Browse Source

Adding symfony2 DI component

Julio Montoya 10 years ago
parent
commit
05db83127c
100 changed files with 4855 additions and 1384 deletions
  1. 687 0
      app/SymfonyRequirements.php
  2. 13 0
      app/autoload.php
  3. 3050 0
      app/bootstrap.php.cache
  4. 62 0
      app/check.php
  5. 3 0
      app/config/parameters.php
  6. 18 0
      app/config/routing.yml
  7. 14 0
      app/config/routing_dev.yml
  8. 55 80
      composer.json
  9. 1 1
      main/admin/add_users_to_usergroup.php
  10. 3 6
      main/admin/course_list.php
  11. 0 4
      main/admin/index.php
  12. 6 7
      main/admin/user_list.php
  13. 2 2
      main/auth/shibboleth/app/controller/shibboleth_controller.class.php
  14. 7 2
      main/course_home/activity.php
  15. 3 0
      main/document/document.php
  16. 44 53
      main/inc/lib/api.lib.php
  17. 73 0
      main/inc/lib/chamilo_session.class.php
  18. 1 1
      main/inc/lib/course.lib.php
  19. 8 3
      main/inc/lib/course_home.lib.php
  20. 3 10
      main/inc/lib/display.lib.php
  21. 2 2
      main/inc/lib/events.lib.inc.php
  22. 1 0
      main/inc/lib/formvalidator/FormValidator.class.php
  23. 3 4
      main/inc/lib/internationalization.lib.php
  24. 1 0
      main/inc/lib/security.lib.php
  25. 0 97
      src/ChamiloLMS/Command/Template/AsseticDumpCommand.php
  26. 0 613
      src/ChamiloLMS/Controller/BaseController.php
  27. 0 98
      src/ChamiloLMS/Controller/LegacyController.php
  28. 2 2
      src/ChamiloLMS/CoreBundle/Command/Translation/ExportLanguagesCommand.php
  29. 2 2
      src/ChamiloLMS/CoreBundle/Component/Auth/LoginListener.php
  30. 2 2
      src/ChamiloLMS/CoreBundle/Component/Auth/LoginSuccessHandler.php
  31. 1 1
      src/ChamiloLMS/CoreBundle/Component/Auth/LogoutSuccessHandler.php
  32. 3 3
      src/ChamiloLMS/CoreBundle/Component/Auth/Role.php
  33. 3 3
      src/ChamiloLMS/CoreBundle/Component/Composer/Tasks.php
  34. 2 2
      src/ChamiloLMS/CoreBundle/Component/Console/Output/BufferedOutput.php
  35. 5 5
      src/ChamiloLMS/CoreBundle/Component/DataFilesystem/DataFilesystem.php
  36. 5 5
      src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/CkEditor.php
  37. 3 3
      src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/Basic.php
  38. 2 2
      src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/Documents.php
  39. 2 2
      src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/IntroductionTool.php
  40. 2 2
      src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/LearningPathDocuments.php
  41. 2 2
      src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/Message.php
  42. 2 2
      src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/TestFreeAnswer.php
  43. 2 2
      src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/TestFreeAnswerStrict.php
  44. 2 2
      src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/TestProposedAnswer.php
  45. 2 2
      src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/TestQuestionDescription.php
  46. 2 2
      src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/UniqueAnswerImage.php
  47. 7 7
      src/ChamiloLMS/CoreBundle/Component/Editor/Connector.php
  48. 2 2
      src/ChamiloLMS/CoreBundle/Component/Editor/Driver/CourseDriver.php
  49. 2 2
      src/ChamiloLMS/CoreBundle/Component/Editor/Driver/CourseUserDriver.php
  50. 3 3
      src/ChamiloLMS/CoreBundle/Component/Editor/Driver/Driver.php
  51. 7 7
      src/ChamiloLMS/CoreBundle/Component/Editor/Driver/DropBoxDriver.php
  52. 2 2
      src/ChamiloLMS/CoreBundle/Component/Editor/Driver/HomeDriver.php
  53. 3 3
      src/ChamiloLMS/CoreBundle/Component/Editor/Driver/InterfaceDriver.php
  54. 2 2
      src/ChamiloLMS/CoreBundle/Component/Editor/Driver/PersonalDriver.php
  55. 4 4
      src/ChamiloLMS/CoreBundle/Component/Editor/Editor.php
  56. 1 1
      src/ChamiloLMS/CoreBundle/Component/Editor/Finder.php
  57. 4 4
      src/ChamiloLMS/CoreBundle/Component/Editor/TinyMce/TinyMce.php
  58. 3 3
      src/ChamiloLMS/CoreBundle/Component/Editor/TinyMce/Toolbar/Basic.php
  59. 2 2
      src/ChamiloLMS/CoreBundle/Component/Editor/Toolbar.php
  60. 2 2
      src/ChamiloLMS/CoreBundle/Component/Mail/MailGenerator.php
  61. 1 1
      src/ChamiloLMS/CoreBundle/Component/Validator/ConstraintValidatorFactory.php
  62. 15 22
      src/ChamiloLMS/CoreBundle/Controller/Admin/AdminController.php
  63. 13 13
      src/ChamiloLMS/CoreBundle/Controller/Admin/Administrator/BranchController.php
  64. 15 15
      src/ChamiloLMS/CoreBundle/Controller/Admin/Administrator/JuryController.php
  65. 16 6
      src/ChamiloLMS/CoreBundle/Controller/Admin/Administrator/QuestionScoreController.php
  66. 8 7
      src/ChamiloLMS/CoreBundle/Controller/Admin/Administrator/QuestionScoreNameController.php
  67. 6 6
      src/ChamiloLMS/CoreBundle/Controller/Admin/Administrator/RoleController.php
  68. 4 4
      src/ChamiloLMS/CoreBundle/Controller/Admin/Administrator/UpgradeController.php
  69. 21 20
      src/ChamiloLMS/CoreBundle/Controller/Admin/Director/BranchDirectorController.php
  70. 20 20
      src/ChamiloLMS/CoreBundle/Controller/Admin/JuryMember/JuryMemberController.php
  71. 14 14
      src/ChamiloLMS/CoreBundle/Controller/Admin/JuryPresident/JuryPresidentController.php
  72. 10 10
      src/ChamiloLMS/CoreBundle/Controller/Admin/QuestionManager/QuestionManagerController.php
  73. 3 3
      src/ChamiloLMS/CoreBundle/Controller/App/Certificate/CertificateController.php
  74. 6 6
      src/ChamiloLMS/CoreBundle/Controller/App/Editor/EditorController.php
  75. 2 2
      src/ChamiloLMS/CoreBundle/Controller/App/ModelAjax/ModelAjaxController.php
  76. 3 3
      src/ChamiloLMS/CoreBundle/Controller/App/News/NewsController.php
  77. 8 8
      src/ChamiloLMS/CoreBundle/Controller/App/SessionPath/SessionPathController.php
  78. 6 6
      src/ChamiloLMS/CoreBundle/Controller/App/SessionPath/SessionTreeController.php
  79. 228 0
      src/ChamiloLMS/CoreBundle/Controller/BaseController.php
  80. 36 2
      src/ChamiloLMS/CoreBundle/Controller/CrudController.php
  81. 4 4
      src/ChamiloLMS/CoreBundle/Controller/CrudControllerInterface.php
  82. 34 34
      src/ChamiloLMS/CoreBundle/Controller/IndexController.php
  83. 116 0
      src/ChamiloLMS/CoreBundle/Controller/LegacyController.php
  84. 35 26
      src/ChamiloLMS/CoreBundle/Controller/Tool/CourseHome/CourseHomeController.php
  85. 9 9
      src/ChamiloLMS/CoreBundle/Controller/Tool/Curriculum/CurriculumCategoryController.php
  86. 4 4
      src/ChamiloLMS/CoreBundle/Controller/Tool/Curriculum/CurriculumController.php
  87. 9 9
      src/ChamiloLMS/CoreBundle/Controller/Tool/Curriculum/CurriculumItemController.php
  88. 19 19
      src/ChamiloLMS/CoreBundle/Controller/Tool/Curriculum/CurriculumUserController.php
  89. 2 2
      src/ChamiloLMS/CoreBundle/Controller/Tool/Exercise/ExerciseController.php
  90. 10 8
      src/ChamiloLMS/CoreBundle/Controller/Tool/Introduction/IntroductionController.php
  91. 12 12
      src/ChamiloLMS/CoreBundle/Controller/Tool/LearningPath/LearningPathController.php
  92. 3 3
      src/ChamiloLMS/CoreBundle/Controller/ToolBaseController.php
  93. 3 3
      src/ChamiloLMS/CoreBundle/Controller/User/ProfileController.php
  94. 3 3
      src/ChamiloLMS/CoreBundle/Controller/User/UserController.php
  95. 1 1
      src/ChamiloLMS/CoreBundle/Entity/AccessUrl.php
  96. 1 1
      src/ChamiloLMS/CoreBundle/Entity/AccessUrlRelCourse.php
  97. 1 1
      src/ChamiloLMS/CoreBundle/Entity/AccessUrlRelSession.php
  98. 1 1
      src/ChamiloLMS/CoreBundle/Entity/AccessUrlRelUser.php
  99. 2 2
      src/ChamiloLMS/CoreBundle/Entity/BranchSync.php
  100. 1 1
      src/ChamiloLMS/CoreBundle/Entity/CDropboxFile.php

+ 687 - 0
app/SymfonyRequirements.php

@@ -0,0 +1,687 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+/*
+ * Users of PHP 5.2 should be able to run the requirements checks.
+ * This is why the file and all classes must be compatible with PHP 5.2+
+ * (e.g. not using namespaces and closures).
+ *
+ * ************** CAUTION **************
+ *
+ * DO NOT EDIT THIS FILE as it will be overridden by Composer as part of
+ * the installation/update process. The original file resides in the
+ * SensioDistributionBundle.
+ *
+ * ************** CAUTION **************
+ */
+
+/**
+ * Represents a single PHP requirement, e.g. an installed extension.
+ * It can be a mandatory requirement or an optional recommendation.
+ * There is a special subclass, named PhpIniRequirement, to check a php.ini configuration.
+ *
+ * @author Tobias Schultze <http://tobion.de>
+ */
+class Requirement
+{
+    private $fulfilled;
+    private $testMessage;
+    private $helpText;
+    private $helpHtml;
+    private $optional;
+
+    /**
+     * Constructor that initializes the requirement.
+     *
+     * @param Boolean     $fulfilled   Whether the requirement is fulfilled
+     * @param string      $testMessage The message for testing the requirement
+     * @param string      $helpHtml    The help text formatted in HTML for resolving the problem
+     * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
+     * @param Boolean     $optional    Whether this is only an optional recommendation not a mandatory requirement
+     */
+    public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false)
+    {
+        $this->fulfilled = (Boolean) $fulfilled;
+        $this->testMessage = (string) $testMessage;
+        $this->helpHtml = (string) $helpHtml;
+        $this->helpText = null === $helpText ? strip_tags($this->helpHtml) : (string) $helpText;
+        $this->optional = (Boolean) $optional;
+    }
+
+    /**
+     * Returns whether the requirement is fulfilled.
+     *
+     * @return Boolean true if fulfilled, otherwise false
+     */
+    public function isFulfilled()
+    {
+        return $this->fulfilled;
+    }
+
+    /**
+     * Returns the message for testing the requirement.
+     *
+     * @return string The test message
+     */
+    public function getTestMessage()
+    {
+        return $this->testMessage;
+    }
+
+    /**
+     * Returns the help text for resolving the problem
+     *
+     * @return string The help text
+     */
+    public function getHelpText()
+    {
+        return $this->helpText;
+    }
+
+    /**
+     * Returns the help text formatted in HTML.
+     *
+     * @return string The HTML help
+     */
+    public function getHelpHtml()
+    {
+        return $this->helpHtml;
+    }
+
+    /**
+     * Returns whether this is only an optional recommendation and not a mandatory requirement.
+     *
+     * @return Boolean true if optional, false if mandatory
+     */
+    public function isOptional()
+    {
+        return $this->optional;
+    }
+}
+
+/**
+ * Represents a PHP requirement in form of a php.ini configuration.
+ *
+ * @author Tobias Schultze <http://tobion.de>
+ */
+class PhpIniRequirement extends Requirement
+{
+    /**
+     * Constructor that initializes the requirement.
+     *
+     * @param string           $cfgName    The configuration name used for ini_get()
+     * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
+                                                    or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
+     * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
+                                                    This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
+                                                    Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
+     * @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
+     * @param string|null $helpHtml    The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
+     * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
+     * @param Boolean     $optional    Whether this is only an optional recommendation not a mandatory requirement
+     */
+    public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
+    {
+        $cfgValue = ini_get($cfgName);
+
+        if (is_callable($evaluation)) {
+            if (null === $testMessage || null === $helpHtml) {
+                throw new InvalidArgumentException('You must provide the parameters testMessage and helpHtml for a callback evaluation.');
+            }
+
+            $fulfilled = call_user_func($evaluation, $cfgValue);
+        } else {
+            if (null === $testMessage) {
+                $testMessage = sprintf('%s %s be %s in php.ini',
+                    $cfgName,
+                    $optional ? 'should' : 'must',
+                    $evaluation ? 'enabled' : 'disabled'
+                );
+            }
+
+            if (null === $helpHtml) {
+                $helpHtml = sprintf('Set <strong>%s</strong> to <strong>%s</strong> in php.ini<a href="#phpini">*</a>.',
+                    $cfgName,
+                    $evaluation ? 'on' : 'off'
+                );
+            }
+
+            $fulfilled = $evaluation == $cfgValue;
+        }
+
+        parent::__construct($fulfilled || ($approveCfgAbsence && false === $cfgValue), $testMessage, $helpHtml, $helpText, $optional);
+    }
+}
+
+/**
+ * A RequirementCollection represents a set of Requirement instances.
+ *
+ * @author Tobias Schultze <http://tobion.de>
+ */
+class RequirementCollection implements IteratorAggregate
+{
+    private $requirements = array();
+
+    /**
+     * Gets the current RequirementCollection as an Iterator.
+     *
+     * @return Traversable A Traversable interface
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->requirements);
+    }
+
+    /**
+     * Adds a Requirement.
+     *
+     * @param Requirement $requirement A Requirement instance
+     */
+    public function add(Requirement $requirement)
+    {
+        $this->requirements[] = $requirement;
+    }
+
+    /**
+     * Adds a mandatory requirement.
+     *
+     * @param Boolean     $fulfilled   Whether the requirement is fulfilled
+     * @param string      $testMessage The message for testing the requirement
+     * @param string      $helpHtml    The help text formatted in HTML for resolving the problem
+     * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
+     */
+    public function addRequirement($fulfilled, $testMessage, $helpHtml, $helpText = null)
+    {
+        $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, false));
+    }
+
+    /**
+     * Adds an optional recommendation.
+     *
+     * @param Boolean     $fulfilled   Whether the recommendation is fulfilled
+     * @param string      $testMessage The message for testing the recommendation
+     * @param string      $helpHtml    The help text formatted in HTML for resolving the problem
+     * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
+     */
+    public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText = null)
+    {
+        $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, true));
+    }
+
+    /**
+     * Adds a mandatory requirement in form of a php.ini configuration.
+     *
+     * @param string           $cfgName    The configuration name used for ini_get()
+     * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
+                                                    or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
+     * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
+                                                    This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
+                                                    Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
+     * @param string      $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
+     * @param string      $helpHtml    The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
+     * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
+     */
+    public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
+    {
+        $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, false));
+    }
+
+    /**
+     * Adds an optional recommendation in form of a php.ini configuration.
+     *
+     * @param string           $cfgName    The configuration name used for ini_get()
+     * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
+                                                    or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
+     * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
+                                                    This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
+                                                    Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
+     * @param string      $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
+     * @param string      $helpHtml    The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
+     * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
+     */
+    public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
+    {
+        $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, true));
+    }
+
+    /**
+     * Adds a requirement collection to the current set of requirements.
+     *
+     * @param RequirementCollection $collection A RequirementCollection instance
+     */
+    public function addCollection(RequirementCollection $collection)
+    {
+        $this->requirements = array_merge($this->requirements, $collection->all());
+    }
+
+    /**
+     * Returns both requirements and recommendations.
+     *
+     * @return array Array of Requirement instances
+     */
+    public function all()
+    {
+        return $this->requirements;
+    }
+
+    /**
+     * Returns all mandatory requirements.
+     *
+     * @return array Array of Requirement instances
+     */
+    public function getRequirements()
+    {
+        $array = array();
+        foreach ($this->requirements as $req) {
+            if (!$req->isOptional()) {
+                $array[] = $req;
+            }
+        }
+
+        return $array;
+    }
+
+    /**
+     * Returns the mandatory requirements that were not met.
+     *
+     * @return array Array of Requirement instances
+     */
+    public function getFailedRequirements()
+    {
+        $array = array();
+        foreach ($this->requirements as $req) {
+            if (!$req->isFulfilled() && !$req->isOptional()) {
+                $array[] = $req;
+            }
+        }
+
+        return $array;
+    }
+
+    /**
+     * Returns all optional recommendations.
+     *
+     * @return array Array of Requirement instances
+     */
+    public function getRecommendations()
+    {
+        $array = array();
+        foreach ($this->requirements as $req) {
+            if ($req->isOptional()) {
+                $array[] = $req;
+            }
+        }
+
+        return $array;
+    }
+
+    /**
+     * Returns the recommendations that were not met.
+     *
+     * @return array Array of Requirement instances
+     */
+    public function getFailedRecommendations()
+    {
+        $array = array();
+        foreach ($this->requirements as $req) {
+            if (!$req->isFulfilled() && $req->isOptional()) {
+                $array[] = $req;
+            }
+        }
+
+        return $array;
+    }
+
+    /**
+     * Returns whether a php.ini configuration is not correct.
+     *
+     * @return Boolean php.ini configuration problem?
+     */
+    public function hasPhpIniConfigIssue()
+    {
+        foreach ($this->requirements as $req) {
+            if (!$req->isFulfilled() && $req instanceof PhpIniRequirement) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Returns the PHP configuration file (php.ini) path.
+     *
+     * @return string|false php.ini file path
+     */
+    public function getPhpIniConfigPath()
+    {
+        return get_cfg_var('cfg_file_path');
+    }
+}
+
+/**
+ * This class specifies all requirements and optional recommendations that
+ * are necessary to run the Symfony Standard Edition.
+ *
+ * @author Tobias Schultze <http://tobion.de>
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+class SymfonyRequirements extends RequirementCollection
+{
+    const REQUIRED_PHP_VERSION = '5.3.3';
+
+    /**
+     * Constructor that initializes the requirements.
+     */
+    public function __construct()
+    {
+        /* mandatory requirements follow */
+
+        $installedPhpVersion = phpversion();
+
+        $this->addRequirement(
+            version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>='),
+            sprintf('PHP version must be at least %s (%s installed)', self::REQUIRED_PHP_VERSION, $installedPhpVersion),
+            sprintf('You are running PHP version "<strong>%s</strong>", but Symfony needs at least PHP "<strong>%s</strong>" to run.
+                Before using Symfony, upgrade your PHP installation, preferably to the latest version.',
+                $installedPhpVersion, self::REQUIRED_PHP_VERSION),
+            sprintf('Install PHP %s or newer (installed version is %s)', self::REQUIRED_PHP_VERSION, $installedPhpVersion)
+        );
+
+        $this->addRequirement(
+            version_compare($installedPhpVersion, '5.3.16', '!='),
+            'PHP version must not be 5.3.16 as Symfony won\'t work properly with it',
+            'Install PHP 5.3.17 or newer (or downgrade to an earlier PHP version)'
+        );
+
+        $this->addRequirement(
+            is_dir(__DIR__.'/../vendor/composer'),
+            'Vendor libraries must be installed',
+            'Vendor libraries are missing. Install composer following instructions from <a href="http://getcomposer.org/">http://getcomposer.org/</a>. ' .
+                'Then run "<strong>php composer.phar install</strong>" to install them.'
+        );
+
+        $baseDir = basename(__DIR__);
+
+        $this->addRequirement(
+            is_writable(__DIR__.'/cache'),
+            "$baseDir/cache/ directory must be writable",
+            "Change the permissions of the \"<strong>$baseDir/cache/</strong>\" directory so that the web server can write into it."
+        );
+
+        $this->addRequirement(
+            is_writable(__DIR__.'/logs'),
+            "$baseDir/logs/ directory must be writable",
+            "Change the permissions of the \"<strong>$baseDir/logs/</strong>\" directory so that the web server can write into it."
+        );
+
+        $this->addPhpIniRequirement(
+            'date.timezone', true, false,
+            'date.timezone setting must be set',
+            'Set the "<strong>date.timezone</strong>" setting in php.ini<a href="#phpini">*</a> (like Europe/Paris).'
+        );
+
+        if (version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>=')) {
+            $timezones = array();
+            foreach (DateTimeZone::listAbbreviations() as $abbreviations) {
+                foreach ($abbreviations as $abbreviation) {
+                    $timezones[$abbreviation['timezone_id']] = true;
+                }
+            }
+
+            $this->addRequirement(
+                isset($timezones[date_default_timezone_get()]),
+                sprintf('Configured default timezone "%s" must be supported by your installation of PHP', date_default_timezone_get()),
+                'Your default timezone is not supported by PHP. Check for typos in your <strong>php.ini</strong> file and have a look at the list of deprecated timezones at <a href="http://php.net/manual/en/timezones.others.php">http://php.net/manual/en/timezones.others.php</a>.'
+            );
+        }
+
+        $this->addRequirement(
+            function_exists('json_encode'),
+            'json_encode() must be available',
+            'Install and enable the <strong>JSON</strong> extension.'
+        );
+
+        $this->addRequirement(
+            function_exists('session_start'),
+            'session_start() must be available',
+            'Install and enable the <strong>session</strong> extension.'
+        );
+
+        $this->addRequirement(
+            function_exists('ctype_alpha'),
+            'ctype_alpha() must be available',
+            'Install and enable the <strong>ctype</strong> extension.'
+        );
+
+        $this->addRequirement(
+            function_exists('token_get_all'),
+            'token_get_all() must be available',
+            'Install and enable the <strong>Tokenizer</strong> extension.'
+        );
+
+        $this->addRequirement(
+            function_exists('simplexml_import_dom'),
+            'simplexml_import_dom() must be available',
+            'Install and enable the <strong>SimpleXML</strong> extension.'
+        );
+
+        if (function_exists('apc_store') && ini_get('apc.enabled')) {
+            if (version_compare($installedPhpVersion, '5.4.0', '>=')) {
+                $this->addRequirement(
+                    version_compare(phpversion('apc'), '3.1.13', '>='),
+                    'APC version must be at least 3.1.13 when using PHP 5.4',
+                    'Upgrade your <strong>APC</strong> extension (3.1.13+).'
+                );
+            } else {
+                $this->addRequirement(
+                    version_compare(phpversion('apc'), '3.0.17', '>='),
+                    'APC version must be at least 3.0.17',
+                    'Upgrade your <strong>APC</strong> extension (3.0.17+).'
+                );
+            }
+        }
+
+        $this->addPhpIniRequirement('detect_unicode', false);
+
+        if (extension_loaded('suhosin')) {
+            $this->addPhpIniRequirement(
+                'suhosin.executor.include.whitelist',
+                create_function('$cfgValue', 'return false !== stripos($cfgValue, "phar");'),
+                false,
+                'suhosin.executor.include.whitelist must be configured correctly in php.ini',
+                'Add "<strong>phar</strong>" to <strong>suhosin.executor.include.whitelist</strong> in php.ini<a href="#phpini">*</a>.'
+            );
+        }
+
+        if (extension_loaded('xdebug')) {
+            $this->addPhpIniRequirement(
+                'xdebug.show_exception_trace', false, true
+            );
+
+            $this->addPhpIniRequirement(
+                'xdebug.scream', false, true
+            );
+
+            $this->addPhpIniRecommendation(
+                'xdebug.max_nesting_level',
+                create_function('$cfgValue', 'return $cfgValue > 100;'),
+                true,
+                'xdebug.max_nesting_level should be above 100 in php.ini',
+                'Set "<strong>xdebug.max_nesting_level</strong>" to e.g. "<strong>250</strong>" in php.ini<a href="#phpini">*</a> to stop Xdebug\'s infinite recursion protection erroneously throwing a fatal error in your project.'
+            );
+        }
+
+        $pcreVersion = defined('PCRE_VERSION') ? (float) PCRE_VERSION : null;
+
+        $this->addRequirement(
+            null !== $pcreVersion,
+            'PCRE extension must be available',
+            'Install the <strong>PCRE</strong> extension (version 8.0+).'
+        );
+
+        /* optional recommendations follow */
+
+        $this->addRecommendation(
+            file_get_contents(__FILE__) === file_get_contents(__DIR__.'/../vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/SymfonyRequirements.php'),
+            'Requirements file should be up-to-date',
+            'Your requirements file is outdated. Run composer install and re-check your configuration.'
+        );
+
+        $this->addRecommendation(
+            version_compare($installedPhpVersion, '5.3.4', '>='),
+            'You should use at least PHP 5.3.4 due to PHP bug #52083 in earlier versions',
+            'Your project might malfunction randomly due to PHP bug #52083 ("Notice: Trying to get property of non-object"). Install PHP 5.3.4 or newer.'
+        );
+
+        $this->addRecommendation(
+            version_compare($installedPhpVersion, '5.3.8', '>='),
+            'When using annotations you should have at least PHP 5.3.8 due to PHP bug #55156',
+            'Install PHP 5.3.8 or newer if your project uses annotations.'
+        );
+
+        $this->addRecommendation(
+            version_compare($installedPhpVersion, '5.4.0', '!='),
+            'You should not use PHP 5.4.0 due to the PHP bug #61453',
+            'Your project might not work properly due to the PHP bug #61453 ("Cannot dump definitions which have method calls"). Install PHP 5.4.1 or newer.'
+        );
+
+        $this->addRecommendation(
+            version_compare($installedPhpVersion, '5.4.11', '>='),
+            'When using the logout handler from the Symfony Security Component, you should have at least PHP 5.4.11 due to PHP bug #63379 (as a workaround, you can also set invalidate_session to false in the security logout handler configuration)',
+            'Install PHP 5.4.11 or newer if your project uses the logout handler from the Symfony Security Component.'
+        );
+
+        $this->addRecommendation(
+            (version_compare($installedPhpVersion, '5.3.18', '>=') && version_compare($installedPhpVersion, '5.4.0', '<'))
+            ||
+            version_compare($installedPhpVersion, '5.4.8', '>='),
+            'You should use PHP 5.3.18+ or PHP 5.4.8+ to always get nice error messages for fatal errors in the development environment due to PHP bug #61767/#60909',
+            'Install PHP 5.3.18+ or PHP 5.4.8+ if you want nice error messages for all fatal errors in the development environment.'
+        );
+
+        if (null !== $pcreVersion) {
+            $this->addRecommendation(
+                $pcreVersion >= 8.0,
+                sprintf('PCRE extension should be at least version 8.0 (%s installed)', $pcreVersion),
+                '<strong>PCRE 8.0+</strong> is preconfigured in PHP since 5.3.2 but you are using an outdated version of it. Symfony probably works anyway but it is recommended to upgrade your PCRE extension.'
+            );
+        }
+
+        $this->addRecommendation(
+            class_exists('DomDocument'),
+            'PHP-XML module should be installed',
+            'Install and enable the <strong>PHP-XML</strong> module.'
+        );
+
+        $this->addRecommendation(
+            function_exists('mb_strlen'),
+            'mb_strlen() should be available',
+            'Install and enable the <strong>mbstring</strong> extension.'
+        );
+
+        $this->addRecommendation(
+            function_exists('iconv'),
+            'iconv() should be available',
+            'Install and enable the <strong>iconv</strong> extension.'
+        );
+
+        $this->addRecommendation(
+            function_exists('utf8_decode'),
+            'utf8_decode() should be available',
+            'Install and enable the <strong>XML</strong> extension.'
+        );
+
+        if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
+            $this->addRecommendation(
+                function_exists('posix_isatty'),
+                'posix_isatty() should be available',
+                'Install and enable the <strong>php_posix</strong> extension (used to colorize the CLI output).'
+            );
+        }
+
+        $this->addRecommendation(
+            class_exists('Locale'),
+            'intl extension should be available',
+            'Install and enable the <strong>intl</strong> extension (used for validators).'
+        );
+
+        if (class_exists('Collator')) {
+            $this->addRecommendation(
+                null !== new Collator('fr_FR'),
+                'intl extension should be correctly configured',
+                'The intl extension does not behave properly. This problem is typical on PHP 5.3.X x64 WIN builds.'
+            );
+        }
+
+        if (class_exists('Locale')) {
+            if (defined('INTL_ICU_VERSION')) {
+                $version = INTL_ICU_VERSION;
+            } else {
+                $reflector = new ReflectionExtension('intl');
+
+                ob_start();
+                $reflector->info();
+                $output = strip_tags(ob_get_clean());
+
+                preg_match('/^ICU version +(?:=> )?(.*)$/m', $output, $matches);
+                $version = $matches[1];
+            }
+
+            $this->addRecommendation(
+                version_compare($version, '4.0', '>='),
+                'intl ICU version should be at least 4+',
+                'Upgrade your <strong>intl</strong> extension with a newer ICU version (4+).'
+            );
+        }
+
+        $accelerator =
+            (extension_loaded('eaccelerator') && ini_get('eaccelerator.enable'))
+            ||
+            (extension_loaded('apc') && ini_get('apc.enabled'))
+            ||
+            (extension_loaded('Zend OPcache') && ini_get('opcache.enable'))
+            ||
+            (extension_loaded('xcache') && ini_get('xcache.cacher'))
+            ||
+            (extension_loaded('wincache') && ini_get('wincache.ocenabled'))
+        ;
+
+        $this->addRecommendation(
+            $accelerator,
+            'a PHP accelerator should be installed',
+            'Install and enable a <strong>PHP accelerator</strong> like APC (highly recommended).'
+        );
+
+        $this->addPhpIniRecommendation('short_open_tag', false);
+
+        $this->addPhpIniRecommendation('magic_quotes_gpc', false, true);
+
+        $this->addPhpIniRecommendation('register_globals', false, true);
+
+        $this->addPhpIniRecommendation('session.auto_start', false);
+
+        $this->addRecommendation(
+            class_exists('PDO'),
+            'PDO should be installed',
+            'Install <strong>PDO</strong> (mandatory for Doctrine).'
+        );
+
+        if (class_exists('PDO')) {
+            $drivers = PDO::getAvailableDrivers();
+            $this->addRecommendation(
+                count($drivers),
+                sprintf('PDO should have some drivers installed (currently available: %s)', count($drivers) ? implode(', ', $drivers) : 'none'),
+                'Install <strong>PDO drivers</strong> (mandatory for Doctrine).'
+            );
+        }
+    }
+}

+ 13 - 0
app/autoload.php

@@ -0,0 +1,13 @@
+<?php
+
+use Doctrine\Common\Annotations\AnnotationRegistry;
+use Composer\Autoload\ClassLoader;
+
+/**
+ * @var ClassLoader $loader
+ */
+$loader = require __DIR__.'/../vendor/autoload.php';
+
+AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
+
+return $loader;

+ 3050 - 0
app/bootstrap.php.cache

@@ -0,0 +1,3050 @@
+<?php
+
+namespace { $loader = require_once __DIR__.'/autoload.php'; }
+
+ 
+namespace Symfony\Component\HttpFoundation
+{
+class ParameterBag implements \IteratorAggregate, \Countable
+{
+protected $parameters;
+public function __construct(array $parameters = array())
+{
+$this->parameters = $parameters;
+}
+public function all()
+{
+return $this->parameters;
+}
+public function keys()
+{
+return array_keys($this->parameters);
+}
+public function replace(array $parameters = array())
+{
+$this->parameters = $parameters;
+}
+public function add(array $parameters = array())
+{
+$this->parameters = array_replace($this->parameters, $parameters);
+}
+public function get($path, $default = null, $deep = false)
+{
+if (!$deep || false === $pos = strpos($path,'[')) {
+return array_key_exists($path, $this->parameters) ? $this->parameters[$path] : $default;
+}
+$root = substr($path, 0, $pos);
+if (!array_key_exists($root, $this->parameters)) {
+return $default;
+}
+$value = $this->parameters[$root];
+$currentKey = null;
+for ($i = $pos, $c = strlen($path); $i < $c; $i++) {
+$char = $path[$i];
+if ('['=== $char) {
+if (null !== $currentKey) {
+throw new \InvalidArgumentException(sprintf('Malformed path. Unexpected "[" at position %d.', $i));
+}
+$currentKey ='';
+} elseif (']'=== $char) {
+if (null === $currentKey) {
+throw new \InvalidArgumentException(sprintf('Malformed path. Unexpected "]" at position %d.', $i));
+}
+if (!is_array($value) || !array_key_exists($currentKey, $value)) {
+return $default;
+}
+$value = $value[$currentKey];
+$currentKey = null;
+} else {
+if (null === $currentKey) {
+throw new \InvalidArgumentException(sprintf('Malformed path. Unexpected "%s" at position %d.', $char, $i));
+}
+$currentKey .= $char;
+}
+}
+if (null !== $currentKey) {
+throw new \InvalidArgumentException(sprintf('Malformed path. Path must end with "]".'));
+}
+return $value;
+}
+public function set($key, $value)
+{
+$this->parameters[$key] = $value;
+}
+public function has($key)
+{
+return array_key_exists($key, $this->parameters);
+}
+public function remove($key)
+{
+unset($this->parameters[$key]);
+}
+public function getAlpha($key, $default ='', $deep = false)
+{
+return preg_replace('/[^[:alpha:]]/','', $this->get($key, $default, $deep));
+}
+public function getAlnum($key, $default ='', $deep = false)
+{
+return preg_replace('/[^[:alnum:]]/','', $this->get($key, $default, $deep));
+}
+public function getDigits($key, $default ='', $deep = false)
+{
+return str_replace(array('-','+'),'', $this->filter($key, $default, $deep, FILTER_SANITIZE_NUMBER_INT));
+}
+public function getInt($key, $default = 0, $deep = false)
+{
+return (int) $this->get($key, $default, $deep);
+}
+public function filter($key, $default = null, $deep = false, $filter = FILTER_DEFAULT, $options = array())
+{
+$value = $this->get($key, $default, $deep);
+if (!is_array($options) && $options) {
+$options = array('flags'=> $options);
+}
+if (is_array($value) && !isset($options['flags'])) {
+$options['flags'] = FILTER_REQUIRE_ARRAY;
+}
+return filter_var($value, $filter, $options);
+}
+public function getIterator()
+{
+return new \ArrayIterator($this->parameters);
+}
+public function count()
+{
+return count($this->parameters);
+}
+}
+}
+namespace Symfony\Component\HttpFoundation
+{
+class HeaderBag implements \IteratorAggregate, \Countable
+{
+protected $headers = array();
+protected $cacheControl = array();
+public function __construct(array $headers = array())
+{
+foreach ($headers as $key => $values) {
+$this->set($key, $values);
+}
+}
+public function __toString()
+{
+if (!$this->headers) {
+return'';
+}
+$max = max(array_map('strlen', array_keys($this->headers))) + 1;
+$content ='';
+ksort($this->headers);
+foreach ($this->headers as $name => $values) {
+$name = implode('-', array_map('ucfirst', explode('-', $name)));
+foreach ($values as $value) {
+$content .= sprintf("%-{$max}s %s\r\n", $name.':', $value);
+}
+}
+return $content;
+}
+public function all()
+{
+return $this->headers;
+}
+public function keys()
+{
+return array_keys($this->headers);
+}
+public function replace(array $headers = array())
+{
+$this->headers = array();
+$this->add($headers);
+}
+public function add(array $headers)
+{
+foreach ($headers as $key => $values) {
+$this->set($key, $values);
+}
+}
+public function get($key, $default = null, $first = true)
+{
+$key = strtr(strtolower($key),'_','-');
+if (!array_key_exists($key, $this->headers)) {
+if (null === $default) {
+return $first ? null : array();
+}
+return $first ? $default : array($default);
+}
+if ($first) {
+return count($this->headers[$key]) ? $this->headers[$key][0] : $default;
+}
+return $this->headers[$key];
+}
+public function set($key, $values, $replace = true)
+{
+$key = strtr(strtolower($key),'_','-');
+$values = array_values((array) $values);
+if (true === $replace || !isset($this->headers[$key])) {
+$this->headers[$key] = $values;
+} else {
+$this->headers[$key] = array_merge($this->headers[$key], $values);
+}
+if ('cache-control'=== $key) {
+$this->cacheControl = $this->parseCacheControl($values[0]);
+}
+}
+public function has($key)
+{
+return array_key_exists(strtr(strtolower($key),'_','-'), $this->headers);
+}
+public function contains($key, $value)
+{
+return in_array($value, $this->get($key, null, false));
+}
+public function remove($key)
+{
+$key = strtr(strtolower($key),'_','-');
+unset($this->headers[$key]);
+if ('cache-control'=== $key) {
+$this->cacheControl = array();
+}
+}
+public function getDate($key, \DateTime $default = null)
+{
+if (null === $value = $this->get($key)) {
+return $default;
+}
+if (false === $date = \DateTime::createFromFormat(DATE_RFC2822, $value)) {
+throw new \RuntimeException(sprintf('The %s HTTP header is not parseable (%s).', $key, $value));
+}
+return $date;
+}
+public function addCacheControlDirective($key, $value = true)
+{
+$this->cacheControl[$key] = $value;
+$this->set('Cache-Control', $this->getCacheControlHeader());
+}
+public function hasCacheControlDirective($key)
+{
+return array_key_exists($key, $this->cacheControl);
+}
+public function getCacheControlDirective($key)
+{
+return array_key_exists($key, $this->cacheControl) ? $this->cacheControl[$key] : null;
+}
+public function removeCacheControlDirective($key)
+{
+unset($this->cacheControl[$key]);
+$this->set('Cache-Control', $this->getCacheControlHeader());
+}
+public function getIterator()
+{
+return new \ArrayIterator($this->headers);
+}
+public function count()
+{
+return count($this->headers);
+}
+protected function getCacheControlHeader()
+{
+$parts = array();
+ksort($this->cacheControl);
+foreach ($this->cacheControl as $key => $value) {
+if (true === $value) {
+$parts[] = $key;
+} else {
+if (preg_match('#[^a-zA-Z0-9._-]#', $value)) {
+$value ='"'.$value.'"';
+}
+$parts[] = "$key=$value";
+}
+}
+return implode(', ', $parts);
+}
+protected function parseCacheControl($header)
+{
+$cacheControl = array();
+preg_match_all('#([a-zA-Z][a-zA-Z_-]*)\s*(?:=(?:"([^"]*)"|([^ \t",;]*)))?#', $header, $matches, PREG_SET_ORDER);
+foreach ($matches as $match) {
+$cacheControl[strtolower($match[1])] = isset($match[3]) ? $match[3] : (isset($match[2]) ? $match[2] : true);
+}
+return $cacheControl;
+}
+}
+}
+namespace Symfony\Component\HttpFoundation
+{
+use Symfony\Component\HttpFoundation\File\UploadedFile;
+class FileBag extends ParameterBag
+{
+private static $fileKeys = array('error','name','size','tmp_name','type');
+public function __construct(array $parameters = array())
+{
+$this->replace($parameters);
+}
+public function replace(array $files = array())
+{
+$this->parameters = array();
+$this->add($files);
+}
+public function set($key, $value)
+{
+if (!is_array($value) && !$value instanceof UploadedFile) {
+throw new \InvalidArgumentException('An uploaded file must be an array or an instance of UploadedFile.');
+}
+parent::set($key, $this->convertFileInformation($value));
+}
+public function add(array $files = array())
+{
+foreach ($files as $key => $file) {
+$this->set($key, $file);
+}
+}
+protected function convertFileInformation($file)
+{
+if ($file instanceof UploadedFile) {
+return $file;
+}
+$file = $this->fixPhpFilesArray($file);
+if (is_array($file)) {
+$keys = array_keys($file);
+sort($keys);
+if ($keys == self::$fileKeys) {
+if (UPLOAD_ERR_NO_FILE == $file['error']) {
+$file = null;
+} else {
+$file = new UploadedFile($file['tmp_name'], $file['name'], $file['type'], $file['size'], $file['error']);
+}
+} else {
+$file = array_map(array($this,'convertFileInformation'), $file);
+}
+}
+return $file;
+}
+protected function fixPhpFilesArray($data)
+{
+if (!is_array($data)) {
+return $data;
+}
+$keys = array_keys($data);
+sort($keys);
+if (self::$fileKeys != $keys || !isset($data['name']) || !is_array($data['name'])) {
+return $data;
+}
+$files = $data;
+foreach (self::$fileKeys as $k) {
+unset($files[$k]);
+}
+foreach (array_keys($data['name']) as $key) {
+$files[$key] = $this->fixPhpFilesArray(array('error'=> $data['error'][$key],'name'=> $data['name'][$key],'type'=> $data['type'][$key],'tmp_name'=> $data['tmp_name'][$key],'size'=> $data['size'][$key]
+));
+}
+return $files;
+}
+}
+}
+namespace Symfony\Component\HttpFoundation
+{
+class ServerBag extends ParameterBag
+{
+public function getHeaders()
+{
+$headers = array();
+$contentHeaders = array('CONTENT_LENGTH'=> true,'CONTENT_MD5'=> true,'CONTENT_TYPE'=> true);
+foreach ($this->parameters as $key => $value) {
+if (0 === strpos($key,'HTTP_')) {
+$headers[substr($key, 5)] = $value;
+}
+elseif (isset($contentHeaders[$key])) {
+$headers[$key] = $value;
+}
+}
+if (isset($this->parameters['PHP_AUTH_USER'])) {
+$headers['PHP_AUTH_USER'] = $this->parameters['PHP_AUTH_USER'];
+$headers['PHP_AUTH_PW'] = isset($this->parameters['PHP_AUTH_PW']) ? $this->parameters['PHP_AUTH_PW'] :'';
+} else {
+$authorizationHeader = null;
+if (isset($this->parameters['HTTP_AUTHORIZATION'])) {
+$authorizationHeader = $this->parameters['HTTP_AUTHORIZATION'];
+} elseif (isset($this->parameters['REDIRECT_HTTP_AUTHORIZATION'])) {
+$authorizationHeader = $this->parameters['REDIRECT_HTTP_AUTHORIZATION'];
+}
+if (null !== $authorizationHeader) {
+if (0 === stripos($authorizationHeader,'basic')) {
+$exploded = explode(':', base64_decode(substr($authorizationHeader, 6)));
+if (count($exploded) == 2) {
+list($headers['PHP_AUTH_USER'], $headers['PHP_AUTH_PW']) = $exploded;
+}
+} elseif (empty($this->parameters['PHP_AUTH_DIGEST']) && (0 === stripos($authorizationHeader,'digest'))) {
+$headers['PHP_AUTH_DIGEST'] = $authorizationHeader;
+$this->parameters['PHP_AUTH_DIGEST'] = $authorizationHeader;
+}
+}
+}
+if (isset($headers['PHP_AUTH_USER'])) {
+$headers['AUTHORIZATION'] ='Basic '.base64_encode($headers['PHP_AUTH_USER'].':'.$headers['PHP_AUTH_PW']);
+} elseif (isset($headers['PHP_AUTH_DIGEST'])) {
+$headers['AUTHORIZATION'] = $headers['PHP_AUTH_DIGEST'];
+}
+return $headers;
+}
+}
+}
+namespace Symfony\Component\HttpFoundation
+{
+use Symfony\Component\HttpFoundation\Session\SessionInterface;
+class Request
+{
+const HEADER_CLIENT_IP ='client_ip';
+const HEADER_CLIENT_HOST ='client_host';
+const HEADER_CLIENT_PROTO ='client_proto';
+const HEADER_CLIENT_PORT ='client_port';
+protected static $trustedProxies = array();
+protected static $trustedHostPatterns = array();
+protected static $trustedHosts = array();
+protected static $trustedHeaders = array(
+self::HEADER_CLIENT_IP =>'X_FORWARDED_FOR',
+self::HEADER_CLIENT_HOST =>'X_FORWARDED_HOST',
+self::HEADER_CLIENT_PROTO =>'X_FORWARDED_PROTO',
+self::HEADER_CLIENT_PORT =>'X_FORWARDED_PORT',
+);
+protected static $httpMethodParameterOverride = false;
+public $attributes;
+public $request;
+public $query;
+public $server;
+public $files;
+public $cookies;
+public $headers;
+protected $content;
+protected $languages;
+protected $charsets;
+protected $encodings;
+protected $acceptableContentTypes;
+protected $pathInfo;
+protected $requestUri;
+protected $baseUrl;
+protected $basePath;
+protected $method;
+protected $format;
+protected $session;
+protected $locale;
+protected $defaultLocale ='en';
+protected static $formats;
+protected static $requestFactory;
+public function __construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null)
+{
+$this->initialize($query, $request, $attributes, $cookies, $files, $server, $content);
+}
+public function initialize(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null)
+{
+$this->request = new ParameterBag($request);
+$this->query = new ParameterBag($query);
+$this->attributes = new ParameterBag($attributes);
+$this->cookies = new ParameterBag($cookies);
+$this->files = new FileBag($files);
+$this->server = new ServerBag($server);
+$this->headers = new HeaderBag($this->server->getHeaders());
+$this->content = $content;
+$this->languages = null;
+$this->charsets = null;
+$this->encodings = null;
+$this->acceptableContentTypes = null;
+$this->pathInfo = null;
+$this->requestUri = null;
+$this->baseUrl = null;
+$this->basePath = null;
+$this->method = null;
+$this->format = null;
+}
+public static function createFromGlobals()
+{
+$request = self::createRequestFromFactory($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
+if (0 === strpos($request->headers->get('CONTENT_TYPE'),'application/x-www-form-urlencoded')
+&& in_array(strtoupper($request->server->get('REQUEST_METHOD','GET')), array('PUT','DELETE','PATCH'))
+) {
+parse_str($request->getContent(), $data);
+$request->request = new ParameterBag($data);
+}
+return $request;
+}
+public static function create($uri, $method ='GET', $parameters = array(), $cookies = array(), $files = array(), $server = array(), $content = null)
+{
+$server = array_replace(array('SERVER_NAME'=>'localhost','SERVER_PORT'=> 80,'HTTP_HOST'=>'localhost','HTTP_USER_AGENT'=>'Symfony/2.X','HTTP_ACCEPT'=>'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8','HTTP_ACCEPT_LANGUAGE'=>'en-us,en;q=0.5','HTTP_ACCEPT_CHARSET'=>'ISO-8859-1,utf-8;q=0.7,*;q=0.7','REMOTE_ADDR'=>'127.0.0.1','SCRIPT_NAME'=>'','SCRIPT_FILENAME'=>'','SERVER_PROTOCOL'=>'HTTP/1.1','REQUEST_TIME'=> time(),
+), $server);
+$server['PATH_INFO'] ='';
+$server['REQUEST_METHOD'] = strtoupper($method);
+$components = parse_url($uri);
+if (isset($components['host'])) {
+$server['SERVER_NAME'] = $components['host'];
+$server['HTTP_HOST'] = $components['host'];
+}
+if (isset($components['scheme'])) {
+if ('https'=== $components['scheme']) {
+$server['HTTPS'] ='on';
+$server['SERVER_PORT'] = 443;
+} else {
+unset($server['HTTPS']);
+$server['SERVER_PORT'] = 80;
+}
+}
+if (isset($components['port'])) {
+$server['SERVER_PORT'] = $components['port'];
+$server['HTTP_HOST'] = $server['HTTP_HOST'].':'.$components['port'];
+}
+if (isset($components['user'])) {
+$server['PHP_AUTH_USER'] = $components['user'];
+}
+if (isset($components['pass'])) {
+$server['PHP_AUTH_PW'] = $components['pass'];
+}
+if (!isset($components['path'])) {
+$components['path'] ='/';
+}
+switch (strtoupper($method)) {
+case'POST':
+case'PUT':
+case'DELETE':
+if (!isset($server['CONTENT_TYPE'])) {
+$server['CONTENT_TYPE'] ='application/x-www-form-urlencoded';
+}
+case'PATCH':
+$request = $parameters;
+$query = array();
+break;
+default:
+$request = array();
+$query = $parameters;
+break;
+}
+$queryString ='';
+if (isset($components['query'])) {
+parse_str(html_entity_decode($components['query']), $qs);
+if ($query) {
+$query = array_replace($qs, $query);
+$queryString = http_build_query($query,'','&');
+} else {
+$query = $qs;
+$queryString = $components['query'];
+}
+} elseif ($query) {
+$queryString = http_build_query($query,'','&');
+}
+$server['REQUEST_URI'] = $components['path'].(''!== $queryString ?'?'.$queryString :'');
+$server['QUERY_STRING'] = $queryString;
+return self::createRequestFromFactory($query, $request, array(), $cookies, $files, $server, $content);
+}
+public static function setFactory($callable)
+{
+self::$requestFactory = $callable;
+}
+public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null)
+{
+$dup = clone $this;
+if ($query !== null) {
+$dup->query = new ParameterBag($query);
+}
+if ($request !== null) {
+$dup->request = new ParameterBag($request);
+}
+if ($attributes !== null) {
+$dup->attributes = new ParameterBag($attributes);
+}
+if ($cookies !== null) {
+$dup->cookies = new ParameterBag($cookies);
+}
+if ($files !== null) {
+$dup->files = new FileBag($files);
+}
+if ($server !== null) {
+$dup->server = new ServerBag($server);
+$dup->headers = new HeaderBag($dup->server->getHeaders());
+}
+$dup->languages = null;
+$dup->charsets = null;
+$dup->encodings = null;
+$dup->acceptableContentTypes = null;
+$dup->pathInfo = null;
+$dup->requestUri = null;
+$dup->baseUrl = null;
+$dup->basePath = null;
+$dup->method = null;
+$dup->format = null;
+if (!$dup->get('_format') && $this->get('_format')) {
+$dup->attributes->set('_format', $this->get('_format'));
+}
+if (!$dup->getRequestFormat(null)) {
+$dup->setRequestFormat($format = $this->getRequestFormat(null));
+}
+return $dup;
+}
+public function __clone()
+{
+$this->query = clone $this->query;
+$this->request = clone $this->request;
+$this->attributes = clone $this->attributes;
+$this->cookies = clone $this->cookies;
+$this->files = clone $this->files;
+$this->server = clone $this->server;
+$this->headers = clone $this->headers;
+}
+public function __toString()
+{
+return
+sprintf('%s %s %s', $this->getMethod(), $this->getRequestUri(), $this->server->get('SERVER_PROTOCOL'))."\r\n".
+$this->headers."\r\n".
+$this->getContent();
+}
+public function overrideGlobals()
+{
+$_GET = $this->query->all();
+$_POST = $this->request->all();
+$_SERVER = $this->server->all();
+$_COOKIE = $this->cookies->all();
+foreach ($this->headers->all() as $key => $value) {
+$key = strtoupper(str_replace('-','_', $key));
+if (in_array($key, array('CONTENT_TYPE','CONTENT_LENGTH'))) {
+$_SERVER[$key] = implode(', ', $value);
+} else {
+$_SERVER['HTTP_'.$key] = implode(', ', $value);
+}
+}
+$request = array('g'=> $_GET,'p'=> $_POST,'c'=> $_COOKIE);
+$requestOrder = ini_get('request_order') ?: ini_get('variables_order');
+$requestOrder = preg_replace('#[^cgp]#','', strtolower($requestOrder)) ?:'gp';
+$_REQUEST = array();
+foreach (str_split($requestOrder) as $order) {
+$_REQUEST = array_merge($_REQUEST, $request[$order]);
+}
+}
+public static function setTrustedProxies(array $proxies)
+{
+self::$trustedProxies = $proxies;
+}
+public static function getTrustedProxies()
+{
+return self::$trustedProxies;
+}
+public static function setTrustedHosts(array $hostPatterns)
+{
+self::$trustedHostPatterns = array_map(function ($hostPattern) {
+return sprintf('{%s}i', str_replace('}','\\}', $hostPattern));
+}, $hostPatterns);
+self::$trustedHosts = array();
+}
+public static function getTrustedHosts()
+{
+return self::$trustedHostPatterns;
+}
+public static function setTrustedHeaderName($key, $value)
+{
+if (!array_key_exists($key, self::$trustedHeaders)) {
+throw new \InvalidArgumentException(sprintf('Unable to set the trusted header name for key "%s".', $key));
+}
+self::$trustedHeaders[$key] = $value;
+}
+public static function getTrustedHeaderName($key)
+{
+if (!array_key_exists($key, self::$trustedHeaders)) {
+throw new \InvalidArgumentException(sprintf('Unable to get the trusted header name for key "%s".', $key));
+}
+return self::$trustedHeaders[$key];
+}
+public static function normalizeQueryString($qs)
+{
+if (''== $qs) {
+return'';
+}
+$parts = array();
+$order = array();
+foreach (explode('&', $qs) as $param) {
+if (''=== $param ||'='=== $param[0]) {
+continue;
+}
+$keyValuePair = explode('=', $param, 2);
+$parts[] = isset($keyValuePair[1]) ?
+rawurlencode(urldecode($keyValuePair[0])).'='.rawurlencode(urldecode($keyValuePair[1])) :
+rawurlencode(urldecode($keyValuePair[0]));
+$order[] = urldecode($keyValuePair[0]);
+}
+array_multisort($order, SORT_ASC, $parts);
+return implode('&', $parts);
+}
+public static function enableHttpMethodParameterOverride()
+{
+self::$httpMethodParameterOverride = true;
+}
+public static function getHttpMethodParameterOverride()
+{
+return self::$httpMethodParameterOverride;
+}
+public function get($key, $default = null, $deep = false)
+{
+return $this->query->get($key, $this->attributes->get($key, $this->request->get($key, $default, $deep), $deep), $deep);
+}
+public function getSession()
+{
+return $this->session;
+}
+public function hasPreviousSession()
+{
+return $this->hasSession() && $this->cookies->has($this->session->getName());
+}
+public function hasSession()
+{
+return null !== $this->session;
+}
+public function setSession(SessionInterface $session)
+{
+$this->session = $session;
+}
+public function getClientIps()
+{
+$ip = $this->server->get('REMOTE_ADDR');
+if (!self::$trustedProxies) {
+return array($ip);
+}
+if (!self::$trustedHeaders[self::HEADER_CLIENT_IP] || !$this->headers->has(self::$trustedHeaders[self::HEADER_CLIENT_IP])) {
+return array($ip);
+}
+$clientIps = array_map('trim', explode(',', $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_IP])));
+$clientIps[] = $ip;
+$ip = $clientIps[0];
+foreach ($clientIps as $key => $clientIp) {
+if (IpUtils::checkIp($clientIp, self::$trustedProxies)) {
+unset($clientIps[$key]);
+}
+}
+return $clientIps ? array_reverse($clientIps) : array($ip);
+}
+public function getClientIp()
+{
+$ipAddresses = $this->getClientIps();
+return $ipAddresses[0];
+}
+public function getScriptName()
+{
+return $this->server->get('SCRIPT_NAME', $this->server->get('ORIG_SCRIPT_NAME',''));
+}
+public function getPathInfo()
+{
+if (null === $this->pathInfo) {
+$this->pathInfo = $this->preparePathInfo();
+}
+return $this->pathInfo;
+}
+public function getBasePath()
+{
+if (null === $this->basePath) {
+$this->basePath = $this->prepareBasePath();
+}
+return $this->basePath;
+}
+public function getBaseUrl()
+{
+if (null === $this->baseUrl) {
+$this->baseUrl = $this->prepareBaseUrl();
+}
+return $this->baseUrl;
+}
+public function getScheme()
+{
+return $this->isSecure() ?'https':'http';
+}
+public function getPort()
+{
+if (self::$trustedProxies) {
+if (self::$trustedHeaders[self::HEADER_CLIENT_PORT] && $port = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PORT])) {
+return $port;
+}
+if (self::$trustedHeaders[self::HEADER_CLIENT_PROTO] &&'https'=== $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PROTO],'http')) {
+return 443;
+}
+}
+if ($host = $this->headers->get('HOST')) {
+if (false !== $pos = strrpos($host,':')) {
+return intval(substr($host, $pos + 1));
+}
+return'https'=== $this->getScheme() ? 443 : 80;
+}
+return $this->server->get('SERVER_PORT');
+}
+public function getUser()
+{
+return $this->server->get('PHP_AUTH_USER');
+}
+public function getPassword()
+{
+return $this->server->get('PHP_AUTH_PW');
+}
+public function getUserInfo()
+{
+$userinfo = $this->getUser();
+$pass = $this->getPassword();
+if (''!= $pass) {
+$userinfo .= ":$pass";
+}
+return $userinfo;
+}
+public function getHttpHost()
+{
+$scheme = $this->getScheme();
+$port = $this->getPort();
+if (('http'== $scheme && $port == 80) || ('https'== $scheme && $port == 443)) {
+return $this->getHost();
+}
+return $this->getHost().':'.$port;
+}
+public function getRequestUri()
+{
+if (null === $this->requestUri) {
+$this->requestUri = $this->prepareRequestUri();
+}
+return $this->requestUri;
+}
+public function getSchemeAndHttpHost()
+{
+return $this->getScheme().'://'.$this->getHttpHost();
+}
+public function getUri()
+{
+if (null !== $qs = $this->getQueryString()) {
+$qs ='?'.$qs;
+}
+return $this->getSchemeAndHttpHost().$this->getBaseUrl().$this->getPathInfo().$qs;
+}
+public function getUriForPath($path)
+{
+return $this->getSchemeAndHttpHost().$this->getBaseUrl().$path;
+}
+public function getQueryString()
+{
+$qs = static::normalizeQueryString($this->server->get('QUERY_STRING'));
+return''=== $qs ? null : $qs;
+}
+public function isSecure()
+{
+if (self::$trustedProxies && self::$trustedHeaders[self::HEADER_CLIENT_PROTO] && $proto = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PROTO])) {
+return in_array(strtolower(current(explode(',', $proto))), array('https','on','ssl','1'));
+}
+return'on'== strtolower($this->server->get('HTTPS')) || 1 == $this->server->get('HTTPS');
+}
+public function getHost()
+{
+if (self::$trustedProxies && self::$trustedHeaders[self::HEADER_CLIENT_HOST] && $host = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_HOST])) {
+$elements = explode(',', $host);
+$host = $elements[count($elements) - 1];
+} elseif (!$host = $this->headers->get('HOST')) {
+if (!$host = $this->server->get('SERVER_NAME')) {
+$host = $this->server->get('SERVER_ADDR','');
+}
+}
+$host = strtolower(preg_replace('/:\d+$/','', trim($host)));
+if ($host && !preg_match('/^\[?(?:[a-zA-Z0-9-:\]_]+\.?)+$/', $host)) {
+throw new \UnexpectedValueException(sprintf('Invalid Host "%s"', $host));
+}
+if (count(self::$trustedHostPatterns) > 0) {
+if (in_array($host, self::$trustedHosts)) {
+return $host;
+}
+foreach (self::$trustedHostPatterns as $pattern) {
+if (preg_match($pattern, $host)) {
+self::$trustedHosts[] = $host;
+return $host;
+}
+}
+throw new \UnexpectedValueException(sprintf('Untrusted Host "%s"', $host));
+}
+return $host;
+}
+public function setMethod($method)
+{
+$this->method = null;
+$this->server->set('REQUEST_METHOD', $method);
+}
+public function getMethod()
+{
+if (null === $this->method) {
+$this->method = strtoupper($this->server->get('REQUEST_METHOD','GET'));
+if ('POST'=== $this->method) {
+if ($method = $this->headers->get('X-HTTP-METHOD-OVERRIDE')) {
+$this->method = strtoupper($method);
+} elseif (self::$httpMethodParameterOverride) {
+$this->method = strtoupper($this->request->get('_method', $this->query->get('_method','POST')));
+}
+}
+}
+return $this->method;
+}
+public function getRealMethod()
+{
+return strtoupper($this->server->get('REQUEST_METHOD','GET'));
+}
+public function getMimeType($format)
+{
+if (null === static::$formats) {
+static::initializeFormats();
+}
+return isset(static::$formats[$format]) ? static::$formats[$format][0] : null;
+}
+public function getFormat($mimeType)
+{
+if (false !== $pos = strpos($mimeType,';')) {
+$mimeType = substr($mimeType, 0, $pos);
+}
+if (null === static::$formats) {
+static::initializeFormats();
+}
+foreach (static::$formats as $format => $mimeTypes) {
+if (in_array($mimeType, (array) $mimeTypes)) {
+return $format;
+}
+}
+}
+public function setFormat($format, $mimeTypes)
+{
+if (null === static::$formats) {
+static::initializeFormats();
+}
+static::$formats[$format] = is_array($mimeTypes) ? $mimeTypes : array($mimeTypes);
+}
+public function getRequestFormat($default ='html')
+{
+if (null === $this->format) {
+$this->format = $this->get('_format', $default);
+}
+return $this->format;
+}
+public function setRequestFormat($format)
+{
+$this->format = $format;
+}
+public function getContentType()
+{
+return $this->getFormat($this->headers->get('CONTENT_TYPE'));
+}
+public function setDefaultLocale($locale)
+{
+$this->defaultLocale = $locale;
+if (null === $this->locale) {
+$this->setPhpDefaultLocale($locale);
+}
+}
+public function setLocale($locale)
+{
+$this->setPhpDefaultLocale($this->locale = $locale);
+}
+public function getLocale()
+{
+return null === $this->locale ? $this->defaultLocale : $this->locale;
+}
+public function isMethod($method)
+{
+return $this->getMethod() === strtoupper($method);
+}
+public function isMethodSafe()
+{
+return in_array($this->getMethod(), array('GET','HEAD'));
+}
+public function getContent($asResource = false)
+{
+if (false === $this->content || (true === $asResource && null !== $this->content)) {
+throw new \LogicException('getContent() can only be called once when using the resource return type.');
+}
+if (true === $asResource) {
+$this->content = false;
+return fopen('php://input','rb');
+}
+if (null === $this->content) {
+$this->content = file_get_contents('php://input');
+}
+return $this->content;
+}
+public function getETags()
+{
+return preg_split('/\s*,\s*/', $this->headers->get('if_none_match'), null, PREG_SPLIT_NO_EMPTY);
+}
+public function isNoCache()
+{
+return $this->headers->hasCacheControlDirective('no-cache') ||'no-cache'== $this->headers->get('Pragma');
+}
+public function getPreferredLanguage(array $locales = null)
+{
+$preferredLanguages = $this->getLanguages();
+if (empty($locales)) {
+return isset($preferredLanguages[0]) ? $preferredLanguages[0] : null;
+}
+if (!$preferredLanguages) {
+return $locales[0];
+}
+$extendedPreferredLanguages = array();
+foreach ($preferredLanguages as $language) {
+$extendedPreferredLanguages[] = $language;
+if (false !== $position = strpos($language,'_')) {
+$superLanguage = substr($language, 0, $position);
+if (!in_array($superLanguage, $preferredLanguages)) {
+$extendedPreferredLanguages[] = $superLanguage;
+}
+}
+}
+$preferredLanguages = array_values(array_intersect($extendedPreferredLanguages, $locales));
+return isset($preferredLanguages[0]) ? $preferredLanguages[0] : $locales[0];
+}
+public function getLanguages()
+{
+if (null !== $this->languages) {
+return $this->languages;
+}
+$languages = AcceptHeader::fromString($this->headers->get('Accept-Language'))->all();
+$this->languages = array();
+foreach (array_keys($languages) as $lang) {
+if (strstr($lang,'-')) {
+$codes = explode('-', $lang);
+if ($codes[0] =='i') {
+if (count($codes) > 1) {
+$lang = $codes[1];
+}
+} else {
+for ($i = 0, $max = count($codes); $i < $max; $i++) {
+if ($i == 0) {
+$lang = strtolower($codes[0]);
+} else {
+$lang .='_'.strtoupper($codes[$i]);
+}
+}
+}
+}
+$this->languages[] = $lang;
+}
+return $this->languages;
+}
+public function getCharsets()
+{
+if (null !== $this->charsets) {
+return $this->charsets;
+}
+return $this->charsets = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Charset'))->all());
+}
+public function getEncodings()
+{
+if (null !== $this->encodings) {
+return $this->encodings;
+}
+return $this->encodings = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all());
+}
+public function getAcceptableContentTypes()
+{
+if (null !== $this->acceptableContentTypes) {
+return $this->acceptableContentTypes;
+}
+return $this->acceptableContentTypes = array_keys(AcceptHeader::fromString($this->headers->get('Accept'))->all());
+}
+public function isXmlHttpRequest()
+{
+return'XMLHttpRequest'== $this->headers->get('X-Requested-With');
+}
+protected function prepareRequestUri()
+{
+$requestUri ='';
+if ($this->headers->has('X_ORIGINAL_URL')) {
+$requestUri = $this->headers->get('X_ORIGINAL_URL');
+$this->headers->remove('X_ORIGINAL_URL');
+$this->server->remove('HTTP_X_ORIGINAL_URL');
+$this->server->remove('UNENCODED_URL');
+$this->server->remove('IIS_WasUrlRewritten');
+} elseif ($this->headers->has('X_REWRITE_URL')) {
+$requestUri = $this->headers->get('X_REWRITE_URL');
+$this->headers->remove('X_REWRITE_URL');
+} elseif ($this->server->get('IIS_WasUrlRewritten') =='1'&& $this->server->get('UNENCODED_URL') !='') {
+$requestUri = $this->server->get('UNENCODED_URL');
+$this->server->remove('UNENCODED_URL');
+$this->server->remove('IIS_WasUrlRewritten');
+} elseif ($this->server->has('REQUEST_URI')) {
+$requestUri = $this->server->get('REQUEST_URI');
+$schemeAndHttpHost = $this->getSchemeAndHttpHost();
+if (strpos($requestUri, $schemeAndHttpHost) === 0) {
+$requestUri = substr($requestUri, strlen($schemeAndHttpHost));
+}
+} elseif ($this->server->has('ORIG_PATH_INFO')) {
+$requestUri = $this->server->get('ORIG_PATH_INFO');
+if (''!= $this->server->get('QUERY_STRING')) {
+$requestUri .='?'.$this->server->get('QUERY_STRING');
+}
+$this->server->remove('ORIG_PATH_INFO');
+}
+$this->server->set('REQUEST_URI', $requestUri);
+return $requestUri;
+}
+protected function prepareBaseUrl()
+{
+$filename = basename($this->server->get('SCRIPT_FILENAME'));
+if (basename($this->server->get('SCRIPT_NAME')) === $filename) {
+$baseUrl = $this->server->get('SCRIPT_NAME');
+} elseif (basename($this->server->get('PHP_SELF')) === $filename) {
+$baseUrl = $this->server->get('PHP_SELF');
+} elseif (basename($this->server->get('ORIG_SCRIPT_NAME')) === $filename) {
+$baseUrl = $this->server->get('ORIG_SCRIPT_NAME'); } else {
+$path = $this->server->get('PHP_SELF','');
+$file = $this->server->get('SCRIPT_FILENAME','');
+$segs = explode('/', trim($file,'/'));
+$segs = array_reverse($segs);
+$index = 0;
+$last = count($segs);
+$baseUrl ='';
+do {
+$seg = $segs[$index];
+$baseUrl ='/'.$seg.$baseUrl;
+++$index;
+} while ($last > $index && (false !== $pos = strpos($path, $baseUrl)) && 0 != $pos);
+}
+$requestUri = $this->getRequestUri();
+if ($baseUrl && false !== $prefix = $this->getUrlencodedPrefix($requestUri, $baseUrl)) {
+return $prefix;
+}
+if ($baseUrl && false !== $prefix = $this->getUrlencodedPrefix($requestUri, dirname($baseUrl))) {
+return rtrim($prefix,'/');
+}
+$truncatedRequestUri = $requestUri;
+if (false !== $pos = strpos($requestUri,'?')) {
+$truncatedRequestUri = substr($requestUri, 0, $pos);
+}
+$basename = basename($baseUrl);
+if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri), $basename)) {
+return'';
+}
+if (strlen($requestUri) >= strlen($baseUrl) && (false !== $pos = strpos($requestUri, $baseUrl)) && $pos !== 0) {
+$baseUrl = substr($requestUri, 0, $pos + strlen($baseUrl));
+}
+return rtrim($baseUrl,'/');
+}
+protected function prepareBasePath()
+{
+$filename = basename($this->server->get('SCRIPT_FILENAME'));
+$baseUrl = $this->getBaseUrl();
+if (empty($baseUrl)) {
+return'';
+}
+if (basename($baseUrl) === $filename) {
+$basePath = dirname($baseUrl);
+} else {
+$basePath = $baseUrl;
+}
+if ('\\'=== DIRECTORY_SEPARATOR) {
+$basePath = str_replace('\\','/', $basePath);
+}
+return rtrim($basePath,'/');
+}
+protected function preparePathInfo()
+{
+$baseUrl = $this->getBaseUrl();
+if (null === ($requestUri = $this->getRequestUri())) {
+return'/';
+}
+$pathInfo ='/';
+if ($pos = strpos($requestUri,'?')) {
+$requestUri = substr($requestUri, 0, $pos);
+}
+if (null !== $baseUrl && false === $pathInfo = substr($requestUri, strlen($baseUrl))) {
+return'/';
+} elseif (null === $baseUrl) {
+return $requestUri;
+}
+return (string) $pathInfo;
+}
+protected static function initializeFormats()
+{
+static::$formats = array('html'=> array('text/html','application/xhtml+xml'),'txt'=> array('text/plain'),'js'=> array('application/javascript','application/x-javascript','text/javascript'),'css'=> array('text/css'),'json'=> array('application/json','application/x-json'),'xml'=> array('text/xml','application/xml','application/x-xml'),'rdf'=> array('application/rdf+xml'),'atom'=> array('application/atom+xml'),'rss'=> array('application/rss+xml'),
+);
+}
+private function setPhpDefaultLocale($locale)
+{
+try {
+if (class_exists('Locale', false)) {
+\Locale::setDefault($locale);
+}
+} catch (\Exception $e) {
+}
+}
+private function getUrlencodedPrefix($string, $prefix)
+{
+if (0 !== strpos(rawurldecode($string), $prefix)) {
+return false;
+}
+$len = strlen($prefix);
+if (preg_match("#^(%[[:xdigit:]]{2}|.){{$len}}#", $string, $match)) {
+return $match[0];
+}
+return false;
+}
+private static function createRequestFromFactory(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null)
+{
+if (self::$requestFactory) {
+$request = call_user_func(self::$requestFactory, $query, $request, $attributes, $cookies, $files, $server, $content);
+if (!$request instanceof Request) {
+throw new \LogicException('The Request factory must return an instance of Symfony\Component\HttpFoundation\Request.');
+}
+return $request;
+}
+return new static($query, $request, $attributes, $cookies, $files, $server, $content);
+}
+}
+}
+namespace Symfony\Component\HttpFoundation
+{
+class Response
+{
+const HTTP_CONTINUE = 100;
+const HTTP_SWITCHING_PROTOCOLS = 101;
+const HTTP_PROCESSING = 102; const HTTP_OK = 200;
+const HTTP_CREATED = 201;
+const HTTP_ACCEPTED = 202;
+const HTTP_NON_AUTHORITATIVE_INFORMATION = 203;
+const HTTP_NO_CONTENT = 204;
+const HTTP_RESET_CONTENT = 205;
+const HTTP_PARTIAL_CONTENT = 206;
+const HTTP_MULTI_STATUS = 207; const HTTP_ALREADY_REPORTED = 208; const HTTP_IM_USED = 226; const HTTP_MULTIPLE_CHOICES = 300;
+const HTTP_MOVED_PERMANENTLY = 301;
+const HTTP_FOUND = 302;
+const HTTP_SEE_OTHER = 303;
+const HTTP_NOT_MODIFIED = 304;
+const HTTP_USE_PROXY = 305;
+const HTTP_RESERVED = 306;
+const HTTP_TEMPORARY_REDIRECT = 307;
+const HTTP_PERMANENTLY_REDIRECT = 308; const HTTP_BAD_REQUEST = 400;
+const HTTP_UNAUTHORIZED = 401;
+const HTTP_PAYMENT_REQUIRED = 402;
+const HTTP_FORBIDDEN = 403;
+const HTTP_NOT_FOUND = 404;
+const HTTP_METHOD_NOT_ALLOWED = 405;
+const HTTP_NOT_ACCEPTABLE = 406;
+const HTTP_PROXY_AUTHENTICATION_REQUIRED = 407;
+const HTTP_REQUEST_TIMEOUT = 408;
+const HTTP_CONFLICT = 409;
+const HTTP_GONE = 410;
+const HTTP_LENGTH_REQUIRED = 411;
+const HTTP_PRECONDITION_FAILED = 412;
+const HTTP_REQUEST_ENTITY_TOO_LARGE = 413;
+const HTTP_REQUEST_URI_TOO_LONG = 414;
+const HTTP_UNSUPPORTED_MEDIA_TYPE = 415;
+const HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
+const HTTP_EXPECTATION_FAILED = 417;
+const HTTP_I_AM_A_TEAPOT = 418; const HTTP_UNPROCESSABLE_ENTITY = 422; const HTTP_LOCKED = 423; const HTTP_FAILED_DEPENDENCY = 424; const HTTP_RESERVED_FOR_WEBDAV_ADVANCED_COLLECTIONS_EXPIRED_PROPOSAL = 425; const HTTP_UPGRADE_REQUIRED = 426; const HTTP_PRECONDITION_REQUIRED = 428; const HTTP_TOO_MANY_REQUESTS = 429; const HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; const HTTP_INTERNAL_SERVER_ERROR = 500;
+const HTTP_NOT_IMPLEMENTED = 501;
+const HTTP_BAD_GATEWAY = 502;
+const HTTP_SERVICE_UNAVAILABLE = 503;
+const HTTP_GATEWAY_TIMEOUT = 504;
+const HTTP_VERSION_NOT_SUPPORTED = 505;
+const HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL = 506; const HTTP_INSUFFICIENT_STORAGE = 507; const HTTP_LOOP_DETECTED = 508; const HTTP_NOT_EXTENDED = 510; const HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511;
+public $headers;
+protected $content;
+protected $version;
+protected $statusCode;
+protected $statusText;
+protected $charset;
+public static $statusTexts = array(
+100 =>'Continue',
+101 =>'Switching Protocols',
+102 =>'Processing', 200 =>'OK',
+201 =>'Created',
+202 =>'Accepted',
+203 =>'Non-Authoritative Information',
+204 =>'No Content',
+205 =>'Reset Content',
+206 =>'Partial Content',
+207 =>'Multi-Status', 208 =>'Already Reported', 226 =>'IM Used', 300 =>'Multiple Choices',
+301 =>'Moved Permanently',
+302 =>'Found',
+303 =>'See Other',
+304 =>'Not Modified',
+305 =>'Use Proxy',
+306 =>'Reserved',
+307 =>'Temporary Redirect',
+308 =>'Permanent Redirect', 400 =>'Bad Request',
+401 =>'Unauthorized',
+402 =>'Payment Required',
+403 =>'Forbidden',
+404 =>'Not Found',
+405 =>'Method Not Allowed',
+406 =>'Not Acceptable',
+407 =>'Proxy Authentication Required',
+408 =>'Request Timeout',
+409 =>'Conflict',
+410 =>'Gone',
+411 =>'Length Required',
+412 =>'Precondition Failed',
+413 =>'Request Entity Too Large',
+414 =>'Request-URI Too Long',
+415 =>'Unsupported Media Type',
+416 =>'Requested Range Not Satisfiable',
+417 =>'Expectation Failed',
+418 =>'I\'m a teapot', 422 =>'Unprocessable Entity', 423 =>'Locked', 424 =>'Failed Dependency', 425 =>'Reserved for WebDAV advanced collections expired proposal', 426 =>'Upgrade Required', 428 =>'Precondition Required', 429 =>'Too Many Requests', 431 =>'Request Header Fields Too Large', 500 =>'Internal Server Error',
+501 =>'Not Implemented',
+502 =>'Bad Gateway',
+503 =>'Service Unavailable',
+504 =>'Gateway Timeout',
+505 =>'HTTP Version Not Supported',
+506 =>'Variant Also Negotiates (Experimental)', 507 =>'Insufficient Storage', 508 =>'Loop Detected', 510 =>'Not Extended', 511 =>'Network Authentication Required', );
+public function __construct($content ='', $status = 200, $headers = array())
+{
+$this->headers = new ResponseHeaderBag($headers);
+$this->setContent($content);
+$this->setStatusCode($status);
+$this->setProtocolVersion('1.0');
+if (!$this->headers->has('Date')) {
+$this->setDate(new \DateTime(null, new \DateTimeZone('UTC')));
+}
+}
+public static function create($content ='', $status = 200, $headers = array())
+{
+return new static($content, $status, $headers);
+}
+public function __toString()
+{
+return
+sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText)."\r\n".
+$this->headers."\r\n".
+$this->getContent();
+}
+public function __clone()
+{
+$this->headers = clone $this->headers;
+}
+public function prepare(Request $request)
+{
+$headers = $this->headers;
+if ($this->isInformational() || in_array($this->statusCode, array(204, 304))) {
+$this->setContent(null);
+}
+if (!$headers->has('Content-Type')) {
+$format = $request->getRequestFormat();
+if (null !== $format && $mimeType = $request->getMimeType($format)) {
+$headers->set('Content-Type', $mimeType);
+}
+}
+$charset = $this->charset ?:'UTF-8';
+if (!$headers->has('Content-Type')) {
+$headers->set('Content-Type','text/html; charset='.$charset);
+} elseif (0 === stripos($headers->get('Content-Type'),'text/') && false === stripos($headers->get('Content-Type'),'charset')) {
+$headers->set('Content-Type', $headers->get('Content-Type').'; charset='.$charset);
+}
+if ($headers->has('Transfer-Encoding')) {
+$headers->remove('Content-Length');
+}
+if ($request->isMethod('HEAD')) {
+$length = $headers->get('Content-Length');
+$this->setContent(null);
+if ($length) {
+$headers->set('Content-Length', $length);
+}
+}
+if ('HTTP/1.0'!= $request->server->get('SERVER_PROTOCOL')) {
+$this->setProtocolVersion('1.1');
+}
+if ('1.0'== $this->getProtocolVersion() &&'no-cache'== $this->headers->get('Cache-Control')) {
+$this->headers->set('pragma','no-cache');
+$this->headers->set('expires', -1);
+}
+$this->ensureIEOverSSLCompatibility($request);
+return $this;
+}
+public function sendHeaders()
+{
+if (headers_sent()) {
+return $this;
+}
+header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode);
+foreach ($this->headers->allPreserveCase() as $name => $values) {
+foreach ($values as $value) {
+header($name.': '.$value, false, $this->statusCode);
+}
+}
+foreach ($this->headers->getCookies() as $cookie) {
+setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());
+}
+return $this;
+}
+public function sendContent()
+{
+echo $this->content;
+return $this;
+}
+public function send()
+{
+$this->sendHeaders();
+$this->sendContent();
+if (function_exists('fastcgi_finish_request')) {
+fastcgi_finish_request();
+} elseif ('cli'!== PHP_SAPI) {
+$previous = null;
+$obStatus = ob_get_status(1);
+while (($level = ob_get_level()) > 0 && $level !== $previous) {
+$previous = $level;
+if ($obStatus[$level - 1]) {
+if (version_compare(PHP_VERSION,'5.4','>=')) {
+if (isset($obStatus[$level - 1]['flags']) && ($obStatus[$level - 1]['flags'] & PHP_OUTPUT_HANDLER_REMOVABLE)) {
+ob_end_flush();
+}
+} else {
+if (isset($obStatus[$level - 1]['del']) && $obStatus[$level - 1]['del']) {
+ob_end_flush();
+}
+}
+}
+}
+flush();
+}
+return $this;
+}
+public function setContent($content)
+{
+if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable(array($content,'__toString'))) {
+throw new \UnexpectedValueException(sprintf('The Response content must be a string or object implementing __toString(), "%s" given.', gettype($content)));
+}
+$this->content = (string) $content;
+return $this;
+}
+public function getContent()
+{
+return $this->content;
+}
+public function setProtocolVersion($version)
+{
+$this->version = $version;
+return $this;
+}
+public function getProtocolVersion()
+{
+return $this->version;
+}
+public function setStatusCode($code, $text = null)
+{
+$this->statusCode = $code = (int) $code;
+if ($this->isInvalid()) {
+throw new \InvalidArgumentException(sprintf('The HTTP status code "%s" is not valid.', $code));
+}
+if (null === $text) {
+$this->statusText = isset(self::$statusTexts[$code]) ? self::$statusTexts[$code] :'';
+return $this;
+}
+if (false === $text) {
+$this->statusText ='';
+return $this;
+}
+$this->statusText = $text;
+return $this;
+}
+public function getStatusCode()
+{
+return $this->statusCode;
+}
+public function setCharset($charset)
+{
+$this->charset = $charset;
+return $this;
+}
+public function getCharset()
+{
+return $this->charset;
+}
+public function isCacheable()
+{
+if (!in_array($this->statusCode, array(200, 203, 300, 301, 302, 404, 410))) {
+return false;
+}
+if ($this->headers->hasCacheControlDirective('no-store') || $this->headers->getCacheControlDirective('private')) {
+return false;
+}
+return $this->isValidateable() || $this->isFresh();
+}
+public function isFresh()
+{
+return $this->getTtl() > 0;
+}
+public function isValidateable()
+{
+return $this->headers->has('Last-Modified') || $this->headers->has('ETag');
+}
+public function setPrivate()
+{
+$this->headers->removeCacheControlDirective('public');
+$this->headers->addCacheControlDirective('private');
+return $this;
+}
+public function setPublic()
+{
+$this->headers->addCacheControlDirective('public');
+$this->headers->removeCacheControlDirective('private');
+return $this;
+}
+public function mustRevalidate()
+{
+return $this->headers->hasCacheControlDirective('must-revalidate') || $this->headers->has('proxy-revalidate');
+}
+public function getDate()
+{
+return $this->headers->getDate('Date', new \DateTime());
+}
+public function setDate(\DateTime $date)
+{
+$date->setTimezone(new \DateTimeZone('UTC'));
+$this->headers->set('Date', $date->format('D, d M Y H:i:s').' GMT');
+return $this;
+}
+public function getAge()
+{
+if (null !== $age = $this->headers->get('Age')) {
+return (int) $age;
+}
+return max(time() - $this->getDate()->format('U'), 0);
+}
+public function expire()
+{
+if ($this->isFresh()) {
+$this->headers->set('Age', $this->getMaxAge());
+}
+return $this;
+}
+public function getExpires()
+{
+try {
+return $this->headers->getDate('Expires');
+} catch (\RuntimeException $e) {
+return \DateTime::createFromFormat(DATE_RFC2822,'Sat, 01 Jan 00 00:00:00 +0000');
+}
+}
+public function setExpires(\DateTime $date = null)
+{
+if (null === $date) {
+$this->headers->remove('Expires');
+} else {
+$date = clone $date;
+$date->setTimezone(new \DateTimeZone('UTC'));
+$this->headers->set('Expires', $date->format('D, d M Y H:i:s').' GMT');
+}
+return $this;
+}
+public function getMaxAge()
+{
+if ($this->headers->hasCacheControlDirective('s-maxage')) {
+return (int) $this->headers->getCacheControlDirective('s-maxage');
+}
+if ($this->headers->hasCacheControlDirective('max-age')) {
+return (int) $this->headers->getCacheControlDirective('max-age');
+}
+if (null !== $this->getExpires()) {
+return $this->getExpires()->format('U') - $this->getDate()->format('U');
+}
+}
+public function setMaxAge($value)
+{
+$this->headers->addCacheControlDirective('max-age', $value);
+return $this;
+}
+public function setSharedMaxAge($value)
+{
+$this->setPublic();
+$this->headers->addCacheControlDirective('s-maxage', $value);
+return $this;
+}
+public function getTtl()
+{
+if (null !== $maxAge = $this->getMaxAge()) {
+return $maxAge - $this->getAge();
+}
+}
+public function setTtl($seconds)
+{
+$this->setSharedMaxAge($this->getAge() + $seconds);
+return $this;
+}
+public function setClientTtl($seconds)
+{
+$this->setMaxAge($this->getAge() + $seconds);
+return $this;
+}
+public function getLastModified()
+{
+return $this->headers->getDate('Last-Modified');
+}
+public function setLastModified(\DateTime $date = null)
+{
+if (null === $date) {
+$this->headers->remove('Last-Modified');
+} else {
+$date = clone $date;
+$date->setTimezone(new \DateTimeZone('UTC'));
+$this->headers->set('Last-Modified', $date->format('D, d M Y H:i:s').' GMT');
+}
+return $this;
+}
+public function getEtag()
+{
+return $this->headers->get('ETag');
+}
+public function setEtag($etag = null, $weak = false)
+{
+if (null === $etag) {
+$this->headers->remove('Etag');
+} else {
+if (0 !== strpos($etag,'"')) {
+$etag ='"'.$etag.'"';
+}
+$this->headers->set('ETag', (true === $weak ?'W/':'').$etag);
+}
+return $this;
+}
+public function setCache(array $options)
+{
+if ($diff = array_diff(array_keys($options), array('etag','last_modified','max_age','s_maxage','private','public'))) {
+throw new \InvalidArgumentException(sprintf('Response does not support the following options: "%s".', implode('", "', array_values($diff))));
+}
+if (isset($options['etag'])) {
+$this->setEtag($options['etag']);
+}
+if (isset($options['last_modified'])) {
+$this->setLastModified($options['last_modified']);
+}
+if (isset($options['max_age'])) {
+$this->setMaxAge($options['max_age']);
+}
+if (isset($options['s_maxage'])) {
+$this->setSharedMaxAge($options['s_maxage']);
+}
+if (isset($options['public'])) {
+if ($options['public']) {
+$this->setPublic();
+} else {
+$this->setPrivate();
+}
+}
+if (isset($options['private'])) {
+if ($options['private']) {
+$this->setPrivate();
+} else {
+$this->setPublic();
+}
+}
+return $this;
+}
+public function setNotModified()
+{
+$this->setStatusCode(304);
+$this->setContent(null);
+foreach (array('Allow','Content-Encoding','Content-Language','Content-Length','Content-MD5','Content-Type','Last-Modified') as $header) {
+$this->headers->remove($header);
+}
+return $this;
+}
+public function hasVary()
+{
+return null !== $this->headers->get('Vary');
+}
+public function getVary()
+{
+if (!$vary = $this->headers->get('Vary', null, false)) {
+return array();
+}
+$ret = array();
+foreach ($vary as $item) {
+$ret = array_merge($ret, preg_split('/[\s,]+/', $item));
+}
+return $ret;
+}
+public function setVary($headers, $replace = true)
+{
+$this->headers->set('Vary', $headers, $replace);
+return $this;
+}
+public function isNotModified(Request $request)
+{
+if (!$request->isMethodSafe()) {
+return false;
+}
+$lastModified = $request->headers->get('If-Modified-Since');
+$notModified = false;
+if ($etags = $request->getEtags()) {
+$notModified = (in_array($this->getEtag(), $etags) || in_array('*', $etags)) && (!$lastModified || $this->headers->get('Last-Modified') == $lastModified);
+} elseif ($lastModified) {
+$notModified = $lastModified == $this->headers->get('Last-Modified');
+}
+if ($notModified) {
+$this->setNotModified();
+}
+return $notModified;
+}
+public function isInvalid()
+{
+return $this->statusCode < 100 || $this->statusCode >= 600;
+}
+public function isInformational()
+{
+return $this->statusCode >= 100 && $this->statusCode < 200;
+}
+public function isSuccessful()
+{
+return $this->statusCode >= 200 && $this->statusCode < 300;
+}
+public function isRedirection()
+{
+return $this->statusCode >= 300 && $this->statusCode < 400;
+}
+public function isClientError()
+{
+return $this->statusCode >= 400 && $this->statusCode < 500;
+}
+public function isServerError()
+{
+return $this->statusCode >= 500 && $this->statusCode < 600;
+}
+public function isOk()
+{
+return 200 === $this->statusCode;
+}
+public function isForbidden()
+{
+return 403 === $this->statusCode;
+}
+public function isNotFound()
+{
+return 404 === $this->statusCode;
+}
+public function isRedirect($location = null)
+{
+return in_array($this->statusCode, array(201, 301, 302, 303, 307, 308)) && (null === $location ?: $location == $this->headers->get('Location'));
+}
+public function isEmpty()
+{
+return in_array($this->statusCode, array(204, 304));
+}
+protected function ensureIEOverSSLCompatibility(Request $request)
+{
+if (false !== stripos($this->headers->get('Content-Disposition'),'attachment') && preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT'), $match) == 1 && true === $request->isSecure()) {
+if (intval(preg_replace("/(MSIE )(.*?);/","$2", $match[0])) < 9) {
+$this->headers->remove('Cache-Control');
+}
+}
+}
+}
+}
+namespace Symfony\Component\HttpFoundation
+{
+class ResponseHeaderBag extends HeaderBag
+{
+const COOKIES_FLAT ='flat';
+const COOKIES_ARRAY ='array';
+const DISPOSITION_ATTACHMENT ='attachment';
+const DISPOSITION_INLINE ='inline';
+protected $computedCacheControl = array();
+protected $cookies = array();
+protected $headerNames = array();
+public function __construct(array $headers = array())
+{
+parent::__construct($headers);
+if (!isset($this->headers['cache-control'])) {
+$this->set('Cache-Control','');
+}
+}
+public function __toString()
+{
+$cookies ='';
+foreach ($this->getCookies() as $cookie) {
+$cookies .='Set-Cookie: '.$cookie."\r\n";
+}
+ksort($this->headerNames);
+return parent::__toString().$cookies;
+}
+public function allPreserveCase()
+{
+return array_combine($this->headerNames, $this->headers);
+}
+public function replace(array $headers = array())
+{
+$this->headerNames = array();
+parent::replace($headers);
+if (!isset($this->headers['cache-control'])) {
+$this->set('Cache-Control','');
+}
+}
+public function set($key, $values, $replace = true)
+{
+parent::set($key, $values, $replace);
+$uniqueKey = strtr(strtolower($key),'_','-');
+$this->headerNames[$uniqueKey] = $key;
+if (in_array($uniqueKey, array('cache-control','etag','last-modified','expires'))) {
+$computed = $this->computeCacheControlValue();
+$this->headers['cache-control'] = array($computed);
+$this->headerNames['cache-control'] ='Cache-Control';
+$this->computedCacheControl = $this->parseCacheControl($computed);
+}
+}
+public function remove($key)
+{
+parent::remove($key);
+$uniqueKey = strtr(strtolower($key),'_','-');
+unset($this->headerNames[$uniqueKey]);
+if ('cache-control'=== $uniqueKey) {
+$this->computedCacheControl = array();
+}
+}
+public function hasCacheControlDirective($key)
+{
+return array_key_exists($key, $this->computedCacheControl);
+}
+public function getCacheControlDirective($key)
+{
+return array_key_exists($key, $this->computedCacheControl) ? $this->computedCacheControl[$key] : null;
+}
+public function setCookie(Cookie $cookie)
+{
+$this->cookies[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie;
+}
+public function removeCookie($name, $path ='/', $domain = null)
+{
+if (null === $path) {
+$path ='/';
+}
+unset($this->cookies[$domain][$path][$name]);
+if (empty($this->cookies[$domain][$path])) {
+unset($this->cookies[$domain][$path]);
+if (empty($this->cookies[$domain])) {
+unset($this->cookies[$domain]);
+}
+}
+}
+public function getCookies($format = self::COOKIES_FLAT)
+{
+if (!in_array($format, array(self::COOKIES_FLAT, self::COOKIES_ARRAY))) {
+throw new \InvalidArgumentException(sprintf('Format "%s" invalid (%s).', $format, implode(', ', array(self::COOKIES_FLAT, self::COOKIES_ARRAY))));
+}
+if (self::COOKIES_ARRAY === $format) {
+return $this->cookies;
+}
+$flattenedCookies = array();
+foreach ($this->cookies as $path) {
+foreach ($path as $cookies) {
+foreach ($cookies as $cookie) {
+$flattenedCookies[] = $cookie;
+}
+}
+}
+return $flattenedCookies;
+}
+public function clearCookie($name, $path ='/', $domain = null)
+{
+$this->setCookie(new Cookie($name, null, 1, $path, $domain));
+}
+public function makeDisposition($disposition, $filename, $filenameFallback ='')
+{
+if (!in_array($disposition, array(self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE))) {
+throw new \InvalidArgumentException(sprintf('The disposition must be either "%s" or "%s".', self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE));
+}
+if (''== $filenameFallback) {
+$filenameFallback = $filename;
+}
+if (!preg_match('/^[\x20-\x7e]*$/', $filenameFallback)) {
+throw new \InvalidArgumentException('The filename fallback must only contain ASCII characters.');
+}
+if (false !== strpos($filenameFallback,'%')) {
+throw new \InvalidArgumentException('The filename fallback cannot contain the "%" character.');
+}
+if (false !== strpos($filename,'/') || false !== strpos($filename,'\\') || false !== strpos($filenameFallback,'/') || false !== strpos($filenameFallback,'\\')) {
+throw new \InvalidArgumentException('The filename and the fallback cannot contain the "/" and "\\" characters.');
+}
+$output = sprintf('%s; filename="%s"', $disposition, str_replace('"','\\"', $filenameFallback));
+if ($filename !== $filenameFallback) {
+$output .= sprintf("; filename*=utf-8''%s", rawurlencode($filename));
+}
+return $output;
+}
+protected function computeCacheControlValue()
+{
+if (!$this->cacheControl && !$this->has('ETag') && !$this->has('Last-Modified') && !$this->has('Expires')) {
+return'no-cache';
+}
+if (!$this->cacheControl) {
+return'private, must-revalidate';
+}
+$header = $this->getCacheControlHeader();
+if (isset($this->cacheControl['public']) || isset($this->cacheControl['private'])) {
+return $header;
+}
+if (!isset($this->cacheControl['s-maxage'])) {
+return $header.', private';
+}
+return $header;
+}
+}
+}
+namespace Symfony\Component\DependencyInjection
+{
+interface ContainerAwareInterface
+{
+public function setContainer(ContainerInterface $container = null);
+}
+}
+namespace Symfony\Component\DependencyInjection
+{
+use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
+use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
+use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
+interface ContainerInterface
+{
+const EXCEPTION_ON_INVALID_REFERENCE = 1;
+const NULL_ON_INVALID_REFERENCE = 2;
+const IGNORE_ON_INVALID_REFERENCE = 3;
+const SCOPE_CONTAINER ='container';
+const SCOPE_PROTOTYPE ='prototype';
+public function set($id, $service, $scope = self::SCOPE_CONTAINER);
+public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE);
+public function has($id);
+public function getParameter($name);
+public function hasParameter($name);
+public function setParameter($name, $value);
+public function enterScope($name);
+public function leaveScope($name);
+public function addScope(ScopeInterface $scope);
+public function hasScope($name);
+public function isScopeActive($name);
+}
+}
+namespace Symfony\Component\DependencyInjection
+{
+interface IntrospectableContainerInterface extends ContainerInterface
+{
+public function initialized($id);
+}
+}
+namespace Symfony\Component\DependencyInjection
+{
+use Symfony\Component\DependencyInjection\Exception\InactiveScopeException;
+use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
+use Symfony\Component\DependencyInjection\Exception\RuntimeException;
+use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
+use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
+use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
+class Container implements IntrospectableContainerInterface
+{
+protected $parameterBag;
+protected $services = array();
+protected $methodMap = array();
+protected $aliases = array();
+protected $scopes = array();
+protected $scopeChildren = array();
+protected $scopedServices = array();
+protected $scopeStacks = array();
+protected $loading = array();
+public function __construct(ParameterBagInterface $parameterBag = null)
+{
+$this->parameterBag = $parameterBag ?: new ParameterBag();
+$this->set('service_container', $this);
+}
+public function compile()
+{
+$this->parameterBag->resolve();
+$this->parameterBag = new FrozenParameterBag($this->parameterBag->all());
+}
+public function isFrozen()
+{
+return $this->parameterBag instanceof FrozenParameterBag;
+}
+public function getParameterBag()
+{
+return $this->parameterBag;
+}
+public function getParameter($name)
+{
+return $this->parameterBag->get($name);
+}
+public function hasParameter($name)
+{
+return $this->parameterBag->has($name);
+}
+public function setParameter($name, $value)
+{
+$this->parameterBag->set($name, $value);
+}
+public function set($id, $service, $scope = self::SCOPE_CONTAINER)
+{
+if (self::SCOPE_PROTOTYPE === $scope) {
+throw new InvalidArgumentException(sprintf('You cannot set service "%s" of scope "prototype".', $id));
+}
+$id = strtolower($id);
+if (self::SCOPE_CONTAINER !== $scope) {
+if (!isset($this->scopedServices[$scope])) {
+throw new RuntimeException(sprintf('You cannot set service "%s" of inactive scope.', $id));
+}
+$this->scopedServices[$scope][$id] = $service;
+}
+$this->services[$id] = $service;
+if (method_exists($this, $method ='synchronize'.strtr($id, array('_'=>'','.'=>'_','\\'=>'_')).'Service')) {
+$this->$method();
+}
+if (self::SCOPE_CONTAINER !== $scope && null === $service) {
+unset($this->scopedServices[$scope][$id]);
+}
+if (null === $service) {
+unset($this->services[$id]);
+}
+}
+public function has($id)
+{
+$id = strtolower($id);
+return isset($this->services[$id])
+|| array_key_exists($id, $this->services)
+|| isset($this->aliases[$id])
+|| method_exists($this,'get'.strtr($id, array('_'=>'','.'=>'_','\\'=>'_')).'Service')
+;
+}
+public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
+{
+foreach (array(false, true) as $strtolower) {
+if ($strtolower) {
+$id = strtolower($id);
+}
+if (isset($this->aliases[$id])) {
+$id = $this->aliases[$id];
+}
+if (isset($this->services[$id]) || array_key_exists($id, $this->services)) {
+return $this->services[$id];
+}
+}
+if (isset($this->loading[$id])) {
+throw new ServiceCircularReferenceException($id, array_keys($this->loading));
+}
+if (isset($this->methodMap[$id])) {
+$method = $this->methodMap[$id];
+} elseif (method_exists($this, $method ='get'.strtr($id, array('_'=>'','.'=>'_','\\'=>'_')).'Service')) {
+} else {
+if (self::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) {
+if (!$id) {
+throw new ServiceNotFoundException($id);
+}
+$alternatives = array();
+foreach (array_keys($this->services) as $key) {
+$lev = levenshtein($id, $key);
+if ($lev <= strlen($id) / 3 || false !== strpos($key, $id)) {
+$alternatives[] = $key;
+}
+}
+throw new ServiceNotFoundException($id, null, null, $alternatives);
+}
+return;
+}
+$this->loading[$id] = true;
+try {
+$service = $this->$method();
+} catch (\Exception $e) {
+unset($this->loading[$id]);
+if (array_key_exists($id, $this->services)) {
+unset($this->services[$id]);
+}
+if ($e instanceof InactiveScopeException && self::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) {
+return;
+}
+throw $e;
+}
+unset($this->loading[$id]);
+return $service;
+}
+public function initialized($id)
+{
+$id = strtolower($id);
+return isset($this->services[$id]) || array_key_exists($id, $this->services);
+}
+public function getServiceIds()
+{
+$ids = array();
+$r = new \ReflectionClass($this);
+foreach ($r->getMethods() as $method) {
+if (preg_match('/^get(.+)Service$/', $method->name, $match)) {
+$ids[] = self::underscore($match[1]);
+}
+}
+return array_unique(array_merge($ids, array_keys($this->services)));
+}
+public function enterScope($name)
+{
+if (!isset($this->scopes[$name])) {
+throw new InvalidArgumentException(sprintf('The scope "%s" does not exist.', $name));
+}
+if (self::SCOPE_CONTAINER !== $this->scopes[$name] && !isset($this->scopedServices[$this->scopes[$name]])) {
+throw new RuntimeException(sprintf('The parent scope "%s" must be active when entering this scope.', $this->scopes[$name]));
+}
+if (isset($this->scopedServices[$name])) {
+$services = array($this->services, $name => $this->scopedServices[$name]);
+unset($this->scopedServices[$name]);
+foreach ($this->scopeChildren[$name] as $child) {
+if (isset($this->scopedServices[$child])) {
+$services[$child] = $this->scopedServices[$child];
+unset($this->scopedServices[$child]);
+}
+}
+$this->services = call_user_func_array('array_diff_key', $services);
+array_shift($services);
+if (!isset($this->scopeStacks[$name])) {
+$this->scopeStacks[$name] = new \SplStack();
+}
+$this->scopeStacks[$name]->push($services);
+}
+$this->scopedServices[$name] = array();
+}
+public function leaveScope($name)
+{
+if (!isset($this->scopedServices[$name])) {
+throw new InvalidArgumentException(sprintf('The scope "%s" is not active.', $name));
+}
+$services = array($this->services, $this->scopedServices[$name]);
+unset($this->scopedServices[$name]);
+foreach ($this->scopeChildren[$name] as $child) {
+if (!isset($this->scopedServices[$child])) {
+continue;
+}
+$services[] = $this->scopedServices[$child];
+unset($this->scopedServices[$child]);
+}
+$this->services = call_user_func_array('array_diff_key', $services);
+if (isset($this->scopeStacks[$name]) && count($this->scopeStacks[$name]) > 0) {
+$services = $this->scopeStacks[$name]->pop();
+$this->scopedServices += $services;
+foreach ($services as $array) {
+foreach ($array as $id => $service) {
+$this->set($id, $service, $name);
+}
+}
+}
+}
+public function addScope(ScopeInterface $scope)
+{
+$name = $scope->getName();
+$parentScope = $scope->getParentName();
+if (self::SCOPE_CONTAINER === $name || self::SCOPE_PROTOTYPE === $name) {
+throw new InvalidArgumentException(sprintf('The scope "%s" is reserved.', $name));
+}
+if (isset($this->scopes[$name])) {
+throw new InvalidArgumentException(sprintf('A scope with name "%s" already exists.', $name));
+}
+if (self::SCOPE_CONTAINER !== $parentScope && !isset($this->scopes[$parentScope])) {
+throw new InvalidArgumentException(sprintf('The parent scope "%s" does not exist, or is invalid.', $parentScope));
+}
+$this->scopes[$name] = $parentScope;
+$this->scopeChildren[$name] = array();
+while ($parentScope !== self::SCOPE_CONTAINER) {
+$this->scopeChildren[$parentScope][] = $name;
+$parentScope = $this->scopes[$parentScope];
+}
+}
+public function hasScope($name)
+{
+return isset($this->scopes[$name]);
+}
+public function isScopeActive($name)
+{
+return isset($this->scopedServices[$name]);
+}
+public static function camelize($id)
+{
+return strtr(ucwords(strtr($id, array('_'=>' ','.'=>'_ ','\\'=>'_ '))), array(' '=>''));
+}
+public static function underscore($id)
+{
+return strtolower(preg_replace(array('/([A-Z]+)([A-Z][a-z])/','/([a-z\d])([A-Z])/'), array('\\1_\\2','\\1_\\2'), strtr($id,'_','.')));
+}
+}
+}
+namespace Symfony\Component\HttpKernel
+{
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+interface HttpKernelInterface
+{
+const MASTER_REQUEST = 1;
+const SUB_REQUEST = 2;
+public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true);
+}
+}
+namespace Symfony\Component\HttpKernel
+{
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\HttpKernel\Bundle\BundleInterface;
+use Symfony\Component\Config\Loader\LoaderInterface;
+interface KernelInterface extends HttpKernelInterface, \Serializable
+{
+public function registerBundles();
+public function registerContainerConfiguration(LoaderInterface $loader);
+public function boot();
+public function shutdown();
+public function getBundles();
+public function isClassInActiveBundle($class);
+public function getBundle($name, $first = true);
+public function locateResource($name, $dir = null, $first = true);
+public function getName();
+public function getEnvironment();
+public function isDebug();
+public function getRootDir();
+public function getContainer();
+public function getStartTime();
+public function getCacheDir();
+public function getLogDir();
+public function getCharset();
+}
+}
+namespace Symfony\Component\HttpKernel
+{
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+interface TerminableInterface
+{
+public function terminate(Request $request, Response $response);
+}
+}
+namespace Symfony\Component\HttpKernel
+{
+use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator;
+use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
+use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
+use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
+use Symfony\Component\DependencyInjection\Loader\IniFileLoader;
+use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
+use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpKernel\Bundle\BundleInterface;
+use Symfony\Component\HttpKernel\Config\FileLocator;
+use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
+use Symfony\Component\HttpKernel\DependencyInjection\AddClassesToCachePass;
+use Symfony\Component\Config\Loader\LoaderResolver;
+use Symfony\Component\Config\Loader\DelegatingLoader;
+use Symfony\Component\Config\ConfigCache;
+use Symfony\Component\ClassLoader\ClassCollectionLoader;
+abstract class Kernel implements KernelInterface, TerminableInterface
+{
+protected $bundles = array();
+protected $bundleMap;
+protected $container;
+protected $rootDir;
+protected $environment;
+protected $debug;
+protected $booted = false;
+protected $name;
+protected $startTime;
+protected $loadClassCache;
+const VERSION ='2.4.4';
+const VERSION_ID ='20404';
+const MAJOR_VERSION ='2';
+const MINOR_VERSION ='4';
+const RELEASE_VERSION ='4';
+const EXTRA_VERSION ='';
+public function __construct($environment, $debug)
+{
+$this->environment = $environment;
+$this->debug = (bool) $debug;
+$this->rootDir = $this->getRootDir();
+$this->name = $this->getName();
+if ($this->debug) {
+$this->startTime = microtime(true);
+}
+$this->init();
+}
+public function init()
+{
+}
+public function __clone()
+{
+if ($this->debug) {
+$this->startTime = microtime(true);
+}
+$this->booted = false;
+$this->container = null;
+}
+public function boot()
+{
+if (true === $this->booted) {
+return;
+}
+if ($this->loadClassCache) {
+$this->doLoadClassCache($this->loadClassCache[0], $this->loadClassCache[1]);
+}
+$this->initializeBundles();
+$this->initializeContainer();
+foreach ($this->getBundles() as $bundle) {
+$bundle->setContainer($this->container);
+$bundle->boot();
+}
+$this->booted = true;
+}
+public function terminate(Request $request, Response $response)
+{
+if (false === $this->booted) {
+return;
+}
+if ($this->getHttpKernel() instanceof TerminableInterface) {
+$this->getHttpKernel()->terminate($request, $response);
+}
+}
+public function shutdown()
+{
+if (false === $this->booted) {
+return;
+}
+$this->booted = false;
+foreach ($this->getBundles() as $bundle) {
+$bundle->shutdown();
+$bundle->setContainer(null);
+}
+$this->container = null;
+}
+public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
+{
+if (false === $this->booted) {
+$this->boot();
+}
+return $this->getHttpKernel()->handle($request, $type, $catch);
+}
+protected function getHttpKernel()
+{
+return $this->container->get('http_kernel');
+}
+public function getBundles()
+{
+return $this->bundles;
+}
+public function isClassInActiveBundle($class)
+{
+foreach ($this->getBundles() as $bundle) {
+if (0 === strpos($class, $bundle->getNamespace())) {
+return true;
+}
+}
+return false;
+}
+public function getBundle($name, $first = true)
+{
+if (!isset($this->bundleMap[$name])) {
+throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your %s.php file?', $name, get_class($this)));
+}
+if (true === $first) {
+return $this->bundleMap[$name][0];
+}
+return $this->bundleMap[$name];
+}
+public function locateResource($name, $dir = null, $first = true)
+{
+if ('@'!== $name[0]) {
+throw new \InvalidArgumentException(sprintf('A resource name must start with @ ("%s" given).', $name));
+}
+if (false !== strpos($name,'..')) {
+throw new \RuntimeException(sprintf('File name "%s" contains invalid characters (..).', $name));
+}
+$bundleName = substr($name, 1);
+$path ='';
+if (false !== strpos($bundleName,'/')) {
+list($bundleName, $path) = explode('/', $bundleName, 2);
+}
+$isResource = 0 === strpos($path,'Resources') && null !== $dir;
+$overridePath = substr($path, 9);
+$resourceBundle = null;
+$bundles = $this->getBundle($bundleName, false);
+$files = array();
+foreach ($bundles as $bundle) {
+if ($isResource && file_exists($file = $dir.'/'.$bundle->getName().$overridePath)) {
+if (null !== $resourceBundle) {
+throw new \RuntimeException(sprintf('"%s" resource is hidden by a resource from the "%s" derived bundle. Create a "%s" file to override the bundle resource.',
+$file,
+$resourceBundle,
+$dir.'/'.$bundles[0]->getName().$overridePath
+));
+}
+if ($first) {
+return $file;
+}
+$files[] = $file;
+}
+if (file_exists($file = $bundle->getPath().'/'.$path)) {
+if ($first && !$isResource) {
+return $file;
+}
+$files[] = $file;
+$resourceBundle = $bundle->getName();
+}
+}
+if (count($files) > 0) {
+return $first && $isResource ? $files[0] : $files;
+}
+throw new \InvalidArgumentException(sprintf('Unable to find file "%s".', $name));
+}
+public function getName()
+{
+if (null === $this->name) {
+$this->name = preg_replace('/[^a-zA-Z0-9_]+/','', basename($this->rootDir));
+}
+return $this->name;
+}
+public function getEnvironment()
+{
+return $this->environment;
+}
+public function isDebug()
+{
+return $this->debug;
+}
+public function getRootDir()
+{
+if (null === $this->rootDir) {
+$r = new \ReflectionObject($this);
+$this->rootDir = str_replace('\\','/', dirname($r->getFileName()));
+}
+return $this->rootDir;
+}
+public function getContainer()
+{
+return $this->container;
+}
+public function loadClassCache($name ='classes', $extension ='.php')
+{
+$this->loadClassCache = array($name, $extension);
+}
+public function setClassCache(array $classes)
+{
+file_put_contents($this->getCacheDir().'/classes.map', sprintf('<?php return %s;', var_export($classes, true)));
+}
+public function getStartTime()
+{
+return $this->debug ? $this->startTime : -INF;
+}
+public function getCacheDir()
+{
+return $this->rootDir.'/cache/'.$this->environment;
+}
+public function getLogDir()
+{
+return $this->rootDir.'/logs';
+}
+public function getCharset()
+{
+return'UTF-8';
+}
+protected function doLoadClassCache($name, $extension)
+{
+if (!$this->booted && is_file($this->getCacheDir().'/classes.map')) {
+ClassCollectionLoader::load(include($this->getCacheDir().'/classes.map'), $this->getCacheDir(), $name, $this->debug, false, $extension);
+}
+}
+protected function initializeBundles()
+{
+$this->bundles = array();
+$topMostBundles = array();
+$directChildren = array();
+foreach ($this->registerBundles() as $bundle) {
+$name = $bundle->getName();
+if (isset($this->bundles[$name])) {
+throw new \LogicException(sprintf('Trying to register two bundles with the same name "%s"', $name));
+}
+$this->bundles[$name] = $bundle;
+if ($parentName = $bundle->getParent()) {
+if (isset($directChildren[$parentName])) {
+throw new \LogicException(sprintf('Bundle "%s" is directly extended by two bundles "%s" and "%s".', $parentName, $name, $directChildren[$parentName]));
+}
+if ($parentName == $name) {
+throw new \LogicException(sprintf('Bundle "%s" can not extend itself.', $name));
+}
+$directChildren[$parentName] = $name;
+} else {
+$topMostBundles[$name] = $bundle;
+}
+}
+if (!empty($directChildren) && count($diff = array_diff_key($directChildren, $this->bundles))) {
+$diff = array_keys($diff);
+throw new \LogicException(sprintf('Bundle "%s" extends bundle "%s", which is not registered.', $directChildren[$diff[0]], $diff[0]));
+}
+$this->bundleMap = array();
+foreach ($topMostBundles as $name => $bundle) {
+$bundleMap = array($bundle);
+$hierarchy = array($name);
+while (isset($directChildren[$name])) {
+$name = $directChildren[$name];
+array_unshift($bundleMap, $this->bundles[$name]);
+$hierarchy[] = $name;
+}
+foreach ($hierarchy as $bundle) {
+$this->bundleMap[$bundle] = $bundleMap;
+array_pop($bundleMap);
+}
+}
+}
+protected function getContainerClass()
+{
+return $this->name.ucfirst($this->environment).($this->debug ?'Debug':'').'ProjectContainer';
+}
+protected function getContainerBaseClass()
+{
+return'Container';
+}
+protected function initializeContainer()
+{
+$class = $this->getContainerClass();
+$cache = new ConfigCache($this->getCacheDir().'/'.$class.'.php', $this->debug);
+$fresh = true;
+if (!$cache->isFresh()) {
+$container = $this->buildContainer();
+$container->compile();
+$this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass());
+$fresh = false;
+}
+require_once $cache;
+$this->container = new $class();
+$this->container->set('kernel', $this);
+if (!$fresh && $this->container->has('cache_warmer')) {
+$this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'));
+}
+}
+protected function getKernelParameters()
+{
+$bundles = array();
+foreach ($this->bundles as $name => $bundle) {
+$bundles[$name] = get_class($bundle);
+}
+return array_merge(
+array('kernel.root_dir'=> $this->rootDir,'kernel.environment'=> $this->environment,'kernel.debug'=> $this->debug,'kernel.name'=> $this->name,'kernel.cache_dir'=> $this->getCacheDir(),'kernel.logs_dir'=> $this->getLogDir(),'kernel.bundles'=> $bundles,'kernel.charset'=> $this->getCharset(),'kernel.container_class'=> $this->getContainerClass(),
+),
+$this->getEnvParameters()
+);
+}
+protected function getEnvParameters()
+{
+$parameters = array();
+foreach ($_SERVER as $key => $value) {
+if (0 === strpos($key,'SYMFONY__')) {
+$parameters[strtolower(str_replace('__','.', substr($key, 9)))] = $value;
+}
+}
+return $parameters;
+}
+protected function buildContainer()
+{
+foreach (array('cache'=> $this->getCacheDir(),'logs'=> $this->getLogDir()) as $name => $dir) {
+if (!is_dir($dir)) {
+if (false === @mkdir($dir, 0777, true)) {
+throw new \RuntimeException(sprintf("Unable to create the %s directory (%s)\n", $name, $dir));
+}
+} elseif (!is_writable($dir)) {
+throw new \RuntimeException(sprintf("Unable to write in the %s directory (%s)\n", $name, $dir));
+}
+}
+$container = $this->getContainerBuilder();
+$container->addObjectResource($this);
+$this->prepareContainer($container);
+if (null !== $cont = $this->registerContainerConfiguration($this->getContainerLoader($container))) {
+$container->merge($cont);
+}
+$container->addCompilerPass(new AddClassesToCachePass($this));
+return $container;
+}
+protected function prepareContainer(ContainerBuilder $container)
+{
+$extensions = array();
+foreach ($this->bundles as $bundle) {
+if ($extension = $bundle->getContainerExtension()) {
+$container->registerExtension($extension);
+$extensions[] = $extension->getAlias();
+}
+if ($this->debug) {
+$container->addObjectResource($bundle);
+}
+}
+foreach ($this->bundles as $bundle) {
+$bundle->build($container);
+}
+$container->getCompilerPassConfig()->setMergePass(new MergeExtensionConfigurationPass($extensions));
+}
+protected function getContainerBuilder()
+{
+$container = new ContainerBuilder(new ParameterBag($this->getKernelParameters()));
+if (class_exists('ProxyManager\Configuration')) {
+$container->setProxyInstantiator(new RuntimeInstantiator());
+}
+return $container;
+}
+protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container, $class, $baseClass)
+{
+$dumper = new PhpDumper($container);
+if (class_exists('ProxyManager\Configuration')) {
+$dumper->setProxyDumper(new ProxyDumper());
+}
+$content = $dumper->dump(array('class'=> $class,'base_class'=> $baseClass));
+if (!$this->debug) {
+$content = static::stripComments($content);
+}
+$cache->write($content, $container->getResources());
+}
+protected function getContainerLoader(ContainerInterface $container)
+{
+$locator = new FileLocator($this);
+$resolver = new LoaderResolver(array(
+new XmlFileLoader($container, $locator),
+new YamlFileLoader($container, $locator),
+new IniFileLoader($container, $locator),
+new PhpFileLoader($container, $locator),
+new ClosureLoader($container),
+));
+return new DelegatingLoader($resolver);
+}
+public static function stripComments($source)
+{
+if (!function_exists('token_get_all')) {
+return $source;
+}
+$rawChunk ='';
+$output ='';
+$tokens = token_get_all($source);
+$ignoreSpace = false;
+for (reset($tokens); false !== $token = current($tokens); next($tokens)) {
+if (is_string($token)) {
+$rawChunk .= $token;
+} elseif (T_START_HEREDOC === $token[0]) {
+$output .= $rawChunk.$token[1];
+do {
+$token = next($tokens);
+$output .= $token[1];
+} while ($token[0] !== T_END_HEREDOC);
+$rawChunk ='';
+} elseif (T_WHITESPACE === $token[0]) {
+if ($ignoreSpace) {
+$ignoreSpace = false;
+continue;
+}
+$rawChunk .= preg_replace(array('/\n{2,}/S'),"\n", $token[1]);
+} elseif (in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {
+$ignoreSpace = true;
+} else {
+$rawChunk .= $token[1];
+if (T_OPEN_TAG === $token[0]) {
+$ignoreSpace = true;
+}
+}
+}
+$output .= $rawChunk;
+return $output;
+}
+public function serialize()
+{
+return serialize(array($this->environment, $this->debug));
+}
+public function unserialize($data)
+{
+list($environment, $debug) = unserialize($data);
+$this->__construct($environment, $debug);
+}
+}
+}
+namespace Symfony\Component\ClassLoader
+{
+class ApcClassLoader
+{
+private $prefix;
+protected $decorated;
+public function __construct($prefix, $decorated)
+{
+if (!extension_loaded('apc')) {
+throw new \RuntimeException('Unable to use ApcClassLoader as APC is not enabled.');
+}
+if (!method_exists($decorated,'findFile')) {
+throw new \InvalidArgumentException('The class finder must implement a "findFile" method.');
+}
+$this->prefix = $prefix;
+$this->decorated = $decorated;
+}
+public function register($prepend = false)
+{
+spl_autoload_register(array($this,'loadClass'), true, $prepend);
+}
+public function unregister()
+{
+spl_autoload_unregister(array($this,'loadClass'));
+}
+public function loadClass($class)
+{
+if ($file = $this->findFile($class)) {
+require $file;
+return true;
+}
+}
+public function findFile($class)
+{
+if (false === $file = apc_fetch($this->prefix.$class)) {
+apc_store($this->prefix.$class, $file = $this->decorated->findFile($class));
+}
+return $file;
+}
+public function __call($method, $args)
+{
+return call_user_func_array(array($this->decorated, $method), $args);
+}
+}
+}
+namespace Symfony\Component\HttpKernel\Bundle
+{
+use Symfony\Component\DependencyInjection\ContainerAwareInterface;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
+interface BundleInterface extends ContainerAwareInterface
+{
+public function boot();
+public function shutdown();
+public function build(ContainerBuilder $container);
+public function getContainerExtension();
+public function getParent();
+public function getName();
+public function getNamespace();
+public function getPath();
+}
+}
+namespace Symfony\Component\DependencyInjection
+{
+abstract class ContainerAware implements ContainerAwareInterface
+{
+protected $container;
+public function setContainer(ContainerInterface $container = null)
+{
+$this->container = $container;
+}
+}
+}
+namespace Symfony\Component\HttpKernel\Bundle
+{
+use Symfony\Component\DependencyInjection\ContainerAware;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Container;
+use Symfony\Component\Console\Application;
+use Symfony\Component\Finder\Finder;
+use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
+abstract class Bundle extends ContainerAware implements BundleInterface
+{
+protected $name;
+protected $extension;
+protected $path;
+public function boot()
+{
+}
+public function shutdown()
+{
+}
+public function build(ContainerBuilder $container)
+{
+}
+public function getContainerExtension()
+{
+if (null === $this->extension) {
+$basename = preg_replace('/Bundle$/','', $this->getName());
+$class = $this->getNamespace().'\\DependencyInjection\\'.$basename.'Extension';
+if (class_exists($class)) {
+$extension = new $class();
+$expectedAlias = Container::underscore($basename);
+if ($expectedAlias != $extension->getAlias()) {
+throw new \LogicException(sprintf('The extension alias for the default extension of a '.'bundle must be the underscored version of the '.'bundle name ("%s" instead of "%s")',
+$expectedAlias, $extension->getAlias()
+));
+}
+$this->extension = $extension;
+} else {
+$this->extension = false;
+}
+}
+if ($this->extension) {
+return $this->extension;
+}
+}
+public function getNamespace()
+{
+$class = get_class($this);
+return substr($class, 0, strrpos($class,'\\'));
+}
+public function getPath()
+{
+if (null === $this->path) {
+$reflected = new \ReflectionObject($this);
+$this->path = dirname($reflected->getFileName());
+}
+return $this->path;
+}
+public function getParent()
+{
+}
+final public function getName()
+{
+if (null !== $this->name) {
+return $this->name;
+}
+$name = get_class($this);
+$pos = strrpos($name,'\\');
+return $this->name = false === $pos ? $name : substr($name, $pos + 1);
+}
+public function registerCommands(Application $application)
+{
+if (!is_dir($dir = $this->getPath().'/Command')) {
+return;
+}
+$finder = new Finder();
+$finder->files()->name('*Command.php')->in($dir);
+$prefix = $this->getNamespace().'\\Command';
+foreach ($finder as $file) {
+$ns = $prefix;
+if ($relativePath = $file->getRelativePath()) {
+$ns .='\\'.strtr($relativePath,'/','\\');
+}
+$class = $ns.'\\'.$file->getBasename('.php');
+if ($this->container) {
+$alias ='console.command.'.strtolower(str_replace('\\','_', $class));
+if ($this->container->has($alias)) {
+continue;
+}
+}
+$r = new \ReflectionClass($class);
+if ($r->isSubclassOf('Symfony\\Component\\Console\\Command\\Command') && !$r->isAbstract() && !$r->getConstructor()->getNumberOfRequiredParameters()) {
+$application->add($r->newInstance());
+}
+}
+}
+}
+}
+namespace Symfony\Component\Config
+{
+use Symfony\Component\Config\Resource\ResourceInterface;
+use Symfony\Component\Filesystem\Filesystem;
+class ConfigCache
+{
+private $debug;
+private $file;
+public function __construct($file, $debug)
+{
+$this->file = $file;
+$this->debug = (bool) $debug;
+}
+public function __toString()
+{
+return $this->file;
+}
+public function isFresh()
+{
+if (!is_file($this->file)) {
+return false;
+}
+if (!$this->debug) {
+return true;
+}
+$metadata = $this->getMetaFile();
+if (!is_file($metadata)) {
+return false;
+}
+$time = filemtime($this->file);
+$meta = unserialize(file_get_contents($metadata));
+foreach ($meta as $resource) {
+if (!$resource->isFresh($time)) {
+return false;
+}
+}
+return true;
+}
+public function write($content, array $metadata = null)
+{
+$mode = 0666 & ~umask();
+$filesystem = new Filesystem();
+$filesystem->dumpFile($this->file, $content, null);
+@chmod($this->file, $mode);
+if (null !== $metadata && true === $this->debug) {
+$filesystem->dumpFile($this->getMetaFile(), serialize($metadata), null);
+@chmod($this->getMetaFile(), $mode);
+}
+}
+private function getMetaFile()
+{
+return $this->file.'.meta';
+}
+}
+}
+namespace Symfony\Component\HttpKernel
+{
+use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
+use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
+use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
+use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent;
+use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
+use Symfony\Component\HttpKernel\Event\PostResponseEvent;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\RequestStack;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
+class HttpKernel implements HttpKernelInterface, TerminableInterface
+{
+protected $dispatcher;
+protected $resolver;
+protected $requestStack;
+public function __construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver, RequestStack $requestStack = null)
+{
+$this->dispatcher = $dispatcher;
+$this->resolver = $resolver;
+$this->requestStack = $requestStack ?: new RequestStack();
+}
+public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
+{
+try {
+return $this->handleRaw($request, $type);
+} catch (\Exception $e) {
+if (false === $catch) {
+$this->finishRequest($request, $type);
+throw $e;
+}
+return $this->handleException($e, $request, $type);
+}
+}
+public function terminate(Request $request, Response $response)
+{
+$this->dispatcher->dispatch(KernelEvents::TERMINATE, new PostResponseEvent($this, $request, $response));
+}
+private function handleRaw(Request $request, $type = self::MASTER_REQUEST)
+{
+$this->requestStack->push($request);
+$event = new GetResponseEvent($this, $request, $type);
+$this->dispatcher->dispatch(KernelEvents::REQUEST, $event);
+if ($event->hasResponse()) {
+return $this->filterResponse($event->getResponse(), $request, $type);
+}
+if (false === $controller = $this->resolver->getController($request)) {
+throw new NotFoundHttpException(sprintf('Unable to find the controller for path "%s". Maybe you forgot to add the matching route in your routing configuration?', $request->getPathInfo()));
+}
+$event = new FilterControllerEvent($this, $controller, $request, $type);
+$this->dispatcher->dispatch(KernelEvents::CONTROLLER, $event);
+$controller = $event->getController();
+$arguments = $this->resolver->getArguments($request, $controller);
+$response = call_user_func_array($controller, $arguments);
+if (!$response instanceof Response) {
+$event = new GetResponseForControllerResultEvent($this, $request, $type, $response);
+$this->dispatcher->dispatch(KernelEvents::VIEW, $event);
+if ($event->hasResponse()) {
+$response = $event->getResponse();
+}
+if (!$response instanceof Response) {
+$msg = sprintf('The controller must return a response (%s given).', $this->varToString($response));
+if (null === $response) {
+$msg .=' Did you forget to add a return statement somewhere in your controller?';
+}
+throw new \LogicException($msg);
+}
+}
+return $this->filterResponse($response, $request, $type);
+}
+private function filterResponse(Response $response, Request $request, $type)
+{
+$event = new FilterResponseEvent($this, $request, $type, $response);
+$this->dispatcher->dispatch(KernelEvents::RESPONSE, $event);
+$this->finishRequest($request, $type);
+return $event->getResponse();
+}
+private function finishRequest(Request $request, $type)
+{
+$this->dispatcher->dispatch(KernelEvents::FINISH_REQUEST, new FinishRequestEvent($this, $request, $type));
+$this->requestStack->pop();
+}
+private function handleException(\Exception $e, $request, $type)
+{
+$event = new GetResponseForExceptionEvent($this, $request, $type, $e);
+$this->dispatcher->dispatch(KernelEvents::EXCEPTION, $event);
+$e = $event->getException();
+if (!$event->hasResponse()) {
+$this->finishRequest($request, $type);
+throw $e;
+}
+$response = $event->getResponse();
+if ($response->headers->has('X-Status-Code')) {
+$response->setStatusCode($response->headers->get('X-Status-Code'));
+$response->headers->remove('X-Status-Code');
+} elseif (!$response->isClientError() && !$response->isServerError() && !$response->isRedirect()) {
+if ($e instanceof HttpExceptionInterface) {
+$response->setStatusCode($e->getStatusCode());
+$response->headers->add($e->getHeaders());
+} else {
+$response->setStatusCode(500);
+}
+}
+try {
+return $this->filterResponse($response, $request, $type);
+} catch (\Exception $e) {
+return $response;
+}
+}
+private function varToString($var)
+{
+if (is_object($var)) {
+return sprintf('Object(%s)', get_class($var));
+}
+if (is_array($var)) {
+$a = array();
+foreach ($var as $k => $v) {
+$a[] = sprintf('%s => %s', $k, $this->varToString($v));
+}
+return sprintf("Array(%s)", implode(', ', $a));
+}
+if (is_resource($var)) {
+return sprintf('Resource(%s)', get_resource_type($var));
+}
+if (null === $var) {
+return'null';
+}
+if (false === $var) {
+return'false';
+}
+if (true === $var) {
+return'true';
+}
+return (string) $var;
+}
+}
+}
+namespace Symfony\Component\HttpKernel\DependencyInjection
+{
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\RequestStack;
+use Symfony\Component\HttpKernel\HttpKernelInterface;
+use Symfony\Component\HttpKernel\HttpKernel;
+use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\DependencyInjection\Scope;
+class ContainerAwareHttpKernel extends HttpKernel
+{
+protected $container;
+public function __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver, RequestStack $requestStack = null)
+{
+parent::__construct($dispatcher, $controllerResolver, $requestStack);
+$this->container = $container;
+if (!$container->hasScope('request')) {
+$container->addScope(new Scope('request'));
+}
+}
+public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
+{
+$request->headers->set('X-Php-Ob-Level', ob_get_level());
+$this->container->enterScope('request');
+$this->container->set('request', $request,'request');
+try {
+$response = parent::handle($request, $type, $catch);
+} catch (\Exception $e) {
+$this->container->set('request', null,'request');
+$this->container->leaveScope('request');
+throw $e;
+}
+$this->container->set('request', null,'request');
+$this->container->leaveScope('request');
+return $response;
+}
+}
+}
+
+namespace { return $loader; }
+            

+ 62 - 0
app/check.php

@@ -0,0 +1,62 @@
+<?php
+
+require_once dirname(__FILE__).'/SymfonyRequirements.php';
+
+$symfonyRequirements = new SymfonyRequirements();
+
+$iniPath = $symfonyRequirements->getPhpIniConfigPath();
+
+echo "********************************\n";
+echo "*                              *\n";
+echo "*  Symfony requirements check  *\n";
+echo "*                              *\n";
+echo "********************************\n\n";
+
+echo $iniPath ? sprintf("* Configuration file used by PHP: %s\n\n", $iniPath) : "* WARNING: No configuration file (php.ini) used by PHP!\n\n";
+
+echo "** ATTENTION **\n";
+echo "*  The PHP CLI can use a different php.ini file\n";
+echo "*  than the one used with your web server.\n";
+if ('\\' == DIRECTORY_SEPARATOR) {
+    echo "*  (especially on the Windows platform)\n";
+}
+echo "*  To be on the safe side, please also launch the requirements check\n";
+echo "*  from your web server using the web/config.php script.\n";
+
+echo_title('Mandatory requirements');
+
+$checkPassed = true;
+foreach ($symfonyRequirements->getRequirements() as $req) {
+    /** @var $req Requirement */
+    echo_requirement($req);
+    if (!$req->isFulfilled()) {
+        $checkPassed = false;
+    }
+}
+
+echo_title('Optional recommendations');
+
+foreach ($symfonyRequirements->getRecommendations() as $req) {
+    echo_requirement($req);
+}
+
+exit($checkPassed ? 0 : 1);
+
+/**
+ * Prints a Requirement instance
+ */
+function echo_requirement(Requirement $requirement)
+{
+    $result = $requirement->isFulfilled() ? 'OK' : ($requirement->isOptional() ? 'WARNING' : 'ERROR');
+    echo ' ' . str_pad($result, 9);
+    echo $requirement->getTestMessage() . "\n";
+
+    if (!$requirement->isFulfilled()) {
+        echo sprintf("          %s\n\n", $requirement->getHelpText());
+    }
+}
+
+function echo_title($title)
+{
+    echo "\n** $title **\n\n";
+}

+ 3 - 0
app/config/parameters.php

@@ -0,0 +1,3 @@
+<?php
+$_configuration = require_once __DIR__.'/../../config/configuration.php';
+$container->setParameter('configuration', $_configuration);

+ 18 - 0
app/config/routing.yml

@@ -0,0 +1,18 @@
+main:
+    resource: "@ChamiloLMSCoreBundle/Resources/config/routing.yml"
+
+login_check:
+    path: /login_check
+
+login:
+    path:     /login
+    defaults: { _controller: ChamiloLMSCoreBundle:Security:login }
+
+secured_logout:
+    pattern:   /secured/logout
+
+logout:
+    pattern:   /secured/logout
+
+root:
+    path: /

+ 14 - 0
app/config/routing_dev.yml

@@ -0,0 +1,14 @@
+_wdt:
+    resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
+    prefix:   /_wdt
+
+_profiler:
+    resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
+    prefix:   /_profiler
+
+_configurator:
+    resource: "@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml"
+    prefix:   /_configurator
+
+_main:
+    resource: routing.yml

+ 55 - 80
composer.json

@@ -9,9 +9,7 @@
     },
     "autoload": {
         "psr-0": {
-            "Entity" : "main/inc/",
-            "Gedmo": "vendor/gedmo/doctrine-extensions/lib",
-            "ChamiloLMS" : "src/"
+            "": "src/"
         },
         "classmap": [
             "main/auth",
@@ -29,89 +27,66 @@
     },
     "repositories": [
         {
-            "type": "vcs",
-            "url": "https://github.com/jmontoyaa/phpqrcode"
-        },
-        {
-            "type": "vcs",
-            "url": "https://github.com/jmontoyaa/silex-pagerfanta-provider"
-        },
-        {
-            "type": "vcs",
-            "url": "https://github.com/jmontoyaa/XHProfServiceProvider"
+            "type": "package",
+            "package": {
+                "name": "jquery/jquery",
+                "version": "1.10.2",
+                "dist": {
+                    "url": "http://code.jquery.com/jquery-1.10.2.js",
+                    "type": "file"
+                }
+            }
         }
     ],
     "require": {
         "php": ">=5.3.3",
-        "silex/silex": "~1.1",
-        "symfony/console"  : "~2.3",
-        "symfony/twig-bridge": "~2.3",
-        "symfony/doctrine-bridge": "~2.3",
-        "symfony/security": "~2.3",
-        "symfony/form": "~2.3",
-        "symfony/property-access": "~2.3",
-        "symfony/validator": "~2.3",
-        "symfony/translation": "~2.3",
-        "symfony/dependency-injection": "~2.3",
-        "symfony/filesystem": "~2.3",
-        "symfony/finder": "~2.3",
-        "monolog/monolog" : ">=1.0.0",
-        "symfony/config": "~2.3",
-        "symfony/yaml": "~2.3",
-        "symfony/locale": "~2.3",
-        "symfony/monolog-bridge": "~2.3",
-        "twig/twig": ">=1.8,<2.0-dev",
-        "braincrafted/bootstrap-bundle": "dev-master",
-        "dflydev/doctrine-orm-service-provider": "1.0.*@dev",
-        "doctrine/migrations": "dev-master",
+        "symfony/symfony": "~2.4",
+        "doctrine/orm": "~2.2,>=2.2.3",
+        "doctrine/doctrine-bundle": "~1.2",
+        "twig/extensions": "~1.0",
+        "symfony/assetic-bundle": "~2.3",
+        "symfony/swiftmailer-bundle": "~2.3",
+        "symfony/monolog-bundle": "~2.4",
+        "sensio/distribution-bundle": "~2.3",
+        "sensio/framework-extra-bundle": "~3.0",
+        "sensio/generator-bundle": "~2.3",
+        "incenteev/composer-parameter-handler": "~2.0",
+        "braincrafted/bootstrap-bundle": "~2.0",
         "gedmo/doctrine-extensions": "~2.3",
-        "swiftmailer/swiftmailer": ">=4.1.2,<4.2-dev",
-        "pagerfanta/pagerfanta": "dev-master",
-        "franmomu/silex-pagerfanta-provider": "1.0.*@dev",
-        "igorw/config-service-provider": "1.2.*@dev",
-        "mpdf/mpdf": "v5.6.1",
-        "ezyang/htmlpurifier": "v4.6.0",
-        "realityking/pchart": "dev-master",
-        "imagine/imagine": "0.6.*@dev",
-        "grom/silex-service-provider": "dev-master",
-        "knplabs/knp-menu": "2.0.*@dev",
-        "knplabs/knp-snappy": "dev-master",
-        "knplabs/console-service-provider": "dev-master",
-        "jmontoyaa/phpqrcode": "dev-master",
-        "neutron/silex-filesystem-provider": "dev-master",
-        "jbroadway/urlify": "1.0.0-stable",
-        "sensio/framework-extra-bundle": "~2.3",
-        "chamilo/chash": "dev-master",
-        "composer/composer": "1.0.0-alpha7",
-        "flint/flint": "1.6.0",
-        "icehero/silex-opauth": "dev-master",
-        "opauth/openid": "0.1.0",
-        "opauth/facebook": "0.2.1",
-        "opauth/google": "0.2.2",
-        "media-alchemyst/media-alchemyst": "0.4.4",
-        "php-ffmpeg/php-ffmpeg": "0.4.4",
-        "sunra/php-simple-html-dom-parser": "1.5.0",
-        "zendframework/zend-config": "~2.3",
-        "zendframework/zend-feed": "~2.3",
-        "zendframework/zend-http": "~2.3",
-        "zendframework/zend-servicemanager": "~2.3",
-        "sabre/vobject" : "~3.1",
-        "patchwork/utf8": "1.1.*",
-        "sonata-project/exporter": "1.3.3"
-    },
-    "require-dev": {
-        "league/flysystem": "0.3.3",
-        "symfony/browser-kit": "~2.3",
-        "symfony/web-profiler-bundle": "~2.3",
-        "silex/web-profiler": "~1.0",
-        "natxet/CssMin": "dev-master",
-        "leafo/lessphp": "dev-master",
-        "mheap/silex-assetic": "1.0.*@dev",
-        "filp/whoops": "dev-master",
-        "jmontoyaa/xhprof-service-provider": "dev-master"
+        "twbs/bootstrap": "3.0.*",
+        "jquery/jquery":  "1.10.*",
+        "oyejorge/less.php": "~1.5",
+        "sonata-project/block-bundle": "~2.2",
+        "knplabs/knp-menu-bundle": "~1.1",
+        "white-october/pagerfanta-bundle": "dev-master"
     },
     "scripts": {
-        "post-install-cmd": "ChamiloLMS\\Composer\\Tasks::postInstall",
-        "post-update-cmd": "ChamiloLMS\\Composer\\Tasks::postUpdate"
+        "post-install-cmd": [
+            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
+            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
+            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
+            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
+            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
+        ],
+        "post-update-cmd": [
+            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
+            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
+            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
+            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
+            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
+        ]
+    },
+    "config": {
+        "bin-dir": "bin"
+    },
+    "extra": {
+        "symfony-app-dir": "app",
+        "symfony-web-dir": "web",
+        "incenteev-parameters": {
+            "file": "app/config/parameters.yml"
+        },
+        "branch-alias": {
+            "dev-master": "2.4-dev"
+        }
     }
 }

+ 1 - 1
main/admin/add_users_to_usergroup.php

@@ -11,7 +11,7 @@ $language_file = array('admin','registration');
 $cidReset = true;
 
 // including some necessary files
-require_once '../inc/global.inc.php';
+//require_once '../inc/global.inc.php';
 
 // setting the section (for the tabs)
 $this_section = SECTION_PLATFORM_ADMIN;

+ 3 - 6
main/admin/course_list.php

@@ -289,9 +289,6 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
     $content .= $table->return_table();
 }
 
-$app['title'] = $tool_name;
-$tpl = $app['template'];
-$tpl->assign('actions', $actions);
-$tpl->assign('message', $message);
-$tpl->assign('content', $content);
-$tpl->display_one_col_template();
+echo $actions;
+echo $message;
+echo $content;

+ 0 - 4
main/admin/index.php

@@ -1,4 +0,0 @@
-<?php
-$url = api_get_path(WEB_PUBLIC_PATH).'admin';
-header('Location: '.$url);
-exit;

+ 6 - 7
main/admin/user_list.php

@@ -5,7 +5,7 @@
 	@author Julio Montoya <gugli100@gmail.com> BeezNest 2011
 *	@package chamilo.admin
 */
-
+use ChamiloSession as Session;
 // name of the language file that needs to be included
 $language_file = array ('registration','admin');
 $cidReset = true;
@@ -410,7 +410,7 @@ function modify_filter($user_id, $url_params, $row) {
         )
     ) {
         if (!$user_is_anonymous) {
-            if ($app['security']->isGranted('ROLE_GLOBAL_ADMIN')) {
+            if (Session::getSecurity()->isGranted('ROLE_GLOBAL_ADMIN')) {
                 // everything looks good, show "login as" link
                 if ($user_id != $userId) {
                     $result .= '<a href="'.api_get_path(WEB_PUBLIC_PATH).'?_switch_user='.$row[5].'">'.Display::return_icon('login_as.gif', get_lang('LoginAs')).'</a>&nbsp;&nbsp;';
@@ -801,9 +801,8 @@ if ($table->get_total_number_of_items() == 0) {
     }
 }
 
-$app['title'] = $tool_name;
-$tpl = $app['template'];
+echo $message;
+echo $actions;
+echo $form.$table_result.$extra_search_options;
+
 
-$tpl->assign('actions', $actions);
-$tpl->assign('message', $message);
-$tpl->assign('content', $form.$table_result.$extra_search_options);

+ 2 - 2
main/auth/shibboleth/app/controller/shibboleth_controller.class.php

@@ -91,8 +91,8 @@ class ShibbolethController
             $message = get_lang('already_logged_in');
             Shibboleth::display()->message_page($message, $title);
         }
-        $html = PageController::displayLoginForm();
-        Shibboleth::display()->page($html, $title);
+        /*$html = PageController::displayLoginForm();
+        Shibboleth::display()->page($html, $title);*/
     }
 
     /**

+ 7 - 2
main/course_home/activity.php

@@ -1,5 +1,6 @@
 <?php
 /* For licensing terms, see /license.txt */
+use  \ChamiloSession as Session;
 
 /**
  *   HOME PAGE FOR EACH COURSE
@@ -22,17 +23,21 @@ function return_block($title, $content)
 }
 
 $session_id = api_get_session_id();
-global $app;
-$urlGenerator = $app['url_generator'];
+
+$urlGenerator = Session::$urlGenerator;
 
 $content = null;
 
 // Start of tools for CourseAdmins (teachers/tutors)
 $totalList = array();
+
 if ($session_id == 0 && api_is_course_admin() && api_is_allowed_to_edit(null, true)) {
     $list = CourseHome::get_tools_category(TOOL_AUTHORING);
+
 	$result = CourseHome::show_tools_category($urlGenerator, $list);
+
     $content .= return_block(get_lang('Authoring'), $result['content']);
+
     $totalList = $result['tool_list'];
 
     $list = CourseHome::get_tools_category(TOOL_INTERACTION);

+ 3 - 0
main/document/document.php

@@ -40,6 +40,9 @@ $lib_path = api_get_path(LIBRARY_PATH);
 api_protect_course_script(true);
 
 $to_user_id = api_get_user_id();
+$_course = api_get_course_info();
+$_user = api_get_user_info();
+$charset = api_get_system_encoding();
 
 //erase temp nanogons' audio, image edit
 if (isset($_SESSION['temp_audio_nanogong']) && !empty($_SESSION['temp_audio_nanogong'])) {

+ 44 - 53
main/inc/lib/api.lib.php

@@ -565,7 +565,6 @@ define('TOOL_ADMIN_VISIBLE',             'tooladminvisible');
  * ...
  */
 function api_get_path($path_type, $path = null) {
-    global $app;
 
     static $paths = array(
         SYS_DATA_PATH           => 'data/',
@@ -575,20 +574,20 @@ function api_get_path($path_type, $path = null) {
         WEB_DATA_COURSE_PATH    => 'courses/',
         WEB_DATA_PATH           => '/',
         SYS_COURSE_PATH         => 'data/',
-        SYS_CSS_PATH            => 'web/ChamiloLMS/css/',
+        SYS_CSS_PATH            => 'ChamiloLMS/css/',
         SYS_LANG_PATH           => 'lang/',
-        WEB_IMG_PATH            => 'web/ChamiloLMS/img/',
+        WEB_IMG_PATH            => 'ChamiloLMS/img/',
         SYS_IMG_PATH            => 'web/ChamiloLMS/img/',
-        WEB_CSS_PATH            => 'web/ChamiloLMS/css/',
+        WEB_CSS_PATH            => 'ChamiloLMS/css/',
         SYS_PLUGIN_PATH         => 'plugin/',
         WEB_PLUGIN_PATH         => 'plugin/',
         WEB_ARCHIVE_PATH        => 'temp/',
         INCLUDE_PATH            => 'inc/',
         LIBRARY_PATH            => 'inc/lib/',
-        SYS_LIBRARY_JS_PATH     => 'web/ChamiloLMS/js/',
+        SYS_LIBRARY_JS_PATH     => 'ChamiloLMS/js/',
         CONFIGURATION_PATH      => 'inc/conf/',
         WEB_LIBRARY_PATH        => 'inc/lib/',
-        WEB_LIBRARY_JS_PATH     => 'web/ChamiloLMS/js/',
+        WEB_LIBRARY_JS_PATH     => 'ChamiloLMS/js/',
         WEB_AJAX_PATH           => 'inc/ajax/',
         SYS_TEST_PATH           => 'tests/',
         WEB_TEMPLATE_PATH       => 'template/',
@@ -610,16 +609,17 @@ function api_get_path($path_type, $path = null) {
     static $code_folder;
     static $course_folder;
 
+    global $_configuration;
     // Always load root_web modifications for multiple url features.
-    $_configuration = $app->getConfiguration();
 
     // Default $_configuration['root_web'] configuration
     //$root_web = isset($_configuration['root_web']) ? $_configuration['root_web'] : $app['url_generator'];
-    $root_web = $app['url_generator']->generate('root'); //$_configuration['root_web'];
-    $root_web = str_replace('web/', '', $root_web);
+
+    $root_web = Session::getUrlGenerator()->generate('root'); //$_configuration['root_web'];
+    $rootDir = Session::getRootDir();
 
     // Configuration data for already installed system.
-    $root_sys = $app['path.base'];
+    $root_sys = $rootDir;
 
     $load_new_config = false;
 
@@ -657,10 +657,10 @@ function api_get_path($path_type, $path = null) {
         $paths[SYS_PATH]                = $root_sys;
 
         // Update data path to get it from config file if defined
-        $paths[SYS_DATA_PATH]           = $app['path.data'];
-        $paths[SYS_LOG_PATH]            = $app['path.logs'];
-        $paths[SYS_CONFIG_PATH]         = $app['path.config'];
-        $paths[SYS_COURSE_PATH]         = $app['path.courses'];
+        $paths[SYS_DATA_PATH]           = Session::getDataDir();
+        $paths[SYS_LOG_PATH]            = Session::getLogDir();
+        $paths[SYS_CONFIG_PATH]         = Session::getConfigDir();
+        $paths[SYS_COURSE_PATH]         = Session::getCourseDir();
 
         $paths[SYS_DEFAULT_COURSE_DOCUMENT_PATH] = $paths[SYS_DATA_PATH].'default_course_document/';
 
@@ -687,7 +687,7 @@ function api_get_path($path_type, $path = null) {
         // Now we can switch into api_get_path() "terminology".
         $paths[SYS_LANG_PATH]           = $paths[SYS_CODE_PATH].$paths[SYS_LANG_PATH];
         $paths[SYS_PLUGIN_PATH]         = $paths[SYS_PATH].$paths[SYS_PLUGIN_PATH];
-        $paths[SYS_ARCHIVE_PATH]        = $app['path.temp'];
+        $paths[SYS_ARCHIVE_PATH]        = Session::getTempDir();
         $paths[SYS_TEST_PATH]           = $paths[SYS_PATH].$paths[SYS_TEST_PATH];
         $paths[SYS_TEMPLATE_PATH]       = $paths[SYS_CODE_PATH].$paths[SYS_TEMPLATE_PATH];
         $paths[SYS_CSS_PATH]            = $paths[SYS_PATH].$paths[SYS_CSS_PATH];
@@ -1365,7 +1365,6 @@ function api_get_course_int_id() {
     return Session::read('_real_cid', 0);
 }
 
-
 /**
  * Returns the current course directory
  *
@@ -2196,17 +2195,19 @@ function api_get_self() {
  */
 function api_is_platform_admin($allow_sessions_admins = false)
 {
-    global $app;
-    $token = $app['security']->getToken();
+    $security = Session::getSecurity();
+    if ($security) {
+        $token = $security->getToken();
 
-    if (!empty($token)) {
-        if ($app['security']->isGranted('ROLE_ADMIN')) {
-        return true;
-    }
-        if ($allow_sessions_admins) {
-            if ($app['security']->isGranted('ROLE_SESSION_MANAGER')) {
+        if (!empty($token)) {
+            if ($security->isGranted('ROLE_ADMIN')) {
                 return true;
             }
+            if ($allow_sessions_admins) {
+                if ($security->isGranted('ROLE_SESSION_MANAGER')) {
+                    return true;
+                }
+            }
         }
     }
     return false;
@@ -2217,11 +2218,10 @@ function api_is_platform_admin($allow_sessions_admins = false)
  */
 function api_is_question_manager()
 {
-    global $app;
-    $token = $app['security']->getToken();
-
+    $security = Session::getSecurity();
+    $token = $security->getToken();
     if (!empty($token)) {
-        if ($app['security']->isGranted('ROLE_QUESTION_MANAGER')) {
+        if ($security->isGranted('ROLE_QUESTION_MANAGER')) {
             return true;
         }
     }
@@ -2235,11 +2235,10 @@ function api_is_question_manager()
  */
 function api_is_session_admin()
 {
-    global $app;
-    $token = $app['security']->getToken();
-
+    $security = Session::getSecurity();
+    $token = $security->getToken();
     if (!empty($token)) {
-        if ($app['security']->isGranted('ROLE_SESSION_MANAGER')) {
+        if ($security->isGranted('ROLE_SESSION_MANAGER')) {
             return true;
         }
     }
@@ -2251,11 +2250,10 @@ function api_is_session_admin()
  * @return boolean True if current user is a human resources manager
  */
 function api_is_drh() {
-    global $app;
-    $token = $app['security']->getToken();
-
+    $security = Session::getSecurity();
+    $token = $security->getToken();
     if (!empty($token)) {
-        if ($app['security']->isGranted('ROLE_RRHH')) {
+        if ($security->isGranted('ROLE_RRHH')) {
             return true;
         }
     }
@@ -2267,11 +2265,10 @@ function api_is_drh() {
  * @return boolean True if current user is a human resources manager
  */
 function api_is_student() {
-    global $app;
-    $token = $app['security']->getToken();
-
+    $security = Session::getSecurity();
+    $token = $security->getToken();
     if (!empty($token)) {
-        if ($app['security']->isGranted('ROLE_STUDENT')) {
+        if ($security->isGranted('ROLE_STUDENT')) {
             return true;
         }
     }
@@ -2283,9 +2280,12 @@ function api_is_student() {
  * @return boolean True if current user is a human resources manager
  */
 function api_is_teacher() {
-    global $app;
-    if ($app['security']->isGranted('ROLE_TEACHER')) {
-        return true;
+    $security = Session::getSecurity();
+    $token = $security->getToken();
+    if (!empty($token)) {
+        if ($security->isGranted('ROLE_TEACHER')) {
+            return true;
+        }
     }
     return false;
 }
@@ -2973,18 +2973,9 @@ function api_is_anonymous($user_id = null, $db_check = false) {
  */
 function api_not_allowed($printHeaders = false, $message = null)
 {
-    global $app;
-    if (empty($message)) {
-        $message = 'Unauthorized';
-    }
-    if ($printHeaders == false) {
-        $app['template.show_footer'] = false;
-        $app['template.show_header'] = false;
-    }
-    return $app->abort('401', $message);
+   throw new Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
 }
 
-
 /* WHAT'S NEW
    functions for the what's new icons
    in the user course list */

+ 73 - 0
main/inc/lib/chamilo_session.class.php

@@ -6,6 +6,79 @@
 class ChamiloSession
 {
     public static $session;
+    public static $configuration;
+    public static $urlGenerator;
+    public static $security;
+    public static $translator;
+
+    public static $rootDir;
+    public static $logDir;
+    public static $tempDir;
+    public static $dataDir;
+    public static $courseDir;
+    public static $configDir;
+
+    public static function getConfigDir()
+    {
+        return self::$configDir;
+    }
+
+    public static function getLogDir()
+    {
+        return self::$logDir;
+    }
+
+    public static function getTempDir()
+    {
+        return self::$tempDir;
+    }
+
+    public static function getRootDir()
+    {
+        return self::$rootDir;
+    }
+
+    public static function getDataDir()
+    {
+        return self::$dataDir;
+    }
+
+    public static function getCourseDir()
+    {
+        return self::$courseDir;
+    }
+
+    /**
+     * @return Symfony\Component\Routing\Generator\UrlGeneratorInterface
+     */
+    public static function getUrlGenerator()
+    {
+        return self::$urlGenerator;
+    }
+
+    /**
+     * @return Symfony\Component\HttpFoundation\Session\SessionInterface;
+     */
+    public static function getSession()
+    {
+        return self::$session;
+    }
+
+    /**
+     * @return Symfony\Component\Security\Core\SecurityContextInterface
+     */
+    public static function getSecurity()
+    {
+        return self::$security;
+    }
+
+    /**
+     * @return Symfony\Component\Security\Core\SecurityContextInterface
+     */
+    public static function getTranslator()
+    {
+        return self::$translator;
+    }
 
     /**
      * @param $session

+ 1 - 1
main/inc/lib/course.lib.php

@@ -3740,7 +3740,7 @@ class CourseManager
         $urlId = api_get_current_access_url_id();
         $limit  = intval($limit);
 
-        //Getting my courses
+        // Getting my courses
         $my_course_list = CourseManager::get_courses_list_by_user_id(api_get_user_id());
 
         $my_course_code_list = array();

+ 8 - 3
main/inc/lib/course_home.lib.php

@@ -431,6 +431,7 @@ class CourseHome
                 break;
             case TOOL_AUTHORING:
                 $sql = "SELECT * FROM $course_tool_table WHERE category = 'authoring' AND c_id = $course_id $condition_session ORDER BY id";
+
                 $result = Database::query($sql);
                 $col_link ="##003399";
                 break;
@@ -642,7 +643,8 @@ class CourseHome
                 if ($tool['image'] == 'scormbuilder.gif') {
                     // Check if the published learnpath is visible for student
                     $published_lp_id = self::get_published_lp_id_from_link($tool['link']);
-                    if (!api_is_allowed_to_edit(null, true) && !learnpath::is_lp_visible_for_student($published_lp_id, api_get_user_id())) {
+                    if (!api_is_allowed_to_edit(null, true) &&
+                        !learnpath::is_lp_visible_for_student($published_lp_id, api_get_user_id())) {
                         continue;
                     }
                 }
@@ -660,7 +662,9 @@ class CourseHome
                 unset($lnk);
 
                 $item['extra'] = null;
+
                 if ($is_allowed_to_edit && !api_is_coach()) {
+
                     if (empty($session_id)) {
                         if ($tool['visibility'] == '1' && $tool['admin'] != '1') {
                             $link['name'] = Display::return_icon(
@@ -672,7 +676,7 @@ class CourseHome
                             );
                             if (!empty($tool['id'])) {
                                 $link['cmd'] = $urlGenerator->generate(
-                                    'course_home.controller:hideIconAction',
+                                    'chamilolms_core_tool_coursehome_coursehome_hideicon',
                                     array(
                                         'courseCode' => api_get_course_id(),
                                         'iconId' => $tool['id']
@@ -685,7 +689,7 @@ class CourseHome
                             $link['name'] = Display::return_icon('invisible.gif', get_lang('Activate'), array('id' => 'linktool_'.$tool['id']), ICON_SIZE_MEDIUM, false);
                             if (!empty($tool['id'])) {
                                 $link['cmd'] = $urlGenerator->generate(
-                                    'course_home.controller:showIconAction',
+                                    'chamilolms_core_tool_coursehome_coursehome_showicon',
                                     array(
                                         'courseCode' => api_get_course_id(),
                                         'iconId' => $tool['id']
@@ -922,6 +926,7 @@ class CourseHome
                         $html .= Display::div($content, array('class'=>'activity_content'));
                         $html .=  '</div>';
 
+
                         if ($counter == 1) {
                             $html .=  '</div>';
                             $counter = -1;

+ 3 - 10
main/inc/lib/display.lib.php

@@ -39,9 +39,7 @@ class Display
      */
     public static function display_header($tool_name = '', $help = null, $page_header = null)
     {
-        global $app;
-        $app['classic_layout'] = true;
-        $app['template']->setTitle($tool_name);
+        //$app['template']->setTitle($tool_name);
     }
 
     /**
@@ -213,7 +211,7 @@ class Display
                     $introduction_section .=  '<div id="introduction_block_action" class="col-md-2 col-md-offset-10">';
 
                     $url = $urlGenerator->generate(
-                        'introduction.controller:editAction',
+                        'chamilolms_core_tool_introduction_introduction_edit',
                         array('tool' => $tool, 'courseCode' => api_get_course_id())
                     );
 
@@ -227,7 +225,7 @@ class Display
                     // Displays "edit intro && delete intro" commands
                     $introduction_section .=  '<div id="introduction_block_action" class="col-md-2 col-md-offset-10">';
                     $url = $urlGenerator->generate(
-                        'introduction.controller:editAction',
+                        'chamilolms_core_tool_introduction_introduction_edit',
                         array('tool' => $tool, 'courseCode' => api_get_course_id())
                     );
 
@@ -792,9 +790,6 @@ class Display
         $code_path   = api_get_path(SYS_IMG_PATH);
         $w_code_path = api_get_path(WEB_IMG_PATH);
 
-        //$code_path = self::$urlGenerator->generate('root');
-        //$w_code_path = self::$urlGenerator->generate('root');
-
         $image      = trim($image);
         $theme      = 'css/'.api_get_visual_theme().'/icons/';
         $size_extra = '';
@@ -807,7 +802,6 @@ class Display
         }
 
         // Checking the theme icons folder example: main/css/chamilo/icons/XXX
-
         if (is_file($code_path.$theme.$size_extra.$image)) {
             $icon = $w_code_path.$theme.$size_extra.$image;
         } elseif (is_file($code_path.'icons/'.$size_extra.$image)) {
@@ -822,7 +816,6 @@ class Display
         if ($return_only_path) {
             return $icon;
         }
-
         $img = self::img($icon, $alt_text, $additional_attributes);
         if (SHOW_TEXT_NEAR_ICONS == true and !empty($alt_text)) {
             if ($show_text) {

+ 2 - 2
main/inc/lib/events.lib.inc.php

@@ -11,8 +11,8 @@
  *
  * @package chamilo.library
  */
-use ChamiloLMS\Entity\User;
-use ChamiloLMS\Entity\Role;
+use ChamiloLMS\CoreBundle\Entity\User;
+use ChamiloLMS\CoreBundle\Entity\Role;
 
 /**
  * @author Sebastien Piraux <piraux_seb@hotmail.com> old code

+ 1 - 0
main/inc/lib/formvalidator/FormValidator.class.php

@@ -673,6 +673,7 @@ EOT;
 function html_filter($html, $mode = NO_HTML)
 {
     return $html;
+    //$filter = new Zend\Filter\StripTags(array('allowTags' => 'a'));
     $allowed_tags = HTML_QuickForm_Rule_HTML::get_allowed_tags($mode);
     $cleaned_html = kses($html, $allowed_tags);
     return $cleaned_html;

+ 3 - 4
main/inc/lib/internationalization.lib.php

@@ -10,7 +10,7 @@
  * @author More authors, mentioned in the correpsonding fragments of this source.
  * @package chamilo.library
  */
-use Patchwork\Utf8 as u;
+use \ChamiloSession as Session;
 use Symfony\Component\Intl\DateFormatter\IntlDateFormatter;
 
 // Predefined date formats in Chamilo provided by the language sub-system.
@@ -49,11 +49,10 @@ define('PERSON_NAME_DATA_EXPORT', PERSON_NAME_EASTERN_ORDER); // Contextual: for
  */
 function get_lang($variable)
 {
-    global $app;
-    $translated = $app['translator']->trans($variable);
+    $translated = Session::getTranslator()->trans($variable);
     if ($translated == $variable) {
         // Check the langVariable for BC
-        $translated = $app['translator']->trans("lang$variable");
+        $translated = Session::getTranslator()->trans("lang$variable");
         if ($translated == "lang$variable") {
             return $variable;
         }

+ 1 - 0
main/inc/lib/security.lib.php

@@ -260,6 +260,7 @@ class Security
      */
     public static function remove_XSS($var, $user_status = ANONYMOUS, $filter_terms = false)
     {
+        return $var;
         // @todo improvement - HTMLpurifier eats server memory ~ 3M
         // return $var;
         if ($filter_terms) {

+ 0 - 97
src/ChamiloLMS/Command/Template/AsseticDumpCommand.php

@@ -1,97 +0,0 @@
-<?php
-/* For licensing terms, see /license.txt */
-namespace ChamiloLMS\Command\Template;
-
-use Symfony\Component\Console\Input\ArrayInput;
-use Symfony\Component\Console\Input\InputArgument;
-use Symfony\Component\Console\Input\InputOption;
-use Symfony\Component\Console;
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Input\InputInterface;
-
-/**
- * Class AsseticDumpCommand
- * @package ChamiloLMS\Command\Template
- */
-class AsseticDumpCommand extends Command
-{
-    /**
-     * {@inheritdoc}
-     */
-    protected function configure()
-    {
-        $this
-            ->setName('assetic:dump')
-            ->setDescription('Dumps all assets to the filesystem')
-            ->addArgument('theme', InputArgument::OPTIONAL, 'The theme to dump, if none is set then all themes will be generated', null);
-    }
-
-    /**
-     * @param InputInterface $input
-     * @param OutputInterface $output
-     * @return integer|null|boolean|void
-     */
-    protected function execute(InputInterface $input, OutputInterface $output)
-    {
-        /** @var \Silex\Application $app */
-        $app = $this->getApplication()->getSilexApplication();
-
-        $theme = $input->getArgument('theme');
-
-        // Get all themes
-        if ($app['assetic.enabled'] == false || !isset($app['assetic.enabled'])) {
-            $output->writeln("<info>Assetic is not enabled. Change this value to true:</info> <comment>assetic.enabled = true</comment>");
-            return false;
-        }
-
-        $themes = $app['template']->getStyleSheetFolderList();
-        //$themes = array('chamilo', 'public_admin');
-
-        if (empty($theme)) {
-            $dialog = $this->getHelperSet()->get('dialog');
-            if (!$dialog->askConfirmation(
-                    $output,
-                    '<question>Are you sure you want to dump css/js of all themes?</question>(y/N)',
-                    false
-                )
-            ) {
-                return;
-            }
-        } else {
-            $themes = array($theme);
-        }
-
-        if (!is_dir($app['assetic.path_to_web'])) {
-            mkdir($app['assetic.path_to_web'], api_get_permissions_for_new_directories());
-            $output->writeln("<info>Creating folder in: </info><comment>".$app['assetic.path_to_web']."</comment>");
-        }
-
-        foreach ($themes as $theme) {
-            if (is_dir($app['path.base'].'main/css/'.$theme) && file_exists($app['path.base'].'main/css/'.$theme.'/default.css')) {
-                $output->writeln("<info>Dumping theme: $theme</info>");
-
-                /** @var \SilexAssetic\Assetic\Dumper $dumper */
-                $dumper = $app['assetic.dumper'];
-
-                $app['assetic.output.path_to_css'] = 'css/'.$theme.'/style.css';
-
-                $params = array(
-                    $app['path.base'].'main/css/'.$theme => $app['assetic.input.path_to_assets'].'/css/'.$theme
-                );
-
-                $app['chamilo.filesystem']->copyFolders($params, $output);
-
-                if (isset($app['twig'])) {
-                    //$dumper->addTwigAssets();
-                }
-                $dumper->dumpAssets();
-            } else {
-                $output->writeln("<info>Seems that theme: <comment>$theme</comment> doesn't have a <comment>$theme/default.css</comment> file. Skipping dump.</info>");
-            }
-        }
-        $output->writeln('<info>Dump finished</info>');
-
-        return true;
-    }
-}

+ 0 - 613
src/ChamiloLMS/Controller/BaseController.php

@@ -1,613 +0,0 @@
-<?php
-/* For licensing terms, see /license.txt */
-
-namespace ChamiloLMS\Controller;
-
-use Symfony\Bundle\FrameworkBundle\Controller\Controller;
-use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
-use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\HttpFoundation\JsonResponse;
-use Symfony\Component\HttpFoundation\Request;
-use Knp\Menu\Matcher\Matcher;
-use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
-use Silex\Application;
-use Flint\Controller\Controller as FlintController;
-use Symfony\Component\Routing\Annotation\Route;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
-use Symfony\Component\DependencyInjection\Container;
-
-use Knp\Menu\FactoryInterface as MenuFactoryInterface;
-use Knp\Menu\ItemInterface as MenuItemInterface;
-use Knp\Menu\Renderer\ListRenderer;
-
-/**
- * Each entity controller must extends this class.
- *
- * @abstract
- */
-abstract class BaseController extends FlintController
-{
-    protected $app;
-    protected $pimple;
-    private $classParts;
-    protected $breadcrumbs = array();
-    protected $classNameLabel;
-
-    /**
-     * @param Application $app
-     */
-    public function __construct(Application $app)
-    {
-        $this->app = $app;
-        // In order to use the Flint Controller.
-        $this->pimple = $app;
-
-        $className = get_class($this);
-        $this->classParts = explode('\\', Container::underscore($className));
-
-        //if (!$this->classnameLabel) {
-        $this->classNameLabel = str_replace('Controller', '', substr($className, strrpos($className, '\\') + 1));
-        //}
-    }
-
-    /**
-     * @return array
-     */
-    protected function getClassParts()
-    {
-        return $this->classParts;
-    }
-
-    /**
-     * Converts string 'ChamiloLMS\Controller\Admin\QuestionManager' into
-     * 'admin/question_manager'
-     */
-    public function getTemplatePath()
-    {
-        $parts = $this->classParts;
-
-        $newPath = array();
-        foreach ($parts as $part) {
-            if (in_array($part, array('chamilo_lms', 'controller'))
-                //strpos($part, '_controller') > 0
-            ) {
-                continue;
-            }
-            $newPath[] = $part;
-        }
-
-        $template = implode('/', $newPath);
-        return str_replace('_controller', '', $template);
-    }
-
-    /**
-     * Transforms 'QuestionManagerController' to 'question_manager.controller'
-     * @return string
-     */
-    public function getControllerAlias()
-    {
-        $parts = $this->classParts;
-        $parts = array_reverse($parts);
-        $alias = str_replace('_controller', '.controller', $parts[0]);
-        return $alias;
-    }
-
-    /**
-     * Translator shortcut
-     * @param string $variable
-     * @return string
-     */
-    public function trans($variable)
-    {
-        return $this->get('translator')->trans($variable);
-    }
-
-    /**
-     * Returns the class name label
-     * @example RoleController -> Role
-     *
-     * @return string the class name label
-     */
-    public function getClassNameLabel()
-    {
-        return $this->classNameLabel;
-    }
-
-    /**
-     * @return MenuFactoryInterface
-     */
-    public function getMenuFactory()
-    {
-        return $this->get('knp_menu.factory');
-    }
-
-    /**
-     * @param string $action
-     * @return MenuItemInterface
-     */
-    protected function getBreadcrumbs($action)
-    {
-        $breadcrumbs = $this->buildBreadcrumbs($action);
-
-        return $breadcrumbs;
-    }
-
-    /** Main home URL
-     * @return MenuItemInterface
-     */
-    protected function getHomeBreadCrumb()
-    {
-        $menu = $this->getMenuFactory()->createItem(
-            'root',
-            array(
-                'childrenAttributes' => array(
-                    'class'        => 'breadcrumb',
-                    'currentClass' => 'active'
-                )
-            )
-        );
-
-        $menu->addChild(
-            $this->trans('Home'),
-            array('uri' => $this->generateUrl('home'))
-        );
-
-        return $menu;
-    }
-
-    /**
-     * @param $action
-     * @param MenuItemInterface $menu
-     * @return MenuItemInterface
-     */
-    public function buildBreadcrumbs($action, MenuItemInterface $menu = null)
-    {
-        if (!$menu) {
-            $menu = $this->getHomeBreadCrumb();
-        }
-
-        $menu->addChild(
-            $this->trans($this->getClassnameLabel().'List'),
-            array('uri' => $this->generateControllerUrl('listingAction'))
-        );
-
-        $action = str_replace(
-            array($this->getControllerAlias().':', 'Action'),
-            '',
-            $action
-        );
-
-        switch ($action) {
-            case 'add':
-            case 'edit':
-                $menu->addChild(
-                    $this->trans($this->getClassnameLabel().ucfirst($action))
-                    //array('uri' => $this->generateControllerUrl($action.'Action'))
-                );
-                break;
-        }
-
-        return $menu;
-    }
-
-    /**
-     * @param array $breadCrumbList
-     * @return string
-     */
-    protected function parseLegacyBreadCrumb($breadCrumbList = array())
-    {
-        $menu = $this->getHomeBreadCrumb();
-        foreach ($breadCrumbList as $item) {
-            $menu->addChild(
-                $this->trans($item['title']),
-                array('uri' => $item['url'])
-            );
-        }
-
-        $renderer = new ListRenderer(new \Knp\Menu\Matcher\Matcher());
-        $result = $renderer->render($menu);
-
-        return $result;
-    }
-
-    /**
-     * Renders the current controller template
-     * @param string $name
-     * @param array $elements
-     * @return mixed
-     */
-    public function renderTemplate($name, $elements = array())
-    {
-        $name = $this->getTemplatePath().'/'.$name;
-
-        $renderer = new ListRenderer(new \Knp\Menu\Matcher\Matcher());
-        $action = $this->getRequest()->get('_route');
-        $result = $renderer->render($this->getBreadcrumbs($action));
-        $elements['new_breadcrumb'] = $result;
-
-        return $this->getTemplate()->renderTemplate($name, $elements);
-    }
-
-    /**
-     * @return \ChamiloLMS\Entity\Course
-     */
-    protected function getCourse()
-    {
-        //if (isset($this->app['course'])) {
-            return $this->app['course'];
-        //}
-        return false;
-    }
-
-    /**
-     * @return \ChamiloLMS\Entity\Session
-     */
-    protected function getSession()
-    {
-        if (isset($this->app['course_session']) && !empty($this->app['course_session'])) {
-            return $this->app['course_session'];
-        }
-        return false;
-    }
-
-    /**
-     * @return null|\Symfony\Component\HttpFoundation\Session\SessionInterface
-     */
-    protected function getSessionHandler()
-    {
-        return $this->getRequest()->getSession();
-    }
-
-    /**
-     * @return \ChamiloLMS\Framework\Template
-     */
-    protected function getTemplate()
-    {
-        return $this->get('template');
-    }
-
-    /**
-     * @return \ChamiloLMS\Component\Editor\Editor
-     */
-    protected function getHtmlEditor()
-    {
-        return $this->get('html_editor');
-    }
-
-    /**
-     * @return \ChamiloLMS\Component\Editor\Connector
-     */
-    protected function getEditorConnector()
-    {
-        return $this->get('editor_connector');
-    }
-
-    /**
-     * @return \ChamiloLMS\Component\DataFilesystem\DataFilesystem
-     */
-    protected function getDataFileSystem()
-    {
-        return $this->get('chamilo.filesystem');
-    }
-
-    /**
-     * @return \ChamiloLMS\Entity\User
-     */
-    public function getUser()
-    {
-        $user = parent::getUser();
-        if (empty($user)) {
-            return $this->abort(404, $this->trans('Login required.'));
-        }
-        return $user;
-    }
-
-    /**
-     * @return \Symfony\Component\Security\Core\SecurityContext
-     */
-    public function getSecurity()
-    {
-        return $this->get('security');
-    }
-
-    /**
-     * @return \Doctrine\ORM\EntityManager
-     */
-    protected function getManager()
-    {
-        return $this->get('orm.em');
-    }
-
-    /**
-     * @return \Doctrine\DBAL\Connection
-     */
-    protected function getDatabase()
-    {
-        return $this->get('db');
-    }
-
-    /**
-     * Shortcut of
-     * $this->getManager()->getRepository('ChamiloLMS\Entity\MyClass')
-     * @param string $entity
-     * @return \Doctrine\ORM\EntityRepository
-     */
-    /*sprotected function getRepository($entity)
-    {
-        return $this->getManager()->getRepository('ChamiloLMS\Entity\\'.$entity);
-    }*/
-
-    /**
-     * @see \Silex\Application::sendFile
-     */
-    public function sendFile($file, $status = 200, $headers = array(), $contentDisposition = null)
-    {
-        return $this->pimple->sendFile($file, $status, $headers, $contentDisposition);
-    }
-
-    /**
-     * Converts an array of URL to absolute URLs using the url_generator service
-     * @param string $label
-     * @param array
-     * @return mixed
-     * @deprecated
-     */
-    protected function createUrl($label, $parameters = array())
-    {
-        $links = $this->generateLinks();
-        $course = $this->getCourse();
-
-        if (!empty($course)) {
-            $parameters['course'] = $course->getCode();
-        }
-        $session = $this->getSession();
-        if (!empty($session)) {
-            $parameters['id_session'] = $session->getId();
-        }
-
-        $extraParams = $this->getExtraParameters();
-
-        if (!empty($extraParams)) {
-            $request = $this->getRequest();
-            $dynamicParams = array();
-            foreach ($extraParams as $param) {
-                $value = $request->get($param);
-                if (!empty($value)) {
-                    $dynamicParams[$param] = $value;
-                }
-            }
-            $parameters = array_merge($parameters, $dynamicParams);
-        }
-
-        if (isset($links) && is_array($links) && isset($links[$label])) {
-            $url = $this->generateUrl($links[$label], $parameters);
-            return $url;
-        }
-        return $url = $this->generateUrl($links['list_link']);
-    }
-
-    /**
-     * Add extra parameters when generating URLs
-     * @return array
-     */
-    protected function getExtraParameters()
-    {
-        return array();
-    }
-
-    /**
-     * @see Symfony\Component\Routing\RouterInterface::generate()
-     */
-    public function generateUrl(
-        $name,
-        array $parameters = array(),
-        $reference = UrlGeneratorInterface::ABSOLUTE_PATH
-    ) {
-        if ($name != 'home') {
-            $course = $this->getCourse();
-            if (!empty($course)) {
-                $parameters['cidReq'] = $course->getCode();
-            }
-            $session = $this->getSession();
-            if (!empty($session)) {
-                $parameters['id_session'] = $session->getId();
-            }
-        }
-        return parent::generateUrl($name, $parameters, $reference);
-    }
-
-    /**
-     * In a controller like RoleController when calling the indexAction URL
-     * this function will transform to role.controller:indexAction
-     * @param string $name
-     * @param array $parameters
-     * @param bool $reference
-     * @return mixed
-     */
-    public function generateControllerUrl(
-        $name,
-        array $parameters = array(),
-        $reference = UrlGeneratorInterface::ABSOLUTE_PATH
-    ) {
-        $name = $this->getControllerAlias().':'.$name;
-        return $this->generateUrl($name, $parameters, $reference);
-    }
-
-    /**
-     * @param \Doctrine\ORM\QueryBuilder $qb
-     * @param string
-     */
-    protected function setCourseParameters(\Doctrine\ORM\QueryBuilder & $qb, $prefix)
-    {
-        $course = $this->getCourse();
-        if ($course) {
-            $qb->andWhere($prefix.'.cId = :id');
-            $qb->setParameter('id', $course->getId());
-
-            $session = $this->getSession();
-            if (!empty($session)) {
-                $qb->andWhere($prefix.'.sessionId = :session_id');
-                $qb->setParameter('session_id', $session->getId());
-            }
-        }
-    }
-
-    /**
-     * Get system setting.
-     * @param string $variable
-     * @param string $key
-     * @return string
-     */
-    public function getSetting($variable, $key = null)
-    {
-        $session = $this->getRequest()->getSession();
-        $settings = $session->get('_setting');
-        if (empty($key)) {
-            if (isset($settings[$variable])) {
-                return $settings[$variable];
-            }
-        } else {
-            if (isset($settings[$variable]) && isset($settings[$variable])) {
-                return $settings[$variable];
-            }
-        }
-    }
-
-    /**
-     * @return bool
-     */
-    public function isCourseTeacher()
-    {
-        $course = $this->getCourse();
-        if (!$course) {
-            return false;
-        } else {
-            if ($this->getSecurity()->isGranted('ROLE_ADMIN')) {
-                return true;
-            }
-            $course->getId();
-            $role = "ROLE_TEACHER_COURSE_".$course->getId().'_SESSION_0';
-
-            return $this->getSecurity()->isGranted($role);
-        }
-    }
-
-    /**
-     * Add flash messages.
-     * @param string $message
-     * @param string $type example: info|success|warning
-     */
-    public function addMessage($message, $type = 'info')
-    {
-        if ($type == 'confirmation') {
-            $type = 'info';
-        }
-        $this->get('session')->getFlashBag()->add($type, $message);
-    }
-
-    /**
-     * @param array $breadcrumbs
-     * @deprecated
-     */
-    protected function setBreadcrumb($breadcrumbs)
-    {
-        $course = $this->getCourse();
-        //$session =  $this->getSession();
-
-        // Adding course breadcrumb.
-        if (!empty($course)) {
-            $courseBreadcrumb = array(
-                'name' => \Display::return_icon('home.png').' '.$course->getTitle(),
-                'url' => array(
-                    'route' => 'course',
-                    'routeParameters' => array(
-                        'cidReq' => $course->getCode(),
-                        'id_session' => api_get_session_id()
-                    )
-                )
-            );
-            array_unshift($breadcrumbs, $courseBreadcrumb);
-        }
-
-        $app = $this->app;
-
-        $app['main_breadcrumb'] = function ($app) use ($breadcrumbs) {
-            /** @var \Knp\Menu\MenuItem $menu */
-            $menu = $app['knp_menu.factory']->createItem(
-                'root',
-                array(
-                    'childrenAttributes' => array(
-                        'class'        => 'breadcrumb',
-                        'currentClass' => 'active'
-                    )
-                )
-            );
-
-            if (!empty($breadcrumbs)) {
-                foreach ($breadcrumbs as $item) {
-                    if (empty($item['url'])) {
-                        $item['url'] = array();
-                    }
-                    $menu->addChild($item['name'], $item['url']);
-                }
-            }
-
-            return $menu;
-        };
-
-        $matcher = new Matcher();
-        $voter = new \Knp\Menu\Silex\Voter\RouteVoter();
-        $voter->setRequest($this->getRequest());
-        $matcher->addVoter($voter);
-        $renderer = new \Knp\Menu\Renderer\TwigRenderer(
-            $this->get('twig'),
-            'bread.tpl',
-            $matcher
-        );
-        $bread = $renderer->render(
-            $this->get('main_breadcrumb'),
-            array(
-                'template' => 'default/layout/bread.tpl'
-            )
-        );
-        $app['breadcrumbs'] = $bread;
-    }
-
-    /**
-     * @return array
-     */
-    public function menuList()
-    {
-        return array(
-            'index',
-            'users' => array(
-                'list', 'add', 'edit', 'export', 'import', 'profiling', 'roles'
-            ),
-            'courses' => array(
-                array(
-                    'list',
-                    'add',
-                    'edit',
-                    'export',
-                    'import',
-                    'add_users',
-                    'import_users',
-                    'course_categories',
-                    'extra_fields',
-                    'question_extra_fields'
-                )
-            ),
-            'sessions',
-            'classes',
-            'appearance',
-            'plugins',
-            'settings',
-            'tools'
-        );
-    }
-
-    public function before(Request $request)
-    {
-
-    }
-}

+ 0 - 98
src/ChamiloLMS/Controller/LegacyController.php

@@ -1,98 +0,0 @@
-<?php
-/* For licensing terms, see /license.txt */
-
-namespace ChamiloLMS\Controller;
-
-use Silex\Application;
-use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\HttpFoundation\Request;
-
-/**
- * Class LegacyController
- * Manages the chamilo pages starting with Display::display_header and $tpl = new Template();
- * @package ChamiloLMS\Controller
- * @author Julio Montoya <gugli100@gmail.com>
- */
-class LegacyController extends BaseController
-{
-    public $section;
-
-    /**
-    * Handles default Chamilo scripts handled by Display::display_header() and display_footer()
-    *
-    * @param \Silex\Application $app
-    * @param string $file
-    *
-    * @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response|void
-    */
-    public function classicAction(Application $app, $file)
-    {
-        $responseHeaders = array();
-        $request = $this->getRequest();
-
-        // get.
-        $_GET = $request->query->all();
-        // post.
-        $_POST = $request->request->all();
-        // echo $request->getMethod();
-
-        //$_REQUEST = $request->request->all();
-        $mainPath = $app['paths']['sys_root'].'main/';
-
-        $fileToLoad = $mainPath.$file;
-
-        if (is_file($fileToLoad) &&
-            \Security::check_abs_path($fileToLoad, $mainPath)
-        ) {
-            $toolNameFromFile = basename(dirname($fileToLoad));
-
-            // Default values
-            $_course = api_get_course_info();
-            $_user = api_get_user_info();
-            $charset = 'UTF-8';
-            $debug = $app['debug'];
-            $text_dir = api_get_text_direction();
-            $is_platformAdmin = api_is_platform_admin();
-            $_cid = api_get_course_id();
-
-            // Loading file
-            ob_start();
-            require_once $mainPath.$file;
-            $out = ob_get_contents();
-            ob_end_clean();
-
-            // No browser cache when executing an exercise.
-            if ($file == 'exercice/exercise_submit.php') {
-                $responseHeaders = array(
-                    'cache-control' => 'no-store, no-cache, must-revalidate'
-                );
-            }
-
-            // Setting page header/footer conditions (important for LPs)
-            $this->getTemplate()->setFooter($app['template.show_footer']);
-            $this->getTemplate()->setHeader($app['template.show_header']);
-
-            if (isset($htmlHeadXtra)) {
-                $this->getTemplate()->addResource($htmlHeadXtra, 'string');
-            }
-            // $interbreadcrumb is loaded in the require_once file.
-            $interbreadcrumb = isset($interbreadcrumb) ? $interbreadcrumb : null;
-            $this->getTemplate()->setBreadcrumb($interbreadcrumb);
-            $breadCrumb = $this->getTemplate()->getBreadCrumbLegacyArray();
-            $menu = $this->parseLegacyBreadCrumb($breadCrumb);
-            $this->getTemplate()->assign('new_breadcrumb', $menu);
-            $this->getTemplate()->parseResources();
-
-            if (isset($tpl)) {
-                $response = $app['twig']->render($app['default_layout']);
-            } else {
-                $this->getTemplate()->assign('content', $out);
-                $response = $app['twig']->render($app['default_layout']);
-            }
-        } else {
-            return $app->abort(404, 'File not found');
-        }
-
-        return new Response($response, 200, $responseHeaders);
-    }
-}

+ 2 - 2
src/ChamiloLMS/Command/Translation/ExportLanguagesCommand.php → src/ChamiloLMS/CoreBundle/Command/Translation/ExportLanguagesCommand.php

@@ -1,7 +1,7 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Command\Translation;
+namespace ChamiloLMS\CoreBundle\Command\Translation;
 
 use Symfony\Component\Console\Input\ArrayInput;
 use Symfony\Component\Console\Input\InputArgument;
@@ -14,7 +14,7 @@ use Symfony\Component\Console\Input\InputInterface;
 
 /**
  * Class ExportLanguagesCommand
- * @package ChamiloLMS\Command\Translation
+ * @package ChamiloLMS\CoreBundle\Command\Translation
  */
 class ExportLanguagesCommand extends Command
 {

+ 2 - 2
src/ChamiloLMS/Component/Auth/LoginListener.php → src/ChamiloLMS/CoreBundle/Component/Auth/LoginListener.php

@@ -1,6 +1,6 @@
 <?php
 /* For licensing terms, see /license.txt */
-namespace ChamiloLMS\Component\Auth;
+namespace ChamiloLMS\CoreBundle\Component\Auth;
 
 use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
 use Symfony\Component\Security\Http\Event\SwitchUserEvent;
@@ -13,7 +13,7 @@ class LoginListener
      */
     public function onSecuritySwitchUser(SwitchUserEvent $event)
     {
-        /** @var \ChamiloLMS\Entity\User $user */
+        /** @var \ChamiloLMS\CoreBundle\Entity\User $user */
         $user = $event->getTargetUser();
         /*var_dump($user );
         var_dump($event->getRequest()->getUser());

+ 2 - 2
src/ChamiloLMS/Component/Auth/LoginSuccessHandler.php → src/ChamiloLMS/CoreBundle/Component/Auth/LoginSuccessHandler.php

@@ -1,6 +1,6 @@
 <?php
 /* For licensing terms, see /license.txt */
-namespace ChamiloLMS\Component\Auth;
+namespace ChamiloLMS\CoreBundle\Component\Auth;
 
 use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface;
 use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
@@ -9,7 +9,7 @@ use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\RedirectResponse;
 use Symfony\Component\Routing\Router;
 use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
-use ChamiloLMS\Entity\User;
+use ChamiloLMS\CoreBundle\Entity\User;
 
 /**
  * Class LoginSuccessHandler

+ 1 - 1
src/ChamiloLMS/Component/Auth/LogoutSuccessHandler.php → src/ChamiloLMS/CoreBundle/Component/Auth/LogoutSuccessHandler.php

@@ -1,6 +1,6 @@
 <?php
 /* For licensing terms, see /license.txt */
-namespace ChamiloLMS\Component\Auth;
+namespace ChamiloLMS\CoreBundle\Listener;
 
 use Symfony\Component\Security\Http\Logout\LogoutSuccessHandlerInterface;
 use Symfony\Component\Security\Core\SecurityContext;

+ 3 - 3
src/ChamiloLMS/Component/Auth/Role.php → src/ChamiloLMS/CoreBundle/Component/Auth/Role.php

@@ -1,16 +1,16 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Auth;
+namespace ChamiloLMS\CoreBundle\Component\Auth;
 
 use Symfony\Component\Security\Core\Role\RoleInterface;
 use Symfony\Component\Security\Core\User\AdvancedUserInterface;
 use Doctrine\Common\Collections\ArrayCollection;
-use ChamiloLMS\Entity\CourseRelUser;
+use ChamiloLMS\CoreBundle\Entity\CourseRelUser;
 
 /**
  * Class Role
- * @package ChamiloLMS\Component\Auth
+ * @package ChamiloLMS\CoreBundle\Component\Auth
  */
 class Role implements RoleInterface
 {

+ 3 - 3
src/ChamiloLMS/Component/Composer/Tasks.php → src/ChamiloLMS/CoreBundle/Component/Composer/Tasks.php

@@ -1,12 +1,12 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Composer;
+namespace ChamiloLMS\CoreBundle\Composer;
 
 /**
  * Class Tasks
  * Executes tasks when executing composer update/install methods
- * @package ChamiloLMS\Composer
+ * @package ChamiloLMS\CoreBundle\Composer
  */
 class Tasks
 {
@@ -27,4 +27,4 @@ class Tasks
     {
 
     }
-}
+}

+ 2 - 2
src/ChamiloLMS/Component/Console/Output/BufferedOutput.php → src/ChamiloLMS/CoreBundle/Component/Console/Output/BufferedOutput.php

@@ -1,14 +1,14 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Console\Output;
+namespace ChamiloLMS\CoreBundle\Component\Console\Output;
 
 use Symfony\Component\Console\Output\Output;
 use Symfony\Component\HttpFoundation\Request;
 
 /**
  * Class BufferedOutput
- * @package ChamiloLMS\Component\Console\Output
+ * @package ChamiloLMS\CoreBundle\Component\Console\Output
  */
 class BufferedOutput extends Output
 {

+ 5 - 5
src/ChamiloLMS/Component/DataFilesystem/DataFilesystem.php → src/ChamiloLMS/CoreBundle/Component/DataFilesystem/DataFilesystem.php

@@ -1,16 +1,16 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\DataFilesystem;
+namespace ChamiloLMS\CoreBundle\Component\DataFilesystem;
 
 use Symfony\Component\Finder\Finder;
 use Symfony\Component\Finder\SplFileInfo;
 use Symfony\Component\Filesystem\Filesystem;
 use Symfony\Component\Console;
 use Sunra\PhpSimple\HtmlDomParser;
-use ChamiloLMS\Component\Editor\Connector;
-use ChamiloLMS\Component\Editor\Driver\CourseDriver;
-use ChamiloLMS\Entity\User;
+use ChamiloLMS\CoreBundle\Component\Editor\Connector;
+use ChamiloLMS\CoreBundle\Component\Editor\Driver\CourseDriver;
+use ChamiloLMS\CoreBundle\Entity\User;
 use MediaAlchemyst\Alchemyst;
 use Unoconv\Unoconv;
 use Symfony\Component\Console\Output\OutputInterface;
@@ -19,7 +19,7 @@ use Symfony\Component\Console\Output\OutputInterface;
  * @todo use Gaufrette to manage course files (some day)
  * @todo add security restrictions.
  * Class DataFilesystem
- * @package ChamiloLMS\Component\DataFilesystem
+ * @package ChamiloLMS\CoreBundle\Component\DataFilesystem
  */
 class DataFilesystem
 {

+ 5 - 5
src/ChamiloLMS/Component/Editor/CkEditor/CkEditor.php → src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/CkEditor.php

@@ -1,15 +1,15 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\CkEditor;
+namespace ChamiloLMS\CoreBundle\Component\Editor\CkEditor;
 
-use ChamiloLMS\Component\Editor\Editor;
-use ChamiloLMS\Component\Editor\CkEditor\Toolbar;
+use ChamiloLMS\CoreBundle\Component\Editor\Editor;
+use ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar;
 use Symfony\Component\Routing\Generator\UrlGenerator;
 
 /**
  * Class CkEditor
- * @package ChamiloLMS\Component\Editor\CkEditor
+ * @package ChamiloLMS\CoreBundle\Component\Editor\CkEditor
  */
 class CkEditor extends Editor
 {
@@ -73,7 +73,7 @@ class CkEditor extends Editor
         if (empty($templates)) {
             return null;
         }
-        /** @var \ChamiloLMS\Entity\SystemTemplate $template */
+        /** @var \ChamiloLMS\CoreBundle\Entity\SystemTemplate $template */
         $templateList = array();
 
         $search = array('{CSS}', '{IMG_DIR}', '{REL_PATH}', '{COURSE_DIR}');

+ 3 - 3
src/ChamiloLMS/Component/Editor/CkEditor/Toolbar/Basic.php → src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/Basic.php

@@ -1,13 +1,13 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\CkEditor\Toolbar;
+namespace ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar;
 
-use ChamiloLMS\Component\Editor\Toolbar;
+use ChamiloLMS\CoreBundle\Component\Editor\Toolbar;
 
 /**
  * Class Basic
- * @package ChamiloLMS\Component\Editor\CkEditor\Toolbar
+ * @package ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar
  */
 class Basic extends Toolbar
 {

+ 2 - 2
src/ChamiloLMS/Component/Editor/CkEditor/Toolbar/Documents.php → src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/Documents.php

@@ -1,11 +1,11 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\CkEditor\Toolbar;
+namespace ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar;
 
 /**
  * Class Documents
- * @package ChamiloLMS\Component\Editor\CkEditor\Toolbar
+ * @package ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar
  */
 class Documents extends Basic
 {

+ 2 - 2
src/ChamiloLMS/Component/Editor/CkEditor/Toolbar/IntroductionTool.php → src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/IntroductionTool.php

@@ -1,11 +1,11 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\CkEditor\Toolbar;
+namespace ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar;
 
 /**
  * Class IntroductionTool
- * @package ChamiloLMS\Component\Editor\CkEditor\Toolbar
+ * @package ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar
  */
 class IntroductionTool extends Basic
 {

+ 2 - 2
src/ChamiloLMS/Component/Editor/CkEditor/Toolbar/LearningPathDocuments.php → src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/LearningPathDocuments.php

@@ -1,11 +1,11 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\CkEditor\Toolbar;
+namespace ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar;
 
 /**
  * Class LearningPathDocuments
- * @package ChamiloLMS\Component\Editor\CkEditor\Toolbar
+ * @package ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar
  */
 class LearningPathDocuments extends Basic
 {

+ 2 - 2
src/ChamiloLMS/Component/Editor/CkEditor/Toolbar/Message.php → src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/Message.php

@@ -1,11 +1,11 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\CkEditor\Toolbar;
+namespace ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar;
 
 /**
  * Class Message
- * @package ChamiloLMS\Component\Editor\CkEditor\Toolbar
+ * @package ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar
  */
 class Message extends Basic
 {

+ 2 - 2
src/ChamiloLMS/Component/Editor/CkEditor/Toolbar/TestFreeAnswer.php → src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/TestFreeAnswer.php

@@ -1,11 +1,11 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\CkEditor\Toolbar;
+namespace ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar;
 
 /**
  * Class TestFreeAnswer
- * @package ChamiloLMS\Component\Editor\CkEditor\Toolbar
+ * @package ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar
  */
 class TestFreeAnswer extends Basic
 {

+ 2 - 2
src/ChamiloLMS/Component/Editor/CkEditor/Toolbar/TestFreeAnswerStrict.php → src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/TestFreeAnswerStrict.php

@@ -1,11 +1,11 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\CkEditor\Toolbar;
+namespace ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar;
 
 /**
  * Class TestFreeAnswerStrict
- * @package ChamiloLMS\Component\Editor\CkEditor\Toolbar
+ * @package ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar
  */
 class TestFreeAnswerStrict extends Basic
 {

+ 2 - 2
src/ChamiloLMS/Component/Editor/CkEditor/Toolbar/TestProposedAnswer.php → src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/TestProposedAnswer.php

@@ -1,11 +1,11 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\CkEditor\Toolbar;
+namespace ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar;
 
 /**
  * Class TestProposedAnswer
- * @package ChamiloLMS\Component\Editor\CkEditor\Toolbar
+ * @package ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar
  */
 class TestProposedAnswer
 {

+ 2 - 2
src/ChamiloLMS/Component/Editor/CkEditor/Toolbar/TestQuestionDescription.php → src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/TestQuestionDescription.php

@@ -1,11 +1,11 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\CkEditor\Toolbar;
+namespace ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar;
 
 /**
  * Class TestQuestionDescription
- * @package ChamiloLMS\Component\Editor\CkEditor\Toolbar
+ * @package ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar
  */
 class TestQuestionDescription
 {

+ 2 - 2
src/ChamiloLMS/Component/Editor/CkEditor/Toolbar/UniqueAnswerImage.php → src/ChamiloLMS/CoreBundle/Component/Editor/CkEditor/Toolbar/UniqueAnswerImage.php

@@ -1,11 +1,11 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\CkEditor\Toolbar;
+namespace ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar;
 
 /**
  * Class UniqueAnswerImage
- * @package ChamiloLMS\Component\Editor\CkEditor\Toolbar
+ * @package ChamiloLMS\CoreBundle\Component\Editor\CkEditor\Toolbar
  */
 class UniqueAnswerImage extends Basic
 {

+ 7 - 7
src/ChamiloLMS/Component/Editor/Connector.php → src/ChamiloLMS/CoreBundle/Component/Editor/Connector.php

@@ -1,20 +1,20 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor;
+namespace ChamiloLMS\CoreBundle\Component\Editor;
 
 use Doctrine\ORM\EntityManager;
-use ChamiloLMS\Entity\User;
-use ChamiloLMS\Entity\Course;
+use ChamiloLMS\CoreBundle\Entity\User;
+use ChamiloLMS\CoreBundle\Entity\Course;
 
 use Symfony\Component\Translation\Translator;
 use Symfony\Component\Routing\Router;
-use ChamiloLMS\Component\Editor\Driver\Driver;
+use ChamiloLMS\CoreBundle\Component\Editor\Driver\Driver;
 use Symfony\Component\Security\Core\SecurityContext;
 
 /**
  * Class elFinder Connector - editor + Chamilo repository
- * @package ChamiloLMS\Component\Editor
+ * @package ChamiloLMS\CoreBundle\Component\Editor
  */
 class Connector
 {
@@ -168,7 +168,7 @@ class Connector
 
         $driverUpdated = array_merge($defaultDriver, $driver);
 
-        $driverUpdated['driver'] = 'ChamiloLMS\Component\Editor\Driver\\'.$driver['driver'];
+        $driverUpdated['driver'] = 'ChamiloLMS\CoreBundle\Component\Editor\Driver\\'.$driver['driver'];
         $driverUpdated['attributes'] = $attributes;
         return $driverUpdated;
     }
@@ -380,6 +380,6 @@ class Connector
      */
     private function getDriverClass($driver)
     {
-        return 'ChamiloLMS\Component\Editor\Driver\\'.$driver;
+        return 'ChamiloLMS\CoreBundle\Component\Editor\Driver\\'.$driver;
     }
 }

+ 2 - 2
src/ChamiloLMS/Component/Editor/Driver/CourseDriver.php → src/ChamiloLMS/CoreBundle/Component/Editor/Driver/CourseDriver.php

@@ -1,11 +1,11 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\Driver;
+namespace ChamiloLMS\CoreBundle\Component\Editor\Driver;
 
 /**
  * Class CourseDriver
- * @package ChamiloLMS\Component\Editor\Driver
+ * @package ChamiloLMS\CoreBundle\Component\Editor\Driver
  */
 class CourseDriver extends Driver
 {

+ 2 - 2
src/ChamiloLMS/Component/Editor/Driver/CourseUserDriver.php → src/ChamiloLMS/CoreBundle/Component/Editor/Driver/CourseUserDriver.php

@@ -1,11 +1,11 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\Driver;
+namespace ChamiloLMS\CoreBundle\Component\Editor\Driver;
 
 /**
  * Class CourseUserDriver
- * @package ChamiloLMS\Component\Editor\Driver
+ * @package ChamiloLMS\CoreBundle\Component\Editor\Driver
  */
 class CourseUserDriver extends CourseDriver
 {

+ 3 - 3
src/ChamiloLMS/Component/Editor/Driver/Driver.php → src/ChamiloLMS/CoreBundle/Component/Editor/Driver/Driver.php

@@ -1,13 +1,13 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\Driver;
+namespace ChamiloLMS\CoreBundle\Component\Editor\Driver;
 
-use ChamiloLMS\Component\Editor\Connector;
+use ChamiloLMS\CoreBundle\Component\Editor\Connector;
 
 /**
  * Class Driver
- * @package ChamiloLMS\Component\Editor\Driver
+ * @package ChamiloLMS\CoreBundle\Component\Editor\Driver
  */
 class Driver extends \elFinderVolumeLocalFileSystem implements InterfaceDriver
 {

+ 7 - 7
src/ChamiloLMS/Component/Editor/Driver/DropBoxDriver.php → src/ChamiloLMS/CoreBundle/Component/Editor/Driver/DropBoxDriver.php

@@ -1,14 +1,14 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\Driver;
+namespace ChamiloLMS\CoreBundle\Component\Editor\Driver;
 
-use ChamiloLMS\Entity\CDropboxFile;
-use ChamiloLMS\Component\Editor\Connector;
+use ChamiloLMS\CoreBundle\Entity\CDropboxFile;
+use ChamiloLMS\CoreBundle\Component\Editor\Connector;
 
 /**
  * Class DropBoxDriver
- * @package ChamiloLMS\Component\Editor\Driver
+ * @package ChamiloLMS\CoreBundle\Component\Editor\Driver
  */
 class DropBoxDriver extends \elFinderVolumeMySQL implements InterfaceDriver
 {
@@ -69,8 +69,8 @@ class DropBoxDriver extends \elFinderVolumeMySQL implements InterfaceDriver
     {
         if ($this->connector->security->isGranted('IS_AUTHENTICATED_FULLY')) {
 
-            /** @var \ChamiloLMS\Entity\Repository\UserRepository $repository */
-            /*$repository = $this->connector->entityManager->getRepository('ChamiloLMS\Entity\User');
+            /** @var \ChamiloLMS\CoreBundle\Entity\Repository\UserRepository $repository */
+            /*$repository = $this->connector->entityManager->getRepository('ChamiloLMS\CoreBundle\Entity\User');
             $courses = $repository->getCourses($this->connector->user);*/
 
             //if (!empty($courses)) {
@@ -206,7 +206,7 @@ class DropBoxDriver extends \elFinderVolumeMySQL implements InterfaceDriver
             return $this->returnDirectory();
         }
 
-        $file = $this->connector->entityManager->getRepository('ChamiloLMS\Entity\CDropboxFile')->findOneBy($criteria);
+        $file = $this->connector->entityManager->getRepository('ChamiloLMS\CoreBundle\Entity\CDropboxFile')->findOneBy($criteria);
 
         if ($file) {
             $stat = $this->transformFileInStat($file);

+ 2 - 2
src/ChamiloLMS/Component/Editor/Driver/HomeDriver.php → src/ChamiloLMS/CoreBundle/Component/Editor/Driver/HomeDriver.php

@@ -1,11 +1,11 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\Driver;
+namespace ChamiloLMS\CoreBundle\Component\Editor\Driver;
 
 /**
  * Class HomeDriver
- * @package ChamiloLMS\Component\Editor\Driver
+ * @package ChamiloLMS\CoreBundle\Component\Editor\Driver
  */
 class HomeDriver extends Driver
 {

+ 3 - 3
src/ChamiloLMS/Component/Editor/Driver/InterfaceDriver.php → src/ChamiloLMS/CoreBundle/Component/Editor/Driver/InterfaceDriver.php

@@ -1,13 +1,13 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\Driver;
+namespace ChamiloLMS\CoreBundle\Component\Editor\Driver;
 
-use ChamiloLMS\Component\Editor\Connector;
+use ChamiloLMS\CoreBundle\Component\Editor\Connector;
 
 /**
  * Class Driver
- * @package ChamiloLMS\Component\Editor\Driver
+ * @package ChamiloLMS\CoreBundle\Component\Editor\Driver
  */
 interface interfaceDriver
 {

+ 2 - 2
src/ChamiloLMS/Component/Editor/Driver/PersonalDriver.php → src/ChamiloLMS/CoreBundle/Component/Editor/Driver/PersonalDriver.php

@@ -1,12 +1,12 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\Driver;
+namespace ChamiloLMS\CoreBundle\Component\Editor\Driver;
 
 /**
  * Class PersonalDriver
  * @todo add more checks in upload/rm
- * @package ChamiloLMS\Component\Editor\Driver
+ * @package ChamiloLMS\CoreBundle\Component\Editor\Driver
  */
 class PersonalDriver extends Driver
 {

+ 4 - 4
src/ChamiloLMS/Component/Editor/Editor.php → src/ChamiloLMS/CoreBundle/Component/Editor/Editor.php

@@ -1,16 +1,16 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor;
+namespace ChamiloLMS\CoreBundle\Component\Editor;
 
 use Symfony\Component\Translation\Translator;
 use Symfony\Component\Routing\Router;
-use ChamiloLMS\Entity\Course;
-use ChamiloLMS\Framework\Template;
+use ChamiloLMS\CoreBundle\Entity\Course;
+use ChamiloLMS\CoreBundle\Framework\Template;
 
 /**
  * Class Editor
- * @package ChamiloLMS\Component\Editor
+ * @package ChamiloLMS\CoreBundle\Component\Editor
  */
 class Editor
 {

+ 1 - 1
src/ChamiloLMS/Component/Editor/Finder.php → src/ChamiloLMS/CoreBundle/Component/Editor/Finder.php

@@ -1,7 +1,7 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor;
+namespace ChamiloLMS\CoreBundle\Component\Editor;
 
 /**
  * elFinder - file manager for web.

+ 4 - 4
src/ChamiloLMS/Component/Editor/TinyMce/TinyMce.php → src/ChamiloLMS/CoreBundle/Component/Editor/TinyMce/TinyMce.php

@@ -1,14 +1,14 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\TinyMce;
+namespace ChamiloLMS\CoreBundle\Component\Editor\TinyMce;
 
-use ChamiloLMS\Component\Editor\Editor;
-use ChamiloLMS\Component\Editor\TinyMce\Toolbar;
+use ChamiloLMS\CoreBundle\Component\Editor\Editor;
+use ChamiloLMS\CoreBundle\Component\Editor\TinyMce\Toolbar;
 
 /**
  * Class TinyMce
- * @package ChamiloLMS\Component\Editor\TinyMce
+ * @package ChamiloLMS\CoreBundle\Component\Editor\TinyMce
  */
 class TinyMce extends Editor
 {

+ 3 - 3
src/ChamiloLMS/Component/Editor/TinyMce/Toolbar/Basic.php → src/ChamiloLMS/CoreBundle/Component/Editor/TinyMce/Toolbar/Basic.php

@@ -1,13 +1,13 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor\TinyMce\Toolbar;
+namespace ChamiloLMS\CoreBundle\Component\Editor\TinyMce\Toolbar;
 
-use ChamiloLMS\Component\Editor\Toolbar;
+use ChamiloLMS\CoreBundle\Component\Editor\Toolbar;
 
 /**
  * Class Basic
- * @package ChamiloLMS\Component\Editor\TinyMce\Toolbar\Basic
+ * @package ChamiloLMS\CoreBundle\Component\Editor\TinyMce\Toolbar\Basic
  */
 class Basic extends Toolbar
 {

+ 2 - 2
src/ChamiloLMS/Component/Editor/Toolbar.php → src/ChamiloLMS/CoreBundle/Component/Editor/Toolbar.php

@@ -1,13 +1,13 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Editor;
+namespace ChamiloLMS\CoreBundle\Component\Editor;
 
 use Symfony\Component\Routing\Router;
 
 /**
  * Class Toolbar
- * @package ChamiloLMS\Component\Editor
+ * @package ChamiloLMS\CoreBundle\Component\Editor
  */
 class Toolbar
 {

+ 2 - 2
src/ChamiloLMS/Component/Mail/MailGenerator.php → src/ChamiloLMS/CoreBundle/Component/Mail/MailGenerator.php

@@ -1,11 +1,11 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Mail;
+namespace ChamiloLMS\CoreBundle\Component\Mail;
 
 /**
  * Class MailGenerator
- * @package ChamiloLMS\Component\Mail
+ * @package ChamiloLMS\CoreBundle\Component\Mail
  */
 class MailGenerator
 {

+ 1 - 1
src/ChamiloLMS/Component/Validator/ConstraintValidatorFactory.php → src/ChamiloLMS/CoreBundle/Component/Validator/ConstraintValidatorFactory.php

@@ -1,7 +1,7 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Component\Validator;
+namespace ChamiloLMS\CoreBundle\Component\Validator;
 
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\ConstraintValidator;

+ 15 - 22
src/ChamiloLMS/Controller/Admin/AdminController.php → src/ChamiloLMS/CoreBundle/Controller/Admin/AdminController.php

@@ -1,10 +1,9 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\Admin;
+namespace ChamiloLMS\CoreBundle\Controller\Admin;
 
-use ChamiloLMS\Controller\BaseController;
-use Silex\Application;
+use ChamiloLMS\CoreBundle\Controller\BaseController;
 use Symfony\Component\HttpFoundation\Response;
 use Entity;
 use Symfony\Component\Routing\Annotation\Route;
@@ -12,14 +11,13 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
 
 /**
  * Class Administrator
- * @todo @route and @method function don't work yet
- * @package ChamiloLMS\Controller
+ * @package ChamiloLMS\CoreBundle\Controller
  * @author Julio Montoya <gugli100@gmail.com>
  */
 class AdminController extends BaseController
 {
     /**
-     * @Route("/")
+     * @Route("/", name="administration")
      * @Method({"GET"})
      *
      * @return Response
@@ -29,16 +27,13 @@ class AdminController extends BaseController
         $template = $this->getTemplate();
         $security = $this->getSecurity();
 
-        if (!$security->isGranted($this->app['allow_admin_toolbar'])) {
-            return $this->abort(403, 'Access denied');
+        if (!$security->isGranted('ROLE_ADMIN')) {
+            //return $this->abort(403, 'Access denied');
         }
 
         if ($security->isGranted('ROLE_ADMIN')) {
-            $this->loadAdminMenu();
+            return $this->loadAdminMenu();
         }
-        $response = $template->renderTemplate('admin/index.tpl');
-
-        return new Response($response, 200, array());
     }
 
     /**
@@ -58,17 +53,9 @@ class AdminController extends BaseController
      */
     private function loadAdminMenu()
     {
-        $template = $this->get('template');
-
         // Access restrictions.
         api_protect_admin_script(true);
 
-        // @todo fix register/check version
-        $message = null;
-        if (!empty($_POST['Register'])) {
-            register_site();
-            $message = \Display::return_message(get_lang('VersionCheckEnabled'), 'confirmation');
-        }
         $adminUrl = api_get_path(WEB_CODE_PATH).'admin/';
         $blocks = array();
 
@@ -273,7 +260,13 @@ class AdminController extends BaseController
         }
 
         $admin_ajax_url = api_get_path(WEB_AJAX_PATH).'admin.ajax.php';
-        $template->assign('web_admin_ajax_url', $admin_ajax_url);
-        $template->assign('blocks', $blocks);
+
+        return $this->render(
+            'ChamiloLMSCoreBundle:Admin:index.html.twig',
+            array(
+                'blocks' => $blocks,
+                'web_admin_ajax_url' => $admin_ajax_url
+            )
+        );
     }
 }

+ 13 - 13
src/ChamiloLMS/Controller/Admin/Administrator/BranchController.php → src/ChamiloLMS/CoreBundle/Controller/Admin/Administrator/BranchController.php

@@ -1,36 +1,36 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\Admin\Administrator;
+namespace ChamiloLMS\CoreBundle\Controller\Admin\Administrator;
 
-use ChamiloLMS\Controller\CrudController;
+use ChamiloLMS\CoreBundle\Controller\CrudController;
 use Silex\Application;
 use Symfony\Component\HttpFoundation\JsonResponse;
 use Symfony\Component\HttpFoundation\Response;
 use Entity;
-use ChamiloLMS\Form\BranchType;
-use ChamiloLMS\Form\BranchUsersType;
-use ChamiloLMS\Entity\BranchUsers;
-use ChamiloLMS\Entity\BranchSync;
+use ChamiloLMS\CoreBundle\Form\BranchType;
+use ChamiloLMS\CoreBundle\Form\BranchUsersType;
+use ChamiloLMS\CoreBundle\Entity\BranchUsers;
+use ChamiloLMS\CoreBundle\Entity\BranchSync;
 
 use Symfony\Component\Routing\Annotation\Route;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
 
 /**
  * Class RoleController
- * @package ChamiloLMS\Controller\Admin\Administrator
+ * @package ChamiloLMS\CoreBundle\Controller\Admin\Administrator
  * @author Julio Montoya <gugli100@gmail.com>
  */
 class BranchController extends CrudController
 {
     public function getClass()
     {
-        return 'ChamiloLMS\Entity\BranchSync';
+        return 'ChamiloLMS\CoreBundle\Entity\BranchSync';
     }
 
     public function getType()
     {
-        return 'ChamiloLMS\Form\BranchType';
+        return 'ChamiloLMS\CoreBundle\Form\BranchType';
     }
 
     public function getControllerAlias()
@@ -76,7 +76,7 @@ class BranchController extends CrudController
         $query = $this->getManager()
             ->createQueryBuilder()
             ->select('node')
-            ->from('ChamiloLMS\Entity\BranchSync', 'node')
+            ->from('ChamiloLMS\CoreBundle\Entity\BranchSync', 'node')
             //->where('node.cId = 0')
             ->orderBy('node.root, node.lft', 'ASC')
             ->getQuery();
@@ -108,7 +108,7 @@ class BranchController extends CrudController
 
                 $userIdList = $item->getUserId();
                 $userId = ($userIdList[0]);
-                $user = $this->getManager()->getRepository('ChamiloLMS\Entity\User')->find($userId);
+                $user = $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\User')->find($userId);
                 if (!$user) {
                     throw new \Exception('Unable to found User');
                 }
@@ -151,7 +151,7 @@ class BranchController extends CrudController
             'branchId' => $id,
             'userId' => $userId
         );
-        $branchUser = $this->getManager()->getRepository('ChamiloLMS\Entity\BranchUsers')->findOneBy($criteria);
+        $branchUser = $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\BranchUsers')->findOneBy($criteria);
 
         if (!$branchUser) {
             $this->createNotFoundException();
@@ -174,7 +174,7 @@ class BranchController extends CrudController
         $template = $this->get('template');
         $template->assign('links', $this->generateLinks());
 
-        /** @var \ChamiloLMS\Entity\Repository\BranchSyncRepository $repo */
+        /** @var \ChamiloLMS\CoreBundle\Entity\Repository\BranchSyncRepository $repo */
         $repo = $this->getRepository();
         $item = $this->getEntity($id);
 

+ 15 - 15
src/ChamiloLMS/Controller/Admin/Administrator/JuryController.php → src/ChamiloLMS/CoreBundle/Controller/Admin/Administrator/JuryController.php

@@ -1,32 +1,32 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\Admin\Administrator;
+namespace ChamiloLMS\CoreBundle\Controller\Admin\Administrator;
 
-use ChamiloLMS\Controller\CrudController;
+use ChamiloLMS\CoreBundle\Controller\CrudController;
 use Symfony\Component\Form\Extension\Validator\Constraints\FormValidator;
 use Symfony\Component\HttpFoundation\Response;
 use Entity;
-use ChamiloLMS\Form\JuryType;
-use ChamiloLMS\Form\JuryUserType;
-use ChamiloLMS\Form\JuryMembersType;
+use ChamiloLMS\CoreBundle\Form\JuryType;
+use ChamiloLMS\CoreBundle\Form\JuryUserType;
+use ChamiloLMS\CoreBundle\Form\JuryMembersType;
 use Symfony\Component\HttpFoundation\JsonResponse;
-use ChamiloLMS\Entity\JuryMembers;
-use ChamiloLMS\Entity\Jury;
+use ChamiloLMS\CoreBundle\Entity\JuryMembers;
+use ChamiloLMS\CoreBundle\Entity\Jury;
 
 use Symfony\Component\Routing\Annotation\Route;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
 
 /**
  * Class JuryController
- * @package ChamiloLMS\Controller\Admin\Administrator
+ * @package ChamiloLMS\CoreBundle\Controller\Admin\Administrator
  * @author Julio Montoya <gugli100@gmail.com>
  */
 class JuryController extends CrudController
 {
     public function getClass()
     {
-        return 'ChamiloLMS\Entity\Jury';
+        return 'ChamiloLMS\CoreBundle\Entity\Jury';
     }
 
     public function getControllerAlias()
@@ -39,7 +39,7 @@ class JuryController extends CrudController
      */
     public function getType()
     {
-        return 'ChamiloLMS\Form\JuryType';
+        return 'ChamiloLMS\CoreBundle\Form\JuryType';
     }
 
     /**
@@ -73,7 +73,7 @@ class JuryController extends CrudController
     */
     public function removeMemberAction($id)
     {
-        $juryMembers = $this->getManager()->getRepository('ChamiloLMS\Entity\JuryMembers')->find($id);
+        $juryMembers = $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\JuryMembers')->find($id);
         if ($juryMembers) {
             $em = $this->getManager();
             $em->remove($juryMembers);
@@ -95,8 +95,8 @@ class JuryController extends CrudController
         $keyword = $request->get('tag');
 
         $role = $request->get('role');
-        /** @var \ChamiloLMS\Entity\Repository\UserRepository $repo */
-        $repo = $this->getManager()->getRepository('ChamiloLMS\Entity\User');
+        /** @var \ChamiloLMS\CoreBundle\Entity\Repository\UserRepository $repo */
+        $repo = $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\User');
 
         if (empty($role)) {
             $entities = $repo->searchUserByKeyword($keyword);
@@ -106,7 +106,7 @@ class JuryController extends CrudController
 
         $data = array();
         if ($entities) {
-            /** @var \ChamiloLMS\Entity\User $entity */
+            /** @var \ChamiloLMS\CoreBundle\Entity\User $entity */
             foreach ($entities as $entity) {
                 $data[] = array(
                     'key' => (string) $entity->getUserId(),
@@ -136,7 +136,7 @@ class JuryController extends CrudController
 
                 $userIdList = $item->getUserId();
                 $userId = ($userIdList[0]);
-                $user = $this->getManager()->getRepository('ChamiloLMS\Entity\User')->find($userId);
+                $user = $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\User')->find($userId);
                 if (!$user) {
                     throw new \Exception('Unable to found User');
                 }

+ 16 - 6
src/ChamiloLMS/Controller/Admin/Administrator/QuestionScoreController.php → src/ChamiloLMS/CoreBundle/Controller/Admin/Administrator/QuestionScoreController.php

@@ -1,29 +1,39 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\Admin\Administrator;
+namespace ChamiloLMS\CoreBundle\Controller\Admin\Administrator;
 
-use ChamiloLMS\Controller\CrudController;
+use ChamiloLMS\CoreBundle\Controller\CrudController;
 use Symfony\Component\HttpFoundation\Response;
-use ChamiloLMS\Entity;
+use ChamiloLMS\CoreBundle\Entity;
 use Symfony\Component\Routing\Annotation\Route;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
 
 /**
  * Class QuestionScoreController
- * @package ChamiloLMS\Controller\Admin\Administrator
+ * @package ChamiloLMS\CoreBundle\Controller\Admin\Administrator
  * @author Julio Montoya <gugli100@gmail.com>
+ * @Route("/question_score")
  */
 class QuestionScoreController extends CrudController
 {
+    /**
+     *
+     * @Route("/")
+     * @Method({"GET"})
+     */
+    public function indexAction()
+    {
+
+    }
     public function getClass()
     {
-        return 'ChamiloLMS\Entity\BranchSync';
+        return 'ChamiloLMS\CoreBundle\Entity\BranchSync';
     }
 
     public function getType()
     {
-        return 'ChamiloLMS\Form\QuestionScoreType';
+        return 'ChamiloLMS\CoreBundle\Form\QuestionScoreType';
     }
 
     /**

+ 8 - 7
src/ChamiloLMS/Controller/Admin/Administrator/QuestionScoreNameController.php → src/ChamiloLMS/CoreBundle/Controller/Admin/Administrator/QuestionScoreNameController.php

@@ -1,15 +1,16 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\Admin\Administrator;
+namespace ChamiloLMS\CoreBundle\Controller\Admin\Administrator;
 
-use ChamiloLMS\Controller\CrudController;
-use ChamiloLMS\Entity;
+use ChamiloLMS\CoreBundle\Controller\CrudController;
+use ChamiloLMS\CoreBundle\Entity;
+use Symfony\Component\Routing\Annotation\Route;
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
 
 /**
  * Class QuestionScoreController
- * @todo @route and @method function don't work yet
- * @package ChamiloLMS\Controller\Admin\Administrator
+ * @package ChamiloLMS\CoreBundle\Controller\Admin\Administrator
  * @author Julio Montoya <gugli100@gmail.com>
  */
 
@@ -17,12 +18,12 @@ class QuestionScoreNameController extends CrudController
 {
     public function getClass()
     {
-        return 'ChamiloLMS\Entity\QuestionScoreName';
+        return 'ChamiloLMS\CoreBundle\Entity\QuestionScoreName';
     }
 
     public function getType()
     {
-        return 'ChamiloLMS\Form\QuestionScoreNameType';
+        return 'ChamiloLMS\CoreBundle\Form\QuestionScoreNameType';
     }
 
     public function getControllerAlias()

+ 6 - 6
src/ChamiloLMS/Controller/Admin/Administrator/RoleController.php → src/ChamiloLMS/CoreBundle/Controller/Admin/Administrator/RoleController.php

@@ -1,14 +1,14 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\Admin\Administrator;
+namespace ChamiloLMS\CoreBundle\Controller\Admin\Administrator;
 
-use ChamiloLMS\Controller\CrudController;
-use ChamiloLMS\Entity;
+use ChamiloLMS\CoreBundle\Controller\CrudController;
+use ChamiloLMS\CoreBundle\Entity;
 
 /**
  * Class RoleController
- * @package ChamiloLMS\Controller\Admin\Administrator
+ * @package ChamiloLMS\CoreBundle\Controller\Admin\Administrator
  * @author Julio Montoya <gugli100@gmail.com>
  */
 class RoleController extends CrudController
@@ -18,7 +18,7 @@ class RoleController extends CrudController
      */
     public function getClass()
     {
-        return 'ChamiloLMS\Entity\Role';
+        return 'ChamiloLMS\CoreBundle\Entity\Role';
     }
 
     /**
@@ -26,7 +26,7 @@ class RoleController extends CrudController
      */
     public function getType()
     {
-        return 'ChamiloLMS\Form\RoleType';
+        return 'ChamiloLMS\CoreBundle\Form\RoleType';
     }
 
     /**

+ 4 - 4
src/ChamiloLMS/Controller/Admin/Administrator/UpgradeController.php → src/ChamiloLMS/CoreBundle/Controller/Admin/Administrator/UpgradeController.php

@@ -1,13 +1,13 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\Admin\Administrator;
+namespace ChamiloLMS\CoreBundle\Controller\Admin\Administrator;
 
-use ChamiloLMS\Controller\BaseController;
+use ChamiloLMS\CoreBundle\Controller\BaseController;
 use Silex\Application;
 use Symfony\Component\Form\Extension\Core\Type\FormType;
 use Symfony\Component\Form\Extension\Validator\Constraints\FormValidator;
-use ChamiloLMS\Component\Console\Output\BufferedOutput;
+use ChamiloLMS\CoreBundle\Component\Console\Output\BufferedOutput;
 use Symfony\Component\HttpFoundation\Response;
 use Entity;
 use Symfony\Component\Routing\Annotation\Route;
@@ -17,7 +17,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
 /**
  * Class RoleController
  * @todo @route and @method function don't work yet
- * @package ChamiloLMS\Controller
+ * @package ChamiloLMS\CoreBundle\Controller
  * @author Julio Montoya <gugli100@gmail.com>
  */
 class UpgradeController extends BaseController

+ 21 - 20
src/ChamiloLMS/Controller/Admin/Director/BranchDirectorController.php → src/ChamiloLMS/CoreBundle/Controller/Admin/Director/BranchDirectorController.php

@@ -1,38 +1,39 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\Admin\Director;
-
-use ChamiloLMS\Controller\CrudController;
-use ChamiloLMS\Form\DirectorJuryUserType;
-use ChamiloLMS\Form\JuryType;
-use ChamiloLMS\Entity;
-use ChamiloLMS\Entity\BranchSync;
-use ChamiloLMS\Entity\Jury;
-use ChamiloLMS\Entity\User;
-use ChamiloLMS\Entity\JuryMembers;
-use Silex\Application;
+namespace ChamiloLMS\CoreBundle\Controller\Admin\Director;
+
+use ChamiloLMS\CoreBundle\Controller\CrudController;
+use ChamiloLMS\CoreBundle\Form\DirectorJuryUserType;
+use ChamiloLMS\CoreBundle\Form\JuryType;
+use ChamiloLMS\CoreBundle\Entity;
+use ChamiloLMS\CoreBundle\Entity\BranchSync;
+use ChamiloLMS\CoreBundle\Entity\Jury;
+use ChamiloLMS\CoreBundle\Entity\User;
+use ChamiloLMS\CoreBundle\Entity\JuryMembers;
 use Symfony\Component\HttpFoundation\Response;
 
+use Symfony\Component\Routing\Annotation\Route;
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
+
 /**
  * Class RoleController
- * @todo @route and @method function don't work yet
- * @package ChamiloLMS\Controller
+ * @package ChamiloLMS\CoreBundle\Controller
  * @author Julio Montoya <gugli100@gmail.com>
  */
 class BranchDirectorController extends CrudController
 {
     public function getClass()
     {
-        return 'ChamiloLMS\Entity\BranchSync';
+        return 'ChamiloLMS\CoreBundle\Entity\BranchSync';
     }
 
     public function getType()
     {
-        return 'ChamiloLMS\Form\DirectorJuryUserType';
+        return 'ChamiloLMS\CoreBundle\Form\DirectorJuryUserType';
     }
 
-    protected function getControllerAlias()
+    public function getControllerAlias()
     {
         return 'branch_director.controller';
     }
@@ -40,7 +41,7 @@ class BranchDirectorController extends CrudController
     /**
      * {@inheritdoc}
      */
-    protected function getTemplatePath()
+    public function getTemplatePath()
     {
         return 'admin/director/branches/';
     }
@@ -61,7 +62,7 @@ class BranchDirectorController extends CrudController
             'childClose' => '</li>',
             'nodeDecorator' => function ($row) {
                 /**  @var BranchSync $branch */
-                $branch = $this->getManager()->getRepository('ChamiloLMS\Entity\BranchSync')->find($row['id']);
+                $branch = $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\BranchSync')->find($row['id']);
                 $juries = $branch->getJuries();
                 /** @var Jury $jury */
                 $juryList = null;
@@ -91,7 +92,7 @@ class BranchDirectorController extends CrudController
         $query = $this->getManager()
             ->createQueryBuilder()
             ->select('node')
-            ->from('ChamiloLMS\Entity\BranchSync', 'node')
+            ->from('ChamiloLMS\CoreBundle\Entity\BranchSync', 'node')
             ->innerJoin('node.users', 'u')
             ->where('u.userId = :userId')
             ->setParameter('userId', $userId)
@@ -161,7 +162,7 @@ class BranchDirectorController extends CrudController
         $form->handleRequest($request);
         if ($form->isValid()) {
 
-            $jury = $this->getManager()->getRepository('ChamiloLMS\Entity\Jury')->find($juryId);
+            $jury = $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\Jury')->find($juryId);
 
             $factory = $this->get('security.encoder_factory');
             $encoder = $factory->getEncoder($user);

+ 20 - 20
src/ChamiloLMS/Controller/Admin/JuryMember/JuryMemberController.php → src/ChamiloLMS/CoreBundle/Controller/Admin/JuryMember/JuryMemberController.php

@@ -1,14 +1,14 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\Admin\JuryMember;
-
-use ChamiloLMS\Controller\CrudController;
-use ChamiloLMS\Entity\TrackExercise;
-use ChamiloLMS\Entity\Jury;
-use ChamiloLMS\Entity\TrackExerciseAttemptJury;
-use ChamiloLMS\Entity\JuryMembers;
-use ChamiloLMS\Entity;
+namespace ChamiloLMS\CoreBundle\Controller\Admin\JuryMember;
+
+use ChamiloLMS\CoreBundle\Controller\CrudController;
+use ChamiloLMS\CoreBundle\Entity\TrackExercise;
+use ChamiloLMS\CoreBundle\Entity\Jury;
+use ChamiloLMS\CoreBundle\Entity\TrackExerciseAttemptJury;
+use ChamiloLMS\CoreBundle\Entity\JuryMembers;
+use ChamiloLMS\CoreBundle\Entity;
 use Silex\Application;
 use Symfony\Component\HttpFoundation\Response;
 use Doctrine\Common\Collections\Criteria;
@@ -17,7 +17,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
 
 /**
  * Class JuryMemberController
- * @package ChamiloLMS\Controller
+ * @package ChamiloLMS\CoreBundle\Controller
  * @author Julio Montoya <gugli100@gmail.com>
  */
 class JuryMemberController extends CrudController
@@ -26,7 +26,7 @@ class JuryMemberController extends CrudController
 
     public function getClass()
     {
-        return 'ChamiloLMS\Entity\Jury';
+        return 'ChamiloLMS\CoreBundle\Entity\Jury';
     }
 
     public function getControllerAlias()
@@ -48,7 +48,7 @@ class JuryMemberController extends CrudController
      */
     public function getType()
     {
-        return 'ChamiloLMS\Form\JuryType';
+        return 'ChamiloLMS\CoreBundle\Form\JuryType';
     }
 
     /**
@@ -147,7 +147,7 @@ class JuryMemberController extends CrudController
             $this->createNotFoundException();
         }
 
-        /** @var \ChamiloLMS\Entity\Jury $jury */
+        /** @var \ChamiloLMS\CoreBundle\Entity\Jury $jury */
         $jury = $this->getRepository()->find($juryId);
 
         if (empty($jury)) {
@@ -190,7 +190,7 @@ class JuryMemberController extends CrudController
         if ($security->isGranted('ROLE_JURY_PRESIDENT')) {
             // Relating user with president
             if ($member) {
-                $this->getManager()->getRepository('ChamiloLMS\Entity\JuryMembers')->assignUserToJuryMember(
+                $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\JuryMembers')->assignUserToJuryMember(
                     $trackExercise['exe_user_id'],
                     $member->getId()
                 );
@@ -204,7 +204,7 @@ class JuryMemberController extends CrudController
             'juryUserId' => $userId
         );
 
-        $trackJury = $this->getManager()->getRepository('ChamiloLMS\Entity\TrackExerciseAttemptJury')->findBy($criteria);
+        $trackJury = $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\TrackExerciseAttemptJury')->findBy($criteria);
 
         if ($trackJury) {
             $this->get('session')->getFlashBag()->add('info', "You already review this exercise attempt.");
@@ -232,11 +232,11 @@ class JuryMemberController extends CrudController
         $options = array();
 
         if ($modelType) {
-            /** @var \ChamiloLMS\Entity\QuestionScore $questionScoreName */
-            $questionScore = $this->get('orm.em')->getRepository('ChamiloLMS\Entity\QuestionScore')->find($modelType);
+            /** @var \ChamiloLMS\CoreBundle\Entity\QuestionScore $questionScoreName */
+            $questionScore = $this->get('orm.em')->getRepository('ChamiloLMS\CoreBundle\Entity\QuestionScore')->find($modelType);
             if ($questionScore) {
                 $items = $questionScore->getItems();
-                /** @var \ChamiloLMS\Entity\QuestionScoreName  $score */
+                /** @var \ChamiloLMS\CoreBundle\Entity\QuestionScoreName  $score */
                 foreach ($items as $score) {
                     $options[$score->getId().':'.$score->getScore()] = $score;
                 }
@@ -349,8 +349,8 @@ class JuryMemberController extends CrudController
     public function saveScoreAction($exeId, $juryId)
     {
         $questionsAndScore = $this->getRequest()->get('options');
-        /** @var \ChamiloLMS\Entity\TrackExercise $attempt */
-        $attempt = $this->getManager()->getRepository('ChamiloLMS\Entity\TrackExercise')->find($exeId);
+        /** @var \ChamiloLMS\CoreBundle\Entity\TrackExercise $attempt */
+        $attempt = $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\TrackExercise')->find($exeId);
 
         $totalScore = 0;
 
@@ -372,7 +372,7 @@ class JuryMemberController extends CrudController
 
                     $totalScore += $score;
 
-                    $obj = $this->getManager()->getRepository('ChamiloLMS\Entity\TrackExerciseAttemptJury')->findOneBy($criteria);
+                    $obj = $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\TrackExerciseAttemptJury')->findOneBy($criteria);
                     if ($obj) {
                         $obj->setQuestionScoreNameId($questionScoreNameId);
                         $obj->setScore($score);

+ 14 - 14
src/ChamiloLMS/Controller/Admin/JuryPresident/JuryPresidentController.php → src/ChamiloLMS/CoreBundle/Controller/Admin/JuryPresident/JuryPresidentController.php

@@ -1,15 +1,15 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\Admin\JuryPresident;
+namespace ChamiloLMS\CoreBundle\Controller\Admin\JuryPresident;
 
-use ChamiloLMS\Controller\CrudController;
-use ChamiloLMS\Form\JuryType;
-use ChamiloLMS\Form\JuryUserType;
-use ChamiloLMS\Entity\Jury;
-use ChamiloLMS\Entity\JuryMembers;
-use ChamiloLMS\Entity\TrackExerciseAttemptJury;
-use ChamiloLMS\Entity\TrackExercise;
+use ChamiloLMS\CoreBundle\Controller\CrudController;
+use ChamiloLMS\CoreBundle\Form\JuryType;
+use ChamiloLMS\CoreBundle\Form\JuryUserType;
+use ChamiloLMS\CoreBundle\Entity\Jury;
+use ChamiloLMS\CoreBundle\Entity\JuryMembers;
+use ChamiloLMS\CoreBundle\Entity\TrackExerciseAttemptJury;
+use ChamiloLMS\CoreBundle\Entity\TrackExercise;
 
 use Silex\Application;
 use Symfony\Component\Form\Extension\Validator\Constraints\FormValidator;
@@ -23,7 +23,7 @@ use Whoops\Example\Exception;
 /**
  * Class RoleController
  * @todo @route and @method function don't work yet
- * @package ChamiloLMS\Controller
+ * @package ChamiloLMS\CoreBundle\Controller
  * @author Julio Montoya <gugli100@gmail.com>
  */
 class JuryPresidentController extends CrudController
@@ -32,12 +32,12 @@ class JuryPresidentController extends CrudController
 
     public function getClass()
     {
-        return 'ChamiloLMS\Entity\BranchSync';
+        return 'ChamiloLMS\CoreBundle\Entity\BranchSync';
     }
 
     public function getType()
     {
-        return 'ChamiloLMS\Form\JuryType';
+        return 'ChamiloLMS\CoreBundle\Form\JuryType';
     }
 
     public function getControllerAlias()
@@ -138,7 +138,7 @@ class JuryPresidentController extends CrudController
     */
     public function assignUserToJuryMemberAction($userId, $juryMemberId)
     {
-        return $this->getManager()->getRepository('ChamiloLMS\Entity\JuryMembers')->assignUserToJuryMember($userId, $juryMemberId);
+        return $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\JuryMembers')->assignUserToJuryMember($userId, $juryMemberId);
     }
 
     /**
@@ -147,7 +147,7 @@ class JuryPresidentController extends CrudController
     */
     public function removeUserToJuryMemberAction($userId, $juryMemberId)
     {
-        return $this->getManager()->getRepository('ChamiloLMS\Entity\JuryMembers')->removeUserToJuryMember($userId, $juryMemberId);
+        return $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\JuryMembers')->removeUserToJuryMember($userId, $juryMemberId);
     }
 
     /**
@@ -205,7 +205,7 @@ class JuryPresidentController extends CrudController
                 $randomMembers = array_rand($members, $maxCount);
                 foreach ($randomMembers as $randomMember) {
                     $member = $members[$randomMember];
-                    $this->getManager()->getRepository('ChamiloLMS\Entity\JuryMembers')->assignUserToJuryMember($userId, $member->getId());
+                    $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\JuryMembers')->assignUserToJuryMember($userId, $member->getId());
                 }
             }
             $this->get('session')->getFlashBag()->add('success', "Los usuarios fueron asignados al azar");

+ 10 - 10
src/ChamiloLMS/Controller/Admin/QuestionManager/QuestionManagerController.php → src/ChamiloLMS/CoreBundle/Controller/Admin/QuestionManager/QuestionManagerController.php

@@ -1,9 +1,9 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\Admin\QuestionManager;
+namespace ChamiloLMS\CoreBundle\Controller\Admin\QuestionManager;
 
-use ChamiloLMS\Controller\BaseController;
+use ChamiloLMS\CoreBundle\Controller\BaseController;
 use Silex\Application;
 use Symfony\Component\HttpFoundation\Response;
 use Symfony\Component\Routing\Annotation\Route;
@@ -12,7 +12,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
 /**
  * Class QuestionManagerController
  * @todo reduce controller size
- * @package ChamiloLMS\Controller
+ * @package ChamiloLMS\CoreBundle\Controller
  * @author Julio Montoya <gugli100@gmail.com>
  */
 class QuestionManagerController extends BaseController
@@ -98,7 +98,7 @@ class QuestionManagerController extends BaseController
     public function getCategoriesAction($id)
     {
         // Getting CQuizCategory repo.
-        $repo = $this->getManager()->getRepository('ChamiloLMS\Entity\CQuizCategory');
+        $repo = $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\CQuizCategory');
 
         $options  = array(
             'decorate'      => true,
@@ -143,9 +143,9 @@ class QuestionManagerController extends BaseController
         // Getting CQuizCategory repo.
         /** @var \Doctrine\ORM\EntityManager $em */
         $em   = $this->getManager();
-        $repo = $em->getRepository('ChamiloLMS\Entity\CQuizCategory');
+        $repo = $em->getRepository('ChamiloLMS\CoreBundle\Entity\CQuizCategory');
 
-        /** @var \ChamiloLMS\Entity\CQuizCategory $category */
+        /** @var \ChamiloLMS\CoreBundle\Entity\CQuizCategory $category */
         $category = $repo->find($categoryId);
 
         $questionColumns = \Question::getQuestionColumns();
@@ -219,7 +219,7 @@ class QuestionManagerController extends BaseController
         // Getting CQuizCategory repo.
         /** @var \Gedmo\Tree\Entity\Repository\NestedTreeRepository $repo */
 
-        $repo = $this->getManager()->getRepository('ChamiloLMS\Entity\CQuizCategory');
+        $repo = $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\CQuizCategory');
         $categoryId = $this->getRequest()->get('categoryId');
         $subtree = null;
 
@@ -271,7 +271,7 @@ class QuestionManagerController extends BaseController
 
         $qb = $this->getManager()->createQueryBuilder()
             ->select('node')
-            ->from('ChamiloLMS\Entity\CQuizCategory', 'node')
+            ->from('ChamiloLMS\CoreBundle\Entity\CQuizCategory', 'node')
             ->where('node.cId <> 0 AND node.lvl = 0')
             ->orderBy('node.root, node.lft', 'ASC');
 
@@ -286,7 +286,7 @@ class QuestionManagerController extends BaseController
         $query = $this->getManager()
             ->createQueryBuilder()
             ->select('node')
-            ->from('ChamiloLMS\Entity\CQuizCategory', 'node')
+            ->from('ChamiloLMS\CoreBundle\Entity\CQuizCategory', 'node')
             ->where('node.cId = 0 AND node.lvl = 0')
             ->orderBy('node.root, node.lft', 'ASC')
             ->getQuery();
@@ -395,7 +395,7 @@ class QuestionManagerController extends BaseController
      */
     public function deleteCategoryAction($id)
     {
-        $repo = $this->getManager()->getRepository('ChamiloLMS\Entity\CQuizCategory');
+        $repo = $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\CQuizCategory');
         $category = $repo->find($id);
         if (empty($category)) {
             $this->abort(404);

+ 3 - 3
src/ChamiloLMS/Controller/App/Certificate/CertificateController.php → src/ChamiloLMS/CoreBundle/Controller/App/Certificate/CertificateController.php

@@ -1,15 +1,15 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\App\Certificate;
+namespace ChamiloLMS\CoreBundle\Controller\App\Certificate;
 
-use ChamiloLMS\Controller\BaseController;
+use ChamiloLMS\CoreBundle\Controller\BaseController;
 use Silex\Application;
 use Symfony\Component\HttpFoundation\Response;
 
 /**
  * Class CertificateController
- * @package ChamiloLMS\Controller
+ * @package ChamiloLMS\CoreBundle\Controller
  * @author Julio Montoya <gugli100@gmail.com>
  */
 class CertificateController extends BaseController

+ 6 - 6
src/ChamiloLMS/Controller/App/Editor/EditorController.php → src/ChamiloLMS/CoreBundle/Controller/App/Editor/EditorController.php

@@ -1,17 +1,17 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\App\Editor;
+namespace ChamiloLMS\CoreBundle\Controller\App\Editor;
 
-use ChamiloLMS\Controller\BaseController;
+use ChamiloLMS\CoreBundle\Controller\BaseController;
 use Silex\Application;
 use Symfony\Component\HttpFoundation\Response;
-use ChamiloLMS\Component\Editor\Connector;
-use ChamiloLMS\Component\Editor\Finder;
+use ChamiloLMS\CoreBundle\Component\Editor\Connector;
+use ChamiloLMS\CoreBundle\Component\Editor\Finder;
 
 use Symfony\Component\Routing\Annotation\Route;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
-use ChamiloLMS\Component\Editor\Driver\elFinderVolumePersonalDriver;
+use ChamiloLMS\CoreBundle\Component\Editor\Driver\elFinderVolumePersonalDriver;
 
 /**
  * @package ChamiloLMS.Controller
@@ -48,7 +48,7 @@ class EditorController extends BaseController
      */
     public function getTemplatesAction()
     {
-        $templates = $this->getManager()->getRepository('ChamiloLMS\Entity\SystemTemplate')->findAll();
+        $templates = $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\SystemTemplate')->findAll();
         $templates = $this->getHtmlEditor()->formatTemplates($templates);
         $this->getTemplate()->assign('templates', $templates);
         $response = $this->getTemplate()->renderTemplate('javascript/editor/ckeditor/templates.tpl');

+ 2 - 2
src/ChamiloLMS/Controller/App/ModelAjax/ModelAjaxController.php → src/ChamiloLMS/CoreBundle/Controller/App/ModelAjax/ModelAjaxController.php

@@ -1,14 +1,14 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\App\ModelAjax;
+namespace ChamiloLMS\CoreBundle\Controller\App\ModelAjax;
 
 use Silex\Application;
 use Symfony\Component\HttpFoundation\Response;
 
 /**
  * Class ModelAjaxController should replace the model.ajax.php file
- * @package ChamiloLMS\Controller
+ * @package ChamiloLMS\CoreBundle\Controller
  * @author Julio Montoya <gugli100@gmail.com>
  */
 class ModelAjaxController

+ 3 - 3
src/ChamiloLMS/Controller/App/News/NewsController.php → src/ChamiloLMS/CoreBundle/Controller/App/News/NewsController.php

@@ -1,9 +1,9 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\App\News;
+namespace ChamiloLMS\CoreBundle\Controller\App\News;
 
-use ChamiloLMS\Controller\BaseController;
+use ChamiloLMS\CoreBundle\Controller\BaseController;
 use Silex\Application;
 use Symfony\Component\HttpFoundation\Response;
 
@@ -12,7 +12,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
 
 /**
  * Class NewsController
- * @package ChamiloLMS\Controller\App\News
+ * @package ChamiloLMS\CoreBundle\Controller\App\News
  * @author Julio Montoya <gugli100@gmail.com>
  */
 class NewsController extends BaseController

+ 8 - 8
src/ChamiloLMS/Controller/App/SessionPath/SessionPathController.php → src/ChamiloLMS/CoreBundle/Controller/App/SessionPath/SessionPathController.php

@@ -1,17 +1,17 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\App\SessionPath;
+namespace ChamiloLMS\CoreBundle\Controller\App\SessionPath;
 
 use Silex\Application;
-use ChamiloLMS\Controller\CrudController;
+use ChamiloLMS\CoreBundle\Controller\CrudController;
 use Symfony\Component\HttpFoundation\Response;
 
 use Symfony\Component\Routing\Annotation\Route;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
 
-use ChamiloLMS\Entity\SessionPath;
-use ChamiloLMS\Form\SessionPathType;
+use ChamiloLMS\CoreBundle\Entity\SessionPath;
+use ChamiloLMS\CoreBundle\Form\SessionPathType;
 
 /**
  * @package ChamiloLMS.Controller
@@ -21,7 +21,7 @@ class SessionPathController extends CrudController
 {
     public function getClass()
     {
-        return 'ChamiloLMS\Entity\SessionPath';
+        return 'ChamiloLMS\CoreBundle\Entity\SessionPath';
     }
 
     public function getControllerAlias()
@@ -42,7 +42,7 @@ class SessionPathController extends CrudController
      */
     public function getType()
     {
-        return 'ChamiloLMS\Form\SessionPathType';
+        return 'ChamiloLMS\CoreBundle\Form\SessionPathType';
     }
 
     /**
@@ -71,12 +71,12 @@ class SessionPathController extends CrudController
         );
 
         // @todo put this in a function
-        $repo = $this->get('orm.em')->getRepository('ChamiloLMS\Entity\SessionTree');
+        $repo = $this->get('orm.em')->getRepository('ChamiloLMS\CoreBundle\Entity\SessionTree');
 
         $query = $this->getManager()
             ->createQueryBuilder()
             ->select('node')
-            ->from('ChamiloLMS\Entity\SessionTree', 'node')
+            ->from('ChamiloLMS\CoreBundle\Entity\SessionTree', 'node')
             //->where('node.cId = 0')
             ->orderBy('node.root, node.lft', 'ASC')
             ->getQuery();

+ 6 - 6
src/ChamiloLMS/Controller/App/SessionPath/SessionTreeController.php → src/ChamiloLMS/CoreBundle/Controller/App/SessionPath/SessionTreeController.php

@@ -1,17 +1,17 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\App\SessionPath;
+namespace ChamiloLMS\CoreBundle\Controller\App\SessionPath;
 
 use Silex\Application;
-use ChamiloLMS\Controller\BaseController;
+use ChamiloLMS\CoreBundle\Controller\BaseController;
 use Symfony\Component\HttpFoundation\Response;
 
 use Symfony\Component\Routing\Annotation\Route;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
 
-use ChamiloLMS\Entity\SessionPath;
-use ChamiloLMS\Form\SessionTreeType;
+use ChamiloLMS\CoreBundle\Entity\SessionPath;
+use ChamiloLMS\CoreBundle\Form\SessionTreeType;
 
 /**
  * @package ChamiloLMS.Controller
@@ -21,12 +21,12 @@ class SessionTreeController extends BaseController
 {
     public function getClass()
     {
-        return 'ChamiloLMS\Entity\SessionTree';
+        return 'ChamiloLMS\CoreBundle\Entity\SessionTree';
     }
 
     public function getType()
     {
-        return 'ChamiloLMS\Form\SessionTreeType';
+        return 'ChamiloLMS\CoreBundle\Form\SessionTreeType';
     }
 
     /**

+ 228 - 0
src/ChamiloLMS/CoreBundle/Controller/BaseController.php

@@ -0,0 +1,228 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+namespace ChamiloLMS\CoreBundle\Controller;
+
+use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpFoundation\JsonResponse;
+use Symfony\Component\HttpFoundation\Request;
+use Knp\Menu\Matcher\Matcher;
+use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
+use Symfony\Component\Routing\Annotation\Route;
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
+use Symfony\Component\DependencyInjection\Container;
+
+use Knp\Menu\FactoryInterface as MenuFactoryInterface;
+use Knp\Menu\ItemInterface as MenuItemInterface;
+use Knp\Menu\Renderer\ListRenderer;
+
+/**
+ * Each entity controller must extends this class.
+ *
+ * @abstract
+ */
+abstract class BaseController extends Controller
+{
+    /**
+     * @return object
+     */
+    public function getSecurity()
+    {
+        return $this->container->get('security.context');
+    }
+
+    public function getSessionHandler()
+    {
+        return $this->getRequest()->getSession();
+    }
+
+    /**
+     * @return object
+     */
+    public function getTemplate()
+    {
+        return $this->container->get('templating');
+    }
+
+    /**
+     * @return NotFoundHttpException
+     */
+    public function abort()
+    {
+        return new NotFoundHttpException();
+    }
+
+    /**
+     * Converts string 'ChamiloLMS\CoreBundle\Controller\Admin\QuestionManager' into
+     * 'admin/question_manager'
+     */
+    public function getTemplatePath()
+    {
+        $parts = $this->classParts;
+
+        $newPath = array();
+        foreach ($parts as $part) {
+            if (in_array($part, array('chamilo_lms', 'controller'))
+                //strpos($part, '_controller') > 0
+            ) {
+                continue;
+            }
+            $newPath[] = $part;
+        }
+
+        $template = implode('/', $newPath);
+        return str_replace('_controller', '', $template);
+    }
+
+    /**
+     * Transforms 'QuestionManagerController' to 'question_manager.controller'
+     * @return string
+     */
+    public function getControllerAlias()
+    {
+        $parts = $this->classParts;
+        $parts = array_reverse($parts);
+        $alias = str_replace('_controller', '.controller', $parts[0]);
+        return $alias;
+    }
+
+    /**
+     * Translator shortcut
+     * @param string $variable
+     * @return string
+     */
+    public function trans($variable)
+    {
+        return $this->container->get('translator')->trans($variable);
+    }
+
+    /**
+     * Returns the class name label
+     * @example RoleController -> Role
+     *
+     * @return string the class name label
+     */
+    public function getClassNameLabel()
+    {
+        return $this->classNameLabel;
+    }
+
+    /**
+     * @return MenuFactoryInterface
+     */
+    public function getMenuFactory()
+    {
+        return $this->container->get('knp_menu.factory');
+    }
+
+    /**
+     * @param string $action
+     * @return MenuItemInterface
+     */
+    protected function getBreadcrumbs($action)
+    {
+        $breadcrumbs = $this->buildBreadcrumbs($action);
+
+        return $breadcrumbs;
+    }
+
+    /** Main home URL
+     * @return MenuItemInterface
+     */
+    protected function getHomeBreadCrumb()
+    {
+        $menu = $this->getMenuFactory()->createItem(
+            'root',
+            array(
+                'childrenAttributes' => array(
+                    'class'        => 'breadcrumb',
+                    'currentClass' => 'active'
+                )
+            )
+        );
+
+        $menu->addChild(
+            $this->trans('Home'),
+            array('uri' => $this->generateUrl('home'))
+        );
+
+        return $menu;
+    }
+
+    /**
+     * @param $action
+     * @param MenuItemInterface $menu
+     * @return MenuItemInterface
+     */
+    public function buildBreadcrumbs($action, MenuItemInterface $menu = null)
+    {
+        if (!$menu) {
+            $menu = $this->getHomeBreadCrumb();
+        }
+
+        $menu->addChild(
+            $this->trans($this->getClassnameLabel().'List'),
+            array('uri' => $this->generateControllerUrl('listingAction'))
+        );
+
+        $action = str_replace(
+            array($this->getControllerAlias().':', 'Action'),
+            '',
+            $action
+        );
+
+        switch ($action) {
+            case 'add':
+            case 'edit':
+                $menu->addChild(
+                    $this->trans($this->getClassnameLabel().ucfirst($action))
+                    //array('uri' => $this->generateControllerUrl($action.'Action'))
+                );
+                break;
+        }
+
+        return $menu;
+    }
+
+    /**
+     * @param array $breadCrumbList
+     * @return string
+     */
+    protected function parseLegacyBreadCrumb($breadCrumbList = array())
+    {
+        $menu = $this->getHomeBreadCrumb();
+        foreach ($breadCrumbList as $item) {
+            $menu->addChild(
+                $this->trans($item['title']),
+                array('uri' => $item['url'])
+            );
+        }
+
+        $renderer = new ListRenderer(new \Knp\Menu\Matcher\Matcher());
+        $result = $renderer->render($menu);
+
+        return $result;
+    }
+
+    /**
+     * Renders the current controller template
+     * @param string $name
+     * @param array $elements
+     * @return mixed
+     */
+    public function renderTemplate($name, $elements = array())
+    {
+        $name = $this->getTemplatePath().'/'.$name;
+
+        $renderer = new ListRenderer(new \Knp\Menu\Matcher\Matcher());
+        $action = $this->getRequest()->get('_route');
+        $result = $renderer->render($this->getBreadcrumbs($action));
+        $elements['new_breadcrumb'] = $result;
+
+        return $this->getTemplate()->renderTemplate($name, $elements);
+    }
+
+
+}

+ 36 - 2
src/ChamiloLMS/Controller/CrudController.php → src/ChamiloLMS/CoreBundle/Controller/CrudController.php

@@ -1,7 +1,7 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller;
+namespace ChamiloLMS\CoreBundle\Controller;
 
 use Doctrine\ORM\Query;
 use Doctrine\ORM\NoResultException;
@@ -17,7 +17,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
 
 /**
  * Class CrudController
- * @package ChamiloLMS\Controller
+ * @package ChamiloLMS\CoreBundle\Controller
  */
 abstract class CrudController extends BaseController implements CrudControllerInterface
 {
@@ -244,6 +244,39 @@ abstract class CrudController extends BaseController implements CrudControllerIn
         }
     }
 
+    /**
+    * @Route("/export/{format}")
+    * @Method({"GET"})
+    */
+    public function exportAction($format = 'csv')
+    {
+        $qb = $this->getRepository()->createQueryBuilder('e');
+        $query = $qb->getQuery();
+
+        $source = new \Exporter\Source\DoctrineORMQuerySourceIterator($query, array('id'));
+
+        // Prepare the writer
+        $writer = new \Exporter\Writer\CsvWriter('data2.csv');
+
+        $filename = sprintf('export_%s_%s.%s',
+            strtolower(substr($this->getClassNameLabel(), strripos($this->getClassNameLabel(), '\\') + 1)),
+            date('Y_m_d_H_i_s', strtotime('now')),
+            $format
+        );
+
+
+        return $this->get('exporter')->getResponse(
+            $format,
+            $filename,
+            $this->getDataSourceIterator()
+        );
+    }
+
+    public function getDataSourceIterator()
+    {
+
+    }
+
     /**
      * Base "read" action.
      *
@@ -288,6 +321,7 @@ abstract class CrudController extends BaseController implements CrudControllerIn
         return $this->getList($format);
     }
 
+
     /**
      * @param string $format
      * @return JsonResponse

+ 4 - 4
src/ChamiloLMS/Controller/CrudControllerInterface.php → src/ChamiloLMS/CoreBundle/Controller/CrudControllerInterface.php

@@ -1,22 +1,22 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller;
+namespace ChamiloLMS\CoreBundle\Controller;
 
 /**
  * Interface CrudControllerInterface
- * @package ChamiloLMS\Controller
+ * @package ChamiloLMS\CoreBundle\Controller
  */
 interface CrudControllerInterface
 {
     /**
-     * Returns the entity class example: 'ChamiloLMS\Entity\Role'
+     * Returns the entity class example: 'ChamiloLMS\CoreBundle\Entity\Role'
      * @return string
      */
     public function getClass();
 
     /**
-     * Returns the form type name example: 'ChamiloLMS\Form\RoleType'
+     * Returns the form type name example: 'ChamiloLMS\CoreBundle\Form\RoleType'
      * @return string
      */
     public function getType();

+ 34 - 34
src/ChamiloLMS/Controller/IndexController.php → src/ChamiloLMS/CoreBundle/Controller/IndexController.php

@@ -1,31 +1,40 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller;
+namespace ChamiloLMS\CoreBundle\Controller;
 
-use Silex\Application;
+use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+use ChamiloLMS\CoreBundle\Controller\BaseController;
 use Symfony\Component\HttpFoundation\Response;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpKernel\HttpKernelInterface;
 use Symfony\Component\Finder\Finder;
-use Symfony\Component\Routing\Annotation\Route;
+
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
 
 /**
- * @package ChamiloLMS.Controller
- * @author Julio Montoya <gugli100@gmail.com>
+ * Class IndexController
+ * author Julio Montoya <gugli100@gmail.com>
+ * @package ChamiloLMS\CoreBundle\Controller
  */
 class IndexController extends BaseController
 {
     /**
-     * @Route("/index")
+     * @Route("/index", name="index")
+     * @Route("/")
      * @Method({"GET"})
      * @return Response
      */
     public function indexAction()
     {
-        $template = $this->getTemplate();
+        return $this->render(
+            'ChamiloLMSCoreBundle:Index:index.html.twig',
+            array('content' => 'julio')
+        );
 
+        //$template = $this->get('templating');
         // $countries = Intl::getRegionBundle()->getCountryNames('es');
         //var_dump($countries);
 
@@ -35,28 +44,21 @@ class IndexController extends BaseController
         echo $formatter->format(time());*/
 
         $extra = array();
-        if ($this->getSetting('use_virtual_keyboard') == 'true') {
+      /*  if ($this->getSetting('use_virtual_keyboard') == 'true') {
             $extra[] = api_get_css(api_get_path(WEB_LIBRARY_JS_PATH).'keyboard/keyboard.css');
             $extra[] = api_get_js('keyboard/jquery.keyboard.js');
-        }
+        }*/
 
-        $template->addResource(api_get_jqgrid_js(), 'string');
+        //$template->addResource(api_get_jqgrid_js(), 'string');
 
-        $this->app['this_section'] = SECTION_CAMPUS;
+        //$this->app['this_section'] = SECTION_CAMPUS;
 
         /** @var \PageController $pageController */
-        $pageController = $this->get('page_controller');
+        //$pageController = $this->get('page_controller');
 
         if (api_get_setting('display_categories_on_homepage') == 'true') {
-            $template->assign('course_category_block', $pageController->return_courses_in_categories());
+            //$template->assign('course_category_block', $pageController->return_courses_in_categories());
         }
-
-        // @todo Custom Facebook connection lib could be replaced with opauth
-        // Facebook connection, if activated
-        if (api_is_facebook_auth_activated() && !api_get_user_id()) {
-            facebook_connect();
-        }
-
         $this->setLoginForm();
 
         if (!api_is_anonymous()) {
@@ -402,7 +404,7 @@ class IndexController extends BaseController
     }
 
     /**
-     * @Route("/userportal")
+     * @Route("/userportal", name="userportal")
      * @Method({"GET"})
      *
      * @param string $type courses|sessions|mycoursecategories
@@ -412,21 +414,18 @@ class IndexController extends BaseController
      */
     public function userPortalAction($type = 'courses', $filter = 'current', $page = 1)
     {
-        // @todo Use filters like "after/before|finish" to manage user access
         api_block_anonymous_users();
 
-
         // Abort request because the user is not allowed here - @todo use filters
-        if ($this->app['allowed'] == false) {
+        /*if ($this->app['allowed'] == false) {
             return $this->abort(403, 'Not allowed');
-        }
+        }*/
 
         // Main courses and session list
         $items = null;
         $type = str_replace('/', '', $type);
 
-        /** @var \PageController $pageController */
-        $pageController = $this->get('page_controller');
+        $pageController = new \ChamiloLMS\CoreBundle\Framework\PageController();
 
         switch ($type) {
             case 'sessions':
@@ -459,26 +458,27 @@ class IndexController extends BaseController
             return $menu;
         };
         $app['knp_menu.menus'] = array('main' => 'my_main_menu');*/
-        $template->assign('content', $items);
-        $pageController->setCourseSessionMenu();
 
+        /*$pageController->setCourseSessionMenu();
         $pageController->setProfileBlock();
         $pageController->setUserImageBlock();
         $pageController->setCourseBlock($filter);
         $pageController->setSessionBlock();
         $pageController->return_reservation_block();
-        $pageController->returnNavigationLinks($template->getNavigationLinks());
+        $pageController->returnNavigationLinks($template->getNavigationLinks());*/
 
-        $template->assign('search_block', $pageController->return_search_block());
-        $template->assign('classes_block', $pageController->return_classes_block());
+        //$template->assign('search_block', $pageController->return_search_block());
+        //$template->assign('classes_block', $pageController->return_classes_block());
         $pageController->returnSkillsLinks();
 
         // Deleting the session_id.
         $this->getSessionHandler()->remove('session_id');
 
-        $response = $template->renderTemplate('userportal/index.tpl');
 
-        return new Response($response, 200, array());
+        return $this->render(
+            'ChamiloLMSCoreBundle:Index:userportal.html.twig',
+            array('content' => $items)
+        );
     }
 
     /**

+ 116 - 0
src/ChamiloLMS/CoreBundle/Controller/LegacyController.php

@@ -0,0 +1,116 @@
+<?php
+/* For licensing terms, see /license.txt */
+
+namespace ChamiloLMS\CoreBundle\Controller;
+
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
+use \ChamiloSession as Session;
+use Display;
+
+/**
+ * Class LegacyController
+ * Manages the chamilo pages starting with Display::display_header and $tpl = new Template();
+ * @package ChamiloLMS\CoreBundle\Controller
+ * @author Julio Montoya <gugli100@gmail.com>
+ */
+class LegacyController extends BaseController
+{
+    public $section;
+
+    /**
+     * @param $name
+     * @return Response
+     */
+    public function classicAction($name)
+    {
+        $responseHeaders = array();
+        $request = $this->getRequest();
+
+        // get.
+        $_GET = $request->query->all();
+        // post.
+        $_POST = $request->request->all();
+        // echo $request->getMethod();
+
+        $rootDir = $this->get('kernel')->getRealRootDir();
+
+        //$_REQUEST = $request->request->all();
+        $mainPath = $rootDir.'main/';
+        $fileToLoad = $mainPath.$name;
+
+        // Legacy inclusions
+        Session::setSession($this->getRequest()->getSession());
+        $dbConnection = $this->container->get('database_connection');
+        $database  = new \Database($dbConnection, array());
+        Session::$urlGenerator = $this->container->get('router');
+        Session::$security = $this->container->get('security.context');
+        Session::$translator = $this->container->get('translator');
+        Session::$rootDir = $this->container->get('kernel')->getRealRootDir();
+        Session::$logDir = $this->container->get('kernel')->getLogDir();
+        Session::$dataDir = $this->container->get('kernel')->getDataDir();
+        Session::$tempDir = $this->container->get('kernel')->getCacheDir();
+        Session::$courseDir = $this->container->get('kernel')->getDataDir();
+        Session::$configDir = $this->container->get('kernel')->getConfigDir();
+
+        if (is_file($fileToLoad) &&
+            \Security::check_abs_path($fileToLoad, $mainPath)
+        ) {
+
+            $toolNameFromFile = basename(dirname($fileToLoad));
+
+            // Default values
+            /*$_course = api_get_course_info();
+            $_user = api_get_user_info();
+            $charset = 'UTF-8';
+            $text_dir = api_get_text_direction();
+            $is_platformAdmin = api_is_platform_admin();
+            $_cid = api_get_course_id();*/
+            $debug = $this->container->get('kernel')->getEnvironment() == 'dev' ? true : false;
+
+            // Loading file
+            ob_start();
+            require_once $fileToLoad;
+            $out = ob_get_contents();
+            ob_end_clean();
+
+            // No browser cache when executing an exercise.
+            if ($name == 'exercice/exercise_submit.php') {
+                $responseHeaders = array(
+                    'cache-control' => 'no-store, no-cache, must-revalidate'
+                );
+            }
+
+            // Setting page header/footer conditions (important for LPs)
+            //$this->getTemplate()->setFooter($app['template.show_footer']);
+            //$this->getTemplate()->setHeader($app['template.show_header']);
+
+            if (isset($htmlHeadXtra)) {
+                //$this->getTemplate()->addResource($htmlHeadXtra, 'string');
+            }
+            // $interbreadcrumb is loaded in the require_once file.
+            $interbreadcrumb = isset($interbreadcrumb) ? $interbreadcrumb : null;
+            //$this->getTemplate()->setBreadcrumb($interbreadcrumb);
+            //$breadCrumb = $this->getTemplate()->getBreadCrumbLegacyArray();
+            //$menu = $this->parseLegacyBreadCrumb($breadCrumb);
+            //$this->getTemplate()->assign('new_breadcrumb', $menu);
+            //$this->getTemplate()->parseResources();
+
+            /*if (isset($tpl)) {
+                $response = $app['twig']->render($app['default_layout']);
+            } else {
+                $this->getTemplate()->assign('content', $out);
+                $response = $app['twig']->render($app['default_layout']);
+            }*/
+
+            return $this->render(
+                'ChamiloLMSCoreBundle:Legacy:index.html.twig',
+                array('content' => $out)
+            );
+        } else {
+            throw new NotFoundHttpException();
+        }
+    }
+}

+ 35 - 26
src/ChamiloLMS/Controller/Tool/CourseHome/CourseHomeController.php → src/ChamiloLMS/CoreBundle/Controller/Tool/CourseHome/CourseHomeController.php

@@ -1,29 +1,29 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\Tool\CourseHome;
+namespace ChamiloLMS\CoreBundle\Controller\Tool\CourseHome;
 
-use ChamiloLMS\Controller\ToolBaseController;
-use Silex\Application;
+use ChamiloLMS\CoreBundle\Controller\ToolBaseController;
 use Symfony\Component\HttpFoundation\Response;
-use ChamiloLMS\Controller\CrudController;
+use ChamiloLMS\CoreBundle\Controller\CrudController;
 use Symfony\Component\Routing\Annotation\Route;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
-use ChamiloLMS\Entity\CTool;
-use ChamiloLMS\Form\CourseHomeToolType;
+use ChamiloLMS\CoreBundle\Entity\CTool;
+use ChamiloLMS\CoreBundle\Form\CourseHomeToolType;
 use Doctrine\Common\Collections\Criteria;
 use Display;
 
 /**
  * Class CourseHomeController
- * @package ChamiloLMS\Controller\Tool\CourseHome
+ * @package ChamiloLMS\CoreBundle\Controller\Tool\CourseHome
  * @author Julio Montoya <gugli100@gmail.com>
+ * @Route("/course_home")
  */
 class CourseHomeController extends ToolBaseController
 {
     public function getClass()
     {
-        return 'ChamiloLMS\Entity\CTool';
+        return 'ChamiloLMS\CoreBundle\Entity\CTool';
     }
 
     /**
@@ -31,7 +31,7 @@ class CourseHomeController extends ToolBaseController
      */
     public function getType()
     {
-        return 'ChamiloLMS\Form\CourseHomeToolType';
+        return 'ChamiloLMS\CoreBundle\Form\CourseHomeToolType';
     }
 
     /**
@@ -60,15 +60,18 @@ class CourseHomeController extends ToolBaseController
         if ($showAutoLaunchExerciseWarning) {
             $this->addMessage('TheExerciseAutoLaunchSettingIsONStudentsWillBeRedirectToAnSpecificExercise', 'warning');
         }
-
-        if ($this->isCourseTeacher()) {
+        if (true) {
+        //if ($this->isCourseTeacher()) {
 
             $editIcons = Display::url(
                 Display::return_icon('edit.png'),
-                $this->generateControllerUrl('iconListAction', array('courseCode' => api_get_course_id()))
+                $this->generateUrl(
+                    'chamilolms_core_tool_coursehome_coursehome_iconlist',
+                    array('courseCode' => api_get_course_id())
+                )
             );
 
-            $this->getTemplate()->assign('edit_icons', $editIcons);
+            //$this->getTemplate()->addg('edit_icons', $editIcons);
         }
 
         if (!isset($coursesAlreadyVisited[$courseCode])) {
@@ -102,22 +105,28 @@ class CourseHomeController extends ToolBaseController
 
         $result = require_once api_get_path(SYS_CODE_PATH).'course_home/'.$script;
         $toolList = $result['tool_list'];
-        $this->getTemplate()->assign('icons', $result['content']);
 
         $introduction = Display::return_introduction_section(
-            $this->get('url_generator'),
+            $this->get('router'),
             TOOL_COURSE_HOMEPAGE,
             $toolList
         );
-
-        $this->getTemplate()->assign('introduction_text', $introduction);
-
+        $sessionInfo = null;
         if (api_get_setting('show_session_data') == 'true' && $sessionId) {
             $sessionInfo = \CourseHome::show_session_data($sessionId);
-            $this->getTemplate()->assign('session_info', $sessionInfo);
         }
 
-        $response = $this->renderTemplate('index.tpl');
+        $response = $this->render(
+            'ChamiloLMSCoreBundle:Tool:CourseHome/index.html.twig',
+            array(
+                'session_info' => $sessionInfo,
+                'icons' => $result['content'],
+                'edit_icons' => $editIcons,
+                'introduction_text' => $introduction,
+                'exercise_warning' => null,
+                'lp_warning' => null
+            )
+        );
 
         return new Response($response, 200, array());
     }
@@ -297,7 +306,7 @@ class CourseHomeController extends ToolBaseController
         }
         $entityManager = $this->getManager();
         $criteria = array('cId' => api_get_course_int_id(), 'id' => $iconId);
-        $tool = $this->getRepository('ChamiloLMS\Entity\CTool')->findOneBy($criteria);
+        $tool = $this->getRepository('ChamiloLMS\CoreBundle\Entity\CTool')->findOneBy($criteria);
         if ($tool) {
             $tool->setVisibility(1);
         }
@@ -320,7 +329,7 @@ class CourseHomeController extends ToolBaseController
 
         $entityManager = $this->getManager();
         $criteria = array('cId' => api_get_course_int_id(), 'id' => $iconId);
-        $tool = $this->getRepository('ChamiloLMS\Entity\CTool')->findOneBy($criteria);
+        $tool = $this->getRepository('ChamiloLMS\CoreBundle\Entity\CTool')->findOneBy($criteria);
         if ($tool) {
             $tool->setVisibility(0);
         }
@@ -343,7 +352,7 @@ class CourseHomeController extends ToolBaseController
 
         $entityManager = $this->getManager();
         $criteria = array('cId' => api_get_course_int_id(), 'id' => $iconId, 'added_tool' => 1);
-        $tool = $this->getRepository('ChamiloLMS\Entity\CTool')->findOneBy($criteria);
+        $tool = $this->getRepository('ChamiloLMS\CoreBundle\Entity\CTool')->findOneBy($criteria);
         $entityManager->remove($tool);
         //$entityManager->flush();
         return Display::return_message(get_lang('Deleted'), 'confirmation');
@@ -364,7 +373,7 @@ class CourseHomeController extends ToolBaseController
 
             $query = $this->getManager()->createQueryBuilder('a');
             $query->select('s');
-            $query->from('ChamiloLMS\Entity\CTool', 's');
+            $query->from('ChamiloLMS\CoreBundle\Entity\CTool', 's');
             $query->where('s.cId  = :courseId AND s.sessionId = :sessionId')
                 ->setParameters(
                     array(
@@ -382,7 +391,7 @@ class CourseHomeController extends ToolBaseController
             //$itemsFromSession = $this->getRepository()->findBy($criteria);
             $query = $this->getManager()->createQueryBuilder('a');
             $query->select('s');
-            $query->from('ChamiloLMS\Entity\CTool', 's');
+            $query->from('ChamiloLMS\CoreBundle\Entity\CTool', 's');
             $query->where('s.cId  = :courseId AND s.sessionId = 0')
                 ->setParameters(
                     array(
@@ -442,7 +451,7 @@ class CourseHomeController extends ToolBaseController
 
             $query = $this->getManager()->createQueryBuilder('a');
             $query->select('MAX(s.id) as id');
-            $query->from('ChamiloLMS\Entity\CTool', 's');
+            $query->from('ChamiloLMS\CoreBundle\Entity\CTool', 's');
             $query->where('s.cId  = :courseId')->setParameter('courseId', $this->getCourse()->getId());
             $result = $query->getQuery()->getArrayResult();
             $maxId = $result[0]['id'] + 1;

+ 9 - 9
src/ChamiloLMS/Controller/Tool/Curriculum/CurriculumCategoryController.php → src/ChamiloLMS/CoreBundle/Controller/Tool/Curriculum/CurriculumCategoryController.php

@@ -1,27 +1,27 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\Tool\Curriculum;
+namespace ChamiloLMS\CoreBundle\Controller\Tool\Curriculum;
 
-use ChamiloLMS\Controller\CrudController;
+use ChamiloLMS\CoreBundle\Controller\CrudController;
 use Silex\Application;
 use Symfony\Component\Form\Extension\Validator\Constraints\FormValidator;
 use Symfony\Component\HttpFoundation\Response;
-use ChamiloLMS\Entity\CurriculumCategory;
-use ChamiloLMS\Form\CurriculumCategoryType;
+use ChamiloLMS\CoreBundle\Entity\CurriculumCategory;
+use ChamiloLMS\CoreBundle\Form\CurriculumCategoryType;
 use Symfony\Component\Routing\Annotation\Route;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
 
 /**
  * Class CurriculumController
- * @package ChamiloLMS\Controller
+ * @package ChamiloLMS\CoreBundle\Controller
  * @author Julio Montoya <gugli100@gmail.com>
  */
 class CurriculumCategoryController extends CrudController
 {
     public function getClass()
     {
-        return 'ChamiloLMS\Entity\CurriculumCategory';
+        return 'ChamiloLMS\CoreBundle\Entity\CurriculumCategory';
     }
 
     /**
@@ -37,7 +37,7 @@ class CurriculumCategoryController extends CrudController
      */
     public function getType()
     {
-        return 'ChamiloLMS\Form\CurriculumCategoryType';
+        return 'ChamiloLMS\CoreBundle\Form\CurriculumCategoryType';
     }
 
     public function getControllerAlias()
@@ -123,7 +123,7 @@ class CurriculumCategoryController extends CrudController
         $qb = $this->getManager()
             ->createQueryBuilder()
             ->select('node, i')
-            ->from('ChamiloLMS\Entity\CurriculumCategory', 'node')
+            ->from('ChamiloLMS\CoreBundle\Entity\CurriculumCategory', 'node')
             ->leftJoin('node.items', 'i')
             ->innerJoin('node.course', 'c')
             ->orderBy('node.root, node.lft', 'ASC');
@@ -362,7 +362,7 @@ class CurriculumCategoryController extends CrudController
         $qb = $this->getManager()
             ->createQueryBuilder()
             ->select('node.id, u.userId, SUM(i.score) as score')
-            ->from('ChamiloLMS\Entity\CurriculumCategory', 'node')
+            ->from('ChamiloLMS\CoreBundle\Entity\CurriculumCategory', 'node')
             ->innerJoin('node.course', 'c')
             ->innerJoin('node.items', 'i')
             ->innerJoin('i.userItems', 'u')

+ 4 - 4
src/ChamiloLMS/Controller/Tool/Curriculum/CurriculumController.php → src/ChamiloLMS/CoreBundle/Controller/Tool/Curriculum/CurriculumController.php

@@ -1,20 +1,20 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\Tool\Curriculum;
+namespace ChamiloLMS\CoreBundle\Controller\Tool\Curriculum;
 
-use ChamiloLMS\Controller\BaseController;
+use ChamiloLMS\CoreBundle\Controller\BaseController;
 use Silex\Application;
 use Symfony\Component\Form\Extension\Validator\Constraints\FormValidator;
 use Symfony\Component\HttpFoundation\Response;
 use Entity;
-use ChamiloLMS\Form\CurriculumItemType;
+use ChamiloLMS\CoreBundle\Form\CurriculumItemType;
 use Symfony\Component\Routing\Annotation\Route;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
 
 /**
  * Class CurriculumController
- * @package ChamiloLMS\Controller
+ * @package ChamiloLMS\CoreBundle\Controller
  * @author Julio Montoya <gugli100@gmail.com>
  */
 class CurriculumController extends BaseController

+ 9 - 9
src/ChamiloLMS/Controller/Tool/Curriculum/CurriculumItemController.php → src/ChamiloLMS/CoreBundle/Controller/Tool/Curriculum/CurriculumItemController.php

@@ -1,21 +1,21 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\Tool\Curriculum;
+namespace ChamiloLMS\CoreBundle\Controller\Tool\Curriculum;
 
-use ChamiloLMS\Controller\CrudController;
+use ChamiloLMS\CoreBundle\Controller\CrudController;
 use Silex\Application;
 use Symfony\Component\Form\Extension\Validator\Constraints\FormValidator;
 use Symfony\Component\HttpFoundation\Response;
-use ChamiloLMS\Entity\CurriculumItem;
-use ChamiloLMS\Entity\CurriculumCategory;
-use ChamiloLMS\Form\CurriculumItemType;
+use ChamiloLMS\CoreBundle\Entity\CurriculumItem;
+use ChamiloLMS\CoreBundle\Entity\CurriculumCategory;
+use ChamiloLMS\CoreBundle\Form\CurriculumItemType;
 use Symfony\Component\Routing\Annotation\Route;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
 
 /**
  * Class CurriculumItemController
- * @package ChamiloLMS\Controller
+ * @package ChamiloLMS\CoreBundle\Controller
  * @author Julio Montoya <gugli100@gmail.com>
  */
 class CurriculumItemController extends CrudController
@@ -38,7 +38,7 @@ class CurriculumItemController extends CrudController
      */
     public function getClass()
     {
-        return 'ChamiloLMS\Entity\CurriculumItem';
+        return 'ChamiloLMS\CoreBundle\Entity\CurriculumItem';
     }
 
     /**
@@ -46,7 +46,7 @@ class CurriculumItemController extends CrudController
      */
     public function getType()
     {
-        return 'ChamiloLMS\Form\CurriculumItemType';
+        return 'ChamiloLMS\CoreBundle\Form\CurriculumItemType';
     }
 
     /**
@@ -120,7 +120,7 @@ class CurriculumItemController extends CrudController
 
         $entity = new CurriculumItem();
 
-        $category = $this->get('orm.em')->getRepository('ChamiloLMS\Entity\CurriculumCategory')->find($id);
+        $category = $this->get('orm.em')->getRepository('ChamiloLMS\CoreBundle\Entity\CurriculumCategory')->find($id);
         $entity->setCategory($category);
 
         $form = $this->get('form.factory')->create($formType, $entity);

+ 19 - 19
src/ChamiloLMS/Controller/Tool/Curriculum/CurriculumUserController.php → src/ChamiloLMS/CoreBundle/Controller/Tool/Curriculum/CurriculumUserController.php

@@ -1,16 +1,16 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\Tool\Curriculum;
+namespace ChamiloLMS\CoreBundle\Controller\Tool\Curriculum;
 
-use ChamiloLMS\Controller\CrudController;
+use ChamiloLMS\CoreBundle\Controller\CrudController;
 use Silex\Application;
 use Symfony\Component\Form\Extension\Validator\Constraints\FormValidator;
 use Symfony\Component\HttpFoundation\Response;
-use ChamiloLMS\Entity\CurriculumItemRelUser;
-use ChamiloLMS\Entity\CurriculumItem;
-use ChamiloLMS\Entity\Repository\CurriculumItemRelUserRepository;
-use ChamiloLMS\Form\CurriculumItemRelUserCollectionType;
+use ChamiloLMS\CoreBundle\Entity\CurriculumItemRelUser;
+use ChamiloLMS\CoreBundle\Entity\CurriculumItem;
+use ChamiloLMS\CoreBundle\Entity\Repository\CurriculumItemRelUserRepository;
+use ChamiloLMS\CoreBundle\Form\CurriculumItemRelUserCollectionType;
 use Symfony\Component\OptionsResolver\OptionsResolverInterface;
 use Symfony\Component\Routing\Annotation\Route;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
@@ -18,7 +18,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
 /**
  * Class CurriculumUserController
  * @todo @route and @method function don't work yet
- * @package ChamiloLMS\Controller
+ * @package ChamiloLMS\CoreBundle\Controller
  * @author Julio Montoya <gugli100@gmail.com>
  */
 class CurriculumUserController extends CrudController
@@ -42,7 +42,7 @@ class CurriculumUserController extends CrudController
      */
     public function getClass()
     {
-        return 'ChamiloLMS\Entity\CurriculumItemRelUser';
+        return 'ChamiloLMS\CoreBundle\Entity\CurriculumItemRelUser';
     }
 
     /**
@@ -50,7 +50,7 @@ class CurriculumUserController extends CrudController
      */
     public function getType()
     {
-        return 'ChamiloLMS\Form\CurriculumItemRelUserCollectionType';
+        return 'ChamiloLMS\CoreBundle\Form\CurriculumItemRelUserCollectionType';
     }
 
     protected function generateDefaultCrudRoutes()
@@ -95,7 +95,7 @@ class CurriculumUserController extends CrudController
         $qb = $this->getManager()
             ->createQueryBuilder()
             ->select('node, i, u')
-            ->from('ChamiloLMS\Entity\CurriculumCategory', 'node')
+            ->from('ChamiloLMS\CoreBundle\Entity\CurriculumCategory', 'node')
             ->innerJoin('node.course', 'c')
             ->leftJoin('node.items', 'i')
             ->leftJoin('i.userItems', 'u', 'WITH', 'u.userId = :userId OR u.userId IS NULL')
@@ -109,10 +109,10 @@ class CurriculumUserController extends CrudController
         $categories = $query->getResult();
 
         $formList = array();
-        /** @var \ChamiloLMS\Entity\CurriculumCategory $category */
+        /** @var \ChamiloLMS\CoreBundle\Entity\CurriculumCategory $category */
         foreach ($categories as $category) {
 
-            /** @var \ChamiloLMS\Entity\CurriculumItem $item */
+            /** @var \ChamiloLMS\CoreBundle\Entity\CurriculumItem $item */
             foreach ($category->getItems() as $item) {
 
                 $formType = new CurriculumItemRelUserCollectionType($item->getId());
@@ -181,7 +181,7 @@ class CurriculumUserController extends CrudController
                 $query = $this->getManager()
                     ->createQueryBuilder()
                     ->select('node, i, u')
-                    ->from('ChamiloLMS\Entity\CurriculumCategory', 'node')
+                    ->from('ChamiloLMS\CoreBundle\Entity\CurriculumCategory', 'node')
                     ->innerJoin('node.items', 'i')
                     ->innerJoin('i.userItems', 'u')
                     ->orderBy('node.root, node.lft', 'ASC')
@@ -192,7 +192,7 @@ class CurriculumUserController extends CrudController
 
                 $categories = $query->getResult();
 
-                /** @var \ChamiloLMS\Entity\CurriculumCategory $category */
+                /** @var \ChamiloLMS\CoreBundle\Entity\CurriculumCategory $category */
                 $alreadyAdded = array();
 
                 foreach ($categories as $category) {
@@ -208,7 +208,7 @@ class CurriculumUserController extends CrudController
                 }
 
                 // @todo check this
-                $user = $this->get('orm.em')->getRepository('ChamiloLMS\Entity\User')->find($user->getUserId());
+                $user = $this->get('orm.em')->getRepository('ChamiloLMS\CoreBundle\Entity\User')->find($user->getUserId());
 
                 $counter = 1;
                 $parsed = array();
@@ -315,7 +315,7 @@ class CurriculumUserController extends CrudController
         $qb = $this->getManager()
             ->createQueryBuilder()
             ->select('node, i, u')
-            ->from('ChamiloLMS\Entity\CurriculumCategory', 'node')
+            ->from('ChamiloLMS\CoreBundle\Entity\CurriculumCategory', 'node')
             ->innerJoin('node.course', 'c')
             ->leftJoin('node.items', 'i')
             ->leftJoin('i.userItems', 'u', 'WITH', 'u.userId = :userId OR u.userId IS NULL')
@@ -325,7 +325,7 @@ class CurriculumUserController extends CrudController
         $query = $qb->getQuery();
         $categories = $query->getResult();
         foreach ($categories as $category) {
-            /** @var \ChamiloLMS\Entity\CurriculumItem $item */
+            /** @var \ChamiloLMS\CoreBundle\Entity\CurriculumItem $item */
             $score = 0;
             foreach ($category->getItems() as $item) {
 
@@ -369,12 +369,12 @@ class CurriculumUserController extends CrudController
 
     private function getCurriculumCategoryRepository()
     {
-        return $this->get('orm.em')->getRepository('ChamiloLMS\Entity\CurriculumCategory');
+        return $this->get('orm.em')->getRepository('ChamiloLMS\CoreBundle\Entity\CurriculumCategory');
     }
 
     private function getCurriculumItemRepository()
     {
-        return $this->get('orm.em')->getRepository('ChamiloLMS\Entity\CurriculumItem');
+        return $this->get('orm.em')->getRepository('ChamiloLMS\CoreBundle\Entity\CurriculumItem');
     }
 
 }

+ 2 - 2
src/ChamiloLMS/Controller/Tool/Exercise/ExerciseController.php → src/ChamiloLMS/CoreBundle/Controller/Tool/Exercise/ExerciseController.php

@@ -1,9 +1,9 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\Tool\Exercise;
+namespace ChamiloLMS\CoreBundle\Controller\Tool\Exercise;
 
-use ChamiloLMS\Controller\BaseController;
+use ChamiloLMS\CoreBundle\Controller\BaseController;
 use Silex\Application;
 use Symfony\Component\HttpFoundation\Response;
 use Symfony\Component\HttpFoundation\Request;

+ 10 - 8
src/ChamiloLMS/Controller/Tool/Introduction/IntroductionController.php → src/ChamiloLMS/CoreBundle/Controller/Tool/Introduction/IntroductionController.php

@@ -1,29 +1,30 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\Tool\Introduction;
+namespace ChamiloLMS\CoreBundle\Controller\Tool\Introduction;
 
-use ChamiloLMS\Entity\CToolIntro;
+use ChamiloLMS\CoreBundle\Entity\CToolIntro;
 use Symfony\Component\HttpFoundation\Response;
-use ChamiloLMS\Controller\CrudController;
+use ChamiloLMS\CoreBundle\Controller\CrudController;
 use Symfony\Component\Routing\Annotation\Route;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
 
 /**
  * Class IntroductionToolController
- * @package ChamiloLMS\Controller\Tool\Introduction
+ * @package ChamiloLMS\CoreBundle\Controller\Tool\Introduction
  * @author Julio Montoya <gugli100@gmail.com>
+ * @Route("/introduction")
  */
 class IntroductionController extends CrudController
 {
     public function getClass()
     {
-        return 'ChamiloLMS\Entity\CToolIntro';
+        return 'ChamiloLMS\CoreBundle\Entity\CToolIntro';
     }
 
     public function getType()
     {
-        return 'ChamiloLMS\Form\BranchType';
+        return 'ChamiloLMS\CoreBundle\Form\BranchType';
     }
 
     public function getControllerAlias()
@@ -57,7 +58,8 @@ class IntroductionController extends CrudController
         $TBL_INTRODUCTION = \Database::get_course_table(TABLE_TOOL_INTRO);
 
         $url = $this->generateUrl(
-            'introduction.controller:editAction',
+            //'introduction.controller:editAction',
+            'chamilolms_core_tool_introduction_introduction_edit',
             array('tool' => $tool, 'courseCode' => api_get_course_id())
         );
 
@@ -119,7 +121,7 @@ class IntroductionController extends CrudController
         }
 
         $url = $this->generateUrl(
-            'introduction.controller:editAction',
+            'chamilolms_core_tool_introduction_introduction_edit',
             array('tool' => $tool, 'courseCode' => api_get_course_id())
         );
 

+ 12 - 12
src/ChamiloLMS/Controller/Tool/LearningPath/LearningPathController.php → src/ChamiloLMS/CoreBundle/Controller/Tool/LearningPath/LearningPathController.php

@@ -1,15 +1,15 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\Tool\LearningPath;
+namespace ChamiloLMS\CoreBundle\Controller\Tool\LearningPath;
 
-use ChamiloLMS\Controller\BaseController;
+use ChamiloLMS\CoreBundle\Controller\BaseController;
 use Silex\Application;
 use Symfony\Component\HttpFoundation\Response;
 
 /**
  * Class LearningPathController
- * @package ChamiloLMS\Controller
+ * @package ChamiloLMS\CoreBundle\Controller
  * @author Julio Montoya <gugli100@gmail.com>
  */
 class LearningPathController extends BaseController
@@ -60,14 +60,14 @@ class LearningPathController extends BaseController
         $sessionId = api_get_session_id();
         $session = null;
         if (!empty($sessionId)) {
-            $session = $app['orm.em']->getRepository('ChamiloLMS\Entity\Session')->find($sessionId);
+            $session = $app['orm.em']->getRepository('ChamiloLMS\CoreBundle\Entity\Session')->find($sessionId);
         }
 
         // Find course.
-        $course = $app['orm.em']->getRepository('ChamiloLMS\Entity\Course')->find($courseId);
+        $course = $app['orm.em']->getRepository('ChamiloLMS\CoreBundle\Entity\Course')->find($courseId);
 
         // Getting subscribe users to the course.
-        $subscribedUsers = $app['orm.em']->getRepository('ChamiloLMS\Entity\Course')->getSubscribedStudents($course);
+        $subscribedUsers = $app['orm.em']->getRepository('ChamiloLMS\CoreBundle\Entity\Course')->getSubscribedStudents($course);
         $subscribedUsers = $subscribedUsers->getQuery();
         $subscribedUsers = $subscribedUsers->execute();
 
@@ -78,7 +78,7 @@ class LearningPathController extends BaseController
         }
 
         // Getting subscribed users to a LP.
-        $subscribedUsersInLp = $app['orm.em']->getRepository('ChamiloLMS\Entity\CItemProperty')->getUsersSubscribedToItem(
+        $subscribedUsersInLp = $app['orm.em']->getRepository('ChamiloLMS\CoreBundle\Entity\CItemProperty')->getUsersSubscribedToItem(
             'learnpath',
             $lpId,
             $course,
@@ -124,7 +124,7 @@ class LearningPathController extends BaseController
         }
 
         //Subscribed groups to a LP
-        $subscribedGroupsInLp = $app['orm.em']->getRepository('ChamiloLMS\Entity\CItemProperty')->getGroupsSubscribedToItem(
+        $subscribedGroupsInLp = $app['orm.em']->getRepository('ChamiloLMS\CoreBundle\Entity\CItemProperty')->getGroupsSubscribedToItem(
             'learnpath',
             $lpId,
             $course,
@@ -151,7 +151,7 @@ class LearningPathController extends BaseController
                 'expanded' => false,
                 //'class' => 'Entity\Course',
                 //'property' => 'complete_name',
-                //'query_builder' => function(ChamiloLMS\Entity\Repository\CourseRepository $repo) use ($course) {
+                //'query_builder' => function(ChamiloLMS\CoreBundle\Entity\Repository\CourseRepository $repo) use ($course) {
                     $repo =  $repo->getSubscribedStudents($course);
                     return $repo;
                 },
@@ -164,7 +164,7 @@ class LearningPathController extends BaseController
                 'required' => false,
                 //'class' => 'Entity\Course',
                 //'property' => 'complete_name',
-                //'query_builder' => function(ChamiloLMS\Entity\Repository\CourseRepository $repo) use ($course) {
+                //'query_builder' => function(ChamiloLMS\CoreBundle\Entity\Repository\CourseRepository $repo) use ($course) {
                   //  return $repo->getSubscribedStudents($course);
                 //},
                 'choices' => $selectedChoices
@@ -183,7 +183,7 @@ class LearningPathController extends BaseController
             $users = $request->get('users');
             $userForm = $request->get('user_form');
             if (!empty($userForm)) {
-                $app['orm.em']->getRepository('ChamiloLMS\Entity\CItemProperty')->subscribeUsersToItem(
+                $app['orm.em']->getRepository('ChamiloLMS\CoreBundle\Entity\CItemProperty')->subscribeUsersToItem(
                     'learnpath',
                     $course,
                     $session,
@@ -197,7 +197,7 @@ class LearningPathController extends BaseController
             $groupForm = $request->get('group_form');
 
             if (!empty($groupForm)) {
-                $app['orm.em']->getRepository('ChamiloLMS\Entity\CItemProperty')->subscribeGroupsToItem(
+                $app['orm.em']->getRepository('ChamiloLMS\CoreBundle\Entity\CItemProperty')->subscribeGroupsToItem(
                     'learnpath',
                     $course,
                     $session,

+ 3 - 3
src/ChamiloLMS/Controller/ToolBaseController.php → src/ChamiloLMS/CoreBundle/Controller/ToolBaseController.php

@@ -1,9 +1,9 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller;
+namespace ChamiloLMS\CoreBundle\Controller;
 
-use ChamiloLMS\Controller\BaseController;
+use ChamiloLMS\CoreBundle\Controller\BaseController;
 use Knp\Menu\FactoryInterface as MenuFactoryInterface;
 use Knp\Menu\ItemInterface as MenuItemInterface;
 use Knp\Menu\Renderer\ListRenderer;
@@ -60,7 +60,7 @@ abstract class ToolBaseController extends BaseController
     }
 
     /**
-     * Converts string 'ChamiloLMS\Controller\Tool\CourseHome\CourseHomeController' into
+     * Converts string 'ChamiloLMS\CoreBundle\Controller\Tool\CourseHome\CourseHomeController' into
      * 'tool/course_home'
      */
     public function getTemplatePath()

+ 3 - 3
src/ChamiloLMS/Controller/User/ProfileController.php → src/ChamiloLMS/CoreBundle/Controller/User/ProfileController.php

@@ -1,9 +1,9 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\User;
+namespace ChamiloLMS\CoreBundle\Controller\User;
 
-use ChamiloLMS\Controller\BaseController;
+use ChamiloLMS\CoreBundle\Controller\BaseController;
 use Silex\Application;
 use Symfony\Component\Routing\Annotation\Route;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
@@ -12,7 +12,7 @@ use Symfony\Component\HttpFoundation\Response;
 
 /**
  * Class ProfileController
- * @package ChamiloLMS\Controller
+ * @package ChamiloLMS\CoreBundle\Controller
  */
 class ProfileController extends BaseController
 {

+ 3 - 3
src/ChamiloLMS/Controller/User/UserController.php → src/ChamiloLMS/CoreBundle/Controller/User/UserController.php

@@ -1,19 +1,19 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-namespace ChamiloLMS\Controller\User;
+namespace ChamiloLMS\CoreBundle\Controller\User;
 
 use Silex\Application;
 
 use Symfony\Component\HttpFoundation\Response;
-use ChamiloLMS\Controller\BaseController;
+use ChamiloLMS\CoreBundle\Controller\BaseController;
 use Symfony\Component\Routing\Annotation\Route;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
 
 
 /**
  * Class UserController
- * @package ChamiloLMS\Controller
+ * @package ChamiloLMS\CoreBundle\Controller
  * @author Julio Montoya <gugli100@gmail.com>
  */
 class UserController extends BaseController

+ 1 - 1
src/ChamiloLMS/Entity/AccessUrl.php → src/ChamiloLMS/CoreBundle/Entity/AccessUrl.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace ChamiloLMS\Entity;
+namespace ChamiloLMS\CoreBundle\Entity;
 
 use Doctrine\ORM\Mapping as ORM;
 

+ 1 - 1
src/ChamiloLMS/Entity/AccessUrlRelCourse.php → src/ChamiloLMS/CoreBundle/Entity/AccessUrlRelCourse.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace ChamiloLMS\Entity;
+namespace ChamiloLMS\CoreBundle\Entity;
 
 use Doctrine\ORM\Mapping as ORM;
 

+ 1 - 1
src/ChamiloLMS/Entity/AccessUrlRelSession.php → src/ChamiloLMS/CoreBundle/Entity/AccessUrlRelSession.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace ChamiloLMS\Entity;
+namespace ChamiloLMS\CoreBundle\Entity;
 
 use Doctrine\ORM\Mapping as ORM;
 

+ 1 - 1
src/ChamiloLMS/Entity/AccessUrlRelUser.php → src/ChamiloLMS/CoreBundle/Entity/AccessUrlRelUser.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace ChamiloLMS\Entity;
+namespace ChamiloLMS\CoreBundle\Entity;
 
 use Doctrine\ORM\Mapping as ORM;
 

+ 2 - 2
src/ChamiloLMS/Entity/BranchSync.php → src/ChamiloLMS/CoreBundle/Entity/BranchSync.php

@@ -1,5 +1,5 @@
 <?php
-namespace ChamiloLMS\Entity;
+namespace ChamiloLMS\CoreBundle\Entity;
 
 use Doctrine\ORM\Mapping as ORM;
 use Gedmo\Mapping\Annotation as Gedmo;
@@ -8,7 +8,7 @@ use Gedmo\Mapping\Annotation as Gedmo;
  * BranchSync
  *
  * @ORM\Table(name="branch_sync")
- * @ORM\Entity(repositoryClass="ChamiloLMS\Entity\Repository\BranchSyncRepository")
+ * @ORM\Entity(repositoryClass="ChamiloLMS\CoreBundle\Entity\Repository\BranchSyncRepository")
  * @Gedmo\Tree(type="nested")
 
  */

+ 1 - 1
src/ChamiloLMS/Entity/CDropboxFile.php → src/ChamiloLMS/CoreBundle/Entity/CDropboxFile.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace ChamiloLMS\Entity;
+namespace ChamiloLMS\CoreBundle\Entity;
 
 use Doctrine\ORM\Mapping as ORM;
 

Some files were not shown because too many files changed in this diff