diff --git a/doc/Installation.md b/doc/Installation.md index f8f97500..36d3365e 100644 --- a/doc/Installation.md +++ b/doc/Installation.md @@ -30,7 +30,7 @@ for more information. ### Optional Requirements - PHP with GD extension (when using identicon or vizhash icons, jdenticon works - without it) + without it) and OPcache (for better performance) - a database supported by [PHP PDO](https://php.net/manual/book.pdo.php) and the PHP PDO extension (when using database storage) - a Ceph cluster with Rados gateway or AWS S3 storage (when using S3 storage) diff --git a/doc/README.md b/doc/README.md index d809cd6b..8ab58404 100644 --- a/doc/README.md +++ b/doc/README.md @@ -4,7 +4,7 @@ Please have a look at these questions *before* opening an issue in this repo. -## [Installation guide](https://github.com/PrivateBin/PrivateBin/blob/master/doc/Installation.md#installation) +## [Installation guide](Installation.md#installation) Minimal requirements, hardening and securing your installation and initial configuration. @@ -26,12 +26,12 @@ How to help translate PrivateBin and technical background on it's implementation Know how for participating in PrivateBins development. -### [Generating Source Code Documentation](https://github.com/PrivateBin/PrivateBin/blob/master/doc/Generating%20Source%20Code%20Documentation.md#generating-source-code-documentation) +### [Generating Source Code Documentation](Generating%20Source%20Code%20Documentation.md#generating-source-code-documentation) How to generate the source code API documentation, as found on the project website for [PHP](https://privatebin.info/codedoc/) and [JS](https://privatebin.info/jsdoc/) -### [Running Unit Tests](https://github.com/PrivateBin/PrivateBin/blob/master/doc/Running Unit Tests.md#running-all-unit-tests) +### [Running Unit Tests](Running%20Unit%20Tests.md#running-all-unit-tests) How to run the PHP & JS unit tests, including a brief introduction to property based unit testing. diff --git a/i18n/uk.json b/i18n/uk.json index 23217c26..45ef2286 100644 --- a/i18n/uk.json +++ b/i18n/uk.json @@ -5,7 +5,7 @@ "Because ignorance is bliss": "Менше знаєш — краще спиш", "Document does not exist, has expired or has been deleted.": "Документ не існує. Можливо, його протерміновано чи видалено.", "%s requires php %s or above to work. Sorry.": "Для роботи %s потрібен php %s чи вище. Вибачте.", - "%s requires configuration section [%s] to be present in configuration file.": "%s потрібна секція [%s] у файлі налаштувань.", + "%s requires configuration section [%s] to be present in configuration file.": "%s потрібна секція [%s] в конфігураційному файлі.", "Please wait %d seconds between each post.": [ "Будь ласка, зачекайте %d секунду між створеннями.", "Будь ласка, зачекайте %d секунди між створеннями.", @@ -36,8 +36,8 @@ "Discussion": "Обговорення", "Toggle navigation": "Перемкнути навігацію", "%d seconds": [ - "%d секунд", - "%d секунд", + "%d секунду", + "%d секунди", "%d секунд", "%d секунд", "%d секунд", @@ -213,7 +213,7 @@ "URL shortener is enabled by default.": "Скорочення посилань типово увімкнено.", "Save document": "Зберегти документ", "Your IP is not authorized to create documents.": "Вашій IP-адресі не дозволено створювати документи.", - "Trying to shorten a URL that isn't pointing at our instance.": "Спроба скоротити URL, який не вказує на наш екземпляр.", + "Trying to shorten a URL that isn't pointing at our instance.": "Спроба скоротити URL, який не вказує на наш сервер.", "Proxy error: Proxy URL is empty. This can be a configuration issue, like wrong or missing config keys.": "Помилка проксі: не вказано URL-адреси проксі. Ймовірно, проблема в налаштуваннях: ключі конфігурації можуть бути відсутні або містити одрук.", "Proxy error: Error parsing proxy response. This can be a configuration issue, like wrong or missing config keys.": "Помилка проксі: не вдається розпізнати відповідь проксі. Ймовірно, проблема в налаштуваннях: ключі конфігурації можуть бути відсутні або містити одрук", "Proxy error: Bad response. This can be a configuration issue, like wrong or missing config keys or a temporary outage.": "Помилка проксі: хибна відповідь. Ймовірно, проблема в налаштуваннях: ключі конфігурації можуть бути відсутні або містити одрук.", diff --git a/lib/Data/Filesystem.php b/lib/Data/Filesystem.php index b6837e26..e4377a9f 100644 --- a/lib/Data/Filesystem.php +++ b/lib/Data/Filesystem.php @@ -267,27 +267,25 @@ class Filesystem extends AbstractData */ public function setValue($value, $namespace, $key = '') { + $file = $this->_path . DIRECTORY_SEPARATOR . $namespace . '.php'; + if (function_exists('opcache_invalidate')) { + opcache_invalidate($file); + } switch ($namespace) { case 'purge_limiter': - opcache_invalidate($this->_path . DIRECTORY_SEPARATOR . 'purge_limiter.php'); - return $this->_storeString( - $this->_path . DIRECTORY_SEPARATOR . 'purge_limiter.php', - '_storeString( - $this->_path . DIRECTORY_SEPARATOR . 'salt.php', - '_last_cache[$key] = $value; - opcache_invalidate($this->_path . DIRECTORY_SEPARATOR . 'traffic_limiter.php'); - return $this->_storeString( - $this->_path . DIRECTORY_SEPARATOR . 'traffic_limiter.php', - '_last_cache, true) . ';' - ); + $content = '_last_cache, true) . ';'; + break; + default: + return false; } - return false; + return $this->_storeString($file, $content); } /**