diff --git a/.gitignore b/.gitignore index ae4975b08..738240c3f 100755 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,5 @@ coverage .project .settings/ local/cache/* -composer.lock web/assets/* web/.htaccess diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..a68ad96a4 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,13 @@ +language: php + +php: + - "5.4" + - "5.5" + +env: + - DB_USER=root + +before_script: + - composer install --prefer-dist + - sh -c "mysql -u$DB_USER -e 'SET FOREIGN_KEY_CHECKS = 0; DROP DATABASE IF EXISTS thelia;SET FOREIGN_KEY_CHECKS = 1;'; fi" + - php Thelia thelia:install --db_host=localhost --db_username=$DB_USER --db_name=thelia diff --git a/composer.lock b/composer.lock new file mode 100644 index 000000000..34d7ed17e --- /dev/null +++ b/composer.lock @@ -0,0 +1,1691 @@ +{ + "_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" + ], + "hash": "b685fb592402c71a2fffea42e58fd3eb", + "packages": [ + { + "name": "ezyang/htmlpurifier", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/ezyang/htmlpurifier.git", + "reference": "v4.5.0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/v4.5.0", + "reference": "v4.5.0", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "HTMLPurifier": "library/" + }, + "files": [ + "library/HTMLPurifier.composer.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL" + ], + "authors": [ + { + "name": "Edward Z. Yang", + "email": "admin@htmlpurifier.org", + "homepage": "http://ezyang.com" + } + ], + "description": "Standards compliant HTML filter written in PHP", + "homepage": "http://htmlpurifier.org/", + "keywords": [ + "html" + ], + "time": "2013-02-18 00:04:08" + }, + { + "name": "ircmaxell/password-compat", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/ircmaxell/password_compat.git", + "reference": "5d44eec3b571b4a6daae45794b0a31fbbf63c74c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5d44eec3b571b4a6daae45794b0a31fbbf63c74c", + "reference": "5d44eec3b571b4a6daae45794b0a31fbbf63c74c", + "shasum": "" + }, + "type": "library", + "autoload": { + "files": [ + "lib/password.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anthony Ferrara", + "email": "ircmaxell@php.net", + "homepage": "http://blog.ircmaxell.com" + } + ], + "description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash", + "homepage": "https://github.com/ircmaxell/password_compat", + "keywords": [ + "hashing", + "password" + ], + "time": "2013-06-24 12:01:11" + }, + { + "name": "kriswallsmith/assetic", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/kriswallsmith/assetic.git", + "reference": "82e8fc20a3b043b378a7efbda9e3d406d420f00e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kriswallsmith/assetic/zipball/82e8fc20a3b043b378a7efbda9e3d406d420f00e", + "reference": "82e8fc20a3b043b378a7efbda9e3d406d420f00e", + "shasum": "" + }, + "require": { + "php": ">=5.3.1", + "symfony/process": ">=2.1,<3.0" + }, + "require-dev": { + "cssmin/cssmin": "*", + "joliclic/javascript-packer": "*", + "kamicane/packager": "*", + "leafo/lessphp": "*", + "leafo/scssphp": "*", + "leafo/scssphp-compass": "*", + "mrclay/minify": "*", + "phpunit/phpunit": ">=3.7,<4.0", + "ptachoire/cssembed": "*", + "twig/twig": ">=1.6,<2.0" + }, + "suggest": { + "leafo/lessphp": "Assetic provides the integration with the lessphp LESS compiler", + "leafo/scssphp": "Assetic provides the integration with the scssphp SCSS compiler", + "leafo/scssphp-compass": "Assetic provides the integration with the SCSS compass plugin", + "ptachoire/cssembed": "Assetic provides the integration with phpcssembed to embed data uris", + "twig/twig": "Assetic provides the integration with the Twig templating engine" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-0": { + "Assetic": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kris Wallsmith", + "email": "kris.wallsmith@gmail.com", + "homepage": "http://kriswallsmith.net/" + } + ], + "description": "Asset Management for PHP", + "homepage": "https://github.com/kriswallsmith/assetic", + "keywords": [ + "assets", + "compression", + "minification" + ], + "time": "2013-06-13 16:47:03" + }, + { + "name": "leafo/lessphp", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/leafo/lessphp.git", + "reference": "ff86f2941c3f3d67d56acad2f8902ca57c73b359" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/leafo/lessphp/zipball/ff86f2941c3f3d67d56acad2f8902ca57c73b359", + "reference": "ff86f2941c3f3d67d56acad2f8902ca57c73b359", + "shasum": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.3-dev" + } + }, + "autoload": { + "classmap": [ + "lessc.inc.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT", + "GPL-3.0" + ], + "authors": [ + { + "name": "Leaf Corcoran", + "email": "leafot@gmail.com", + "homepage": "http://leafo.net" + } + ], + "description": "lessphp is a compiler for LESS written in PHP.", + "homepage": "http://leafo.net/lessphp/", + "time": "2013-05-22 17:52:29" + }, + { + "name": "propel/propel", + "version": "2.0.0-alpha1", + "source": { + "type": "git", + "url": "https://github.com/propelorm/Propel2.git", + "reference": "2.0.0-alpha1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/propelorm/Propel2/zipball/2.0.0-alpha1", + "reference": "2.0.0-alpha1", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "psr/log": ">=1.0,<2.0", + "symfony/console": ">=2.2,<3.0", + "symfony/filesystem": ">=2.2,<3.0", + "symfony/finder": ">=2.2,<3.0", + "symfony/validator": ">=2.2,<3.0", + "symfony/yaml": ">=2.2,<3.0" + }, + "require-dev": { + "behat/behat": ">=2.4,<3.0", + "monolog/monolog": ">=1.3,<2.0", + "phpunit/phpunit": "3.7.*" + }, + "suggest": { + "monolog/monolog": "The recommended logging library to use with Propel." + }, + "bin": [ + "bin/propel" + ], + "type": "library", + "autoload": { + "psr-0": { + "Propel": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "William Durand", + "email": "william.durand1@gmail.com", + "homepage": "http://www.willdurand.fr" + } + ], + "description": "Propel2 is an open-source Object-Relational Mapping (ORM) for PHP 5.4", + "homepage": "http://www.propelorm.org/", + "keywords": [ + "Active Record", + "orm", + "persistence" + ], + "time": "2013-06-05 06:46:14" + }, + { + "name": "psr/log", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log", + "reference": "1.0.0" + }, + "dist": { + "type": "zip", + "url": "https://github.com/php-fig/log/archive/1.0.0.zip", + "reference": "1.0.0", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "Psr\\Log\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2012-12-21 11:40:51" + }, + { + "name": "ptachoire/cssembed", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/krichprollsch/phpCssEmbed.git", + "reference": "v1.0.1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/krichprollsch/phpCssEmbed/zipball/v1.0.1", + "reference": "v1.0.1", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "CssEmbed": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Pierre Tachoire", + "email": "pierre.tachoire@gmail.com" + } + ], + "description": "Css url embed library.", + "homepage": "https://github.com/krichprollsch/phpCssEmbed", + "keywords": [ + "css", + "url" + ], + "time": "2013-04-29 19:58:29" + }, + { + "name": "smarty/smarty", + "version": "v3.1.13", + "source": { + "type": "svn", + "url": "http://smarty-php.googlecode.com/svn", + "reference": "/tags/v3.1.13/@4699" + }, + "require": { + "php": ">=5.2" + }, + "type": "library", + "autoload": { + "classmap": [ + "distribution/libs/Smarty.class.php", + "distribution/libs/SmartyBC.class.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0" + ], + "authors": [ + { + "name": "Monte Ohrt", + "email": "monte@ohrt.com" + }, + { + "name": "Uwe Tews", + "email": "uwe.tews@googlemail.com" + }, + { + "name": "Rodney Rehm", + "email": "rodney.rehm@medialize.de" + } + ], + "description": "Smarty - the compiling PHP template engine", + "homepage": "http://www.smarty.net", + "keywords": [ + "templating" + ], + "time": "2013-01-26 12:03:52" + }, + { + "name": "symfony-cmf/routing", + "version": "1.0.0", + "target-dir": "Symfony/Cmf/Component/Routing", + "source": { + "type": "git", + "url": "https://github.com/symfony-cmf/Routing.git", + "reference": "1.0.0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony-cmf/Routing/zipball/1.0.0", + "reference": "1.0.0", + "shasum": "" + }, + "require": { + "php": ">=5.3.2", + "symfony/http-kernel": ">=2.1,<2.3-dev", + "symfony/routing": ">=2.1,<2.3-dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Cmf\\Component\\Routing": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony CMF Community", + "homepage": "https://github.com/symfony-cmf/Routing/contributors" + } + ], + "description": "Extends the Symfony2 routing component for dynamic routes and chaining several routers", + "homepage": "http://cmf.symfony.com", + "keywords": [ + "database", + "routing" + ], + "time": "2013-03-25 15:02:40" + }, + { + "name": "symfony/class-loader", + "version": "v2.2.3", + "target-dir": "Symfony/Component/ClassLoader", + "source": { + "type": "git", + "url": "https://github.com/symfony/ClassLoader.git", + "reference": "v2.2.3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/v2.2.3", + "reference": "v2.2.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/finder": ">=2.0,<3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\ClassLoader\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony ClassLoader Component", + "homepage": "http://symfony.com", + "time": "2013-05-06 20:02:13" + }, + { + "name": "symfony/config", + "version": "v2.2.3", + "target-dir": "Symfony/Component/Config", + "source": { + "type": "git", + "url": "https://github.com/symfony/Config.git", + "reference": "v2.2.3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Config/zipball/v2.2.3", + "reference": "v2.2.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Config\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "http://symfony.com", + "time": "2013-05-10 18:08:31" + }, + { + "name": "symfony/console", + "version": "v2.2.3", + "target-dir": "Symfony/Component/Console", + "source": { + "type": "git", + "url": "https://github.com/symfony/Console.git", + "reference": "v2.2.3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Console/zipball/v2.2.3", + "reference": "v2.2.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Console\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "http://symfony.com", + "time": "2013-06-13 07:47:06" + }, + { + "name": "symfony/dependency-injection", + "version": "v2.2.3", + "target-dir": "Symfony/Component/DependencyInjection", + "source": { + "type": "git", + "url": "https://github.com/symfony/DependencyInjection.git", + "reference": "v2.2.3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/v2.2.3", + "reference": "v2.2.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/config": ">=2.2,<2.3-dev", + "symfony/yaml": ">=2.0,<3.0" + }, + "suggest": { + "symfony/config": "2.2.*", + "symfony/yaml": "2.2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\DependencyInjection\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony DependencyInjection Component", + "homepage": "http://symfony.com", + "time": "2013-05-06 08:37:50" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.2.3", + "target-dir": "Symfony/Component/EventDispatcher", + "source": { + "type": "git", + "url": "https://github.com/symfony/EventDispatcher.git", + "reference": "v2.2.3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/v2.2.3", + "reference": "v2.2.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/dependency-injection": ">=2.0,<3.0" + }, + "suggest": { + "symfony/dependency-injection": "2.2.*", + "symfony/http-kernel": "2.2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "http://symfony.com", + "time": "2013-02-11 11:26:43" + }, + { + "name": "symfony/filesystem", + "version": "v2.2.3", + "target-dir": "Symfony/Component/Filesystem", + "source": { + "type": "git", + "url": "https://github.com/symfony/Filesystem.git", + "reference": "v2.2.3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/v2.2.3", + "reference": "v2.2.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Filesystem\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "http://symfony.com", + "time": "2013-05-06 20:02:13" + }, + { + "name": "symfony/finder", + "version": "v2.3.1", + "target-dir": "Symfony/Component/Finder", + "source": { + "type": "git", + "url": "https://github.com/symfony/Finder.git", + "reference": "v2.3.1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Finder/zipball/v2.3.1", + "reference": "v2.3.1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Finder\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "http://symfony.com", + "time": "2013-06-02 12:05:51" + }, + { + "name": "symfony/form", + "version": "v2.2.3", + "target-dir": "Symfony/Component/Form", + "source": { + "type": "git", + "url": "https://github.com/symfony/Form.git", + "reference": "v2.2.3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Form/zipball/v2.2.3", + "reference": "v2.2.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/event-dispatcher": ">=2.1,<3.0", + "symfony/locale": ">=2.0,<3.0", + "symfony/options-resolver": ">=2.1,<2.3-dev", + "symfony/property-access": ">=2.2,<2.3-dev" + }, + "require-dev": { + "symfony/http-foundation": ">=2.1,<2.3-dev", + "symfony/validator": ">=2.2,<2.3-dev" + }, + "suggest": { + "symfony/http-foundation": "2.2.*", + "symfony/validator": "2.2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Form\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Form Component", + "homepage": "http://symfony.com", + "time": "2013-06-13 07:35:18" + }, + { + "name": "symfony/http-foundation", + "version": "v2.2.3", + "target-dir": "Symfony/Component/HttpFoundation", + "source": { + "type": "git", + "url": "https://github.com/symfony/HttpFoundation.git", + "reference": "v2.2.3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/v2.2.3", + "reference": "v2.2.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "classmap": [ + "Symfony/Component/HttpFoundation/Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony HttpFoundation Component", + "homepage": "http://symfony.com", + "time": "2013-06-13 12:48:26" + }, + { + "name": "symfony/http-kernel", + "version": "v2.2.3", + "target-dir": "Symfony/Component/HttpKernel", + "source": { + "type": "git", + "url": "https://github.com/symfony/HttpKernel.git", + "reference": "v2.2.3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/v2.2.3", + "reference": "v2.2.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "psr/log": ">=1.0,<2.0", + "symfony/event-dispatcher": ">=2.1,<3.0", + "symfony/http-foundation": ">=2.2,<2.3-dev" + }, + "require-dev": { + "symfony/browser-kit": "2.2.*", + "symfony/class-loader": ">=2.1,<3.0", + "symfony/config": ">=2.0,<3.0", + "symfony/console": "2.2.*", + "symfony/dependency-injection": ">=2.0,<3.0", + "symfony/finder": ">=2.0,<3.0", + "symfony/process": ">=2.0,<3.0", + "symfony/routing": ">=2.2,<2.3-dev", + "symfony/stopwatch": ">=2.2,<2.3-dev" + }, + "suggest": { + "symfony/browser-kit": "2.2.*", + "symfony/class-loader": "2.2.*", + "symfony/config": "2.2.*", + "symfony/console": "2.2.*", + "symfony/dependency-injection": "2.2.*", + "symfony/finder": "2.2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\HttpKernel\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony HttpKernel Component", + "homepage": "http://symfony.com", + "time": "2013-06-19 12:09:49" + }, + { + "name": "symfony/icu", + "version": "v1.2.0", + "target-dir": "Symfony/Component/Icu", + "source": { + "type": "git", + "url": "https://github.com/symfony/Icu.git", + "reference": "v1.2.0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Icu/zipball/v1.2.0", + "reference": "v1.2.0", + "shasum": "" + }, + "require": { + "lib-icu": ">=4.4", + "php": ">=5.3.3", + "symfony/intl": ">=2.3,<3.0" + }, + "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": "2013-06-03 18:32:58" + }, + { + "name": "symfony/intl", + "version": "v2.3.1", + "target-dir": "Symfony/Component/Intl", + "source": { + "type": "git", + "url": "https://github.com/symfony/Intl.git", + "reference": "v2.3.1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Intl/zipball/v2.3.1", + "reference": "v2.3.1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/icu": ">=1.0-RC,<2.0" + }, + "require-dev": { + "symfony/filesystem": ">=2.1" + }, + "suggest": { + "ext-intl": "to use the component with locales other than \"en\"" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Intl\\": "" + }, + "classmap": [ + "Symfony/Component/Intl/Resources/stubs" + ], + "files": [ + "Symfony/Component/Intl/Resources/stubs/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch", + "homepage": "http://wiedler.ch/igor/" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + }, + { + "name": "Eriksen Costa", + "email": "eriksen.costa@infranology.com.br" + } + ], + "description": "A PHP replacement layer for the C intl extension that includes additional data from the ICU library.", + "homepage": "http://symfony.com", + "keywords": [ + "i18n", + "icu", + "internationalization", + "intl", + "l10n", + "localization" + ], + "time": "2013-05-18 11:21:22" + }, + { + "name": "symfony/locale", + "version": "v2.3.1", + "target-dir": "Symfony/Component/Locale", + "source": { + "type": "git", + "url": "https://github.com/symfony/Locale.git", + "reference": "v2.3.1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Locale/zipball/v2.3.1", + "reference": "v2.3.1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/intl": ">=2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Locale\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Locale Component", + "homepage": "http://symfony.com", + "time": "2013-04-11 09:29:25" + }, + { + "name": "symfony/options-resolver", + "version": "v2.2.3", + "target-dir": "Symfony/Component/OptionsResolver", + "source": { + "type": "git", + "url": "https://github.com/symfony/OptionsResolver.git", + "reference": "v2.2.3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/OptionsResolver/zipball/v2.2.3", + "reference": "v2.2.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\OptionsResolver\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony OptionsResolver Component", + "homepage": "http://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "time": "2013-01-17 15:25:59" + }, + { + "name": "symfony/process", + "version": "v2.3.1", + "target-dir": "Symfony/Component/Process", + "source": { + "type": "git", + "url": "https://github.com/symfony/Process.git", + "reference": "v2.3.1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Process/zipball/v2.3.1", + "reference": "v2.3.1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Process\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "http://symfony.com", + "time": "2013-05-06 20:03:44" + }, + { + "name": "symfony/property-access", + "version": "v2.2.3", + "target-dir": "Symfony/Component/PropertyAccess", + "source": { + "type": "git", + "url": "https://github.com/symfony/PropertyAccess.git", + "reference": "v2.2.3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/PropertyAccess/zipball/v2.2.3", + "reference": "v2.2.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\PropertyAccess\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony PropertyAccess Component", + "homepage": "http://symfony.com", + "keywords": [ + "access", + "array", + "extraction", + "index", + "injection", + "object", + "property", + "property path", + "reflection" + ], + "time": "2013-04-07 22:02:49" + }, + { + "name": "symfony/routing", + "version": "v2.2.3", + "target-dir": "Symfony/Component/Routing", + "source": { + "type": "git", + "url": "https://github.com/symfony/Routing.git", + "reference": "v2.2.3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Routing/zipball/v2.2.3", + "reference": "v2.2.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "doctrine/common": ">=2.2,<3.0", + "psr/log": ">=1.0,<2.0", + "symfony/config": ">=2.2,<2.3-dev", + "symfony/yaml": ">=2.0,<3.0" + }, + "suggest": { + "doctrine/common": "~2.2", + "symfony/config": "2.2.*", + "symfony/yaml": "2.2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Routing\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Routing Component", + "homepage": "http://symfony.com", + "time": "2013-05-10 16:49:00" + }, + { + "name": "symfony/security", + "version": "v2.2.3", + "target-dir": "Symfony/Component/Security", + "source": { + "type": "git", + "url": "https://github.com/symfony/Security.git", + "reference": "v2.2.3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Security/zipball/v2.2.3", + "reference": "v2.2.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/event-dispatcher": ">=2.1,<3.0", + "symfony/http-foundation": ">=2.1,<2.3-dev", + "symfony/http-kernel": ">=2.1,<=2.3-dev" + }, + "require-dev": { + "doctrine/common": ">=2.2,<3.0", + "doctrine/dbal": ">=2.2,<3.0", + "psr/log": ">=1.0,<2.0", + "symfony/form": ">=2.0,<3.0", + "symfony/routing": ">=2.2,<2.3-dev", + "symfony/validator": ">=2.2,<2.3-dev" + }, + "suggest": { + "doctrine/dbal": "to use the built-in ACL implementation", + "symfony/class-loader": "2.2.*", + "symfony/finder": "2.2.*", + "symfony/form": "2.2.*", + "symfony/routing": "2.2.*", + "symfony/validator": "2.2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Security\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Security Component", + "homepage": "http://symfony.com", + "time": "2013-05-27 14:47:40" + }, + { + "name": "symfony/templating", + "version": "v2.2.3", + "target-dir": "Symfony/Component/Templating", + "source": { + "type": "git", + "url": "https://github.com/symfony/Templating.git", + "reference": "v2.2.3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Templating/zipball/v2.2.3", + "reference": "v2.2.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Templating\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Templating Component", + "homepage": "http://symfony.com", + "time": "2013-04-17 05:27:14" + }, + { + "name": "symfony/translation", + "version": "v2.2.3", + "target-dir": "Symfony/Component/Translation", + "source": { + "type": "git", + "url": "https://github.com/symfony/Translation.git", + "reference": "v2.2.3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Translation/zipball/v2.2.3", + "reference": "v2.2.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/config": ">=2.0,<2.3-dev", + "symfony/yaml": ">=2.2,<3.0" + }, + "suggest": { + "symfony/config": "2.2.*", + "symfony/yaml": "2.2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Translation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Translation Component", + "homepage": "http://symfony.com", + "time": "2013-05-10 16:49:00" + }, + { + "name": "symfony/validator", + "version": "v2.2.3", + "target-dir": "Symfony/Component/Validator", + "source": { + "type": "git", + "url": "https://github.com/symfony/Validator.git", + "reference": "v2.2.3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Validator/zipball/v2.2.3", + "reference": "v2.2.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/translation": ">=2.0,<3.0" + }, + "require-dev": { + "symfony/config": ">=2.2,<2.3-dev", + "symfony/http-foundation": ">=2.1,<3.0", + "symfony/locale": ">=2.0,<3.0", + "symfony/yaml": ">=2.0,<3.0" + }, + "suggest": { + "doctrine/common": "~2.2", + "symfony/config": "2.2.*", + "symfony/http-foundation": "2.2.*", + "symfony/locale": "2.2.*", + "symfony/yaml": "2.2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Validator\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Validator Component", + "homepage": "http://symfony.com", + "time": "2013-06-02 12:05:41" + }, + { + "name": "symfony/yaml", + "version": "v2.2.3", + "target-dir": "Symfony/Component/Yaml", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml.git", + "reference": "v2.2.3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/v2.2.3", + "reference": "v2.2.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Yaml\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "http://symfony.com", + "time": "2013-05-10 18:08:31" + } + ], + "packages-dev": [ + { + "name": "fzaninotto/faker", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/fzaninotto/Faker.git", + "reference": "cf749f1e40950873726ba437cbd36f1a5a1d5ad1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/cf749f1e40950873726ba437cbd36f1a5a1d5ad1", + "reference": "cf749f1e40950873726ba437cbd36f1a5a1d5ad1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-0": { + "Faker": "src/", + "Faker\\PHPUnit": "test/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "François Zaninotto" + } + ], + "description": "Faker is a PHP library that generates fake data for you.", + "keywords": [ + "data", + "faker", + "fixtures" + ], + "time": "2013-07-01 12:57:31" + } + ], + "aliases": [ + + ], + "minimum-stability": "stable", + "stability-flags": { + "ezyang/htmlpurifier": 20, + "ircmaxell/password-compat": 20, + "propel/propel": 15, + "kriswallsmith/assetic": 20, + "leafo/lessphp": 20, + "ptachoire/cssembed": 20, + "fzaninotto/faker": 20 + }, + "platform": { + "php": ">=5.3" + }, + "platform-dev": [ + + ] +} diff --git a/core/lib/Thelia/Command/Install.php b/core/lib/Thelia/Command/Install.php index 81f493701..9d4d4d1fd 100755 --- a/core/lib/Thelia/Command/Install.php +++ b/core/lib/Thelia/Command/Install.php @@ -41,6 +41,30 @@ class Install extends ContainerAwareCommand ->setName("thelia:install") ->setDescription("Install thelia using cli tools. For now Thelia only use mysql database") ->setHelp("The thelia:install command install Thelia database and create config file needed.") + ->addOption( + "db_host", + null, + InputOption::VALUE_OPTIONAL, + "host for your database" + ) + ->addOption( + "db_username", + null, + InputOption::VALUE_OPTIONAL, + "username for your database" + ) + ->addOption( + "db_password", + null, + InputOption::VALUE_OPTIONAL, + "password for your database" + ) + ->addOption( + "db_name", + null, + InputOption::VALUE_OPTIONAL, + "database name" + ) ; } @@ -56,9 +80,19 @@ class Install extends ContainerAwareCommand $this->checkPermission($output); - do { - $connectionInfo = $this->getConnectionInfo($input, $output); - } while(false === $connection = $this->tryConnection($connectionInfo, $output)); + + $connectionInfo = array( + "host" => $input->getOption("db_host"), + "dbName" => $input->getOption("db_name"), + "username" => $input->getOption("db_username"), + "password" => $input->getOption("db_password") + ); + + + + while(false === $connection = $this->tryConnection($connectionInfo, $output)) { + $connectionInfo = $this->getConnectionInfo($input, $output); + } $this->createDatabase($connection, $connectionInfo["dbName"]); diff --git a/core/lib/Thelia/Core/Security/Encoder/PasswordPhpCompatEncoder.php b/core/lib/Thelia/Core/Security/Encoder/PasswordPhpCompatEncoder.php new file mode 100644 index 000000000..32b1c7fd0 --- /dev/null +++ b/core/lib/Thelia/Core/Security/Encoder/PasswordPhpCompatEncoder.php @@ -0,0 +1,58 @@ +. */ +/* */ +/*************************************************************************************/ +namespace Thelia\Core\Security\Encoder; + +/** + * + * use password api include in php 5.5 and available throw the password_compat library. + * + * Class PasswordPhpCompatEncoder + * @package Thelia\Core\Security\Encoder + */ +class PasswordPhpCompatEncoder implements PasswordEncoderInterface { + + /** + * Encode a string. + * + * @param string $password the password to encode + * @param string $algorithm the hash() algorithm + * @return string $salt the salt, the salt is not used here. + */ + public function encode($password, $algorithm, $salt = null) + { + return password_hash($password, $algorithm); + } + + /** + * Check a string against an encoded password. + * + * @param string $string the string to compare against password + * @param string $password the encoded password + * @param string $algorithm the hash() algorithm, not used here + * @return string $salt the salt, not used here + */ + public function isEqual($string, $password, $algorithm = null, $salt = null) + { + return password_verify($string, $password); + } +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Template/Element/BaseLoop.php b/core/lib/Thelia/Core/Template/Element/BaseLoop.php index ba22e0509..59747eec1 100755 --- a/core/lib/Thelia/Core/Template/Element/BaseLoop.php +++ b/core/lib/Thelia/Core/Template/Element/BaseLoop.php @@ -115,6 +115,7 @@ abstract class BaseLoop $faultDetails = array(); while (($argument = $this->args->current()) !== false) { + $this->args->next(); $value = isset($nameValuePairs[$argument->name]) ? $nameValuePairs[$argument->name] : null; diff --git a/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php b/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php index 721dde312..5b8b99f03 100755 --- a/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php +++ b/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php @@ -52,11 +52,11 @@ class Argument } public function getValue() { - return $this->value; + return $this->type->getFormattedValue($this->value); } public function setValue($value) { - $this->value = $value; + $this->value = $value === null ? null : (string)$value; } public static function createAnyTypeArgument($name, $default=null, $mandatory=false, $empty=true) diff --git a/core/lib/Thelia/Core/Template/Loop/Category.php b/core/lib/Thelia/Core/Template/Loop/Category.php index c12d723e4..96809f5dc 100755 --- a/core/lib/Thelia/Core/Template/Loop/Category.php +++ b/core/lib/Thelia/Core/Template/Loop/Category.php @@ -83,7 +83,7 @@ class Category extends BaseLoop new Argument( 'order', new TypeCollection( - new Type\EnumType('alpha', 'alpha_reverse', 'reverse') + new Type\EnumListType('alpha', 'alpha_reverse', 'reverse') ) ), Argument::createBooleanTypeArgument('random', 0), @@ -137,23 +137,32 @@ class Category extends BaseLoop $search->filterByVisible($this->getVisible() ? 1 : 0); - switch ($this->getOrder()) { - case "alpha": - $search->addAscendingOrderByColumn(\Thelia\Model\CategoryI18nPeer::TITLE); - break; - case "alpha_reverse": - $search->addDescendingOrderByColumn(\Thelia\Model\CategoryI18nPeer::TITLE); - break; - case "reverse": - $search->orderByPosition(\Criteria::DESC); - break; - default: - $search->orderByPosition(); - break; + $orders = $this->getOrder(); + + if(null === $orders) { + $search->orderByPosition(); + } else { + foreach($orders as $order) { + switch ($order) { + case "alpha": + $search->addAscendingOrderByColumn(\Thelia\Model\CategoryI18nPeer::TITLE); + break; + case "alpha_reverse": + $search->addDescendingOrderByColumn(\Thelia\Model\CategoryI18nPeer::TITLE); + break; + case "reverse": + $search->orderByPosition(\Criteria::DESC); + break; + default: + $search->orderByPosition(); + break; + } + } } + $random = $this->getRandom(); - if ($this->getRandom() === true) { + if ($random === true) { $search->clearOrderByColumns(); $search->addAscendingOrderByColumn('RAND()'); } diff --git a/core/lib/Thelia/Core/Template/Loop/Product.php b/core/lib/Thelia/Core/Template/Loop/Product.php index 935879961..001c5c750 100755 --- a/core/lib/Thelia/Core/Template/Loop/Product.php +++ b/core/lib/Thelia/Core/Template/Loop/Product.php @@ -24,7 +24,6 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; - use Thelia\Core\Template\Element\BaseLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -34,8 +33,8 @@ use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Log\Tlog; use Thelia\Model\CategoryQuery; +use Thelia\Model\Map\ProductTableMap; use Thelia\Model\ProductCategoryQuery; -use Thelia\Model\ProductPeer; use Thelia\Model\ProductQuery; use Thelia\Model\ConfigQuery; use Thelia\Type\TypeCollection; @@ -80,7 +79,7 @@ class Product extends BaseLoop new Argument( 'order', new TypeCollection( - new Type\EnumType(array('alpha', 'alpha_reverse', 'reverse', 'min_price', 'max_price', 'category', 'manual', 'manual_reverse', 'ref', 'promo', 'new')) + new Type\EnumListType(array('alpha', 'alpha_reverse', 'reverse', 'min_price', 'max_price', 'manual', 'manual_reverse', 'ref', 'promo', 'new')) ) ), Argument::createBooleanTypeArgument('random', 0), @@ -97,6 +96,8 @@ class Product extends BaseLoop { $search = ProductQuery::create(); + $search->withColumn('CASE WHEN ' . ProductTableMap::PROMO . '=1 THEN ' . ProductTableMap::PRICE2 . ' ELSE ' . ProductTableMap::PRICE . ' END', 'real_price'); + $id = $this->getId(); if (!is_null($id)) { @@ -153,10 +154,15 @@ class Product extends BaseLoop $min_price = $this->getMin_price(); if(null !== $min_price) { - $search->condition('in_promo', ProductPeer::PROMO . Criteria::EQUAL . '1') - ->condition('not_in_promo', ProductPeer::PROMO . Criteria::NOT_EQUAL . '1') - ->condition('min_price2', ProductPeer::PRICE2 . Criteria::GREATER_EQUAL . '?', $min_price) - ->condition('min_price', ProductPeer::PRICE . Criteria::GREATER_EQUAL . '?', $min_price) + /** + * Following should work but does not : + * + * $search->filterBy('real_price', $max_price, Criteria::GREATER_EQUAL); + */ + $search->condition('in_promo', ProductTableMap::PROMO . Criteria::EQUAL . '1') + ->condition('not_in_promo', ProductTableMap::PROMO . Criteria::NOT_EQUAL . '1') + ->condition('min_price2', ProductTableMap::PRICE2 . Criteria::GREATER_EQUAL . '?', $min_price) + ->condition('min_price', ProductTableMap::PRICE . Criteria::GREATER_EQUAL . '?', $min_price) ->combine(array('in_promo', 'min_price2'), Criteria::LOGICAL_AND, 'in_promo_min_price') ->combine(array('not_in_promo', 'min_price'), Criteria::LOGICAL_AND, 'not_in_promo_min_price') ->where(array('not_in_promo_min_price', 'in_promo_min_price'), Criteria::LOGICAL_OR); @@ -165,10 +171,15 @@ class Product extends BaseLoop $max_price = $this->getMax_price(); if(null !== $max_price) { - $search->condition('in_promo', ProductPeer::PROMO . Criteria::EQUAL . '1') - ->condition('not_in_promo', ProductPeer::PROMO . Criteria::NOT_EQUAL . '1') - ->condition('max_price2', ProductPeer::PRICE2 . Criteria::LESS_EQUAL . '?', $max_price) - ->condition('max_price', ProductPeer::PRICE . Criteria::LESS_EQUAL . '?', $max_price) + /** + * Following should work but does not : + * + * $search->filterBy('real_price', $max_price, Criteria::LESS_EQUAL); + */ + $search->condition('in_promo', ProductTableMap::PROMO . Criteria::EQUAL . '1') + ->condition('not_in_promo', ProductTableMap::PROMO . Criteria::NOT_EQUAL . '1') + ->condition('max_price2', ProductTableMap::PRICE2 . Criteria::LESS_EQUAL . '?', $max_price) + ->condition('max_price', ProductTableMap::PRICE . Criteria::LESS_EQUAL . '?', $max_price) ->combine(array('in_promo', 'max_price2'), Criteria::LOGICAL_AND, 'in_promo_max_price') ->combine(array('not_in_promo', 'max_price'), Criteria::LOGICAL_AND, 'not_in_promo_max_price') ->where(array('not_in_promo_max_price', 'in_promo_max_price'), Criteria::LOGICAL_OR); @@ -222,47 +233,58 @@ class Product extends BaseLoop $search->filterByVisible($this->getVisible()); - switch ($this->getOrder()) { - case "alpha": - $search->addAscendingOrderByColumn(\Thelia\Model\CategoryI18nPeer::TITLE); - break; - case "alpha_reverse": - $search->addDescendingOrderByColumn(\Thelia\Model\CategoryI18nPeer::TITLE); - break; - case "reverse": - $search->orderByPosition(Criteria::DESC); - break; - case "min_price": - //$search->order - //$search->orderByPosition(Criteria::DESC); - break; - /*case "max_price": - $search->orderByPosition(Criteria::DESC); - break; - case "category": - $search->orderByPosition(Criteria::DESC); - break;*/ - case "manual": - $search->addAscendingOrderByColumn(\Thelia\Model\ProductPeer::POSITION); - break; - case "manual_reverse": - $search->addDescendingOrderByColumn(\Thelia\Model\ProductPeer::POSITION); - break; - case "ref": - $search->addAscendingOrderByColumn(\Thelia\Model\ProductPeer::REF); - break; - case "promo": - $search->addDescendingOrderByColumn(\Thelia\Model\ProductPeer::PROMO); - break; - case "new": - $search->addDescendingOrderByColumn(\Thelia\Model\ProductPeer::NEWNESS); - break; - default: - $search->orderByPosition(); - break; + $orders = $this->getOrder(); + + if(null === $orders) { + $search->orderByPosition(); + } else { + foreach($orders as $order) { + switch ($order) { + case "alpha": + $search->addAscendingOrderByColumn(\Thelia\Model\Map\CategoryI18nTableMap::TITLE); + $search->addAscendingOrderByColumn(\Thelia\Model\Map\CategoryI18nTableMap::TITLE); + break; + case "alpha_reverse": + $search->addDescendingOrderByColumn(\Thelia\Model\Map\CategoryI18nTableMap::TITLE); + break; + case "reverse": + $search->orderByPosition(Criteria::DESC); + break; + case "min_price": + $search->orderBy('real_price', Criteria::ASC); + break; + case "max_price": + $search->orderBy('real_price', Criteria::DESC); + break; + case "manual": + if(null === $this->category || count($this->category) != 1) + throw new \InvalidArgumentException('Manual order cannot be set without single category argument'); + $search->addAscendingOrderByColumn(ProductTableMap::POSITION); + break; + case "manual_reverse": + if(null === $this->category || count($this->category) != 1) + throw new \InvalidArgumentException('Manual order cannot be set without single category argument'); + $search->addDescendingOrderByColumn(ProductTableMap::POSITION); + break; + case "ref": + $search->addAscendingOrderByColumn(ProductTableMap::REF); + break; + case "promo": + $search->addDescendingOrderByColumn(ProductTableMap::PROMO); + break; + case "new": + $search->addDescendingOrderByColumn(ProductTableMap::NEWNESS); + break; + default: + $search->orderByPosition(); + break; + } + } } - if ($this->getRandom() === true) { + $random = $this->getRandom(); + + if ($random === true) { $search->clearOrderByColumns(); $search->addAscendingOrderByColumn('RAND()'); } diff --git a/core/lib/Thelia/Form/CustomerCreation.php b/core/lib/Thelia/Form/CustomerCreation.php index 659bc4fe4..2ba80f362 100644 --- a/core/lib/Thelia/Form/CustomerCreation.php +++ b/core/lib/Thelia/Form/CustomerCreation.php @@ -22,10 +22,7 @@ /*************************************************************************************/ namespace Thelia\Form; -use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Validator\Constraints; -use Symfony\Component\Validator\ExecutionContext; use Symfony\Component\Validator\ExecutionContextInterface; use Thelia\Model\ConfigQuery; use Thelia\Model\CustomerQuery; diff --git a/core/lib/Thelia/Model/Customer.php b/core/lib/Thelia/Model/Customer.php index eb0cbea8a..13024996b 100644 --- a/core/lib/Thelia/Model/Customer.php +++ b/core/lib/Thelia/Model/Customer.php @@ -105,7 +105,7 @@ class Customer extends BaseCustomer implements UserInterface $this->setAlgo("PASSWORD_BCRYPT"); return parent::setPassword(password_hash($password, PASSWORD_BCRYPT)); } - + return $this; } public function setDispatcher(EventDispatcherInterface $dispatcher) diff --git a/core/lib/Thelia/Tests/Core/Security/Encoder/PasswordPhpCompatEncoderTest.php b/core/lib/Thelia/Tests/Core/Security/Encoder/PasswordPhpCompatEncoderTest.php new file mode 100644 index 000000000..988be2360 --- /dev/null +++ b/core/lib/Thelia/Tests/Core/Security/Encoder/PasswordPhpCompatEncoderTest.php @@ -0,0 +1,31 @@ +encoder = new PasswordPhpCompatEncoder(); + } + + public function testEncode() + { + $hash = $this->encoder->encode("foo", PASSWORD_BCRYPT); + + $this->assertEquals($hash, crypt("foo", $hash)); + } + +} \ No newline at end of file diff --git a/core/lib/Thelia/Tests/Log/TlogTest.php b/core/lib/Thelia/Tests/Log/TlogTest.php index acae68dc6..bde1cdb39 100755 --- a/core/lib/Thelia/Tests/Log/TlogTest.php +++ b/core/lib/Thelia/Tests/Log/TlogTest.php @@ -29,7 +29,8 @@ class TlogTest extends \PHPUnit_Framework_TestCase { protected static $logger; - protected $regex = "/(\\d)(:)(\\s+)(%s)(\\s+)(\\[.*?\\])(\\s+)(\\{.*?\\})(\\s+)((?:2|1)\\d{3}(?:-|\\/)(?:(?:0[1-9])|(?:1[0-2]))(?:-|\\/)(?:(?:0[1-9])|(?:[1-2][0-9])|(?:3[0-1]))(?:T|\\s)(?:(?:[0-1][0-9])|(?:2[0-3])):(?:[0-5][0-9]):(?:[0-5][0-9]))(.)(\\s+)(%s)([\n])/is"; + //protected $regex = "/(\\d)(:)(\\s+)(%s)(\\s+)(\\[.*?\\])(\\s+)(\\{.*?\\})(\\s+)(\\d{4})(-)(\\d{2})(-)(\\d{2})(\\s+)(\\d{2})(:)(\\d{2})(:)(\\d{2})(:)(\\s+)(%s)([\n])/is"; + protected $regex = "/[0-9]+:[\s](%s)+[\s]\[[a-zA-Z\.]+:[a-zA-Z]+\(\)\][\s]\{[0-9]+\}[\s][0-9]{4}-[0-9]{2}-[0-9]{2}[\s][0-9]{2}:[0-9]{2}:[0-9]{2}:[\s](%s).*$/is"; public static function setUpBeforeClass() { diff --git a/core/lib/Thelia/Tests/Type/AlphaNumStringListTypeTest.php b/core/lib/Thelia/Tests/Type/AlphaNumStringListTypeTest.php index 22d1c52ce..2a8ba5fa0 100755 --- a/core/lib/Thelia/Tests/Type/AlphaNumStringListTypeTest.php +++ b/core/lib/Thelia/Tests/Type/AlphaNumStringListTypeTest.php @@ -42,7 +42,7 @@ class AlphaNumStringListTypeTest extends \PHPUnit_Framework_TestCase public function testFormatAlphaNumStringListType() { $type = new AlphaNumStringListType(); - $this->assertTrue(is_array($type->getFormatedValue('FOO1,FOO_2,FOO-3'))); - $this->assertNull($type->getFormatedValue('5€')); + $this->assertTrue(is_array($type->getFormattedValue('FOO1,FOO_2,FOO-3'))); + $this->assertNull($type->getFormattedValue('5€')); } } diff --git a/core/lib/Thelia/Tests/Type/BooleanTypeTest.php b/core/lib/Thelia/Tests/Type/BooleanTypeTest.php index 84889ff40..d91cc6bc9 100755 --- a/core/lib/Thelia/Tests/Type/BooleanTypeTest.php +++ b/core/lib/Thelia/Tests/Type/BooleanTypeTest.php @@ -48,8 +48,8 @@ class BooleanTypeTest extends \PHPUnit_Framework_TestCase public function testFormatBooleanType() { $booleanType = new BooleanType(); - $this->assertTrue($booleanType->getFormatedValue('yes')); - $this->assertFalse($booleanType->getFormatedValue('no')); - $this->assertNull($booleanType->getFormatedValue('foo')); + $this->assertTrue($booleanType->getFormattedValue('yes')); + $this->assertFalse($booleanType->getFormattedValue('no')); + $this->assertNull($booleanType->getFormattedValue('foo')); } } diff --git a/core/lib/Thelia/Tests/Type/EnumListTypeTest.php b/core/lib/Thelia/Tests/Type/EnumListTypeTest.php new file mode 100755 index 000000000..a992fb0bd --- /dev/null +++ b/core/lib/Thelia/Tests/Type/EnumListTypeTest.php @@ -0,0 +1,50 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Tests\Type; + +use Thelia\Type\EnumListType; + +/** + * + * @author Etienne Roudeix + * + */ +class EnumListTypeTest extends \PHPUnit_Framework_TestCase +{ + public function testEnumListType() + { + $enumListType = new EnumListType(array("cat", "dog", "frog")); + $this->assertTrue($enumListType->isValid('cat')); + $this->assertTrue($enumListType->isValid('cat,dog')); + $this->assertFalse($enumListType->isValid('potato')); + $this->assertFalse($enumListType->isValid('cat,monkey')); + } + + public function testFormatEnumListType() + { + $enumListType = new EnumListType(array("cat", "dog", "frog")); + $this->assertTrue(is_array($enumListType->getFormattedValue('cat,dog'))); + $this->assertNull($enumListType->getFormattedValue('cat,monkey')); + } +} diff --git a/core/lib/Thelia/Tests/Type/IntListTypeTest.php b/core/lib/Thelia/Tests/Type/IntListTypeTest.php index 6f9cc1e99..80ffa3e2e 100755 --- a/core/lib/Thelia/Tests/Type/IntListTypeTest.php +++ b/core/lib/Thelia/Tests/Type/IntListTypeTest.php @@ -43,7 +43,7 @@ class IntListTypeTest extends \PHPUnit_Framework_TestCase public function testFormatIntListType() { $intListType = new IntListType(); - $this->assertTrue(is_array($intListType->getFormatedValue('1,2,3'))); - $this->assertNull($intListType->getFormatedValue('foo')); + $this->assertTrue(is_array($intListType->getFormattedValue('1,2,3'))); + $this->assertNull($intListType->getFormattedValue('foo')); } } diff --git a/core/lib/Thelia/Tests/Type/JsonTypeTest.php b/core/lib/Thelia/Tests/Type/JsonTypeTest.php index 2dc15a2f5..79b2c59b8 100755 --- a/core/lib/Thelia/Tests/Type/JsonTypeTest.php +++ b/core/lib/Thelia/Tests/Type/JsonTypeTest.php @@ -42,7 +42,7 @@ class JsonTypeTest extends \PHPUnit_Framework_TestCase public function testFormatJsonType() { $jsonType = new JsonType(); - $this->assertTrue(is_array($jsonType->getFormatedValue('{"k0":"v0","k1":"v1","k2":"v2"}'))); - $this->assertNull($jsonType->getFormatedValue('foo')); + $this->assertTrue(is_array($jsonType->getFormattedValue('{"k0":"v0","k1":"v1","k2":"v2"}'))); + $this->assertNull($jsonType->getFormattedValue('foo')); } } diff --git a/core/lib/Thelia/Type/AlphaNumStringListType.php b/core/lib/Thelia/Type/AlphaNumStringListType.php index 1fa210cba..41af21e07 100755 --- a/core/lib/Thelia/Type/AlphaNumStringListType.php +++ b/core/lib/Thelia/Type/AlphaNumStringListType.php @@ -45,7 +45,7 @@ class AlphaNumStringListType implements TypeInterface return true; } - public function getFormatedValue($values) + public function getFormattedValue($values) { return $this->isValid($values) ? explode(',', $values) : null; } diff --git a/core/lib/Thelia/Type/AlphaNumStringType.php b/core/lib/Thelia/Type/AlphaNumStringType.php index b893f8a46..963237cb0 100755 --- a/core/lib/Thelia/Type/AlphaNumStringType.php +++ b/core/lib/Thelia/Type/AlphaNumStringType.php @@ -40,7 +40,7 @@ class AlphaNumStringType implements TypeInterface return preg_match('#^[a-zA-Z0-9\-_]+$#', $value) ? true : false; } - public function getFormatedValue($value) + public function getFormattedValue($value) { return $this->isValid($value) ? $value : null; } diff --git a/core/lib/Thelia/Type/AnyType.php b/core/lib/Thelia/Type/AnyType.php index 8e22d44eb..ca0a14616 100755 --- a/core/lib/Thelia/Type/AnyType.php +++ b/core/lib/Thelia/Type/AnyType.php @@ -40,7 +40,7 @@ class AnyType implements TypeInterface return true; } - public function getFormatedValue($value) + public function getFormattedValue($value) { return $value; } diff --git a/core/lib/Thelia/Type/BooleanType.php b/core/lib/Thelia/Type/BooleanType.php index 939ff0d79..0c85d3ba8 100755 --- a/core/lib/Thelia/Type/BooleanType.php +++ b/core/lib/Thelia/Type/BooleanType.php @@ -53,7 +53,7 @@ class BooleanType implements TypeInterface return in_array($value, $this->trueValuesArray) || in_array($value, $this->falseValuesArray); } - public function getFormatedValue($value) + public function getFormattedValue($value) { return $this->isValid($value) ? ( in_array($value, $this->trueValuesArray) ) : null; } diff --git a/core/lib/Thelia/Type/EnumListType.php b/core/lib/Thelia/Type/EnumListType.php new file mode 100755 index 000000000..1603dc89f --- /dev/null +++ b/core/lib/Thelia/Type/EnumListType.php @@ -0,0 +1,65 @@ +. */ +/* */ +/*************************************************************************************/ +namespace Thelia\Type; + +/** + * + * @author Etienne Roudeix + * + */ + +class EnumListType implements TypeInterface +{ + protected $values = array(); + + public function __construct($values = array()) + { + if(is_array($values)) + $this->values = $values; + } + + public function getType() + { + return 'Enum list type'; + } + + public function isValid($values) + { + foreach(explode(',', $values) as $value) { + if(!$this->isSingleValueValid($value)) + return false; + } + + return true; + } + + public function getFormattedValue($values) + { + return $this->isValid($values) ? explode(',', $values) : null; + } + + public function isSingleValueValid($value) + { + return in_array($value, $this->values); + } +} diff --git a/core/lib/Thelia/Type/EnumType.php b/core/lib/Thelia/Type/EnumType.php index 0aff0ec88..0221f8b8e 100755 --- a/core/lib/Thelia/Type/EnumType.php +++ b/core/lib/Thelia/Type/EnumType.php @@ -48,7 +48,7 @@ class EnumType implements TypeInterface return in_array($value, $this->values); } - public function getFormatedValue($value) + public function getFormattedValue($value) { return $this->isValid($value) ? $value : null; } diff --git a/core/lib/Thelia/Type/FloatType.php b/core/lib/Thelia/Type/FloatType.php index 83d3561a4..3c10df86c 100755 --- a/core/lib/Thelia/Type/FloatType.php +++ b/core/lib/Thelia/Type/FloatType.php @@ -40,7 +40,7 @@ class FloatType implements TypeInterface return filter_var($value, FILTER_VALIDATE_FLOAT) === false ? false : true; } - public function getFormatedValue($value) + public function getFormattedValue($value) { return $this->isValid($value) ? $value : null; } diff --git a/core/lib/Thelia/Type/IntListType.php b/core/lib/Thelia/Type/IntListType.php index b023173f7..cd4eadf22 100755 --- a/core/lib/Thelia/Type/IntListType.php +++ b/core/lib/Thelia/Type/IntListType.php @@ -45,7 +45,7 @@ class IntListType implements TypeInterface return true; } - public function getFormatedValue($values) + public function getFormattedValue($values) { return $this->isValid($values) ? explode(',', $values) : null; } diff --git a/core/lib/Thelia/Type/IntType.php b/core/lib/Thelia/Type/IntType.php index 4adc2e10e..c2d6dcfa8 100755 --- a/core/lib/Thelia/Type/IntType.php +++ b/core/lib/Thelia/Type/IntType.php @@ -40,7 +40,7 @@ class IntType implements TypeInterface return filter_var($value, FILTER_VALIDATE_INT) === false ? false : true; } - public function getFormatedValue($value) + public function getFormattedValue($value) { return $this->isValid($value) ? $value : null; } diff --git a/core/lib/Thelia/Type/JsonType.php b/core/lib/Thelia/Type/JsonType.php index 397967df9..39ee57d53 100755 --- a/core/lib/Thelia/Type/JsonType.php +++ b/core/lib/Thelia/Type/JsonType.php @@ -41,7 +41,7 @@ class JsonType implements TypeInterface return (json_last_error() == JSON_ERROR_NONE); } - public function getFormatedValue($value) + public function getFormattedValue($value) { return $this->isValid($value) ? json_decode($value, true) : null; } diff --git a/core/lib/Thelia/Type/TypeCollection.php b/core/lib/Thelia/Type/TypeCollection.php index bff384f92..460d9b96e 100755 --- a/core/lib/Thelia/Type/TypeCollection.php +++ b/core/lib/Thelia/Type/TypeCollection.php @@ -133,10 +133,10 @@ class TypeCollection implements \Iterator return false; } - public function getFormatedValue($value) { + public function getFormattedValue($value) { foreach($this as $type) { if($type->isValid($value)) { - return $type->getFormatedValue($value); + return $type->getFormattedValue($value); } } diff --git a/core/lib/Thelia/Type/TypeInterface.php b/core/lib/Thelia/Type/TypeInterface.php index 9268df7d5..b2ba11a4b 100755 --- a/core/lib/Thelia/Type/TypeInterface.php +++ b/core/lib/Thelia/Type/TypeInterface.php @@ -34,5 +34,5 @@ interface TypeInterface public function isValid($value); - public function getFormatedValue($value); + public function getFormattedValue($value); } diff --git a/local/config/database.yml.sample b/local/config/database.yml.sample old mode 100755 new mode 100644 diff --git a/templates/smarty-sample/category.html b/templates/smarty-sample/category.html index 594be9cc6..1589036a4 100755 --- a/templates/smarty-sample/category.html +++ b/templates/smarty-sample/category.html @@ -19,7 +19,7 @@
{/loop*}

PRODUCTS

-{loop name="product" type="product" order="min_price"} +{loop name="product" type="product" order="promo,min_price"}

PRODUCT : #REF / #TITLE

price : #PRICE €
promo price : #PROMO_PRICE €