diff --git a/composer.lock b/composer.lock index d01304acc4..02133475a8 100755 --- a/composer.lock +++ b/composer.lock @@ -7,12 +7,12 @@ "source": { "type": "git", "url": "https://github.com/chamilo/chash.git", - "reference": "b9f4f3b3ff7f04ce87df7bb9896f2b3aee710feb" + "reference": "0db81e2ad152355baca3d968f0af04cce147d510" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/chamilo/chash/zipball/b9f4f3b3ff7f04ce87df7bb9896f2b3aee710feb", - "reference": "b9f4f3b3ff7f04ce87df7bb9896f2b3aee710feb", + "url": "https://api.github.com/repos/chamilo/chash/zipball/0db81e2ad152355baca3d968f0af04cce147d510", + "reference": "0db81e2ad152355baca3d968f0af04cce147d510", "shasum": "" }, "require": { @@ -27,7 +27,7 @@ } }, "notification-url": "https://packagist.org/downloads/", - "time": "2013-03-27 13:08:43" + "time": "2013-03-28 10:43:52" }, { "name": "dflydev/doctrine-orm-service-provider", @@ -356,12 +356,12 @@ "source": { "type": "git", "url": "https://github.com/l3pp4rd/DoctrineExtensions.git", - "reference": "03799ebed1067cff5bb7fa60b711ce34f3bb689f" + "reference": "e96e48a988f7fffbe3cca4763df84f77ba79ddde" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/l3pp4rd/DoctrineExtensions/zipball/03799ebed1067cff5bb7fa60b711ce34f3bb689f", - "reference": "03799ebed1067cff5bb7fa60b711ce34f3bb689f", + "url": "https://api.github.com/repos/l3pp4rd/DoctrineExtensions/zipball/e96e48a988f7fffbe3cca4763df84f77ba79ddde", + "reference": "e96e48a988f7fffbe3cca4763df84f77ba79ddde", "shasum": "" }, "require": { @@ -427,7 +427,7 @@ "tree", "uploadable" ], - "time": "2013-03-26 20:33:31" + "time": "2013-03-27 16:49:35" }, { "name": "knplabs/knp-menu", diff --git a/main/inc/global.inc.php b/main/inc/global.inc.php index 46d59f3df2..c9bb85c7fb 100644 --- a/main/inc/global.inc.php +++ b/main/inc/global.inc.php @@ -242,6 +242,10 @@ $app['breadcrumb'] = array(); //Form provider $app->register(new Silex\Provider\FormServiceProvider()); + +//URL generator provider +$app->register(new Silex\Provider\UrlGeneratorServiceProvider()); + /* use Doctrine\Common\Persistence\AbstractManagerRegistry; @@ -320,8 +324,7 @@ $app['twig'] = $app->share( }) ); -//URL generator provider -$app->register(new Silex\Provider\UrlGeneratorServiceProvider()); + //Monolog and web profiler only available if cache is writable if (is_writable($app['cache.path'])) { diff --git a/src/ChamiloLMS/Controller/IndexController.php b/src/ChamiloLMS/Controller/IndexController.php index e737f25b78..4d7a36c59c 100644 --- a/src/ChamiloLMS/Controller/IndexController.php +++ b/src/ChamiloLMS/Controller/IndexController.php @@ -31,7 +31,7 @@ class IndexController// extends Controller { $this->logout(); - return $app->redirect($app['url_generator']->generator('index')); + return $app->redirect($app['url_generator']->generate('index')); } /** @@ -112,8 +112,6 @@ class IndexController// extends Controller facebook_connect(); } - //$app['url_generator']->generator('index'); - $this->setLoginForm($app); if (!api_is_anonymous()) { @@ -207,7 +205,7 @@ class IndexController// extends Controller /** * @param \Silex\Application $app */ - function setLoginForm(Application $app) + public function setLoginForm(Application $app) { $userId = api_get_user_id(); $loginForm = null; @@ -260,7 +258,7 @@ class IndexController// extends Controller return $app['template']->assign('form', $form->createView()); */ - $form = new \FormValidator('formLogin', 'POST', null, null, array('class' => 'form-vertical')); + $form = new \FormValidator('formLogin', 'POST', $app['url_generator']->generate('index'), null, array('class' => 'form-vertical')); $form->addElement( 'text', 'login', diff --git a/vendor/autoload.php b/vendor/autoload.php index ed15abd45a..c97df28563 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInit0e9c4675a86057df1d33aecce1a6569e::getLoader(); +return ComposerAutoloaderInitebc4e42976108992b86543316b8b2ad8::getLoader(); diff --git a/vendor/chamilo/chash/src/Chash/Helpers/ConfigurationHelper.php b/vendor/chamilo/chash/src/Chash/Helpers/ConfigurationHelper.php index 5003ea5701..ce8d9885ec 100644 --- a/vendor/chamilo/chash/src/Chash/Helpers/ConfigurationHelper.php +++ b/vendor/chamilo/chash/src/Chash/Helpers/ConfigurationHelper.php @@ -45,41 +45,41 @@ class ConfigurationHelper extends Helper if (is_dir($dir)) { return $dir; } - /* - $confFile = $dir.'configuration.php'; - $confYML = $dir.'configuration.yml'; - if (file_exists($confFile)) { - return $dir; - } - - if (file_exists($confYML)) { - return $dir; - }*/ return false; } + /** + * Reads the Chamilo configuration file. + * Merges the configuration.php with the configuration.yml if it exists + * @param null $path + * @return array|bool|mixed + */ public function readConfigurationFile($path = null) { $confPath = $this->getConfigurationPath($path); - if (!empty($confPath)) { $confFile = $confPath.'configuration.php'; + + $_configuration = array(); + if (file_exists($confFile)) { require $confFile; - $this->setConfiguration($_configuration); - - return $_configuration; } $confYML = $confPath.'configuration.yml'; if (file_exists($confYML)) { $yaml = new Parser(); - $_configuration = $yaml->parse(file_get_contents($confYML)); - - return $_configuration; + $_configurationYML = $yaml->parse(file_get_contents($confYML)); + if (isset($_configuration) && !empty($_configuration) && isset($_configurationYML) && !empty($_configurationYML)) { + $_configuration = array_merge($_configuration, $_configurationYML); + } else { + $_configuration = $_configurationYML; + } } + + return $_configuration; } return false; @@ -179,16 +179,22 @@ class ConfigurationHelper extends Helper $dbs[] = $_configuration['user_personal_database']; } - $t = $_configuration['main_database'].'.course'; - $sql = 'SELECT db_name from '.$t; - $res = mysql_query($sql); - if (mysql_num_rows($res) > 0) { - while ($row = mysql_fetch_array($res)) { - if (!empty($row['db_name'])) { - $dbs[] = $row['db_name']; + $courseTable = $_configuration['main_database'].'.course'; + + $singleDatabase = isset($_configuration['single_database']) ? $_configuration['single_database'] : false; + + if ($singleDatabase == false) { + $sql = 'SELECT db_name from '.$courseTable; + $res = mysql_query($sql); + if (mysql_num_rows($res) > 0) { + while ($row = mysql_fetch_array($res)) { + if (!empty($row['db_name'])) { + $dbs[] = $row['db_name']; + } } } } + return $dbs; } diff --git a/vendor/chamilo/chash/vendor/autoload.php b/vendor/chamilo/chash/vendor/autoload.php new file mode 100644 index 0000000000..4294a4c111 --- /dev/null +++ b/vendor/chamilo/chash/vendor/autoload.php @@ -0,0 +1,7 @@ +=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.*" - }, - "time": "2013-02-11 11:24:47", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev" - } - }, - "installation-source": "dist", - "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" - }, { "name": "symfony/web-profiler-bundle", "version": "v2.2.0", @@ -1852,6 +1792,36 @@ "description": "Symfony Yaml Component", "homepage": "http://symfony.com" }, + { + "name": "chamilo/chash", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/chamilo/chash.git", + "reference": "0db81e2ad152355baca3d968f0af04cce147d510" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/chamilo/chash/zipball/0db81e2ad152355baca3d968f0af04cce147d510", + "reference": "0db81e2ad152355baca3d968f0af04cce147d510", + "shasum": "" + }, + "require": { + "php": ">=5.3.2", + "symfony/console": "2.3.*@dev", + "symfony/yaml": "2.1.*" + }, + "time": "2013-03-28 10:43:52", + "type": "library", + "installation-source": "source", + "autoload": { + "psr-0": { + "Chash": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/" + }, { "name": "monolog/monolog", "version": "1.4.0", @@ -2062,12 +2032,12 @@ "source": { "type": "git", "url": "https://github.com/l3pp4rd/DoctrineExtensions.git", - "reference": "03799ebed1067cff5bb7fa60b711ce34f3bb689f" + "reference": "e96e48a988f7fffbe3cca4763df84f77ba79ddde" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/l3pp4rd/DoctrineExtensions/zipball/03799ebed1067cff5bb7fa60b711ce34f3bb689f", - "reference": "03799ebed1067cff5bb7fa60b711ce34f3bb689f", + "url": "https://api.github.com/repos/l3pp4rd/DoctrineExtensions/zipball/e96e48a988f7fffbe3cca4763df84f77ba79ddde", + "reference": "e96e48a988f7fffbe3cca4763df84f77ba79ddde", "shasum": "" }, "require": { @@ -2087,7 +2057,7 @@ "doctrine/mongodb-odm": ">=1.0.0-BETA7", "doctrine/orm": ">=2.3.2" }, - "time": "2013-03-26 20:33:31", + "time": "2013-03-27 16:49:35", "type": "library", "extra": { "branch-alias": { @@ -2137,33 +2107,63 @@ ] }, { - "name": "chamilo/chash", - "version": "dev-master", - "version_normalized": "9999999-dev", + "name": "symfony/routing", + "version": "v2.2.0", + "version_normalized": "2.2.0.0", + "target-dir": "Symfony/Component/Routing", "source": { "type": "git", - "url": "https://github.com/chamilo/chash.git", - "reference": "b9f4f3b3ff7f04ce87df7bb9896f2b3aee710feb" + "url": "https://github.com/symfony/Routing.git", + "reference": "v2.2.0-RC3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/chamilo/chash/zipball/b9f4f3b3ff7f04ce87df7bb9896f2b3aee710feb", - "reference": "b9f4f3b3ff7f04ce87df7bb9896f2b3aee710feb", + "url": "https://api.github.com/repos/symfony/Routing/zipball/v2.2.0-RC3", + "reference": "v2.2.0-RC3", "shasum": "" }, "require": { - "php": ">=5.3.2", - "symfony/console": "2.3.*@dev", - "symfony/yaml": "2.1.*" + "php": ">=5.3.3" }, - "time": "2013-03-27 13:08:43", + "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.*" + }, + "time": "2013-02-11 11:24:47", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, "installation-source": "source", "autoload": { "psr-0": { - "Chash": "src/" + "Symfony\\Component\\Routing\\": "" } }, - "notification-url": "https://packagist.org/downloads/" + "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" } ] diff --git a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tool/Wrapper/AbstractWrapper.php b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tool/Wrapper/AbstractWrapper.php index 83d51938ef..cba8a1a8b6 100644 --- a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tool/Wrapper/AbstractWrapper.php +++ b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tool/Wrapper/AbstractWrapper.php @@ -70,6 +70,11 @@ abstract class AbstractWrapper implements WrapperInterface return self::$wrappedObjectReferences[$oid]; } + public static function clear() + { + self::$wrappedObjectReferences = array(); + } + /** * {@inheritDoc} */ @@ -96,4 +101,4 @@ abstract class AbstractWrapper implements WrapperInterface } return $this; } -} \ No newline at end of file +}