فهرست منبع

Merge branch 'master' into crowdin-translation

El RIDO 9 ماه پیش
والد
کامیت
d27d63584f
4فایلهای تغییر یافته به همراه21 افزوده شده و 23 حذف شده
  1. 1 1
      doc/Installation.md
  2. 3 3
      doc/README.md
  3. 4 4
      i18n/uk.json
  4. 13 15
      lib/Data/Filesystem.php

+ 1 - 1
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)

+ 3 - 3
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.

+ 4 - 4
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.": "Помилка проксі: хибна відповідь. Ймовірно, проблема в налаштуваннях: ключі конфігурації можуть бути відсутні або містити одрук.",

+ 13 - 15
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',
-                    '<?php' . PHP_EOL . '$GLOBALS[\'purge_limiter\'] = ' . var_export($value, true) . ';'
-                );
+                $content = '<?php' . PHP_EOL . '$GLOBALS[\'purge_limiter\'] = ' . var_export($value, true) . ';';
+                break;
             case 'salt':
-                return $this->_storeString(
-                    $this->_path . DIRECTORY_SEPARATOR . 'salt.php',
-                    '<?php # |' . $value . '|'
-                );
+                $content = '<?php # |' . $value . '|';
+                break;
             case 'traffic_limiter':
                 $this->_last_cache[$key] = $value;
-                opcache_invalidate($this->_path . DIRECTORY_SEPARATOR . 'traffic_limiter.php');
-                return $this->_storeString(
-                    $this->_path . DIRECTORY_SEPARATOR . 'traffic_limiter.php',
-                    '<?php' . PHP_EOL . '$GLOBALS[\'traffic_limiter\'] = ' . var_export($this->_last_cache, true) . ';'
-                );
+                $content                 = '<?php' . PHP_EOL . '$GLOBALS[\'traffic_limiter\'] = ' . var_export($this->_last_cache, true) . ';';
+                break;
+            default:
+                return false;
         }
-        return false;
+        return $this->_storeString($file, $content);
     }
 
     /**