remove notORM bundle
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
||||
288
core/composer.lock
generated
288
core/composer.lock
generated
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
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 <mraynaud@openstudio.fr>
|
||||
*/
|
||||
|
||||
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'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
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 <mraynaud@openstudio.fr>
|
||||
*/
|
||||
|
||||
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'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
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 <mraynaud@openstudio.fr>
|
||||
*/
|
||||
|
||||
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')));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user