From 813acbf26c0ff6ade86d9f7b37167e4f6dbc6af9 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 15 Jan 2013 10:56:48 +0100 Subject: [PATCH] remove notORM bundle --- core/composer.json | 7 +- core/composer.lock | 288 +++++++++++-------- core/lib/Thelia/Core/Bundle/LoggerBundle.php | 81 ------ core/lib/Thelia/Core/Bundle/ModelBundle.php | 60 ---- core/lib/Thelia/Core/Bundle/NotORMBundle.php | 98 ------- core/lib/Thelia/Core/Thelia.php | 3 - 6 files changed, 164 insertions(+), 373 deletions(-) delete mode 100644 core/lib/Thelia/Core/Bundle/LoggerBundle.php delete mode 100644 core/lib/Thelia/Core/Bundle/ModelBundle.php delete mode 100644 core/lib/Thelia/Core/Bundle/NotORMBundle.php diff --git a/core/composer.json b/core/composer.json index a8cda3428..6f0c40cb0 100644 --- a/core/composer.json +++ b/core/composer.json @@ -10,10 +10,7 @@ "symfony/console" : "2.1.*", "symfony/event-dispatcher" : "2.1.*", "symfony-cmf/routing" : "1.0.*@dev", - "vrana/notorm": "dev-master" + "propel/propel1" : "1.6.*" }, - "minimum-stability": "stable", - "autoload" : { - "classmap" : ["vendor/vrana/notorm/NotORM.php","vendor/vrana/notorm/NotORM"] - } + "minimum-stability": "stable" } diff --git a/core/composer.lock b/core/composer.lock index 078ede977..2f95c421f 100644 --- a/core/composer.lock +++ b/core/composer.lock @@ -1,6 +1,118 @@ { - "hash": "4dac998c040ba1f3fcdd8ddd3e49262c", + "hash": "2be3cc68d014718aa32d78effb38b917", "packages": [ + { + "name": "phing/phing", + "version": "2.4.14", + "source": { + "type": "git", + "url": "https://github.com/phingofficial/phing", + "reference": "2.4.14" + }, + "dist": { + "type": "zip", + "url": "https://github.com/phingofficial/phing/archive/2.4.14.zip", + "reference": "2.4.14", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "time": "2012-11-29 21:23:47", + "bin": [ + "bin/phing" + ], + "type": "library", + "autoload": { + "classmap": [ + "classes/phing/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "classes" + ], + "license": [ + "LGPL3" + ], + "authors": [ + { + "name": "Michiel Rook", + "email": "mrook@php.net" + }, + { + "name": "Phing Community", + "homepage": "http://www.phing.info/trac/wiki/Development/Contributors" + } + ], + "description": "PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.", + "homepage": "http://www.phing.info/", + "keywords": [ + "build", + "task", + "tool" + ] + }, + { + "name": "propel/propel1", + "version": "1.6.7", + "source": { + "type": "git", + "url": "https://github.com/propelorm/Propel", + "reference": "1.6.7" + }, + "dist": { + "type": "zip", + "url": "https://github.com/propelorm/Propel/zipball/1.6.7", + "reference": "1.6.7", + "shasum": "" + }, + "require": { + "php": ">=5.2.4", + "phing/phing": ">=2.4.12,2.4.*" + }, + "time": "2012-07-30 00:58:15", + "bin": [ + "generator/bin/propel-gen", + "generator/bin/propel-gen.bat" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "classmap": [ + "runtime/lib", + "generator/lib" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "runtime/lib", + "generator/lib" + ], + "license": [ + "MIT" + ], + "authors": [ + { + "name": "William Durand", + "email": "william.durand1@gmail.com", + "homepage": "http://www.willdurand.fr" + } + ], + "description": "Propel is an open-source Object-Relational Mapping (ORM) for PHP5.", + "homepage": "http://www.propelorm.org/", + "keywords": [ + "database", + "orm", + "persistence", + "Active Record", + "mapping" + ] + }, { "name": "symfony-cmf/routing", "version": "dev-master", @@ -28,7 +140,6 @@ "dev-master": "1.0-dev" } }, - "installation-source": "source", "autoload": { "psr-0": { "Symfony\\Cmf\\Component\\Routing": "" @@ -52,17 +163,17 @@ }, { "name": "symfony/class-loader", - "version": "v2.1.4", + "version": "v2.1.6", "target-dir": "Symfony/Component/ClassLoader", "source": { "type": "git", "url": "https://github.com/symfony/ClassLoader", - "reference": "v2.1.4" + "reference": "v2.1.6" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/ClassLoader/archive/v2.1.4.zip", - "reference": "v2.1.4", + "url": "https://github.com/symfony/ClassLoader/archive/v2.1.6.zip", + "reference": "v2.1.6", "shasum": "" }, "require": { @@ -71,19 +182,14 @@ "require-dev": { "symfony/finder": "2.1.*" }, - "time": "2012-11-08 09:51:48", + "time": "2012-12-06 10:00:55", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "dist", "autoload": { "psr-0": { "Symfony\\Component\\ClassLoader": "" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -102,35 +208,30 @@ }, { "name": "symfony/config", - "version": "v2.1.4", + "version": "v2.1.6", "target-dir": "Symfony/Component/Config", "source": { "type": "git", "url": "https://github.com/symfony/Config", - "reference": "v2.1.4" + "reference": "v2.1.6" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/Config/archive/v2.1.4.zip", - "reference": "v2.1.4", + "url": "https://github.com/symfony/Config/archive/v2.1.6.zip", + "reference": "v2.1.6", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "time": "2012-11-08 09:51:48", + "time": "2012-12-11 10:40:22", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "dist", "autoload": { "psr-0": { "Symfony\\Component\\Config": "" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -149,35 +250,30 @@ }, { "name": "symfony/console", - "version": "v2.1.4", + "version": "v2.1.6", "target-dir": "Symfony/Component/Console", "source": { "type": "git", "url": "https://github.com/symfony/Console", - "reference": "v2.1.4" + "reference": "v2.1.6" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/Console/archive/v2.1.4.zip", - "reference": "v2.1.4", + "url": "https://github.com/symfony/Console/archive/v2.1.6.zip", + "reference": "v2.1.6", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "time": "2012-11-09 08:52:51", + "time": "2012-12-13 17:42:00", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "dist", "autoload": { "psr-0": { "Symfony\\Component\\Console": "" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -196,17 +292,17 @@ }, { "name": "symfony/dependency-injection", - "version": "v2.1.4", + "version": "v2.1.6", "target-dir": "Symfony/Component/DependencyInjection", "source": { "type": "git", "url": "https://github.com/symfony/DependencyInjection", - "reference": "v2.1.4" + "reference": "v2.1.6" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/DependencyInjection/archive/v2.1.4.zip", - "reference": "v2.1.4", + "url": "https://github.com/symfony/DependencyInjection/archive/v2.1.6.zip", + "reference": "v2.1.6", "shasum": "" }, "require": { @@ -220,19 +316,14 @@ "symfony/yaml": "2.1.*", "symfony/config": "2.1.*" }, - "time": "2012-11-11 11:59:36", + "time": "2012-12-06 10:00:55", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "dist", "autoload": { "psr-0": { "Symfony\\Component\\DependencyInjection": "" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -251,17 +342,17 @@ }, { "name": "symfony/event-dispatcher", - "version": "v2.1.4", + "version": "v2.1.6", "target-dir": "Symfony/Component/EventDispatcher", "source": { "type": "git", "url": "https://github.com/symfony/EventDispatcher", - "reference": "v2.1.4" + "reference": "v2.1.6" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/EventDispatcher/archive/v2.1.4.zip", - "reference": "v2.1.4", + "url": "https://github.com/symfony/EventDispatcher/archive/v2.1.6.zip", + "reference": "v2.1.6", "shasum": "" }, "require": { @@ -274,19 +365,14 @@ "symfony/dependency-injection": "2.1.*", "symfony/http-kernel": "2.1.*" }, - "time": "2012-11-08 09:51:48", + "time": "2012-12-06 10:00:55", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "dist", "autoload": { "psr-0": { "Symfony\\Component\\EventDispatcher": "" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -305,36 +391,31 @@ }, { "name": "symfony/http-foundation", - "version": "v2.1.4", + "version": "v2.1.6", "target-dir": "Symfony/Component/HttpFoundation", "source": { "type": "git", "url": "https://github.com/symfony/HttpFoundation", - "reference": "v2.1.4" + "reference": "v2.1.6" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/HttpFoundation/archive/v2.1.4.zip", - "reference": "v2.1.4", + "url": "https://github.com/symfony/HttpFoundation/archive/v2.1.6.zip", + "reference": "v2.1.6", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "time": "2012-11-30 12:53:14", + "time": "2012-12-14 21:03:29", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "dist", "autoload": { "psr-0": { "Symfony\\Component\\HttpFoundation": "", "SessionHandlerInterface": "Symfony/Component/HttpFoundation/Resources/stubs" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -353,17 +434,17 @@ }, { "name": "symfony/http-kernel", - "version": "v2.1.4", + "version": "v2.1.7", "target-dir": "Symfony/Component/HttpKernel", "source": { "type": "git", "url": "https://github.com/symfony/HttpKernel", - "reference": "v2.1.4" + "reference": "v2.1.7" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/HttpKernel/archive/v2.1.4.zip", - "reference": "v2.1.4", + "url": "https://github.com/symfony/HttpKernel/archive/v2.1.7.zip", + "reference": "v2.1.7", "shasum": "" }, "require": { @@ -389,19 +470,14 @@ "symfony/dependency-injection": "2.1.*", "symfony/finder": "2.1.*" }, - "time": "2012-11-29 11:56:19", + "time": "2012-12-21 10:24:53", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "dist", "autoload": { "psr-0": { "Symfony\\Component\\HttpKernel": "" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -420,17 +496,17 @@ }, { "name": "symfony/routing", - "version": "v2.1.4", + "version": "v2.1.6", "target-dir": "Symfony/Component/Routing", "source": { "type": "git", "url": "https://github.com/symfony/Routing", - "reference": "v2.1.4" + "reference": "v2.1.6" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/Routing/archive/v2.1.4.zip", - "reference": "v2.1.4", + "url": "https://github.com/symfony/Routing/archive/v2.1.6.zip", + "reference": "v2.1.6", "shasum": "" }, "require": { @@ -447,19 +523,14 @@ "symfony/yaml": "2.1.*", "doctrine/common": ">=2.2,<2.4-dev" }, - "time": "2012-11-19 10:35:29", + "time": "2012-12-11 10:40:22", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "installation-source": "dist", "autoload": { "psr-0": { "Symfony\\Component\\Routing": "" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -475,40 +546,6 @@ ], "description": "Symfony Routing Component", "homepage": "http://symfony.com" - }, - { - "name": "vrana/notorm", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/vrana/notorm.git", - "reference": "80131ce82afb8c1ea50868374b8ec8996b770fe3" - }, - "dist": { - "type": "zip", - "url": "https://github.com/vrana/notorm/archive/80131ce82afb8c1ea50868374b8ec8996b770fe3.zip", - "reference": "80131ce82afb8c1ea50868374b8ec8996b770fe3", - "shasum": "" - }, - "time": "2012-09-15 17:29:05", - "type": "library", - "installation-source": "source", - "license": [ - "Apache-2.0", - "GPL-2.0+" - ], - "authors": [ - { - "name": "Jakub Vrána", - "homepage": "http://www.vrana.cz/" - } - ], - "description": "NotORM is a PHP library for simple working with data in the database.", - "homepage": "http://www.notorm.com/", - "keywords": [ - "database", - "dbal" - ] } ], "packages-dev": null, @@ -517,7 +554,6 @@ ], "minimum-stability": "stable", "stability-flags": { - "symfony-cmf/routing": 20, - "vrana/notorm": 20 + "symfony-cmf/routing": 20 } } diff --git a/core/lib/Thelia/Core/Bundle/LoggerBundle.php b/core/lib/Thelia/Core/Bundle/LoggerBundle.php deleted file mode 100644 index 9e9a0015b..000000000 --- a/core/lib/Thelia/Core/Bundle/LoggerBundle.php +++ /dev/null @@ -1,81 +0,0 @@ -. */ -/* */ -/*************************************************************************************/ -namespace Thelia\Core\Bundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * First Bundle use in Thelia - * It initialize dependency injection container. - * - * @TODO load configuration from thelia plugin - * @TODO register database configuration. - * - * - * @author Manuel Raynaud - */ - -class LoggerBundle extends Bundle -{ - /** - * - * Construct the depency injection builder - * - * Reference all Model in the Container here - * - * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container - */ - - public function build(ContainerBuilder $container) - { - $container->setParameter("logger.class", "\Thelia\Log\Tlog"); - $container->register("logger","%logger.class%") - ->addArgument(new Reference('service_container')); - - $kernel = $container->get('kernel'); - - if ($kernel->isDebug()) { -// $debug = function ($query, $parameters) -// { -// -// $pattern = '(^' . preg_quote(dirname(__FILE__)) . '(\\.php$|[/\\\\]))'; // can be static -// foreach (debug_backtrace() as $backtrace) { -// if (isset($backtrace["file"]) && !preg_match($pattern, $backtrace["file"])) { // stop on first file outside NotORM source codes -// break; -// } -// } -// file_put_contents(THELIA_ROOT . 'log/request_debug.log', "$backtrace[file]:$backtrace[line]:$query", FILE_APPEND); -// file_put_contents(THELIA_ROOT . 'log/request_debug.log', is_scalar($parameters) ? $parameters : print_r($parameters, true), FILE_APPEND); -// -// }; -// -// $container->getDefinition('database') -// ->addMethodCall('setDebug', array($debug)); - - $container->get('database') - ->setLogger($container->get('logger')); - } - } -} diff --git a/core/lib/Thelia/Core/Bundle/ModelBundle.php b/core/lib/Thelia/Core/Bundle/ModelBundle.php deleted file mode 100644 index ef72a2e57..000000000 --- a/core/lib/Thelia/Core/Bundle/ModelBundle.php +++ /dev/null @@ -1,60 +0,0 @@ -. */ -/* */ -/*************************************************************************************/ -namespace Thelia\Core\Bundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; -use Thelia\Tools\DIGenerator; - -/** - * First Bundle use in Thelia - * It initialize dependency injection container. - * - * @TODO load configuration from thelia plugin - * @TODO register database configuration. - * - * - * @author Manuel Raynaud - */ - -class ModelBundle extends Bundle -{ - /** - * - * Construct the depency injection builder - * - * Reference all Model in the Container here - * - * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container - */ - - public function build(ContainerBuilder $container) - { - foreach (DIGenerator::genDiModel(realpath(THELIA_ROOT . "core/lib/Thelia/Model"), array('Base')) as $name => $class) { - $container->register('model.'.$name, $class) - ->addArgument(new Reference("database")) - ->addArgument(new Reference('service_container')); - } - } -} diff --git a/core/lib/Thelia/Core/Bundle/NotORMBundle.php b/core/lib/Thelia/Core/Bundle/NotORMBundle.php deleted file mode 100644 index c8ed30143..000000000 --- a/core/lib/Thelia/Core/Bundle/NotORMBundle.php +++ /dev/null @@ -1,98 +0,0 @@ -. */ -/* */ -/*************************************************************************************/ -namespace Thelia\Core\Bundle; - -use Symfony\Component\HttpKernel\Bundle\Bundle; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * First Bundle use in Thelia - * It initialize dependency injection container. - * - * @TODO load configuration from thelia plugin - * @TODO register database configuration. - * - * - * @author Manuel Raynaud - */ - -class NotORMBundle extends Bundle -{ - /** - * - * Construct the depency injection builder - * - * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container - */ - - public function build(ContainerBuilder $container) - { - $config = array( - \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION - ); - - $kernel = $container->get('kernel'); - - $pdo = new \PDO(THELIA_DB_DSN,THELIA_DB_USER, THELIA_DB_PASSWORD, $config); - - $pdo->exec("SET NAMES UTF8"); - - $container->register('database','\Thelia\Database\NotORM') - ->addArgument($pdo); - - if (defined('THELIA_DB_CACHE') && !$kernel->isDebug()) { - switch (THELIA_DB_CACHE) { - case 'file': - $container->register('database_cache','\NotORM_Cache_File') - ->addArgument($kernel->getCacheDir().'/database.php'); - break; - case 'include': - $container->register('database_cache','\NotORM_Cache_Include') - ->addArgument($kernel->getCacheDir().'/database_include.php'); - break; - case 'apc': - if (extension_loaded('apc')) { - $container->register('database_cache','\NotORM_Cache_APC'); - } - break; - case 'session': - $container->register('database_cache','\NotORM_Cache_Session'); - break; - case 'memcache': - if (class_exists('Memcache')) { - $container->register('database_cache','\NotORM_Cache_Memcache') - ->addArgument(new \Memcache()); - } - break; - - } - - if ($container->hasDefinition('database_cache')) { - $container->getDefinition('database') - ->addMethodCall('setCache', array(new Reference('database_cache'))); - } - } - - } -} diff --git a/core/lib/Thelia/Core/Thelia.php b/core/lib/Thelia/Core/Thelia.php index e611ebafe..04779e0ae 100644 --- a/core/lib/Thelia/Core/Thelia.php +++ b/core/lib/Thelia/Core/Thelia.php @@ -116,9 +116,6 @@ class Thelia extends Kernel $bundles = array( /* TheliaBundle contain all the dependency injection description */ new Bundle\TheliaBundle(), - new Bundle\NotORMBundle(), - new Bundle\ModelBundle(), - new Bundle\LoggerBundle() ); /**