parent
3307f4737f
commit
05db83127c
@ -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).' |
||||
); |
||||
} |
||||
} |
||||
} |
||||
@ -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; |
||||
File diff suppressed because it is too large
Load Diff
@ -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"; |
||||
} |
||||
@ -0,0 +1,3 @@ |
||||
<?php |
||||
$_configuration = require_once __DIR__.'/../../config/configuration.php'; |
||||
$container->setParameter('configuration', $_configuration); |
||||
@ -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: / |
||||
@ -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 |
||||
@ -1,4 +0,0 @@ |
||||
<?php |
||||
$url = api_get_path(WEB_PUBLIC_PATH).'admin'; |
||||
header('Location: '.$url); |
||||
exit; |
||||
@ -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; |
||||
} |
||||
} |
||||
@ -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) |
||||
{ |
||||
|
||||
} |
||||
} |
||||
@ -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); |
||||
} |
||||
} |
||||
@ -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; |
||||
@ -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 |
||||
{ |
||||
@ -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 |
||||
{ |
||||
@ -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 |
||||
{ |
||||
@ -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 |
||||
{ |
||||
@ -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 |
||||
{ |
||||
@ -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 |
||||
{ |
||||
@ -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 |
||||
{ |
||||
@ -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 |
||||
{ |
||||
@ -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 |
||||
{ |
||||
@ -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 |
||||
{ |
||||
@ -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 |
||||
{ |
||||
@ -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 |
||||
{ |
||||
@ -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 |
||||
{ |
||||
@ -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 |
||||
{ |
||||
@ -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 |
||||
{ |
||||
@ -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 |
||||
{ |
||||
@ -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 |
||||
{ |
||||
@ -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 |
||||
{ |
||||
@ -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,7 +1,7 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
namespace ChamiloLMS\Component\Editor; |
||||
namespace ChamiloLMS\CoreBundle\Component\Editor; |
||||
|
||||
/** |
||||
* elFinder - file manager for web. |
||||
@ -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 |
||||
{ |
||||
@ -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 |
||||
{ |
||||
@ -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 |
||||
{ |
||||
@ -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,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; |
||||
@ -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'; |
||||
} |
||||
|
||||
/** |
||||
@ -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 |
||||
@ -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 |
||||
@ -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); |
||||
} |
||||
|
||||
|
||||
} |
||||
@ -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(); |
||||
@ -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(); |
||||
} |
||||
} |
||||
} |
||||
@ -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 |
||||
@ -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; |
||||
@ -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,6 +1,6 @@ |
||||
<?php |
||||
|
||||
namespace ChamiloLMS\Entity; |
||||
namespace ChamiloLMS\CoreBundle\Entity; |
||||
|
||||
use Doctrine\ORM\Mapping as ORM; |
||||
|
||||
@ -1,6 +1,6 @@ |
||||
<?php |
||||
|
||||
namespace ChamiloLMS\Entity; |
||||
namespace ChamiloLMS\CoreBundle\Entity; |
||||
|
||||
use Doctrine\ORM\Mapping as ORM; |
||||
|
||||
@ -1,6 +1,6 @@ |
||||
<?php |
||||
|
||||
namespace ChamiloLMS\Entity; |
||||
namespace ChamiloLMS\CoreBundle\Entity; |
||||
|
||||
use Doctrine\ORM\Mapping as ORM; |
||||
|
||||
@ -1,6 +1,6 @@ |
||||
<?php |
||||
|
||||
namespace ChamiloLMS\Entity; |
||||
namespace ChamiloLMS\CoreBundle\Entity; |
||||
|
||||
use Doctrine\ORM\Mapping as ORM; |
||||
|
||||
@ -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 have changed in this diff Show More
Loading…
Reference in new issue