diff --git a/server/composer.lock b/server/composer.lock
index 4a3e1ed3..4230cf7d 100644
--- a/server/composer.lock
+++ b/server/composer.lock
@@ -8,16 +8,16 @@
"packages": [
{
"name": "gabordemooij/redbean",
- "version": "v4.2.1",
+ "version": "v4.3",
"source": {
"type": "git",
"url": "https://github.com/gabordemooij/redbean.git",
- "reference": "13610146620d7c0a66215dcaf0c8796bb03a04aa"
+ "reference": "f375a1678d137ca1ff806813fac306723f97ec6b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/gabordemooij/redbean/zipball/13610146620d7c0a66215dcaf0c8796bb03a04aa",
- "reference": "13610146620d7c0a66215dcaf0c8796bb03a04aa",
+ "url": "https://api.github.com/repos/gabordemooij/redbean/zipball/f375a1678d137ca1ff806813fac306723f97ec6b",
+ "reference": "f375a1678d137ca1ff806813fac306723f97ec6b",
"shasum": ""
},
"require": {
@@ -45,7 +45,7 @@
"keywords": [
"orm"
],
- "time": "2015-05-09 12:22:47"
+ "time": "2015-09-11 18:55:25"
},
{
"name": "slim/slim",
@@ -151,16 +151,16 @@
},
{
"name": "myclabs/deep-copy",
- "version": "1.4.0",
+ "version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
- "reference": "d8093b631a31628342d0703764935f8bac2c56b1"
+ "reference": "e3abefcd7f106677fd352cd7c187d6c969aa9ddc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/d8093b631a31628342d0703764935f8bac2c56b1",
- "reference": "d8093b631a31628342d0703764935f8bac2c56b1",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/e3abefcd7f106677fd352cd7c187d6c969aa9ddc",
+ "reference": "e3abefcd7f106677fd352cd7c187d6c969aa9ddc",
"shasum": ""
},
"require": {
@@ -189,7 +189,7 @@
"object",
"object graph"
],
- "time": "2015-10-05 15:07:09"
+ "time": "2015-11-07 22:20:37"
},
{
"name": "phpdocumentor/reflection-docblock",
@@ -302,16 +302,16 @@
},
{
"name": "phpunit/php-code-coverage",
- "version": "3.0.1",
+ "version": "3.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "c84f05be256cd7c9d2340b26f7995b4afbf8787b"
+ "reference": "f7bb5cddf4ffe113eeb737b05241adb947b43f9d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c84f05be256cd7c9d2340b26f7995b4afbf8787b",
- "reference": "c84f05be256cd7c9d2340b26f7995b4afbf8787b",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f7bb5cddf4ffe113eeb737b05241adb947b43f9d",
+ "reference": "f7bb5cddf4ffe113eeb737b05241adb947b43f9d",
"shasum": ""
},
"require": {
@@ -360,7 +360,7 @@
"testing",
"xunit"
],
- "time": "2015-10-06 15:51:05"
+ "time": "2015-11-12 21:08:20"
},
{
"name": "phpunit/php-file-iterator",
@@ -542,16 +542,16 @@
},
{
"name": "phpunit/phpunit",
- "version": "5.0.6",
+ "version": "5.0.9",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "d2656ec378c88e036b3fc14fb4262ee1a25498c9"
+ "reference": "ed084be6b5b912f11c3559e17110f8d8a1e3a8a1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d2656ec378c88e036b3fc14fb4262ee1a25498c9",
- "reference": "d2656ec378c88e036b3fc14fb4262ee1a25498c9",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ed084be6b5b912f11c3559e17110f8d8a1e3a8a1",
+ "reference": "ed084be6b5b912f11c3559e17110f8d8a1e3a8a1",
"shasum": ""
},
"require": {
@@ -612,20 +612,20 @@
"testing",
"xunit"
],
- "time": "2015-10-14 13:51:20"
+ "time": "2015-11-10 21:47:43"
},
{
"name": "phpunit/phpunit-mock-objects",
- "version": "3.0.3",
+ "version": "3.0.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
- "reference": "382c729a52b7ef682e94c73fd6868f5ee8116ba7"
+ "reference": "b28b029356e65091dfbf8c2bc4ef106ffece509e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/382c729a52b7ef682e94c73fd6868f5ee8116ba7",
- "reference": "382c729a52b7ef682e94c73fd6868f5ee8116ba7",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/b28b029356e65091dfbf8c2bc4ef106ffece509e",
+ "reference": "b28b029356e65091dfbf8c2bc4ef106ffece509e",
"shasum": ""
},
"require": {
@@ -668,7 +668,7 @@
"mock",
"xunit"
],
- "time": "2015-10-18 07:55:54"
+ "time": "2015-11-09 15:37:17"
},
{
"name": "sebastian/comparator",
@@ -1085,24 +1085,21 @@
},
{
"name": "symfony/yaml",
- "version": "v2.7.5",
+ "version": "v2.7.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770"
+ "reference": "eca9019c88fbe250164affd107bc8057771f3f4d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/31cb2ad0155c95b88ee55fe12bc7ff92232c1770",
- "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/eca9019c88fbe250164affd107bc8057771f3f4d",
+ "reference": "eca9019c88fbe250164affd107bc8057771f3f4d",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
- "require-dev": {
- "symfony/phpunit-bridge": "~2.7"
- },
"type": "library",
"extra": {
"branch-alias": {
@@ -1130,7 +1127,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
- "time": "2015-09-14 14:14:09"
+ "time": "2015-10-11 09:39:48"
}
],
"aliases": [],
diff --git a/server/vendor/autoload.php b/server/vendor/autoload.php
index 0ef0cb4f..92d6189a 100644
--- a/server/vendor/autoload.php
+++ b/server/vendor/autoload.php
@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
-return ComposerAutoloaderInita2f433ace6603da0dacbae24a9d70062::getLoader();
+return ComposerAutoloaderInitc1131bbfb8e9acff5fc8b79d0d7d1f64::getLoader();
diff --git a/server/vendor/composer/autoload_real.php b/server/vendor/composer/autoload_real.php
index 628d0669..d264186e 100644
--- a/server/vendor/composer/autoload_real.php
+++ b/server/vendor/composer/autoload_real.php
@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
-class ComposerAutoloaderInita2f433ace6603da0dacbae24a9d70062
+class ComposerAutoloaderInitc1131bbfb8e9acff5fc8b79d0d7d1f64
{
private static $loader;
@@ -19,9 +19,9 @@ class ComposerAutoloaderInita2f433ace6603da0dacbae24a9d70062
return self::$loader;
}
- spl_autoload_register(array('ComposerAutoloaderInita2f433ace6603da0dacbae24a9d70062', 'loadClassLoader'), true, true);
+ spl_autoload_register(array('ComposerAutoloaderInitc1131bbfb8e9acff5fc8b79d0d7d1f64', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
- spl_autoload_unregister(array('ComposerAutoloaderInita2f433ace6603da0dacbae24a9d70062', 'loadClassLoader'));
+ spl_autoload_unregister(array('ComposerAutoloaderInitc1131bbfb8e9acff5fc8b79d0d7d1f64', 'loadClassLoader'));
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
@@ -44,7 +44,7 @@ class ComposerAutoloaderInita2f433ace6603da0dacbae24a9d70062
}
}
-function composerRequirea2f433ace6603da0dacbae24a9d70062($file)
+function composerRequirec1131bbfb8e9acff5fc8b79d0d7d1f64($file)
{
require $file;
}
diff --git a/server/vendor/composer/installed.json b/server/vendor/composer/installed.json
index 07d748f6..a426272b 100644
--- a/server/vendor/composer/installed.json
+++ b/server/vendor/composer/installed.json
@@ -48,18 +48,61 @@
]
},
{
- "name": "myclabs/deep-copy",
- "version": "1.4.0",
- "version_normalized": "1.4.0.0",
+ "name": "gabordemooij/redbean",
+ "version": "v4.3",
+ "version_normalized": "4.3.0.0",
"source": {
"type": "git",
- "url": "https://github.com/myclabs/DeepCopy.git",
- "reference": "d8093b631a31628342d0703764935f8bac2c56b1"
+ "url": "https://github.com/gabordemooij/redbean.git",
+ "reference": "f375a1678d137ca1ff806813fac306723f97ec6b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/d8093b631a31628342d0703764935f8bac2c56b1",
- "reference": "d8093b631a31628342d0703764935f8bac2c56b1",
+ "url": "https://api.github.com/repos/gabordemooij/redbean/zipball/f375a1678d137ca1ff806813fac306723f97ec6b",
+ "reference": "f375a1678d137ca1ff806813fac306723f97ec6b",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.4"
+ },
+ "time": "2015-09-11 18:55:25",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "RedBeanPHP\\": "RedBeanPHP"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "New BSD and GPLv2"
+ ],
+ "authors": [
+ {
+ "name": "Gabor de Mooij",
+ "email": "gabor@redbeanphp.com",
+ "homepage": "http://redbeanphp.com"
+ }
+ ],
+ "description": "RedBeanPHP ORM",
+ "homepage": "http://redbeanphp.com/",
+ "keywords": [
+ "orm"
+ ]
+ },
+ {
+ "name": "myclabs/deep-copy",
+ "version": "1.5.0",
+ "version_normalized": "1.5.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/myclabs/DeepCopy.git",
+ "reference": "e3abefcd7f106677fd352cd7c187d6c969aa9ddc"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/e3abefcd7f106677fd352cd7c187d6c969aa9ddc",
+ "reference": "e3abefcd7f106677fd352cd7c187d6c969aa9ddc",
"shasum": ""
},
"require": {
@@ -69,7 +112,7 @@
"doctrine/collections": "1.*",
"phpunit/phpunit": "~4.1"
},
- "time": "2015-10-05 15:07:09",
+ "time": "2015-11-07 22:20:37",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -522,26 +565,23 @@
},
{
"name": "symfony/yaml",
- "version": "v2.7.5",
- "version_normalized": "2.7.5.0",
+ "version": "v2.7.6",
+ "version_normalized": "2.7.6.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770"
+ "reference": "eca9019c88fbe250164affd107bc8057771f3f4d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/31cb2ad0155c95b88ee55fe12bc7ff92232c1770",
- "reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/eca9019c88fbe250164affd107bc8057771f3f4d",
+ "reference": "eca9019c88fbe250164affd107bc8057771f3f4d",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
- "require-dev": {
- "symfony/phpunit-bridge": "~2.7"
- },
- "time": "2015-09-14 14:14:09",
+ "time": "2015-10-11 09:39:48",
"type": "library",
"extra": {
"branch-alias": {
@@ -785,17 +825,17 @@
},
{
"name": "phpunit/phpunit-mock-objects",
- "version": "3.0.3",
- "version_normalized": "3.0.3.0",
+ "version": "3.0.4",
+ "version_normalized": "3.0.4.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
- "reference": "382c729a52b7ef682e94c73fd6868f5ee8116ba7"
+ "reference": "b28b029356e65091dfbf8c2bc4ef106ffece509e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/382c729a52b7ef682e94c73fd6868f5ee8116ba7",
- "reference": "382c729a52b7ef682e94c73fd6868f5ee8116ba7",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/b28b029356e65091dfbf8c2bc4ef106ffece509e",
+ "reference": "b28b029356e65091dfbf8c2bc4ef106ffece509e",
"shasum": ""
},
"require": {
@@ -810,7 +850,7 @@
"suggest": {
"ext-soap": "*"
},
- "time": "2015-10-18 07:55:54",
+ "time": "2015-11-09 15:37:17",
"type": "library",
"extra": {
"branch-alias": {
@@ -986,17 +1026,17 @@
},
{
"name": "phpunit/php-code-coverage",
- "version": "3.0.1",
- "version_normalized": "3.0.1.0",
+ "version": "3.0.2",
+ "version_normalized": "3.0.2.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "c84f05be256cd7c9d2340b26f7995b4afbf8787b"
+ "reference": "f7bb5cddf4ffe113eeb737b05241adb947b43f9d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c84f05be256cd7c9d2340b26f7995b4afbf8787b",
- "reference": "c84f05be256cd7c9d2340b26f7995b4afbf8787b",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f7bb5cddf4ffe113eeb737b05241adb947b43f9d",
+ "reference": "f7bb5cddf4ffe113eeb737b05241adb947b43f9d",
"shasum": ""
},
"require": {
@@ -1016,7 +1056,7 @@
"ext-xdebug": ">=2.2.1",
"ext-xmlwriter": "*"
},
- "time": "2015-10-06 15:51:05",
+ "time": "2015-11-12 21:08:20",
"type": "library",
"extra": {
"branch-alias": {
@@ -1050,17 +1090,17 @@
},
{
"name": "phpunit/phpunit",
- "version": "5.0.6",
- "version_normalized": "5.0.6.0",
+ "version": "5.0.9",
+ "version_normalized": "5.0.9.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "d2656ec378c88e036b3fc14fb4262ee1a25498c9"
+ "reference": "ed084be6b5b912f11c3559e17110f8d8a1e3a8a1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d2656ec378c88e036b3fc14fb4262ee1a25498c9",
- "reference": "d2656ec378c88e036b3fc14fb4262ee1a25498c9",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ed084be6b5b912f11c3559e17110f8d8a1e3a8a1",
+ "reference": "ed084be6b5b912f11c3559e17110f8d8a1e3a8a1",
"shasum": ""
},
"require": {
@@ -1089,7 +1129,7 @@
"suggest": {
"phpunit/php-invoker": "~1.1"
},
- "time": "2015-10-14 13:51:20",
+ "time": "2015-11-10 21:47:43",
"bin": [
"phpunit"
],
@@ -1123,48 +1163,5 @@
"testing",
"xunit"
]
- },
- {
- "name": "gabordemooij/redbean",
- "version": "v4.2.1",
- "version_normalized": "4.2.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/gabordemooij/redbean.git",
- "reference": "13610146620d7c0a66215dcaf0c8796bb03a04aa"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/gabordemooij/redbean/zipball/13610146620d7c0a66215dcaf0c8796bb03a04aa",
- "reference": "13610146620d7c0a66215dcaf0c8796bb03a04aa",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.4"
- },
- "time": "2015-05-09 12:22:47",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "RedBeanPHP\\": "RedBeanPHP"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "New BSD and GPLv2"
- ],
- "authors": [
- {
- "name": "Gabor de Mooij",
- "email": "gabor@redbeanphp.com",
- "homepage": "http://redbeanphp.com"
- }
- ],
- "description": "RedBeanPHP ORM",
- "homepage": "http://redbeanphp.com/",
- "keywords": [
- "orm"
- ]
}
]
diff --git a/server/vendor/gabordemooij/redbean/README.markdown b/server/vendor/gabordemooij/redbean/README.markdown
index 36f9a816..df47f4d9 100755
--- a/server/vendor/gabordemooij/redbean/README.markdown
+++ b/server/vendor/gabordemooij/redbean/README.markdown
@@ -9,6 +9,22 @@ RedBeanPHP is an easy to use ORM tool for PHP.
* No configuration, just fire and forget
* No complicated package tools, no autoloaders, just ONE file
+Installation via Composer
+-------------------------
+
+Just open your composer.json file and add the package name ```(e.g. "gabordemooij/redbean": "dev-master")``` in your require list.
+
+```json
+{
+ "require": {
+ "gabordemooij/redbean": "dev-master"
+ }
+}
+```
+
+If you not using composer then [try it.](http://redbeanphp.com/install)
+
+
Quick Example
-------------
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/Adapter.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/Adapter.php
index 234cb1ad..fbef8f1c 100755
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/Adapter.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/Adapter.php
@@ -1,4 +1,4 @@
-oodb->isFrozen() || !$this->writer->sqlStateIn( $exception->getSQLState(),
array(
@@ -74,9 +67,6 @@ class AssociationManager extends Observable
* @param array $bindings bindings for query
*
* @return array
- *
- * @throws Security
- * @throws SQL
*/
private function relatedRows( $bean, $type, $sql = '', $bindings = array() )
{
@@ -100,8 +90,6 @@ class AssociationManager extends Observable
* @param OODBBean $bean2 second bean
* @param OODBBean $bean base bean (association record)
*
- * @throws\Exception|SQL
- *
* @return mixed
*/
protected function associateBeans( OODBBean $bean1, OODBBean $bean2, OODBBean $bean )
@@ -174,7 +162,7 @@ class AssociationManager extends Observable
* This method will associate two beans and store the connection between the
* two in a link table. Instead of two single beans this method also accepts
* two sets of beans. Returns the ID or the IDs of the linking beans.
- *
+ *
* @param OODBBean|array $beans1 one or more beans to form the association
* @param OODBBean|array $beans2 one or more beans to form the association
*
@@ -209,13 +197,11 @@ class AssociationManager extends Observable
* SQL snippet for additional filtering.
*
* @param OODBBean|array $bean a bean object or an array of beans
- * @param string $type type of bean you're interested in
- * @param string $sql SQL snippet (optional)
- * @param array $bindings bindings for your SQL string
+ * @param string $type type of bean you're interested in
+ * @param string $sql SQL snippet (optional)
+ * @param array $bindings bindings for your SQL string
*
* @return integer
- *
- * @throws Security
*/
public function relatedCount( $bean, $type, $sql = NULL, $bindings = array() )
{
@@ -249,9 +235,9 @@ class AssociationManager extends Observable
* set to boolean TRUE this method will remove the beans without their consent,
* bypassing FUSE. This can be used to improve performance.
*
- * @param OODBBean $bean1 first bean
- * @param OODBBean $bean2 second bean
- * @param boolean $fast If TRUE, removes the entries by query without FUSE
+ * @param OODBBean $bean1 first bean in target association
+ * @param OODBBean $bean2 second bean in target association
+ * @param boolean $fast if TRUE, removes the entries by query without FUSE
*
* @return void
*/
@@ -299,7 +285,7 @@ class AssociationManager extends Observable
* with unassociate() instead. (that might be slower though)
*
* @param OODBBean $bean reference bean
- * @param string $type type of beans that need to be unassociated
+ * @param string $type type of beans that need to be unassociated
*
* @return void
*/
@@ -328,11 +314,10 @@ class AssociationManager extends Observable
* Since 3.2, you can now also pass an array of beans instead just one
* bean as the first parameter.
*
- * @param OODBBean|array $bean the bean you have
- * @param string $type the type of beans you want
- * @param string $sql SQL snippet for extra filtering
- * @param array $bindings values to be inserted in SQL slots
- * @param boolean $glue whether the SQL should be prefixed with WHERE
+ * @param OODBBean|array $bean the bean you have
+ * @param string $type the type of beans you want
+ * @param string $sql SQL snippet for extra filtering
+ * @param array $bindings values to be inserted in SQL slots
*
* @return array
*/
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/BeanCollection.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/BeanCollection.php
index cad1aafa..25ab5017 100644
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/BeanCollection.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/BeanCollection.php
@@ -44,10 +44,10 @@ class BeanCollection
* @var string
*/
protected $type = NULL;
-
+
/**
* Constructor, creates a new instance of the BeanCollection.
- *
+ *
* @param string $type type of beans in this collection
* @param Repository $repository repository to use to generate bean objects
* @param Cursor $cursor cursor object to use
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/BeanHelper.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/BeanHelper.php
index 3e28dbe8..867bc978 100755
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/BeanHelper.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/BeanHelper.php
@@ -7,7 +7,7 @@ use RedBeanPHP\OODBBean as OODBBean;
/**
* Bean Helper Interface.
- *
+ *
* Interface for Bean Helper.
* A little bolt that glues the whole machinery together.
*
@@ -28,7 +28,7 @@ interface BeanHelper
* as such the bean is a proxy for OODB. This allows beans to implement
* their magic getters and setters and return lists.
*
- * @return ToolBox $toolbox toolbox
+ * @return ToolBox
*/
public function getToolbox();
@@ -46,9 +46,9 @@ interface BeanHelper
* Given a certain bean this method will
* return the corresponding model.
*
- * @param OODBBean $bean
+ * @param OODBBean $bean bean to obtain the corresponding model of
*
- * @return object
+ * @return SimpleModel|CustomModel
*/
public function getModelForBean( OODBBean $bean );
}
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/BeanHelper/SimpleFacadeBeanHelper.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/BeanHelper/SimpleFacadeBeanHelper.php
index ebfeac12..4be2e6fa 100755
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/BeanHelper/SimpleFacadeBeanHelper.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/BeanHelper/SimpleFacadeBeanHelper.php
@@ -50,11 +50,11 @@ class SimpleFacadeBeanHelper implements BeanHelper
* Sets the factory function to create the model when using FUSE
* to connect a bean to a model.
*
- * @param closure $factory
+ * @param closure $factory factory function
*
* @return void
*/
- public static function setFactoryFunction( $factory )
+ public static function setFactoryFunction( $factory )
{
self::$factory = $factory;
}
@@ -86,7 +86,7 @@ class SimpleFacadeBeanHelper implements BeanHelper
if ( !class_exists( $modelName ) ) {
//second try
$modelName = $prefix . ucfirst( $model );
-
+
if ( !class_exists( $modelName ) ) {
return NULL;
}
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/Driver.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/Driver.php
index 618d4ab1..befd7b1e 100755
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/Driver.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/Driver.php
@@ -1,4 +1,4 @@
-123) will bind the integer 123 to the key :key in the
* SQL. This method has no return value.
*
- * @param string $sql SQL Code to execute
+ * @param string $sql SQL query to execute
* @param array $bindings list of values to bind to SQL snippet
*
* @return array Affected Rows
@@ -106,8 +106,8 @@ interface Driver
/**
* Returns a cursor-like object from the database.
*
- * @param string $sql SQL code to execute
- * @param array $bindings Bindings
+ * @param string $sql SQL query to execute
+ * @param array $bindings list of values to bind to SQL snippet
*
* @return mixed
*/
@@ -120,11 +120,12 @@ interface Driver
* passes on to the screen for inspection.
* This method has no return value.
*
- * @param boolean $trueFalse turn on/off
+ * @param boolean $tf TRUE = debug mode ON
+ * @param Logger $customLogger
*
* @return void
*/
- public function setDebugMode( $tf );
+ public function setDebugMode( $tf, $customLogger );
/**
* Starts a transaction.
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/Driver/RPDO.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/Driver/RPDO.php
index 3063af16..10339865 100755
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/Driver/RPDO.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/Driver/RPDO.php
@@ -130,9 +130,9 @@ class RPDO implements Driver
*
* @param string $sql the SQL string to be send to database server
* @param array $bindings the values that need to get bound to the query slots
+ * @param array $options
*
- * @return void
- *
+ * @return mixed
* @throws SQL
*/
protected function runQuery( $sql, $bindings, $options = array() )
@@ -168,7 +168,7 @@ class RPDO implements Driver
} else {
$this->resultArray = array();
}
- } catch (\PDOException $e ) {
+ } catch ( \PDOException $e ) {
//Unfortunately the code field is supposed to be int by default (php)
//So we need a property to convey the SQL State code.
$err = $e->getMessage();
@@ -184,11 +184,13 @@ class RPDO implements Driver
* MySQL < 5.5 does not support proper 4 byte unicode but they
* seem to have added it with version 5.5 under a different label: utf8mb4.
* We try to select the best possible charset based on your version data.
+ *
+ * @return void
*/
protected function setEncoding()
{
- $driver = $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME );
- $version = floatval( $this->pdo->getAttribute(\PDO::ATTR_SERVER_VERSION ) );
+ $driver = $this->pdo->getAttribute( \PDO::ATTR_DRIVER_NAME );
+ $version = floatval( $this->pdo->getAttribute( \PDO::ATTR_SERVER_VERSION ) );
if ($driver === 'mysql') {
$encoding = ($version >= 5.5) ? 'utf8mb4' : 'utf8';
$this->pdo->setAttribute(\PDO::MYSQL_ATTR_INIT_COMMAND, 'SET NAMES '.$encoding ); //on every re-connect
@@ -205,10 +207,11 @@ class RPDO implements Driver
* $driver = new RPDO($dsn, $user, $password);
* $driver = new RPDO($existingConnection);
*
- * @param string|object $dsn database connection string
- * @param string $user optional, usename to sign in
- * @param string $pass optional, password for connection login
+ * @param string|object $dsn database connection string
+ * @param string $user optional, usename to sign in
+ * @param string $pass optional, password for connection login
*
+ * @return void
*/
public function __construct( $dsn, $user = NULL, $pass = NULL )
{
@@ -216,8 +219,8 @@ class RPDO implements Driver
$this->pdo = $dsn;
$this->isConnected = TRUE;
$this->setEncoding();
- $this->pdo->setAttribute(\PDO::ATTR_ERRMODE,\PDO::ERRMODE_EXCEPTION );
- $this->pdo->setAttribute(\PDO::ATTR_DEFAULT_FETCH_MODE,\PDO::FETCH_ASSOC );
+ $this->pdo->setAttribute( \PDO::ATTR_ERRMODE,\PDO::ERRMODE_EXCEPTION );
+ $this->pdo->setAttribute( \PDO::ATTR_DEFAULT_FETCH_MODE,\PDO::FETCH_ASSOC );
// make sure that the dsn at least contains the type
$this->dsn = $this->getDatabaseType();
} else {
@@ -286,8 +289,6 @@ class RPDO implements Driver
* UTF8 for the database and PDO-ERRMODE-EXCEPTION as well as
* PDO-FETCH-ASSOC.
*
- * @throws\PDOException
- *
* @return void
*/
public function connect()
@@ -531,7 +532,7 @@ class RPDO implements Driver
/**
* Returns the version number of the database.
*
- * @return mixed $version version number of the database
+ * @return mixed
*/
public function getDatabaseVersion()
{
@@ -551,7 +552,7 @@ class RPDO implements Driver
}
/**
- * Closes database connection by destructing\PDO.
+ * Closes database connection by destructing PDO.
*
* @return void
*/
@@ -562,7 +563,7 @@ class RPDO implements Driver
}
/**
- * Returns TRUE if the current\PDO instance is connected.
+ * Returns TRUE if the current PDO instance is connected.
*
* @return boolean
*/
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/DuplicationManager.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/DuplicationManager.php
index e2d8e174..d816796f 100644
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/DuplicationManager.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/DuplicationManager.php
@@ -278,11 +278,15 @@ class DuplicationManager
*
* This method allows two array formats:
*
+ *
* array( TABLE1, TABLE2 ... )
+ *
*
* or
*
+ *
* array( TABLE1 => array( COLUMN1, COLUMN2 ... ) ... )
+ *
*
* @param array $tables a table cache array
*
@@ -335,6 +339,8 @@ class DuplicationManager
* the default behavior.
*
* @param array $filters list of tables to be filtered
+ *
+ * @return void
*/
public function setFilters( $filters )
{
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/Facade.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/Facade.php
index f3888af3..2232331e 100755
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/Facade.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/Facade.php
@@ -2,35 +2,29 @@
namespace RedBeanPHP;
-use RedBeanPHP\ToolBox as ToolBox;
-use RedBeanPHP\OODB as OODB;
use RedBeanPHP\QueryWriter as QueryWriter;
use RedBeanPHP\Adapter\DBAdapter as DBAdapter;
-use RedBeanPHP\AssociationManager as AssociationManager;
-use RedBeanPHP\TagManager as TagManager;
-use RedBeanPHP\DuplicationManager as DuplicationManager;
-use RedBeanPHP\LabelMaker as LabelMaker;
-use RedBeanPHP\Finder as Finder;
use RedBeanPHP\RedException\SQL as SQLException;
-use RedBeanPHP\RedException\Security as Security;
use RedBeanPHP\Logger as Logger;
use RedBeanPHP\Logger\RDefault as RDefault;
use RedBeanPHP\Logger\RDefault\Debug as Debug;
-use RedBeanPHP\OODBBean as OODBBean;
-use RedBeanPHP\SimpleModel as SimpleModel;
-use RedBeanPHP\SimpleModelHelper as SimpleModelHelper;
use RedBeanPHP\Adapter as Adapter;
use RedBeanPHP\QueryWriter\AQueryWriter as AQueryWriter;
use RedBeanPHP\RedException as RedException;
use RedBeanPHP\BeanHelper\SimpleFacadeBeanHelper as SimpleFacadeBeanHelper;
use RedBeanPHP\Driver\RPDO as RPDO;
+use RedBeanPHP\Util\MultiLoader as MultiLoader;
+use RedBeanPHP\Util\Transaction as Transaction;
+use RedBeanPHP\Util\Dump as Dump;
+use RedBeanPHP\Util\DispenseHelper as DispenseHelper;
+use RedBeanPHP\Util\ArrayTool as ArrayTool;
/**
* RedBean Facade
*
* Version Information
- * RedBean Version @version 4.2
- *
+ * RedBean Version @version 4.3
+ *
* This class hides the object landscape of
* RedBeanPHP behind a single letter class providing
* almost all functionality with simple static calls.
@@ -49,7 +43,7 @@ class Facade
/**
* RedBeanPHP version constant.
*/
- const C_REDBEANPHP_VERSION = '4.2';
+ const C_REDBEANPHP_VERSION = '4.3';
/**
* @var ToolBox
@@ -110,7 +104,7 @@ class Facade
* @var string
*/
private static $exportCaseStyle = 'default';
-
+
/**
* Not in use (backward compatibility SQLHelper)
*/
@@ -130,8 +124,6 @@ class Facade
* Internal Query function, executes the desired query. Used by
* all facade query functions. This keeps things DRY.
*
- * @throws SQL
- *
* @param string $method desired query method (i.e. 'cell', 'col', 'exec' etc..)
* @param string $sql the sql you want to execute
* @param array $bindings array of values to be bound to query statement
@@ -231,62 +223,38 @@ class Facade
}
/**
- * Starts a transaction within a closure (or other valid callback).
- * If an\Exception is thrown inside, the operation is automatically rolled back.
- * If no\Exception happens, it commits automatically.
+ * Wraps a transaction around a closure or string callback.
+ * If an Exception is thrown inside, the operation is automatically rolled back.
+ * If no Exception happens, it commits automatically.
* It also supports (simulated) nested transactions (that is useful when
* you have many methods that needs transactions but are unaware of
* each other).
- * ex:
- * $from = 1;
- * $to = 2;
- * $amount = 300;
*
- * R::transaction(function() use($from, $to, $amount)
- * {
- * $accountFrom = R::load('account', $from);
- * $accountTo = R::load('account', $to);
+ * Example:
*
- * $accountFrom->money -= $amount;
- * $accountTo->money += $amount;
+ *
+ * $from = 1;
+ * $to = 2;
+ * $amount = 300;
*
- * R::store($accountFrom);
- * R::store($accountTo);
- * });
+ * R::transaction(function() use($from, $to, $amount)
+ * {
+ * $accountFrom = R::load('account', $from);
+ * $accountTo = R::load('account', $to);
+ * $accountFrom->money -= $amount;
+ * $accountTo->money += $amount;
+ * R::store($accountFrom);
+ * R::store($accountTo);
+ * });
+ *
*
* @param callable $callback Closure (or other callable) with the transaction logic
*
- * @throws Security
- *
* @return mixed
- *
*/
public static function transaction( $callback )
{
- if ( !is_callable( $callback ) ) {
- throw new RedException( 'R::transaction needs a valid callback.' );
- }
-
- static $depth = 0;
- $result = null;
- try {
- if ( $depth == 0 ) {
- self::begin();
- }
- $depth++;
- $result = call_user_func( $callback ); //maintain 5.2 compatibility
- $depth--;
- if ( $depth == 0 ) {
- self::commit();
- }
- } catch (\Exception $exception ) {
- $depth--;
- if ( $depth == 0 ) {
- self::rollback();
- }
- throw $exception;
- }
- return $result;
+ return Transaction::transaction( self::$adapter, $callback );
}
/**
@@ -295,8 +263,10 @@ class Facade
*
* Usage:
*
+ *
* R::addDatabase( 'database-1', 'sqlite:/tmp/db1.txt' );
* R::selectDatabase( 'database-1' ); //to select database again
+ *
*
* This method allows you to dynamically add (and select) new databases
* to the facade. Adding a database with the same key will cause an exception.
@@ -325,16 +295,19 @@ class Facade
$adapter = new DBAdapter( $db );
- $writers = array(
- 'pgsql' => 'PostgreSQL',
- 'sqlite' => 'SQLiteT',
- 'cubrid' => 'CUBRID',
- 'mysql' => 'MySQL',
- 'sqlsrv' => 'SQLServer',
- );
+ $writers = array(
+ 'pgsql' => 'PostgreSQL',
+ 'sqlite' => 'SQLiteT',
+ 'cubrid' => 'CUBRID',
+ 'mysql' => 'MySQL',
+ 'sqlsrv' => 'SQLServer',
+ );
$wkey = trim( strtolower( $dbType ) );
- if ( !isset( $writers[$wkey] ) ) trigger_error( 'Unsupported DSN: '.$wkey );
+ if ( !isset( $writers[$wkey] ) ) {
+ $wkey = preg_replace( '/\W/', '' , $wkey );
+ throw new RedException( 'Unsupported database ('.$wkey.').' );
+ }
$writerClass = '\\RedBeanPHP\\QueryWriter\\'.$writers[$wkey];
$writer = new $writerClass( $adapter );
$redbean = new OODB( $writer, $frozen );
@@ -362,6 +335,10 @@ class Facade
return FALSE;
}
+ if ( !isset( self::$toolboxes[$key] ) ) {
+ throw new RedException( 'Database not found in registry. Add database using R::addDatabase().' );
+ }
+
self::configureFacadeWithToolbox( self::$toolboxes[$key] );
self::$currentDB = $key;
@@ -379,9 +356,8 @@ class Facade
* @param boolean $tf debug mode (true or false)
* @param integer $mode (0 = to STDOUT, 1 = to ARRAY)
*
- * @throws Security
- *
* @return RDefault
+ * @throws RedException
*/
public static function debug( $tf = TRUE, $mode = 0 )
{
@@ -450,8 +426,6 @@ class Facade
* @param OODBBean|SimpleModel $bean bean to store
*
* @return integer|string
- *
- * @throws Security
*/
public static function store( $bean )
{
@@ -480,28 +454,16 @@ class Facade
* for loading a one-to-one relation.
*
* Usage:
- * list($author, $bio) = R::load('author, bio', $id);
+ * list( $author, $bio ) = R::loadMulti( 'author, bio', $id );
*
- * @param string|array $types
- * @param mixed $id
+ * @param string|array $types the set of types to load at once
+ * @param mixed $id the common ID
*
* @return OODBBean
*/
public static function loadMulti( $types, $id )
{
- if ( is_string( $types ) ) {
- $types = explode( ',', $types );
- }
-
- if ( !is_array( $types ) ) {
- return array();
- }
-
- foreach ( $types as $k => $typeItem ) {
- $types[$k] = self::$redbean->load( $typeItem, $id );
- }
-
- return $types;
+ return MultiLoader::load( self::$redbean, $types, $id );
}
/**
@@ -524,8 +486,6 @@ class Facade
* @param string $type type of bean you want to load
* @param integer $id ID of the bean you want to load
*
- * @throws SQL
- *
* @return OODBBean
*/
public static function load( $type, $id )
@@ -543,7 +503,7 @@ class Facade
* and THEN trash it.
*
* @param string|OODBBean|SimpleModel $bean bean you want to remove from database
- * @param integer $id (optional)
+ * @param integer $id ID if the bean to trash (optional, type-id variant only)
*
* @return void
*/
@@ -559,41 +519,13 @@ class Facade
*
* @param string|array $typeOrBeanArray type or bean array to import
* @param integer $number number of beans to dispense
- * @param boolean $alwaysReturnArray if TRUE always returns the result as an array
+ * @param boolean $alwaysReturnArray if TRUE always returns the result as an array
*
* @return array|OODBBean
- *
- * @throws Security
*/
public static function dispense( $typeOrBeanArray, $num = 1, $alwaysReturnArray = FALSE )
{
- if ( is_array($typeOrBeanArray) ) {
-
- if ( !isset( $typeOrBeanArray['_type'] ) ) {
- $list = array();
- foreach( $typeOrBeanArray as $beanArray ) if ( !( is_array( $beanArray ) && isset( $beanArray['_type'] ) ) ) throw new RedException( 'Invalid Array Bean' );
- foreach( $typeOrBeanArray as $beanArray ) $list[] = self::dispense( $beanArray );
- return $list;
- }
-
- $import = $typeOrBeanArray;
- $type = $import['_type'];
- unset( $import['_type'] );
- } else {
- $type = $typeOrBeanArray;
- }
-
- if ( !preg_match( '/^[a-z0-9]+$/', $type ) ) {
- throw new RedException( 'Invalid type: ' . $type );
- }
-
- $beanOrBeans = self::$redbean->dispense( $type, $num, $alwaysReturnArray );
-
- if ( isset( $import ) ) {
- $beanOrBeans->import( $import );
- }
-
- return $beanOrBeans;
+ return DispenseHelper::dispense( self::$redbean, $typeOrBeanArray, $num, $alwaysReturnArray );
}
/**
@@ -603,14 +535,18 @@ class Facade
*
* Usage:
*
- * list($book, $page, $text) = R::dispenseAll('book,page,text');
+ *
+ * list( $book, $page, $text ) = R::dispenseAll( 'book,page,text' );
+ *
*
* This will dispense a book, a page and a text. This way you can
* quickly dispense beans of various types in just one line of code.
*
* Usage:
*
+ *
* list($book, $pages) = R::dispenseAll('book,page*100');
+ *
*
* This returns an array with a book bean and then another array
* containing 100 page beans.
@@ -622,21 +558,7 @@ class Facade
*/
public static function dispenseAll( $order, $onlyArrays = FALSE )
{
-
- $list = array();
-
- foreach( explode( ',', $order ) as $order ) {
- if ( strpos( $order, '*' ) !== false ) {
- list( $type, $amount ) = explode( '*', $order );
- } else {
- $type = $order;
- $amount = 1;
- }
-
- $list[] = self::dispense( $type, $amount, $onlyArrays );
- }
-
- return $list;
+ return DispenseHelper::dispenseAll( self::$redbean, $order, $onlyArrays );
}
/**
@@ -661,9 +583,9 @@ class Facade
* array parameter; you can either use the question mark notation
* or the slot-notation (:keyname).
*
- * @param string $type type the type of bean you are looking for
- * @param string $sql sql SQL query to find the desired bean, starting right after WHERE clause
- * @param array $bindings values array of values to be bound to parameters in query
+ * @param string $type the type of bean you are looking for
+ * @param string $sql SQL query to find the desired bean, starting right after WHERE clause
+ * @param array $bindings array of values to be bound to parameters in query
*
* @return array
*/
@@ -681,9 +603,9 @@ class Facade
*
* Your SQL does not have to start with a valid WHERE-clause condition.
*
- * @param string $type type the type of bean you are looking for
- * @param string $sql sql SQL query to find the desired bean, starting right after WHERE clause
- * @param array $bindings values array of values to be bound to parameters in query
+ * @param string $type the type of bean you are looking for
+ * @param string $sql SQL query to find the desired bean, starting right after WHERE clause
+ * @param array $bindings array of values to be bound to parameters in query
*
* @return array
*/
@@ -696,9 +618,9 @@ class Facade
* @see Facade::find
* The variation also exports the beans (i.e. it returns arrays).
*
- * @param string $type type the type of bean you are looking for
- * @param string $sql sql SQL query to find the desired bean, starting right after WHERE clause
- * @param array $bindings values array of values to be bound to parameters in query
+ * @param string $type the type of bean you are looking for
+ * @param string $sql SQL query to find the desired bean, starting right after WHERE clause
+ * @param array $bindings array of values to be bound to parameters in query
*
* @return array
*/
@@ -711,9 +633,9 @@ class Facade
* @see Facade::find
* This variation returns the first bean only.
*
- * @param string $type type the type of bean you are looking for
- * @param string $sql sql SQL query to find the desired bean, starting right after WHERE clause
- * @param array $bindings values array of values to be bound to parameters in query
+ * @param string $type the type of bean you are looking for
+ * @param string $sql SQL query to find the desired bean, starting right after WHERE clause
+ * @param array $bindings array of values to be bound to parameters in query
*
* @return OODBBean
*/
@@ -726,9 +648,9 @@ class Facade
* @see Facade::find
* This variation returns the last bean only.
*
- * @param string $type type the type of bean you are looking for
- * @param string $sql sql SQL query to find the desired bean, starting right after WHERE clause
- * @param array $bindings values array of values to be bound to parameters in query
+ * @param string $type the type of bean you are looking for
+ * @param string $sql SQL query to find the desired bean, starting right after WHERE clause
+ * @param array $bindings array of values to be bound to parameters in query
*
* @return OODBBean
*/
@@ -741,9 +663,9 @@ class Facade
* Finds a bean collection.
* Use this for large datasets.
*
- * @param string $type type the type of bean you are looking for
- * @param string $sql sql SQL query to find the desired bean, starting right after WHERE clause
- * @param array $bindings values array of values to be bound to parameters in query
+ * @param string $type the type of bean you are looking for
+ * @param string $sql SQL query to find the desired bean, starting right after WHERE clause
+ * @param array $bindings array of values to be bound to parameters in query
*
* @return BeanCollection
*/
@@ -762,7 +684,7 @@ class Facade
* @param array|string $types a list of bean types to find
* @param string|array $sqlOrArr SQL query string or result set array
* @param array $bindings SQL bindings
- * @param array $remappings An array of remapping arrays containing closures
+ * @param array $remappings an array of remapping arrays containing closures
*
* @return array
*/
@@ -812,8 +734,8 @@ class Facade
* Convenience function to execute Queries directly.
* Executes SQL.
*
- * @param string $sql sql SQL query to execute
- * @param array $bindings values a list of values to be bound to query parameters
+ * @param string $sql SQL query to execute
+ * @param array $bindings a list of values to be bound to query parameters
*
* @return integer
*/
@@ -826,8 +748,8 @@ class Facade
* Convenience function to execute Queries directly.
* Executes SQL.
*
- * @param string $sql sql SQL query to execute
- * @param array $bindings values a list of values to be bound to query parameters
+ * @param string $sql SQL query to execute
+ * @param array $bindings a list of values to be bound to query parameters
*
* @return array
*/
@@ -840,8 +762,8 @@ class Facade
* Convenience function to execute Queries directly.
* Executes SQL.
*
- * @param string $sql sql SQL query to execute
- * @param array $bindings values a list of values to be bound to query parameters
+ * @param string $sql SQL query to execute
+ * @param array $bindings a list of values to be bound to query parameters
*
* @return string
*/
@@ -854,8 +776,8 @@ class Facade
* Convenience function to execute Queries directly.
* Executes SQL.
*
- * @param string $sql sql SQL query to execute
- * @param array $bindings values a list of values to be bound to query parameters
+ * @param string $sql SQL query to execute
+ * @param array $bindings a list of values to be bound to query parameters
*
* @return array
*/
@@ -868,8 +790,8 @@ class Facade
* Convenience function to execute Queries directly.
* Executes SQL.
*
- * @param string $sql sql SQL query to execute
- * @param array $bindings values a list of values to be bound to query parameters
+ * @param string $sql SQL query to execute
+ * @param array $bindings a list of values to be bound to query parameters
*
* @return array
*/
@@ -887,8 +809,8 @@ class Facade
* selected in the query, both key and value of the array will have the
* value of this field for each row.
*
- * @param string $sql sql SQL query to execute
- * @param array $bindings values a list of values to be bound to query parameters
+ * @param string $sql SQL query to execute
+ * @param array $bindings a list of values to be bound to query parameters
*
* @return array
*/
@@ -903,8 +825,8 @@ class Facade
* Results will be returned as an associative array indexed by the first
* column in the select.
*
- * @param string $sql sql SQL query to execute
- * @param array $bindings values a list of values to be bound to query parameters
+ * @param string $sql SQL query to execute
+ * @param array $bindings a list of values to be bound to query parameters
*
* @return array
*/
@@ -946,7 +868,7 @@ class Facade
* @param OODBBean $bean bean to be copied
* @param array $trail for internal usage, pass array()
* @param boolean $pid for internal usage
- * @param array $white white list filter with bean types to duplicate
+ * @param array $white white list filter with bean types to duplicate
*
* @return array
*/
@@ -960,9 +882,9 @@ class Facade
* Makes a deep copy of a bean. This method makes a deep copy
* of the bean.The copy will have the following:
*
- * - All beans in own-lists will be duplicated as well
- * - All references to shared beans will be copied but not the shared beans themselves
- * - All references to parent objects (_id fields) will be copied but not the parents themselves
+ * * All beans in own-lists will be duplicated as well
+ * * All references to shared beans will be copied but not the shared beans themselves
+ * * All references to parent objects (_id fields) will be copied but not the parents themselves
*
* In most cases this is the desired scenario for copying beans.
* This function uses a trail-array to prevent infinite recursion, if a recursive bean is found
@@ -976,7 +898,7 @@ class Facade
* This is a simplified version of the deprecated R::dup() function.
*
* @param OODBBean $bean bean to be copied
- * @param array $white white list filter with bean types to duplicate
+ * @param array $white white list filter with bean types to duplicate
*
* @return array
*/
@@ -989,15 +911,16 @@ class Facade
* Exports a collection of beans. Handy for XML/JSON exports with a
* Javascript framework like Dojo or ExtJS.
* What will be exported:
- * - contents of the bean
- * - all own bean lists (recursively)
- * - all shared beans (not THEIR own lists)
+ *
+ * * contents of the bean
+ * * all own bean lists (recursively)
+ * * all shared beans (not THEIR own lists)
*
* @param array|OODBBean $beans beans to be exported
* @param boolean $parents whether you want parent beans to be exported
* @param array $filters whitelist of types
*
- * @return array
+ * @return array
*/
public static function exportAll( $beans, $parents = FALSE, $filters = array())
{
@@ -1009,9 +932,9 @@ class Facade
* This will determine the case style for the keys of exported beans (see exportAll).
* The following options are accepted:
*
- * 'default' RedBeanPHP by default enforces Snake Case (i.e. book_id is_valid )
- * 'camel' Camel Case (i.e. bookId isValid )
- * 'dolphin' Dolphin Case (i.e. bookID isValid ) Like CamelCase but ID is written all uppercase
+ * * 'default' RedBeanPHP by default enforces Snake Case (i.e. book_id is_valid )
+ * * 'camel' Camel Case (i.e. bookId isValid )
+ * * 'dolphin' Dolphin Case (i.e. bookID isValid ) Like CamelCase but ID is written all uppercase
*
* @warning RedBeanPHP transforms camelCase to snake_case using a slightly different
* algorithm, it also converts isACL to is_acl (not is_a_c_l) and bookID to book_id.
@@ -1090,8 +1013,8 @@ class Facade
* be associated with the bean.
* You may also pass an array instead of a string.
*
- * @param OODBBean $bean bean
- * @param mixed $tagList tags
+ * @param OODBBean $bean bean to tag
+ * @param mixed $tagList tags to attach to the specified bean
*
* @return string
*/
@@ -1107,7 +1030,7 @@ class Facade
* be associated with the bean.
* You may also pass an array instead of a string.
*
- * @param OODBBean $bean bean
+ * @param OODBBean $bean bean to tag
* @param array $tagList list of tags to add to bean
*
* @return void
@@ -1123,8 +1046,8 @@ class Facade
*
* @param string $beanType type of bean you are looking for
* @param array $tagList list of tags to match
- * @param string $sql additional SQL
- * @param array $bindings bindings
+ * @param string $sql additional SQL query snippet
+ * @param array $bindings a list of values to bind to the query parameters
*
* @return array
*/
@@ -1139,8 +1062,8 @@ class Facade
*
* @param string $beanType type of bean you are looking for
* @param array $tagList list of tags to match
- * @param string $sql additional SQL
- * @param array $bindings bindings
+ * @param string $sql additional SQL query snippet
+ * @param array $bindings a list of values to bind to the query parameters
*
* @return array
*/
@@ -1171,8 +1094,6 @@ class Facade
* @param array $bindings parameters to bind to SQL
*
* @return integer
- *
- * @throws SQL
*/
public static function count( $type, $addSQL = '', $bindings = array() )
{
@@ -1184,36 +1105,26 @@ class Facade
* Adapter and you want it on-the-fly? Use this method to hot-swap your facade with a new
* toolbox.
*
- * @param ToolBox $tb toolbox
+ * @param ToolBox $tb toolbox to configure facade with
*
* @return ToolBox
*/
public static function configureFacadeWithToolbox( ToolBox $tb )
{
$oldTools = self::$toolbox;
-
self::$toolbox = $tb;
-
self::$writer = self::$toolbox->getWriter();
self::$adapter = self::$toolbox->getDatabaseAdapter();
self::$redbean = self::$toolbox->getRedBean();
self::$finder = new Finder( self::$toolbox );
-
self::$associationManager = new AssociationManager( self::$toolbox );
-
self::$redbean->setAssociationManager( self::$associationManager );
-
self::$labelMaker = new LabelMaker( self::$toolbox );
-
$helper = new SimpleModelHelper();
-
$helper->attachEventListeners( self::$redbean );
-
self::$redbean->setBeanHelper( new SimpleFacadeBeanHelper );
-
self::$duplicationManager = new DuplicationManager( self::$toolbox );
self::$tagManager = new TagManager( self::$toolbox );
-
return $oldTools;
}
@@ -1226,9 +1137,7 @@ class Facade
public static function begin()
{
if ( !self::$redbean->isFrozen() ) return FALSE;
-
self::$adapter->startTransaction();
-
return TRUE;
}
@@ -1241,9 +1150,7 @@ class Facade
public static function commit()
{
if ( !self::$redbean->isFrozen() ) return FALSE;
-
self::$adapter->commit();
-
return TRUE;
}
@@ -1256,9 +1163,7 @@ class Facade
public static function rollback()
{
if ( !self::$redbean->isFrozen() ) return FALSE;
-
self::$adapter->rollback();
-
return TRUE;
}
@@ -1286,8 +1191,7 @@ class Facade
*/
public static function genSlots( $array, $template = NULL )
{
- $str = count( $array ) ? implode( ',', array_fill( 0, count( $array ), '?' ) ) : '';
- return ( is_null( $template ) || $str === '' ) ? $str : sprintf( $template, $str );
+ return ArrayTool::genSlots( $array, $template );
}
/**
@@ -1299,11 +1203,7 @@ class Facade
*/
public static function flat( $array, $result = array() )
{
- foreach( $array as $value ) {
- if ( is_array( $value ) ) $result = self::flat( $value, $result );
- else $result[] = $value;
- }
- return $result;
+ return ArrayTool::flat( $array, $result );
}
/**
@@ -1338,7 +1238,6 @@ class Facade
foreach ( $beans as $bean ) {
$ids[] = self::store( $bean );
}
-
return $ids;
}
@@ -1378,7 +1277,6 @@ class Facade
self::getWriter()->setUseCache( $yesNo );
}
-
/**
* A label is a bean with only an id, type and name property.
* This function will dispense beans for all entries in the array. The
@@ -1402,7 +1300,9 @@ class Facade
*
* To obtain (and add if necessary) an ENUM value:
*
+ *
* $tea->flavour = R::enum( 'flavour:apple' );
+ *
*
* Returns a bean of type 'flavour' with name = apple.
* This will add a bean with property name (set to APPLE) to the database
@@ -1410,11 +1310,15 @@ class Facade
*
* To obtain all flavours:
*
+ *
* R::enum('flavour');
+ *
*
* To get a list of all flavour names:
*
+ *
* R::gatherLabels( R::enum( 'flavour' ) );
+ *
*
* @param string $enum either type or type-value
*
@@ -1481,7 +1385,6 @@ class Facade
public static function isoDateTime( $time = NULL )
{
if ( !$time ) $time = time();
-
return @date( 'Y-m-d H:i:s', $time );
}
@@ -1489,7 +1392,7 @@ class Facade
* Optional accessor for neat code.
* Sets the database adapter you want to use.
*
- * @param Adapter $adapter
+ * @param Adapter $adapter Database Adapter for facade to use
*
* @return void
*/
@@ -1502,7 +1405,7 @@ class Facade
* Optional accessor for neat code.
* Sets the database adapter you want to use.
*
- * @param QueryWriter $writer
+ * @param QueryWriter $writer Query Writer instance for facade to use
*
* @return void
*/
@@ -1515,7 +1418,7 @@ class Facade
* Optional accessor for neat code.
* Sets the database adapter you want to use.
*
- * @param OODB $redbean
+ * @param OODB $redbean Object Database for facade to use
*/
public static function setRedBean( OODB $redbean )
{
@@ -1586,21 +1489,16 @@ class Facade
*
* Returns the components in the following order:
*
- * 0 - OODB instance (getRedBean())
- * 1 - Database Adapter
- * 2 - Query Writer
- * 3 - Toolbox itself
+ * # OODB instance (getRedBean())
+ * # Database Adapter
+ * # Query Writer
+ * # Toolbox itself
*
* @return array
*/
public static function getExtractedToolbox()
{
- return array(
- self::$redbean,
- self::$adapter,
- self::$writer,
- self::$toolbox
- );
+ return array( self::$redbean, self::$adapter, self::$writer, self::$toolbox );
}
/**
@@ -1630,36 +1528,36 @@ class Facade
public static function beansToArray( $beans )
{
$list = array();
- foreach( $beans as $bean ) {
- $list[] = $bean->export();
- }
+ foreach( $beans as $bean ) $list[] = $bean->export();
return $list;
}
-
+
/**
* Sets the error mode for FUSE.
* What to do if a FUSE model method does not exist?
* You can set the following options:
*
- * OODBBean::C_ERR_IGNORE (default), ignores the call, returns NULL
- * OODBBean::C_ERR_LOG, logs the incident using error_log
- * OODBBean::C_ERR_NOTICE, triggers a E_USER_NOTICE
- * OODBBean::C_ERR_WARN, triggers a E_USER_WARNING
- * OODBBean::C_ERR_EXCEPTION, throws an exception
- * OODBBean::C_ERR_FUNC, allows you to specify a custom handler (function)
- * OODBBean::C_ERR_FATAL, triggers a E_USER_ERROR
- *
+ * * OODBBean::C_ERR_IGNORE (default), ignores the call, returns NULL
+ * * OODBBean::C_ERR_LOG, logs the incident using error_log
+ * * OODBBean::C_ERR_NOTICE, triggers a E_USER_NOTICE
+ * * OODBBean::C_ERR_WARN, triggers a E_USER_WARNING
+ * * OODBBean::C_ERR_EXCEPTION, throws an exception
+ * * OODBBean::C_ERR_FUNC, allows you to specify a custom handler (function)
+ * * OODBBean::C_ERR_FATAL, triggers a E_USER_ERROR
+ *
+ *
* Custom handler method signature: handler( array (
* 'message' => string
* 'bean' => OODBBean
* 'method' => string
* ) )
+ *
*
* This method returns the old mode and handler as an array.
*
- * @param integer $mode mode
- * @param callable|NULL $func custom handler
- *
+ * @param integer $mode mode, determines how to handle errors
+ * @param callable|NULL $func custom handler (if applicable)
+ *
* @return array
*/
public static function setErrorHandlingFUSE( $mode, $func = NULL )
@@ -1676,29 +1574,10 @@ class Facade
* @param OODBBean|array $data either a bean or an array of beans
*
* @return array
- *
*/
public static function dump( $data )
{
- $array = array();
-
- if ( $data instanceof OODBBean ) {
- $str = strval( $data );
- if (strlen($str) > 35) {
- $beanStr = substr( $str, 0, 35 ).'... ';
- } else {
- $beanStr = $str;
- }
- return $beanStr;
- }
-
- if ( is_array( $data ) ) {
- foreach( $data as $key => $item ) {
- $array[$key] = self::dump( $item );
- }
- }
-
- return $array;
+ return Dump::dump( $data );
}
/**
@@ -1710,16 +1589,19 @@ class Facade
*
* Example:
*
+ *
* R::bindFunc( 'read', 'location.point', 'asText' );
* R::bindFunc( 'write', 'location.point', 'GeomFromText' );
+ *
*
* Passing NULL as the function will reset (clear) the function
* for this column/mode.
*
- * @param string $mode (read or write)
- * @param string $field
- * @param string $function
+ * @param string $mode mode for function: i.e. read or write
+ * @param string $field field (table.column) to bind function to
+ * @param string $function SQL function to bind to specified column
*
+ * @return void
*/
public static function bindFunc( $mode, $field, $function )
{
@@ -1729,7 +1611,7 @@ class Facade
/**
* Sets global aliases.
*
- * @param array $list
+ * @param array $list list of global aliases
*
* @return void
*/
@@ -1865,14 +1747,20 @@ class Facade
*
* Usage:
*
+ *
* R::ext( 'makeTea', function() { ... } );
+ *
*
* Now you can use your makeTea plugin like this:
*
+ *
* R::makeTea();
+ *
*
* @param string $pluginName name of the method to call the plugin
* @param callable $callable a PHP callable
+ *
+ * @return void
*/
public static function ext( $pluginName, $callable )
{
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/Finder.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/Finder.php
index 2affc837..5a1b4b75 100644
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/Finder.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/Finder.php
@@ -2,10 +2,6 @@
namespace RedBeanPHP;
-use RedBeanPHP\ToolBox as ToolBox;
-use RedBeanPHP\OODB as OODB;
-use RedBeanPHP\RedException\Security as Security;
-use RedBeanPHP\OODBBean as OODBBean;
/**
* RedBeanPHP Finder.
@@ -59,8 +55,6 @@ class Finder
* @param array $bindings values array of values to be bound to parameters in query
*
* @return array
- *
- * @throws Security
*/
public function find( $type, $sql = NULL, $bindings = array() )
{
@@ -75,8 +69,12 @@ class Finder
/**
* Like find() but also exports the beans as an array.
+ * This method will perform a find-operation. For every bean
+ * in the result collection this method will call the export() method.
+ * This method returns an array containing the array representations
+ * of every bean in the result set.
*
- * @see Finder::findAndExport
+ * @see Finder::find
*
* @param string $type type the type of bean you are looking for
* @param string $sql sql SQL query to find the desired bean, starting right after WHERE clause
@@ -97,6 +95,7 @@ class Finder
/**
* Like find() but returns just one bean instead of an array of beans.
* This method will return only the first bean of the array.
+ * If no beans are found, this method will return NULL.
*
* @see Finder::find
*
@@ -109,7 +108,7 @@ class Finder
public function findOne( $type, $sql = NULL, $bindings = array() )
{
$sql = $this->toolbox->getWriter()->glueLimitOne( $sql );
-
+
$items = $this->find( $type, $sql, $bindings );
if ( empty($items) ) {
@@ -122,6 +121,7 @@ class Finder
/**
* Like find() but returns the last bean of the result array.
* Opposite of Finder::findLast().
+ * If no beans are found, this method will return NULL.
*
* @see Finder::find
*
@@ -252,9 +252,11 @@ class Finder
*
* Example:
*
+ *
* $stuff = $finder->findMulti('movie,review', '
* SELECT movie.*, review.* FROM movie
* LEFT JOIN review ON review.movie_id = movie.id');
+ *
*
* After this operation, $stuff will contain an entry 'movie' containing all
* movies and an entry named 'review' containing all reviews (all beans).
@@ -267,18 +269,21 @@ class Finder
* The remapping argument (optional) should contain an array of arrays.
* Each array in the remapping array should contain the following entries:
*
+ *
* array(
* 'a' => TYPE A
* 'b' => TYPE B
* 'matcher' => MATCHING FUNCTION ACCEPTING A, B and ALL BEANS
* 'do' => OPERATION FUNCTION ACCEPTING A, B, ALL BEANS, ALL REMAPPINGS
* )
+ *
*
* Using this mechanism you can build your own 'preloader' with tiny function
* snippets (and those can be re-used and shared online of course).
*
* Example:
*
+ *
* array(
* 'a' => 'movie' //define A as movie
* 'b' => 'review' //define B as review
@@ -290,6 +295,7 @@ class Finder
* $a->clearHistory(); //optional, act 'as if these beans have been loaded through ownReviewList'.
* }
* )
+ *
*
* The Query Template parameter is optional as well but can be used to
* set a different SQL template (sprintf-style) for processing the original query.
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/Functions.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/Functions.php
index 3285124f..259aac8c 100644
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/Functions.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/Functions.php
@@ -7,7 +7,7 @@
* @file RedBeanPHP/Functions.php
* @author Gabor de Mooij and the RedBeanPHP community
* @license BSD/GPLv2
- *
+ *
* @copyright
* copyright (c) G.J.G.T. (Gabor) de Mooij and the RedBeanPHP Community.
* This source file is subject to the BSD/GPLv2 License that is bundled
@@ -19,7 +19,9 @@
*
* Usage:
*
+ *
* R::find( 'paint', ' color_id = ? ', [ EID('color:yellow') ] );
+ *
*
* If a function called EID() already exists you'll have to write this
* wrapper yourself ;)
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/LabelMaker.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/LabelMaker.php
index 677dcb5a..23010fad 100644
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/LabelMaker.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/LabelMaker.php
@@ -45,7 +45,9 @@ class LabelMaker
* values of the array will be assigned to the name property of each
* individual bean.
*
+ *
* $people = R::dispenseLabels( 'person', [ 'Santa', 'Claus' ] );
+ *
*
* @param string $type type of beans you would like to have
* @param array $labels list of labels, names for each bean
@@ -72,9 +74,11 @@ class LabelMaker
*
* Usage:
*
+ *
* $o1->name = 'hamburger';
* $o2->name = 'pizza';
* implode( ',', R::gatherLabels( [ $o1, $o2 ] ) ); //hamburger,pizza
+ *
*
* Note that the return value is an array of strings, not beans.
*
@@ -94,39 +98,47 @@ class LabelMaker
return $labels;
}
-
+
/**
* Fetches an ENUM from the database and creates it if necessary.
* An ENUM has the following format:
*
+ *
* ENUM:VALUE
+ *
*
* If you pass 'ENUM' only, this method will return an array of its
* values:
*
+ *
* implode( ',', R::gatherLabels( R::enum( 'flavour' ) ) ) //'BANANA,MOCCA'
+ *
*
* If you pass 'ENUM:VALUE' this method will return the specified enum bean
* and create it in the database if it does not exist yet:
*
+ *
* $bananaFlavour = R::enum( 'flavour:banana' );
* $bananaFlavour->name;
+ *
*
* So you can use this method to set an ENUM value in a bean:
*
+ *
* $shake->flavour = R::enum( 'flavour:banana' );
+ *
*
* the property flavour now contains the enum bean, a parent bean.
* In the database, flavour_id will point to the flavour record with name 'banana'.
*
* @param string $enum ENUM specification for label
- *
+ *
* @return array|OODBBean
*/
public function enum( $enum )
{
$oodb = $this->toolbox->getRedBean();
-
+
if ( strpos( $enum, ':' ) === FALSE ) {
$type = $enum;
$value = FALSE;
@@ -134,22 +146,37 @@ class LabelMaker
list( $type, $value ) = explode( ':', $enum );
$value = preg_replace( '/\W+/', '_', strtoupper( trim( $value ) ) );
}
-
+
+ /**
+ * We use simply find here, we could use inspect() in fluid mode etc,
+ * but this would be useless. At first sight it looks clean, you could even
+ * bake this into find(), however, find not only has to deal with the primary
+ * search type, people can also include references in the SQL part, so avoiding
+ * find failures does not matter, this is still the quickest way making use
+ * of existing functionality.
+ *
+ * @note There seems to be a bug in XDebug v2.3.2 causing suppressed
+ * exceptions like these to surface anyway, to prevent this use:
+ *
+ * "xdebug.default_enable = 0"
+ *
+ * Also see Github Issue #464
+ */
$values = $oodb->find( $type );
-
+
if ( $value === FALSE ) {
return $values;
}
-
+
foreach( $values as $enumItem ) {
- if ( $enumItem->name === $value ) return $enumItem;
+ if ( $enumItem->name === $value ) return $enumItem;
}
-
+
$newEnumItems = $this->dispenseLabels( $type, array( $value ) );
$newEnumItem = reset( $newEnumItems );
-
+
$oodb->store( $newEnumItem );
-
+
return $newEnumItem;
}
}
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/Logger.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/Logger.php
index 2b791edb..3699e66b 100755
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/Logger.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/Logger.php
@@ -1,4 +1,4 @@
-mode === self::C_LOGGER_ECHO ) echo "
\n";
+ if ( $this->mode === self::C_LOGGER_ECHO ) echo "
" . PHP_EOL;
}
}
-
+
/**
* Returns the internal log array.
* The internal log array is where all log messages are stored.
- *
+ *
* @return array
*/
public function getLogs()
{
return $this->logs;
}
-
+
/**
* Clears the internal log array, removing all
* previously stored entries.
- *
+ *
* @return self
*/
public function clear()
@@ -92,16 +91,16 @@ class RDefault implements Logger
$this->logs = array();
return $this;
}
-
+
/**
* Selects a logging mode.
* There are several options available.
- *
- * C_LOGGER_ARRAY - log silently, stores entries in internal log array only
- * C_LOGGER_ECHO - also forward log messages directly to STDOUT
- *
+ *
+ * * C_LOGGER_ARRAY - log silently, stores entries in internal log array only
+ * * C_LOGGER_ECHO - also forward log messages directly to STDOUT
+ *
* @param integer $mode mode of operation for logging object
- *
+ *
* @return self
*/
public function setMode( $mode )
@@ -112,7 +111,7 @@ class RDefault implements Logger
$this->mode = $mode;
return $this;
}
-
+
/**
* Searches for all log entries in internal log array
* for $needle and returns those entries.
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/Logger/RDefault/Debug.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/Logger/RDefault/Debug.php
index 73712772..a17fbbe1 100644
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/Logger/RDefault/Debug.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/Logger/RDefault/Debug.php
@@ -5,7 +5,6 @@ namespace RedBeanPHP\Logger\RDefault;
use RedBeanPHP\Logger as Logger;
use RedBeanPHP\Logger\RDefault as RDefault;
use RedBeanPHP\RedException as RedException;
-use RedBeanPHP\RedException\Security as Security;
/**
* Debug logger.
@@ -57,7 +56,7 @@ class Debug extends RDefault implements Logger
* Fills in a value of a binding and truncates the
* resulting string if necessary.
*
- * @param mixed $value
+ * @param mixed $value bound value
*
* @return string
*/
@@ -89,7 +88,7 @@ class Debug extends RDefault implements Logger
protected function output( $str )
{
$this->logs[] = $str;
- if ( !$this->mode ) echo $str .'
';
+ if ( !$this->mode ) echo $str ,'
';
}
/**
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/OODB.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/OODB.php
index 30953844..abc37d2e 100755
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/OODB.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/OODB.php
@@ -2,16 +2,9 @@
namespace RedBeanPHP;
-use RedBeanPHP\OODBBean as OODBBean;
-use RedBeanPHP\Observable as Observable;
use RedBeanPHP\Adapter\DBAdapter as DBAdapter;
-use RedBeanPHP\BeanHelper\FacadeBeanHelper as FacadeBeanHelper;
-use RedBeanPHP\AssociationManager as AssociationManager;
use RedBeanPHP\QueryWriter as QueryWriter;
-use RedBeanPHP\RedException\Security as Security;
-use RedBeanPHP\SimpleModel as SimpleModel;
use RedBeanPHP\BeanHelper as BeanHelper;
-use RedBeanPHP\RedException\SQL as SQL;
use RedBeanPHP\QueryWriter\AQueryWriter as AQueryWriter;
use RedBeanPHP\Repository as Repository;
use RedBeanPHP\Repository\Fluid as FluidRepo;
@@ -19,7 +12,7 @@ use RedBeanPHP\Repository\Frozen as FrozenRepo;
/**
* RedBean Object Oriented DataBase.
- *
+ *
* The RedBean OODB Class is the main class of RedBeanPHP.
* It takes OODBBean objects and stores them to and loads them from the
* database as well as providing other CRUD functions. This class acts as a
@@ -46,7 +39,6 @@ class OODB extends Observable
*/
protected $chillList = array();
-
/**
* @var array
*/
@@ -92,6 +84,24 @@ class OODB extends Observable
*/
protected $fluidRepository = NULL;
+ /**
+ * @var boolean
+ */
+ protected static $autoClearHistoryAfterStore = FALSE;
+
+ /**
+ * If set to TRUE, this method will call clearHistory every time
+ * the bean gets stored.
+ *
+ * @param boolean $autoClear auto clear option
+ *
+ * @return void
+ */
+ public static function autoClearHistoryAfterStore( $autoClear = TRUE )
+ {
+ self::$autoClearHistoryAfterStore = (boolean) $autoClear;
+ }
+
/**
* Unboxes a bean from a FUSE model if needed and checks whether the bean is
* an instance of OODBBean.
@@ -99,8 +109,6 @@ class OODB extends Observable
* @param OODBBean $bean bean you wish to unbox
*
* @return OODBBean
- *
- * @throws Security
*/
protected function unboxIfNeeded( $bean )
{
@@ -259,8 +267,6 @@ class OODB extends Observable
* @param OODBBean $bean the bean that needs to be checked
*
* @return void
- *
- * @throws Security $exception
*/
public function check( OODBBean $bean )
{
@@ -273,10 +279,12 @@ class OODB extends Observable
*
* Conditions need to take form:
*
+ *
* array(
* 'PROPERTY' => array( POSSIBLE VALUES... 'John', 'Steve' )
* 'PROPERTY' => array( POSSIBLE VALUES... )
* );
+ *
*
* All conditions are glued together using the AND-operator, while all value lists
* are glued using IN-operators thus acting as OR-conditions.
@@ -287,11 +295,9 @@ class OODB extends Observable
* @param string $type type of beans you are looking for
* @param array $conditions list of conditions
* @param string $addSQL SQL to be used in query
- * @param array $bindings whether you prefer to use a WHERE clause or not (TRUE = not)
+ * @param array $bindings a list of values to bind to query parameters
*
* @return array
- *
- * @throws SQL
*/
public function find( $type, $conditions = array(), $sql = NULL, $bindings = array() )
{
@@ -301,13 +307,11 @@ class OODB extends Observable
/**
* Same as find() but returns a BeanCollection.
*
- * @param string $type type of beans you are looking for
- * @param string $addSQL SQL to be used in query
- * @param array $bindings whether you prefer to use a WHERE clause or not (TRUE = not)
+ * @param string $type type of beans you are looking for
+ * @param string $addSQL SQL to be used in query
+ * @param array $bindings a list of values to bind to query parameters
*
* @return array
- *
- * @throws SQL
*/
public function findCollection( $type, $sql = NULL, $bindings = array() )
{
@@ -348,13 +352,15 @@ class OODB extends Observable
* @param OODBBean|SimpleModel $bean bean to store
*
* @return integer|string
- *
- * @throws Security
*/
public function store( $bean )
{
$bean = $this->unboxIfNeeded( $bean );
- return $this->repository->store( $bean );
+ $id = $this->repository->store( $bean );
+ if ( self::$autoClearHistoryAfterStore ) {
+ $bean->clearHistory();
+ }
+ return $id;
}
/**
@@ -377,10 +383,7 @@ class OODB extends Observable
* @param string $type type of bean you want to load
* @param integer $id ID of the bean you want to load
*
- * @throws SQL
- *
* @return OODBBean
- *
*/
public function load( $type, $id )
{
@@ -395,8 +398,6 @@ class OODB extends Observable
* @param OODBBean|SimpleModel $bean bean you want to remove from database
*
* @return void
- *
- * @throws Security
*/
public function trash( $bean )
{
@@ -449,8 +450,6 @@ class OODB extends Observable
* @param array $bindings parameters to bind to SQL
*
* @return integer
- *
- * @throws SQL
*/
public function count( $type, $addSQL = '', $bindings = array() )
{
@@ -463,8 +462,6 @@ class OODB extends Observable
* @param string $type type of bean you wish to delete all instances of
*
* @return boolean
- *
- * @throws SQL
*/
public function wipe( $type )
{
@@ -477,8 +474,6 @@ class OODB extends Observable
* storage and more.
*
* @return AssociationManager
- *
- * @throws Security
*/
public function getAssociationManager()
{
@@ -521,9 +516,11 @@ class OODB extends Observable
* MySQL spatial columns, because they need to be processed first using
* the asText/GeomFromText functions.
*
- * @param string $mode (read or write)
- * @param string $field
- * @param string $function
+ * @param string $mode mode to set function for, i.e. read or write
+ * @param string $field field (table.column) to bind SQL function to
+ * @param string $function SQL function to bind to field
+ *
+ * @return void
*/
public function bindFunc( $mode, $field, $function )
{
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/OODBBean.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/OODBBean.php
index f657fcbb..1854a8a7 100755
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/OODBBean.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/OODBBean.php
@@ -4,13 +4,11 @@ namespace RedBeanPHP;
use RedBeanPHP\QueryWriter\AQueryWriter as AQueryWriter;
use RedBeanPHP\BeanHelper as BeanHelper;
-use RedBeanPHP\RedException\Security as Security;
use RedBeanPHP\RedException as RedException;
-use RedBeanPHP\OODBBean as OODBBean;
/**
* OODBBean (Object Oriented DataBase Bean).
- *
+ *
* to exchange information with the database. A bean represents
* a single table row and offers generic services for interaction
* with databases systems as well as some meta-data.
@@ -19,7 +17,7 @@ use RedBeanPHP\OODBBean as OODBBean;
* @author Gabor de Mooij and the RedBeanPHP community
* @license BSD/GPLv2
* @desc OODBBean represents a bean. RedBeanPHP uses beans
- *
+ *
* @copyright
* copyright (c) G.J.G.T. (Gabor) de Mooij and the RedBeanPHP Community.
* This source file is subject to the BSD/GPLv2 License that is bundled
@@ -58,84 +56,6 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
*/
protected static $autoResolve = FALSE;
- /**
- * Sets the error mode for FUSE.
- * What to do if a FUSE model method does not exist?
- * You can set the following options:
- *
- * OODBBean::C_ERR_IGNORE (default), ignores the call, returns NULL
- * OODBBean::C_ERR_LOG, logs the incident using error_log
- * OODBBean::C_ERR_NOTICE, triggers a E_USER_NOTICE
- * OODBBean::C_ERR_WARN, triggers a E_USER_WARNING
- * OODBBean::C_ERR_EXCEPTION, throws an exception
- * OODBBean::C_ERR_FUNC, allows you to specify a custom handler (function)
- * OODBBean::C_ERR_FATAL, triggers a E_USER_ERROR
- *
- * Custom handler method signature: handler( array (
- * 'message' => string
- * 'bean' => OODBBean
- * 'method' => string
- * ) )
- *
- * This method returns the old mode and handler as an array.
- *
- * @param integer $mode mode
- * @param callable|NULL $func custom handler
- *
- * @return array
- */
- public static function setErrorHandlingFUSE($mode, $func = NULL) {
- if (
- $mode !== self::C_ERR_IGNORE
- && $mode !== self::C_ERR_LOG
- && $mode !== self::C_ERR_NOTICE
- && $mode !== self::C_ERR_WARN
- && $mode !== self::C_ERR_EXCEPTION
- && $mode !== self::C_ERR_FUNC
- && $mode !== self::C_ERR_FATAL
- ) throw new \Exception( 'Invalid error mode selected' );
-
- if ( $mode === self::C_ERR_FUNC && !is_callable( $func ) ) {
- throw new \Exception( 'Invalid error handler' );
- }
-
- $old = array( self::$errorHandlingFUSE, self::$errorHandler );
- self::$errorHandlingFUSE = $mode;
- if ( is_callable( $func ) ) {
- self::$errorHandler = $func;
- } else {
- self::$errorHandler = NULL;
- }
- return $old;
- }
-
- /**
- * Sets aliases.
- *
- * @param array $list
- *
- * @return void
- */
- public static function aliases( $list )
- {
- self::$aliases = $list;
- }
-
- /**
- * Enables or disables auto-resolving fetch types.
- * Auto-resolving aliased parent beans is convenient but can
- * be slower and can create infinite recursion if you
- * used aliases to break cyclic relations in your domain.
- *
- * @param boolean $automatic TRUE to enable automatic resolving aliased parents
- *
- * @return void
- */
- public static function setAutoResolve( $automatic = TRUE )
- {
- self::$autoResolve = (boolean) $automatic;
- }
-
/**
* This is where the real properties of the bean live. They are stored and retrieved
* by the magic getter and setter (__get and __set).
@@ -195,6 +115,86 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
*/
protected $all = FALSE;
+ /**
+ * Sets the error mode for FUSE.
+ * What to do if a FUSE model method does not exist?
+ * You can set the following options:
+ *
+ * * OODBBean::C_ERR_IGNORE (default), ignores the call, returns NULL
+ * * OODBBean::C_ERR_LOG, logs the incident using error_log
+ * * OODBBean::C_ERR_NOTICE, triggers a E_USER_NOTICE
+ * * OODBBean::C_ERR_WARN, triggers a E_USER_WARNING
+ * * OODBBean::C_ERR_EXCEPTION, throws an exception
+ * * OODBBean::C_ERR_FUNC, allows you to specify a custom handler (function)
+ * * OODBBean::C_ERR_FATAL, triggers a E_USER_ERROR
+ *
+ *
+ * Custom handler method signature: handler( array (
+ * 'message' => string
+ * 'bean' => OODBBean
+ * 'method' => string
+ * ) )
+ *
+ *
+ * This method returns the old mode and handler as an array.
+ *
+ * @param integer $mode error handling mode
+ * @param callable|NULL $func custom handler
+ *
+ * @return array
+ */
+ public static function setErrorHandlingFUSE($mode, $func = NULL) {
+ if (
+ $mode !== self::C_ERR_IGNORE
+ && $mode !== self::C_ERR_LOG
+ && $mode !== self::C_ERR_NOTICE
+ && $mode !== self::C_ERR_WARN
+ && $mode !== self::C_ERR_EXCEPTION
+ && $mode !== self::C_ERR_FUNC
+ && $mode !== self::C_ERR_FATAL
+ ) throw new \Exception( 'Invalid error mode selected' );
+
+ if ( $mode === self::C_ERR_FUNC && !is_callable( $func ) ) {
+ throw new \Exception( 'Invalid error handler' );
+ }
+
+ $old = array( self::$errorHandlingFUSE, self::$errorHandler );
+ self::$errorHandlingFUSE = $mode;
+ if ( is_callable( $func ) ) {
+ self::$errorHandler = $func;
+ } else {
+ self::$errorHandler = NULL;
+ }
+ return $old;
+ }
+
+ /**
+ * Sets global aliases.
+ *
+ * @param array $list list of global aliases to use
+ *
+ * @return void
+ */
+ public static function aliases( $list )
+ {
+ self::$aliases = $list;
+ }
+
+ /**
+ * Enables or disables auto-resolving fetch types.
+ * Auto-resolving aliased parent beans is convenient but can
+ * be slower and can create infinite recursion if you
+ * used aliases to break cyclic relations in your domain.
+ *
+ * @param boolean $automatic TRUE to enable automatic resolving aliased parents
+ *
+ * @return void
+ */
+ public static function setAutoResolve( $automatic = TRUE )
+ {
+ self::$autoResolve = (boolean) $automatic;
+ }
+
/**
* Sets a meta property for all beans. This is a quicker way to set
* the meta properties for a collection of beans because this method
@@ -232,7 +232,7 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
*
* @param string $type the source type for the join
*
- * @return string $joinSql
+ * @return string
*/
private function parseJoin( $type )
{
@@ -357,7 +357,7 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
* use the OODB object to dispense new beans. You can use this method
* if you build your own bean dispensing mechanism.
*
- * @param string $type type of the new bean
+ * @param string $type type of the new bean
* @param BeanHelper $beanhelper bean helper to obtain a toolbox and a model
*
* @return void
@@ -380,7 +380,7 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
* nested beans (bean lists: ownBean, sharedBean) without the need to
* rely on static calls to the facade (or make this class dep. on OODB).
*
- * @param BeanHelper $helper
+ * @param BeanHelper $helper helper to use for this bean
*
* @return void
*/
@@ -390,7 +390,7 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
}
/**
- * Returns an\ArrayIterator so you can treat the bean like
+ * Returns an ArrayIterator so you can treat the bean like
* an array with the properties container as its contents.
* This method is meant for PHP and allows you to access beans as if
* they were arrays, i.e. using array notation:
@@ -399,11 +399,11 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
*
* Note that not all PHP functions work with the array interface.
*
- * @return \ArrayIterator
+ * @return ArrayIterator
*/
public function getIterator()
{
- return new\ArrayIterator( $this->properties );
+ return new \ArrayIterator( $this->properties );
}
/**
@@ -600,7 +600,7 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
* Unsets a property of a bean.
* Magic method, gets called implicitly when performing the unset() operation
* on a bean property.
- *
+ *
* @param string $property property to unset
*
* @return void
@@ -636,13 +636,15 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
* issue the following command: $book->ownPage
* However, to order these pages by number use:
*
+ *
* $book->with(' ORDER BY `number` ASC ')->ownPage
+ *
*
* the additional SQL snippet will be merged into the final
* query.
*
- * @param string $sql SQL to be added to retrieval query.
- * @param array $bindings array with parameters to bind to SQL snippet
+ * @param string $sql SQL to be added to retrieval query.
+ * @param array $bindings array with parameters to bind to SQL snippet
*
* @return OODBBean
*/
@@ -682,8 +684,10 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
*
* Usage:
*
+ *
* $bean->with( ' LIMIT 3 ' )->ownPage; //Just 3
* $bean->all()->ownPage; //Reload all pages
+ *
*
* @return self
*/
@@ -713,16 +717,22 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
* case, so to the project has a teacher_id pointing to a person, and a student_id
* also pointing to a person. Given a project, we obtain the teacher like this:
*
+ *
* $project->fetchAs('person')->teacher;
+ *
*
* Now, if we want all projects of a teacher we cant say:
*
+ *
* $teacher->ownProject
+ *
*
* because the $teacher is a bean of type 'person' and no project has been
* assigned to a person. Instead we use the alias() method like this:
*
+ *
* $teacher->alias('teacher')->ownProject
+ *
*
* now we get the projects associated with the person bean aliased as
* a teacher.
@@ -770,12 +780,13 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
* Turns a camelcase property name into an underscored property name.
*
* Examples:
- * oneACLRoute -> one_acl_route
- * camelCase -> camel_case
+ *
+ * * oneACLRoute -> one_acl_route
+ * * camelCase -> camel_case
*
* Also caches the result to improve performance.
*
- * @param string $property
+ * @param string $property property to un-beautify
*
* @return string
*/
@@ -911,7 +922,6 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
return $this->properties[$property];
}
-
list( $redbean, , , $toolbox ) = $this->beanHelper->getExtractedToolbox();
if ( isset( $this->$fieldLink ) ) {
@@ -989,8 +999,6 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
* @param mixed $value the value you want to assign
*
* @return void
- *
- * @throws Security
*/
public function __set( $property, $value )
{
@@ -1101,12 +1109,14 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
*
* Example:
*
+ *
* $bean->setMeta( 'flush-cache', TRUE );
+ *
*
* RedBeanPHP also stores meta data in beans, this meta data uses
* keys prefixed with 'sys.' (system).
*
- * @param string $path path
+ * @param string $path path to property in meta data
* @param mixed $default default value
*
* @return mixed
@@ -1122,7 +1132,7 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
* This is a short-cut method that can be used instead
* of combining a get/unset.
*
- * @param string $path path
+ * @param string $path path to property in meta data
* @param mixed $default default value
*
* @return mixed
@@ -1161,7 +1171,7 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
* This is a convenience method to enable you to
* exchange meta information easily.
*
- * @param OODBBean $bean
+ * @param OODBBean $bean bean to copy meta data of
*
* @return OODBBean
*/
@@ -1338,7 +1348,7 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
* For polymorphic bean relations.
* Same as fetchAs but uses a column instead of a direct value.
*
- * @param string $column
+ * @param string $field field name to use for mapping
*
* @return OODBBean
*/
@@ -1354,10 +1364,12 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
*
* Can be used together with with, withCondition, alias and fetchAs.
*
- * @param string $property property
- * @param closure $function function
+ * @param string $property property
+ * @param callable $function function
+ * @param integer $maxDepth maximum depth for traversal
*
* @return OODBBean
+ * @throws RedException
*/
public function traverse( $property, $function, $maxDepth = NULL )
{
@@ -1382,7 +1394,7 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
if ( !is_array( $beans ) ) $beans = array( $beans );
foreach( $beans as $bean ) {
-
+ /** @var OODBBean $bean */
$function( $bean );
$bean->fetchType = $oldFetchType;
@@ -1397,7 +1409,7 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
}
/**
- * Implementation of\Countable interface. Makes it possible to use
+ * Implementation of Countable interface. Makes it possible to use
* count() function on a bean.
*
* @return integer
@@ -1508,7 +1520,7 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
* it has been stored or not. Storing a bean does not undo it's history,
* to clean the history of a bean use: clearHistory().
*
- * @param string $property name of the property you want the change-status of
+ * @param string $property name of the property you want the change-status of
*
* @return boolean
*/
@@ -1564,11 +1576,15 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
*
* Usage:
*
+ *
* $album->link('track', array('number'=>1))->song = $song;
+ *
*
* or:
*
+ *
* $album->link($trackBean)->song = $song;
+ *
*
* What this method does is adding the link bean to the own-list, in this case
* ownTrack. If the first argument is a string and the second is an array or
@@ -1577,7 +1593,7 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
* allowing the chained setter: ->song = $song.
*
* @param string|OODBBean $type type of bean to dispense or the full bean
- * @param string|array $qualification JSON string or array (optional)
+ * @param string|array $qualification JSON string or array (optional)
*
* @return OODBBean
*/
@@ -1609,6 +1625,19 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
return $bean;
}
+ /**
+ * Returns a bean of the given type with the same ID of as
+ * the current one. This only happens in a one-to-one relation.
+ * This is as far as support for 1-1 goes in RedBeanPHP. This
+ * method will only return a reference to the bean, changing it
+ * and storing the bean will not update the related one-bean.
+ *
+ * @return OODBBean
+ */
+ public function one( $type ) {
+ return $this->beanHelper->getToolBox()->getRedBean()->load( $type, $this->id );
+ }
+
/**
* Returns the same bean freshly loaded from the database.
*
@@ -1708,7 +1737,7 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
$count = 0;
if ( $this->getID() ) {
- $count = $redbean->getAssociationManager()->relatedCount( $this, $type, $this->withSql, $this->withParams, TRUE );
+ $count = $redbean->getAssociationManager()->relatedCount( $this, $type, $this->withSql, $this->withParams );
}
$this->clearModifiers();
@@ -1727,7 +1756,9 @@ class OODBBean implements\IteratorAggregate,\ArrayAccess,\Countable
*
* Example:
*
+ *
* $quest->aggr( 'xownQuestTarget', 'target', 'quest' );
+ *
*
* Loads (in batch) and returns references to all
* quest beans residing in the $questTarget->target properties
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/Observable.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/Observable.php
index 0b68d7b7..8e3e6c72 100755
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/Observable.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/Observable.php
@@ -1,4 +1,4 @@
-
* renameAssociation('album_song','track')
+ *
*
* This allows:
*
+ *
* $album->sharedSong
+ *
*
* to add/retrieve beans from track instead of album_song.
* Also works for exportAll().
@@ -451,8 +455,8 @@ interface QueryWriter
* This method also accepts a single associative array as
* its first argument.
*
- * @param string|array $fromType
- * @param string $toType (optional)
+ * @param string|array $fromType original type name, or array
+ * @param string $toType new type name (only if 1st argument is string)
*
* @return void
*/
@@ -474,7 +478,7 @@ interface QueryWriter
/**
* Given a bean type and a property, this method
* tries to infer the fetch type using the foreign key
- * definitions in the database.
+ * definitions in the database.
* For instance: project, student -> person.
* If no fetchType can be inferred, this method will return NULL.
*
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/AQueryWriter.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/AQueryWriter.php
index 052ec32d..dbe6ac26 100755
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/AQueryWriter.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/AQueryWriter.php
@@ -123,7 +123,7 @@ abstract class AQueryWriter
* Globally available service method for RedBeanPHP.
* Converts a camel cased string to a snake cased string.
*
- * @param string $camel a camelCased string
+ * @param string $camel camelCased string to converty to snake case
*
* @return string
*/
@@ -172,6 +172,7 @@ abstract class AQueryWriter
* This is a lowlevel method to set the SQL filter array.
* The format of this array is:
*
+ *
* array(
* '' => array(
* '' => array(
@@ -179,22 +180,27 @@ abstract class AQueryWriter
* )
* )
* )
+ *
*
* Example:
*
+ *
* array(
- * QueryWriter::C_SQLFILTER_READ => array(
+ * QueryWriter::C_SQLFILTER_READ => array(
* 'book' => array(
* 'title' => ' LOWER(book.title) '
* )
* )
+ *
*
* Note that you can use constants instead of magical chars
* as keys for the uppermost array.
* This is a lowlevel method. For a more friendly method
* please take a look at the facade: R::bindFunc().
*
- * @param array
+ * @param array list of filters to set
+ *
+ * @return void
*/
public static function setSQLFilters( $sqlFilters, $safeMode = false )
{
@@ -284,7 +290,7 @@ abstract class AQueryWriter
* improve caching efficiency (issue #400).
*
* @param string $cacheTag cache tag (secondary key)
- * @param string $key key
+ * @param string $key key to store values under
* @param array $values content to be stored
*
* @return void
@@ -303,15 +309,17 @@ abstract class AQueryWriter
/**
* Creates an SQL snippet from a list of conditions of format:
*
+ *
* array(
* key => array(
* value1, value2, value3 ....
* )
* )
+ *
*
* @param array $conditions list of conditions
* @param array $bindings parameter bindings for SQL snippet
- * @param string $addSql SQL snippet
+ * @param string $addSql additional SQL snippet to append to result
*
* @return string
*/
@@ -434,6 +442,7 @@ abstract class AQueryWriter
* A foreign key map describes the foreign keys in a table.
* A FKM always has the same structure:
*
+ *
* array(
* 'name' =>
* 'from' =>
@@ -442,6 +451,7 @@ abstract class AQueryWriter
* 'on_update' =>
* 'on_delete' =>
* )
+ *
*
* @note the keys in the result array are FKDLs, i.e. descriptive unique
* keys per source table. Also see: AQueryWriter::makeFKLabel for details.
@@ -510,9 +520,9 @@ abstract class AQueryWriter
* If you pass an offset the bindings will be re-added to the value list.
* Some databases cant handle duplicate parameter names in queries.
*
- * @param array &$valueList list of values to generate slots for (gets modified if needed)
- * @param array $otherBindings list of additional bindings
- * @param integer $offset start counter at...
+ * @param array &$valueList list of values to generate slots for (gets modified if needed)
+ * @param array $otherBindings list of additional bindings
+ * @param integer $offset start counter at...
*
* @return string
*/
@@ -648,8 +658,6 @@ abstract class AQueryWriter
* @param string $table table string
*
* @return string
- *
- * @throws Security
*/
protected function check( $struct )
{
@@ -712,7 +720,7 @@ abstract class AQueryWriter
*/
public function glueLimitOne( $sql = '')
{
- return ( strpos( $sql, 'LIMIT' ) === FALSE ) ? ( $sql . ' LIMIT 1 ' ) : $sql;
+ return ( strpos( strtoupper( $sql ), 'LIMIT' ) === FALSE ) ? ( $sql . ' LIMIT 1 ' ) : $sql;
}
/**
@@ -832,7 +840,6 @@ abstract class AQueryWriter
$rows = $this->adapter->get( $sql, $bindings );
-
if ( $this->flagUseCache && $key ) {
$this->putResultInCache( $type, $key, $rows );
}
@@ -1107,6 +1114,8 @@ abstract class AQueryWriter
* use a result row cache.
*
* @param boolean
+ *
+ * @return void
*/
public function setUseCache( $yesNo )
{
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/CUBRID.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/CUBRID.php
index 4e91acb8..ad8740af 100644
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/CUBRID.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/CUBRID.php
@@ -1,10 +1,10 @@
esc( $type, TRUE );
$field = $this->esc( $property, TRUE ) . '_id';
$keys = $this->getKeyMapForType( $table );
-
+
foreach( $keys as $key ) {
- if (
+ if (
$key['from'] === $field
) return $key['table'];
}
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/MySQL.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/MySQL.php
index 7e575760..f6545c2a 100755
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/MySQL.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/MySQL.php
@@ -39,6 +39,7 @@ class MySQL extends AQueryWriter implements QueryWriter
const C_DATATYPE_SPECIAL_POINT = 90;
const C_DATATYPE_SPECIAL_LINESTRING = 91;
const C_DATATYPE_SPECIAL_POLYGON = 92;
+ const C_DATATYPE_SPECIAL_MONEY = 93;
const C_DATATYPE_SPECIFIED = 99;
@@ -57,6 +58,7 @@ class MySQL extends AQueryWriter implements QueryWriter
*/
protected function getKeyMapForType( $type )
{
+ $databaseName = $this->adapter->getCell('SELECT DATABASE()');
$table = $this->esc( $type, TRUE );
$keys = $this->adapter->get('
SELECT
@@ -68,17 +70,15 @@ class MySQL extends AQueryWriter implements QueryWriter
information_schema.referential_constraints.delete_rule AS `on_delete`
FROM information_schema.key_column_usage
INNER JOIN information_schema.referential_constraints
- ON (
- information_schema.referential_constraints.constraint_name = information_schema.key_column_usage.constraint_name
- AND information_schema.referential_constraints.constraint_schema = information_schema.key_column_usage.constraint_schema
- AND information_schema.referential_constraints.constraint_catalog = information_schema.key_column_usage.constraint_catalog
- )
+ ON information_schema.referential_constraints.constraint_name = information_schema.key_column_usage.constraint_name
WHERE
- information_schema.key_column_usage.table_schema IN ( SELECT DATABASE() )
- AND information_schema.key_column_usage.table_name = ?
+ information_schema.key_column_usage.table_schema = :database
+ AND information_schema.referential_constraints.constraint_schema = :database
+ AND information_schema.key_column_usage.constraint_schema = :database
+ AND information_schema.key_column_usage.table_name = :table
AND information_schema.key_column_usage.constraint_name != \'PRIMARY\'
AND information_schema.key_column_usage.referenced_table_name IS NOT NULL
- ', array($table));
+ ', array( ':database' => $databaseName, ':table' => $table ) );
$keyInfoList = array();
foreach ( $keys as $k ) {
$label = $this->makeFKLabel( $k['from'], $k['table'], $k['to'] );
@@ -114,6 +114,7 @@ class MySQL extends AQueryWriter implements QueryWriter
MySQL::C_DATATYPE_SPECIAL_POINT => ' POINT ',
MySQL::C_DATATYPE_SPECIAL_LINESTRING => ' LINESTRING ',
MySQL::C_DATATYPE_SPECIAL_POLYGON => ' POLYGON ',
+ MySQL::C_DATATYPE_SPECIAL_MONEY => ' DECIMAL(10,2) '
);
$this->sqltype_typeno = array();
@@ -131,7 +132,7 @@ class MySQL extends AQueryWriter implements QueryWriter
* This method returns the datatype to be used for primary key IDS and
* foreign keys. Returns one if the data type constants.
*
- * @return integer $const data type to be used for IDS.
+ * @return integer
*/
public function getTypeForID()
{
@@ -185,6 +186,9 @@ class MySQL extends AQueryWriter implements QueryWriter
if ( $value === INF ) return MySQL::C_DATATYPE_TEXT7;
if ( $flagSpecial ) {
+ if ( preg_match( '/^-?\d+\.\d{2}$/', $value ) ) {
+ return MySQL::C_DATATYPE_SPECIAL_MONEY;
+ }
if ( preg_match( '/^\d{4}\-\d\d-\d\d$/', $value ) ) {
return MySQL::C_DATATYPE_SPECIAL_DATE;
}
@@ -297,6 +301,7 @@ class MySQL extends AQueryWriter implements QueryWriter
/**
* @see QueryWriter::addFK
+ * @return bool
*/
public function addFK( $type, $targetType, $property, $targetProperty, $isDependent = FALSE )
{
@@ -329,6 +334,7 @@ class MySQL extends AQueryWriter implements QueryWriter
} catch ( SQLException $e ) {
// Failure of fk-constraints is not a problem
}
+ return true;
}
/**
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/PostgreSQL.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/PostgreSQL.php
index 9b9f601d..f364fc79 100755
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/PostgreSQL.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/PostgreSQL.php
@@ -37,6 +37,7 @@ class PostgreSQL extends AQueryWriter implements QueryWriter
const C_DATATYPE_SPECIAL_CIRCLE = 92;
const C_DATATYPE_SPECIAL_MONEY = 93;
const C_DATATYPE_SPECIAL_POLYGON = 94;
+ const C_DATATYPE_SPECIAL_MONEY2 = 95; //Numbers only money, i.e. fixed point numeric
const C_DATATYPE_SPECIFIED = 99;
/**
@@ -136,6 +137,7 @@ class PostgreSQL extends AQueryWriter implements QueryWriter
self::C_DATATYPE_SPECIAL_LSEG => ' lseg ',
self::C_DATATYPE_SPECIAL_CIRCLE => ' circle ',
self::C_DATATYPE_SPECIAL_MONEY => ' money ',
+ self::C_DATATYPE_SPECIAL_MONEY2 => ' numeric(10,2) ',
self::C_DATATYPE_SPECIAL_POLYGON => ' polygon ',
);
@@ -152,7 +154,7 @@ class PostgreSQL extends AQueryWriter implements QueryWriter
* This method returns the datatype to be used for primary key IDS and
* foreign keys. Returns one if the data type constants.
*
- * @return integer $const data type to be used for IDS.
+ * @return integer
*/
public function getTypeForID()
{
@@ -184,7 +186,7 @@ class PostgreSQL extends AQueryWriter implements QueryWriter
{
$table = $this->esc( $table, TRUE );
- $columnsRaw = $this->adapter->get( "SELECT column_name, data_type FROM information_schema.columns WHERE table_name='$table'" );
+ $columnsRaw = $this->adapter->get( "SELECT column_name, data_type FROM information_schema.columns WHERE table_name='$table' AND table_schema = ANY( current_schemas( FALSE ) )" );
$columns = array();
foreach ( $columnsRaw as $r ) {
@@ -231,12 +233,16 @@ class PostgreSQL extends AQueryWriter implements QueryWriter
if ( preg_match( '/^\-?(\$|€|¥|£)[\d,\.]+$/', $value ) ) {
return PostgreSQL::C_DATATYPE_SPECIAL_MONEY;
}
+
+ if ( preg_match( '/^-?\d+\.\d{2}$/', $value ) ) {
+ return PostgreSQL::C_DATATYPE_SPECIAL_MONEY2;
+ }
}
if ( is_float( $value ) ) return self::C_DATATYPE_DOUBLE;
if ( $this->startsWithZeros( $value ) ) return self::C_DATATYPE_TEXT;
-
+
if ( $value === FALSE || $value === TRUE || $value === NULL || ( is_numeric( $value )
&& AQueryWriter::canBeTreatedAsInt( $value )
&& $value < 2147483648
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/SQLiteT.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/SQLiteT.php
index b171a650..96f52d3c 100755
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/SQLiteT.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/QueryWriter/SQLiteT.php
@@ -1,4 +1,4 @@
-startsWithZeros( $value ) ) return self::C_DATATYPE_TEXT;
if ( $value === TRUE || $value === FALSE ) return self::C_DATATYPE_INTEGER;
-
+
if ( is_numeric( $value ) && ( intval( $value ) == $value ) && $value < 2147483648 && $value > -2147483648 ) return self::C_DATATYPE_INTEGER;
if ( ( is_numeric( $value ) && $value < 2147483648 && $value > -2147483648)
@@ -290,7 +291,7 @@ class SQLiteT extends AQueryWriter implements QueryWriter
public function code( $typedescription, $includeSpecials = FALSE )
{
$r = ( ( isset( $this->sqltype_typeno[$typedescription] ) ) ? $this->sqltype_typeno[$typedescription] : 99 );
-
+
return $r;
}
@@ -400,7 +401,7 @@ class SQLiteT extends AQueryWriter implements QueryWriter
public function wipe( $type )
{
$table = $this->esc( $type );
-
+
$this->adapter->exec( "DELETE FROM $table " );
}
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/R.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/R.php
index 1e2c9fd9..6f2648b4 100644
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/R.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/R.php
@@ -16,4 +16,6 @@ namespace RedBeanPHP;
* @license BSD/GPLv2
*
*/
- class R extends Facade {}
+class R extends Facade
+{
+}
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/RedException.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/RedException.php
index d8ca7146..5973bbb7 100755
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/RedException.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/RedException.php
@@ -1,4 +1,4 @@
-getMeta( 'type' ) . '_id';
@@ -210,8 +201,8 @@ abstract class Repository
/**
* Unassociates the list items in the trashcan.
*
- * @param OODBBean $bean bean
- * @param array $sharedTrashcan list
+ * @param OODBBean $bean bean to process
+ * @param array $sharedTrashcan list to process
*
* @return void
*/
@@ -225,8 +216,8 @@ abstract class Repository
/**
* Stores all the beans in the residue group.
*
- * @param OODBBean $bean bean
- * @param array $sharedresidue list
+ * @param OODBBean $bean bean to process
+ * @param array $sharedresidue list to process
*
* @return void
*/
@@ -259,19 +250,20 @@ abstract class Repository
return $processLists;
}
-
/**
* Converts an embedded bean to an ID, removed the bean property and
* stores the bean in the embedded beans array.
*
- * @param array $embeddedBeans destination array for embedded bean
- * @param OODBBean $bean target bean
- * @param string $property property that contains the embedded bean
+ * @param array $embeddedBeans destination array for embedded bean
+ * @param OODBBean $bean target bean to process
+ * @param string $property property that contains the embedded bean
* @param OODBBean $value embedded bean itself
+ *
+ * @return void
*/
protected function processEmbeddedBean( &$embeddedBeans, $bean, $property, OODBBean $value )
{
- $linkField = $property . '_id';
+ $linkField = $property . '_id';
$id = $this->prepareEmbeddedBean( $value );
if ($bean->$linkField != $id) $bean->$linkField = $id;
$bean->setMeta( 'cast.' . $linkField, 'id' );
@@ -279,11 +271,13 @@ abstract class Repository
unset( $bean->$property );
}
-
/**
* Constructor, requires a query writer.
+ * Creates a new instance of the bean respository class.
*
- * @param QueryWriter $writer writer
+ * @param QueryWriter $writer the Query Writer to use for this repository
+ *
+ * @return void
*/
public function __construct( OODB $oodb, QueryWriter $writer )
{
@@ -299,8 +293,6 @@ abstract class Repository
* @param OODBBean $bean the bean that needs to be checked
*
* @return void
- *
- * @throws Security $exception
*/
public function check( OODBBean $bean )
{
@@ -339,10 +331,12 @@ abstract class Repository
*
* Conditions need to take form:
*
+ *
* array(
* 'PROPERTY' => array( POSSIBLE VALUES... 'John', 'Steve' )
* 'PROPERTY' => array( POSSIBLE VALUES... )
* );
+ *
*
* All conditions are glued together using the AND-operator, while all value lists
* are glued using IN-operators thus acting as OR-conditions.
@@ -356,7 +350,6 @@ abstract class Repository
* @param array $bindings whether you prefer to use a WHERE clause or not (TRUE = not)
*
* @return array
- *
*/
public function find( $type, $conditions = array(), $sql = NULL, $bindings = array() )
{
@@ -512,8 +505,6 @@ abstract class Repository
* @param array $bindings parameters to bind to SQL
*
* @return integer
- *
- * @throws SQLException
*/
public function count( $type, $addSQL = '', $bindings = array() )
{
@@ -543,8 +534,6 @@ abstract class Repository
* @param OODBBean|SimpleModel $bean bean you want to remove from database
*
* @return void
- *
- * @throws SQLException
*/
public function trash( $bean )
{
@@ -591,8 +580,6 @@ abstract class Repository
* @param string $type type of bean you wish to delete all instances of
*
* @return boolean
- *
- * @throws SQLException
*/
public function wipe( $type )
{
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/Repository/Fluid.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/Repository/Fluid.php
index 65502e7e..fb4dcee4 100644
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/Repository/Fluid.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/Repository/Fluid.php
@@ -3,16 +3,10 @@
namespace RedBeanPHP\Repository;
use RedBeanPHP\OODBBean as OODBBean;
-use RedBeanPHP\Observable as Observable;
-use RedBeanPHP\Adapter\DBAdapter as DBAdapter;
-use RedBeanPHP\BeanHelper\FacadeBeanHelper as FacadeBeanHelper;
use RedBeanPHP\QueryWriter as QueryWriter;
use RedBeanPHP\RedException as RedException;
-use RedBeanPHP\RedException\Security as Security;
-use RedBeanPHP\SimpleModel as SimpleModel;
use RedBeanPHP\BeanHelper as BeanHelper;
use RedBeanPHP\RedException\SQL as SQLException;
-use RedBeanPHP\QueryWriter\AQueryWriter as AQueryWriter;
use RedBeanPHP\Repository as Repository;
/**
@@ -41,8 +35,6 @@ class Fluid extends Repository
* @param string $cast cast identifier
*
* @return integer
- *
- * @throws Security
*/
private function getTypeFromCast( $cast )
{
@@ -63,8 +55,8 @@ class Fluid extends Repository
* Orders the Query Writer to create a table if it does not exist already and
* adds a note in the build report about the creation.
*
- * @param OODBBean $bean bean to update report of
- * @param string $table table to check and create if not exists
+ * @param OODBBean $bean bean to update report of
+ * @param string $table table to check and create if not exists
*
* @return void
*/
@@ -149,12 +141,15 @@ class Fluid extends Repository
* adds a foreign key. Also adds a constraint in case the type is
* in the dependent list.
*
- * @param OODBBean $bean bean
- * @param array $ownAdditions list of addition beans in own-list
+ * Note that this method raises a custom exception if the bean
+ * is not an instance of OODBBean. Therefore it does not use
+ * a type hint. This allows the user to take action in case
+ * invalid objects are passed in the list.
+ *
+ * @param OODBBean $bean bean to process
+ * @param array $ownAdditions list of addition beans in own-list
*
* @return void
- *
- * @throws Security
*/
protected function processAdditions( $bean, $ownAdditions )
{
@@ -217,13 +212,11 @@ class Fluid extends Repository
}
/**
- * Handles\Exceptions. Suppresses exceptions caused by missing structures.
+ * Handles exceptions. Suppresses exceptions caused by missing structures.
*
- * @param\Exception $exception exception
+ * @param Exception $exception exception
*
* @return void
- *
- * @throws\Exception
*/
protected function handleException( \Exception $exception )
{
@@ -286,10 +279,7 @@ class Fluid extends Repository
* @param string $type type of bean you want to load
* @param integer $id ID of the bean you want to load
*
- * @throws SQL
- *
* @return OODBBean
- *
*/
public function load( $type, $id )
{
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/Repository/Frozen.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/Repository/Frozen.php
index 9f42d72f..7e7a53ef 100644
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/Repository/Frozen.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/Repository/Frozen.php
@@ -3,16 +3,10 @@
namespace RedBeanPHP\Repository;
use RedBeanPHP\OODBBean as OODBBean;
-use RedBeanPHP\Observable as Observable;
-use RedBeanPHP\Adapter\DBAdapter as DBAdapter;
-use RedBeanPHP\BeanHelper\FacadeBeanHelper as FacadeBeanHelper;
use RedBeanPHP\QueryWriter as QueryWriter;
use RedBeanPHP\RedException as RedException;
-use RedBeanPHP\RedException\Security as Security;
-use RedBeanPHP\SimpleModel as SimpleModel;
use RedBeanPHP\BeanHelper as BeanHelper;
use RedBeanPHP\RedException\SQL as SQLException;
-use RedBeanPHP\QueryWriter\AQueryWriter as AQueryWriter;
use RedBeanPHP\Repository as Repository;
/**
@@ -36,12 +30,11 @@ use RedBeanPHP\Repository as Repository;
class Frozen extends Repository
{
/**
- * Handles\Exceptions. Suppresses exceptions caused by missing structures.
+ * Handles exceptions. Suppresses exceptions caused by missing structures.
*
- * @param \Exception $exception exception
+ * @param \Exception $exception exception to handle
*
* @return void
- *
* @throws \Exception
*/
protected function handleException( \Exception $exception )
@@ -85,12 +78,16 @@ class Frozen extends Repository
* adds a foreign key. Also adds a constraint in case the type is
* in the dependent list.
*
- * @param OODBBean $bean bean
- * @param array $ownAdditions list of addition beans in own-list
+ * Note that this method raises a custom exception if the bean
+ * is not an instance of OODBBean. Therefore it does not use
+ * a type hint. This allows the user to take action in case
+ * invalid objects are passed in the list.
+ *
+ * @param OODBBean $bean bean to process
+ * @param array $ownAdditions list of addition beans in own-list
*
* @return void
- *
- * @throws Security
+ * @throws RedException
*/
protected function processAdditions( $bean, $ownAdditions )
{
@@ -124,7 +121,7 @@ class Frozen extends Repository
* configuration for you.
*
* @param string $type type of bean you want to dispense
- * @param string $number number of beans you would like to get
+ * @param int $number number of beans you would like to get
* @param boolean $alwaysReturnArray if TRUE always returns the result as an array
*
* @return OODBBean
@@ -134,6 +131,7 @@ class Frozen extends Repository
$OODBBEAN = defined( 'REDBEAN_OODBBEAN_CLASS' ) ? REDBEAN_OODBBEAN_CLASS : '\RedBeanPHP\OODBBean';
$beans = array();
for ( $i = 0; $i < $number; $i++ ) {
+ /** @var \RedBeanPHP\OODBBean $bean */
$bean = new $OODBBEAN;
$bean->initializeForDispense( $type, $this->oodb->getBeanHelper() );
$this->oodb->signal( 'dispense', $bean );
@@ -163,10 +161,8 @@ class Frozen extends Repository
* @param string $type type of bean you want to load
* @param integer $id ID of the bean you want to load
*
- * @throws SQL
- *
* @return OODBBean
- *
+ * @throws SQLException
*/
public function load( $type, $id )
{
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/SimpleModel.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/SimpleModel.php
index 17a54bc0..b7940f44 100755
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/SimpleModel.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/SimpleModel.php
@@ -1,4 +1,4 @@
-sharedTag;
$foundTags = array();
@@ -193,12 +193,12 @@ class TagManager
* If $tagList is a comma separated list of tags all tags will
* be associated with the bean.
* You may also pass an array instead of a string.
- *
+ *
* Tag list can be either an array with tag names or a comma separated list
* of tag names.
*
- * @param OODBBean $bean bean to add tags to
- * @param array|string $tagList list of tags to add to bean
+ * @param OODBBean $bean bean to add tags to
+ * @param array|string $tagList list of tags to add to bean
*
* @return void
*/
@@ -250,8 +250,8 @@ class TagManager
* Tag list can be either an array with tag names or a comma separated list
* of tag names.
*
- * @param string $beanType type of bean you are looking for
- * @param array|string $tagList list of tags to match
+ * @param string $beanType type of bean you are looking for
+ * @param array|string $tagList list of tags to match
*
* @return array
*/
diff --git a/server/vendor/gabordemooij/redbean/RedBeanPHP/ToolBox.php b/server/vendor/gabordemooij/redbean/RedBeanPHP/ToolBox.php
index ef60c0cf..9947b792 100755
--- a/server/vendor/gabordemooij/redbean/RedBeanPHP/ToolBox.php
+++ b/server/vendor/gabordemooij/redbean/RedBeanPHP/ToolBox.php
@@ -1,4 +1,4 @@
- 0) {
- echo 'Done!' .PHP_EOL;
+ echo 'Done!' ,PHP_EOL;
} else {
- echo 'Hm, something seems to have gone wrong... '.PHP_EOL;
+ echo 'Hm, something seems to have gone wrong... ',PHP_EOL;
}
}
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT.php
index 5c50c4e8..d2ceadb4 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT.php
@@ -19,6 +19,11 @@ use RedBeanPHP\Facade as R;
*/
abstract class RedUNIT
{
+ /**
+ * @var integer
+ */
+ protected $round;
+
/**
* @var string
*/
@@ -35,7 +40,7 @@ abstract class RedUNIT
public function prepare()
{
R::freeze( FALSE );
-
+
R::debug( FALSE );
R::nuke();
@@ -86,4 +91,34 @@ abstract class RedUNIT
{
$this->currentlyActiveDriverID = $driver;
}
+
+ /**
+ * Sets the round number.
+ *
+ * @param integer $roundNumber round
+ */
+ public function setRound( $roundNumber )
+ {
+ $this->round = (int) $roundNumber;
+ }
+
+ /**
+ * Returns the current round number
+ *
+ * @return integer
+ */
+ public function getRound()
+ {
+ return $this->round;
+ }
+
+ /**
+ * Returns TRUE if the current round is the first round.
+ *
+ * @return boolean
+ */
+ public function isFirstRound()
+ {
+ return ( $this->round === 0 );
+ }
}
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Aliasing.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Aliasing.php
index bfb896e7..e497f7eb 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Aliasing.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Aliasing.php
@@ -252,7 +252,8 @@ class Aliasing extends Base
list( $teacher, $student ) = R::dispense( 'person', 2 ) ;
$teacher->name = 'jimmy' ;
$student->name = 'jacko' ;
- R::store( $teacher, $student ) ;
+ R::store( $teacher ) ;
+ R::store( $student ) ;
$client = R::dispense( 'client' ) ;
$client->firm = 'bean AG' ;
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Arrays.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Arrays.php
index 1ad65223..dbdb284b 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Arrays.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Arrays.php
@@ -1,4 +1,4 @@
-name = 'bean';
$bean->taste = 'salty';
@@ -38,7 +38,7 @@ class Arrays extends Base
asrt( isset( $properties['id'] ), TRUE );
asrt( isset( $properties['name'] ), TRUE );
asrt( isset( $properties['taste'] ), TRUE );
-
+
$bean = R::dispense('bean');
$bean['name'] = 'bean';
$bean['taste'] = 'salty';
@@ -52,30 +52,30 @@ class Arrays extends Base
asrt( isset( $properties['name'] ), TRUE );
asrt( isset( $properties['taste'] ), TRUE );
}
-
+
/**
* Tests array access with lists.
- *
+ *
* @return void
*/
public function testArrayAccessAndLists()
{
$book = R::dispense('book');
$book['title'] = 'My Book';
-
+
//Can we add a bean in list with array access?
$book['ownPage'][] = R::dispense('page');
$book['ownPage'][] = R::dispense('page');
-
+
asrt( count( $book ), 3 );
-
+
$properties = array();
foreach($book as $key => $value) {
$properties[ $key ] = $value;
}
-
+
asrt( count( $properties ), 3 );
-
+
//Dont reveal aliased x-own and -List in foreach-loop
asrt( isset( $properties['id'] ), TRUE );
asrt( isset( $properties['title'] ), TRUE );
@@ -83,13 +83,13 @@ class Arrays extends Base
asrt( isset( $properties['ownPageList'] ), FALSE );
asrt( isset( $properties['xownPage'] ), FALSE );
asrt( isset( $properties['xownPageList'] ), FALSE );
-
+
//But keep them countable
asrt( count( $book['ownPage'] ), 2 );
asrt( count( $book['ownPageList'] ), 2 );
asrt( count( $book['xownPage'] ), 2 );
asrt( count( $book['xownPageList'] ), 2 );
-
+
//And reveal them with isset()
asrt( isset( $book['id'] ), TRUE );
asrt( isset( $book['title'] ), TRUE );
@@ -97,21 +97,21 @@ class Arrays extends Base
asrt( isset( $book['ownPageList'] ), TRUE );
asrt( isset( $book['xownPage'] ), TRUE );
asrt( isset( $book['xownPageList'] ), TRUE );
-
+
//Can we add using the List alias?
$book['ownPageList'][] = R::dispense('page');
asrt( count( $book['ownPage'] ), 3 );
asrt( count( $book['ownPageList'] ), 3 );
asrt( count( $book['xownPage'] ), 3 );
asrt( count( $book['xownPageList'] ), 3 );
-
+
//Can we add using the x-mode alias?
$book['ownPageList'][] = R::dispense('page');
asrt( count( $book['ownPage'] ), 4 );
asrt( count( $book['ownPageList'] ), 4 );
asrt( count( $book['xownPage'] ), 4 );
asrt( count( $book['xownPageList'] ), 4 );
-
+
//Can we unset using array access?
unset( $book['ownPage'] );
asrt( isset( $book['ownPage'] ), FALSE );
@@ -136,39 +136,39 @@ class Arrays extends Base
asrt( isset( $book['ownPageList'] ), FALSE );
asrt( isset( $book['xownPage'] ), FALSE );
asrt( isset( $book['xownPageList'] ), FALSE );
-
+
//does it work with shared lists as well?
$book['sharedCategory'] = array( R::dispense('category') );
asrt( count( $book ), 3 );
-
+
$properties = array();
foreach($book as $key => $value) {
$properties[ $key ] = $value;
}
-
+
asrt( isset( $properties['sharedCategory'] ), TRUE );
asrt( isset( $properties['sharedCategoryList'] ), FALSE );
-
+
asrt( isset( $book['sharedCategory'] ), TRUE );
asrt( isset( $book['sharedCategoryList'] ), TRUE );
-
+
asrt( count( $book['sharedCategory'] ), 1 );
asrt( count( $book['sharedCategoryList'] ), 1 );
-
+
$book['sharedCategory'][] = R::dispense( 'category' );
-
+
asrt( count( $book['sharedCategory'] ), 2 );
asrt( count( $book['sharedCategoryList'] ), 2 );
-
+
$book['sharedCategoryList'][] = R::dispense( 'category' );
-
+
asrt( count( $book['sharedCategory'] ), 3 );
asrt( count( $book['sharedCategoryList'] ), 3 );
}
-
+
/**
* Tests array access with parent beans.
- *
+ *
* @return void
*/
public function testArrayAccessWithBeans()
@@ -194,10 +194,10 @@ class Arrays extends Base
asrt( isset( $book['author'] ), FALSE );
asrt( count( $book ), 1 );
}
-
+
/**
* Tests array access with CRUD operations.
- *
+ *
* @return void
*/
public function testArrayAccessWithCRUD()
@@ -206,7 +206,7 @@ class Arrays extends Base
$book = R::dispense( 'book' );
$book['ownPageList'] = R::dispense( 'page', 3 );
R::store( $book );
-
+
$book = $book->fresh();
//note that isset first returns false, so you can check if a list is loaded
asrt( isset( $book['ownPage'] ), FALSE );
@@ -225,10 +225,10 @@ class Arrays extends Base
asrt( count( $book['ownPageList'] ), 3 );
$book = $book->fresh();
asrt( count( $book['xownPageList'] ), 3 );
-
+
$book['ownPage'][] = R::dispense( 'page' );
R::store( $book );
-
+
$book = $book->fresh();
asrt( count( $book['ownPage'] ), 4 );
$book = $book->fresh();
@@ -237,7 +237,7 @@ class Arrays extends Base
asrt( count( $book['ownPageList'] ), 4 );
$book = $book->fresh();
asrt( count( $book['xownPageList'] ), 4 );
-
+
//does dependency still work?
$book['xownPageList'] = array();
R::store( $book );
@@ -249,11 +249,11 @@ class Arrays extends Base
asrt( count( $book['ownPageList'] ), 0 );
$book = $book->fresh();
asrt( count( $book['xownPageList'] ), 0 );
-
+
//does shared list work as well?
$book['sharedTag'] = R::dispense( 'tag', 2 );
R::store( $book );
-
+
$book = $book->fresh();
//note that isset first returns false, so you can check if a list is loaded
asrt( isset( $book['sharedTagList'] ), FALSE );
@@ -263,18 +263,17 @@ class Arrays extends Base
asrt( count( $book['sharedTag'] ), 2 );
asrt( isset( $book['sharedTagList'] ), TRUE );
asrt( isset( $book['sharedTag'] ), TRUE );
-
-
+
$book['sharedTag'][] = R::dispense( 'tag' );
R::store( $book );
-
+
$book = $book->fresh();
asrt( count( $book['sharedTagList'] ), 3 );
asrt( count( $book['sharedTag'] ), 3 );
-
+
$book['sharedTagList'][] = R::dispense( 'tag' );
R::store( $book );
-
+
$book = $book->fresh();
asrt( count( $book['sharedTagList'] ), 4 );
asrt( count( $book['sharedTag'] ), 4 );
@@ -288,16 +287,16 @@ class Arrays extends Base
$first = reset( $book['sharedBookList'] );
$id = $first['id'];
asrt( count( $book['sharedBookList'][$id]['sharedBookList'] ), 1 );
-
+
$properties = array();
foreach($book as $key => $value) {
$properties[ $key ] = $value;
}
-
+
asrt( count( $properties ), 2 );
$keys = array_keys( $properties );
sort( $keys );
asrt( implode( ',', $keys ), 'id,sharedBook' );
}
-
+
}
\ No newline at end of file
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Association.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Association.php
index 98cc5836..9887ca2f 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Association.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Association.php
@@ -170,6 +170,14 @@ class Association extends Base
R::storeAll( array( $author, $bio ) );
+ $x = $author->one( 'bio' );
+ $y = $bio->one('author');
+
+ asrt( $x->name, $bio->name );
+ asrt( $y->name, $author->name );
+ asrt( $x->id, $bio->id );
+ asrt( $y->id, $author->id );
+
$id2 = $author->id;
list( $a, $b ) = R::loadMulti( 'author,bio', $id1 );
@@ -310,7 +318,6 @@ class Association extends Base
asrt( count( $wines[2]->sharedOlive ), 0 );
}
-
public function testErrorHandling()
{
R::nuke();
@@ -345,7 +352,6 @@ class Association extends Base
fail();
}
-
}
}
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Bean.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Bean.php
index 4abfe699..1aff3715 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Bean.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Bean.php
@@ -53,7 +53,7 @@ class Bean extends Base
asrt( isset( $columns['xownerCritic'] ), FALSE );
asrt( isset( $columns['sharedbyReader'] ), FALSE );
}
-
+
/**
* Other tests...
*/
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Boxing.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Boxing.php
index ff3ce37a..33b1dd90 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Boxing.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Boxing.php
@@ -72,4 +72,3 @@ class Boxing extends Base
}
}
-
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Chill.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Chill.php
index 71db71d2..86524b27 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Chill.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Chill.php
@@ -99,7 +99,6 @@ class Chill extends Base
}
asrt(R::count('person_role'), 2);
-
R::nuke();
$link = R::getRedBean()->dispense('person_role');
$person = R::dispense( 'person' );
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Close.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Close.php
index 511f748b..573123ed 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Close.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Close.php
@@ -38,4 +38,3 @@ class Close extends Base
}
}
-
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Count.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Count.php
index dad1d405..c914f599 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Count.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Count.php
@@ -50,7 +50,6 @@ class Count extends Base
}
}
-
/**
* Test count and wipe.
*
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Cross.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Cross.php
index b77559fd..d8f1fae3 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Cross.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Cross.php
@@ -461,7 +461,7 @@ class Cross extends Base
$text->content = 'CHANGED';
}
foreach( $texts as $text ) {
- asrt( $text->content, 'CHANGED', TRUE );
+ asrt( $text->content, 'CHANGED' );
}
}
@@ -504,7 +504,7 @@ class Cross extends Base
$text->content = 'CHANGED';
}
foreach( $texts as $text ) {
- asrt( $text->content, 'CHANGED', TRUE );
+ asrt( $text->content, 'CHANGED' );
}
}
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Cursors.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Cursors.php
index 3fcc0bf0..2168a475 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Cursors.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Cursors.php
@@ -61,7 +61,7 @@ class Cursors extends Base
if ( $i > 5 ) break;
}
$key = array_rand( $list );
- $content = $list[ $key ];
+ $content = $list[ $key ];
$collection = R::findCollection( 'page', ' content = ? ', array( $content ) );
$bean = $collection->next();
asrt( $bean->content, $content );
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Database.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Database.php
index 15bd2e7c..60d0b4c8 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Database.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Database.php
@@ -161,7 +161,7 @@ class Database extends Base
$expect = '{"1":"a","2":"c"}';
asrt( json_encode( R::getAssoc( 'SELECT id, a FROM page' ) ), $expect );
-
+
$expect = '{"1":{"a":"a","b":"b"},"2":{"a":"c","b":"d"}}';
asrt( json_encode( R::getAssoc( 'SELECT id, a, b FROM page' ) ), $expect );
@@ -391,4 +391,3 @@ class TroubleDapter extends DBAdapter
}
}
-
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Dispense.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Dispense.php
index 25c25652..62c270e8 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Dispense.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Dispense.php
@@ -70,7 +70,6 @@ class Dispense extends Base
asrt( isset( $bean["abc"] ), TRUE );
}
-
/**
* Tests the facade-only dispenseAll method.
*
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Dup.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Dup.php
index 73560153..d352b720 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Dup.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Dup.php
@@ -424,7 +424,7 @@ class Dup extends Base
* }}'
*/
- $d->setTables( $cache, 1 );
+ $d->setTables( $cache );
ob_start();
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Finding.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Finding.php
index 48bbb121..a5d309fd 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Finding.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Finding.php
@@ -663,6 +663,10 @@ class Finding extends Base {
$logger->clear();
$found = R::findOne( 'book', ' title = ? LIMIT 1', array( 'b' ) );
asrt( count( $logger->grep('LIMIT 1') ), 1 );
+ $logger->clear();
+ $found = R::findOne( 'book', ' title = ? limit 1', array( 'b' ) );
+ asrt( count( $logger->grep('LIMIT 1') ), 0 );
+ asrt( count( $logger->grep('limit 1') ), 1 );
asrt( ( $found instanceof \RedBeanPHP\OODBBean ), TRUE );
$found = R::findOne( 'book', ' title = ? LIMIT 2', array( 'b' ) );
asrt( count( $logger->grep('LIMIT 2') ), 1 );
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Foreignkeys.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Foreignkeys.php
index 747bf3bf..19428da9 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Foreignkeys.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Foreignkeys.php
@@ -9,7 +9,6 @@ use RedBeanPHP\OODBBean as OODBBean;
use RedBeanPHP\Adapter as Adapter;
use RedBeanPHP\QueryWriter\AQueryWriter as AQueryWriter;
-
/**
* Foreignkeys
*
@@ -229,7 +228,7 @@ class Foreignkeys extends Base implements Observer
* @return void
*/
public function testDependency2()
- {
+ {
$can = $this->createBeanInCan( TRUE );
asrt( R::count( 'bean' ), 1 );
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Fuse.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Fuse.php
index 0ced24c1..f8851795 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Fuse.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Fuse.php
@@ -158,7 +158,7 @@ class Fuse extends Base
asrt( $probe->getLogActionCount( 'after_delete' ), 0 );
asrt( ( $probe->getDataFromLog( 2, 'bean' ) === $probe ), TRUE );
}
-
+
/**
* Tests the SimpleFacadeBeanHelper factory setter.
*
@@ -336,7 +336,7 @@ class Fuse extends Base
asrt( $old[1], NULL);
$test->nonExistantMethod(); //we cant really test this... :(
pass();
-
+
$old = R::setErrorHandlingFUSE( OODBBean::C_ERR_NOTICE );
asrt( is_array( $old ), TRUE );
asrt( count( $old ), 2 );
@@ -347,7 +347,7 @@ class Fuse extends Base
}, E_USER_NOTICE);
$test->nonExistantMethod();
restore_error_handler();
-
+
$old = OODBBean::setErrorHandlingFUSE( OODBBean::C_ERR_WARN );
asrt( is_array( $old ), TRUE );
asrt( count( $old ), 2 );
@@ -358,7 +358,7 @@ class Fuse extends Base
}, E_USER_WARNING);
$test->nonExistantMethod();
restore_error_handler();
-
+
$old = OODBBean::setErrorHandlingFUSE( OODBBean::C_ERR_FATAL );
asrt( is_array( $old ), TRUE );
asrt( count( $old ), 2 );
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Joins.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Joins.php
index eb13c3ba..2bb4f460 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Joins.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Joins.php
@@ -6,7 +6,6 @@ use RedUNIT\Base as Base;
use RedBeanPHP\Facade as R;
use RedBeanPHP\OODBBean as OODBBean;
-
/**
* Joins
*
@@ -106,10 +105,10 @@ class Joins extends Base
/**
* Helper for the next test.
- *
+ *
* @param array $books the books we are going to check
* @param string $numberList the numbers that are expected
- *
+ *
* @return void
*/
private function checkBookNumbers( $books, $numberList )
@@ -190,7 +189,7 @@ class Joins extends Base
$books = $author->with(' ORDER BY @joined.category.title DESC, @joined.info.title ASC' )->ownBookList;
$this->checkBookNumbers( $books, '3,2,0,1' );
$books = $author->with(' ORDER BY @joined.category.title DESC, @joined.info.title ASC LIMIT 2' )->ownBookList;
- $this->checkBookNumbers( $books, '3,2' );
+ $this->checkBookNumbers( $books, '3,2' );
}
/**
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Keywords.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Keywords.php
index e343f000..9a5c6a1a 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Keywords.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Keywords.php
@@ -48,7 +48,6 @@ class Keywords extends Base
'distinct', 'like'
);
-
foreach ( $keywords as $k ) {
R::nuke();
@@ -76,6 +75,5 @@ class Keywords extends Base
pass();
}
-
}
}
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Largenum.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Largenum.php
index b7c0d87c..9a3cb4a8 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Largenum.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Largenum.php
@@ -22,7 +22,7 @@ class Largenum extends Base
/**
* Test for issue #386.
* Can we use large numbers in LIMIT ?
- *
+ *
* @return void
*/
public function testLargeNum()
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Logging.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Logging.php
index 29d80620..59090574 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Logging.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Logging.php
@@ -5,7 +5,7 @@ namespace RedUNIT\Base;
use RedUNIT\Base as Base;
use RedBeanPHP\Facade as R;
use RedBeanPHP\Logger as Logger;
-use RedBeanPHP\Logger\RDefault as RDefault;
+use RedBeanPHP\Logger\RDefault as RDefault;
/**
* Logging
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Misc.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Misc.php
index 16a3fbe7..95caed61 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Misc.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Misc.php
@@ -28,6 +28,37 @@ use RedBeanPHP\Driver\RPDO as RPDO;
*/
class Misc extends Base
{
+ /**
+ * Test whether we can set the 'auto clear'
+ * option in OODB.
+ *
+ * @return void
+ */
+ public function testAutoClearHistory()
+ {
+ testpack( 'Auto clear history' );
+ $book = R::dispense( 'book' );
+ $book->pages = 100;
+ $book->title = 'book';
+ R::store( $book );
+ $book = R::findOne( 'book' );
+ asrt( $book->hasChanged( 'title' ), FALSE );
+ $book->title = 'yes';
+ R::store( $book );
+ asrt( $book->hasChanged( 'title' ), TRUE );
+ OODB::autoClearHistoryAfterStore( TRUE );
+ $book = R::findOne( 'book' );
+ asrt( $book->hasChanged( 'title' ), FALSE );
+ $book->title = 'yes2';
+ R::store( $book );
+ asrt( $book->hasChanged( 'title' ), FALSE );
+ OODB::autoClearHistoryAfterStore( FALSE );
+ $book = R::findOne( 'book' );
+ asrt( $book->hasChanged( 'title' ), FALSE );
+ $book->title = 'yes';
+ R::store( $book );
+ asrt( $book->hasChanged( 'title' ), TRUE );
+ }
/**
* Tests the R::inspect() method on the Facade.
@@ -584,7 +615,6 @@ class Misc extends Base
asrt( R::count( 'flavour' ), 4 );
}
-
/**
* Test trashAll().
*/
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Performance.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Performance.php
index 9492f390..58fa3324 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Performance.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Performance.php
@@ -1,16 +1,16 @@
-title = 'book';
@@ -55,16 +55,16 @@ class Performance extends Base
$book->sharedTagList = $tags;
R::store( $book );
}
-
+
/**
* CRUD performance.
- *
+ *
* @return void
*/
public function crud()
{
R::freeze( TRUE );
-
+
$book = R::dispense( 'book' );
$book->title = 'Book';
$page = R::dispense('page');
@@ -87,18 +87,18 @@ class Performance extends Base
$book->ownPage;
$book->sharedTag;
R::trash( $book );
-
+
}
-
+
/**
* CRUD performance Array Access.
- *
+ *
* @return void
*/
public function crudaa()
{
R::freeze( TRUE );
-
+
$book = R::dispense( 'book' );
$book['title'] = 'Book';
$page = R::dispense('page');
@@ -121,6 +121,6 @@ class Performance extends Base
$book->ownPage;
$book->sharedTag;
R::trash( $book );
-
+
}
}
\ No newline at end of file
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Prefixes.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Prefixes.php
index c8ee53aa..d18edd6f 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Prefixes.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Prefixes.php
@@ -37,7 +37,7 @@ class Prefixes extends Base
* Test prerequisites.
*/
public function testPrerequisites()
- {
+ {
R::nuke();
$bean = R::xdispense( 'type_with_underscore' );
asrt( ( $bean instanceof OODBBean ), TRUE );
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Relations.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Relations.php
index 37529ab5..b5c7de38 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Relations.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Relations.php
@@ -981,12 +981,10 @@ class Relations extends Base
// Get books for topic
asrt( $topic3->countShared('book'), 2 );
-
$t3 = R::load( 'topic', $topic3->id );
asrt( count( $t3->sharedBook ), 2 );
-
// Nuke an own-array, replace entire array at once without getting first
$page2->id = 0;
$page2->title = 'yet another page 2';
@@ -1420,7 +1418,6 @@ class Relations extends Base
$v2->name = 'Ville 2';
$v3->name = 'Ville 3';
-
$v1->link( 'armyVillage' )->army = $a3;
$v2->link( 'army_village' )->army = $a2;
$v3->link( 'armyVillage' )->army = $a1;
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Traverse.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Traverse.php
index 4c92e84c..fa3c5692 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Traverse.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Traverse.php
@@ -149,7 +149,6 @@ class Traverse extends Base
asrt( implode( ',', $path ), 'e,f,h' );
-
$path = array();
$pageA->traverse( 'ownPageList', function( $page ) use ( &$path ) {
$path[] = $page->title;
@@ -226,7 +225,6 @@ class Traverse extends Base
} );
asrt( implode( ',', $cats ), 'SF,Fantasy' );
-
$catList = array();
$fantasy->alias( 'genre' )
->with( ' ORDER BY gname ASC ' )
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Update.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Update.php
index 0bdc8a59..faab8124 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Update.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Update.php
@@ -176,7 +176,6 @@ class Update extends Base
$account = R::load( 'user', $id );
asrt( count( $account->alias( 'seller' )->ownTransaction ), 10 );
-
$account->alias( 'seller' )->ownTransaction = array();
$id = R::store( $account );
@@ -507,7 +506,7 @@ class Update extends Base
asrt( (int) $pdo->GetCell( "SELECT count(*) FROM page" ), 0 );
}
-
+
public function testEmptyStringShouldNotBeStoredAsInteger()
{
R::nuke();
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Via.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Via.php
index fdf7c1cd..319b3b2f 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Via.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/Via.php
@@ -91,7 +91,6 @@ class Via extends Base
$book->via('garbage')->item = 'test';
asrt( count( $book->sharedPageList ), 1 );
-
//yet another
$book = R::dispense('leaflet');
$book->title = 'leaflet';
@@ -189,7 +188,6 @@ class Via extends Base
R::storeAll(array( $p1, $p2 ));
-
$project = R::load('project', $x1->id);
$designers = $project
@@ -201,7 +199,6 @@ class Via extends Base
asrt(count($designers), 1);
asrt($anna->name, 'Anna');
-
$coders = $project
->withCondition(' participant.arole = ? ', array( 'coder' ) )
->via( 'participant' )
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/With.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/With.php
index d2f6f8fe..10817f1c 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/With.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Base/With.php
@@ -107,7 +107,6 @@ class With extends Base
}
-
/**
* Test all().
*
@@ -466,7 +465,6 @@ class With extends Base
$book->ownPage[] = R::dispense( 'page' );
asrt( count( $book->ownPageList ), 4 );
-
//Do not reload an own list if told to not reload using noLoad()
$book->noLoad()->with(' LIMIT 1 ')->ownPage; //dont reload!
asrt( count( $book->xownPage ), 0); //dont reload!
@@ -529,7 +527,6 @@ class With extends Base
$book->sharedTag = R::dispense( 'tag', 16 );
asrt( count( $book->sharedTag ), 16 );
-
//Do not reload a sharedTag list if told to not reload using noLoad()
$book->noLoad()->with(' LIMIT 1 ')->sharedTag; //dont reload!
asrt( count( $book->sharedTag ), 0); //dont reload!
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Blackhole/Debug.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Blackhole/Debug.php
index b8d50eb3..19c13e36 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Blackhole/Debug.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Blackhole/Debug.php
@@ -118,7 +118,6 @@ class Debug extends Blackhole
$this->testDebug(':a,?', array(':a'=>20, 30), '20,30');
$this->testDebug(':a,?', array(30, ':a'=>20), '20,30');
-
$this->testDebug('?,?', array('test',20), '\'test\',20');
$this->testDebug('?', array( NULL ), 'NULL');
$this->testDebug('title = ?', array( NULL ), 'title = NULL');
@@ -129,7 +128,7 @@ class Debug extends Blackhole
$this->testDebug('?,?', array('hello'), '\'hello\',:slot1');
$this->testDebug('hello ?', 'world', 'hello ?');
-
+
$this->testDebug(':slot0 :slot1 :slot2 :slot3 :slot4 :slot5 :slot6 :slot7 :slot8 :slot9 :slot10', array(
'a','b','c','d','e','f','g','h','i','j','k'
),"'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k'");
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Blackhole/Fusebox.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Blackhole/Fusebox.php
index 522440a6..350ca444 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Blackhole/Fusebox.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Blackhole/Fusebox.php
@@ -69,4 +69,3 @@ class Fusebox extends Blackhole
}
}
-
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Blackhole/Misc.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Blackhole/Misc.php
index 88dbbbb7..cac84133 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Blackhole/Misc.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Blackhole/Misc.php
@@ -256,7 +256,6 @@ class Misc extends Blackhole
$bean->name = 'a';
-
try {
R::transaction( function () use ( $bean ) {
R::store( $bean );
@@ -336,7 +335,6 @@ class Misc extends Blackhole
testpack( 'Misc Tests' );
-
R::debug( 1 );
flush();
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Blackhole/Toolbox.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Blackhole/Toolbox.php
index f749b37b..58719ddf 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Blackhole/Toolbox.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Blackhole/Toolbox.php
@@ -13,7 +13,7 @@ use RedBeanPHP\BeanHelper\SimpleFacadeBeanHelper as SimpleFacadeBeanHelper;
use RedBeanPHP\Repository as Repository;
use RedBeanPHP\Repository\Fluid as FluidRepo;
use RedBeanPHP\Repository\Frozen as FrozenRepo;
-
+use RedBeanPHP\RedException as RedException;
/**
* Toolbox
@@ -29,6 +29,22 @@ use RedBeanPHP\Repository\Frozen as FrozenRepo;
*/
class Toolbox extends Blackhole {
+ /**
+ * Github issue #458, selectDatabase causes PHP notice undefined index
+ * if database key not found.
+ *
+ * @return void
+ */
+ public function testInvalidDB()
+ {
+ try {
+ R::selectDatabase( 'idontexist' );
+ fail();
+ } catch ( RedException $exception ) {
+ pass();
+ }
+ }
+
/**
* Test whether we can obtain a toolbox properly.
*
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/CUBRID.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/CUBRID.php
index 469ec6f5..0338d791 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/CUBRID.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/CUBRID.php
@@ -1,5 +1,5 @@
-getWriter();
$redbean = $toolbox->getRedBean();
$pdo = $adapter->getDatabase();
-
+
$writer->createTable( "testtable" );
$writer->addColumn( "testtable", "special", CUBRID::C_DATATYPE_SPECIAL_DATE );
-
+
$cols = $writer->getColumns( "testtable" );
asrt( $writer->code( $cols['special'], TRUE ), CUBRID::C_DATATYPE_SPECIAL_DATE );
-
+
asrt( $writer->code( $cols['special'], FALSE ), CUBRID::C_DATATYPE_SPECIFIED );
-
+
$writer->addColumn( "testtable", "special2", CUBRID::C_DATATYPE_SPECIAL_DATETIME );
-
+
$cols = $writer->getColumns( "testtable" );
asrt( $writer->code( $cols['special2'], TRUE ), CUBRID::C_DATATYPE_SPECIAL_DATETIME );
-
+
asrt( $writer->code( $cols['special'], FALSE ), CUBRID::C_DATATYPE_SPECIFIED );
-
-
+
}
-
+
}
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Foreignkeys.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Foreignkeys.php
index 6a99d1ca..6ee4ae64 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Foreignkeys.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Foreignkeys.php
@@ -276,7 +276,6 @@ class Foreignkeys extends Mysql
//Now add non-dep key
R::nuke();
-
$sql = '
CREATE TABLE book (
id INT( 11 ) UNSIGNED NULL AUTO_INCREMENT,
@@ -363,7 +362,6 @@ class Foreignkeys extends Mysql
$writer->addIndex('song', 'index1', 'album_id');
-
$indexes = R::getAll( 'SHOW INDEX FROM song' );
asrt( count( $indexes ), 2 );
@@ -379,7 +377,6 @@ class Foreignkeys extends Mysql
asrt( count( $indexes ), 3 );
-
//Dont fail, just dont
try {
$writer->addIndex('song', 'index3', 'nonexistant');
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Issue411.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Issue411.php
index f6141a3c..cc93bb52 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Issue411.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Issue411.php
@@ -55,6 +55,3 @@ class Issue411 extends Mysql
}
}
-
-
-
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Mix.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Mix.php
index 6495308f..102fefdc 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Mix.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Mix.php
@@ -145,6 +145,3 @@ class Mix extends Mysql
}
}
-
-
-
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Setget.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Setget.php
index 11c642e1..cbf2db08 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Setget.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Setget.php
@@ -48,6 +48,11 @@ class Setget extends Mysql
asrt( setget( "1.0" ), "1" );
asrt( setget( 1.0 ), "1" );
+ asrt( setget( "3.20" ), "3.20" );
+ asrt( setget( "13.20" ), "13.20" );
+ asrt( setget( "134.20" ), "134.20" );
+ asrt( setget( 3.21 ), '3.21' );
+
asrt( setget( "0.12345678" ), "0.12345678" );
asrt( setget( 0.12345678 ), "0.12345678" );
@@ -133,8 +138,8 @@ class Setget extends Mysql
asrt( setget( "NULL" ), "NULL" );
asrt( setget( "NULL" ), "NULL" );
- asrt( setget( "0123", 1 ), "0123" );
- asrt( setget( "0000123", 1 ), "0000123" );
+ asrt( setget( "0123" ), "0123" );
+ asrt( setget( "0000123" ), "0000123" );
asrt( setget( NULL ), NULL );
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Writer.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Writer.php
index b5c9e950..e1f2c82b 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Writer.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Mysql/Writer.php
@@ -157,7 +157,7 @@ class Writer extends \RedUNIT\Mysql
asrt( $writer->scanType( FALSE ), MySQL::C_DATATYPE_BOOL );
asrt( $writer->scanType( TRUE ), MySQL::C_DATATYPE_BOOL );
asrt( $writer->scanType( INF ), MySQL::C_DATATYPE_TEXT7 );
-
+
asrt( $writer->scanType( NULL ), MySQL::C_DATATYPE_BOOL );
asrt( $writer->scanType( 2 ), MySQL::C_DATATYPE_UINT32 );
@@ -179,6 +179,10 @@ class Writer extends \RedUNIT\Mysql
asrt( $writer->scanType( "2001-10-10 10:00:00" ), MySQL::C_DATATYPE_TEXT7 );
+ asrt( $writer->scanType( "1.23", TRUE ), MySQL::C_DATATYPE_SPECIAL_MONEY );
+ asrt( $writer->scanType( "12.23", TRUE ), MySQL::C_DATATYPE_SPECIAL_MONEY );
+ asrt( $writer->scanType( "124.23", TRUE ), MySQL::C_DATATYPE_SPECIAL_MONEY );
+
asrt( $writer->scanType( str_repeat( "lorem ipsum", 100 ) ), MySQL::C_DATATYPE_TEXT16 );
$writer->widenColumn( "testtable", "c1", MySQL::C_DATATYPE_UINT32 );
@@ -544,6 +548,37 @@ class Writer extends \RedUNIT\Mysql
asrt( $cols['date'], 'date' );
}
+ /**
+ * Test money types.
+ *
+ * @return void
+ */
+ public function testTypesMon()
+ {
+ $bean = R::dispense( 'bean' );
+
+ $bean->amount = '22.99';
+
+ R::store( $bean );
+
+ $cols = R::getColumns( 'bean' );
+
+ asrt( $cols['amount'], 'decimal(10,2)' );
+
+ R::nuke();
+
+ $bean = R::dispense( 'bean' );
+
+ $bean->amount = '-22.99';
+
+ R::store( $bean );
+
+ $cols = R::getColumns( 'bean' );
+
+ asrt( $cols['amount'], 'decimal(10,2)' );
+ }
+
+
/**
* Date-time
*
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Postgres/Setget.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Postgres/Setget.php
index a38b9665..25a485cc 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Postgres/Setget.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Postgres/Setget.php
@@ -35,6 +35,11 @@ class Setget extends Postgres
asrt( setget( "-0.25" ), "-0.25" );
asrt( setget( -0.25 ), "-0.25" );
+ asrt( setget( "3.20" ), "3.20" );
+ asrt( setget( "13.20" ), "13.20" );
+ asrt( setget( "134.20" ), "134.20" );
+ asrt( setget( 3.21 ), '3.21' );
+
asrt( setget( "0.12345678" ), "0.12345678" );
asrt( setget( 0.12345678 ), "0.12345678" );
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Postgres/Uuid.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Postgres/Uuid.php
index 85f415a6..0b7d82aa 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Postgres/Uuid.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Postgres/Uuid.php
@@ -171,7 +171,6 @@ class Uuid extends Postgres
$id = R::store( $mansion );
//exit;
-
asrt( is_string( $id ), TRUE );
asrt( strlen( $id ), 36 );
$haunted = R::load( 'mansion', $id );
diff --git a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Postgres/Writer.php b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Postgres/Writer.php
index 9d47cfed..fbc2ed1a 100644
--- a/server/vendor/gabordemooij/redbean/testing/RedUNIT/Postgres/Writer.php
+++ b/server/vendor/gabordemooij/redbean/testing/RedUNIT/Postgres/Writer.php
@@ -500,6 +500,36 @@ class Writer extends Postgres
asrt( $bean->circle, '<(9.2,1.2),7.9>' );
}
+ /**
+ * Test money types.
+ *
+ * @return void
+ */
+ public function testTypesMon()
+ {
+ $bean = R::dispense( 'bean' );
+
+ $bean->amount = '22.99';
+
+ R::store( $bean );
+
+ $cols = R::getColumns( 'bean' );
+
+ asrt( $cols['amount'], 'numeric' );
+
+ R::nuke();
+
+ $bean = R::dispense( 'bean' );
+
+ $bean->amount = '-22.99';
+
+ R::store( $bean );
+
+ $cols = R::getColumns( 'bean' );
+
+ asrt( $cols['amount'], 'numeric' );
+ }
+
/**
* Test money data type.
*
diff --git a/server/vendor/gabordemooij/redbean/testing/cli/plugins/myhooks.php b/server/vendor/gabordemooij/redbean/testing/cli/plugins/myhooks.php
index 8bee3621..38699946 100644
--- a/server/vendor/gabordemooij/redbean/testing/cli/plugins/myhooks.php
+++ b/server/vendor/gabordemooij/redbean/testing/cli/plugins/myhooks.php
@@ -8,7 +8,7 @@ require('../RedBeanPHP/QueryWriter/CUBRID.php');
//Define extra test packages from the hook
$extraTestsFromHook = array(
'CUBRID/Setget',
- 'CUBRID/Writer'
+ 'CUBRID/Writer'
);
//Create a connection for this database
diff --git a/server/vendor/gabordemooij/redbean/testing/cli/runperf.php b/server/vendor/gabordemooij/redbean/testing/cli/runperf.php
index 5bb7d4e8..1d584d56 100644
--- a/server/vendor/gabordemooij/redbean/testing/cli/runperf.php
+++ b/server/vendor/gabordemooij/redbean/testing/cli/runperf.php
@@ -9,7 +9,6 @@ require 'RedUNIT.php';
require 'RedUNIT/Base.php';
require 'RedUNIT/Base/Performance.php';
-
error_reporting( E_ALL );
//Load configuration file
@@ -19,7 +18,6 @@ if ( file_exists( 'config/test.ini' ) ) {
die( 'Cant find configuration file.' );
}
-
//Configure the databases
if ( isset( $ini['mysql'] ) ) {
$dsn = "mysql:host={$ini['mysql']['host']};dbname={$ini['mysql']['schema']}";
@@ -52,34 +50,32 @@ $test = new \RedUNIT\Base\Performance();
$drivers = $test->getTargetDrivers();
-
-
foreach ( $drivers as $driver ) {
-
+
if ( !isset( $ini[$driver] ) ) continue;
if ( !isset( $_SERVER['argv'][1])) die('Missing parameter. Usage: php runperf.php ');
-
+
$method = $_SERVER['argv'][1];
-
+
if ($method === 'setup') {
-
+
echo 'Setup...'.PHP_EOL;
-
+
$test->$method();
echo 'READY'.PHP_EOL;
-
+
} else {
-
+
$times = 100;
if (isset($_SERVER['argv'][2])) {
$times = (int) $_SERVER['argv'][2];
}
-
+
echo "Performing test: $method with driver $driver ".PHP_EOL;
for ($j=0; $j<$times; $j++) {
-
+
$t1 = microtime( TRUE );
$test->$method();
@@ -87,14 +83,14 @@ foreach ( $drivers as $driver ) {
$t2 = microtime( TRUE );
$d[] = ($t2 - $t1);
-
+
}
-
+
$s = array_sum($d);
$a = ($s / $times);
$mx = max($d);
$mn = min($d);
-
+
echo PHP_EOL."AVG: $a, MAX: $mx, MIN: $mn, TOTAL: $s, TIMES: $times ".PHP_EOL;
}
}
\ No newline at end of file
diff --git a/server/vendor/gabordemooij/redbean/testing/cli/runtests.php b/server/vendor/gabordemooij/redbean/testing/cli/runtests.php
index e48daff8..c754e3a5 100644
--- a/server/vendor/gabordemooij/redbean/testing/cli/runtests.php
+++ b/server/vendor/gabordemooij/redbean/testing/cli/runtests.php
@@ -2,7 +2,6 @@
chdir( '..' );
-
$xdebugSupported = (function_exists('xdebug_start_code_coverage'));
if ($xdebugSupported) xdebug_start_code_coverage( XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE );
@@ -26,7 +25,6 @@ echo '*** RedUNIT ***'.PHP_EOL;
echo 'Welcome to RedUNIT Unit testing framework for RedBeanPHP.'.PHP_EOL;
echo PHP_EOL;
-
/**
* Define some globals.
*/
@@ -44,7 +42,6 @@ require_once( 'RedUNIT/Mysql.php' );
require_once( 'RedUNIT/Postgres.php' );
require_once( 'RedUNIT/Sqlite.php' );
-
require_once( 'RedUNIT/Pretest.php' );
$extraTestsFromHook = array();
@@ -91,7 +88,6 @@ function activate_driver( $d )
R::selectDatabase( $d );
}
-
$arguments = $_SERVER['argc'];
$mode = 'all';
@@ -198,8 +194,6 @@ $suffix = array(
'Base/Close'
);
-
-
// Default (mode == all)
if ( $mode == 'all' ) {
$packList = $allPacks;
@@ -237,6 +231,9 @@ foreach ( $packList as $testPack ) {
maintestpack( str_replace( '_', ' ', get_class( $test ) ) );
+ $round = 0;
+ $test->setRound( $round );
+
if ( $drivers && is_array( $drivers ) ) {
foreach ( $drivers as $driver ) {
if ( !isset( $ini[$driver] ) ) continue;
@@ -267,6 +264,7 @@ foreach ( $packList as $testPack ) {
}
echo PHP_EOL;
+ $test->setRound( ++$round );
}
} else {
@@ -276,7 +274,6 @@ foreach ( $packList as $testPack ) {
}
}
-
if (!$xdebugSupported) {
echo 'Done. No report - XDEBUG not installed.';
exit(0);
diff --git a/server/vendor/gabordemooij/redbean/testing/cli/test_hook_example.php b/server/vendor/gabordemooij/redbean/testing/cli/test_hook_example.php
index 892b7dd6..ab86d265 100644
--- a/server/vendor/gabordemooij/redbean/testing/cli/test_hook_example.php
+++ b/server/vendor/gabordemooij/redbean/testing/cli/test_hook_example.php
@@ -1,14 +1,14 @@
add 1 additional path which will be searched for unit tests
* $extraTestsFromHook -> array with additional test packs (will be executed if you pass 'all' argument to CLI runner)
- *
- *
+ *
+ *
*/
\ No newline at end of file
diff --git a/server/vendor/gabordemooij/redbean/testing/helpers/classes.php b/server/vendor/gabordemooij/redbean/testing/helpers/classes.php
index aedae9cb..d3a897b9 100644
--- a/server/vendor/gabordemooij/redbean/testing/helpers/classes.php
+++ b/server/vendor/gabordemooij/redbean/testing/helpers/classes.php
@@ -409,7 +409,6 @@ class Model_PageWidget extends RedBean_SimpleModel {
}
}
-
/**
* Mock class to test proper model name
* beautificattion for link table beans in FUSE.
@@ -484,7 +483,6 @@ class Model_Feed extends \RedbeanPHP\SimpleModel {
}
}
-
/**
* UUID QueryWriter for MySQL for testing purposes.
*/
@@ -576,9 +574,9 @@ class DiagnosticBean extends \RedBeanPHP\OODBBean {
class DiagnosticModel extends \RedBeanPHP\SimpleModel
{
-
+
private $logs = array();
-
+
public function open()
{
$this->logs[] = array(
@@ -638,12 +636,12 @@ class DiagnosticModel extends \RedBeanPHP\SimpleModel
)
);
}
-
+
public function getLogs()
{
return $this->logs;
}
-
+
public function getLogActionCount( $action = NULL )
{
if ( is_null( $action ) ) return count( $this->logs );
@@ -653,21 +651,19 @@ class DiagnosticModel extends \RedBeanPHP\SimpleModel
}
return $counter;
}
-
+
public function clearLog()
{
return $this->logs = array();
}
-
+
public function getDataFromLog( $logIndex = 0, $property )
{
return $this->logs[$logIndex]['data'][$property];
}
-
-
+
}
class Model_Probe extends DiagnosticModel {};
-
define('REDBEAN_OODBBEAN_CLASS', '\DiagnosticBean');
diff --git a/server/vendor/gabordemooij/redbean/testing/helpers/functions.php b/server/vendor/gabordemooij/redbean/testing/helpers/functions.php
index 69c7f53b..cdde31e7 100644
--- a/server/vendor/gabordemooij/redbean/testing/helpers/functions.php
+++ b/server/vendor/gabordemooij/redbean/testing/helpers/functions.php
@@ -4,9 +4,9 @@
* Convenience function for test hook.
* If you added the proper Writer class, the facade should be able
* to automatically load it, i.e. \RedBeanPHP\QueryWriter\MyWriter
- *
+ *
* @global array $ini
- *
+ *
* @param string $name name of the connection (key)
* @param string $dsn DSN to connect
* @param string $user username
@@ -16,7 +16,7 @@ function add_writer_to_tests( $name, $dsn, $user, $pass )
{
global $ini;
-
+
\RedUNIT\Base::addToDriverList( $name );
R::addDatabase( $name, $dsn, $user, $pass );
@@ -400,7 +400,6 @@ function getIndexes( $tableNoQ )
return array();
}
-
function are_cols_in_unique( $type, $properties )
{
sort( $properties );
@@ -414,7 +413,6 @@ function are_cols_in_unique( $type, $properties )
return FALSE;
}
-
function get_uniques_for_type( $type )
{
$list = array();
diff --git a/server/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php b/server/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php
index 1330b9e0..3e9092b8 100644
--- a/server/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php
+++ b/server/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php
@@ -5,6 +5,8 @@ namespace DeepCopy;
use DeepCopy\Exception\CloneException;
use DeepCopy\Filter\Filter;
use DeepCopy\Matcher\Matcher;
+use DeepCopy\TypeFilter\TypeFilter;
+use DeepCopy\TypeMatcher\TypeMatcher;
use ReflectionProperty;
use DeepCopy\Reflection\ReflectionHelper;
@@ -24,6 +26,12 @@ class DeepCopy
*/
private $filters = [];
+ /**
+ * Type Filters to apply.
+ * @var array
+ */
+ private $typeFilters = [];
+
private $skipUncloneable = false;
/**
@@ -39,8 +47,8 @@ class DeepCopy
/**
* Perform a deep copy of the object.
- * @param object $object
- * @return object
+ * @param mixed $object
+ * @return mixed
*/
public function copy($object)
{
@@ -57,8 +65,22 @@ class DeepCopy
];
}
+ public function addTypeFilter(TypeFilter $filter, TypeMatcher $matcher)
+ {
+ $this->typeFilters[] = [
+ 'matcher' => $matcher,
+ 'filter' => $filter,
+ ];
+ }
+
+
private function recursiveCopy($var)
{
+ // Matches Type Filter
+ if ($filter = $this->getFirstMatchedTypeFilter($this->typeFilters, $var)) {
+ return $filter->apply($var);
+ }
+
// Resource
if (is_resource($var)) {
return $var;
@@ -159,4 +181,43 @@ class DeepCopy
// Copy the property
$property->setValue($object, $this->recursiveCopy($propertyValue));
}
+
+ /**
+ * Returns first filter that matches variable, NULL if no such filter found.
+ * @param array $filterRecords Associative array with 2 members: 'filter' with value of type {@see TypeFilter} and
+ * 'matcher' with value of type {@see TypeMatcher}
+ * @param mixed $var
+ * @return TypeFilter|null
+ */
+ private function getFirstMatchedTypeFilter(array $filterRecords, $var)
+ {
+ $matched = $this->first(
+ $filterRecords,
+ function (array $record) use ($var) {
+ /* @var TypeMatcher $matcher */
+ $matcher = $record['matcher'];
+
+ return $matcher->matches($var);
+ }
+ );
+
+ return isset($matched) ? $matched['filter'] : null;
+ }
+
+ /**
+ * Returns first element that matches predicate, NULL if no such element found.
+ * @param array $elements
+ * @param callable $predicate Predicate arguments are: element.
+ * @return mixed|null
+ */
+ private function first(array $elements, callable $predicate)
+ {
+ foreach ($elements as $element) {
+ if (call_user_func($predicate, $element)) {
+ return $element;
+ }
+ }
+
+ return null;
+ }
}
diff --git a/server/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php b/server/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php
index 12bb279a..6935541d 100644
--- a/server/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php
+++ b/server/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php
@@ -6,6 +6,9 @@ use ReflectionProperty;
/**
* Match a property by its type
+ *
+ * @deprecated It is recommended to use {@see DeepCopy\TypeFilter\TypeFilter} instead, as it applies on all occurrences
+ * of given type in copied context (eg. array elements), not just on object properties.
*/
class PropertyTypeMatcher implements Matcher
{
diff --git a/server/vendor/phpunit/php-code-coverage/ChangeLog-3.0.md b/server/vendor/phpunit/php-code-coverage/ChangeLog-3.0.md
index af7eaeb1..a39fa8d4 100644
--- a/server/vendor/phpunit/php-code-coverage/ChangeLog-3.0.md
+++ b/server/vendor/phpunit/php-code-coverage/ChangeLog-3.0.md
@@ -2,6 +2,12 @@
All notable changes of the PHP_CodeCoverage 3.0 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
+## [3.0.2] - 2015-11-12
+
+### Changed
+
+* It is now optional that `@deprecated` code is ignored
+
## [3.0.1] - 2015-10-06
### Fixed
@@ -19,6 +25,7 @@ All notable changes of the PHP_CodeCoverage 3.0 release series are documented in
* The blacklist functionality has been removed
* PHP_CodeCoverage is no longer supported on PHP 5.3, PHP 5.4, and PHP 5.5
+[3.0.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/3.0.1...3.0.2
[3.0.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/3.0.0...3.0.1
[3.0.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/2.2...3.0.0
diff --git a/server/vendor/phpunit/php-code-coverage/src/CodeCoverage.php b/server/vendor/phpunit/php-code-coverage/src/CodeCoverage.php
index 65dfea5f..759e86d1 100644
--- a/server/vendor/phpunit/php-code-coverage/src/CodeCoverage.php
+++ b/server/vendor/phpunit/php-code-coverage/src/CodeCoverage.php
@@ -57,6 +57,11 @@ class PHP_CodeCoverage
*/
private $processUncoveredFilesFromWhitelist = false;
+ /**
+ * @var bool
+ */
+ private $ignoreDeprecatedCode = false;
+
/**
* @var mixed
*/
@@ -486,6 +491,23 @@ class PHP_CodeCoverage
$this->disableIgnoredLines = $flag;
}
+ /**
+ * @param bool $flag
+ * @throws PHP_CodeCoverage_InvalidArgumentException
+ * @since Method available since Release 3.0.2
+ */
+ public function setIgnoreDeprecatedCode($flag)
+ {
+ if (!is_bool($flag)) {
+ throw PHP_CodeCoverage_InvalidArgumentException::create(
+ 1,
+ 'boolean'
+ );
+ }
+
+ $this->ignoreDeprecatedCode = $flag;
+ }
+
/**
* Applies the @covers annotation filtering.
*
@@ -732,7 +754,7 @@ class PHP_CodeCoverage
$this->ignoredLines[$filename][] = $token->getLine();
- if (strpos($docblock, '@codeCoverageIgnore') || strpos($docblock, '@deprecated')) {
+ if (strpos($docblock, '@codeCoverageIgnore') || ($this->ignoreDeprecatedCode && strpos($docblock, '@deprecated'))) {
$endLine = $token->getEndLine();
for ($i = $token->getLine(); $i <= $endLine; $i++) {
diff --git a/server/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer.php b/server/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer.php
index 63ebb672..49858b35 100644
--- a/server/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer.php
+++ b/server/vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer.php
@@ -58,7 +58,7 @@ abstract class PHP_CodeCoverage_Report_HTML_Renderer
*/
public function __construct($templatePath, $generator, $date, $lowUpperBound, $highLowerBound)
{
- $version = new SebastianBergmann\Version('3.0.1', dirname(dirname(dirname(dirname(__DIR__)))));
+ $version = new SebastianBergmann\Version('3.0.2', dirname(dirname(dirname(dirname(__DIR__)))));
$this->templatePath = $templatePath;
$this->generator = $generator;
diff --git a/server/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverageTest.php b/server/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverageTest.php
index d6c8aa40..a06bcc07 100644
--- a/server/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverageTest.php
+++ b/server/vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverageTest.php
@@ -238,6 +238,28 @@ class PHP_CodeCoverageTest extends PHP_CodeCoverage_TestCase
$this->coverage->setMapTestClassNameToCoveredClassName(null);
}
+ /**
+ * @covers PHP_CodeCoverage::setIgnoreDeprecatedCode
+ */
+ public function testSetIgnoreDeprecatedCode()
+ {
+ $this->coverage->setIgnoreDeprecatedCode(true);
+ $this->assertAttributeEquals(
+ true,
+ 'ignoreDeprecatedCode',
+ $this->coverage
+ );
+ }
+
+ /**
+ * @covers PHP_CodeCoverage::setIgnoreDeprecatedCode
+ * @expectedException PHP_CodeCoverage_Exception
+ */
+ public function testSetIgnoreDeprecatedCodeThrowsExceptionForInvalidArgument()
+ {
+ $this->coverage->setIgnoreDeprecatedCode(null);
+ }
+
/**
* @covers PHP_CodeCoverage::clear
*/
diff --git a/server/vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/InvocationMocker.php b/server/vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/InvocationMocker.php
index ab95241c..434e11d1 100644
--- a/server/vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/InvocationMocker.php
+++ b/server/vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/InvocationMocker.php
@@ -100,13 +100,7 @@ class PHPUnit_Framework_MockObject_InvocationMocker implements PHPUnit_Framework
{
$exception = null;
$hasReturnValue = false;
-
- if (strtolower($invocation->methodName) == '__tostring') {
- $hasReturnValue = true;
- $returnValue = '';
- } else {
- $returnValue = null;
- }
+ $returnValue = null;
foreach ($this->matchers as $match) {
try {
@@ -129,6 +123,8 @@ class PHPUnit_Framework_MockObject_InvocationMocker implements PHPUnit_Framework
if ($hasReturnValue) {
return $returnValue;
+ } elseif (strtolower($invocation->methodName) == '__tostring') {
+ return '';
}
return $invocation->generateReturnValue();
diff --git a/server/vendor/phpunit/phpunit-mock-objects/tests/MockObjectTest.php b/server/vendor/phpunit/phpunit-mock-objects/tests/MockObjectTest.php
index 7af949eb..b6c5e809 100644
--- a/server/vendor/phpunit/phpunit-mock-objects/tests/MockObjectTest.php
+++ b/server/vendor/phpunit/phpunit-mock-objects/tests/MockObjectTest.php
@@ -841,4 +841,12 @@ class Framework_MockObjectTest extends PHPUnit_Framework_TestCase
$this->assertInternalType('string', (string) $mock);
}
+
+ public function testStringableClassCanBeMocked()
+ {
+ $mock = $this->getMock('StringableClass');
+ $mock->method('__toString')->willReturn('foo');
+
+ $this->assertSame('foo', (string) $mock);
+ }
}
diff --git a/server/vendor/phpunit/phpunit/CONTRIBUTING.md b/server/vendor/phpunit/phpunit/CONTRIBUTING.md
index aee139f3..a22f838b 100644
--- a/server/vendor/phpunit/phpunit/CONTRIBUTING.md
+++ b/server/vendor/phpunit/phpunit/CONTRIBUTING.md
@@ -61,7 +61,6 @@ Please use the most specific issue tracker to search for existing tickets and to
* [Code Coverage](https://github.com/sebastianbergmann/php-code-coverage/issues)
* [Stub and Mock Objects](https://github.com/sebastianbergmann/phpunit-mock-objects/issues)
* [DbUnit](https://github.com/sebastianbergmann/dbunit/issues)
-* [PHPUnit_Selenium](https://github.com/sebastianbergmann/phpunit-selenium/issues)
* [Documentation](https://github.com/sebastianbergmann/phpunit-documentation/issues)
* [Website](https://github.com/sebastianbergmann/phpunit-website/issues)
diff --git a/server/vendor/phpunit/phpunit/ChangeLog-4.8.md b/server/vendor/phpunit/phpunit/ChangeLog-4.8.md
index cc61e131..3beb37f0 100644
--- a/server/vendor/phpunit/phpunit/ChangeLog-4.8.md
+++ b/server/vendor/phpunit/phpunit/ChangeLog-4.8.md
@@ -2,6 +2,36 @@
All notable changes of the PHPUnit 4.8 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
+## [4.8.17] - 2015-11-10
+
+### Fixed
+
+* Fixed [#1935](https://github.com/sebastianbergmann/phpunit/issues/1935): `PHP_CodeCoverage_Exception` not handled properly
+* Fixed [#1948](https://github.com/sebastianbergmann/phpunit/issues/1948): Unable to use PHAR due to unsupported signature error
+
+### Changed
+
+* DbUnit >= 2.0.2 is now bundled in the PHAR distribution
+
+## [4.8.16] - 2015-10-23
+
+### Added
+
+* Implemented [#1925](https://github.com/sebastianbergmann/phpunit/issues/1925): Provide a library-only PHAR
+
+## [4.8.15] - 2015-10-22
+
+### Fixed
+
+* The backup of global state is now properly restored when changes to global state are disallowed
+* The `__PHPUNIT_PHAR__` constant is now properly set when the PHPUnit PHAR is used as a library
+
+## [4.8.14] - 2015-10-17
+
+### Fixed
+
+* Fixed [#1892](https://github.com/sebastianbergmann/phpunit/issues/1892): `--coverage-text` does not honor color settings
+
## [4.8.13] - 2015-10-14
### Added
@@ -101,6 +131,10 @@ New PHAR release due to updated dependencies
* Made the argument check of `assertContains()` and `assertNotContains()` more strict to prevent undefined behavior such as [#1808](https://github.com/sebastianbergmann/phpunit/issues/1808)
* Changed the name of the default group from `__nogroup__` to `default`
+[4.8.17]: https://github.com/sebastianbergmann/phpunit/compare/4.8.16...4.8.17
+[4.8.16]: https://github.com/sebastianbergmann/phpunit/compare/4.8.15...4.8.16
+[4.8.15]: https://github.com/sebastianbergmann/phpunit/compare/4.8.14...4.8.15
+[4.8.14]: https://github.com/sebastianbergmann/phpunit/compare/4.8.13...4.8.14
[4.8.13]: https://github.com/sebastianbergmann/phpunit/compare/4.8.12...4.8.13
[4.8.12]: https://github.com/sebastianbergmann/phpunit/compare/4.8.11...4.8.12
[4.8.11]: https://github.com/sebastianbergmann/phpunit/compare/4.8.10...4.8.11
diff --git a/server/vendor/phpunit/phpunit/ChangeLog-5.0.md b/server/vendor/phpunit/phpunit/ChangeLog-5.0.md
index 47891c13..c72fa6f3 100644
--- a/server/vendor/phpunit/phpunit/ChangeLog-5.0.md
+++ b/server/vendor/phpunit/phpunit/ChangeLog-5.0.md
@@ -2,6 +2,35 @@
All notable changes of the PHPUnit 5.0 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
+## [5.0.9] - 2015-11-10
+
+### Added
+
+* Merged [#1909](https://github.com/sebastianbergmann/phpunit/issues/1909): Added `flowId` parameter to each TeamCity message (for parallel tests)
+
+### Fixed
+
+* Fixed [#1935](https://github.com/sebastianbergmann/phpunit/issues/1935): `PHP_CodeCoverage_Exception` not handled properly
+* Fixed [#1944](https://github.com/sebastianbergmann/phpunit/issues/1944): Exceptions are not handled correctly on PHP 7 when an exception is expected
+* Fixed [#1948](https://github.com/sebastianbergmann/phpunit/issues/1948): Unable to use PHAR due to unsupported signature error
+
+### Removed
+
+* Removed leftover references to PHPUnit_Selenium
+
+## [5.0.8] - 2015-10-23
+
+### Added
+
+* Implemented [#1925](https://github.com/sebastianbergmann/phpunit/issues/1925): Provide a library-only PHAR
+
+## [5.0.7] - 2015-10-22
+
+### Fixed
+
+* The backup of global state is now properly restored when changes to global state are disallowed
+* The `__PHPUNIT_PHAR__` constant is now properly set when the PHPUnit PHAR is used as a library
+
## [5.0.6] - 2015-10-14
### Added
@@ -78,6 +107,9 @@ All notable changes of the PHPUnit 5.0 release series are documented in this fil
* The PHPUnit_Selenium component can no longer be configured using the `` element of PHPUnit's configuration file
* PHPUnit is no longer supported on PHP 5.3, PHP 5.4, and PHP 5.5
+[5.0.9]: https://github.com/sebastianbergmann/phpunit/compare/5.0.8...5.0.9
+[5.0.8]: https://github.com/sebastianbergmann/phpunit/compare/5.0.7...5.0.8
+[5.0.7]: https://github.com/sebastianbergmann/phpunit/compare/5.0.6...5.0.7
[5.0.6]: https://github.com/sebastianbergmann/phpunit/compare/5.0.5...5.0.6
[5.0.5]: https://github.com/sebastianbergmann/phpunit/compare/5.0.4...5.0.5
[5.0.4]: https://github.com/sebastianbergmann/phpunit/compare/5.0.3...5.0.4
diff --git a/server/vendor/phpunit/phpunit/build.xml b/server/vendor/phpunit/phpunit/build.xml
index 66a64530..ad87c99b 100644
--- a/server/vendor/phpunit/phpunit/build.xml
+++ b/server/vendor/phpunit/phpunit/build.xml
@@ -42,6 +42,12 @@
+
+
+
+
+
+
@@ -253,15 +259,31 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/server/vendor/phpunit/phpunit/phpunit.xsd b/server/vendor/phpunit/phpunit/phpunit.xsd
index d4a722a8..32eb7dd8 100644
--- a/server/vendor/phpunit/phpunit/phpunit.xsd
+++ b/server/vendor/phpunit/phpunit/phpunit.xsd
@@ -215,7 +215,6 @@
-
diff --git a/server/vendor/phpunit/phpunit/src/Framework/Constraint/Exception.php b/server/vendor/phpunit/phpunit/src/Framework/Constraint/Exception.php
index c05f1725..0bed9585 100644
--- a/server/vendor/phpunit/phpunit/src/Framework/Constraint/Exception.php
+++ b/server/vendor/phpunit/phpunit/src/Framework/Constraint/Exception.php
@@ -54,9 +54,9 @@ class PHPUnit_Framework_Constraint_Exception extends PHPUnit_Framework_Constrain
{
if ($other !== null) {
$message = '';
- if ($other instanceof Exception) {
+ if ($other instanceof Exception || $other instanceof Throwable) {
$message = '. Message was: "' . $other->getMessage() . '" at'
- . "\n" . $other->getTraceAsString();
+ . "\n" . PHPUnit_Util_Filter::getFilteredStacktrace($other);
}
return sprintf(
diff --git a/server/vendor/phpunit/phpunit/src/Framework/TestCase.php b/server/vendor/phpunit/phpunit/src/Framework/TestCase.php
index a3b48321..048587ba 100644
--- a/server/vendor/phpunit/phpunit/src/Framework/TestCase.php
+++ b/server/vendor/phpunit/phpunit/src/Framework/TestCase.php
@@ -629,7 +629,6 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
if ($this->runTestInSeparateProcess === true &&
$this->inIsolation !== true &&
- !$this instanceof PHPUnit_Extensions_SeleniumTestCase &&
!$this instanceof PHPUnit_Extensions_PhptTestCase) {
$class = new ReflectionClass($this);
@@ -1352,7 +1351,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
}
/**
- * Returns a mock object for the specified class.
+ * Returns a mock with disabled constructor object for the specified class.
*
* @param string $originalClassName
*
@@ -2103,10 +2102,14 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
$backupGlobals = $this->backupGlobals === null || $this->backupGlobals === true;
if ($this->beStrictAboutChangesToGlobalState) {
- $this->compareGlobalStateSnapshots(
- $this->snapshot,
- $this->createGlobalStateSnapshot($backupGlobals)
- );
+ try {
+ $this->compareGlobalStateSnapshots(
+ $this->snapshot,
+ $this->createGlobalStateSnapshot($backupGlobals)
+ );
+ } catch (PHPUnit_Framework_RiskyTestError $rte) {
+ // Intentionally left empty
+ }
}
$restorer = new Restorer;
@@ -2120,6 +2123,10 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
}
$this->snapshot = null;
+
+ if (isset($rte)) {
+ throw $rte;
+ }
}
/**
diff --git a/server/vendor/phpunit/phpunit/src/Framework/TestResult.php b/server/vendor/phpunit/phpunit/src/Framework/TestResult.php
index 43f00bf2..11f85998 100644
--- a/server/vendor/phpunit/phpunit/src/Framework/TestResult.php
+++ b/server/vendor/phpunit/phpunit/src/Framework/TestResult.php
@@ -574,7 +574,6 @@ class PHPUnit_Framework_TestResult implements Countable
}
$collectCodeCoverage = $this->codeCoverage !== null &&
- !$test instanceof PHPUnit_Extensions_SeleniumTestCase &&
!$test instanceof PHPUnit_Framework_Warning;
if ($collectCodeCoverage) {
diff --git a/server/vendor/phpunit/phpunit/src/Runner/Version.php b/server/vendor/phpunit/phpunit/src/Runner/Version.php
index 6c7cac60..0459d4dc 100644
--- a/server/vendor/phpunit/phpunit/src/Runner/Version.php
+++ b/server/vendor/phpunit/phpunit/src/Runner/Version.php
@@ -30,7 +30,7 @@ class PHPUnit_Runner_Version
}
if (self::$version === null) {
- $version = new SebastianBergmann\Version('5.0.6', dirname(dirname(__DIR__)));
+ $version = new SebastianBergmann\Version('5.0.9', dirname(dirname(__DIR__)));
self::$version = $version->getVersion();
}
@@ -44,7 +44,7 @@ class PHPUnit_Runner_Version
*/
public static function series()
{
- return join('.', array_slice(explode('.', self::id()), 0, 2));
+ return implode('.', array_slice(explode('.', self::id()), 0, 2));
}
/**
diff --git a/server/vendor/phpunit/phpunit/src/TextUI/TestRunner.php b/server/vendor/phpunit/phpunit/src/TextUI/TestRunner.php
index 50495ee4..84374dd7 100644
--- a/server/vendor/phpunit/phpunit/src/TextUI/TestRunner.php
+++ b/server/vendor/phpunit/phpunit/src/TextUI/TestRunner.php
@@ -437,11 +437,17 @@ class PHPUnit_TextUI_TestRunner extends PHPUnit_Runner_BaseTestRunner
"\nGenerating code coverage report in Clover XML format ..."
);
- $writer = new PHP_CodeCoverage_Report_Clover;
- $writer->process($codeCoverage, $arguments['coverageClover']);
+ try {
+ $writer = new PHP_CodeCoverage_Report_Clover;
+ $writer->process($codeCoverage, $arguments['coverageClover']);
- $this->printer->write(" done\n");
- unset($writer);
+ $this->printer->write(" done\n");
+ unset($writer);
+ } catch (PHP_CodeCoverage_Exception $e) {
+ $this->printer->write(
+ " failed\n" . $e->getMessage() . "\n"
+ );
+ }
}
if (isset($arguments['coverageCrap4J'])) {
@@ -449,11 +455,17 @@ class PHPUnit_TextUI_TestRunner extends PHPUnit_Runner_BaseTestRunner
"\nGenerating Crap4J report XML file ..."
);
- $writer = new PHP_CodeCoverage_Report_Crap4j($arguments['crap4jThreshold']);
- $writer->process($codeCoverage, $arguments['coverageCrap4J']);
+ try {
+ $writer = new PHP_CodeCoverage_Report_Crap4j($arguments['crap4jThreshold']);
+ $writer->process($codeCoverage, $arguments['coverageCrap4J']);
- $this->printer->write(" done\n");
- unset($writer);
+ $this->printer->write(" done\n");
+ unset($writer);
+ } catch (PHP_CodeCoverage_Exception $e) {
+ $this->printer->write(
+ " failed\n" . $e->getMessage() . "\n"
+ );
+ }
}
if (isset($arguments['coverageHtml'])) {
@@ -461,19 +473,25 @@ class PHPUnit_TextUI_TestRunner extends PHPUnit_Runner_BaseTestRunner
"\nGenerating code coverage report in HTML format ..."
);
- $writer = new PHP_CodeCoverage_Report_HTML(
- $arguments['reportLowUpperBound'],
- $arguments['reportHighLowerBound'],
- sprintf(
- ' and PHPUnit %s',
- PHPUnit_Runner_Version::id()
- )
- );
+ try {
+ $writer = new PHP_CodeCoverage_Report_HTML(
+ $arguments['reportLowUpperBound'],
+ $arguments['reportHighLowerBound'],
+ sprintf(
+ ' and PHPUnit %s',
+ PHPUnit_Runner_Version::id()
+ )
+ );
- $writer->process($codeCoverage, $arguments['coverageHtml']);
+ $writer->process($codeCoverage, $arguments['coverageHtml']);
- $this->printer->write(" done\n");
- unset($writer);
+ $this->printer->write(" done\n");
+ unset($writer);
+ } catch (PHP_CodeCoverage_Exception $e) {
+ $this->printer->write(
+ " failed\n" . $e->getMessage() . "\n"
+ );
+ }
}
if (isset($arguments['coveragePHP'])) {
@@ -481,11 +499,17 @@ class PHPUnit_TextUI_TestRunner extends PHPUnit_Runner_BaseTestRunner
"\nGenerating code coverage report in PHP format ..."
);
- $writer = new PHP_CodeCoverage_Report_PHP;
- $writer->process($codeCoverage, $arguments['coveragePHP']);
+ try {
+ $writer = new PHP_CodeCoverage_Report_PHP;
+ $writer->process($codeCoverage, $arguments['coveragePHP']);
- $this->printer->write(" done\n");
- unset($writer);
+ $this->printer->write(" done\n");
+ unset($writer);
+ } catch (PHP_CodeCoverage_Exception $e) {
+ $this->printer->write(
+ " failed\n" . $e->getMessage() . "\n"
+ );
+ }
}
if (isset($arguments['coverageText'])) {
@@ -514,11 +538,17 @@ class PHPUnit_TextUI_TestRunner extends PHPUnit_Runner_BaseTestRunner
"\nGenerating code coverage report in PHPUnit XML format ..."
);
- $writer = new PHP_CodeCoverage_Report_XML;
- $writer->process($codeCoverage, $arguments['coverageXml']);
+ try {
+ $writer = new PHP_CodeCoverage_Report_XML;
+ $writer->process($codeCoverage, $arguments['coverageXml']);
- $this->printer->write(" done\n");
- unset($writer);
+ $this->printer->write(" done\n");
+ unset($writer);
+ } catch (PHP_CodeCoverage_Exception $e) {
+ $this->printer->write(
+ " failed\n" . $e->getMessage() . "\n"
+ );
+ }
}
}
diff --git a/server/vendor/phpunit/phpunit/src/Util/Blacklist.php b/server/vendor/phpunit/phpunit/src/Util/Blacklist.php
index 6be7c641..1fdf94c1 100644
--- a/server/vendor/phpunit/phpunit/src/Util/Blacklist.php
+++ b/server/vendor/phpunit/phpunit/src/Util/Blacklist.php
@@ -27,7 +27,6 @@ class PHPUnit_Util_Blacklist
'PHPUnit_Framework_TestCase' => 2,
'PHPUnit_Extensions_Database_TestCase' => 2,
'PHPUnit_Framework_MockObject_Generator' => 2,
- 'PHPUnit_Extensions_SeleniumTestCase' => 2,
'Text_Template' => 1,
'Symfony\Component\Yaml\Yaml' => 1,
'SebastianBergmann\Diff\Diff' => 1,
diff --git a/server/vendor/phpunit/phpunit/src/Util/Filter.php b/server/vendor/phpunit/phpunit/src/Util/Filter.php
index b82608f7..a4d7542e 100644
--- a/server/vendor/phpunit/phpunit/src/Util/Filter.php
+++ b/server/vendor/phpunit/phpunit/src/Util/Filter.php
@@ -23,7 +23,7 @@ class PHPUnit_Util_Filter
*
* @return string
*/
- public static function getFilteredStacktrace(Exception $e, $asString = true)
+ public static function getFilteredStacktrace($e, $asString = true)
{
$prefix = false;
$script = realpath($GLOBALS['_SERVER']['SCRIPT_NAME']);
diff --git a/server/vendor/phpunit/phpunit/src/Util/Log/TeamCity.php b/server/vendor/phpunit/phpunit/src/Util/Log/TeamCity.php
index 2eea4c2e..f63b85f0 100644
--- a/server/vendor/phpunit/phpunit/src/Util/Log/TeamCity.php
+++ b/server/vendor/phpunit/phpunit/src/Util/Log/TeamCity.php
@@ -28,6 +28,11 @@ class PHPUnit_Util_Log_TeamCity extends PHPUnit_TextUI_ResultPrinter
*/
private $startedTestName;
+ /**
+ * @var string
+ */
+ private $flowId;
+
/**
* @param string $progress
*/
@@ -166,6 +171,12 @@ class PHPUnit_Util_Log_TeamCity extends PHPUnit_TextUI_ResultPrinter
*/
public function startTestSuite(PHPUnit_Framework_TestSuite $suite)
{
+ if (stripos(ini_get('disable_functions'), 'getmypid') === false) {
+ $this->flowId = getmypid();
+ } else {
+ $this->flowId = false;
+ }
+
if (!$this->isSummaryTestCountPrinted) {
$this->isSummaryTestCountPrinted = true;
@@ -272,6 +283,10 @@ class PHPUnit_Util_Log_TeamCity extends PHPUnit_TextUI_ResultPrinter
{
$this->write("\n##teamcity[$eventName");
+ if ($this->flowId) {
+ $params['flowId'] = $this->flowId;
+ }
+
foreach ($params as $key => $value) {
$escapedValue = self::escapeValue($value);
$this->write(" $key='$escapedValue'");
diff --git a/server/vendor/phpunit/phpunit/src/Util/Test.php b/server/vendor/phpunit/phpunit/src/Util/Test.php
index 1dcc921d..b5e189ca 100644
--- a/server/vendor/phpunit/phpunit/src/Util/Test.php
+++ b/server/vendor/phpunit/phpunit/src/Util/Test.php
@@ -698,9 +698,7 @@ class PHPUnit_Util_Test
if (isset($groups['large']) ||
(class_exists('PHPUnit_Extensions_Database_TestCase', false) &&
- $class->isSubclassOf('PHPUnit_Extensions_Database_TestCase')) ||
- (class_exists('PHPUnit_Extensions_SeleniumTestCase', false) &&
- $class->isSubclassOf('PHPUnit_Extensions_SeleniumTestCase'))) {
+ $class->isSubclassOf('PHPUnit_Extensions_Database_TestCase'))) {
$size = self::LARGE;
} elseif (isset($groups['medium'])) {
$size = self::MEDIUM;
diff --git a/server/vendor/phpunit/phpunit/tests/Framework/AssertTest.php b/server/vendor/phpunit/phpunit/tests/Framework/AssertTest.php
index 17a6b921..2b22753d 100644
--- a/server/vendor/phpunit/phpunit/tests/Framework/AssertTest.php
+++ b/server/vendor/phpunit/phpunit/tests/Framework/AssertTest.php
@@ -738,9 +738,9 @@ class Framework_AssertTest extends PHPUnit_Framework_TestCase
[NAN, NAN],
// arrays
[[], [0 => 1]],
- [[0 => 1], []],
- [[0 => null], []],
- [[0 => 1, 1 => 2], [0 => 1, 1 => 3]],
+ [[0 => 1], []],
+ [[0 => null], []],
+ [[0 => 1, 1 => 2], [0 => 1, 1 => 3]],
[['a', 'b' => [1, 2]], ['a', 'b' => [2, 1]]],
// objects
[new SampleClass(4, 8, 15), new SampleClass(16, 23, 42)],
@@ -821,7 +821,7 @@ class Framework_AssertTest extends PHPUnit_Framework_TestCase
// different types
[new SampleClass(4, 8, 15), false],
[false, new SampleClass(4, 8, 15)],
- [[0 => 1, 1 => 2], false],
+ [[0 => 1, 1 => 2], false],
[false, [0 => 1, 1 => 2]],
[[], new stdClass],
[new stdClass, []],
diff --git a/server/vendor/phpunit/phpunit/tests/Framework/Constraint/JsonMatchesTest.php b/server/vendor/phpunit/phpunit/tests/Framework/Constraint/JsonMatchesTest.php
index 5a88745c..fa2dc5b8 100644
--- a/server/vendor/phpunit/phpunit/tests/Framework/Constraint/JsonMatchesTest.php
+++ b/server/vendor/phpunit/phpunit/tests/Framework/Constraint/JsonMatchesTest.php
@@ -39,10 +39,10 @@ class Framework_Constraint_JsonMatchesTest extends PHPUnit_Framework_TestCase
public static function evaluateDataprovider()
{
return [
- 'valid JSON' => [true, json_encode(['Mascott' => 'Tux']), json_encode(['Mascott' => 'Tux'])],
- 'error syntax' => [false, '{"Mascott"::}', json_encode(['Mascott' => 'Tux'])],
+ 'valid JSON' => [true, json_encode(['Mascott' => 'Tux']), json_encode(['Mascott' => 'Tux'])],
+ 'error syntax' => [false, '{"Mascott"::}', json_encode(['Mascott' => 'Tux'])],
'error UTF-8' => [false, json_encode('\xB1\x31'), json_encode(['Mascott' => 'Tux'])],
- 'invalid JSON in class instantiation' => [false, json_encode(['Mascott' => 'Tux']), '{"Mascott"::}'],
+ 'invalid JSON in class instantiation' => [false, json_encode(['Mascott' => 'Tux']), '{"Mascott"::}'],
];
}
}
diff --git a/server/vendor/phpunit/phpunit/tests/Framework/ConstraintTest.php b/server/vendor/phpunit/phpunit/tests/Framework/ConstraintTest.php
index 9e0cd9ff..aa02e296 100644
--- a/server/vendor/phpunit/phpunit/tests/Framework/ConstraintTest.php
+++ b/server/vendor/phpunit/phpunit/tests/Framework/ConstraintTest.php
@@ -856,14 +856,12 @@ Failed asserting that two objects are equal.
- 'obj' => stdClass Object &$ahash (
- 'foo' => 'bar'
- )
-- 'inf' => null
-- )
-- '$bhash' => Array &1 (
+SplObjectStorage Object &$storage2hash (
+ '$bhash' => Array &0 (
- 'obj' => stdClass Object &$bhash ()
++ 'obj' => stdClass Object &$bhash ()
'inf' => null
)
+- '$bhash' => Array &0
)
EOF
@@ -3456,7 +3454,7 @@ EOF
{
$constraint = new PHPUnit_Framework_Constraint_Exception('FoobarException');
$exception = new DummyException('Test');
- $stackTrace = $exception->getTraceAsString();
+ $stackTrace = PHPUnit_Util_Filter::getFilteredStacktrace($exception);
try {
$constraint->evaluate($exception);
diff --git a/server/vendor/phpunit/phpunit/tests/TextUI/log-teamcity.phpt b/server/vendor/phpunit/phpunit/tests/TextUI/log-teamcity.phpt
index 2c36ccc9..3f764ff9 100644
--- a/server/vendor/phpunit/phpunit/tests/TextUI/log-teamcity.phpt
+++ b/server/vendor/phpunit/phpunit/tests/TextUI/log-teamcity.phpt
@@ -15,23 +15,23 @@ PHPUnit_TextUI_Command::main();
PHPUnit %s by Sebastian Bergmann and contributors.
-##teamcity[testCount count='3']
+##teamcity[testCount count='3' flowId='%d']
-##teamcity[testSuiteStarted name='BankAccountTest' locationHint='php_qn://%s/tests/_files/BankAccountTest.php::\BankAccountTest']
+##teamcity[testSuiteStarted name='BankAccountTest' locationHint='php_qn://%s/tests/_files/BankAccountTest.php::\BankAccountTest' flowId='%d']
-##teamcity[testStarted name='testBalanceIsInitiallyZero' locationHint='php_qn://%s/tests/_files/BankAccountTest.php::\BankAccountTest::testBalanceIsInitiallyZero']
+##teamcity[testStarted name='testBalanceIsInitiallyZero' locationHint='php_qn://%s/tests/_files/BankAccountTest.php::\BankAccountTest::testBalanceIsInitiallyZero' flowId='%d']
.
-##teamcity[testFinished name='testBalanceIsInitiallyZero' duration='0']
+##teamcity[testFinished name='testBalanceIsInitiallyZero' duration='%s' flowId='%d']
-##teamcity[testStarted name='testBalanceCannotBecomeNegative' locationHint='php_qn://%s/tests/_files/BankAccountTest.php::\BankAccountTest::testBalanceCannotBecomeNegative']
+##teamcity[testStarted name='testBalanceCannotBecomeNegative' locationHint='php_qn://%s/tests/_files/BankAccountTest.php::\BankAccountTest::testBalanceCannotBecomeNegative' flowId='%d']
.
-##teamcity[testFinished name='testBalanceCannotBecomeNegative' duration='0']
+##teamcity[testFinished name='testBalanceCannotBecomeNegative' duration='%s' flowId='%d']
-##teamcity[testStarted name='testBalanceCannotBecomeNegative2' locationHint='php_qn://%s/tests/_files/BankAccountTest.php::\BankAccountTest::testBalanceCannotBecomeNegative2']
+##teamcity[testStarted name='testBalanceCannotBecomeNegative2' locationHint='php_qn://%s/tests/_files/BankAccountTest.php::\BankAccountTest::testBalanceCannotBecomeNegative2' flowId='%d']
. 3 / 3 (100%)
-##teamcity[testFinished name='testBalanceCannotBecomeNegative2' duration='0']
+##teamcity[testFinished name='testBalanceCannotBecomeNegative2' duration='%s' flowId='%d']
-##teamcity[testSuiteFinished name='BankAccountTest']
+##teamcity[testSuiteFinished name='BankAccountTest' flowId='%d']
Time: %s, Memory: %s
diff --git a/server/vendor/phpunit/phpunit/tests/TextUI/teamcity.phpt b/server/vendor/phpunit/phpunit/tests/TextUI/teamcity.phpt
index 27e75aed..912a6555 100644
--- a/server/vendor/phpunit/phpunit/tests/TextUI/teamcity.phpt
+++ b/server/vendor/phpunit/phpunit/tests/TextUI/teamcity.phpt
@@ -14,23 +14,23 @@ PHPUnit_TextUI_Command::main();
PHPUnit %s by Sebastian Bergmann and contributors.
-##teamcity[testCount count='3']
+##teamcity[testCount count='3' flowId='%d']
-##teamcity[testSuiteStarted name='BankAccountTest' locationHint='php_qn://%s/tests/_files/BankAccountTest.php::\BankAccountTest']
+##teamcity[testSuiteStarted name='BankAccountTest' locationHint='php_qn://%s/tests/_files/BankAccountTest.php::\BankAccountTest' flowId='%d']
-##teamcity[testStarted name='testBalanceIsInitiallyZero' locationHint='php_qn://%s/tests/_files/BankAccountTest.php::\BankAccountTest::testBalanceIsInitiallyZero']
+##teamcity[testStarted name='testBalanceIsInitiallyZero' locationHint='php_qn://%s/tests/_files/BankAccountTest.php::\BankAccountTest::testBalanceIsInitiallyZero' flowId='%d']
-##teamcity[testFinished name='testBalanceIsInitiallyZero' duration='0']
+##teamcity[testFinished name='testBalanceIsInitiallyZero' duration='%s' flowId='%d']
-##teamcity[testStarted name='testBalanceCannotBecomeNegative' locationHint='php_qn://%s/tests/_files/BankAccountTest.php::\BankAccountTest::testBalanceCannotBecomeNegative']
+##teamcity[testStarted name='testBalanceCannotBecomeNegative' locationHint='php_qn://%s/tests/_files/BankAccountTest.php::\BankAccountTest::testBalanceCannotBecomeNegative' flowId='%d']
-##teamcity[testFinished name='testBalanceCannotBecomeNegative' duration='0']
+##teamcity[testFinished name='testBalanceCannotBecomeNegative' duration='%s' flowId='%d']
-##teamcity[testStarted name='testBalanceCannotBecomeNegative2' locationHint='php_qn://%s/tests/_files/BankAccountTest.php::\BankAccountTest::testBalanceCannotBecomeNegative2']
+##teamcity[testStarted name='testBalanceCannotBecomeNegative2' locationHint='php_qn://%s/tests/_files/BankAccountTest.php::\BankAccountTest::testBalanceCannotBecomeNegative2' flowId='%d']
-##teamcity[testFinished name='testBalanceCannotBecomeNegative2' duration='0']
+##teamcity[testFinished name='testBalanceCannotBecomeNegative2' duration='%s' flowId='%d']
-##teamcity[testSuiteFinished name='BankAccountTest']
+##teamcity[testSuiteFinished name='BankAccountTest' flowId='%d']
Time: %s, Memory: %s
diff --git a/server/vendor/phpunit/phpunit/tests/Util/TestTest.php b/server/vendor/phpunit/phpunit/tests/Util/TestTest.php
index b1da6a85..a2c5a082 100644
--- a/server/vendor/phpunit/phpunit/tests/Util/TestTest.php
+++ b/server/vendor/phpunit/phpunit/tests/Util/TestTest.php
@@ -135,16 +135,16 @@ class Util_TestTest extends PHPUnit_Framework_TestCase
{
return [
['testOne', []],
- ['testTwo', ['PHPUnit' => '1.0']],
- ['testThree', ['PHP' => '2.0']],
- ['testFour', ['PHPUnit'=>'2.0', 'PHP' => '1.0']],
- ['testFive', ['PHP' => '5.4.0RC6']],
- ['testSix', ['PHP' => '5.4.0-alpha1']],
- ['testSeven', ['PHP' => '5.4.0beta2']],
- ['testEight', ['PHP' => '5.4-dev']],
- ['testNine', ['functions' => ['testFunc']]],
+ ['testTwo', ['PHPUnit' => '1.0']],
+ ['testThree', ['PHP' => '2.0']],
+ ['testFour', ['PHPUnit' => '2.0', 'PHP' => '1.0']],
+ ['testFive', ['PHP' => '5.4.0RC6']],
+ ['testSix', ['PHP' => '5.4.0-alpha1']],
+ ['testSeven', ['PHP' => '5.4.0beta2']],
+ ['testEight', ['PHP' => '5.4-dev']],
+ ['testNine', ['functions' => ['testFunc']]],
['testTen', ['extensions' => ['testExt']]],
- ['testEleven', ['OS' => '/Linux/i']],
+ ['testEleven', ['OS' => '/Linux/i']],
[
'testSpace',
[
diff --git a/server/vendor/symfony/yaml/Exception/DumpException.php b/server/vendor/symfony/yaml/Exception/DumpException.php
index 9b3e6de0..cce972f2 100644
--- a/server/vendor/symfony/yaml/Exception/DumpException.php
+++ b/server/vendor/symfony/yaml/Exception/DumpException.php
@@ -15,8 +15,6 @@ namespace Symfony\Component\Yaml\Exception;
* Exception class thrown when an error occurs during dumping.
*
* @author Fabien Potencier
- *
- * @api
*/
class DumpException extends RuntimeException
{
diff --git a/server/vendor/symfony/yaml/Exception/ExceptionInterface.php b/server/vendor/symfony/yaml/Exception/ExceptionInterface.php
index 92e5c2ea..ad850eea 100644
--- a/server/vendor/symfony/yaml/Exception/ExceptionInterface.php
+++ b/server/vendor/symfony/yaml/Exception/ExceptionInterface.php
@@ -15,8 +15,6 @@ namespace Symfony\Component\Yaml\Exception;
* Exception interface for all exceptions thrown by the component.
*
* @author Fabien Potencier
- *
- * @api
*/
interface ExceptionInterface
{
diff --git a/server/vendor/symfony/yaml/Exception/ParseException.php b/server/vendor/symfony/yaml/Exception/ParseException.php
index 0447dff1..b74eb913 100644
--- a/server/vendor/symfony/yaml/Exception/ParseException.php
+++ b/server/vendor/symfony/yaml/Exception/ParseException.php
@@ -15,8 +15,6 @@ namespace Symfony\Component\Yaml\Exception;
* Exception class thrown when an error occurs during parsing.
*
* @author Fabien Potencier
- *
- * @api
*/
class ParseException extends RuntimeException
{
diff --git a/server/vendor/symfony/yaml/Exception/RuntimeException.php b/server/vendor/symfony/yaml/Exception/RuntimeException.php
index 3573bf15..3f36b73b 100644
--- a/server/vendor/symfony/yaml/Exception/RuntimeException.php
+++ b/server/vendor/symfony/yaml/Exception/RuntimeException.php
@@ -15,8 +15,6 @@ namespace Symfony\Component\Yaml\Exception;
* Exception class thrown when an error occurs during parsing.
*
* @author Romain Neutron
- *
- * @api
*/
class RuntimeException extends \RuntimeException implements ExceptionInterface
{
diff --git a/server/vendor/symfony/yaml/Inline.php b/server/vendor/symfony/yaml/Inline.php
index 6e3877bf..a5b53bd9 100644
--- a/server/vendor/symfony/yaml/Inline.php
+++ b/server/vendor/symfony/yaml/Inline.php
@@ -224,8 +224,8 @@ class Inline
$i += strlen($output);
// remove comments
- if (false !== $strpos = strpos($output, ' #')) {
- $output = rtrim(substr($output, 0, $strpos));
+ if (preg_match('/[ \t]+#/', $output, $match, PREG_OFFSET_CAPTURE)) {
+ $output = substr($output, 0, $match[0][1]);
}
} elseif (preg_match('/^(.+?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) {
$output = $match[1];
diff --git a/server/vendor/symfony/yaml/Parser.php b/server/vendor/symfony/yaml/Parser.php
index 651c0170..04f2237b 100644
--- a/server/vendor/symfony/yaml/Parser.php
+++ b/server/vendor/symfony/yaml/Parser.php
@@ -20,7 +20,9 @@ use Symfony\Component\Yaml\Exception\ParseException;
*/
class Parser
{
- const FOLDED_SCALAR_PATTERN = '(?P\||>)(?P\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P +#.*)?';
+ const BLOCK_SCALAR_HEADER_PATTERN = '(?P\||>)(?P\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P +#.*)?';
+ // BC - wrongly named
+ const FOLDED_SCALAR_PATTERN = self::BLOCK_SCALAR_HEADER_PATTERN;
private $offset = 0;
private $lines = array();
@@ -373,8 +375,8 @@ class Parser
$isItUnindentedCollection = $this->isStringUnIndentedCollectionItem($this->currentLine);
- // Comments must not be removed inside a string block (ie. after a line ending with "|")
- $removeCommentsPattern = '~'.self::FOLDED_SCALAR_PATTERN.'$~';
+ // Comments must not be removed inside a block scalar
+ $removeCommentsPattern = '~'.self::BLOCK_SCALAR_HEADER_PATTERN.'$~';
$removeComments = !preg_match($removeCommentsPattern, $this->currentLine);
while ($this->moveToNextLine()) {
@@ -464,10 +466,10 @@ class Parser
return $this->refs[$value];
}
- if (preg_match('/^'.self::FOLDED_SCALAR_PATTERN.'$/', $value, $matches)) {
+ if (preg_match('/^'.self::BLOCK_SCALAR_HEADER_PATTERN.'$/', $value, $matches)) {
$modifiers = isset($matches['modifiers']) ? $matches['modifiers'] : '';
- return $this->parseFoldedScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), (int) abs($modifiers));
+ return $this->parseBlockScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), (int) abs($modifiers));
}
try {
@@ -481,15 +483,15 @@ class Parser
}
/**
- * Parses a folded scalar.
+ * Parses a block scalar.
*
- * @param string $separator The separator that was used to begin this folded scalar (| or >)
- * @param string $indicator The indicator that was used to begin this folded scalar (+ or -)
- * @param int $indentation The indentation that was used to begin this folded scalar
+ * @param string $style The style indicator that was used to begin this block scalar (| or >)
+ * @param string $chomping The chomping indicator that was used to begin this block scalar (+ or -)
+ * @param int $indentation The indentation indicator that was used to begin this block scalar
*
* @return string The text value
*/
- private function parseFoldedScalar($separator, $indicator = '', $indentation = 0)
+ private function parseBlockScalar($style, $chomping = '', $indentation = 0)
{
$notEOF = $this->moveToNextLine();
if (!$notEOF) {
@@ -544,17 +546,23 @@ class Parser
$this->moveToPreviousLine();
}
- // replace all non-trailing single newlines with spaces in folded blocks
- if ('>' === $separator) {
+ // folded style
+ if ('>' === $style) {
+ // folded lines
+ // replace all non-leading/non-trailing single newlines with spaces
preg_match('/(\n*)$/', $text, $matches);
- $text = preg_replace('/(? 'foo # bar', 'ex2' => 'foo # bar', 'ex3' => 'foo # bar', 'ex4' => 'foo')
+ array('ex1' => 'foo # bar', 'ex2' => 'foo # bar', 'ex3' => 'foo # bar', 'ex4' => 'foo', 'ex5' => 'foo', 'ex6' => 'foo#foo', 'ex7' => 'foo')
---
test: Comments in the middle
brief: >
diff --git a/server/vendor/symfony/yaml/Tests/Fixtures/sfTests.yml b/server/vendor/symfony/yaml/Tests/Fixtures/sfTests.yml
index 7a54f163..a427be1c 100644
--- a/server/vendor/symfony/yaml/Tests/Fixtures/sfTests.yml
+++ b/server/vendor/symfony/yaml/Tests/Fixtures/sfTests.yml
@@ -51,9 +51,9 @@ php: |
'~',
)
---
-test: Empty lines in folded blocks
+test: Empty lines in literal blocks
brief: >
- Empty lines in folded blocks
+ Empty lines in literal blocks
yaml: |
foo:
bar: |
@@ -65,6 +65,20 @@ yaml: |
php: |
array('foo' => array('bar' => "foo\n\n\n \nbar\n"))
---
+test: Empty lines in folded blocks
+brief: >
+ Empty lines in folded blocks
+yaml: |
+ foo:
+ bar: >
+
+ foo
+
+
+ bar
+php: |
+ array('foo' => array('bar' => "\nfoo\n\nbar\n"))
+---
test: IP addresses
brief: >
IP addresses
diff --git a/server/vendor/symfony/yaml/Tests/ParserTest.php b/server/vendor/symfony/yaml/Tests/ParserTest.php
index 08ef43fa..0ccc6ee9 100644
--- a/server/vendor/symfony/yaml/Tests/ParserTest.php
+++ b/server/vendor/symfony/yaml/Tests/ParserTest.php
@@ -446,14 +446,11 @@ EOF;
$this->parser->parse('foo: !!php/object:O:30:"Symfony\Tests\Component\Yaml\B":1:{s:1:"b";s:3:"foo";}', true, false);
}
+ /**
+ * @requires extension iconv
+ */
public function testNonUtf8Exception()
{
- if (!function_exists('iconv')) {
- $this->markTestSkipped('Exceptions for non-utf8 charsets require the iconv() function.');
-
- return;
- }
-
$yamls = array(
iconv('UTF-8', 'ISO-8859-1', "foo: 'äöüß'"),
iconv('UTF-8', 'ISO-8859-15', "euro: '€'"),
@@ -622,6 +619,32 @@ EOF;
$this->assertEquals(array('hash' => null), Yaml::parse($input));
}
+ public function testCommentAtTheRootIndent()
+ {
+ $this->assertEquals(array(
+ 'services' => array(
+ 'app.foo_service' => array(
+ 'class' => 'Foo',
+ ),
+ 'app/bar_service' => array(
+ 'class' => 'Bar',
+ ),
+ ),
+ ), Yaml::parse(<<assertEquals(array('content' => <<
- *
- * @api
*/
class Yaml
{
@@ -48,8 +46,6 @@ class Yaml
* @return array The YAML converted to a PHP array
*
* @throws ParseException If the YAML is not valid
- *
- * @api
*/
public static function parse($input, $exceptionOnInvalidType = false, $objectSupport = false, $objectForMap = false)
{
@@ -92,8 +88,6 @@ class Yaml
* @param bool $objectSupport true if object support is enabled, false otherwise
*
* @return string A YAML string representing the original PHP array
- *
- * @api
*/
public static function dump($array, $inline = 2, $indent = 4, $exceptionOnInvalidType = false, $objectSupport = false)
{
diff --git a/server/vendor/symfony/yaml/composer.json b/server/vendor/symfony/yaml/composer.json
index b07b439c..b7981415 100644
--- a/server/vendor/symfony/yaml/composer.json
+++ b/server/vendor/symfony/yaml/composer.json
@@ -18,9 +18,6 @@
"require": {
"php": ">=5.3.9"
},
- "require-dev": {
- "symfony/phpunit-bridge": "~2.7"
- },
"autoload": {
"psr-4": { "Symfony\\Component\\Yaml\\": "" }
},