From 8edcaa2039ace1a0cb73316355af76e218a81ecf Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Wed, 14 Oct 2015 16:37:43 +0300 Subject: [PATCH 01/22] Initial changes for Ubuntu 14.04 and Apache 2.2.4 - Updated Apache Virtualhost configuration - Removed cache-fs and logs-fs ext4 configuration --- apache-config | 15 ++++++++------- scripts/install.sh | 23 ++--------------------- 2 files changed, 10 insertions(+), 28 deletions(-) diff --git a/apache-config b/apache-config index 60dee98..4a8b8f2 100644 --- a/apache-config +++ b/apache-config @@ -1,9 +1,10 @@ - DocumentRoot /var/www - - Options -Indexes FollowSymLinks MultiViews - AllowOverride All - Order allow,deny - Allow from all - + DocumentRoot /opt/codebender/builder/Symfony/web + DirectoryIndex app.php + SetEnv APPLICATION_ENV "production" + + Options -Indexes +FollowSymLinks +MultiViews + Require all granted + AllowOverride All + diff --git a/scripts/install.sh b/scripts/install.sh index 31f12d5..d6fd818 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -22,7 +22,7 @@ if [[ "$OSTYPE" == "linux-gnu" ]]; then sudo service apache2 restart elif [[ "$OSTYPE" == "darwin"* ]]; then # is there something comparable to this on os x? perhaps Homebrew - echo "Configuring environment for OS X" + echo "Configuring environment for OS X (to be added..)" fi if [[ ! $TRAVIS ]]; then @@ -50,26 +50,7 @@ rm -rf Symfony/app/logs/* if [[ "$OSTYPE" == "linux-gnu" ]]; then if [[ ! $TRAVIS ]]; then - - sudo dd if=/dev/zero of=cache-fs bs=1024 count=0 seek=200000 - sudo dd if=/dev/zero of=logs-fs bs=1024 count=0 seek=200000 - - yes | sudo mkfs.ext4 cache-fs - yes | sudo mkfs.ext4 logs-fs - - mkdir -p `pwd`/Symfony/app/cache/ - mkdir -p `pwd`/Symfony/app/logs/ - - echo "`pwd`/cache-fs `pwd`/Symfony/app/cache/ ext4 loop,acl 0 0" | sudo tee -a /etc/fstab > /dev/null 2>&1 - echo "`pwd`/logs-fs `pwd`/Symfony/app/logs/ ext4 loop,acl 0 0" | sudo tee -a /etc/fstab > /dev/null 2>&1 - cat /etc/fstab - - sudo mount `pwd`/Symfony/app/cache/ - sudo mount `pwd`/Symfony/app/logs/ - - sudo rm -rf `pwd`/Symfony/app/cache/* - sudo rm -rf `pwd`/Symfony/app/logs/* - + # Set access control for both apache and current user on cache and logs directories sudo setfacl -R -m u:www-data:rwX -m u:`whoami`:rwX `pwd`/Symfony/app/cache `pwd`/Symfony/app/logs sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx `pwd`/Symfony/app/cache `pwd`/Symfony/app/logs fi From 265f2acc7f4650b96f0bb6763acbb8442107c90f Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Wed, 14 Oct 2015 16:50:16 +0300 Subject: [PATCH 02/22] Put back cache/logs dirs creation --- scripts/install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/install.sh b/scripts/install.sh index d6fd818..d3e6b71 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -50,6 +50,10 @@ rm -rf Symfony/app/logs/* if [[ "$OSTYPE" == "linux-gnu" ]]; then if [[ ! $TRAVIS ]]; then + # Need to create cache and logs directories, as they do not pre-exist in new deployments + mkdir -p `pwd`/Symfony/app/cache/ + mkdir -p `pwd`/Symfony/app/logs/ + # Set access control for both apache and current user on cache and logs directories sudo setfacl -R -m u:www-data:rwX -m u:`whoami`:rwX `pwd`/Symfony/app/cache `pwd`/Symfony/app/logs sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx `pwd`/Symfony/app/cache `pwd`/Symfony/app/logs From cd69b93c84339f06e3cf0345556e99de3c0e002c Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Wed, 14 Oct 2015 17:08:50 +0300 Subject: [PATCH 03/22] Updated parameters.yml generation commands --- scripts/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index d3e6b71..f8af11d 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -75,10 +75,10 @@ cd Symfony cp app/config/parameters.yml.dist app/config/parameters.yml set +x -cat app/config/parameters.yml | grep -v "compiler:" | tee app/config/parameters.yml > /dev/null +cat app/config/parameters.yml | grep -iv "compiler:" > app/config/parameters.yml echo " compiler: '$COMPILER_URL'" >> app/config/parameters.yml -cat app/config/parameters.yml | grep -v "library:" | tee app/config/parameters.yml > /dev/null +cat app/config/parameters.yml | grep -v "library:" > app/config/parameters.yml echo " library: '$LIBRARY_URL'" >> app/config/parameters.yml set -x From 6a33b449166411d603cf665248f9a2def3a3d8df Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Wed, 14 Oct 2015 17:16:50 +0300 Subject: [PATCH 04/22] Remove existing compiler/libmgr parameters and append the right ones correctly --- scripts/install.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index f8af11d..433f810 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -72,13 +72,10 @@ cd Symfony ## For reference, here's a command to replace a substring in a file ## cat kourades.sh | sed 's/kourades/skata/g' | tee skata.sh > /dev/null 2>&1 -cp app/config/parameters.yml.dist app/config/parameters.yml - set +x -cat app/config/parameters.yml | grep -iv "compiler:" > app/config/parameters.yml +cat app/config/parameters.yml.dist | grep -iv "compiler:" | grep -iv "library:" > app/config/parameters.yml echo " compiler: '$COMPILER_URL'" >> app/config/parameters.yml -cat app/config/parameters.yml | grep -v "library:" > app/config/parameters.yml echo " library: '$LIBRARY_URL'" >> app/config/parameters.yml set -x From 1330782f4c568e361e034481256472cb66199dfe Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Wed, 14 Oct 2015 18:41:09 +0300 Subject: [PATCH 05/22] Apache 2.4.7 (default on Unbuntu 14.04) requires VirtualHost files to have a '.conf' extension --- scripts/apache_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/apache_install.sh b/scripts/apache_install.sh index f0bea8c..81040b3 100644 --- a/scripts/apache_install.sh +++ b/scripts/apache_install.sh @@ -7,5 +7,5 @@ PACKAGENAME=builder sudo ln -s /opt/codebender/$PACKAGENAME/Symfony/web /var/www/$PACKAGENAME sudo cp /opt/codebender/$PACKAGENAME/apache-config /etc/apache2/sites-available/codebender-$PACKAGENAME cd /etc/apache2/sites-enabled -sudo ln -s ../sites-available/codebender-$PACKAGENAME 00-codebender +sudo ln -s ../sites-available/codebender-$PACKAGENAME 00-codebender.conf sudo service apache2 restart \ No newline at end of file From ae3d8ff0b94d28bd7c3d08c48c3a302740b770c7 Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Wed, 14 Oct 2015 18:46:08 +0300 Subject: [PATCH 06/22] Updated vendors' versions --- Symfony/app/SymfonyRequirements.php | 85 ++-- Symfony/composer.lock | 704 +++++++++++++--------------- 2 files changed, 373 insertions(+), 416 deletions(-) diff --git a/Symfony/app/SymfonyRequirements.php b/Symfony/app/SymfonyRequirements.php index fb70f80..dd7c278 100644 --- a/Symfony/app/SymfonyRequirements.php +++ b/Symfony/app/SymfonyRequirements.php @@ -77,7 +77,7 @@ public function getTestMessage() } /** - * Returns the help text for resolving the problem + * Returns the help text for resolving the problem. * * @return string The help text */ @@ -119,14 +119,14 @@ class PhpIniRequirement extends Requirement * * @param string $cfgName The configuration name used for ini_get() * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false, - or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement - * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. - This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. - Example: You require a config to be true but PHP later removes this config and defaults it to true internally. - * @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived) - * @param string|null $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived) - * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) - * @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement + * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement + * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. + * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. + * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. + * @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived) + * @param string|null $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived) + * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) + * @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement */ public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false) { @@ -221,13 +221,13 @@ public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText * * @param string $cfgName The configuration name used for ini_get() * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false, - or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement - * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. - This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. - Example: You require a config to be true but PHP later removes this config and defaults it to true internally. - * @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived) - * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived) - * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) + * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement + * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. + * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. + * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. + * @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived) + * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived) + * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) */ public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null) { @@ -239,13 +239,13 @@ public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = * * @param string $cfgName The configuration name used for ini_get() * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false, - or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement - * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. - This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. - Example: You require a config to be true but PHP later removes this config and defaults it to true internally. - * @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived) - * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived) - * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) + * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement + * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. + * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. + * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. + * @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived) + * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived) + * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) */ public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null) { @@ -530,11 +530,22 @@ function_exists('simplexml_import_dom'), /* optional recommendations follow */ - $this->addRecommendation( - file_get_contents(__FILE__) === file_get_contents(__DIR__.'/../vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/SymfonyRequirements.php'), - 'Requirements file should be up-to-date', - 'Your requirements file is outdated. Run composer install and re-check your configuration.' - ); + if (file_exists(__DIR__.'/../vendor/composer')) { + require_once __DIR__.'/../vendor/autoload.php'; + + try { + $r = new \ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle'); + + $contents = file_get_contents(dirname($r->getFileName()).'/Resources/skeleton/app/SymfonyRequirements.php'); + } catch (\ReflectionException $e) { + $contents = ''; + } + $this->addRecommendation( + file_get_contents(__FILE__) === $contents, + 'Requirements file should be up-to-date', + 'Your requirements file is outdated. Run composer install and re-check your configuration.' + ); + } $this->addRecommendation( version_compare($installedPhpVersion, '5.3.4', '>='), @@ -578,8 +589,8 @@ function_exists('simplexml_import_dom'), $this->addRecommendation( class_exists('DomDocument'), - 'PHP-XML module should be installed', - 'Install and enable the PHP-XML module.' + 'PHP-DOM and PHP-XML modules should be installed', + 'Install and enable the PHP-DOM and the PHP-XML modules.' ); $this->addRecommendation( @@ -614,15 +625,15 @@ class_exists('Locale'), 'Install and enable the intl extension (used for validators).' ); - if (class_exists('Collator')) { + if (extension_loaded('intl')) { + // in some WAMP server installations, new Collator() returns null $this->addRecommendation( null !== new Collator('fr_FR'), 'intl extension should be correctly configured', 'The intl extension does not behave properly. This problem is typical on PHP 5.3.X x64 WIN builds.' ); - } - if (class_exists('Locale')) { + // check for compatible ICU versions (only done when you have the intl extension) if (defined('INTL_ICU_VERSION')) { $version = INTL_ICU_VERSION; } else { @@ -641,6 +652,14 @@ class_exists('Locale'), 'intl ICU version should be at least 4+', 'Upgrade your intl extension with a newer ICU version (4+).' ); + + $this->addPhpIniRecommendation( + 'intl.error_level', + create_function('$cfgValue', 'return (int) $cfgValue === 0;'), + true, + 'intl.error_level should be 0 in php.ini', + 'Set "intl.error_level" to "0" in php.ini* to inhibit the messages when an error occurs in ICU functions.' + ); } $accelerator = diff --git a/Symfony/composer.lock b/Symfony/composer.lock index 5bb39dc..8e25377 100644 --- a/Symfony/composer.lock +++ b/Symfony/composer.lock @@ -1,23 +1,24 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], "hash": "ce4b4421faaedd6eaee28ab488e8e9b8", + "content-hash": "3cb40dded1c9e59263f6991361ed79e2", "packages": [ { "name": "doctrine/annotations", - "version": "v1.2.0", + "version": "v1.2.7", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "d9b1a37e9351ddde1f19f09a02e3d6ee92e82efd" + "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/d9b1a37e9351ddde1f19f09a02e3d6ee92e82efd", - "reference": "d9b1a37e9351ddde1f19f09a02e3d6ee92e82efd", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535", + "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535", "shasum": "" }, "require": { @@ -44,17 +45,6 @@ "MIT" ], "authors": [ - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com", - "homepage": "http://www.jwage.com/", - "role": "Creator" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -63,11 +53,17 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, { "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", - "role": "Developer of wrapped JMSSerializerBundle" + "email": "schmittjoh@gmail.com" } ], "description": "Docblock Annotations Parser", @@ -77,20 +73,20 @@ "docblock", "parser" ], - "time": "2014-07-06 15:52:21" + "time": "2015-08-31 12:32:49" }, { "name": "doctrine/cache", - "version": "v1.3.0", + "version": "v1.4.2", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "e16d7adf45664a50fa86f515b6d5e7f670130449" + "reference": "8c434000f420ade76a07c64cbe08ca47e5c101ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/e16d7adf45664a50fa86f515b6d5e7f670130449", - "reference": "e16d7adf45664a50fa86f515b6d5e7f670130449", + "url": "https://api.github.com/repos/doctrine/cache/zipball/8c434000f420ade76a07c64cbe08ca47e5c101ca", + "reference": "8c434000f420ade76a07c64cbe08ca47e5c101ca", "shasum": "" }, "require": { @@ -101,12 +97,13 @@ }, "require-dev": { "phpunit/phpunit": ">=3.7", + "predis/predis": "~1.0", "satooshi/php-coveralls": "~0.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.5.x-dev" } }, "autoload": { @@ -119,17 +116,6 @@ "MIT" ], "authors": [ - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com", - "homepage": "http://www.jwage.com/", - "role": "Creator" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -138,11 +124,17 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, { "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", - "role": "Developer of wrapped JMSSerializerBundle" + "email": "schmittjoh@gmail.com" } ], "description": "Caching library offering an object-oriented API for many cache backends", @@ -151,25 +143,28 @@ "cache", "caching" ], - "time": "2013-10-25 19:04:14" + "time": "2015-08-31 12:36:41" }, { "name": "doctrine/collections", - "version": "v1.2", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "b99c5c46c87126201899afe88ec490a25eedd6a2" + "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/b99c5c46c87126201899afe88ec490a25eedd6a2", - "reference": "b99c5c46c87126201899afe88ec490a25eedd6a2", + "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a", + "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a", "shasum": "" }, "require": { "php": ">=5.3.2" }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, "type": "library", "extra": { "branch-alias": { @@ -186,17 +181,6 @@ "MIT" ], "authors": [ - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com", - "homepage": "http://www.jwage.com/", - "role": "Creator" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -205,11 +189,17 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, { "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", - "role": "Developer of wrapped JMSSerializerBundle" + "email": "schmittjoh@gmail.com" } ], "description": "Collections Abstraction library", @@ -219,20 +209,20 @@ "collections", "iterator" ], - "time": "2014-02-03 23:07:43" + "time": "2015-04-14 22:21:58" }, { "name": "doctrine/common", - "version": "v2.4.2", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "5db6ab40e4c531f14dad4ca96a394dfce5d4255b" + "reference": "0009b8f0d4a917aabc971fb089eba80e872f83f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/5db6ab40e4c531f14dad4ca96a394dfce5d4255b", - "reference": "5db6ab40e4c531f14dad4ca96a394dfce5d4255b", + "url": "https://api.github.com/repos/doctrine/common/zipball/0009b8f0d4a917aabc971fb089eba80e872f83f9", + "reference": "0009b8f0d4a917aabc971fb089eba80e872f83f9", "shasum": "" }, "require": { @@ -249,7 +239,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4.x-dev" + "dev-master": "2.6.x-dev" } }, "autoload": { @@ -262,17 +252,6 @@ "MIT" ], "authors": [ - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com", - "homepage": "http://www.jwage.com/", - "role": "Creator" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -281,11 +260,17 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, { "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", - "role": "Developer of wrapped JMSSerializerBundle" + "email": "schmittjoh@gmail.com" } ], "description": "Common Library for Doctrine projects", @@ -297,20 +282,20 @@ "persistence", "spl" ], - "time": "2014-05-21 19:28:51" + "time": "2015-08-31 13:00:22" }, { "name": "doctrine/dbal", - "version": "v2.4.2", + "version": "v2.4.4", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "fec965d330c958e175c39e61c3f6751955af32d0" + "reference": "a370e5b95e509a7809d11f3d280acfc9310d464b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/fec965d330c958e175c39e61c3f6751955af32d0", - "reference": "fec965d330c958e175c39e61c3f6751955af32d0", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/a370e5b95e509a7809d11f3d280acfc9310d464b", + "reference": "a370e5b95e509a7809d11f3d280acfc9310d464b", "shasum": "" }, "require": { @@ -322,7 +307,7 @@ "symfony/console": "~2.0" }, "suggest": { - "symfony/console": "Allows use of the command line interface" + "symfony/console": "For helpful console commands such as SQL execution and import of files." }, "type": "library", "autoload": { @@ -335,17 +320,6 @@ "MIT" ], "authors": [ - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com", - "homepage": "http://www.jwage.com/", - "role": "Creator" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -353,6 +327,14 @@ { "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" } ], "description": "Database Abstraction Layer", @@ -363,7 +345,7 @@ "persistence", "queryobject" ], - "time": "2014-01-01 16:43:57" + "time": "2015-01-12 21:57:01" }, { "name": "doctrine/doctrine-bundle", @@ -439,22 +421,30 @@ }, { "name": "doctrine/inflector", - "version": "v1.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "54b8333d2a5682afdc690060c1cf384ba9f47f08" + "reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/54b8333d2a5682afdc690060c1cf384ba9f47f08", - "reference": "54b8333d2a5682afdc690060c1cf384ba9f47f08", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/0bcb2e79d8571787f18b7eb036ed3d004908e604", + "reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604", "shasum": "" }, "require": { "php": ">=5.3.2" }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "autoload": { "psr-0": { "Doctrine\\Common\\Inflector\\": "lib/" @@ -465,17 +455,6 @@ "MIT" ], "authors": [ - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com", - "homepage": "http://www.jwage.com/", - "role": "Creator" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -484,41 +463,52 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, { "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", - "role": "Developer of wrapped JMSSerializerBundle" + "email": "schmittjoh@gmail.com" } ], "description": "Common String Manipulations with regard to casing and singular/plural rules.", "homepage": "http://www.doctrine-project.org", "keywords": [ "inflection", - "pluarlize", - "singuarlize", + "pluralize", + "singularize", "string" ], - "time": "2013-01-10 21:49:15" + "time": "2014-12-20 21:24:13" }, { "name": "doctrine/lexer", - "version": "v1.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "2f708a85bb3aab5d99dab8be435abd73e0b18acb" + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/2f708a85bb3aab5d99dab8be435abd73e0b18acb", - "reference": "2f708a85bb3aab5d99dab8be435abd73e0b18acb", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", "shasum": "" }, "require": { "php": ">=5.3.2" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "autoload": { "psr-0": { "Doctrine\\Common\\Lexer\\": "lib/" @@ -529,20 +519,17 @@ "MIT" ], "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, { "name": "Roman Borschel", "email": "roman@code-factory.org" }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", - "role": "Developer of wrapped JMSSerializerBundle" + "email": "schmittjoh@gmail.com" } ], "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", @@ -551,20 +538,20 @@ "lexer", "parser" ], - "time": "2013-01-12 18:59:04" + "time": "2014-09-09 13:34:57" }, { "name": "doctrine/orm", - "version": "v2.4.4", + "version": "v2.4.8", "source": { "type": "git", "url": "https://github.com/doctrine/doctrine2.git", - "reference": "fc19c3b53dcd00e6584db40669fdd699c4671f97" + "reference": "5aedac1e5c5caaeac14798822c70325dc242d467" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/fc19c3b53dcd00e6584db40669fdd699c4671f97", - "reference": "fc19c3b53dcd00e6584db40669fdd699c4671f97", + "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/5aedac1e5c5caaeac14798822c70325dc242d467", + "reference": "5aedac1e5c5caaeac14798822c70325dc242d467", "shasum": "" }, "require": { @@ -601,17 +588,6 @@ "MIT" ], "authors": [ - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com", - "homepage": "http://www.jwage.com/", - "role": "Creator" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -619,6 +595,14 @@ { "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" } ], "description": "Object-Relational-Mapper for PHP", @@ -627,21 +611,20 @@ "database", "orm" ], - "time": "2014-07-11 03:05:53" + "time": "2015-08-31 13:19:01" }, { "name": "incenteev/composer-parameter-handler", - "version": "v2.1.0", - "target-dir": "Incenteev/ParameterHandler", + "version": "v2.1.1", "source": { "type": "git", "url": "https://github.com/Incenteev/ParameterHandler.git", - "reference": "143272a0a09c62616a3c8011fc165a10c6b35241" + "reference": "84a205fe80a46101607bafbc423019527893ddd0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Incenteev/ParameterHandler/zipball/143272a0a09c62616a3c8011fc165a10c6b35241", - "reference": "143272a0a09c62616a3c8011fc165a10c6b35241", + "url": "https://api.github.com/repos/Incenteev/ParameterHandler/zipball/84a205fe80a46101607bafbc423019527893ddd0", + "reference": "84a205fe80a46101607bafbc423019527893ddd0", "shasum": "" }, "require": { @@ -660,8 +643,8 @@ } }, "autoload": { - "psr-0": { - "Incenteev\\ParameterHandler": "" + "psr-4": { + "Incenteev\\ParameterHandler\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -679,7 +662,7 @@ "keywords": [ "parameters management" ], - "time": "2013-12-07 10:10:39" + "time": "2015-06-03 08:27:03" }, { "name": "jdorn/sql-formatter", @@ -733,16 +716,16 @@ }, { "name": "kriswallsmith/assetic", - "version": "v1.1.2", + "version": "v1.1.3", "source": { "type": "git", "url": "https://github.com/kriswallsmith/assetic.git", - "reference": "735cffd3982c6e8cdebe292d5db39d077f65890f" + "reference": "02105abcd35fb32933bc566e4c3bec84c612e9c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kriswallsmith/assetic/zipball/735cffd3982c6e8cdebe292d5db39d077f65890f", - "reference": "735cffd3982c6e8cdebe292d5db39d077f65890f", + "url": "https://api.github.com/repos/kriswallsmith/assetic/zipball/02105abcd35fb32933bc566e4c3bec84c612e9c1", + "reference": "02105abcd35fb32933bc566e4c3bec84c612e9c1", "shasum": "" }, "require": { @@ -800,33 +783,41 @@ "compression", "minification" ], - "time": "2013-07-19 00:03:27" + "time": "2014-12-12 05:37:00" }, { "name": "monolog/monolog", - "version": "1.10.0", + "version": "1.17.2", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "25b16e801979098cb2f120e697bfce454b18bf23" + "reference": "bee7f0dc9c3e0b69a6039697533dca1e845c8c24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/25b16e801979098cb2f120e697bfce454b18bf23", - "reference": "25b16e801979098cb2f120e697bfce454b18bf23", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bee7f0dc9c3e0b69a6039697533dca1e845c8c24", + "reference": "bee7f0dc9c3e0b69a6039697533dca1e845c8c24", "shasum": "" }, "require": { "php": ">=5.3.0", "psr/log": "~1.0" }, + "provide": { + "psr/log-implementation": "1.0.0" + }, "require-dev": { - "aws/aws-sdk-php": "~2.4, >2.4.8", + "aws/aws-sdk-php": "^2.4.9", "doctrine/couchdb": "~1.0@dev", "graylog2/gelf-php": "~1.0", - "phpunit/phpunit": "~3.7.0", - "raven/raven": "~0.5", - "ruflin/elastica": "0.90.*" + "jakub-onderka/php-parallel-lint": "0.9", + "php-console/php-console": "^3.1.3", + "phpunit/phpunit": "~4.5", + "phpunit/phpunit-mock-objects": "2.3.0", + "raven/raven": "^0.13", + "ruflin/elastica": ">=0.90 <3.0", + "swiftmailer/swiftmailer": "~5.3", + "videlalvaro/php-amqplib": "~2.4" }, "suggest": { "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", @@ -834,14 +825,16 @@ "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", "ext-mongo": "Allow sending log messages to a MongoDB server", "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "php-console/php-console": "Allow sending log messages to Google Chrome", "raven/raven": "Allow sending log messages to a Sentry server", "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.10.x-dev" + "dev-master": "1.16.x-dev" } }, "autoload": { @@ -857,8 +850,7 @@ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", - "homepage": "http://seld.be", - "role": "Developer" + "homepage": "http://seld.be" } ], "description": "Sends your logs to files, sockets, inboxes, databases and various web services", @@ -868,7 +860,7 @@ "logging", "psr-3" ], - "time": "2014-06-04 16:30:04" + "time": "2015-10-14 12:51:02" }, { "name": "psr/log", @@ -910,17 +902,17 @@ }, { "name": "sensio/distribution-bundle", - "version": "v2.3.4", + "version": "v2.3.22", "target-dir": "Sensio/Bundle/DistributionBundle", "source": { "type": "git", "url": "https://github.com/sensiolabs/SensioDistributionBundle.git", - "reference": "66df91b4bd637a83299d8072aed3658bfd3b3021" + "reference": "98bdda791e7c2dfb5fd55781e69a4b00e4f751a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/66df91b4bd637a83299d8072aed3658bfd3b3021", - "reference": "66df91b4bd637a83299d8072aed3658bfd3b3021", + "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/98bdda791e7c2dfb5fd55781e69a4b00e4f751a6", + "reference": "98bdda791e7c2dfb5fd55781e69a4b00e4f751a6", "shasum": "" }, "require": { @@ -944,9 +936,7 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "email": "fabien@symfony.com" } ], "description": "The base bundle for the Symfony Distributions", @@ -954,7 +944,7 @@ "configuration", "distribution" ], - "time": "2013-08-22 05:04:53" + "time": "2015-06-05 22:32:08" }, { "name": "sensio/framework-extra-bundle", @@ -1057,28 +1047,28 @@ }, { "name": "swiftmailer/swiftmailer", - "version": "v5.2.1", + "version": "v5.4.1", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "2b9af56cc676c338d52fca4c657e5bdff73bb7af" + "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/2b9af56cc676c338d52fca4c657e5bdff73bb7af", - "reference": "2b9af56cc676c338d52fca4c657e5bdff73bb7af", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/0697e6aa65c83edf97bb0f23d8763f94e3f11421", + "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421", "shasum": "" }, "require": { - "php": ">=5.2.4" + "php": ">=5.3.3" }, "require-dev": { - "mockery/mockery": "~0.9.1" + "mockery/mockery": "~0.9.1,<0.9.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.2-dev" + "dev-master": "5.4-dev" } }, "autoload": { @@ -1092,40 +1082,39 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "name": "Chris Corbyn" }, { - "name": "Chris Corbyn" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Swiftmailer, free feature-rich PHP mailer", "homepage": "http://swiftmailer.org", "keywords": [ + "email", "mail", "mailer" ], - "time": "2014-06-13 11:44:54" + "time": "2015-06-06 14:19:39" }, { "name": "symfony/assetic-bundle", - "version": "v2.3.0", + "version": "v2.3.1", "target-dir": "Symfony/Bundle/AsseticBundle", "source": { "type": "git", - "url": "https://github.com/symfony/AsseticBundle.git", - "reference": "146dd3cb46b302bd471560471c6aaa930483dac1" + "url": "https://github.com/symfony/assetic-bundle.git", + "reference": "099e0bb5d80e7039af20db384a41017fde521f21" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/AsseticBundle/zipball/146dd3cb46b302bd471560471c6aaa930483dac1", - "reference": "146dd3cb46b302bd471560471c6aaa930483dac1", + "url": "https://api.github.com/repos/symfony/assetic-bundle/zipball/099e0bb5d80e7039af20db384a41017fde521f21", + "reference": "099e0bb5d80e7039af20db384a41017fde521f21", "shasum": "" }, "require": { - "kriswallsmith/assetic": "~1.1", + "kriswallsmith/assetic": "1.1.x", "php": ">=5.3.0", "symfony/framework-bundle": "~2.1" }, @@ -1144,7 +1133,7 @@ "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "2.3-dev" } }, "autoload": { @@ -1170,56 +1159,7 @@ "compression", "minification" ], - "time": "2013-05-16 05:32:23" - }, - { - "name": "symfony/icu", - "version": "v1.2.2", - "target-dir": "Symfony/Component/Icu", - "source": { - "type": "git", - "url": "https://github.com/symfony/Icu.git", - "reference": "d4d85d6055b87f394d941b45ddd3a9173e1e3d2a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Icu/zipball/d4d85d6055b87f394d941b45ddd3a9173e1e3d2a", - "reference": "d4d85d6055b87f394d941b45ddd3a9173e1e3d2a", - "shasum": "" - }, - "require": { - "ext-intl": "*", - "lib-icu": ">=4.4", - "php": ">=5.3.3", - "symfony/intl": "~2.3" - }, - "type": "library", - "autoload": { - "psr-0": { - "Symfony\\Component\\Icu\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Contains an excerpt of the ICU data and classes to load it.", - "homepage": "http://symfony.com", - "keywords": [ - "icu", - "intl" - ], - "time": "2014-07-25 09:58:17" + "time": "2013-11-25 16:34:50" }, { "name": "symfony/monolog-bundle", @@ -1227,12 +1167,12 @@ "target-dir": "Symfony/Bundle/MonologBundle", "source": { "type": "git", - "url": "https://github.com/symfony/MonologBundle.git", + "url": "https://github.com/symfony/monolog-bundle.git", "reference": "03ed73bc11367b3156cc21f22ac37c7f70fcd10a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/MonologBundle/zipball/03ed73bc11367b3156cc21f22ac37c7f70fcd10a", + "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/03ed73bc11367b3156cc21f22ac37c7f70fcd10a", "reference": "03ed73bc11367b3156cc21f22ac37c7f70fcd10a", "shasum": "" }, @@ -1283,17 +1223,16 @@ }, { "name": "symfony/swiftmailer-bundle", - "version": "v2.3.7", - "target-dir": "Symfony/Bundle/SwiftmailerBundle", + "version": "v2.3.8", "source": { "type": "git", - "url": "https://github.com/symfony/SwiftmailerBundle.git", - "reference": "e98defd402f72e8b54a029ba4d3ac4cb51dc3577" + "url": "https://github.com/symfony/swiftmailer-bundle.git", + "reference": "970b13d01871207e81d17b17ddda025e7e21e797" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/SwiftmailerBundle/zipball/e98defd402f72e8b54a029ba4d3ac4cb51dc3577", - "reference": "e98defd402f72e8b54a029ba4d3ac4cb51dc3577", + "url": "https://api.github.com/repos/symfony/swiftmailer-bundle/zipball/970b13d01871207e81d17b17ddda025e7e21e797", + "reference": "970b13d01871207e81d17b17ddda025e7e21e797", "shasum": "" }, "require": { @@ -1307,6 +1246,9 @@ "symfony/http-kernel": "~2.1", "symfony/yaml": "~2.1" }, + "suggest": { + "psr/log": "Allows logging" + }, "type": "symfony-bundle", "extra": { "branch-alias": { @@ -1314,8 +1256,8 @@ } }, "autoload": { - "psr-0": { - "Symfony\\Bundle\\SwiftmailerBundle": "" + "psr-4": { + "Symfony\\Bundle\\SwiftmailerBundle\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1323,41 +1265,38 @@ "MIT" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony SwiftmailerBundle", "homepage": "http://symfony.com", - "time": "2014-04-05 17:15:52" + "time": "2014-12-01 17:44:50" }, { "name": "symfony/symfony", - "version": "v2.3.18", + "version": "v2.3.33", "source": { "type": "git", "url": "https://github.com/symfony/symfony.git", - "reference": "75e07e6bde6391a6f49c8546a43740c80ac1b06b" + "reference": "3b8a8ee48e8ad81cb5d9d85b909bbd28011423a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/symfony/zipball/75e07e6bde6391a6f49c8546a43740c80ac1b06b", - "reference": "75e07e6bde6391a6f49c8546a43740c80ac1b06b", + "url": "https://api.github.com/repos/symfony/symfony/zipball/3b8a8ee48e8ad81cb5d9d85b909bbd28011423a1", + "reference": "3b8a8ee48e8ad81cb5d9d85b909bbd28011423a1", "shasum": "" }, "require": { - "doctrine/common": "~2.2", + "doctrine/common": "~2.4", "php": ">=5.3.3", "psr/log": "~1.0", - "symfony/icu": "~1.0", - "twig/twig": "~1.12" + "twig/twig": "~1.20|~2.0" }, "replace": { "symfony/browser-kit": "self.version", @@ -1400,12 +1339,13 @@ }, "require-dev": { "doctrine/data-fixtures": "1.0.*", - "doctrine/dbal": "~2.2", - "doctrine/orm": "~2.2,>=2.2.3", - "ircmaxell/password-compat": "1.0.*", + "doctrine/dbal": "~2.4", + "doctrine/orm": "~2.4,>=2.4.5", + "ircmaxell/password-compat": "~1.0", "monolog/monolog": "~1.3", - "ocramius/proxy-manager": ">=0.3.1,<0.4-dev", - "propel/propel1": "1.6.*" + "ocramius/proxy-manager": "~0.3.1", + "propel/propel1": "~1.6", + "symfony/phpunit-bridge": "~2.7" }, "type": "library", "extra": { @@ -1432,33 +1372,31 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "email": "fabien@symfony.com" }, { "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "homepage": "https://symfony.com/contributors" } ], "description": "The Symfony PHP framework", - "homepage": "http://symfony.com", + "homepage": "https://symfony.com", "keywords": [ "framework" ], - "time": "2014-07-15 14:20:44" + "time": "2015-09-25 09:08:49" }, { "name": "twig/extensions", "version": "v1.0.1", "source": { "type": "git", - "url": "https://github.com/fabpot/Twig-extensions.git", + "url": "https://github.com/twigphp/Twig-extensions.git", "reference": "f91a82ec225e5bb108e01a0f93c9be04f84dcfa0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fabpot/Twig-extensions/zipball/f91a82ec225e5bb108e01a0f93c9be04f84dcfa0", + "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/f91a82ec225e5bb108e01a0f93c9be04f84dcfa0", "reference": "f91a82ec225e5bb108e01a0f93c9be04f84dcfa0", "shasum": "" }, @@ -1499,25 +1437,29 @@ }, { "name": "twig/twig", - "version": "v1.16.0", + "version": "v1.22.3", "source": { "type": "git", - "url": "https://github.com/fabpot/Twig.git", - "reference": "8ce37115802e257a984a82d38254884085060024" + "url": "https://github.com/twigphp/Twig.git", + "reference": "ebfc36b7e77b0c1175afe30459cf943010245540" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fabpot/Twig/zipball/8ce37115802e257a984a82d38254884085060024", - "reference": "8ce37115802e257a984a82d38254884085060024", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/ebfc36b7e77b0c1175afe30459cf943010245540", + "reference": "ebfc36b7e77b0c1175afe30459cf943010245540", "shasum": "" }, "require": { - "php": ">=5.2.4" + "php": ">=5.2.7" + }, + "require-dev": { + "symfony/debug": "~2.7", + "symfony/phpunit-bridge": "~2.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.16-dev" + "dev-master": "1.22-dev" } }, "autoload": { @@ -1543,7 +1485,7 @@ }, { "name": "Twig Team", - "homepage": "https://github.com/fabpot/Twig/graphs/contributors", + "homepage": "http://twig.sensiolabs.org/contributors", "role": "Contributors" } ], @@ -1552,22 +1494,22 @@ "keywords": [ "templating" ], - "time": "2014-07-05 12:19:05" + "time": "2015-10-13 07:07:02" } ], "packages-dev": [ { "name": "guzzle/guzzle", - "version": "v3.9.2", + "version": "v3.9.3", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle3.git", - "reference": "54991459675c1a2924122afbb0e5609ade581155" + "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/54991459675c1a2924122afbb0e5609ade581155", - "reference": "54991459675c1a2924122afbb0e5609ade581155", + "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", + "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", "shasum": "" }, "require": { @@ -1608,6 +1550,9 @@ "zendframework/zend-cache": "2.*,<2.3", "zendframework/zend-log": "2.*,<2.3" }, + "suggest": { + "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." + }, "type": "library", "extra": { "branch-alias": { @@ -1635,7 +1580,7 @@ "homepage": "https://github.com/guzzle/guzzle/contributors" } ], - "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", + "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", "homepage": "http://guzzlephp.org/", "keywords": [ "client", @@ -1646,20 +1591,20 @@ "rest", "web service" ], - "time": "2014-08-11 04:32:36" + "time": "2015-03-18 18:23:50" }, { "name": "pdepend/pdepend", - "version": "2.0.0", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/pdepend/pdepend.git", - "reference": "b74f2bb68e86104cd97dfb8d74209692c9b465ce" + "reference": "dc582a3c0180664a8fbfc5a34efaf4cc13fccc60" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pdepend/pdepend/zipball/b74f2bb68e86104cd97dfb8d74209692c9b465ce", - "reference": "b74f2bb68e86104cd97dfb8d74209692c9b465ce", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/dc582a3c0180664a8fbfc5a34efaf4cc13fccc60", + "reference": "dc582a3c0180664a8fbfc5a34efaf4cc13fccc60", "shasum": "" }, "require": { @@ -1685,7 +1630,7 @@ "BSD-3-Clause" ], "description": "Official version of pdepend to be handled with Composer", - "time": "2014-05-21 09:48:10" + "time": "2014-10-08 06:54:50" }, { "name": "phpmd/phpmd", @@ -1731,23 +1676,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "1.2.17", + "version": "1.2.18", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "6ef2bf3a1c47eca07ea95f0d8a902a6340390b34" + "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6ef2bf3a1c47eca07ea95f0d8a902a6340390b34", - "reference": "6ef2bf3a1c47eca07ea95f0d8a902a6340390b34", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", + "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", "shasum": "" }, "require": { "php": ">=5.3.3", "phpunit/php-file-iterator": ">=1.3.0@stable", "phpunit/php-text-template": ">=1.2.0@stable", - "phpunit/php-token-stream": ">=1.1.3@stable" + "phpunit/php-token-stream": ">=1.1.3,<1.3.0" }, "require-dev": { "phpunit/phpunit": "3.7.*@dev" @@ -1788,35 +1733,37 @@ "testing", "xunit" ], - "time": "2014-03-28 10:53:45" + "time": "2014-09-02 10:13:14" }, { "name": "phpunit/php-file-iterator", - "version": "1.3.4", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", - "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", "shasum": "" }, "require": { "php": ">=5.3.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, "autoload": { "classmap": [ - "File/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -1833,20 +1780,20 @@ "filesystem", "iterator" ], - "time": "2013-10-10 15:34:57" + "time": "2015-06-21 13:08:43" }, { "name": "phpunit/php-text-template", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", "shasum": "" }, "require": { @@ -1855,20 +1802,17 @@ "type": "library", "autoload": { "classmap": [ - "Text/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -1877,20 +1821,20 @@ "keywords": [ "template" ], - "time": "2014-01-30 17:20:04" + "time": "2015-06-21 13:50:34" }, { "name": "phpunit/php-timer", - "version": "1.0.5", + "version": "1.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", "shasum": "" }, "require": { @@ -1899,13 +1843,10 @@ "type": "library", "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -1921,7 +1862,7 @@ "keywords": [ "timer" ], - "time": "2013-08-02 07:42:54" + "time": "2015-06-21 08:01:12" }, { "name": "phpunit/php-token-stream", @@ -1975,16 +1916,16 @@ }, { "name": "phpunit/phpunit", - "version": "3.7.37", + "version": "3.7.38", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ae6cefd7cc84586a5ef27e04bae11ee940ec63dc" + "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ae6cefd7cc84586a5ef27e04bae11ee940ec63dc", - "reference": "ae6cefd7cc84586a5ef27e04bae11ee940ec63dc", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/38709dc22d519a3d1be46849868aa2ddf822bcf6", + "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6", "shasum": "" }, "require": { @@ -2044,7 +1985,7 @@ "testing", "xunit" ], - "time": "2014-04-30 12:24:19" + "time": "2014-10-17 09:04:17" }, { "name": "phpunit/phpunit-mock-objects", @@ -2101,12 +2042,12 @@ "source": { "type": "git", "url": "https://github.com/satooshi/php-coveralls.git", - "reference": "94389a0ebdb64857d6899b5e0254dffa99e5aa96" + "reference": "2fbf803803d179ab1082807308a67bbd5a760c70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/94389a0ebdb64857d6899b5e0254dffa99e5aa96", - "reference": "94389a0ebdb64857d6899b5e0254dffa99e5aa96", + "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/2fbf803803d179ab1082807308a67bbd5a760c70", + "reference": "2fbf803803d179ab1082807308a67bbd5a760c70", "shasum": "" }, "require": { @@ -2168,25 +2109,25 @@ "github", "test" ], - "time": "2014-07-09 10:45:38" + "time": "2014-11-11 15:35:34" }, { "name": "sebastian/finder-facade", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/finder-facade.git", - "reference": "1e396fda3449fce9df032749fa4fa2619e0347e0" + "reference": "a520dcc3dd39160eea480daa3426f4fd419a327b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/1e396fda3449fce9df032749fa4fa2619e0347e0", - "reference": "1e396fda3449fce9df032749fa4fa2619e0347e0", + "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/a520dcc3dd39160eea480daa3426f4fd419a327b", + "reference": "a520dcc3dd39160eea480daa3426f4fd419a327b", "shasum": "" }, "require": { - "symfony/finder": ">=2.2.0", - "theseer/fdomdocument": ">=1.3.1" + "symfony/finder": "~2.3", + "theseer/fdomdocument": "~1.3" }, "type": "library", "autoload": { @@ -2207,28 +2148,28 @@ ], "description": "FinderFacade is a convenience wrapper for Symfony's Finder component.", "homepage": "https://github.com/sebastianbergmann/finder-facade", - "time": "2013-05-28 06:10:03" + "time": "2015-06-04 08:11:58" }, { "name": "sebastian/phpcpd", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpcpd.git", - "reference": "a9462153f2dd90466a010179901d31fbff598365" + "reference": "d3ad100fdf15805495f6ff19f473f4314c99390c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpcpd/zipball/a9462153f2dd90466a010179901d31fbff598365", - "reference": "a9462153f2dd90466a010179901d31fbff598365", + "url": "https://api.github.com/repos/sebastianbergmann/phpcpd/zipball/d3ad100fdf15805495f6ff19f473f4314c99390c", + "reference": "d3ad100fdf15805495f6ff19f473f4314c99390c", "shasum": "" }, "require": { "php": ">=5.3.3", - "phpunit/php-timer": ">=1.0.4", - "sebastian/finder-facade": ">=1.1.0", - "sebastian/version": ">=1.0.3", - "symfony/console": ">=2.2.0", + "phpunit/php-timer": "~1.0", + "sebastian/finder-facade": "~1.1", + "sebastian/version": "~1.0", + "symfony/console": "~2.2", "theseer/fdomdocument": "~1.4" }, "bin": [ @@ -2258,20 +2199,20 @@ ], "description": "Copy/Paste Detector (CPD) for PHP code.", "homepage": "https://github.com/sebastianbergmann/phpcpd", - "time": "2014-03-31 09:25:30" + "time": "2015-03-26 14:47:38" }, { "name": "sebastian/version", - "version": "1.0.3", + "version": "1.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43" + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43", - "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", "shasum": "" }, "type": "library", @@ -2293,20 +2234,20 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2014-03-07 15:35:33" + "time": "2015-06-21 13:59:46" }, { "name": "theseer/fdomdocument", - "version": "1.5.0", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/theseer/fDOMDocument.git", - "reference": "137aa3b13bef05b4e301899cbabdaf7d501847d2" + "reference": "d9ad139d6c2e8edf5e313ffbe37ff13344cf0684" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/fDOMDocument/zipball/137aa3b13bef05b4e301899cbabdaf7d501847d2", - "reference": "137aa3b13bef05b4e301899cbabdaf7d501847d2", + "url": "https://api.github.com/repos/theseer/fDOMDocument/zipball/d9ad139d6c2e8edf5e313ffbe37ff13344cf0684", + "reference": "d9ad139d6c2e8edf5e313ffbe37ff13344cf0684", "shasum": "" }, "require": { @@ -2328,26 +2269,23 @@ { "name": "Arne Blankerts", "email": "arne@blankerts.de", - "role": "Developer" + "role": "lead" } ], "description": "The classes contained within this repository extend the standard DOM to use exceptions at all occasions of errors instead of PHP warnings or notices. They also add various custom methods and shortcuts for convenience and to simplify the usage of DOM.", "homepage": "https://github.com/theseer/fDOMDocument", - "time": "2014-02-19 00:20:43" + "time": "2015-05-27 22:58:02" } ], - "aliases": [ - - ], + "aliases": [], "minimum-stability": "stable", "stability-flags": { "satooshi/php-coveralls": 20 }, "prefer-stable": false, + "prefer-lowest": false, "platform": { "php": ">=5.3.3" }, - "platform-dev": [ - - ] + "platform-dev": [] } From 3443923ebc750d2979d60a9efc163c1c21b61c37 Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Thu, 15 Oct 2015 09:54:47 +0300 Subject: [PATCH 07/22] Updated PHPUnit to version 4.8.13 --- Symfony/composer.json | 7 +- Symfony/composer.lock | 629 +++++++++++++++++++++++++++++++++++++----- 2 files changed, 572 insertions(+), 64 deletions(-) diff --git a/Symfony/composer.json b/Symfony/composer.json index 4a7dc45..d3f8a53 100644 --- a/Symfony/composer.json +++ b/Symfony/composer.json @@ -21,10 +21,13 @@ "incenteev/composer-parameter-handler": "~2.0" }, "require-dev": { - "phpunit/phpunit": "3.7.*", + "phpunit/phpunit": "4.8.*", "satooshi/php-coveralls": "dev-master", "sebastian/phpcpd": "*", - "phpmd/phpmd" : "2.0.*" + "phpmd/phpmd" : "2.0.*", + "phpunit/php-token-stream": "~1.3", + "phpunit/php-code-coverage": "~2.1", + "phpunit/phpunit-mock-objects": "~2.3" }, "scripts": { "post-install-cmd": [ diff --git a/Symfony/composer.lock b/Symfony/composer.lock index 8e25377..f621bad 100644 --- a/Symfony/composer.lock +++ b/Symfony/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "ce4b4421faaedd6eaee28ab488e8e9b8", - "content-hash": "3cb40dded1c9e59263f6991361ed79e2", + "hash": "8da382063ac73510d47c6eb7d7276a74", + "content-hash": "7b2f337d4ac8d2924492f84e61509511", "packages": [ { "name": "doctrine/annotations", @@ -1498,6 +1498,60 @@ } ], "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14 21:17:01" + }, { "name": "guzzle/guzzle", "version": "v3.9.3", @@ -1632,6 +1686,55 @@ "description": "Official version of pdepend to be handled with Composer", "time": "2014-10-08 06:54:50" }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2015-02-03 12:10:50" + }, { "name": "phpmd/phpmd", "version": "2.0.0", @@ -1674,48 +1777,109 @@ "description": "Official version of PHPMD handled with Composer.", "time": "2014-05-21 12:45:23" }, + { + "name": "phpspec/prophecy", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", + "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "phpdocumentor/reflection-docblock": "~2.0", + "sebastian/comparator": "~1.1" + }, + "require-dev": { + "phpspec/phpspec": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2015-08-13 10:07:40" + }, { "name": "phpunit/php-code-coverage", - "version": "1.2.18", + "version": "2.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b" + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", - "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", "shasum": "" }, "require": { "php": ">=5.3.3", - "phpunit/php-file-iterator": ">=1.3.0@stable", - "phpunit/php-text-template": ">=1.2.0@stable", - "phpunit/php-token-stream": ">=1.1.3,<1.3.0" + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "~1.3", + "sebastian/environment": "^1.3.2", + "sebastian/version": "~1.0" }, "require-dev": { - "phpunit/phpunit": "3.7.*@dev" + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4" }, "suggest": { "ext-dom": "*", - "ext-xdebug": ">=2.0.5" + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "2.2.x-dev" } }, "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -1733,7 +1897,7 @@ "testing", "xunit" ], - "time": "2014-09-02 10:13:14" + "time": "2015-10-06 15:47:00" }, { "name": "phpunit/php-file-iterator", @@ -1866,45 +2030,44 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.2.2", + "version": "1.4.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32" + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32", - "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", "shasum": "" }, "require": { "ext-tokenizer": "*", "php": ">=5.3.3" }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.4-dev" } }, "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], "description": "Wrapper around PHP's tokenizer extension.", @@ -1912,62 +2075,61 @@ "keywords": [ "tokenizer" ], - "time": "2014-03-03 05:10:30" + "time": "2015-09-15 10:49:45" }, { "name": "phpunit/phpunit", - "version": "3.7.38", + "version": "4.8.13", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6" + "reference": "be067d6105286b74272facefc2697038f8807b77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/38709dc22d519a3d1be46849868aa2ddf822bcf6", - "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/be067d6105286b74272facefc2697038f8807b77", + "reference": "be067d6105286b74272facefc2697038f8807b77", "shasum": "" }, "require": { - "ext-ctype": "*", "ext-dom": "*", "ext-json": "*", "ext-pcre": "*", "ext-reflection": "*", "ext-spl": "*", "php": ">=5.3.3", - "phpunit/php-code-coverage": "~1.2", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.1", - "phpunit/php-timer": "~1.0", - "phpunit/phpunit-mock-objects": "~1.2", - "symfony/yaml": "~2.0" - }, - "require-dev": { - "pear-pear.php.net/pear": "1.9.4" + "phpspec/prophecy": "^1.3.1", + "phpunit/php-code-coverage": "~2.1", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": ">=1.0.6", + "phpunit/phpunit-mock-objects": "~2.3", + "sebastian/comparator": "~1.1", + "sebastian/diff": "~1.2", + "sebastian/environment": "~1.3", + "sebastian/exporter": "~1.2", + "sebastian/global-state": "~1.0", + "sebastian/version": "~1.0", + "symfony/yaml": "~2.1|~3.0" }, "suggest": { "phpunit/php-invoker": "~1.1" }, "bin": [ - "composer/bin/phpunit" + "phpunit" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.7.x-dev" + "dev-master": "4.8.x-dev" } }, "autoload": { "classmap": [ - "PHPUnit/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "", - "../../symfony/yaml/" - ], "license": [ "BSD-3-Clause" ], @@ -1979,45 +2141,52 @@ } ], "description": "The PHP Unit Testing framework.", - "homepage": "http://www.phpunit.de/", + "homepage": "https://phpunit.de/", "keywords": [ "phpunit", "testing", "xunit" ], - "time": "2014-10-17 09:04:17" + "time": "2015-10-14 13:49:40" }, { "name": "phpunit/phpunit-mock-objects", - "version": "1.2.3", + "version": "2.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875" + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5794e3c5c5ba0fb037b11d8151add2a07fa82875", - "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", "shasum": "" }, "require": { + "doctrine/instantiator": "^1.0.2", "php": ">=5.3.3", - "phpunit/php-text-template": ">=1.1.1@stable" + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" }, "suggest": { "ext-soap": "*" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, "autoload": { "classmap": [ - "PHPUnit/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -2034,7 +2203,7 @@ "mock", "xunit" ], - "time": "2013-01-13 10:24:48" + "time": "2015-10-02 06:51:40" }, { "name": "satooshi/php-coveralls", @@ -2111,6 +2280,238 @@ ], "time": "2014-11-11 15:35:34" }, + { + "name": "sebastian/comparator", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2015-07-26 15:48:44" + }, + { + "name": "sebastian/diff", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", + "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "http://www.github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2015-02-22 15:13:53" + }, + { + "name": "sebastian/environment", + "version": "1.3.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6324c907ce7a52478eeeaede764f48733ef5ae44", + "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2015-08-03 06:14:51" + }, + { + "name": "sebastian/exporter", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "7ae5513327cb536431847bcc0c10edba2701064e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", + "reference": "7ae5513327cb536431847bcc0c10edba2701064e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2015-06-21 07:55:53" + }, { "name": "sebastian/finder-facade", "version": "1.2.0", @@ -2150,6 +2551,57 @@ "homepage": "https://github.com/sebastianbergmann/finder-facade", "time": "2015-06-04 08:11:58" }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2015-10-12 03:26:01" + }, { "name": "sebastian/phpcpd", "version": "2.0.2", @@ -2201,6 +2653,59 @@ "homepage": "https://github.com/sebastianbergmann/phpcpd", "time": "2015-03-26 14:47:38" }, + { + "name": "sebastian/recursion-context", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", + "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2015-06-21 08:04:50" + }, { "name": "sebastian/version", "version": "1.0.6", From 8328c3d7536ab23656db856c651fd861bb38705f Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Thu, 15 Oct 2015 12:30:49 +0300 Subject: [PATCH 08/22] Updated user id & project id fetching Removed pass by reference of the project files. Made the method look for the request fields `userId` & `projectId` instead of the txt files that were user until now. --- .../Controller/DefaultController.php | 30 +++++++------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/Symfony/src/Codebender/BuilderBundle/Controller/DefaultController.php b/Symfony/src/Codebender/BuilderBundle/Controller/DefaultController.php index f310dda..8d4f81d 100644 --- a/Symfony/src/Codebender/BuilderBundle/Controller/DefaultController.php +++ b/Symfony/src/Codebender/BuilderBundle/Controller/DefaultController.php @@ -81,9 +81,9 @@ protected function compile($contents) { $apiHandler = $this->get('codebender_builder.handler'); - $files = $contents["files"]; + $contents = $this->checkForUserIdProjectId($contents); - $this->checkForUserIdProjectId($files); + $files = $contents["files"]; $userLibraries = array(); @@ -199,28 +199,20 @@ protected function returnProvidedAndFetchedLibraries($projectFiles, $userLibrari * Checks if project id and user id txt files exist in the request files. * If not, creates these files with null id * - * @param array $projectFiles + * @param array $requestContents + * @return array */ - protected function checkForUserIdProjectId(&$projectFiles) + protected function checkForUserIdProjectId($requestContents) { - $foundProject = false; - $foundUser = false; - - foreach ($projectFiles as $file) { - if (preg_match('/(?<=user_)[\d]+/', $file['filename'])) { - $foundUser = true; - } - if (preg_match('/(?<=project_)[\d]+/', $file['filename'])) { - $foundProject = true; - } + if (!array_key_exists('userId', $requestContents)) { + $requestContents['userId'] = 'null'; } - if (!$foundUser) { - $projectFiles[] = array('filename' => 'user_null.txt', 'content' => ''); - } - if (!$foundProject) { - $projectFiles[] = array('filename' => 'project_null.txt', 'content' => ''); + if (!array_key_exists('projectId', $requestContents)) { + $requestContents['projectId'] = 'null'; } + + return $requestContents; } } From 0cc74ac975c600ed38636925ac38bf1e651ad5d6 Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Thu, 15 Oct 2015 12:32:45 +0300 Subject: [PATCH 09/22] Updated all test (PHPUnit 4.8 compatibility) --- .../DefaultControllerFunctionalTest.php | 18 +- .../Controller/DefaultControllerUnitTest.php | 265 ++++++++++-------- .../Tests/Handler/DefaultHandlerUnitTest.php | 26 +- 3 files changed, 171 insertions(+), 138 deletions(-) diff --git a/Symfony/src/Codebender/BuilderBundle/Tests/Controller/DefaultControllerFunctionalTest.php b/Symfony/src/Codebender/BuilderBundle/Tests/Controller/DefaultControllerFunctionalTest.php index f202c12..7cbf19b 100644 --- a/Symfony/src/Codebender/BuilderBundle/Tests/Controller/DefaultControllerFunctionalTest.php +++ b/Symfony/src/Codebender/BuilderBundle/Tests/Controller/DefaultControllerFunctionalTest.php @@ -40,9 +40,9 @@ public function testHandleRequestCompile() { ->request( 'POST', "/{$authorizationKey}/{$apiVersion}/", - $parameters = array(), - $files = array(), - $server = array(), + $parameters = [], + $files = [], + $server = [], $content = '{"type":"compiler","data":{"files":[{"filename":"project.ino","content":"void setup(){\n\n}\nvoid loop(){\n\n}\n"}],"format":"binary","version":"105","build":{"mcu":"atmega328p","f_cpu":"16000000L","core":"arduino","variant":"standard"}}}', $changeHistory = true); @@ -61,9 +61,9 @@ public function testHandleRequestLibraryFetching() { ->request( 'POST', "/{$authorizationKey}/{$apiVersion}/", - $parameters = array(), - $files = array(), - $server = array(), + $parameters = [], + $files = [], + $server = [], $content = '{"type":"library","data":{"type":"fetch","library":"Ethernet"}}', $changeHistory = true); @@ -83,9 +83,9 @@ public function testHandleRequestLibraryKeywords() { ->request( 'POST', "/{$authorizationKey}/{$apiVersion}/", - $parameters = array(), - $files = array(), - $server = array(), + $parameters = [], + $files = [], + $server = [], $content = '{"type":"library","data":{"type":"getKeywords","library":"Ethernet"}}', $changeHistory = true); diff --git a/Symfony/src/Codebender/BuilderBundle/Tests/Controller/DefaultControllerUnitTest.php b/Symfony/src/Codebender/BuilderBundle/Tests/Controller/DefaultControllerUnitTest.php index f716af4..2df3d13 100644 --- a/Symfony/src/Codebender/BuilderBundle/Tests/Controller/DefaultControllerUnitTest.php +++ b/Symfony/src/Codebender/BuilderBundle/Tests/Controller/DefaultControllerUnitTest.php @@ -18,7 +18,8 @@ public function testHandleRequestInvalidAuthKey() { $this->setUpController($controller, $container, $request, $apiHandler); - $container->expects($this->once())->method('getParameter')->with('authorizationKey')->will($this->returnValue('anAuthKey')); + $container->expects($this->once())->method('getParameter')->with('authorizationKey') + ->willReturn('anAuthKey'); $actionResponse = $controller->handleRequestAction('invalidAuthKey', 'v1'); @@ -29,8 +30,10 @@ public function testHandleRequestInvalidApiVersion() { $this->setUpController($controller, $container, $request, $apiHandler); - $container->expects($this->at(0))->method('getParameter')->with('authorizationKey')->will($this->returnValue('anAuthKey')); - $container->expects($this->at(1))->method('getParameter')->with('version')->will($this->returnValue('v2')); + $container->expects($this->at(0))->method('getParameter')->with('authorizationKey') + ->willReturn('anAuthKey'); + $container->expects($this->at(1))->method('getParameter')->with('version') + ->willReturn('v2'); $actionResponse = $controller->handleRequestAction('anAuthKey', 'v1'); @@ -41,11 +44,15 @@ public function testHandleRequestEmptyRequest() { $this->setUpController($controller, $container, $request, $apiHandler); - $container->expects($this->at(0))->method('getParameter')->with('authorizationKey')->will($this->returnValue('anAuthKey')); - $container->expects($this->at(1))->method('getParameter')->with('version')->will($this->returnValue('v1')); + $container->expects($this->at(0))->method('getParameter')->with('authorizationKey') + ->willReturn('anAuthKey'); + $container->expects($this->at(1))->method('getParameter')->with('version') + ->willreturn('v1'); - $controller->expects($this->once())->method('getRequest')->will($this->returnValue($request)); - $request->expects($this->once())->method('getContent')->will($this->returnValue('')); + $controller->expects($this->once())->method('getRequest') + ->willReturn($request); + $request->expects($this->once())->method('getContent') + ->willReturn(''); $actionResponse = $controller->handleRequestAction('anAuthKey', 'v1'); @@ -56,11 +63,15 @@ public function testHandleRequestInvalidJsonDecodesToFalse() { $this->setUpController($controller, $container, $request, $apiHandler); - $container->expects($this->at(0))->method('getParameter')->with('authorizationKey')->will($this->returnValue('anAuthKey')); - $container->expects($this->at(1))->method('getParameter')->with('version')->will($this->returnValue('v1')); + $container->expects($this->at(0))->method('getParameter')->with('authorizationKey') + ->willReturn('anAuthKey'); + $container->expects($this->at(1))->method('getParameter')->with('version') + ->willReturn('v1'); - $controller->expects($this->once())->method('getRequest')->will($this->returnValue($request)); - $request->expects($this->once())->method('getContent')->will($this->returnValue("notJson")); + $controller->expects($this->once())->method('getRequest') + ->willReturn($request); + $request->expects($this->once())->method('getContent') + ->willReturn("notJson"); $actionResponse = $controller->handleRequestAction('anAuthKey', 'v1'); @@ -71,11 +82,15 @@ public function testHandleRequestNoDataKeyInRequest() { $this->setUpController($controller, $container, $request, $apiHandler); - $container->expects($this->at(0))->method('getParameter')->with('authorizationKey')->will($this->returnValue('anAuthKey')); - $container->expects($this->at(1))->method('getParameter')->with('version')->will($this->returnValue('v1')); + $container->expects($this->at(0))->method('getParameter')->with('authorizationKey') + ->willReturn('anAuthKey'); + $container->expects($this->at(1))->method('getParameter')->with('version') + ->willReturn('v1'); - $controller->expects($this->once())->method('getRequest')->will($this->returnValue($request)); - $request->expects($this->once())->method('getContent')->will($this->returnValue('{"type":"compiler"}')); + $controller->expects($this->once())->method('getRequest') + ->willReturn($request); + $request->expects($this->once())->method('getContent') + ->willReturn('{"type":"compiler"}'); $actionResponse = $controller->handleRequestAction('anAuthKey', 'v1'); @@ -88,18 +103,23 @@ public function testHandleRequestCompileRequest() { // Override previous controller mock. More class member functions need to get mocked. $controller = $this->getMockBuilder('Codebender\BuilderBundle\Controller\DefaultController') ->disableOriginalConstructor() - ->setMethods(array('getRequest', 'compile', 'getLibraryInfo')) + ->setMethods(['getRequest', 'compile', 'getLibraryInfo']) ->getMock(); $controller->setContainer($container); - $container->expects($this->at(0))->method('getParameter')->with('authorizationKey')->will($this->returnValue('anAuthKey')); - $container->expects($this->at(1))->method('getParameter')->with('version')->will($this->returnValue('v1')); + $container->expects($this->at(0))->method('getParameter')->with('authorizationKey') + ->willReturn('anAuthKey'); + $container->expects($this->at(1))->method('getParameter')->with('version') + ->willReturn('v1'); - $controller->expects($this->once())->method('getRequest')->will($this->returnValue($request)); - $request->expects($this->once())->method('getContent')->will($this->returnValue('{"type":"compiler","data":[]}')); + $controller->expects($this->once())->method('getRequest') + ->willReturn($request); + $request->expects($this->once())->method('getContent') + ->willReturn('{"type":"compiler","data":[]}'); - $controller->expects($this->once())->method('compile')->with(array())->will($this->returnValue('someValue')); + $controller->expects($this->once())->method('compile')->with([]) + ->willReturn('someValue'); $actionResponse = $controller->handleRequestAction('anAuthKey', 'v1'); @@ -112,16 +132,20 @@ public function testHandleRequestLibraryRequest() { // Override previous controller mock. More class member functions need to get mocked. $controller = $this->getMockBuilder('Codebender\BuilderBundle\Controller\DefaultController') ->disableOriginalConstructor() - ->setMethods(array('getRequest', 'compile', 'getLibraryInfo')) + ->setMethods(['getRequest', 'compile', 'getLibraryInfo']) ->getMock(); $controller->setContainer($container); - $container->expects($this->at(0))->method('getParameter')->with('authorizationKey')->will($this->returnValue('anAuthKey')); - $container->expects($this->at(1))->method('getParameter')->with('version')->will($this->returnValue('v1')); + $container->expects($this->at(0))->method('getParameter')->with('authorizationKey') + ->willReturn('anAuthKey'); + $container->expects($this->at(1))->method('getParameter')->with('version') + ->willReturn('v1'); - $controller->expects($this->once())->method('getRequest')->will($this->returnValue($request)); - $request->expects($this->once())->method('getContent')->will($this->returnValue('{"type":"invalidType","data":[]}')); + $controller->expects($this->once())->method('getRequest') + ->willReturn($request); + $request->expects($this->once())->method('getContent') + ->willReturn('{"type":"invalidType","data":[]}'); $actionResponse = $controller->handleRequestAction('anAuthKey', 'v1'); @@ -134,7 +158,7 @@ public function testCompileNonJsonCompilerResponse() { // Override previous controller mock. More class member functions need to get mocked. $controller = $this->getMockBuilder('Codebender\BuilderBundle\Controller\DefaultController') ->disableOriginalConstructor() - ->setMethods(array('get', 'getRequest', 'checkForUserIdProjectId', 'returnProvidedAndFetchedLibraries')) + ->setMethods(['get', 'getRequest', 'checkForUserIdProjectId', 'returnProvidedAndFetchedLibraries']) ->getMock(); $controller->setContainer($container); @@ -144,14 +168,19 @@ public function testCompileNonJsonCompilerResponse() { */ $function = $this->getMethod('compile'); - $controller->expects($this->at(0))->method('get')->with('codebender_builder.handler')->will($this->returnValue($apiHandler)); - $controller->expects($this->at(1))->method('checkForUserIdProjectId')->with(array()); - $controller->expects($this->at(2))->method('returnProvidedAndFetchedLibraries')->with(array())->will($this->returnValue(array('libraries' => array()))); + $controller->expects($this->at(0))->method('get')->with('codebender_builder.handler') + ->willReturn($apiHandler); + $controller->expects($this->at(1))->method('checkForUserIdProjectId')->with(['files' => []]) + ->willReturn(['files' => []]); + $controller->expects($this->at(2))->method('returnProvidedAndFetchedLibraries')->with([]) + ->willReturn(['libraries' => []]); - $container->expects($this->once())->method('getParameter')->with('compiler')->will($this->returnValue('http://compiler/url')); - $apiHandler->expects($this->once())->method('postRawData')->with('http://compiler/url', '{"files":[],"libraries":[]}')->will($this->returnValue('nonJson')); + $container->expects($this->once())->method('getParameter')->with('compiler') + ->willReturn('http://compiler/url'); + $apiHandler->expects($this->once())->method('postRawData') + ->with('http://compiler/url', '{"files":[],"libraries":[]}')->willReturn('nonJson'); - $functionResponse = $function->invoke($controller, array('files' => array())); + $functionResponse = $function->invoke($controller, ['files' => []]); $this->assertContains('Failed to get compiler response', $functionResponse); } @@ -162,7 +191,7 @@ public function testCompileFalseCompilationWithoutStepIncluded() { // Override previous controller mock. More class member functions need to get mocked. $controller = $this->getMockBuilder('Codebender\BuilderBundle\Controller\DefaultController') ->disableOriginalConstructor() - ->setMethods(array('get', 'getRequest', 'checkForUserIdProjectId', 'returnProvidedAndFetchedLibraries')) + ->setMethods(['get', 'getRequest', 'checkForUserIdProjectId', 'returnProvidedAndFetchedLibraries']) ->getMock(); $controller->setContainer($container); @@ -172,18 +201,25 @@ public function testCompileFalseCompilationWithoutStepIncluded() { */ $function = $this->getMethod('compile'); - $controller->expects($this->at(0))->method('get')->with('codebender_builder.handler')->will($this->returnValue($apiHandler)); - $controller->expects($this->at(1))->method('checkForUserIdProjectId')->with(array()); - $controller->expects($this->at(2))->method('returnProvidedAndFetchedLibraries')->with(array())->will($this->returnValue(array('libraries' => array()))); + $controller->expects($this->at(0))->method('get')->with('codebender_builder.handler') + ->willReturn($apiHandler); + $controller->expects($this->at(1))->method('checkForUserIdProjectId')->with(['files' => []]) + ->willReturn(['files' => []]); + $controller->expects($this->at(2))->method('returnProvidedAndFetchedLibraries')->with([]) + ->willReturn(['libraries' => []]); - $container->expects($this->once())->method('getParameter')->with('compiler')->will($this->returnValue('http://compiler/url')); + $container->expects($this->once())->method('getParameter')->with('compiler') + ->willReturn('http://compiler/url'); $apiHandler->expects($this->once())->method('postRawData') ->with('http://compiler/url', '{"files":[],"libraries":[]}') - ->will($this->returnValue('{"success":false,"message":"someError"}')); + ->willReturn('{"success":false,"message":"someError"}'); - $functionResponse = $function->invoke($controller, array('files' => array())); + $functionResponse = $function->invoke($controller, ['files' => []]); - $this->assertEquals('{"success":false,"message":"someError","step":"unknown","additionalCode":[]}', $functionResponse); + $this->assertEquals( + '{"success":false,"message":"someError","step":"unknown","additionalCode":[]}', + $functionResponse + ); } public function testCompileFalseCompilationWithStepIncluded() { @@ -192,7 +228,7 @@ public function testCompileFalseCompilationWithStepIncluded() { // Override previous controller mock. More class member functions need to get mocked. $controller = $this->getMockBuilder('Codebender\BuilderBundle\Controller\DefaultController') ->disableOriginalConstructor() - ->setMethods(array('get', 'getRequest', 'checkForUserIdProjectId', 'returnProvidedAndFetchedLibraries')) + ->setMethods(['get', 'getRequest', 'checkForUserIdProjectId', 'returnProvidedAndFetchedLibraries']) ->getMock(); $controller->setContainer($container); @@ -202,16 +238,20 @@ public function testCompileFalseCompilationWithStepIncluded() { */ $function = $this->getMethod('compile'); - $controller->expects($this->at(0))->method('get')->with('codebender_builder.handler')->will($this->returnValue($apiHandler)); - $controller->expects($this->at(1))->method('checkForUserIdProjectId')->with(array()); - $controller->expects($this->at(2))->method('returnProvidedAndFetchedLibraries')->with(array())->will($this->returnValue(array('libraries' => array()))); + $controller->expects($this->at(0))->method('get')->with('codebender_builder.handler') + ->willReturn($apiHandler); + $controller->expects($this->at(1))->method('checkForUserIdProjectId')->with(['files' => []]) + ->willReturn(['files' => []]); + $controller->expects($this->at(2))->method('returnProvidedAndFetchedLibraries')->with([]) + ->willReturn(['libraries' => []]); - $container->expects($this->once())->method('getParameter')->with('compiler')->will($this->returnValue('http://compiler/url')); + $container->expects($this->once())->method('getParameter')->with('compiler') + ->willReturn('http://compiler/url'); $apiHandler->expects($this->once())->method('postRawData') ->with('http://compiler/url', '{"files":[],"libraries":[]}') - ->will($this->returnValue('{"success":false,"message":"someError","step":5}')); + ->willReturn('{"success":false,"message":"someError","step":5}'); - $functionResponse = $function->invoke($controller, array('files' => array())); + $functionResponse = $function->invoke($controller, ['files' => []]); $this->assertEquals('{"success":false,"message":"someError","step":5,"additionalCode":[]}', $functionResponse); } @@ -225,7 +265,7 @@ public function testGetLibraryInfo() { // Override previous controller mock. More class member functions need to get mocked. $controller = $this->getMockBuilder('Codebender\BuilderBundle\Controller\DefaultController') ->disableOriginalConstructor() - ->setMethods(array('get', 'getRequest')) + ->setMethods(['get', 'getRequest']) ->getMock(); $controller->setContainer($container); @@ -235,11 +275,15 @@ public function testGetLibraryInfo() { */ $function = $this->getMethod('getLibraryInfo'); - $controller->expects($this->once())->method('get')->with('codebender_builder.handler')->will($this->returnValue($apiHandler)); + $controller->expects($this->once())->method('get')->with('codebender_builder.handler') + ->willReturn($apiHandler); - $container->expects($this->once())->method('getParameter')->with('library')->will($this->returnValue('http://library/manager')); + $container->expects($this->once())->method('getParameter')->with('library') + ->willReturn('http://library/manager'); - $apiHandler->expects($this->once())->method('postRawData')->with('http://library/manager', 'library data')->will($this->returnValue('Whatever')); + $apiHandler->expects($this->once())->method('postRawData') + ->with('http://library/manager', 'library data') + ->willReturn('Whatever'); $functionResponse = $function->invoke($controller, 'library data'); @@ -252,7 +296,7 @@ public function testReturnProvidedAndFetchedLibrariesNoProvidedLibrariesNoProjec // Override previous controller mock. More class member functions need to get mocked. $controller = $this->getMockBuilder('Codebender\BuilderBundle\Controller\DefaultController') ->disableOriginalConstructor() - ->setMethods(array('get', 'getRequest')) + ->setMethods(['get', 'getRequest']) ->getMock(); $controller->setContainer($container); @@ -262,11 +306,13 @@ public function testReturnProvidedAndFetchedLibrariesNoProvidedLibrariesNoProjec */ $function = $this->getMethod('returnProvidedAndFetchedLibraries'); - $controller->expects($this->once())->method('get')->with('codebender_builder.handler')->will($this->returnValue($apiHandler)); + $controller->expects($this->once())->method('get')->with('codebender_builder.handler') + ->willReturn($apiHandler); - $apiHandler->expects($this->once())->method('readLibraries')->with(array())->will($this->returnValue(array())); + $apiHandler->expects($this->once())->method('readLibraries')->with([]) + ->willReturn(array()); - $functionResponse = $function->invokeArgs($controller, array(array(), array())); + $functionResponse = $function->invokeArgs($controller, [[], []]); $this->assertArrayHasKey('libraries', $functionResponse); $this->assertEmpty($functionResponse['libraries']); @@ -288,7 +334,7 @@ public function testReturnProvidedAndFetchedLibrariesNoProvidedLibrariesNeedToFe // Override previous controller mock. More class member functions need to get mocked. $controller = $this->getMockBuilder('Codebender\BuilderBundle\Controller\DefaultController') ->disableOriginalConstructor() - ->setMethods(array('get', 'getRequest', 'getLibraryInfo')) + ->setMethods(['get', 'getRequest', 'getLibraryInfo']) ->getMock(); $controller->setContainer($container); @@ -298,18 +344,20 @@ public function testReturnProvidedAndFetchedLibrariesNoProvidedLibrariesNeedToFe */ $function = $this->getMethod('returnProvidedAndFetchedLibraries'); - $controller->expects($this->once())->method('get')->with('codebender_builder.handler')->will($this->returnValue($apiHandler)); + $controller->expects($this->once())->method('get')->with('codebender_builder.handler') + ->willReturn($apiHandler); - $apiHandler->expects($this->once())->method('readLibraries')->with(array())->will($this->returnValue(array('header'))); + $apiHandler->expects($this->once())->method('readLibraries')->with([]) + ->willReturn(['header']); $controller->expects($this->once())->method('getLibraryInfo') ->with('{"type":"fetch","library":"header"}') - ->will($this->returnValue(json_encode(array('success' => true, 'files' => array(array('filename' => 'header.h', 'content' => '')))))); + ->willReturn(json_encode(['success' => true, 'files' => [['filename' => 'header.h', 'content' => '']]])); - $functionResponse = $function->invokeArgs($controller, array(array(), array())); - $this->assertEquals(array('header' => array(array('filename' => 'header.h', 'content' => ''))), $functionResponse['libraries']); - $this->assertEquals(array('header'), $functionResponse['fetchedLibraries']); - $this->assertEquals(array('header.h'), $functionResponse['foundHeaders']); + $functionResponse = $function->invokeArgs($controller, [[], []]); + $this->assertEquals(['header' => [['filename' => 'header.h', 'content' => '']]], $functionResponse['libraries']); + $this->assertEquals(['header'], $functionResponse['fetchedLibraries']); + $this->assertEquals(['header.h'], $functionResponse['foundHeaders']); } public function testReturnProvidedAndFetchedLibrariesNoProvidedRequestedFromLibmanNotFound() { @@ -318,7 +366,7 @@ public function testReturnProvidedAndFetchedLibrariesNoProvidedRequestedFromLibm // Override previous controller mock. More class member functions need to get mocked. $controller = $this->getMockBuilder('Codebender\BuilderBundle\Controller\DefaultController') ->disableOriginalConstructor() - ->setMethods(array('get', 'getRequest', 'getLibraryInfo')) + ->setMethods(['get', 'getRequest', 'getLibraryInfo']) ->getMock(); $controller->setContainer($container); @@ -328,18 +376,20 @@ public function testReturnProvidedAndFetchedLibrariesNoProvidedRequestedFromLibm */ $function = $this->getMethod('returnProvidedAndFetchedLibraries'); - $controller->expects($this->once())->method('get')->with('codebender_builder.handler')->will($this->returnValue($apiHandler)); + $controller->expects($this->once())->method('get')->with('codebender_builder.handler') + ->willReturn($apiHandler); - $apiHandler->expects($this->once())->method('readLibraries')->with(array())->will($this->returnValue(array('header'))); + $apiHandler->expects($this->once())->method('readLibraries')->with([]) + ->willReturn(['header']); $controller->expects($this->once())->method('getLibraryInfo') ->with('{"type":"fetch","library":"header"}') - ->will($this->returnValue(json_encode(array('success' => false)))); + ->willReturn(json_encode(['success' => false])); - $functionResponse = $function->invokeArgs($controller, array(array(), array())); - $this->assertEquals(array(), $functionResponse['libraries']); - $this->assertEquals(array(), $functionResponse['fetchedLibraries']); - $this->assertEquals(array('header.h'), $functionResponse['notFoundHeaders']); + $functionResponse = $function->invokeArgs($controller, [[], []]); + $this->assertEquals([], $functionResponse['libraries']); + $this->assertEquals([], $functionResponse['fetchedLibraries']); + $this->assertEquals(['header.h'], $functionResponse['notFoundHeaders']); } public function testReturnProvidedAndFetchedLibrariesWithProvidedLibrary() { @@ -348,7 +398,7 @@ public function testReturnProvidedAndFetchedLibrariesWithProvidedLibrary() { // Override previous controller mock. More class member functions need to get mocked. $controller = $this->getMockBuilder('Codebender\BuilderBundle\Controller\DefaultController') ->disableOriginalConstructor() - ->setMethods(array('get', 'getRequest', 'getLibraryInfo')) + ->setMethods(['get', 'getRequest', 'getLibraryInfo']) ->getMock(); $controller->setContainer($container); @@ -358,24 +408,25 @@ public function testReturnProvidedAndFetchedLibrariesWithProvidedLibrary() { */ $function = $this->getMethod('returnProvidedAndFetchedLibraries'); - $controller->expects($this->once())->method('get')->with('codebender_builder.handler')->will($this->returnValue($apiHandler)); + $controller->expects($this->once())->method('get')->with('codebender_builder.handler') + ->willReturn($apiHandler); - $apiHandler->expects($this->once())->method('readLibraries')->with(array())->will($this->returnValue(array('header'))); + $apiHandler->expects($this->once())->method('readLibraries')->with([])->willReturn(['header']); $functionResponse = $function->invokeArgs( $controller, - array( - array(), - array('personal_library' => array(array('filename' => 'header.h', 'content' => ''))) - ) + [ + [], + ['personal_library' => [['filename' => 'header.h', 'content' => '']]] + ] ); $controller->expects($this->never())->method('getLibraryInfo'); - $this->assertEquals(array('personal_library' => array(array('filename' => 'header.h', 'content' => ''))), + $this->assertEquals(['personal_library' => [['filename' => 'header.h', 'content' => '']]], $functionResponse['libraries']); - $this->assertEquals(array('personal_library'), $functionResponse['providedLibraries']); - $this->assertEquals(array('header.h'), $functionResponse['foundHeaders']); + $this->assertEquals(['personal_library'], $functionResponse['providedLibraries']); + $this->assertEquals(['header.h'], $functionResponse['foundHeaders']); } public function testcheckUserIdProjectIdHasNone() { @@ -386,18 +437,12 @@ public function testcheckUserIdProjectIdHasNone() { */ $function = $this->getMethod('checkForUserIdProjectId'); - $projectFiles = array(array('filename' => 'project.ino', 'content' =>'')); + $requestContent = ['files' => [['filename' => 'project.ino', 'content' =>'']]]; - /* - * The function accepts a reference of the parameter - * TODO: Find a way to replace the Reflection call-time pass-by-reference (removed in PHP 5.4) - */ - $functionResponse = $function->invoke($controller, &$projectFiles); + $functionResponse = $function->invoke($controller, $requestContent); - $this->assertEquals(3, count($projectFiles)); - foreach ($projectFiles as $file) { - $this->assertTrue(in_array($file['filename'], array('project.ino', 'project_null.txt', 'user_null.txt'))); - } + $this->assertEquals('null', $functionResponse['projectId']); + $this->assertEquals('null', $functionResponse['userId']); } public function testcheckUserIdProjectIdHasOnlyUserId() { @@ -408,18 +453,12 @@ public function testcheckUserIdProjectIdHasOnlyUserId() { */ $function = $this->getMethod('checkForUserIdProjectId'); - $projectFiles = array(array('filename' => 'project.ino', 'content' =>''), array('filename' => 'user_1.txt', 'content' => '')); + $requestContent = ['userId' => 1, 'files' => [['filename' => 'project.ino', 'content' =>'']]]; - /* - * The function accepts a reference of the parameter - * TODO: Find a way to replace the Reflection call-time pass-by-reference (removed in PHP 5.4) - */ - $functionResponse = $function->invoke($controller, &$projectFiles); + $functionResponse = $function->invoke($controller, $requestContent); - $this->assertEquals(3, count($projectFiles)); - foreach ($projectFiles as $file) { - $this->assertTrue(in_array($file['filename'], array('project.ino', 'project_null.txt', 'user_1.txt'))); - } + $this->assertEquals('null', $functionResponse['projectId']); + $this->assertEquals(1, $functionResponse['userId']); } public function testcheckUserIdProjectIdHasOnlyProjectId() { @@ -430,18 +469,12 @@ public function testcheckUserIdProjectIdHasOnlyProjectId() { */ $function = $this->getMethod('checkForUserIdProjectId'); - $projectFiles = array(array('filename' => 'project.ino', 'content' =>''), array('filename' => 'project_1.txt', 'content' => '')); + $projectFiles = ['projectId' => 1, 'files' => [['filename' => 'project.ino', 'content' =>'']]]; - /* - * The function accepts a reference of the parameter - * TODO: Find a way to replace the Reflection call-time pass-by-reference (removed in PHP 5.4) - */ - $functionResponse = $function->invoke($controller, &$projectFiles); + $functionResponse = $function->invoke($controller, $projectFiles); - $this->assertEquals(3, count($projectFiles)); - foreach ($projectFiles as $file) { - $this->assertTrue(in_array($file['filename'], array('project.ino', 'project_1.txt', 'user_null.txt'))); - } + $this->assertEquals(1, $functionResponse['projectId']); + $this->assertEquals('null', $functionResponse['userId']); } protected static function getMethod($name) { @@ -453,22 +486,22 @@ protected static function getMethod($name) { private function setUpController(&$controller, &$container, &$request, &$apiHandler) { $controller = $this->getMockBuilder('Codebender\BuilderBundle\Controller\DefaultController') ->disableOriginalConstructor() - ->setMethods(array('get', 'getRequest')) + ->setMethods(['get', 'getRequest']) ->getMock(); $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface') ->disableOriginalConstructor() - ->setMethods(array('getParameter')) + ->setMethods(['getParameter']) ->getMockForAbstractClass(); $request = $this->getMockBuilder('Symfony\Component\HttpFoundation\Request') ->disableOriginalConstructor() - ->setMethods(array('getContent')) + ->setMethods(['getContent']) ->getMock(); $apiHandler = $this->getMockBuilder('Codebender\BuilderBundle\Handler\DefaultHandler') ->disableOriginalConstructor() - ->setMethods(array('postRawData', 'readLibraries')) + ->setMethods(['postRawData', 'readLibraries']) ->getMock(); $controller->setContainer($container); diff --git a/Symfony/src/Codebender/BuilderBundle/Tests/Handler/DefaultHandlerUnitTest.php b/Symfony/src/Codebender/BuilderBundle/Tests/Handler/DefaultHandlerUnitTest.php index 9c1325c..c16618b 100644 --- a/Symfony/src/Codebender/BuilderBundle/Tests/Handler/DefaultHandlerUnitTest.php +++ b/Symfony/src/Codebender/BuilderBundle/Tests/Handler/DefaultHandlerUnitTest.php @@ -21,51 +21,51 @@ public function testDetectHeadersInFile() { $code = "/*\nThis is a comment\n*/\n#include \n#include \"quotedHeader.h\"\nvoid setup(){\n\n}\n\nvoid loop(){\n\n}\n"; - $this->assertEquals(array('arrows' => array('header'), 'quotes' => array('quotedHeader')), $handler->detectHeadersInFile($code)); + $this->assertEquals(['arrows' => ['header'], 'quotes' => ['quotedHeader']], $handler->detectHeadersInFile($code)); } public function testDetectHeadersInFileEmptyInoProvided() { $handler = new DefaultHandler(); $code = ''; - $this->assertEquals(array('arrows' => array(), 'quotes' => array()), $handler->detectHeadersInFile($code)); + $this->assertEquals(['arrows' => [], 'quotes' => []], $handler->detectHeadersInFile($code)); } public function testReadLibraries() { $handler = $this->getMockBuilder('Codebender\BuilderBundle\Handler\DefaultHandler') - ->setMethods(array('detectHeadersInFile')) + ->setMethods(['detectHeadersInFile']) ->getMock(); - $inoFile = array('filename' => 'project.ino', 'content' => '#include \n#include \n#include \"quotedHeader.h\"\nvoid setup(){\n\n}\n\nvoid loop(){\n\n}\n'); - $headerFile = array('filename' => 'quotedHeader.h', 'content' => '#define PIN 5\n#define PIN2 10'); - $projectFiles = array( + $inoFile = ['filename' => 'project.ino', 'content' => '#include \n#include \n#include \"quotedHeader.h\"\nvoid setup(){\n\n}\n\nvoid loop(){\n\n}\n']; + $headerFile = ['filename' => 'quotedHeader.h', 'content' => '#define PIN 5\n#define PIN2 10']; + $projectFiles = [ $inoFile, $headerFile - ); + ]; $handler ->expects($this->once()) ->method('detectHeadersInFile') ->with($inoFile['content']) - ->will($this->returnValue(array('arrows' => array('header', 'Ethernet'), 'quotes' => array('quotedHeader')))); + ->willReturn(['arrows' => ['header', 'Ethernet'], 'quotes' => ['quotedHeader']]); $this->assertTrue(is_array($handler->readlibraries($projectFiles))); } public function testReadLibrariesNoIno() { $handler = $this->getMockBuilder('Codebender\BuilderBundle\Handler\DefaultHandler') - ->setMethods(array('detectHeadersInFile')) + ->setMethods(['detectHeadersInFile']) ->getMock(); - $headerFile = array('filename' => 'quotedHeader.h', 'content' => '#define PIN 5\n#define PIN2 10'); - $projectFiles = array( + $headerFile = ['filename' => 'quotedHeader.h', 'content' => '#define PIN 5\n#define PIN2 10']; + $projectFiles = [ $headerFile - ); + ]; $handler ->expects($this->never()) ->method('detectHeadersInFile'); - $this->assertEquals($handler->readlibraries($projectFiles), array()); + $this->assertEquals([], $handler->readlibraries($projectFiles)); } } From 4d71b8511fa0f75e2f9efe1ddc581e412a04a76b Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Thu, 15 Oct 2015 12:37:30 +0300 Subject: [PATCH 10/22] PHP 5.5 arrays, added TODO, updated outdated comment --- .../Controller/DefaultController.php | 42 +++++++++++-------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/Symfony/src/Codebender/BuilderBundle/Controller/DefaultController.php b/Symfony/src/Codebender/BuilderBundle/Controller/DefaultController.php index 8d4f81d..969fb51 100644 --- a/Symfony/src/Codebender/BuilderBundle/Controller/DefaultController.php +++ b/Symfony/src/Codebender/BuilderBundle/Controller/DefaultController.php @@ -36,26 +36,26 @@ public function statusAction() public function handleRequestAction($authKey, $version) { if ($authKey !== $this->container->getParameter('authorizationKey')) { - return new Response(json_encode(array("success" => false, "message" => "Invalid authorization key."))); + return new Response(json_encode(["success" => false, "message" => "Invalid authorization key."])); } if ($version !== $this->container->getParameter('version')) { - return new Response(json_encode(array("success" => false, "message" => "Invalid api version."))); + return new Response(json_encode(["success" => false, "message" => "Invalid api version."])); } $request = $this->getRequest()->getContent(); if (empty($request)) { - return new Response(json_encode(array("success" => false, "message" => "Invalid input."))); + return new Response(json_encode(["success" => false, "message" => "Invalid input."])); } $contents = json_decode($request, true); if (json_last_error() !== JSON_ERROR_NONE) { - return new Response(json_encode(array("success" => false, "message" => "Wrong data."))); + return new Response(json_encode(["success" => false, "message" => "Wrong data."])); } if (!array_key_exists("data", $contents)) { - return new Response(json_encode(array("success" => false, "message" => "Insufficient data provided."))); + return new Response(json_encode(["success" => false, "message" => "Insufficient data provided."])); } if ($contents["type"] == "compiler") { @@ -66,7 +66,13 @@ public function handleRequestAction($authKey, $version) return new Response($this->getLibraryInfo(json_encode($contents["data"]))); } - return new Response(json_encode(array("success" => false, "message" => "Invalid request type (can handle only 'compiler' or 'library' requests)"))); + return new Response( + json_encode( + [ + "success" => false, + "message" => "Invalid request type (can handle only 'compiler' or 'library' requests)" + ] + )); } /** @@ -85,7 +91,7 @@ protected function compile($contents) $files = $contents["files"]; - $userLibraries = array(); + $userLibraries = []; if (array_key_exists('libraries', $contents)) { $userLibraries = $contents['libraries']; @@ -102,7 +108,7 @@ protected function compile($contents) $decodedResponse = json_decode($data, true); if (json_last_error() !== JSON_ERROR_NONE) { - return json_encode(array("success" => false, "message"=> "Failed to get compiler response.")); + return json_encode(["success" => false, "message"=> "Failed to get compiler response."]); } if ($decodedResponse["success"] === false && !array_key_exists("step", $decodedResponse)) { @@ -146,15 +152,16 @@ protected function returnProvidedAndFetchedLibraries($projectFiles, $userLibrari $detectedHeaders = $apiHandler->readLibraries($projectFiles); // declare arrays - $notFoundHeaders = array(); - $foundHeaders = array(); - $librariesFromLibman = array(); + $notFoundHeaders = []; + $foundHeaders = []; + $librariesFromLibman = []; $providedLibraries = array_keys($userLibraries); $libraries = $userLibraries; foreach ($detectedHeaders as $header) { $existsInRequest = false; + // TODO We can do this in a better way foreach ($userLibraries as $library) { foreach ($library as $libraryContent) { if ($libraryContent["filename"] == $header.".h") { @@ -167,7 +174,7 @@ protected function returnProvidedAndFetchedLibraries($projectFiles, $userLibrari if ($existsInRequest === true) { continue; } - $requestContent = array("type" => "fetch", "library" => $header); + $requestContent = ["type" => "fetch", "library" => $header]; $data = $this->getLibraryInfo(json_encode($requestContent)); $data = json_decode($data, true); @@ -178,7 +185,7 @@ protected function returnProvidedAndFetchedLibraries($projectFiles, $userLibrari $foundHeaders[] = $header . ".h"; $librariesFromLibman[] = $header; - $filesToBeAdded = array(); + $filesToBeAdded = []; foreach ($data["files"] as $file) { if (in_array(pathinfo($file['filename'], PATHINFO_EXTENSION), array('cpp', 'h', 'c', 'S', 'inc'))) $filesToBeAdded[] = $file; @@ -186,18 +193,19 @@ protected function returnProvidedAndFetchedLibraries($projectFiles, $userLibrari $libraries[$header] = $filesToBeAdded; } - return array( + return [ 'libraries' => $libraries, 'providedLibraries' => $providedLibraries, 'fetchedLibraries' => $librariesFromLibman, 'detectedHeaders'=> $detectedHeaders, 'foundHeaders' => $foundHeaders, - 'notFoundHeaders' => $notFoundHeaders); + 'notFoundHeaders' => $notFoundHeaders + ]; } /** - * Checks if project id and user id txt files exist in the request files. - * If not, creates these files with null id + * Checks if project id and user id exist in the request. + * If not, adds the fields with null id * * @param array $requestContents * @return array From ed61291f249e065caaf2f472b91a5b2ed1cdaf6a Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Thu, 15 Oct 2015 12:38:32 +0300 Subject: [PATCH 11/22] PHP 5.5 arrays in handler code --- .../src/Codebender/BuilderBundle/Handler/DefaultHandler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Symfony/src/Codebender/BuilderBundle/Handler/DefaultHandler.php b/Symfony/src/Codebender/BuilderBundle/Handler/DefaultHandler.php index c7cf11c..f0b1971 100644 --- a/Symfony/src/Codebender/BuilderBundle/Handler/DefaultHandler.php +++ b/Symfony/src/Codebender/BuilderBundle/Handler/DefaultHandler.php @@ -53,7 +53,7 @@ function detectHeadersInFile($code) { $arrowsRegex = "/^\s*#\s*include\s*<\s*([a-zA-Z0-9_+]*)\.h\s*>/"; $quotesRegex = "/^\s*#\s*include\s*\"\s*([a-zA-Z0-9_+]*)\.h\s*\"/"; - $headers = array("arrows" => array(), "quotes" => array()); + $headers = ["arrows" => [], "quotes" => []]; foreach (explode("\n", $code) as $line) { if (preg_match($arrowsRegex, $line, $matches)) @@ -78,7 +78,7 @@ function detectHeadersInFile($code) { */ function readLibraries($sketchFiles) { // Scan files for headers and locate the corresponding include paths. - $headers = array("arrows" => array(), "quotes" => array()); + $headers = ["arrows" => [], "quotes" => []]; foreach ($sketchFiles as $file) { From 7c48adaf6536a764e761c1258957d388f41c30a3 Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Thu, 15 Oct 2015 14:58:12 +0300 Subject: [PATCH 12/22] Add PHP XDebug ( needed for coverage generation) --- scripts/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index 433f810..19078e2 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -14,7 +14,7 @@ if [[ "$OSTYPE" == "linux-gnu" ]]; then sudo apt-get install -y php5-intl fi # Install dependencies - sudo apt-get install -y apache2 libapache2-mod-php5 php-pear php5-curl php5-sqlite php5-mysql acl curl git + sudo apt-get install -y apache2 libapache2-mod-php5 php-pear php5-xdebug php5-curl php5-sqlite php5-mysql acl curl git # Enable Apache configs sudo a2enmod rewrite sudo a2enmod alias From 1062d777a61b66db589845a8fb1a2c46aeb6fe56 Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Thu, 22 Oct 2015 13:54:18 +0300 Subject: [PATCH 13/22] Removed unused symlink --- scripts/apache_install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/apache_install.sh b/scripts/apache_install.sh index 81040b3..8c5e683 100644 --- a/scripts/apache_install.sh +++ b/scripts/apache_install.sh @@ -4,8 +4,7 @@ set -e PACKAGENAME=builder -sudo ln -s /opt/codebender/$PACKAGENAME/Symfony/web /var/www/$PACKAGENAME sudo cp /opt/codebender/$PACKAGENAME/apache-config /etc/apache2/sites-available/codebender-$PACKAGENAME cd /etc/apache2/sites-enabled sudo ln -s ../sites-available/codebender-$PACKAGENAME 00-codebender.conf -sudo service apache2 restart \ No newline at end of file +sudo service apache2 restart From fdf6d21d8487edda3061a55213effcd8e9afe9dc Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Fri, 23 Oct 2015 15:59:40 +0300 Subject: [PATCH 14/22] Removed OS X related if-else's --- scripts/install.sh | 60 +++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 35 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 433f810..3ea0f2b 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -4,26 +4,25 @@ set -e PACKAGENAME=builder -if [[ "$OSTYPE" == "linux-gnu" ]]; then - echo "Configuring environment for Linux" - # Make sure we have up-to-date stuff - sudo apt-get update - if [[ ! $TRAVIS ]]; then - # Ubuntu Server (on AWS?) lacks UTF-8 for some reason. Give it that - sudo locale-gen en_US.UTF-8 - sudo apt-get install -y php5-intl - fi - # Install dependencies - sudo apt-get install -y apache2 libapache2-mod-php5 php-pear php5-curl php5-sqlite php5-mysql acl curl git - # Enable Apache configs - sudo a2enmod rewrite - sudo a2enmod alias - # Restart Apache - sudo service apache2 restart -elif [[ "$OSTYPE" == "darwin"* ]]; then - # is there something comparable to this on os x? perhaps Homebrew - echo "Configuring environment for OS X (to be added..)" +if [[ "$OSTYPE" != "linux-gnu" ]]; then + echo "Only Linux environment is supported" fi +echo "Configuring environment for Linux" +# Make sure we have up-to-date stuff +sudo apt-get update +if [[ ! $TRAVIS ]]; then + # Ubuntu Server (on AWS?) lacks UTF-8 for some reason. Give it that + sudo locale-gen en_US.UTF-8 + sudo apt-get install -y php5-intl +fi +# Install dependencies +sudo apt-get install -y apache2 libapache2-mod-php5 php-pear php5-curl php5-sqlite php5-mysql acl curl git +# Enable Apache configs +sudo a2enmod rewrite +sudo a2enmod alias +# Restart Apache +sudo service apache2 restart + if [[ ! $TRAVIS ]]; then @@ -47,23 +46,14 @@ cd /opt/codebender/$PACKAGENAME rm -rf Symfony/app/cache/* rm -rf Symfony/app/logs/* -if [[ "$OSTYPE" == "linux-gnu" ]]; then - - if [[ ! $TRAVIS ]]; then - # Need to create cache and logs directories, as they do not pre-exist in new deployments - mkdir -p `pwd`/Symfony/app/cache/ - mkdir -p `pwd`/Symfony/app/logs/ - - # Set access control for both apache and current user on cache and logs directories - sudo setfacl -R -m u:www-data:rwX -m u:`whoami`:rwX `pwd`/Symfony/app/cache `pwd`/Symfony/app/logs - sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx `pwd`/Symfony/app/cache `pwd`/Symfony/app/logs - fi - -elif [[ "$OSTYPE" == "darwin"* ]]; then +if [[ ! $TRAVIS ]]; then + # Need to create cache and logs directories, as they do not pre-exist in new deployments + mkdir -p `pwd`/Symfony/app/cache/ + mkdir -p `pwd`/Symfony/app/logs/ - HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` - sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" Symfony/app/cache Symfony/app/logs - sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" Symfony/app/cache Symfony/app/logs + # Set access control for both apache and current user on cache and logs directories + sudo setfacl -R -m u:www-data:rwX -m u:`whoami`:rwX `pwd`/Symfony/app/cache `pwd`/Symfony/app/logs + sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx `pwd`/Symfony/app/cache `pwd`/Symfony/app/logs fi cd Symfony From ab4e2b269949b299985f5800f00aa0499a3dfec1 Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Fri, 23 Oct 2015 16:06:18 +0300 Subject: [PATCH 15/22] Updated the method that adds user- and project- ids to the request and renamed it --- .../Controller/DefaultController.php | 15 ++++----------- .../Controller/DefaultControllerUnitTest.php | 18 +++++++++--------- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/Symfony/src/Codebender/BuilderBundle/Controller/DefaultController.php b/Symfony/src/Codebender/BuilderBundle/Controller/DefaultController.php index 969fb51..1bd8a1c 100644 --- a/Symfony/src/Codebender/BuilderBundle/Controller/DefaultController.php +++ b/Symfony/src/Codebender/BuilderBundle/Controller/DefaultController.php @@ -87,7 +87,7 @@ protected function compile($contents) { $apiHandler = $this->get('codebender_builder.handler'); - $contents = $this->checkForUserIdProjectId($contents); + $contents = $this->addUserIdProjectIdIfNotInRequest($contents); $files = $contents["files"]; @@ -210,17 +210,10 @@ protected function returnProvidedAndFetchedLibraries($projectFiles, $userLibrari * @param array $requestContents * @return array */ - protected function checkForUserIdProjectId($requestContents) + protected function addUserIdProjectIdIfNotInRequest($requestContents) { - if (!array_key_exists('userId', $requestContents)) { - $requestContents['userId'] = 'null'; - } - - if (!array_key_exists('projectId', $requestContents)) { - $requestContents['projectId'] = 'null'; - } - - return $requestContents; + $nullDefaults = ['userId' => 'null', 'projectId' => 'null']; + return array_merge($nullDefaults, (array)$requestContents); } } diff --git a/Symfony/src/Codebender/BuilderBundle/Tests/Controller/DefaultControllerUnitTest.php b/Symfony/src/Codebender/BuilderBundle/Tests/Controller/DefaultControllerUnitTest.php index 2df3d13..fd418ea 100644 --- a/Symfony/src/Codebender/BuilderBundle/Tests/Controller/DefaultControllerUnitTest.php +++ b/Symfony/src/Codebender/BuilderBundle/Tests/Controller/DefaultControllerUnitTest.php @@ -158,7 +158,7 @@ public function testCompileNonJsonCompilerResponse() { // Override previous controller mock. More class member functions need to get mocked. $controller = $this->getMockBuilder('Codebender\BuilderBundle\Controller\DefaultController') ->disableOriginalConstructor() - ->setMethods(['get', 'getRequest', 'checkForUserIdProjectId', 'returnProvidedAndFetchedLibraries']) + ->setMethods(['get', 'getRequest', 'addUserIdProjectIdIfNotInRequest', 'returnProvidedAndFetchedLibraries']) ->getMock(); $controller->setContainer($container); @@ -170,7 +170,7 @@ public function testCompileNonJsonCompilerResponse() { $controller->expects($this->at(0))->method('get')->with('codebender_builder.handler') ->willReturn($apiHandler); - $controller->expects($this->at(1))->method('checkForUserIdProjectId')->with(['files' => []]) + $controller->expects($this->at(1))->method('addUserIdProjectIdIfNotInRequest')->with(['files' => []]) ->willReturn(['files' => []]); $controller->expects($this->at(2))->method('returnProvidedAndFetchedLibraries')->with([]) ->willReturn(['libraries' => []]); @@ -191,7 +191,7 @@ public function testCompileFalseCompilationWithoutStepIncluded() { // Override previous controller mock. More class member functions need to get mocked. $controller = $this->getMockBuilder('Codebender\BuilderBundle\Controller\DefaultController') ->disableOriginalConstructor() - ->setMethods(['get', 'getRequest', 'checkForUserIdProjectId', 'returnProvidedAndFetchedLibraries']) + ->setMethods(['get', 'getRequest', 'addUserIdProjectIdIfNotInRequest', 'returnProvidedAndFetchedLibraries']) ->getMock(); $controller->setContainer($container); @@ -203,7 +203,7 @@ public function testCompileFalseCompilationWithoutStepIncluded() { $controller->expects($this->at(0))->method('get')->with('codebender_builder.handler') ->willReturn($apiHandler); - $controller->expects($this->at(1))->method('checkForUserIdProjectId')->with(['files' => []]) + $controller->expects($this->at(1))->method('addUserIdProjectIdIfNotInRequest')->with(['files' => []]) ->willReturn(['files' => []]); $controller->expects($this->at(2))->method('returnProvidedAndFetchedLibraries')->with([]) ->willReturn(['libraries' => []]); @@ -228,7 +228,7 @@ public function testCompileFalseCompilationWithStepIncluded() { // Override previous controller mock. More class member functions need to get mocked. $controller = $this->getMockBuilder('Codebender\BuilderBundle\Controller\DefaultController') ->disableOriginalConstructor() - ->setMethods(['get', 'getRequest', 'checkForUserIdProjectId', 'returnProvidedAndFetchedLibraries']) + ->setMethods(['get', 'getRequest', 'addUserIdProjectIdIfNotInRequest', 'returnProvidedAndFetchedLibraries']) ->getMock(); $controller->setContainer($container); @@ -240,7 +240,7 @@ public function testCompileFalseCompilationWithStepIncluded() { $controller->expects($this->at(0))->method('get')->with('codebender_builder.handler') ->willReturn($apiHandler); - $controller->expects($this->at(1))->method('checkForUserIdProjectId')->with(['files' => []]) + $controller->expects($this->at(1))->method('addUserIdProjectIdIfNotInRequest')->with(['files' => []]) ->willReturn(['files' => []]); $controller->expects($this->at(2))->method('returnProvidedAndFetchedLibraries')->with([]) ->willReturn(['libraries' => []]); @@ -435,7 +435,7 @@ public function testcheckUserIdProjectIdHasNone() { /* * Use ReflectionMethod class to make compile protected function accessible from current context */ - $function = $this->getMethod('checkForUserIdProjectId'); + $function = $this->getMethod('addUserIdProjectIdIfNotInRequest'); $requestContent = ['files' => [['filename' => 'project.ino', 'content' =>'']]]; @@ -451,7 +451,7 @@ public function testcheckUserIdProjectIdHasOnlyUserId() { /* * Use ReflectionMethod class to make compile protected function accessible from current context */ - $function = $this->getMethod('checkForUserIdProjectId'); + $function = $this->getMethod('addUserIdProjectIdIfNotInRequest'); $requestContent = ['userId' => 1, 'files' => [['filename' => 'project.ino', 'content' =>'']]]; @@ -467,7 +467,7 @@ public function testcheckUserIdProjectIdHasOnlyProjectId() { /* * Use ReflectionMethod class to make compile protected function accessible from current context */ - $function = $this->getMethod('checkForUserIdProjectId'); + $function = $this->getMethod('addUserIdProjectIdIfNotInRequest'); $projectFiles = ['projectId' => 1, 'files' => [['filename' => 'project.ino', 'content' =>'']]]; From 02246b321557d56754a5756dd36dc3414bc55c5b Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Fri, 23 Oct 2015 16:08:32 +0300 Subject: [PATCH 16/22] Renamed apache configuration file --- apache-config => apache-config-2.4 | 0 scripts/apache_install.sh | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename apache-config => apache-config-2.4 (100%) diff --git a/apache-config b/apache-config-2.4 similarity index 100% rename from apache-config rename to apache-config-2.4 diff --git a/scripts/apache_install.sh b/scripts/apache_install.sh index 81040b3..80f1448 100644 --- a/scripts/apache_install.sh +++ b/scripts/apache_install.sh @@ -5,7 +5,7 @@ set -e PACKAGENAME=builder sudo ln -s /opt/codebender/$PACKAGENAME/Symfony/web /var/www/$PACKAGENAME -sudo cp /opt/codebender/$PACKAGENAME/apache-config /etc/apache2/sites-available/codebender-$PACKAGENAME +sudo cp /opt/codebender/$PACKAGENAME/apache-config-2.4 /etc/apache2/sites-available/codebender-$PACKAGENAME cd /etc/apache2/sites-enabled sudo ln -s ../sites-available/codebender-$PACKAGENAME 00-codebender.conf sudo service apache2 restart \ No newline at end of file From 34e641a8532637d6453f55863c8ad19add648b0e Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Fri, 23 Oct 2015 16:15:54 +0300 Subject: [PATCH 17/22] Added separate installation/configuration scripts for Travis (still PHP 5.5.9) --- .travis.yml | 20 ++++---------- apache-config-2.2 | 9 ++++++ scripts/travis_apache_install.sh | 11 ++++++++ scripts/travis_install.sh | 47 ++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 14 deletions(-) create mode 100644 apache-config-2.2 create mode 100644 scripts/travis_apache_install.sh create mode 100644 scripts/travis_install.sh diff --git a/.travis.yml b/.travis.yml index 2810d41..2936568 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,6 @@ language: php php: -# - 5.5 -# - 5.4 - - 5.3 - -#before_install: -# - sudo apt-get update + - 5.5.9 env: global: @@ -15,14 +10,14 @@ env: - secure: "XRsqGDqdu5uhdj2lF4SZ6qv6Y0PdcRPcvE13XvVGnIYRZaITelP3eJNSvLPO+Q5k4mBmKCz8t+ws/OVRRwSAXYaKe0Z8ZXgEcNyo1nEwGekC35mTuG1FFfB/pbuBp5/OWjw6bgz2tEHhKuFIbHytpT9zJQYy+D07rzOYeUsZjOY=" before_script: - - sudo chmod +x scripts/install.sh - - scripts/install.sh + - sudo chmod +x scripts/travis_install.sh + - scripts/travis_install.sh - cd /opt/codebender/builder/Symfony - sudo chmod -R 777 app/cache app/logs - - echo 'error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini + - echo 'error_reporting = E_ALL' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - cd /opt/codebender/builder - - sudo chmod +x scripts/apache_install.sh - - scripts/apache_install.sh + - sudo chmod +x scripts/travis_apache_install.sh + - scripts/travis_apache_install.sh - cd /opt/codebender/builder/Symfony script: @@ -37,6 +32,3 @@ after_script: notifications: irc: "chat.freenode.net#codebender.cc" -# email: -# recipients: -# - girder@codebender.cc diff --git a/apache-config-2.2 b/apache-config-2.2 new file mode 100644 index 0000000..60dee98 --- /dev/null +++ b/apache-config-2.2 @@ -0,0 +1,9 @@ + + DocumentRoot /var/www + + Options -Indexes FollowSymLinks MultiViews + AllowOverride All + Order allow,deny + Allow from all + + diff --git a/scripts/travis_apache_install.sh b/scripts/travis_apache_install.sh new file mode 100644 index 0000000..08635eb --- /dev/null +++ b/scripts/travis_apache_install.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -x +set -e + +PACKAGENAME=builder + +sudo ln -s /opt/codebender/$PACKAGENAME/Symfony/web /var/www/$PACKAGENAME +sudo cp /opt/codebender/$PACKAGENAME/apache-config-2.2 /etc/apache2/sites-available/codebender-$PACKAGENAME +cd /etc/apache2/sites-enabled +sudo ln -s ../sites-available/codebender-$PACKAGENAME 00-codebender.conf +sudo service apache2 restart diff --git a/scripts/travis_install.sh b/scripts/travis_install.sh new file mode 100644 index 0000000..852f039 --- /dev/null +++ b/scripts/travis_install.sh @@ -0,0 +1,47 @@ +#!/bin/bash +set -x +set -e + +PACKAGENAME=builder + +echo "Configuring environment for Linux (Ubuntu 12.04)" + +# Make sure we have up-to-date stuff +sudo apt-get update + +# Install dependencies +sudo apt-get install -y apache2 libapache2-mod-php5 php-pear php5-curl php5-sqlite php5-mysql acl curl git +# Enable Apache configs +sudo a2enmod rewrite +sudo a2enmod alias +# Restart Apache +sudo service apache2 restart + +HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` + +sudo mkdir -p /opt/codebender +sudo cp -r . /opt/codebender/$PACKAGENAME +sudo chown -R `whoami`:$HTTPDUSER /opt/codebender/$PACKAGENAME +cd /opt/codebender/$PACKAGENAME + +#Set permissions for app/cache and app/logs + +rm -rf Symfony/app/cache/* +rm -rf Symfony/app/logs/* + +# Need to create cache and logs directories, as they do not pre-exist in new deployments +mkdir -p `pwd`/Symfony/app/cache/ +mkdir -p `pwd`/Symfony/app/logs/ + +cd Symfony + +set +x +cat app/config/parameters.yml.dist | grep -iv "compiler:" | grep -iv "library:" > app/config/parameters.yml +echo " compiler: '$COMPILER_URL'" >> app/config/parameters.yml + +echo " library: '$LIBRARY_URL'" >> app/config/parameters.yml +set -x + + +curl -s http://getcomposer.org/installer | php +php composer.phar install From 856e78bb1c2aacd138426eaf94d3118b0a2ae1cf Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Fri, 23 Oct 2015 16:20:12 +0300 Subject: [PATCH 18/22] Updated scripts' execution permissions --- scripts/apache_install.sh | 0 scripts/install.sh | 0 scripts/travis_apache_install.sh | 0 scripts/travis_install.sh | 0 4 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/apache_install.sh mode change 100644 => 100755 scripts/install.sh mode change 100644 => 100755 scripts/travis_apache_install.sh mode change 100644 => 100755 scripts/travis_install.sh diff --git a/scripts/apache_install.sh b/scripts/apache_install.sh old mode 100644 new mode 100755 diff --git a/scripts/install.sh b/scripts/install.sh old mode 100644 new mode 100755 diff --git a/scripts/travis_apache_install.sh b/scripts/travis_apache_install.sh old mode 100644 new mode 100755 diff --git a/scripts/travis_install.sh b/scripts/travis_install.sh old mode 100644 new mode 100755 From c8327e9203a87cece4957157dcca11a60f285995 Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Fri, 23 Oct 2015 16:36:38 +0300 Subject: [PATCH 19/22] Updated a unit test (coverage increase) --- .../Tests/Controller/DefaultControllerUnitTest.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Symfony/src/Codebender/BuilderBundle/Tests/Controller/DefaultControllerUnitTest.php b/Symfony/src/Codebender/BuilderBundle/Tests/Controller/DefaultControllerUnitTest.php index fd418ea..32e2d31 100644 --- a/Symfony/src/Codebender/BuilderBundle/Tests/Controller/DefaultControllerUnitTest.php +++ b/Symfony/src/Codebender/BuilderBundle/Tests/Controller/DefaultControllerUnitTest.php @@ -240,9 +240,10 @@ public function testCompileFalseCompilationWithStepIncluded() { $controller->expects($this->at(0))->method('get')->with('codebender_builder.handler') ->willReturn($apiHandler); - $controller->expects($this->at(1))->method('addUserIdProjectIdIfNotInRequest')->with(['files' => []]) - ->willReturn(['files' => []]); - $controller->expects($this->at(2))->method('returnProvidedAndFetchedLibraries')->with([]) + $controller->expects($this->at(1))->method('addUserIdProjectIdIfNotInRequest') + ->with(['files' => [], 'libraries' => []]) + ->willReturn(['files' => [], 'libraries' => []]); + $controller->expects($this->at(2))->method('returnProvidedAndFetchedLibraries')->with([], []) ->willReturn(['libraries' => []]); $container->expects($this->once())->method('getParameter')->with('compiler') @@ -251,7 +252,7 @@ public function testCompileFalseCompilationWithStepIncluded() { ->with('http://compiler/url', '{"files":[],"libraries":[]}') ->willReturn('{"success":false,"message":"someError","step":5}'); - $functionResponse = $function->invoke($controller, ['files' => []]); + $functionResponse = $function->invoke($controller, ['files' => [], 'libraries' => []]); $this->assertEquals('{"success":false,"message":"someError","step":5,"additionalCode":[]}', $functionResponse); } From 9d44773dc42675c613394650d1248ceaeb35d8b5 Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Sat, 24 Oct 2015 19:22:36 +0300 Subject: [PATCH 20/22] Removed diff markers --- scripts/apache_install.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/apache_install.sh b/scripts/apache_install.sh index fa2f065..4d68ce8 100755 --- a/scripts/apache_install.sh +++ b/scripts/apache_install.sh @@ -4,12 +4,8 @@ set -e PACKAGENAME=builder -<<<<<<< HEAD sudo ln -s /opt/codebender/$PACKAGENAME/Symfony/web /var/www/$PACKAGENAME sudo cp /opt/codebender/$PACKAGENAME/apache-config-2.4 /etc/apache2/sites-available/codebender-$PACKAGENAME -======= -sudo cp /opt/codebender/$PACKAGENAME/apache-config /etc/apache2/sites-available/codebender-$PACKAGENAME ->>>>>>> 1062d777a61b66db589845a8fb1a2c46aeb6fe56 cd /etc/apache2/sites-enabled sudo ln -s ../sites-available/codebender-$PACKAGENAME 00-codebender.conf sudo service apache2 restart From 6f0b3a60d4b39837d759e06f0c251b43413d4f2c Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Fri, 20 Nov 2015 16:04:35 +0200 Subject: [PATCH 21/22] Updated library manager parameter in travis install script --- scripts/travis_install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/travis_install.sh b/scripts/travis_install.sh index 852f039..b735aff 100755 --- a/scripts/travis_install.sh +++ b/scripts/travis_install.sh @@ -36,10 +36,10 @@ mkdir -p `pwd`/Symfony/app/logs/ cd Symfony set +x -cat app/config/parameters.yml.dist | grep -iv "compiler:" | grep -iv "library:" > app/config/parameters.yml +cat app/config/parameters.yml.dist | grep -iv "compiler:" | grep -iv "library_manager:" > app/config/parameters.yml echo " compiler: '$COMPILER_URL'" >> app/config/parameters.yml -echo " library: '$LIBRARY_URL'" >> app/config/parameters.yml +echo " library_manager: '$LIBRARY_URL'" >> app/config/parameters.yml set -x From 82e703e66e58453466528a31ad1f0d343136ec4a Mon Sep 17 00:00:00 2001 From: Fotis Papadopoulos Date: Fri, 20 Nov 2015 16:16:25 +0200 Subject: [PATCH 22/22] Updated compiler secure parameter for Travis CI --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2936568..ebfd784 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ env: # eratosthenes library management system url (encrypted) - secure: "ZYn4o229W7hq1uzj/Tii9h/a3iJlr9Li4TBaTNFXm6JY2H49lA57L1DIFUaTleTUx2Ibs2+kUrV3NFQ9Mo/ThO67gV5Q1XEMjxgFzAKt4AuWJ5TNbHxs3GBTjYc+129QCKSd0WdzrRDqEC2nZ9GjI+j7lS39DrjAMGg4wEp9b0U=" # codebender compiler url (encrypted) - - secure: "XRsqGDqdu5uhdj2lF4SZ6qv6Y0PdcRPcvE13XvVGnIYRZaITelP3eJNSvLPO+Q5k4mBmKCz8t+ws/OVRRwSAXYaKe0Z8ZXgEcNyo1nEwGekC35mTuG1FFfB/pbuBp5/OWjw6bgz2tEHhKuFIbHytpT9zJQYy+D07rzOYeUsZjOY=" + - secure: "hzL7akuLe+HCsi6G7Z1UliNR8ekzGlWv1cS/iweeXnxjISYU5ALrvpeOHNcfiC/xTZJsJXq+KYwZpVa/Ps7AVwfLgnUkQGD8OA7AmXbqgIv/xao24u4NNd+xAEB9LSr/eWexQhRJniE+JHgZ53yrAefJBIwmeD0YhvU1IdrzMdE=" before_script: - sudo chmod +x scripts/travis_install.sh