Просмотр исходного кода

incrementing version, updating changelog, added missing phpdoc comments

El RIDO 10 лет назад
Родитель
Сommit
24a4328c55

+ 13 - 0
CHANGELOG.md

@@ -1,5 +1,18 @@
 # ZeroBin version history #
 
+  * **0.22 (2015-11-09)**:
+    * ADDED: Tab character input support
+    * ADDED: Dark bootstrap theme
+    * ADDED: Option to hide clone button on expiring pastes
+    * ADDED: Option to set a different default language then English and/or enforce it as the only language
+    * ADDED: Database now contains version to allow automatic update of structure, only if necessary; removing database structure check on each request
+    * FIXING: Regressions in database layer, prohibiting pastes from being stored
+    * FIXING: Fixing "missing" comments when they were posted during the same second to the same paste
+    * CHANGED: Switching positions of "New" and "Send" button, highlighting the latter to improve workflow
+    * CHANGED: Renamed config file to make updates easier
+    * CHANGED: Switching to JSON-based REST-API
+    * CHANGED: Database structure to store attachments, allowing larger attachments to be stored (depending on maximum BLOB size of database backend)
+    * CHANGED: Refactored data model, traffic limiting & request handling
   * **0.21.1 (2015-09-21)**:
     * FIXING: lost meta data when using DB model instead of flat files
     * FIXING: mobile navbar getting triggered on load

+ 1 - 1
cfg/conf.ini.sample

@@ -5,7 +5,7 @@
 ; @link      http://sebsauvage.net/wiki/doku.php?id=php:zerobin
 ; @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
 ; @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
-; @version   0.21.1
+; @version   0.22
 
 [main]
 ; enable or disable the discussion feature, defaults to true

+ 1 - 1
css/bootstrap/zerobin.css

@@ -1,4 +1,4 @@
-/* ZeroBin 0.21.1 - http://sebsauvage.net/wiki/doku.php?id=php:zerobin */
+/* ZeroBin 0.22 - http://sebsauvage.net/wiki/doku.php?id=php:zerobin */
 
 
 body {

+ 1 - 1
css/zerobin.css

@@ -1,4 +1,4 @@
-/* ZeroBin 0.21.1 - http://sebsauvage.net/wiki/doku.php?id=php:zerobin */
+/* ZeroBin 0.22 - http://sebsauvage.net/wiki/doku.php?id=php:zerobin */
 
 
 /*  CSS Reset from YUI 3.4.1 (build 4118) - Copyright 2011 Yahoo! Inc. All rights reserved.

+ 2 - 2
js/zerobin.js

@@ -6,7 +6,7 @@
  * @link      http://sebsauvage.net/wiki/doku.php?id=php:zerobin
  * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
  * @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
- * @version   0.21.1
+ * @version   0.22
  */
 
 'use strict';
@@ -583,7 +583,7 @@ $(function() {
                     helper.urls2links(this.clearText);
                     helper.urls2links(this.prettyPrint);
                     this.clearText.addClass('hidden');
-                    if (format == 'plaintext') 
+                    if (format == 'plaintext')
                     {
                         this.prettyPrint.css('white-space', 'pre-wrap');
                         this.prettyPrint.css('word-break', 'normal');

+ 1 - 1
lib/auto.php

@@ -7,7 +7,7 @@
  * @link      http://sebsauvage.net/wiki/doku.php?id=php:zerobin
  * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
  * @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
- * @version   0.21.1
+ * @version   0.22
  */
 
 spl_autoload_register('auto::loader');

+ 1 - 1
lib/configuration.php

@@ -7,7 +7,7 @@
  * @link      http://sebsauvage.net/wiki/doku.php?id=php:zerobin
  * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
  * @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
- * @version   0.21.1
+ * @version   0.22
  */
 
 /**

+ 1 - 1
lib/filter.php

@@ -7,7 +7,7 @@
  * @link      http://sebsauvage.net/wiki/doku.php?id=php:zerobin
  * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
  * @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
- * @version   0.21.1
+ * @version   0.22
  */
 
 /**

+ 1 - 1
lib/i18n.php

@@ -7,7 +7,7 @@
  * @link      http://sebsauvage.net/wiki/doku.php?id=php:zerobin
  * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
  * @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
- * @version   0.21.1
+ * @version   0.22
  */
 
 /**

+ 1 - 1
lib/model.php

@@ -7,7 +7,7 @@
  * @link      http://sebsauvage.net/wiki/doku.php?id=php:zerobin
  * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
  * @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
- * @version   0.21.1
+ * @version   0.22
  */
 
 /**

+ 2 - 1
lib/model/abstract.php

@@ -7,7 +7,7 @@
  * @link      http://sebsauvage.net/wiki/doku.php?id=php:zerobin
  * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
  * @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
- * @version   0.21.1
+ * @version   0.22
  */
 
 /**
@@ -80,6 +80,7 @@ abstract class model_abstract
      * Set ID.
      *
      * @access public
+     * @param string $id
      * @throws Exception
      * @return void
      */

+ 9 - 1
lib/model/comment.php

@@ -7,7 +7,7 @@
  * @link      http://sebsauvage.net/wiki/doku.php?id=php:zerobin
  * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
  * @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
- * @version   0.21.1
+ * @version   0.22
  */
 
 /**
@@ -161,6 +161,14 @@ class model_comment extends model_abstract
         return $this->_data->meta->parentid;
     }
 
+    /**
+     * Set nickname.
+     *
+     * @access public
+     * @param string $nickname
+     * @throws Exception
+     * @return void
+     */
     public function setNickname($nickname)
     {
         if (!sjcl::isValid($nickname)) throw new Exception('Invalid data.', 66);

+ 1 - 1
lib/model/paste.php

@@ -7,7 +7,7 @@
  * @link      http://sebsauvage.net/wiki/doku.php?id=php:zerobin
  * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
  * @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
- * @version   0.21.1
+ * @version   0.22
  */
 
 /**

+ 1 - 1
lib/persistence.php

@@ -7,7 +7,7 @@
  * @link      http://sebsauvage.net/wiki/doku.php?id=php:zerobin
  * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
  * @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
- * @version   0.21.1
+ * @version   0.22
  */
 
 /**

+ 2 - 2
lib/request.php

@@ -7,7 +7,7 @@
  * @link      http://sebsauvage.net/wiki/doku.php?id=php:zerobin
  * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
  * @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
- * @version   0.21.1
+ * @version   0.22
  */
 
 /**
@@ -162,7 +162,7 @@ class request
     /**
      * Override the default input stream source, used for unit testing.
      *
-     * @param unknown $input
+     * @param string $input
      */
     public static function setInputStream($input)
     {

+ 1 - 1
lib/serversalt.php

@@ -7,7 +7,7 @@
  * @link      http://sebsauvage.net/wiki/doku.php?id=php:zerobin
  * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
  * @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
- * @version   0.21.1
+ * @version   0.22
  */
 
 /**

+ 1 - 1
lib/sjcl.php

@@ -7,7 +7,7 @@
  * @link      http://sebsauvage.net/wiki/doku.php?id=php:zerobin
  * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
  * @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
- * @version   0.21.1
+ * @version   0.22
  */
 
 /**

+ 1 - 1
lib/trafficlimiter.php

@@ -7,7 +7,7 @@
  * @link      http://sebsauvage.net/wiki/doku.php?id=php:zerobin
  * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
  * @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
- * @version   0.21.1
+ * @version   0.22
  */
 
 /**

+ 1 - 1
lib/vizhash16x16.php

@@ -8,7 +8,7 @@
  * @link      http://sebsauvage.net/wiki/doku.php?id=php:vizhash_gd
  * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
  * @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
- * @version   0.0.4 beta ZeroBin 0.21.1
+ * @version   0.0.4 beta ZeroBin 0.22
  */
 
 /**

+ 1 - 1
lib/zerobin.php

@@ -7,7 +7,7 @@
  * @link      http://sebsauvage.net/wiki/doku.php?id=php:zerobin
  * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
  * @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
- * @version   0.21.1
+ * @version   0.22
  */
 
 /**

+ 1 - 1
lib/zerobin/abstract.php

@@ -7,7 +7,7 @@
  * @link      http://sebsauvage.net/wiki/doku.php?id=php:zerobin
  * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
  * @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
- * @version   0.21.1
+ * @version   0.22
  */
 
 /**

+ 1 - 1
lib/zerobin/data.php

@@ -7,7 +7,7 @@
  * @link      http://sebsauvage.net/wiki/doku.php?id=php:zerobin
  * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
  * @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
- * @version   0.21.1
+ * @version   0.22
  */
 
 /**

+ 1 - 1
lib/zerobin/db.php

@@ -7,7 +7,7 @@
  * @link      http://sebsauvage.net/wiki/doku.php?id=php:zerobin
  * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net)
  * @license   http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License
- * @version   0.21.1
+ * @version   0.22
  */
 
 /**

+ 4 - 2
tst/configGenerator.php

@@ -463,7 +463,7 @@ class configurationTestGenerator
 /**
  * DO NOT EDIT: This file is generated automatically using configGenerator.php
  */
-class configurationTest extends PHPUnit_Framework_TestCase
+class configurationCombinationsTest extends PHPUnit_Framework_TestCase
 {
     private $_model;
 
@@ -539,6 +539,8 @@ EOT;
             case 'Create':
                 $code .= PHP_EOL . <<<'EOT'
         $_POST = helper::getPaste();
+        $_SERVER['HTTP_X_REQUESTED_WITH'] = 'JSONHttpRequest';
+        $_SERVER['REQUEST_METHOD'] = 'POST';
         $_SERVER['REMOTE_ADDR'] = '::1';
 EOT;
                 break;
@@ -580,7 +582,7 @@ EOT;
         $this->assertTag(
             array(
                 'id' => 'cipherdata',
-                'content' => htmlspecialchars(json_encode(helper::getPaste()), ENT_NOQUOTES)
+                'content' => htmlspecialchars(helper::getPasteAsJson(), ENT_NOQUOTES)
             ),
             $content,
             'outputs data correctly'