add NotORM to composer and create classMap for autoloading

This commit is contained in:
Manuel Raynaud
2012-12-20 11:33:50 +01:00
parent ab179a637c
commit 0ed8c2dd00
6 changed files with 58 additions and 136 deletions

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@ local/config/build.properties
local/config/config_db.php
local/config/build
core/vendor
local/config/runtime-conf.xml

View File

@@ -28,4 +28,20 @@ if(file_exists(__DIR__ . '/vendor/composer/autoload_classmap.php'))
$loader->addClassMap($classMap);
}
$loader->addClassMap(array(
'NotORM' => THELIA_ROOT . '/core/vendor/vrana/notorm/NotORM.php',
'NotORM_Cache_Session' => THELIA_ROOT . '/core/vendor/vrana/notorm/NotORM/Cache.php',
'NotORM_Cache_File' => THELIA_ROOT . '/core/vendor/vrana/notorm/NotORM/Cache.php',
'NotORM_Cache_Include' => THELIA_ROOT . '/core/vendor/vrana/notorm/NotORM/Cache.php',
'NotORM_Cache_Database' => THELIA_ROOT . '/core/vendor/vrana/notorm/NotORM/Cache.php',
'NotORM_Cache_Memcache' => THELIA_ROOT . '/core/vendor/vrana/notorm/NotORM/Cache.php',
'NotORM_Cache_APC' => THELIA_ROOT . '/core/vendor/vrana/notorm/NotORM/Cache.php',
'NotORM_Literal' => THELIA_ROOT . '/core/vendor/vrana/notorm/NotORM/Literal.php',
'NotORM_MultiResult' => THELIA_ROOT . '/core/vendor/vrana/notorm/NotORM/MultiResult.php',
'NotORM_Result' => THELIA_ROOT . '/core/vendor/vrana/notorm/NotORM/Result.php',
'NotORM_Row' => THELIA_ROOT . '/core/vendor/vrana/notorm/NotORM/Row.php',
'NotORM_Structure_Convention' => THELIA_ROOT . '/core/vendor/vrana/notorm/NotORM/Structure.php',
'NotORM_Structure_Discovery' => THELIA_ROOT . '/core/vendor/vrana/notorm/NotORM/Structure.php',
));
$loader->register();

View File

@@ -9,10 +9,10 @@ if (!isset($env)) {
* @file
* Functions needed for Thelia bootstrap
*/
define('THELIA_ROOT', __DIR__ .'/../');
$loader = require __DIR__ . '/autoload.php';
define('THELIA_ROOT', __DIR__ .'/../');
if(file_exists(THELIA_ROOT . '/local/config/config_db.php'))
{

View File

@@ -7,8 +7,8 @@
"symfony/dependency-injection" : "2.1.*",
"symfony/console" : "2.1.*",
"symfony/event-dispatcher" : "2.1.*",
"propel/propel1" : "1.6.*",
"symfony-cmf/routing" : "1.0.*@dev"
"symfony-cmf/routing" : "1.0.*@dev",
"vrana/notorm": "dev-master"
},
"minimum-stability": "stable"
}

151
core/composer.lock generated
View File

@@ -1,118 +1,6 @@
{
"hash": "6753cff6ae4e98c641837505039c66fd",
"hash": "0f4d3d738985b803a4bf307ef2d7e85c",
"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",
"installation-source": "dist",
"autoload": {
"classmap": [
"classes/phing/"
]
},
"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"
}
},
"installation-source": "dist",
"autoload": {
"classmap": [
"runtime/lib",
"generator/lib"
]
},
"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",
@@ -587,6 +475,40 @@
],
"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,
@@ -595,6 +517,7 @@
],
"minimum-stability": "stable",
"stability-flags": {
"symfony-cmf/routing": 20
"symfony-cmf/routing": 20,
"vrana/notorm": 20
}
}

View File

@@ -1,18 +0,0 @@
<?php
if (is_file(__DIR__ . '/config_db.php')) {
require __DIR__ . '/config_db.php';
} else {
return false;
}
use Symfony\Component\DependencyInjection\ContainerBuilder;
$container = new ContainerBuilder();
$container->register('database','Thelia\\Database\\Connection');
$container->register('http_kernel','Symfony\\Component\\HttpKernel\\HttpKernel');
$container->register('session','Symfony\\Component\\HttpFoundation\\Session\\Session');
return $container;