Adding Doctrine ORM in global.inc

1.10.x
Julio Montoya 11 years ago
parent 512c20a427
commit d451c63629
  1. 8
      composer.json
  2. 883
      composer.lock
  3. 69
      main/inc/global.inc.php
  4. 140
      main/inc/lib/database.lib.php

@ -10,7 +10,7 @@
},
"autoload": {
"psr-0": {
"": "src/"
"Chamilo": "src/"
},
"classmap": [
"main/auth",
@ -47,7 +47,11 @@
"mpdf/mpdf": "5.7.4",
"barryvdh/elfinder-builds": "2.1.0.3",
"jbroadway/urlify": "1.0.3-stable",
"monolog/monolog": "~1.0"
"monolog/monolog": "~1.0",
"doctrine/orm": "~2.2,>=2.2.3,<2.5",
"symfony/doctrine-bridge": "2.6.4",
"symfony/validator": "2.6.4",
"gedmo/doctrine-extensions": "~2.3"
},
"extra": {
"branch-alias": {

883
composer.lock generated

@ -4,7 +4,7 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "ec96dd7b7109d48fbc04bfbe970a455e",
"hash": "2147ab04df61e658b40678d09ffd7db6",
"packages": [
{
"name": "aferrandini/phpqrcode",
@ -164,81 +164,604 @@
"homepage": "http://elfinder.org",
"time": "2015-02-11 11:10:51"
},
{
"name": "behat/transliterator",
"version": "v1.0.1",
"source": {
"type": "git",
"url": "https://github.com/Behat/Transliterator.git",
"reference": "c93521d3462a554332d1ef5bb0e9b5b8ca4106c4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Behat/Transliterator/zipball/c93521d3462a554332d1ef5bb0e9b5b8ca4106c4",
"reference": "c93521d3462a554332d1ef5bb0e9b5b8ca4106c4",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"psr-0": {
"Behat\\Transliterator": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Artistic-1.0"
],
"description": "String transliterator",
"keywords": [
"i18n",
"slug",
"transliterator"
],
"time": "2014-05-15 22:08:22"
},
{
"name": "ckeditor/ckeditor",
"version": "4.4.7",
"source": {
"type": "git",
"url": "https://github.com/ckeditor/ckeditor-releases.git",
"reference": "cc324415302784eb1abe33a3762fbdd3b48c558b"
"url": "https://github.com/ckeditor/ckeditor-releases.git",
"reference": "cc324415302784eb1abe33a3762fbdd3b48c558b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ckeditor/ckeditor-releases/zipball/cc324415302784eb1abe33a3762fbdd3b48c558b",
"reference": "cc324415302784eb1abe33a3762fbdd3b48c558b",
"shasum": ""
},
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0+",
"LGPL-2.1+",
"MPL-1.1+"
],
"authors": [
{
"name": "CKSource",
"homepage": "http://cksource.com"
}
],
"description": "JavaScript WYSIWYG web text editor.",
"homepage": "http://ckeditor.com",
"keywords": [
"CKEditor",
"editor",
"fckeditor",
"html",
"javascript",
"richtext",
"text",
"wysiwyg"
],
"time": "2015-01-27 15:13:53"
},
{
"name": "doctrine/annotations",
"version": "v1.2.3",
"source": {
"type": "git",
"url": "https://github.com/doctrine/annotations.git",
"reference": "eeda578cbe24a170331a1cfdf78be723412df7a4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/annotations/zipball/eeda578cbe24a170331a1cfdf78be723412df7a4",
"reference": "eeda578cbe24a170331a1cfdf78be723412df7a4",
"shasum": ""
},
"require": {
"doctrine/lexer": "1.*",
"php": ">=5.3.2"
},
"require-dev": {
"doctrine/cache": "1.*",
"phpunit/phpunit": "4.*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Annotations\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Docblock Annotations Parser",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"annotations",
"docblock",
"parser"
],
"time": "2014-12-20 20:49:38"
},
{
"name": "doctrine/cache",
"version": "v1.4.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/cache.git",
"reference": "2346085d2b027b233ae1d5de59b07440b9f288c8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/cache/zipball/2346085d2b027b233ae1d5de59b07440b9f288c8",
"reference": "2346085d2b027b233ae1d5de59b07440b9f288c8",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"conflict": {
"doctrine/common": ">2.2,<2.4"
},
"require-dev": {
"phpunit/phpunit": ">=3.7",
"predis/predis": "~0.8",
"satooshi/php-coveralls": "~0.6"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Cache\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Caching library offering an object-oriented API for many cache backends",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"cache",
"caching"
],
"time": "2015-01-15 20:38:55"
},
{
"name": "doctrine/collections",
"version": "v1.2",
"source": {
"type": "git",
"url": "https://github.com/doctrine/collections.git",
"reference": "b99c5c46c87126201899afe88ec490a25eedd6a2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/collections/zipball/b99c5c46c87126201899afe88ec490a25eedd6a2",
"reference": "b99c5c46c87126201899afe88ec490a25eedd6a2",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Collections\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com",
"homepage": "http://www.jwage.com/",
"role": "Creator"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com",
"homepage": "http://www.instaclick.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
"description": "Collections Abstraction library",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"array",
"collections",
"iterator"
],
"time": "2014-02-03 23:07:43"
},
{
"name": "doctrine/common",
"version": "v2.4.2",
"source": {
"type": "git",
"url": "https://github.com/doctrine/common.git",
"reference": "5db6ab40e4c531f14dad4ca96a394dfce5d4255b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/common/zipball/5db6ab40e4c531f14dad4ca96a394dfce5d4255b",
"reference": "5db6ab40e4c531f14dad4ca96a394dfce5d4255b",
"shasum": ""
},
"require": {
"doctrine/annotations": "1.*",
"doctrine/cache": "1.*",
"doctrine/collections": "1.*",
"doctrine/inflector": "1.*",
"doctrine/lexer": "1.*",
"php": ">=5.3.2"
},
"require-dev": {
"phpunit/phpunit": "~3.7"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.4.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com",
"homepage": "http://www.jwage.com/",
"role": "Creator"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com",
"homepage": "http://www.instaclick.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
"description": "Common Library for Doctrine projects",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"annotations",
"collections",
"eventmanager",
"persistence",
"spl"
],
"time": "2014-05-21 19:28:51"
},
{
"name": "doctrine/dbal",
"version": "v2.5.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
"reference": "628c2256b646ae2417d44e063bce8aec5199d48d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/628c2256b646ae2417d44e063bce8aec5199d48d",
"reference": "628c2256b646ae2417d44e063bce8aec5199d48d",
"shasum": ""
},
"require": {
"doctrine/common": ">=2.4,<2.6-dev",
"php": ">=5.3.2"
},
"require-dev": {
"phpunit/phpunit": "4.*",
"symfony/console": "2.*"
},
"suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files."
},
"bin": [
"bin/doctrine-dbal"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.5.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\DBAL\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
}
],
"description": "Database Abstraction Layer",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"database",
"dbal",
"persistence",
"queryobject"
],
"time": "2015-01-12 21:52:47"
},
{
"name": "doctrine/inflector",
"version": "v1.0.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/inflector.git",
"reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/inflector/zipball/0bcb2e79d8571787f18b7eb036ed3d004908e604",
"reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"require-dev": {
"phpunit/phpunit": "4.*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Inflector\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Common String Manipulations with regard to casing and singular/plural rules.",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"inflection",
"pluralize",
"singularize",
"string"
],
"time": "2014-12-20 21:24:13"
},
{
"name": "doctrine/lexer",
"version": "v1.0.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/lexer.git",
"reference": "83893c552fd2045dd78aef794c31e694c37c0b8c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ckeditor/ckeditor-releases/zipball/cc324415302784eb1abe33a3762fbdd3b48c558b",
"reference": "cc324415302784eb1abe33a3762fbdd3b48c558b",
"url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c",
"reference": "83893c552fd2045dd78aef794c31e694c37c0b8c",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Lexer\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0+",
"LGPL-2.1+",
"MPL-1.1+"
"MIT"
],
"authors": [
{
"name": "CKSource",
"homepage": "http://cksource.com"
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "JavaScript WYSIWYG web text editor.",
"homepage": "http://ckeditor.com",
"description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"CKEditor",
"editor",
"fckeditor",
"html",
"javascript",
"richtext",
"text",
"wysiwyg"
"lexer",
"parser"
],
"time": "2015-01-27 15:13:53"
"time": "2014-09-09 13:34:57"
},
{
"name": "doctrine/cache",
"version": "v1.4.0",
"name": "doctrine/orm",
"version": "v2.4.7",
"source": {
"type": "git",
"url": "https://github.com/doctrine/cache.git",
"reference": "2346085d2b027b233ae1d5de59b07440b9f288c8"
"url": "https://github.com/doctrine/doctrine2.git",
"reference": "2bc4ff3cab2ae297bcd05f2e619d42e6a7ca9e68"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/cache/zipball/2346085d2b027b233ae1d5de59b07440b9f288c8",
"reference": "2346085d2b027b233ae1d5de59b07440b9f288c8",
"url": "https://api.github.com/repos/doctrine/doctrine2/zipball/2bc4ff3cab2ae297bcd05f2e619d42e6a7ca9e68",
"reference": "2bc4ff3cab2ae297bcd05f2e619d42e6a7ca9e68",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"conflict": {
"doctrine/common": ">2.2,<2.4"
"doctrine/collections": "~1.1",
"doctrine/dbal": "~2.4",
"ext-pdo": "*",
"php": ">=5.3.2",
"symfony/console": "~2.0"
},
"require-dev": {
"phpunit/phpunit": ">=3.7",
"predis/predis": "~0.8",
"satooshi/php-coveralls": "~0.6"
"satooshi/php-coveralls": "dev-master",
"symfony/yaml": "~2.1"
},
"suggest": {
"symfony/yaml": "If you want to use YAML Metadata Mapping Driver"
},
"bin": [
"bin/doctrine",
"bin/doctrine.php"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4.x-dev"
"dev-master": "2.4.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Cache\\": "lib/"
"Doctrine\\ORM\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
@ -261,19 +784,15 @@
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Caching library offering an object-oriented API for many cache backends",
"description": "Object-Relational-Mapper for PHP",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"cache",
"caching"
"database",
"orm"
],
"time": "2015-01-15 20:38:55"
"time": "2014-12-16 13:45:01"
},
{
"name": "emojione/emojione",
@ -397,6 +916,84 @@
],
"time": "2013-11-30 08:25:19"
},
{
"name": "gedmo/doctrine-extensions",
"version": "v2.3.12",
"source": {
"type": "git",
"url": "https://github.com/Atlantic18/DoctrineExtensions.git",
"reference": "c3ff3c73c95b01e107af33d4fe3abf80794e2df9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Atlantic18/DoctrineExtensions/zipball/c3ff3c73c95b01e107af33d4fe3abf80794e2df9",
"reference": "c3ff3c73c95b01e107af33d4fe3abf80794e2df9",
"shasum": ""
},
"require": {
"behat/transliterator": "~1.0",
"doctrine/common": "~2.4",
"php": ">=5.3.2"
},
"require-dev": {
"doctrine/mongodb-odm": ">=1.0.0-BETA11",
"doctrine/orm": "~2.4",
"phpunit/phpunit": "~4.4",
"phpunit/phpunit-mock-objects": "~2.3",
"symfony/yaml": "~2.3"
},
"suggest": {
"doctrine/mongodb-odm": "to use the extensions with the MongoDB ODM",
"doctrine/orm": "to use the extensions with the ORM"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.3.x-dev"
}
},
"autoload": {
"psr-0": {
"Gedmo\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "David Buchmann",
"email": "david@liip.ch"
},
{
"name": "Gediminas Morkevicius",
"email": "gediminas.morkevicius@gmail.com"
},
{
"name": "Gustavo Falco",
"email": "comfortablynumb84@gmail.com"
}
],
"description": "Doctrine2 behavioral extensions",
"homepage": "http://gediminasm.org/",
"keywords": [
"Blameable",
"behaviors",
"doctrine2",
"extensions",
"gedmo",
"loggable",
"nestedset",
"sluggable",
"sortable",
"timestampable",
"translatable",
"tree",
"uploadable"
],
"time": "2015-02-24 21:41:37"
},
{
"name": "jbroadway/urlify",
"version": "1.0.3-stable",
@ -888,6 +1485,75 @@
"homepage": "http://symfony.com",
"time": "2015-01-25 04:39:26"
},
{
"name": "symfony/doctrine-bridge",
"version": "v2.6.4",
"target-dir": "Symfony/Bridge/Doctrine",
"source": {
"type": "git",
"url": "https://github.com/symfony/DoctrineBridge.git",
"reference": "5c2d4a9c8f149bcbd560304d74a504f6d4ed6e5d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/DoctrineBridge/zipball/5c2d4a9c8f149bcbd560304d74a504f6d4ed6e5d",
"reference": "5c2d4a9c8f149bcbd560304d74a504f6d4ed6e5d",
"shasum": ""
},
"require": {
"doctrine/common": "~2.3",
"php": ">=5.3.3"
},
"require-dev": {
"doctrine/data-fixtures": "1.0.*",
"doctrine/dbal": "~2.2",
"doctrine/orm": "~2.2,>=2.2.3",
"symfony/dependency-injection": "~2.2",
"symfony/expression-language": "~2.2",
"symfony/form": "~2.3,>=2.3.8",
"symfony/http-kernel": "~2.2",
"symfony/property-access": "~2.3",
"symfony/security": "~2.2",
"symfony/stopwatch": "~2.2",
"symfony/translation": "~2.0,>=2.0.5",
"symfony/validator": "~2.5,>=2.5.5"
},
"suggest": {
"doctrine/data-fixtures": "",
"doctrine/dbal": "",
"doctrine/orm": "",
"symfony/form": "",
"symfony/validator": ""
},
"type": "symfony-bridge",
"extra": {
"branch-alias": {
"dev-master": "2.6-dev"
}
},
"autoload": {
"psr-0": {
"Symfony\\Bridge\\Doctrine\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "Symfony Doctrine Bridge",
"homepage": "http://symfony.com",
"time": "2015-02-01 16:10:57"
},
{
"name": "symfony/filesystem",
"version": "v2.6.4",
@ -982,6 +1648,135 @@
"homepage": "http://symfony.com",
"time": "2015-01-25 04:39:26"
},
{
"name": "symfony/translation",
"version": "v2.6.4",
"target-dir": "Symfony/Component/Translation",
"source": {
"type": "git",
"url": "https://github.com/symfony/Translation.git",
"reference": "f289cdf8179d32058c1e1cbac723106a5ff6fa39"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Translation/zipball/f289cdf8179d32058c1e1cbac723106a5ff6fa39",
"reference": "f289cdf8179d32058c1e1cbac723106a5ff6fa39",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~2.3,>=2.3.12",
"symfony/intl": "~2.3",
"symfony/yaml": "~2.2"
},
"suggest": {
"psr/log": "To use logging capability in translator",
"symfony/config": "",
"symfony/yaml": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.6-dev"
}
},
"autoload": {
"psr-0": {
"Symfony\\Component\\Translation\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "Symfony Translation Component",
"homepage": "http://symfony.com",
"time": "2015-01-03 15:33:07"
},
{
"name": "symfony/validator",
"version": "v2.6.4",
"target-dir": "Symfony/Component/Validator",
"source": {
"type": "git",
"url": "https://github.com/symfony/Validator.git",
"reference": "1906eb78a5049b41a80094c20faf66dfbaaf2049"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Validator/zipball/1906eb78a5049b41a80094c20faf66dfbaaf2049",
"reference": "1906eb78a5049b41a80094c20faf66dfbaaf2049",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"symfony/translation": "~2.0,>=2.0.5"
},
"require-dev": {
"doctrine/annotations": "~1.0",
"doctrine/cache": "~1.0",
"doctrine/common": "~2.3",
"egulias/email-validator": "~1.2,>=1.2.1",
"symfony/config": "~2.2",
"symfony/expression-language": "~2.4",
"symfony/http-foundation": "~2.1",
"symfony/intl": "~2.3",
"symfony/property-access": "~2.3",
"symfony/yaml": "~2.0,>=2.0.5"
},
"suggest": {
"doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.",
"doctrine/cache": "For using the default cached annotation reader and metadata cache.",
"egulias/email-validator": "Strict (RFC compliant) email validation",
"symfony/config": "",
"symfony/expression-language": "For using the 2.4 Expression validator",
"symfony/http-foundation": "",
"symfony/intl": "",
"symfony/property-access": "For using the 2.4 Validator API",
"symfony/yaml": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.6-dev"
}
},
"autoload": {
"psr-0": {
"Symfony\\Component\\Validator\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "Symfony Validator Component",
"homepage": "http://symfony.com",
"time": "2015-02-01 16:10:57"
},
{
"name": "symfony/yaml",
"version": "v2.6.4",

@ -150,6 +150,75 @@ if (!$_configuration['db_host']) {
die();
}
// Doctrine ORM configuration
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
$paths = array(
api_get_path(SYS_PATH).'src/Chamilo/CoreBundle/Entity',
api_get_path(SYS_PATH).'src/Chamilo/UserBundle/Entity',
api_get_path(SYS_PATH).'src/Chamilo/CourseBundle/Entity'
);
$isDevMode = true;
// the connection configuration
$dbParams = array(
'driver' => 'pdo_mysql',
'host' => $_configuration['db_host'],
'user' => $_configuration['db_user'],
'password' => $_configuration['db_password'],
'dbname' => $_configuration['main_database'],
);
$isSimpleMode = false;
$proxyDir = null;
$cache = null;
$config = Setup::createAnnotationMetadataConfiguration(
$paths,
$isDevMode,
$proxyDir,
$cache,
$isSimpleMode
);
$config->setEntityNamespaces(
array(
'ChamiloUserBundle' => 'Chamilo\UserBundle\Entity',
'ChamiloCoreBundle' => 'Chamilo\CoreBundle\Entity',
'ChamiloCourseBundle' => 'Chamilo\CourseBundle\Entity'
)
);
$entityManager = EntityManager::create($dbParams, $config);
use Doctrine\Common\Annotations\AnnotationRegistry;
AnnotationRegistry::registerAutoloadNamespace(
'Symfony\Component\Validator\Constraint',
api_get_path(SYS_PATH)."vendor/symfony/validator"
);
AnnotationRegistry::registerFile(
api_get_path(SYS_PATH)."vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntity.php"
);
AnnotationRegistry::registerAutoloadNamespace(
'Gedmo\Mapping\Annotation',
api_get_path(SYS_PATH)."vendor/gedmo/doctrine-extensions/lib"
);
/*$repo = $entityManager->getRepository('ChamiloCoreBundle:Session');
$repo = $entityManager->getRepository('ChamiloUserBundle:User');
$repo = $entityManager->getRepository('ChamiloCoreBundle:Course');*/
$database = new \Database();
$database->setManager($entityManager);
/* RETRIEVING ALL THE CHAMILO CONFIG SETTINGS FOR MULTIPLE URLs FEATURE*/
if (!empty($_configuration['multiple_access_urls'])) {
$_configuration['access_url'] = 1;

@ -1,6 +1,10 @@
<?php
/* For licensing terms, see /license.txt */
use Doctrine\DBAL\Connection;
use Doctrine\ORM\EntityManager;
use Doctrine\DBAL\Driver\Statement;
/**
* Class Database
* This is the main database library for Chamilo.
@ -17,30 +21,38 @@
*/
class Database
{
/* Variable use only in the installation process to log errors. See the Database::query function */
/* Variable use only in the installation process to log errors.
See the Database::query function */
static $log_queries = false;
/*
Accessor methods
Usually, you won't need these directly but instead
rely on of the get_xxx_table methods.
*/
/**
* Returns the name of the main database.
* @var EntityManager
*/
public static function get_main_database()
private static $em;
/**
* @param EntityManager $em
*/
public function setManager($em)
{
global $_configuration;
return $_configuration['main_database'];
self::$em = $em;
}
/**
* Returns the name of the statistics database.
* @todo use main_database
* @return EntityManager
*/
public static function get_statistic_database()
public static function getManager()
{
return self::get_main_database();
return self::$em;
}
/**
* Returns the name of the main database.
*/
public static function get_main_database()
{
global $_configuration;
return $_configuration['main_database'];
}
/**
@ -173,37 +185,6 @@ class Database
//return self::format_glued_course_table_name(self::fix_database_parameter($database_name), $short_table_name);
}
/**
* This generic method returns the correct and complete name of any
* statistic table of which you pass the short name as a parameter.
* Please, define table names as constants in this library and use them
* instead of directly using magic words in your tool code.
* @deprecated use get_main_table
* @param string $short_table_name, the name of the table
*/
public static function get_statistic_table($short_table_name)
{
return self::get_main_table($short_table_name);
}
/**
* This generic method returns the correct and complete name of any user
* table of which you pass the short name as a parameter. Please, define
* table names as constants in this library and use them instead of directly
* using magic words in your tool code.
*
* @param string $short_table_name, the name of the table
*/
public static function get_user_personal_table($short_table_name)
{
return self::get_main_table($short_table_name);
}
public static function get_course_chat_connected_table($database_name = '')
{
return self::format_glued_course_table_name(self::fix_database_parameter($database_name), TABLE_CHAT_CONNECTED);
}
/*
Query methods
These methods execute a query and return the result(s).
@ -219,21 +200,6 @@ class Database
return self::store_result(self::query("SELECT *, id as real_id FROM $table"));
}
/**
* Returns an array with all database fields for the specified course.
*
* @param string The real (system) course code (main course table ID)
* @todo shouldn't this be in the course.lib.php script?
*/
public static function get_course_info($course_code)
{
$course_code = self::escape_string($course_code);
$table = self::get_main_table(TABLE_MAIN_COURSE);
$result = self::generate_abstract_course_field_names(
self::fetch_array(self::query("SELECT *, id as real_id FROM $table WHERE code = '$course_code'")));
return $result === false ? array('db_name' => '') : $result;
}
/**
* Gets user details from the "user" table
* @param $user_id (integer): the id of the user
@ -269,60 +235,6 @@ class Database
return $info ? $info['course_code'] : false;
}
/**
* This method creates an abstraction layer between database field names
* and field names expected in code.
*
* This approach helps when changing database names.
* It's also useful now to get rid of the 'franglais'.
*
* @todo add more array entries to abstract course info from field names
* @author Roan Embrechts
*
* @todo What's the use of this method. I think this is better removed.
* There should be consistency in the variable names and the
* use throughout the scripts
* for the database name we should consistently use or db_name
* or database (db_name probably being the better one)
*/
public static function generate_abstract_course_field_names($result_array)
{
$visual_code = isset($result_array['visual_code']) ? $result_array['visual_code'] : null;
$code = isset($result_array['code']) ? $result_array['code'] : null;
$title = isset($result_array['title']) ? $result_array['title'] : null;
$db_name = isset($result_array['db_name']) ? $result_array['db_name'] : null;
$category_code = isset($result_array['category_code']) ? $result_array['category_code'] : null;
$result_array['official_code'] = $visual_code;
$result_array['visual_code'] = $visual_code;
$result_array['real_code'] = $code;
$result_array['system_code'] = $code;
$result_array['title'] = $title;
$result_array['database'] = $db_name;
$result_array['faculty'] = $category_code;
//$result_array['directory'] = $result_array['directory'];
/*
still to do: (info taken from local.inc.php)
$_course['id' ] = $cData['cours_id' ]; //auto-assigned integer
$_course['name' ] = $cData['title' ];
$_course['official_code'] = $cData['visual_code' ]; // use in echo
$_course['sysCode' ] = $cData['code' ]; // use as key in db
$_course['path' ] = $cData['directory' ]; // use as key in path
$_course['dbName' ] = $cData['db_name' ]; // use as key in db list
$_course['dbNameGlu' ] = $_configuration['table_prefix'] . $cData['dbName'] . $_configuration['db_glue']; // use in all queries
$_course['titular' ] = $cData['tutor_name' ];
$_course['language' ] = $cData['course_language' ];
$_course['extLink' ]['url' ] = $cData['department_url' ];
$_course['extLink' ]['name'] = $cData['department_name'];
$_course['categoryCode'] = $cData['faCode' ];
$_course['categoryName'] = $cData['faName' ];
$_course['visibility' ] = (bool) ($cData['visibility'] == 2 || $cData['visibility'] == 3);
$_course['registrationAllowed'] = (bool) ($cData['visibility'] == 1 || $cData['visibility'] == 2);
*/
return $result_array;
}
/**
* This method creates an abstraction layer between database field names
* and field names expected in code.

Loading…
Cancel
Save