Przeglądaj źródła

Updating vendors

Julio Montoya 12 lat temu
rodzic
commit
f319aaa06f
100 zmienionych plików z 12554 dodań i 15 usunięć
  1. 1 1
      vendor/autoload.php
  2. 15 0
      vendor/chamilo/chash/README.md
  3. BIN
      vendor/chamilo/chash/chash.phar
  4. 7 0
      vendor/chamilo/chash/chash.php
  5. 15 8
      vendor/chamilo/chash/composer.lock
  6. 92 0
      vendor/chamilo/chash/src/Chash/Command/Translation/AddSubLanguageCommand.php
  7. 70 0
      vendor/chamilo/chash/src/Chash/Command/Translation/DisableLanguageCommand.php
  8. 70 0
      vendor/chamilo/chash/src/Chash/Command/Translation/EnableLanguageCommand.php
  9. 79 0
      vendor/chamilo/chash/src/Chash/Command/Translation/ListLanguagesCommand.php
  10. 80 0
      vendor/chamilo/chash/src/Chash/Command/Translation/PlatformLanguageCommand.php
  11. 72 0
      vendor/chamilo/chash/src/Chash/Command/User/ChangePassCommand.php
  12. 82 0
      vendor/chamilo/chash/src/Chash/Command/User/SetLanguageCommand.php
  13. 5 5
      vendor/chamilo/chash/src/Chash/Helpers/ConfigurationHelper.php
  14. 1 1
      vendor/chamilo/chash/vendor/autoload.php
  15. 240 0
      vendor/chamilo/chash/vendor/composer/ClassLoader.php
  16. 9 0
      vendor/chamilo/chash/vendor/composer/autoload_classmap.php
  17. 12 0
      vendor/chamilo/chash/vendor/composer/autoload_namespaces.php
  18. 43 0
      vendor/chamilo/chash/vendor/composer/autoload_real.php
  19. 98 0
      vendor/chamilo/chash/vendor/composer/installed.json
  20. 1195 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Application.php
  21. 35 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/CHANGELOG.md
  22. 638 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Command/Command.php
  23. 85 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Command/HelpCommand.php
  24. 86 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Command/ListCommand.php
  25. 55 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/ConsoleEvents.php
  26. 25 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleCommandEvent.php
  27. 67 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleEvent.php
  28. 67 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleForExceptionEvent.php
  29. 58 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleTerminateEvent.php
  30. 248 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatter.php
  31. 83 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterInterface.php
  32. 222 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyle.php
  33. 72 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php
  34. 121 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php
  35. 444 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php
  36. 80 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Helper/FormatterHelper.php
  37. 62 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Helper/Helper.php
  38. 49 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Helper/HelperInterface.php
  39. 104 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Helper/HelperSet.php
  40. 443 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressHelper.php
  41. 453 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Helper/TableHelper.php
  42. 338 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php
  43. 209 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Input/ArrayInput.php
  44. 225 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Input/Input.php
  45. 132 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Input/InputArgument.php
  46. 535 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Input/InputDefinition.php
  47. 152 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Input/InputInterface.php
  48. 209 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Input/InputOption.php
  49. 85 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Input/StringInput.php
  50. 19 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/LICENSE
  51. 103 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutput.php
  52. 30 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutputInterface.php
  53. 34 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Output/NullOutput.php
  54. 180 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Output/Output.php
  55. 109 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Output/OutputInterface.php
  56. 113 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Output/StreamOutput.php
  57. 63 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/README.md
  58. BIN
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Resources/bin/hiddeninput.exe
  59. 211 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Shell.php
  60. 117 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tester/ApplicationTester.php
  61. 110 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tester/CommandTester.php
  62. 767 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/ApplicationTest.php
  63. 301 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Command/CommandTest.php
  64. 68 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Command/HelpCommandTest.php
  65. 50 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Command/ListCommandTest.php
  66. 26 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo1Command.php
  67. 21 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo2Command.php
  68. 25 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo3Command.php
  69. 11 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo4Command.php
  70. 33 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/FooCommand.php
  71. 28 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/TestCommand.php
  72. 20 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt
  73. 16 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt
  74. 128 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt
  75. 37 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt
  76. 13 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_gethelp.txt
  77. 8 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception1.txt
  78. 11 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception2.txt
  79. 19 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception3.txt
  80. 9 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception4.txt
  81. 17 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run1.txt
  82. 28 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run2.txt
  83. 27 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run3.txt
  84. 1 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run4.txt
  85. 18 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_astext.txt
  86. 38 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt
  87. 11 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/definition_astext.txt
  88. 39 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/definition_asxml.txt
  89. 70 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleStackTest.php
  90. 77 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleTest.php
  91. 231 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php
  92. 167 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php
  93. 84 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/FormatterHelperTest.php
  94. 173 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/ProgressHelperTest.php
  95. 188 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/TableHelperTest.php
  96. 285 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Input/ArgvInputTest.php
  97. 129 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Input/ArrayInputTest.php
  98. 111 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputArgumentTest.php
  99. 410 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php
  100. 202 0
      vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputOptionTest.php

+ 1 - 1
vendor/autoload.php

@@ -4,4 +4,4 @@
 
 require_once __DIR__ . '/composer' . '/autoload_real.php';
 
-return ComposerAutoloaderInit142b0d726e3437b29f0c0f0d7047c1f2::getLoader();
+return ComposerAutoloaderInita980ba107ef57b35bdb64ba89a32ee06::getLoader();

+ 15 - 0
vendor/chamilo/chash/README.md

@@ -42,6 +42,12 @@ Remember to add execution permissions to the phar file.
 
     cd /var/www/chamilo
     chash
+    
+If you're using php 5.3 with suhosin the phar will not be executed you can try this:
+
+    php -d suhosin.executor.include.whitelist="phar" chash.phar 
+
+or you can change this setting in your /etc/php5/cli/conf.d/suhosin.ini file (look for "executor"), although this might increase the vulnerability of your system.
 
 Available commands:
 ====================
@@ -58,10 +64,19 @@ Available commands:
     files
         files:clean_archives          Cleans the archives directory
         files:clean_config_files      Cleans the config files to help you re-install
+        files:show_mail_conf          Returns the current mail config
 
     translation
         translation:export_language   Exports a Chamilo language package
         translation:import_language   Import a Chamilo language package
+        translation:platform_language Gets or sets the platform language
+
+    user
+        user:change_pass              Updates the user password to the one given
+        user:disable_admins           Makes the given user admin on the main portal
+        user:make_admin               Makes the given user admin on the main portal
+        user:reset_login              Outputs login link for given username
+        user:set_language             Sets the users language to the one given
 
 Usage
 ====================

BIN
vendor/chamilo/chash/chash.phar


+ 7 - 0
vendor/chamilo/chash/chash.php

@@ -46,11 +46,18 @@ $application->addCommands(array(
     new Chash\Command\Files\CleanTempFolderCommand(),
     new Chash\Command\Files\CleanConfigFiles(),
     new Chash\Command\Files\MailConfCommand(),
+    new Chash\Command\Translation\AddSubLanguageCommand(),
+    new Chash\Command\Translation\DisableLanguageCommand(),
+    new Chash\Command\Translation\EnableLanguageCommand(),
     new Chash\Command\Translation\ExportLanguageCommand(),
     new Chash\Command\Translation\ImportLanguageCommand(),
+    new Chash\Command\Translation\ListLanguagesCommand(),
+    new Chash\Command\Translation\PlatformLanguageCommand(),
+    new Chash\Command\User\ChangePassCommand(),
     new Chash\Command\User\DisableAdminsCommand(),
     new Chash\Command\User\MakeAdminCommand(),
     new Chash\Command\User\ResetLoginCommand(),
+    new Chash\Command\User\SetLanguageCommand(),
 ));
 
 $application->run();

+ 15 - 8
vendor/chamilo/chash/composer.lock

@@ -1,4 +1,8 @@
 {
+    "_readme": [
+        "This file locks the dependencies of your project to a known state",
+        "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
+    ],
     "hash": "1bea5cc52d392819dc48a5b9caa6a96b",
     "packages": [
         {
@@ -8,17 +12,20 @@
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/Console.git",
-                "reference": "ce8d34ee8b1abc7c0f3d0923fdb32a85e7decb98"
+                "reference": "74049e36e2e73ca2ec069c9be86d01ba422d44ea"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/Console/zipball/ce8d34ee8b1abc7c0f3d0923fdb32a85e7decb98",
-                "reference": "ce8d34ee8b1abc7c0f3d0923fdb32a85e7decb98",
+                "url": "https://api.github.com/repos/symfony/Console/zipball/74049e36e2e73ca2ec069c9be86d01ba422d44ea",
+                "reference": "74049e36e2e73ca2ec069c9be86d01ba422d44ea",
                 "shasum": ""
             },
             "require": {
                 "php": ">=5.3.3"
             },
+            "require-dev": {
+                "symfony/event-dispatcher": ">=2.1,<3.0"
+            },
             "type": "library",
             "extra": {
                 "branch-alias": {
@@ -46,7 +53,7 @@
             ],
             "description": "Symfony Console Component",
             "homepage": "http://symfony.com",
-            "time": "2013-03-23 07:15:46"
+            "time": "2013-04-13 14:06:01"
         },
         {
             "name": "symfony/yaml",
@@ -55,12 +62,12 @@
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/Yaml.git",
-                "reference": "1238ede850fb8c6946a6c44963d38bbf9cad6dd1"
+                "reference": "4ef80f5c5081ad9a7e08184fc9f25c62d87e408c"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/Yaml/zipball/1238ede850fb8c6946a6c44963d38bbf9cad6dd1",
-                "reference": "1238ede850fb8c6946a6c44963d38bbf9cad6dd1",
+                "url": "https://api.github.com/repos/symfony/Yaml/zipball/4ef80f5c5081ad9a7e08184fc9f25c62d87e408c",
+                "reference": "4ef80f5c5081ad9a7e08184fc9f25c62d87e408c",
                 "shasum": ""
             },
             "require": {
@@ -88,7 +95,7 @@
             ],
             "description": "Symfony Yaml Component",
             "homepage": "http://symfony.com",
-            "time": "2013-03-23 01:54:33"
+            "time": "2013-04-12 10:27:36"
         }
     ],
     "packages-dev": [

+ 92 - 0
vendor/chamilo/chash/src/Chash/Command/Translation/AddSubLanguageCommand.php

@@ -0,0 +1,92 @@
+<?php
+/**
+ * Definition of command to
+ * add sub language
+ * Does not support multi-url yet
+ */
+/**
+ * Necessary namespaces definitions and usage
+ */
+namespace Chash\Command\Translation;
+
+use Chash\Command\Database\CommonChamiloDatabaseCommand;
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * Definition of the translation:add_sub_language command
+ */
+class AddSubLanguageCommand extends CommonChamiloDatabaseCommand
+{
+    protected function configure()
+    {
+        parent::configure();
+        $this
+            ->setName('translation:add_sub_language')
+            ->setAliases(array('tasl'))
+            ->setDescription('Creates a sub-language')
+            ->addArgument(
+                'parent',
+                InputArgument::REQUIRED,
+                'The parent language (English name) for the new sub-language.'
+            )
+            ->addArgument(
+                'sublanguage',
+                InputArgument::REQUIRED,
+                'The English name for the new sub-language.'
+            );
+    }
+
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+        parent::execute($input, $output);
+        $_configuration = $this->getHelper('configuration')->getConfiguration();
+        $dbh = $this->getHelper('configuration')->getConnection();
+        $parent = mysql_real_escape_string($input->getArgument('parent'));
+        $lang = mysql_real_escape_string($input->getArgument('sublanguage'));
+        $ls = "SELECT english_name FROM language WHERE english_name = '$lang'";
+        $lq = mysql_query($ls);
+        if ($lq === false) {
+            $output->writeln('Error in query: '.mysql_error());
+            return null;
+        }
+        $num = mysql_num_rows($lq);
+        if ($num>0) {
+            $output->writeln($lang.' already exists in the database. Pick another English name.');
+            return null;
+        }
+        $ls = "SELECT id, original_name, english_name, isocode, dokeos_folder FROM language WHERE english_name = '$parent'";
+        $lq = mysql_query($ls);
+        if ($lq === false) {
+            $output->writeln('Error in query: '.mysql_error());
+            return null;
+        }
+        $num = mysql_num_rows($lq);
+        if ($num<1) {
+            $output->writeln('The parent language '.$parent.' does not exist. Please choose a valid parent.');
+            return null;
+        }
+        if (is_dir($_configuration['root_sys'].'main/lang/'.$lang)) {
+            $output->writeln('The destination directory ('.$_configuration['root_sys'].'main/lang/'.$lang.') already exists. Please choose another sub-language name.');
+            return null;
+        }
+        // Everything is OK so far, insert the sub-language
+        $lr = mysql_fetch_assoc($lq);
+        $is = "INSERT INTO language (original_name, english_name, isocode, dokeos_folder, available, parent_id) VALUES ('{$lr['original_name']}-2','$lang','{$lr['isocode']}','$lang',0,{$lr['id']})";
+        $iq = mysql_query($is);
+        if ($iq === false) {
+            $output->writeln('Error in query: '.mysql_error());
+        } else {
+            //permissions gathering, copied from main_api.lib.php::api_get_permissions_for_new_directories()
+            //require_once $_configuration['root_sys'].'main/inc/lib/main_api.lib.php';
+            //$perm = api_get_permissions_for_new_directories();
+            // @todo Improve permissions to force creating as user www-data
+            $r = @mkdir($_configuration['root_sys'].'main/lang/'.$lang, 0777);
+            $output->writeln('Sub-language '.$lang.' of language '.$parent.' has been created but is disabled. Fill it, then enable to make available to users. Make sure you check the permissions for the newly created directory as well ('.$_configuration['root_sys'].'main/lang/'.$lang.')');
+        }
+        return null;
+    }
+}

+ 70 - 0
vendor/chamilo/chash/src/Chash/Command/Translation/DisableLanguageCommand.php

@@ -0,0 +1,70 @@
+<?php
+/**
+ * Definition of command to
+ * disable a language
+ * Does not support multi-url yet
+ */
+/**
+ * Necessary namespaces definitions and usage
+ */
+namespace Chash\Command\Translation;
+
+use Chash\Command\Database\CommonChamiloDatabaseCommand;
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * Definition of the translation:disable command
+ */
+class DisableLanguageCommand extends CommonChamiloDatabaseCommand
+{
+    protected function configure()
+    {
+        parent::configure();
+        $this
+            ->setName('translation:disable')
+            ->setAliases(array('tdl'))
+            ->setDescription('Disables a (enabled) language')
+            ->addArgument(
+                'language',
+                InputArgument::REQUIRED,
+                'The English name for the language to disable.'
+            );
+    }
+
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+        parent::execute($input, $output);
+        $_configuration = $this->getHelper('configuration')->getConfiguration();
+        $dbh = $this->getHelper('configuration')->getConnection();
+        $lang = mysql_real_escape_string($input->getArgument('language'));
+        $ls = "SELECT id, english_name, available FROM language WHERE english_name = '$lang'";
+        $lq = mysql_query($ls);
+        if ($lq === false) {
+            $output->writeln('Error in query: '.mysql_error());
+            return null;
+        }
+        $num = mysql_num_rows($lq);
+        if ($num<1) {
+            $output->writeln($lang.' language not found in the database. Please make sure you use an existing language name.');
+            return null;
+        }
+        $lr = mysql_fetch_assoc($lq);
+        if ($lr['available'] == 0) {
+            $output->writeln($lang.' language is already disabled. Nothing to do.');
+            return null;
+        }
+        // Everything is OK so far, enable the language
+        $us = "UPDATE language SET available = 0 WHERE id = {$lr['id']}";
+        $uq = mysql_query($us);
+        if ($uq === false) {
+            $output->writeln('Error in query: '.mysql_error());
+        } else {
+            $output->writeln($lang . ' language has been disabled.');
+        }
+        return null;
+    }
+}

+ 70 - 0
vendor/chamilo/chash/src/Chash/Command/Translation/EnableLanguageCommand.php

@@ -0,0 +1,70 @@
+<?php
+/**
+ * Definition of command to
+ * enable a language
+ * Does not support multi-url yet
+ */
+/**
+ * Necessary namespaces definitions and usage
+ */
+namespace Chash\Command\Translation;
+
+use Chash\Command\Database\CommonChamiloDatabaseCommand;
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * Definition of the translation:enable command
+ */
+class EnableLanguageCommand extends CommonChamiloDatabaseCommand
+{
+    protected function configure()
+    {
+        parent::configure();
+        $this
+            ->setName('translation:enable')
+            ->setAliases(array('tel'))
+            ->setDescription('Enables a (disabled) language')
+            ->addArgument(
+                'language',
+                InputArgument::REQUIRED,
+                'The English name for the language to enable.'
+            );
+    }
+
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+        parent::execute($input, $output);
+        $_configuration = $this->getHelper('configuration')->getConfiguration();
+        $dbh = $this->getHelper('configuration')->getConnection();
+        $lang = mysql_real_escape_string($input->getArgument('language'));
+        $ls = "SELECT id, english_name, available FROM language WHERE english_name = '$lang'";
+        $lq = mysql_query($ls);
+        if ($lq === false) {
+            $output->writeln('Error in query: '.mysql_error());
+            return null;
+        }
+        $num = mysql_num_rows($lq);
+        if ($num<1) {
+            $output->writeln($lang.' language not found in the database. Please make sure you use an existing language name.');
+            return null;
+        }
+        $lr = mysql_fetch_assoc($lq);
+        if ($lr['available'] == 1) {
+            $output->writeln($lang.' language is already enabled. Nothing to do.');
+            return null;
+        }
+        // Everything is OK so far, enable the language
+        $us = "UPDATE language SET available = 1 WHERE id = {$lr['id']}";
+        $uq = mysql_query($us);
+        if ($uq === false) {
+            $output->writeln('Error in query: '.mysql_error());
+        } else {
+            $output->writeln($lang . ' language has been enabled.');
+        }
+        return null;
+    }
+}

+ 79 - 0
vendor/chamilo/chash/src/Chash/Command/Translation/ListLanguagesCommand.php

@@ -0,0 +1,79 @@
+<?php
+/**
+ * Definition of command to
+ * list platform languages
+ * Does not support multi-url yet
+ */
+/**
+ * Necessary namespaces definitions and usage
+ */
+namespace Chash\Command\Translation;
+
+use Chash\Command\Database\CommonChamiloDatabaseCommand;
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * Definition of the translation:list command
+ */
+class ListLanguagesCommand extends CommonChamiloDatabaseCommand
+{
+    protected function configure()
+    {
+        parent::configure();
+        $this
+            ->setName('translation:list')
+            ->setAliases(array('tl'))
+            ->setDescription('Gets all languages as a list')
+            ->addArgument(
+                'availability',
+                InputArgument::OPTIONAL,
+                'Filter the availability we want (0 for disabled, 1 for enabled, empty for all).'
+            );
+    }
+
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+        parent::execute($input, $output);
+        $_configuration = $this->getHelper('configuration')->getConfiguration();
+        $dbh = $this->getHelper('configuration')->getConnection();
+        $av = mysql_real_escape_string($input->getArgument('availability'));
+        $current = 'english';
+        $ls = "SELECT selected_value FROM settings_current WHERE variable='platformLanguage'";
+        $lq = mysql_query($ls);
+        if ($lq === false) {
+            $output->writeln('Error in query: '.mysql_error());
+            return null;
+        } else {
+            $lr = mysql_fetch_assoc($lq);
+            //$output->writeln('Current default language is: '.$lr['selected_value']);
+            $current = $lr['selected_value'];
+        }
+        $where = '';
+        if ($av === '0') {
+            $where = 'WHERE available = 0';
+        } elseif ($av === '1') {
+            $where = 'WHERE available = 1';
+        }
+        $ls = "SELECT english_name, available FROM language ".$where." ORDER BY english_name";
+        $lq = mysql_query($ls);
+        if ($lq === false) {
+            $output->writeln('Error in query: '.mysql_error());
+            return null;
+        } else {
+            $languages = array();
+            $output->writeln("Language          | Enabled | Platform language");
+            $output->writeln("-----------------------------------------------");
+            while ($lr = mysql_fetch_assoc($lq)) {
+                $pl = '';
+                $l = strlen($lr['english_name']);
+                if ($lr['english_name'] == $current) { $pl = '*'; }
+                $output->writeln($lr['english_name'].str_repeat(' ',18-$l)."| ".$lr['available']."       | ".$pl);
+            }
+        }
+        return null;
+    }
+}

+ 80 - 0
vendor/chamilo/chash/src/Chash/Command/Translation/PlatformLanguageCommand.php

@@ -0,0 +1,80 @@
+<?php
+/**
+ * Definition of command to
+ * change platform language
+ * Does not support multi-url yet
+ */
+/**
+ * Necessary namespaces definitions and usage
+ */
+namespace Chash\Command\Translation;
+
+use Chash\Command\Database\CommonChamiloDatabaseCommand;
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * Definition of the translation:platform_language command
+ */
+class PlatformLanguageCommand extends CommonChamiloDatabaseCommand
+{
+    protected function configure()
+    {
+        parent::configure();
+        $this
+            ->setName('translation:platform_language')
+            ->setAliases(array('tpl'))
+            ->setDescription('Gets or sets the platform language')
+            ->addArgument(
+                'language',
+                InputArgument::OPTIONAL,
+                'Which language you want to set (English name). Leave empty to get current language.'
+            );
+    }
+
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+        parent::execute($input, $output);
+        $_configuration = $this->getHelper('configuration')->getConfiguration();
+        $dbh = $this->getHelper('configuration')->getConnection();
+        $lang = mysql_real_escape_string($input->getArgument('language'));
+        if (empty($lang)) {
+            $ls = "SELECT selected_value FROM settings_current WHERE variable='platformLanguage'";
+            $lq = mysql_query($ls);
+            if ($lq === false) {
+                $output->writeln('Error in query: '.mysql_error());
+                return null;
+            } else {
+                $lr = mysql_fetch_assoc($lq);
+                $output->writeln('Current default language is: '.$lr['selected_value']);
+            }
+        } else {
+            $ls = "SELECT english_name FROM language ORDER BY english_name";
+            $lq = mysql_query($ls);
+            if ($lq === false) {
+                $output->writeln('Error in query: '.mysql_error());
+                return null;
+            } else {
+                $languages = array();
+                while ($lr = mysql_fetch_assoc($lq)) {
+                    $languages[] = $lr['english_name'];
+                }
+                if (!in_array($lang,$languages)) {
+                    $output->writeln($lang.' must be available on your platform before you can set it as default');
+                    return null;
+                }
+                $lu = "UPDATE settings_current set selected_value = '$lang' WHERE variable = 'platformLanguage'";
+                $lq = mysql_query($lu);
+                if ($lq === false) {
+                    $output->writeln('Error in query: '.mysql_error());
+                } else {
+                    $output->writeln('Language set to '.$lang);
+                }
+            }
+        }
+        return null;
+    }
+}

+ 72 - 0
vendor/chamilo/chash/src/Chash/Command/User/ChangePassCommand.php

@@ -0,0 +1,72 @@
+<?php
+
+namespace Chash\Command\User;
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+
+
+/**
+ * Command functions meant to deal with what the user of this script is calling
+ * it for.
+ */
+/**
+ * Changes a user password to the one given 
+ */
+class ChangePassCommand extends CommonChamiloUserCommand
+{
+    protected function configure()
+    {
+        parent::configure();
+
+        $this
+            ->setName('user:change_pass')
+            ->setDescription('Updates the user password to the one given')
+            ->addArgument(
+                'username', 
+                InputArgument::REQUIRED,
+                'Allows you to specify the username'
+            )
+            ->addArgument(
+                'password', 
+                InputArgument::REQUIRED,
+                'The new password to give this user'
+            );
+    }
+
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+        parent::execute($input, $output);
+        $_configuration = $this->getHelper('configuration')->getConfiguration();
+        $dbh = $this->getHelper('configuration')->getConnection();
+        $username = $input->getArgument('username');
+        $password = $input->getArgument('password');
+        $us = "SELECT * FROM user WHERE username = '".mysql_real_escape_string($username)."'";
+        $uq = mysql_query($us);
+        $un = mysql_num_rows($uq);
+        if ($un >= 1) {
+            $enc = $_configuration['password_encryption'];
+            switch ($enc) {
+                case 'sha1':
+                    $password = sha1($password);
+                    break;
+                case 'md5':
+                    $password = md5($password);
+                    break;
+                default:
+                    $password = mysql_real_escape_string($password);
+                    break;
+            }
+            $user = mysql_fetch_assoc($uq);
+            $ups = "UPDATE user SET password = '$password' WHERE user_id = ".$user['user_id'];
+            $upq = mysql_query($ups);
+            $output->writeln('User '.$username.' has new password.');
+        } else {
+            $output->writeln('Could not find user '.$username);
+        }
+        return null;
+    }
+}

+ 82 - 0
vendor/chamilo/chash/src/Chash/Command/User/SetLanguageCommand.php

@@ -0,0 +1,82 @@
+<?php
+/**
+ * Command functions meant to deal with what the user of this script is calling
+ * it for.
+ */
+/**
+ * Namespaces
+ */
+namespace Chash\Command\User;
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * Changes the language for all platform users
+ */
+class SetLanguageCommand extends CommonChamiloUserCommand
+{
+    protected function configure()
+    {
+        parent::configure();
+
+        $this
+            ->setName('user:set_language')
+            ->setAliases(array('usl'))
+            ->setDescription('Sets the users language to the one given')
+            ->addArgument(
+                'language', 
+                InputArgument::OPTIONAL,
+                'The English name for the new language to set all users to'
+            );
+    }
+
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+        parent::execute($input, $output);
+        $_configuration = $this->getHelper('configuration')->getConfiguration();
+        $dbh = $this->getHelper('configuration')->getConnection();
+        $lang = mysql_real_escape_string($input->getArgument('language'));
+        if (empty($lang)) {
+            $ls = "SELECT DISTINCT language, count(*) as num FROM user GROUP BY 1 ORDER BY language";
+            $lq = mysql_query($ls);
+            if ($lq === false) {
+                $output->writeln('Error in query: '.mysql_error());
+                return null;
+            } else {
+                $output->writeln("Language\t| Number of users");
+                while ($lr = mysql_fetch_assoc($lq)) {
+                    $output->writeln($lr['language']."\t\t| ".$lr['num']);
+                }
+            }
+        } else {
+            // Check available languages
+            $ls = "SELECT english_name FROM language ORDER BY english_name";
+            $lq = mysql_query($ls);
+            if ($lq === false) {
+                $output->writeln('Error in query: '.mysql_error());
+                return null;
+            } else {
+                $languages = array();
+                while ($lr = mysql_fetch_assoc($lq)) {
+                    $languages[] = $lr['english_name'];
+                }
+                if (!in_array($lang,$languages)) {
+                    $output->writeln($lang.' must be available on your platform before you can use it');
+                    return null;
+                }
+                $lu = "UPDATE user SET language = '$lang'";
+                $lq = mysql_query($lu);
+                if ($lq === false) {
+                    $output->writeln('Error in query: '.mysql_error());
+                } else {
+                    $output->writeln('Language set to '.$lang.' for all users');
+                }
+            }
+        }
+        return null;
+    }
+}

+ 5 - 5
vendor/chamilo/chash/src/Chash/Helpers/ConfigurationHelper.php

@@ -49,12 +49,12 @@ class ConfigurationHelper extends Helper
             $chamiloPath = $path;
         }
 
-        $dir = $chamiloPath.'/main/inc/conf/';
-
-        if (is_dir($dir)) {
-            return $dir;
+        while (!is_dir($chamiloPath.'/main/inc/conf/') && $chamiloPath != '/') {
+            $chamiloPath = realpath($chamiloPath.'/..');
+        }
+        if (is_dir($chamiloPath.'/main/inc/conf/')) {
+            return $dir = realpath($chamiloPath.'/main/inc/conf/').'/';
         }
-
         return false;
     }
 

+ 1 - 1
vendor/chamilo/chash/vendor/autoload.php

@@ -4,4 +4,4 @@
 
 require_once __DIR__ . '/composer' . '/autoload_real.php';
 
-return ComposerAutoloaderInitc47774cf7b086bf8ad0a7620339b00ca::getLoader();
+return ComposerAutoloaderInitb821c02752afe45d11b4bba36e3dd2a7::getLoader();

+ 240 - 0
vendor/chamilo/chash/vendor/composer/ClassLoader.php

@@ -0,0 +1,240 @@
+<?php
+
+/*
+ * This file is part of Composer.
+ *
+ * (c) Nils Adermann <naderman@naderman.de>
+ *     Jordi Boggiano <j.boggiano@seld.be>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\Autoload;
+
+/**
+ * ClassLoader implements a PSR-0 class loader
+ *
+ * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
+ *
+ *     $loader = new \Composer\Autoload\ClassLoader();
+ *
+ *     // register classes with namespaces
+ *     $loader->add('Symfony\Component', __DIR__.'/component');
+ *     $loader->add('Symfony',           __DIR__.'/framework');
+ *
+ *     // activate the autoloader
+ *     $loader->register();
+ *
+ *     // to enable searching the include path (eg. for PEAR packages)
+ *     $loader->setUseIncludePath(true);
+ *
+ * In this example, if you try to use a class in the Symfony\Component
+ * namespace or one of its children (Symfony\Component\Console for instance),
+ * the autoloader will first look for the class under the component/
+ * directory, and it will then fallback to the framework/ directory if not
+ * found before giving up.
+ *
+ * This class is loosely based on the Symfony UniversalClassLoader.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @author Jordi Boggiano <j.boggiano@seld.be>
+ */
+class ClassLoader
+{
+    private $prefixes = array();
+    private $fallbackDirs = array();
+    private $useIncludePath = false;
+    private $classMap = array();
+
+    public function getPrefixes()
+    {
+        return $this->prefixes;
+    }
+
+    public function getFallbackDirs()
+    {
+        return $this->fallbackDirs;
+    }
+
+    public function getClassMap()
+    {
+        return $this->classMap;
+    }
+
+    /**
+     * @param array $classMap Class to filename map
+     */
+    public function addClassMap(array $classMap)
+    {
+        if ($this->classMap) {
+            $this->classMap = array_merge($this->classMap, $classMap);
+        } else {
+            $this->classMap = $classMap;
+        }
+    }
+
+    /**
+     * Registers a set of classes, merging with any others previously set.
+     *
+     * @param string       $prefix  The classes prefix
+     * @param array|string $paths   The location(s) of the classes
+     * @param bool         $prepend Prepend the location(s)
+     */
+    public function add($prefix, $paths, $prepend = false)
+    {
+        if (!$prefix) {
+            if ($prepend) {
+                $this->fallbackDirs = array_merge(
+                    (array) $paths,
+                    $this->fallbackDirs
+                );
+            } else {
+                $this->fallbackDirs = array_merge(
+                    $this->fallbackDirs,
+                    (array) $paths
+                );
+            }
+
+            return;
+        }
+        if (!isset($this->prefixes[$prefix])) {
+            $this->prefixes[$prefix] = (array) $paths;
+
+            return;
+        }
+        if ($prepend) {
+            $this->prefixes[$prefix] = array_merge(
+                (array) $paths,
+                $this->prefixes[$prefix]
+            );
+        } else {
+            $this->prefixes[$prefix] = array_merge(
+                $this->prefixes[$prefix],
+                (array) $paths
+            );
+        }
+    }
+
+    /**
+     * Registers a set of classes, replacing any others previously set.
+     *
+     * @param string       $prefix  The classes prefix
+     * @param array|string $paths   The location(s) of the classes
+     */
+    public function set($prefix, $paths)
+    {
+        if (!$prefix) {
+            $this->fallbackDirs = (array) $paths;
+
+            return;
+        }
+        $this->prefixes[$prefix] = (array) $paths;
+    }
+
+    /**
+     * Turns on searching the include path for class files.
+     *
+     * @param bool $useIncludePath
+     */
+    public function setUseIncludePath($useIncludePath)
+    {
+        $this->useIncludePath = $useIncludePath;
+    }
+
+    /**
+     * Can be used to check if the autoloader uses the include path to check
+     * for classes.
+     *
+     * @return bool
+     */
+    public function getUseIncludePath()
+    {
+        return $this->useIncludePath;
+    }
+
+    /**
+     * Registers this instance as an autoloader.
+     *
+     * @param bool $prepend Whether to prepend the autoloader or not
+     */
+    public function register($prepend = false)
+    {
+        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+    }
+
+    /**
+     * Unregisters this instance as an autoloader.
+     */
+    public function unregister()
+    {
+        spl_autoload_unregister(array($this, 'loadClass'));
+    }
+
+    /**
+     * Loads the given class or interface.
+     *
+     * @param  string    $class The name of the class
+     * @return bool|null True if loaded, null otherwise
+     */
+    public function loadClass($class)
+    {
+        if ($file = $this->findFile($class)) {
+            include $file;
+
+            return true;
+        }
+    }
+
+    /**
+     * Finds the path to the file where the class is defined.
+     *
+     * @param string $class The name of the class
+     *
+     * @return string|false The path if found, false otherwise
+     */
+    public function findFile($class)
+    {
+        if ('\\' == $class[0]) {
+            $class = substr($class, 1);
+        }
+
+        if (isset($this->classMap[$class])) {
+            return $this->classMap[$class];
+        }
+
+        if (false !== $pos = strrpos($class, '\\')) {
+            // namespaced class name
+            $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)) . DIRECTORY_SEPARATOR;
+            $className = substr($class, $pos + 1);
+        } else {
+            // PEAR-like class name
+            $classPath = null;
+            $className = $class;
+        }
+
+        $classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
+
+        foreach ($this->prefixes as $prefix => $dirs) {
+            if (0 === strpos($class, $prefix)) {
+                foreach ($dirs as $dir) {
+                    if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) {
+                        return $dir . DIRECTORY_SEPARATOR . $classPath;
+                    }
+                }
+            }
+        }
+
+        foreach ($this->fallbackDirs as $dir) {
+            if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) {
+                return $dir . DIRECTORY_SEPARATOR . $classPath;
+            }
+        }
+
+        if ($this->useIncludePath && $file = stream_resolve_include_path($classPath)) {
+            return $file;
+        }
+
+        return $this->classMap[$class] = false;
+    }
+}

+ 9 - 0
vendor/chamilo/chash/vendor/composer/autoload_classmap.php

@@ -0,0 +1,9 @@
+<?php
+
+// autoload_classmap.php generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+);

+ 12 - 0
vendor/chamilo/chash/vendor/composer/autoload_namespaces.php

@@ -0,0 +1,12 @@
+<?php
+
+// autoload_namespaces.php generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+    'Symfony\\Component\\Yaml' => $vendorDir . '/symfony/yaml',
+    'Symfony\\Component\\Console\\' => $vendorDir . '/symfony/console',
+    'Chash' => $baseDir . '/src',
+);

+ 43 - 0
vendor/chamilo/chash/vendor/composer/autoload_real.php

@@ -0,0 +1,43 @@
+<?php
+
+// autoload_real.php generated by Composer
+
+class ComposerAutoloaderInitb821c02752afe45d11b4bba36e3dd2a7
+{
+    private static $loader;
+
+    public static function loadClassLoader($class)
+    {
+        if ('Composer\Autoload\ClassLoader' === $class) {
+            require __DIR__ . '/ClassLoader.php';
+        }
+    }
+
+    public static function getLoader()
+    {
+        if (null !== self::$loader) {
+            return self::$loader;
+        }
+
+        spl_autoload_register(array('ComposerAutoloaderInitb821c02752afe45d11b4bba36e3dd2a7', 'loadClassLoader'), true, true);
+        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
+        spl_autoload_unregister(array('ComposerAutoloaderInitb821c02752afe45d11b4bba36e3dd2a7', 'loadClassLoader'));
+
+        $vendorDir = dirname(__DIR__);
+        $baseDir = dirname($vendorDir);
+
+        $map = require __DIR__ . '/autoload_namespaces.php';
+        foreach ($map as $namespace => $path) {
+            $loader->add($namespace, $path);
+        }
+
+        $classMap = require __DIR__ . '/autoload_classmap.php';
+        if ($classMap) {
+            $loader->addClassMap($classMap);
+        }
+
+        $loader->register(true);
+
+        return $loader;
+    }
+}

+ 98 - 0
vendor/chamilo/chash/vendor/composer/installed.json

@@ -0,0 +1,98 @@
+[
+    {
+        "name": "symfony/yaml",
+        "version": "2.1.x-dev",
+        "version_normalized": "2.1.9999999.9999999-dev",
+        "target-dir": "Symfony/Component/Yaml",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/symfony/Yaml.git",
+            "reference": "4ef80f5c5081ad9a7e08184fc9f25c62d87e408c"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/symfony/Yaml/zipball/4ef80f5c5081ad9a7e08184fc9f25c62d87e408c",
+            "reference": "4ef80f5c5081ad9a7e08184fc9f25c62d87e408c",
+            "shasum": ""
+        },
+        "require": {
+            "php": ">=5.3.3"
+        },
+        "time": "2013-04-12 10:27:36",
+        "type": "library",
+        "installation-source": "source",
+        "autoload": {
+            "psr-0": {
+                "Symfony\\Component\\Yaml": ""
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "MIT"
+        ],
+        "authors": [
+            {
+                "name": "Fabien Potencier",
+                "email": "fabien@symfony.com"
+            },
+            {
+                "name": "Symfony Community",
+                "homepage": "http://symfony.com/contributors"
+            }
+        ],
+        "description": "Symfony Yaml Component",
+        "homepage": "http://symfony.com"
+    },
+    {
+        "name": "symfony/console",
+        "version": "dev-master",
+        "version_normalized": "9999999-dev",
+        "target-dir": "Symfony/Component/Console",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/symfony/Console.git",
+            "reference": "74049e36e2e73ca2ec069c9be86d01ba422d44ea"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/symfony/Console/zipball/74049e36e2e73ca2ec069c9be86d01ba422d44ea",
+            "reference": "74049e36e2e73ca2ec069c9be86d01ba422d44ea",
+            "shasum": ""
+        },
+        "require": {
+            "php": ">=5.3.3"
+        },
+        "require-dev": {
+            "symfony/event-dispatcher": ">=2.1,<3.0"
+        },
+        "time": "2013-04-13 14:06:01",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "2.3-dev"
+            }
+        },
+        "installation-source": "source",
+        "autoload": {
+            "psr-0": {
+                "Symfony\\Component\\Console\\": ""
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "MIT"
+        ],
+        "authors": [
+            {
+                "name": "Fabien Potencier",
+                "email": "fabien@symfony.com"
+            },
+            {
+                "name": "Symfony Community",
+                "homepage": "http://symfony.com/contributors"
+            }
+        ],
+        "description": "Symfony Console Component",
+        "homepage": "http://symfony.com"
+    }
+]

+ 1195 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Application.php

@@ -0,0 +1,1195 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\ArgvInput;
+use Symfony\Component\Console\Input\ArrayInput;
+use Symfony\Component\Console\Input\InputDefinition;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Output\ConsoleOutput;
+use Symfony\Component\Console\Output\ConsoleOutputInterface;
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Command\HelpCommand;
+use Symfony\Component\Console\Command\ListCommand;
+use Symfony\Component\Console\Helper\HelperSet;
+use Symfony\Component\Console\Helper\FormatterHelper;
+use Symfony\Component\Console\Helper\DialogHelper;
+use Symfony\Component\Console\Helper\ProgressHelper;
+use Symfony\Component\Console\Helper\TableHelper;
+use Symfony\Component\Console\Event\ConsoleCommandEvent;
+use Symfony\Component\Console\Event\ConsoleForExceptionEvent;
+use Symfony\Component\Console\Event\ConsoleTerminateEvent;
+use Symfony\Component\EventDispatcher\EventDispatcher;
+
+/**
+ * An Application is the container for a collection of commands.
+ *
+ * It is the main entry point of a Console application.
+ *
+ * This class is optimized for a standard CLI environment.
+ *
+ * Usage:
+ *
+ *     $app = new Application('myapp', '1.0 (stable)');
+ *     $app->add(new SimpleCommand());
+ *     $app->run();
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @api
+ */
+class Application
+{
+    private $commands;
+    private $wantHelps = false;
+    private $runningCommand;
+    private $name;
+    private $version;
+    private $catchExceptions;
+    private $autoExit;
+    private $definition;
+    private $helperSet;
+    private $dispatcher;
+
+    /**
+     * Constructor.
+     *
+     * @param string $name    The name of the application
+     * @param string $version The version of the application
+     *
+     * @api
+     */
+    public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN')
+    {
+        $this->name = $name;
+        $this->version = $version;
+        $this->catchExceptions = true;
+        $this->autoExit = true;
+        $this->commands = array();
+        $this->helperSet = $this->getDefaultHelperSet();
+        $this->definition = $this->getDefaultInputDefinition();
+
+        foreach ($this->getDefaultCommands() as $command) {
+            $this->add($command);
+        }
+    }
+
+    public function setDispatcher(EventDispatcher $dispatcher)
+    {
+        $this->dispatcher = $dispatcher;
+    }
+
+    /**
+     * Runs the current application.
+     *
+     * @param InputInterface  $input  An Input instance
+     * @param OutputInterface $output An Output instance
+     *
+     * @return integer 0 if everything went fine, or an error code
+     *
+     * @throws \Exception When doRun returns Exception
+     *
+     * @api
+     */
+    public function run(InputInterface $input = null, OutputInterface $output = null)
+    {
+        if (null === $input) {
+            $input = new ArgvInput();
+        }
+
+        if (null === $output) {
+            $output = new ConsoleOutput();
+        }
+
+        try {
+            $exitCode = $this->doRun($input, $output);
+        } catch (\Exception $e) {
+            if (!$this->catchExceptions) {
+                throw $e;
+            }
+
+            if ($output instanceof ConsoleOutputInterface) {
+                $this->renderException($e, $output->getErrorOutput());
+            } else {
+                $this->renderException($e, $output);
+            }
+            $exitCode = $e->getCode();
+
+            $exitCode = is_numeric($exitCode) && $exitCode ? $exitCode : 1;
+        }
+
+        if ($this->autoExit) {
+            if ($exitCode > 255) {
+                $exitCode = 255;
+            }
+            // @codeCoverageIgnoreStart
+            exit($exitCode);
+            // @codeCoverageIgnoreEnd
+        }
+
+        return $exitCode;
+    }
+
+    /**
+     * Runs the current application.
+     *
+     * @param InputInterface  $input  An Input instance
+     * @param OutputInterface $output An Output instance
+     *
+     * @return integer 0 if everything went fine, or an error code
+     */
+    public function doRun(InputInterface $input, OutputInterface $output)
+    {
+        $name = $this->getCommandName($input);
+
+        if (true === $input->hasParameterOption(array('--ansi'))) {
+            $output->setDecorated(true);
+        } elseif (true === $input->hasParameterOption(array('--no-ansi'))) {
+            $output->setDecorated(false);
+        }
+
+        if (true === $input->hasParameterOption(array('--help', '-h'))) {
+            if (!$name) {
+                $name = 'help';
+                $input = new ArrayInput(array('command' => 'help'));
+            } else {
+                $this->wantHelps = true;
+            }
+        }
+
+        if (true === $input->hasParameterOption(array('--no-interaction', '-n'))) {
+            $input->setInteractive(false);
+        }
+
+        if (function_exists('posix_isatty') && $this->getHelperSet()->has('dialog')) {
+            $inputStream = $this->getHelperSet()->get('dialog')->getInputStream();
+            if (!posix_isatty($inputStream)) {
+                $input->setInteractive(false);
+            }
+        }
+
+        if (true === $input->hasParameterOption(array('--quiet', '-q'))) {
+            $output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
+        } elseif (true === $input->hasParameterOption(array('--verbose', '-v'))) {
+            $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
+        }
+
+        if (true === $input->hasParameterOption(array('--version', '-V'))) {
+            $output->writeln($this->getLongVersion());
+
+            return 0;
+        }
+
+        if (!$name) {
+            $name = 'list';
+            $input = new ArrayInput(array('command' => 'list'));
+        }
+
+        // the command name MUST be the first element of the input
+        $command = $this->find($name);
+
+        $this->runningCommand = $command;
+        $exitCode = $this->doRunCommand($command, $input, $output);
+        $this->runningCommand = null;
+
+        return is_numeric($exitCode) ? $exitCode : 0;
+    }
+
+    /**
+     * Set a helper set to be used with the command.
+     *
+     * @param HelperSet $helperSet The helper set
+     *
+     * @api
+     */
+    public function setHelperSet(HelperSet $helperSet)
+    {
+        $this->helperSet = $helperSet;
+    }
+
+    /**
+     * Get the helper set associated with the command.
+     *
+     * @return HelperSet The HelperSet instance associated with this command
+     *
+     * @api
+     */
+    public function getHelperSet()
+    {
+        return $this->helperSet;
+    }
+
+    /**
+     * Set an input definition set to be used with this application
+     *
+     * @param InputDefinition $definition The input definition
+     *
+     * @api
+     */
+    public function setDefinition(InputDefinition $definition)
+    {
+        $this->definition = $definition;
+    }
+
+    /**
+     * Gets the InputDefinition related to this Application.
+     *
+     * @return InputDefinition The InputDefinition instance
+     */
+    public function getDefinition()
+    {
+        return $this->definition;
+    }
+
+    /**
+     * Gets the help message.
+     *
+     * @return string A help message.
+     */
+    public function getHelp()
+    {
+        $messages = array(
+            $this->getLongVersion(),
+            '',
+            '<comment>Usage:</comment>',
+            '  [options] command [arguments]',
+            '',
+            '<comment>Options:</comment>',
+        );
+
+        foreach ($this->getDefinition()->getOptions() as $option) {
+            $messages[] = sprintf('  %-29s %s %s',
+                '<info>--'.$option->getName().'</info>',
+                $option->getShortcut() ? '<info>-'.$option->getShortcut().'</info>' : '  ',
+                $option->getDescription()
+            );
+        }
+
+        return implode(PHP_EOL, $messages);
+    }
+
+    /**
+     * Sets whether to catch exceptions or not during commands execution.
+     *
+     * @param Boolean $boolean Whether to catch exceptions or not during commands execution
+     *
+     * @api
+     */
+    public function setCatchExceptions($boolean)
+    {
+        $this->catchExceptions = (Boolean) $boolean;
+    }
+
+    /**
+     * Sets whether to automatically exit after a command execution or not.
+     *
+     * @param Boolean $boolean Whether to automatically exit after a command execution or not
+     *
+     * @api
+     */
+    public function setAutoExit($boolean)
+    {
+        $this->autoExit = (Boolean) $boolean;
+    }
+
+    /**
+     * Gets the name of the application.
+     *
+     * @return string The application name
+     *
+     * @api
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * Sets the application name.
+     *
+     * @param string $name The application name
+     *
+     * @api
+     */
+    public function setName($name)
+    {
+        $this->name = $name;
+    }
+
+    /**
+     * Gets the application version.
+     *
+     * @return string The application version
+     *
+     * @api
+     */
+    public function getVersion()
+    {
+        return $this->version;
+    }
+
+    /**
+     * Sets the application version.
+     *
+     * @param string $version The application version
+     *
+     * @api
+     */
+    public function setVersion($version)
+    {
+        $this->version = $version;
+    }
+
+    /**
+     * Returns the long version of the application.
+     *
+     * @return string The long application version
+     *
+     * @api
+     */
+    public function getLongVersion()
+    {
+        if ('UNKNOWN' !== $this->getName() && 'UNKNOWN' !== $this->getVersion()) {
+            return sprintf('<info>%s</info> version <comment>%s</comment>', $this->getName(), $this->getVersion());
+        }
+
+        return '<info>Console Tool</info>';
+    }
+
+    /**
+     * Registers a new command.
+     *
+     * @param string $name The command name
+     *
+     * @return Command The newly created command
+     *
+     * @api
+     */
+    public function register($name)
+    {
+        return $this->add(new Command($name));
+    }
+
+    /**
+     * Adds an array of command objects.
+     *
+     * @param Command[] $commands An array of commands
+     *
+     * @api
+     */
+    public function addCommands(array $commands)
+    {
+        foreach ($commands as $command) {
+            $this->add($command);
+        }
+    }
+
+    /**
+     * Adds a command object.
+     *
+     * If a command with the same name already exists, it will be overridden.
+     *
+     * @param Command $command A Command object
+     *
+     * @return Command The registered command
+     *
+     * @api
+     */
+    public function add(Command $command)
+    {
+        $command->setApplication($this);
+
+        if (!$command->isEnabled()) {
+            $command->setApplication(null);
+
+            return;
+        }
+
+        $this->commands[$command->getName()] = $command;
+
+        foreach ($command->getAliases() as $alias) {
+            $this->commands[$alias] = $command;
+        }
+
+        return $command;
+    }
+
+    /**
+     * Returns a registered command by name or alias.
+     *
+     * @param string $name The command name or alias
+     *
+     * @return Command A Command object
+     *
+     * @throws \InvalidArgumentException When command name given does not exist
+     *
+     * @api
+     */
+    public function get($name)
+    {
+        if (!isset($this->commands[$name])) {
+            throw new \InvalidArgumentException(sprintf('The command "%s" does not exist.', $name));
+        }
+
+        $command = $this->commands[$name];
+
+        if ($this->wantHelps) {
+            $this->wantHelps = false;
+
+            $helpCommand = $this->get('help');
+            $helpCommand->setCommand($command);
+
+            return $helpCommand;
+        }
+
+        return $command;
+    }
+
+    /**
+     * Returns true if the command exists, false otherwise.
+     *
+     * @param string $name The command name or alias
+     *
+     * @return Boolean true if the command exists, false otherwise
+     *
+     * @api
+     */
+    public function has($name)
+    {
+        return isset($this->commands[$name]);
+    }
+
+    /**
+     * Returns an array of all unique namespaces used by currently registered commands.
+     *
+     * It does not returns the global namespace which always exists.
+     *
+     * @return array An array of namespaces
+     */
+    public function getNamespaces()
+    {
+        $namespaces = array();
+        foreach ($this->commands as $command) {
+            $namespaces[] = $this->extractNamespace($command->getName());
+
+            foreach ($command->getAliases() as $alias) {
+                $namespaces[] = $this->extractNamespace($alias);
+            }
+        }
+
+        return array_values(array_unique(array_filter($namespaces)));
+    }
+
+    /**
+     * Finds a registered namespace by a name or an abbreviation.
+     *
+     * @param string $namespace A namespace or abbreviation to search for
+     *
+     * @return string A registered namespace
+     *
+     * @throws \InvalidArgumentException When namespace is incorrect or ambiguous
+     */
+    public function findNamespace($namespace)
+    {
+        $allNamespaces = $this->getNamespaces();
+        $found = '';
+        foreach (explode(':', $namespace) as $i => $part) {
+            // select sub-namespaces matching the current namespace we found
+            $namespaces = array();
+            foreach ($allNamespaces as $n) {
+                if ('' === $found || 0 === strpos($n, $found)) {
+                    $namespaces[$n] = explode(':', $n);
+                }
+            }
+
+            $abbrevs = static::getAbbreviations(array_unique(array_values(array_filter(array_map(function ($p) use ($i) { return isset($p[$i]) ? $p[$i] : ''; }, $namespaces)))));
+
+            if (!isset($abbrevs[$part])) {
+                $message = sprintf('There are no commands defined in the "%s" namespace.', $namespace);
+
+                if (1 <= $i) {
+                    $part = $found.':'.$part;
+                }
+
+                if ($alternatives = $this->findAlternativeNamespace($part, $abbrevs)) {
+                    if (1 == count($alternatives)) {
+                        $message .= "\n\nDid you mean this?\n    ";
+                    } else {
+                        $message .= "\n\nDid you mean one of these?\n    ";
+                    }
+
+                    $message .= implode("\n    ", $alternatives);
+                }
+
+                throw new \InvalidArgumentException($message);
+            }
+
+            // there are multiple matches, but $part is an exact match of one of them so we select it
+            if (in_array($part, $abbrevs[$part])) {
+                $abbrevs[$part] = array($part);
+            }
+
+            if (count($abbrevs[$part]) > 1) {
+                throw new \InvalidArgumentException(sprintf('The namespace "%s" is ambiguous (%s).', $namespace, $this->getAbbreviationSuggestions($abbrevs[$part])));
+            }
+
+            $found .= $found ? ':' . $abbrevs[$part][0] : $abbrevs[$part][0];
+        }
+
+        return $found;
+    }
+
+    /**
+     * Finds a command by name or alias.
+     *
+     * Contrary to get, this command tries to find the best
+     * match if you give it an abbreviation of a name or alias.
+     *
+     * @param string $name A command name or a command alias
+     *
+     * @return Command A Command instance
+     *
+     * @throws \InvalidArgumentException When command name is incorrect or ambiguous
+     *
+     * @api
+     */
+    public function find($name)
+    {
+        // namespace
+        $namespace = '';
+        $searchName = $name;
+        if (false !== $pos = strrpos($name, ':')) {
+            $namespace = $this->findNamespace(substr($name, 0, $pos));
+            $searchName = $namespace.substr($name, $pos);
+        }
+
+        // name
+        $commands = array();
+        foreach ($this->commands as $command) {
+            $extractedNamespace = $this->extractNamespace($command->getName());
+            if ($extractedNamespace === $namespace
+               || !empty($namespace) && 0 === strpos($extractedNamespace, $namespace)
+            ) {
+                $commands[] = $command->getName();
+            }
+        }
+
+        $abbrevs = static::getAbbreviations(array_unique($commands));
+        if (isset($abbrevs[$searchName]) && 1 == count($abbrevs[$searchName])) {
+            return $this->get($abbrevs[$searchName][0]);
+        }
+
+        if (isset($abbrevs[$searchName]) && count($abbrevs[$searchName]) > 1) {
+            $suggestions = $this->getAbbreviationSuggestions($abbrevs[$searchName]);
+
+            throw new \InvalidArgumentException(sprintf('Command "%s" is ambiguous (%s).', $name, $suggestions));
+        }
+
+        // aliases
+        $aliases = array();
+        foreach ($this->commands as $command) {
+            foreach ($command->getAliases() as $alias) {
+                $extractedNamespace = $this->extractNamespace($alias);
+                if ($extractedNamespace === $namespace
+                   || !empty($namespace) && 0 === strpos($extractedNamespace, $namespace)
+                ) {
+                    $aliases[] = $alias;
+                }
+            }
+        }
+
+        $aliases = static::getAbbreviations(array_unique($aliases));
+        if (!isset($aliases[$searchName])) {
+            $message = sprintf('Command "%s" is not defined.', $name);
+
+            if ($alternatives = $this->findAlternativeCommands($searchName, $abbrevs)) {
+                if (1 == count($alternatives)) {
+                    $message .= "\n\nDid you mean this?\n    ";
+                } else {
+                    $message .= "\n\nDid you mean one of these?\n    ";
+                }
+                $message .= implode("\n    ", $alternatives);
+            }
+
+            throw new \InvalidArgumentException($message);
+        }
+
+        if (count($aliases[$searchName]) > 1) {
+            throw new \InvalidArgumentException(sprintf('Command "%s" is ambiguous (%s).', $name, $this->getAbbreviationSuggestions($aliases[$searchName])));
+        }
+
+        return $this->get($aliases[$searchName][0]);
+    }
+
+    /**
+     * Gets the commands (registered in the given namespace if provided).
+     *
+     * The array keys are the full names and the values the command instances.
+     *
+     * @param string $namespace A namespace name
+     *
+     * @return Command[] An array of Command instances
+     *
+     * @api
+     */
+    public function all($namespace = null)
+    {
+        if (null === $namespace) {
+            return $this->commands;
+        }
+
+        $commands = array();
+        foreach ($this->commands as $name => $command) {
+            if ($namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1)) {
+                $commands[$name] = $command;
+            }
+        }
+
+        return $commands;
+    }
+
+    /**
+     * Returns an array of possible abbreviations given a set of names.
+     *
+     * @param array $names An array of names
+     *
+     * @return array An array of abbreviations
+     */
+    public static function getAbbreviations($names)
+    {
+        $abbrevs = array();
+        foreach ($names as $name) {
+            for ($len = strlen($name); $len > 0; --$len) {
+                $abbrev = substr($name, 0, $len);
+                $abbrevs[$abbrev][] = $name;
+            }
+        }
+
+        return $abbrevs;
+    }
+
+    /**
+     * Returns a text representation of the Application.
+     *
+     * @param string  $namespace An optional namespace name
+     * @param boolean $raw       Whether to return raw command list
+     *
+     * @return string A string representing the Application
+     */
+    public function asText($namespace = null, $raw = false)
+    {
+        $commands = $namespace ? $this->all($this->findNamespace($namespace)) : $this->commands;
+
+        $width = 0;
+        foreach ($commands as $command) {
+            $width = strlen($command->getName()) > $width ? strlen($command->getName()) : $width;
+        }
+        $width += 2;
+
+        if ($raw) {
+            $messages = array();
+            foreach ($this->sortCommands($commands) as $space => $commands) {
+                foreach ($commands as $name => $command) {
+                    $messages[] = sprintf("%-${width}s %s", $name, $command->getDescription());
+                }
+            }
+
+            return implode(PHP_EOL, $messages);
+        }
+
+        $messages = array($this->getHelp(), '');
+        if ($namespace) {
+            $messages[] = sprintf("<comment>Available commands for the \"%s\" namespace:</comment>", $namespace);
+        } else {
+            $messages[] = '<comment>Available commands:</comment>';
+        }
+
+        // add commands by namespace
+        foreach ($this->sortCommands($commands) as $space => $commands) {
+            if (!$namespace && '_global' !== $space) {
+                $messages[] = '<comment>'.$space.'</comment>';
+            }
+
+            foreach ($commands as $name => $command) {
+                $messages[] = sprintf("  <info>%-${width}s</info> %s", $name, $command->getDescription());
+            }
+        }
+
+        return implode(PHP_EOL, $messages);
+    }
+
+    /**
+     * Returns an XML representation of the Application.
+     *
+     * @param string  $namespace An optional namespace name
+     * @param Boolean $asDom     Whether to return a DOM or an XML string
+     *
+     * @return string|DOMDocument An XML string representing the Application
+     */
+    public function asXml($namespace = null, $asDom = false)
+    {
+        $commands = $namespace ? $this->all($this->findNamespace($namespace)) : $this->commands;
+
+        $dom = new \DOMDocument('1.0', 'UTF-8');
+        $dom->formatOutput = true;
+        $dom->appendChild($xml = $dom->createElement('symfony'));
+
+        $xml->appendChild($commandsXML = $dom->createElement('commands'));
+
+        if ($namespace) {
+            $commandsXML->setAttribute('namespace', $namespace);
+        } else {
+            $namespacesXML = $dom->createElement('namespaces');
+            $xml->appendChild($namespacesXML);
+        }
+
+        // add commands by namespace
+        foreach ($this->sortCommands($commands) as $space => $commands) {
+            if (!$namespace) {
+                $namespaceArrayXML = $dom->createElement('namespace');
+                $namespacesXML->appendChild($namespaceArrayXML);
+                $namespaceArrayXML->setAttribute('id', $space);
+            }
+
+            foreach ($commands as $name => $command) {
+                if ($name !== $command->getName()) {
+                    continue;
+                }
+
+                if (!$namespace) {
+                    $commandXML = $dom->createElement('command');
+                    $namespaceArrayXML->appendChild($commandXML);
+                    $commandXML->appendChild($dom->createTextNode($name));
+                }
+
+                $node = $command->asXml(true)->getElementsByTagName('command')->item(0);
+                $node = $dom->importNode($node, true);
+
+                $commandsXML->appendChild($node);
+            }
+        }
+
+        return $asDom ? $dom : $dom->saveXml();
+    }
+
+    /**
+     * Renders a caught exception.
+     *
+     * @param Exception       $e      An exception instance
+     * @param OutputInterface $output An OutputInterface instance
+     */
+    public function renderException($e, $output)
+    {
+        $strlen = function ($string) {
+            if (!function_exists('mb_strlen')) {
+                return strlen($string);
+            }
+
+            if (false === $encoding = mb_detect_encoding($string)) {
+                return strlen($string);
+            }
+
+            return mb_strlen($string, $encoding);
+        };
+
+        do {
+            $title = sprintf('  [%s]  ', get_class($e));
+            $len = $strlen($title);
+            $width = $this->getTerminalWidth() ? $this->getTerminalWidth() - 1 : PHP_INT_MAX;
+            $lines = array();
+            foreach (preg_split('/\r?\n/', $e->getMessage()) as $line) {
+                foreach (str_split($line, $width - 4) as $line) {
+                    $lines[] = sprintf('  %s  ', $line);
+                    $len = max($strlen($line) + 4, $len);
+                }
+            }
+
+            $messages = array(str_repeat(' ', $len), $title.str_repeat(' ', max(0, $len - $strlen($title))));
+
+            foreach ($lines as $line) {
+                $messages[] = $line.str_repeat(' ', $len - $strlen($line));
+            }
+
+            $messages[] = str_repeat(' ', $len);
+
+            $output->writeln("");
+            $output->writeln("");
+            foreach ($messages as $message) {
+                $output->writeln('<error>'.$message.'</error>');
+            }
+            $output->writeln("");
+            $output->writeln("");
+
+            if (OutputInterface::VERBOSITY_VERBOSE === $output->getVerbosity()) {
+                $output->writeln('<comment>Exception trace:</comment>');
+
+                // exception related properties
+                $trace = $e->getTrace();
+                array_unshift($trace, array(
+                    'function' => '',
+                    'file'     => $e->getFile() != null ? $e->getFile() : 'n/a',
+                    'line'     => $e->getLine() != null ? $e->getLine() : 'n/a',
+                    'args'     => array(),
+                ));
+
+                for ($i = 0, $count = count($trace); $i < $count; $i++) {
+                    $class = isset($trace[$i]['class']) ? $trace[$i]['class'] : '';
+                    $type = isset($trace[$i]['type']) ? $trace[$i]['type'] : '';
+                    $function = $trace[$i]['function'];
+                    $file = isset($trace[$i]['file']) ? $trace[$i]['file'] : 'n/a';
+                    $line = isset($trace[$i]['line']) ? $trace[$i]['line'] : 'n/a';
+
+                    $output->writeln(sprintf(' %s%s%s() at <info>%s:%s</info>', $class, $type, $function, $file, $line));
+                }
+
+                $output->writeln("");
+                $output->writeln("");
+            }
+        } while ($e = $e->getPrevious());
+
+        if (null !== $this->runningCommand) {
+            $output->writeln(sprintf('<info>%s</info>', sprintf($this->runningCommand->getSynopsis(), $this->getName())));
+            $output->writeln("");
+            $output->writeln("");
+        }
+    }
+
+    /**
+     * Tries to figure out the terminal width in which this application runs
+     *
+     * @return int|null
+     */
+    protected function getTerminalWidth()
+    {
+        $dimensions = $this->getTerminalDimensions();
+
+        return $dimensions[0];
+    }
+
+    /**
+     * Tries to figure out the terminal height in which this application runs
+     *
+     * @return int|null
+     */
+    protected function getTerminalHeight()
+    {
+        $dimensions = $this->getTerminalDimensions();
+
+        return $dimensions[1];
+    }
+
+    /**
+     * Tries to figure out the terminal dimensions based on the current environment
+     *
+     * @return array Array containing width and height
+     */
+    public function getTerminalDimensions()
+    {
+        if (defined('PHP_WINDOWS_VERSION_BUILD')) {
+            // extract [w, H] from "wxh (WxH)"
+            if (preg_match('/^(\d+)x\d+ \(\d+x(\d+)\)$/', trim(getenv('ANSICON')), $matches)) {
+                return array((int) $matches[1], (int) $matches[2]);
+            }
+            // extract [w, h] from "wxh"
+            if (preg_match('/^(\d+)x(\d+)$/', $this->getConsoleMode(), $matches)) {
+                return array((int) $matches[1], (int) $matches[2]);
+            }
+        }
+
+        if ($sttyString = $this->getSttyColumns()) {
+            // extract [w, h] from "rows h; columns w;"
+            if (preg_match('/rows.(\d+);.columns.(\d+);/i', $sttyString, $matches)) {
+                return array((int) $matches[2], (int) $matches[1]);
+            }
+            // extract [w, h] from "; h rows; w columns"
+            if (preg_match('/;.(\d+).rows;.(\d+).columns/i', $sttyString, $matches)) {
+                return array((int) $matches[2], (int) $matches[1]);
+            }
+        }
+
+        return array(null, null);
+    }
+
+    /**
+     * Runs the current command.
+     *
+     * If an event dispatcher has been attached to the application,
+     * events are also dispatched during the life-cycle of the command.
+     *
+     * @param Command         $command A Command instance
+     * @param InputInterface  $input   An Input instance
+     * @param OutputInterface $output  An Output instance
+     *
+     * @return integer 0 if everything went fine, or an error code
+     */
+    protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
+    {
+        if (null === $this->dispatcher) {
+            return $command->run($input, $output);
+        }
+
+        $event = new ConsoleCommandEvent($command, $input, $output);
+        $this->dispatcher->dispatch(ConsoleEvents::COMMAND, $event);
+
+        try {
+            $exitCode = $command->run($input, $output);
+        } catch (\Exception $e) {
+            $event = new ConsoleTerminateEvent($command, $input, $output, $e->getCode());
+            $this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event);
+
+            $event = new ConsoleForExceptionEvent($command, $input, $output, $e, $event->getExitCode());
+            $this->dispatcher->dispatch(ConsoleEvents::EXCEPTION, $event);
+
+            throw $event->getException();
+        }
+
+        $event = new ConsoleTerminateEvent($command, $input, $output, $exitCode);
+        $this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event);
+
+        return $event->getExitCode();
+    }
+
+    /**
+     * Gets the name of the command based on input.
+     *
+     * @param InputInterface $input The input interface
+     *
+     * @return string The command name
+     */
+    protected function getCommandName(InputInterface $input)
+    {
+        return $input->getFirstArgument();
+    }
+
+    /**
+     * Gets the default input definition.
+     *
+     * @return InputDefinition An InputDefinition instance
+     */
+    protected function getDefaultInputDefinition()
+    {
+        return new InputDefinition(array(
+            new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'),
+
+            new InputOption('--help',           '-h', InputOption::VALUE_NONE, 'Display this help message.'),
+            new InputOption('--quiet',          '-q', InputOption::VALUE_NONE, 'Do not output any message.'),
+            new InputOption('--verbose',        '-v', InputOption::VALUE_NONE, 'Increase verbosity of messages.'),
+            new InputOption('--version',        '-V', InputOption::VALUE_NONE, 'Display this application version.'),
+            new InputOption('--ansi',           '',   InputOption::VALUE_NONE, 'Force ANSI output.'),
+            new InputOption('--no-ansi',        '',   InputOption::VALUE_NONE, 'Disable ANSI output.'),
+            new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question.'),
+        ));
+    }
+
+    /**
+     * Gets the default commands that should always be available.
+     *
+     * @return Command[] An array of default Command instances
+     */
+    protected function getDefaultCommands()
+    {
+        return array(new HelpCommand(), new ListCommand());
+    }
+
+    /**
+     * Gets the default helper set with the helpers that should always be available.
+     *
+     * @return HelperSet A HelperSet instance
+     */
+    protected function getDefaultHelperSet()
+    {
+        return new HelperSet(array(
+            new FormatterHelper(),
+            new DialogHelper(),
+            new ProgressHelper(),
+            new TableHelper(),
+        ));
+    }
+
+    /**
+     * Runs and parses stty -a if it's available, suppressing any error output
+     *
+     * @return string
+     */
+    private function getSttyColumns()
+    {
+        if (!function_exists('proc_open')) {
+            return;
+        }
+
+        $descriptorspec = array(1 => array('pipe', 'w'), 2 => array('pipe', 'w'));
+        $process = proc_open('stty -a | grep columns', $descriptorspec, $pipes, null, null, array('suppress_errors' => true));
+        if (is_resource($process)) {
+            $info = stream_get_contents($pipes[1]);
+            fclose($pipes[1]);
+            fclose($pipes[2]);
+            proc_close($process);
+
+            return $info;
+        }
+    }
+
+    /**
+     * Runs and parses mode CON if it's available, suppressing any error output
+     *
+     * @return string <width>x<height> or null if it could not be parsed
+     */
+    private function getConsoleMode()
+    {
+        if (!function_exists('proc_open')) {
+            return;
+        }
+
+        $descriptorspec = array(1 => array('pipe', 'w'), 2 => array('pipe', 'w'));
+        $process = proc_open('mode CON', $descriptorspec, $pipes, null, null, array('suppress_errors' => true));
+        if (is_resource($process)) {
+            $info = stream_get_contents($pipes[1]);
+            fclose($pipes[1]);
+            fclose($pipes[2]);
+            proc_close($process);
+
+            if (preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) {
+                return $matches[2].'x'.$matches[1];
+            }
+        }
+    }
+
+    /**
+     * Sorts commands in alphabetical order.
+     *
+     * @param array $commands An associative array of commands to sort
+     *
+     * @return array A sorted array of commands
+     */
+    private function sortCommands($commands)
+    {
+        $namespacedCommands = array();
+        foreach ($commands as $name => $command) {
+            $key = $this->extractNamespace($name, 1);
+            if (!$key) {
+                $key = '_global';
+            }
+
+            $namespacedCommands[$key][$name] = $command;
+        }
+        ksort($namespacedCommands);
+
+        foreach ($namespacedCommands as &$commands) {
+            ksort($commands);
+        }
+
+        return $namespacedCommands;
+    }
+
+    /**
+     * Returns abbreviated suggestions in string format.
+     *
+     * @param array $abbrevs Abbreviated suggestions to convert
+     *
+     * @return string A formatted string of abbreviated suggestions
+     */
+    private function getAbbreviationSuggestions($abbrevs)
+    {
+        return sprintf('%s, %s%s', $abbrevs[0], $abbrevs[1], count($abbrevs) > 2 ? sprintf(' and %d more', count($abbrevs) - 2) : '');
+    }
+
+    /**
+     * Returns the namespace part of the command name.
+     *
+     * @param string $name  The full name of the command
+     * @param string $limit The maximum number of parts of the namespace
+     *
+     * @return string The namespace of the command
+     */
+    private function extractNamespace($name, $limit = null)
+    {
+        $parts = explode(':', $name);
+        array_pop($parts);
+
+        return implode(':', null === $limit ? $parts : array_slice($parts, 0, $limit));
+    }
+
+    /**
+     * Finds alternative commands of $name
+     *
+     * @param string $name    The full name of the command
+     * @param array  $abbrevs The abbreviations
+     *
+     * @return array A sorted array of similar commands
+     */
+    private function findAlternativeCommands($name, $abbrevs)
+    {
+        $callback = function($item) {
+            return $item->getName();
+        };
+
+        return $this->findAlternatives($name, $this->commands, $abbrevs, $callback);
+    }
+
+    /**
+     * Finds alternative namespace of $name
+     *
+     * @param string $name    The full name of the namespace
+     * @param array  $abbrevs The abbreviations
+     *
+     * @return array A sorted array of similar namespace
+     */
+    private function findAlternativeNamespace($name, $abbrevs)
+    {
+        return $this->findAlternatives($name, $this->getNamespaces(), $abbrevs);
+    }
+
+    /**
+     * Finds alternative of $name among $collection,
+     * if nothing is found in $collection, try in $abbrevs
+     *
+     * @param string               $name       The string
+     * @param array|Traversable    $collection The collection
+     * @param array                $abbrevs    The abbreviations
+     * @param Closure|string|array $callback   The callable to transform collection item before comparison
+     *
+     * @return array A sorted array of similar string
+     */
+    private function findAlternatives($name, $collection, $abbrevs, $callback = null)
+    {
+        $alternatives = array();
+
+        foreach ($collection as $item) {
+            if (null !== $callback) {
+                $item = call_user_func($callback, $item);
+            }
+
+            $lev = levenshtein($name, $item);
+            if ($lev <= strlen($name) / 3 || false !== strpos($item, $name)) {
+                $alternatives[$item] = $lev;
+            }
+        }
+
+        if (!$alternatives) {
+            foreach ($abbrevs as $key => $values) {
+                $lev = levenshtein($name, $key);
+                if ($lev <= strlen($name) / 3 || false !== strpos($key, $name)) {
+                    foreach ($values as $value) {
+                        $alternatives[$value] = $lev;
+                    }
+                }
+            }
+        }
+
+        asort($alternatives);
+
+        return array_keys($alternatives);
+    }
+}

+ 35 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/CHANGELOG.md

@@ -0,0 +1,35 @@
+CHANGELOG
+=========
+
+2.3.0
+-----
+
+ * added Table Helper for tabular data rendering
+ * added support for events in `Application`
+ * added a way to normalize EOLs in `ApplicationTester::getDisplay()` and `CommandTester::getDisplay()`
+ * added a way to set the progress bar progress via the `setCurrent` method
+
+2.2.0
+-----
+
+ * added support for colorization on Windows via ConEmu
+ * add a method to Dialog Helper to ask for a question and hide the response
+ * added support for interactive selections in console (DialogHelper::select())
+ * added support for autocompletion as you type in Dialog Helper
+
+2.1.0
+-----
+
+ * added ConsoleOutputInterface
+ * added the possibility to disable a command (Command::isEnabled())
+ * added suggestions when a command does not exist
+ * added a --raw option to the list command
+ * added support for STDERR in the console output class (errors are now sent
+   to STDERR)
+ * made the defaults (helper set, commands, input definition) in Application
+   more easily customizable
+ * added support for the shell even if readline is not available
+ * added support for process isolation in Symfony shell via
+   `--process-isolation` switch
+ * added support for `--`, which disables options parsing after that point
+   (tokens will be parsed as arguments)

+ 638 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Command/Command.php

@@ -0,0 +1,638 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Command;
+
+use Symfony\Component\Console\Input\InputDefinition;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Helper\HelperSet;
+
+/**
+ * Base class for all commands.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @api
+ */
+class Command
+{
+    private $application;
+    private $name;
+    private $aliases;
+    private $definition;
+    private $help;
+    private $description;
+    private $ignoreValidationErrors;
+    private $applicationDefinitionMerged;
+    private $code;
+    private $synopsis;
+    private $helperSet;
+
+    /**
+     * Constructor.
+     *
+     * @param string $name The name of the command
+     *
+     * @throws \LogicException When the command name is empty
+     *
+     * @api
+     */
+    public function __construct($name = null)
+    {
+        $this->definition = new InputDefinition();
+        $this->ignoreValidationErrors = false;
+        $this->applicationDefinitionMerged = false;
+        $this->aliases = array();
+
+        if (null !== $name) {
+            $this->setName($name);
+        }
+
+        $this->configure();
+
+        if (!$this->name) {
+            throw new \LogicException('The command name cannot be empty.');
+        }
+    }
+
+    /**
+     * Ignores validation errors.
+     *
+     * This is mainly useful for the help command.
+     */
+    public function ignoreValidationErrors()
+    {
+        $this->ignoreValidationErrors = true;
+    }
+
+    /**
+     * Sets the application instance for this command.
+     *
+     * @param Application $application An Application instance
+     *
+     * @api
+     */
+    public function setApplication(Application $application = null)
+    {
+        $this->application = $application;
+        if ($application) {
+            $this->setHelperSet($application->getHelperSet());
+        } else {
+            $this->helperSet = null;
+        }
+    }
+
+    /**
+     * Sets the helper set.
+     *
+     * @param HelperSet $helperSet A HelperSet instance
+     */
+    public function setHelperSet(HelperSet $helperSet)
+    {
+        $this->helperSet = $helperSet;
+    }
+
+    /**
+     * Gets the helper set.
+     *
+     * @return HelperSet A HelperSet instance
+     */
+    public function getHelperSet()
+    {
+        return $this->helperSet;
+    }
+
+    /**
+     * Gets the application instance for this command.
+     *
+     * @return Application An Application instance
+     *
+     * @api
+     */
+    public function getApplication()
+    {
+        return $this->application;
+    }
+
+    /**
+     * Checks whether the command is enabled or not in the current environment
+     *
+     * Override this to check for x or y and return false if the command can not
+     * run properly under the current conditions.
+     *
+     * @return Boolean
+     */
+    public function isEnabled()
+    {
+        return true;
+    }
+
+    /**
+     * Configures the current command.
+     */
+    protected function configure()
+    {
+    }
+
+    /**
+     * Executes the current command.
+     *
+     * This method is not abstract because you can use this class
+     * as a concrete class. In this case, instead of defining the
+     * execute() method, you set the code to execute by passing
+     * a Closure to the setCode() method.
+     *
+     * @param InputInterface  $input  An InputInterface instance
+     * @param OutputInterface $output An OutputInterface instance
+     *
+     * @return null|integer null or 0 if everything went fine, or an error code
+     *
+     * @throws \LogicException When this abstract method is not implemented
+     * @see    setCode()
+     */
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+        throw new \LogicException('You must override the execute() method in the concrete command class.');
+    }
+
+    /**
+     * Interacts with the user.
+     *
+     * @param InputInterface  $input  An InputInterface instance
+     * @param OutputInterface $output An OutputInterface instance
+     */
+    protected function interact(InputInterface $input, OutputInterface $output)
+    {
+    }
+
+    /**
+     * Initializes the command just after the input has been validated.
+     *
+     * This is mainly useful when a lot of commands extends one main command
+     * where some things need to be initialized based on the input arguments and options.
+     *
+     * @param InputInterface  $input  An InputInterface instance
+     * @param OutputInterface $output An OutputInterface instance
+     */
+    protected function initialize(InputInterface $input, OutputInterface $output)
+    {
+    }
+
+    /**
+     * Runs the command.
+     *
+     * The code to execute is either defined directly with the
+     * setCode() method or by overriding the execute() method
+     * in a sub-class.
+     *
+     * @param InputInterface  $input  An InputInterface instance
+     * @param OutputInterface $output An OutputInterface instance
+     *
+     * @return integer The command exit code
+     *
+     * @throws \Exception
+     *
+     * @see setCode()
+     * @see execute()
+     *
+     * @api
+     */
+    public function run(InputInterface $input, OutputInterface $output)
+    {
+        // force the creation of the synopsis before the merge with the app definition
+        $this->getSynopsis();
+
+        // add the application arguments and options
+        $this->mergeApplicationDefinition();
+
+        // bind the input against the command specific arguments/options
+        try {
+            $input->bind($this->definition);
+        } catch (\Exception $e) {
+            if (!$this->ignoreValidationErrors) {
+                throw $e;
+            }
+        }
+
+        $this->initialize($input, $output);
+
+        if ($input->isInteractive()) {
+            $this->interact($input, $output);
+        }
+
+        $input->validate();
+
+        if ($this->code) {
+            $statusCode = call_user_func($this->code, $input, $output);
+        } else {
+            $statusCode = $this->execute($input, $output);
+        }
+
+        return is_numeric($statusCode) ? $statusCode : 0;
+    }
+
+    /**
+     * Sets the code to execute when running this command.
+     *
+     * If this method is used, it overrides the code defined
+     * in the execute() method.
+     *
+     * @param callable $code A callable(InputInterface $input, OutputInterface $output)
+     *
+     * @return Command The current instance
+     *
+     * @throws \InvalidArgumentException
+     *
+     * @see execute()
+     *
+     * @api
+     */
+    public function setCode($code)
+    {
+        if (!is_callable($code)) {
+            throw new \InvalidArgumentException('Invalid callable provided to Command::setCode.');
+        }
+
+        $this->code = $code;
+
+        return $this;
+    }
+
+    /**
+     * Merges the application definition with the command definition.
+     *
+     * @param Boolean $mergeArgs Whether to merge or not the Application definition arguments to Command definition arguments
+     */
+    private function mergeApplicationDefinition($mergeArgs = true)
+    {
+        if (null === $this->application || true === $this->applicationDefinitionMerged) {
+            return;
+        }
+
+        if ($mergeArgs) {
+            $currentArguments = $this->definition->getArguments();
+            $this->definition->setArguments($this->application->getDefinition()->getArguments());
+            $this->definition->addArguments($currentArguments);
+        }
+
+        $this->definition->addOptions($this->application->getDefinition()->getOptions());
+
+        $this->applicationDefinitionMerged = true;
+    }
+
+    /**
+     * Sets an array of argument and option instances.
+     *
+     * @param array|InputDefinition $definition An array of argument and option instances or a definition instance
+     *
+     * @return Command The current instance
+     *
+     * @api
+     */
+    public function setDefinition($definition)
+    {
+        if ($definition instanceof InputDefinition) {
+            $this->definition = $definition;
+        } else {
+            $this->definition->setDefinition($definition);
+        }
+
+        $this->applicationDefinitionMerged = false;
+
+        return $this;
+    }
+
+    /**
+     * Gets the InputDefinition attached to this Command.
+     *
+     * @return InputDefinition An InputDefinition instance
+     *
+     * @api
+     */
+    public function getDefinition()
+    {
+        return $this->definition;
+    }
+
+    /**
+     * Gets the InputDefinition to be used to create XML and Text representations of this Command.
+     *
+     * Can be overridden to provide the original command representation when it would otherwise
+     * be changed by merging with the application InputDefinition.
+     *
+     * @return InputDefinition An InputDefinition instance
+     */
+    protected function getNativeDefinition()
+    {
+        return $this->getDefinition();
+    }
+
+    /**
+     * Adds an argument.
+     *
+     * @param string  $name        The argument name
+     * @param integer $mode        The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
+     * @param string  $description A description text
+     * @param mixed   $default     The default value (for InputArgument::OPTIONAL mode only)
+     *
+     * @return Command The current instance
+     *
+     * @api
+     */
+    public function addArgument($name, $mode = null, $description = '', $default = null)
+    {
+        $this->definition->addArgument(new InputArgument($name, $mode, $description, $default));
+
+        return $this;
+    }
+
+    /**
+     * Adds an option.
+     *
+     * @param string  $name        The option name
+     * @param string  $shortcut    The shortcut (can be null)
+     * @param integer $mode        The option mode: One of the InputOption::VALUE_* constants
+     * @param string  $description A description text
+     * @param mixed   $default     The default value (must be null for InputOption::VALUE_REQUIRED or InputOption::VALUE_NONE)
+     *
+     * @return Command The current instance
+     *
+     * @api
+     */
+    public function addOption($name, $shortcut = null, $mode = null, $description = '', $default = null)
+    {
+        $this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default));
+
+        return $this;
+    }
+
+    /**
+     * Sets the name of the command.
+     *
+     * This method can set both the namespace and the name if
+     * you separate them by a colon (:)
+     *
+     *     $command->setName('foo:bar');
+     *
+     * @param string $name The command name
+     *
+     * @return Command The current instance
+     *
+     * @throws \InvalidArgumentException When command name given is empty
+     *
+     * @api
+     */
+    public function setName($name)
+    {
+        $this->validateName($name);
+
+        $this->name = $name;
+
+        return $this;
+    }
+
+    /**
+     * Returns the command name.
+     *
+     * @return string The command name
+     *
+     * @api
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * Sets the description for the command.
+     *
+     * @param string $description The description for the command
+     *
+     * @return Command The current instance
+     *
+     * @api
+     */
+    public function setDescription($description)
+    {
+        $this->description = $description;
+
+        return $this;
+    }
+
+    /**
+     * Returns the description for the command.
+     *
+     * @return string The description for the command
+     *
+     * @api
+     */
+    public function getDescription()
+    {
+        return $this->description;
+    }
+
+    /**
+     * Sets the help for the command.
+     *
+     * @param string $help The help for the command
+     *
+     * @return Command The current instance
+     *
+     * @api
+     */
+    public function setHelp($help)
+    {
+        $this->help = $help;
+
+        return $this;
+    }
+
+    /**
+     * Returns the help for the command.
+     *
+     * @return string The help for the command
+     *
+     * @api
+     */
+    public function getHelp()
+    {
+        return $this->help;
+    }
+
+    /**
+     * Returns the processed help for the command replacing the %command.name% and
+     * %command.full_name% patterns with the real values dynamically.
+     *
+     * @return string  The processed help for the command
+     */
+    public function getProcessedHelp()
+    {
+        $name = $this->name;
+
+        $placeholders = array(
+            '%command.name%',
+            '%command.full_name%'
+        );
+        $replacements = array(
+            $name,
+            $_SERVER['PHP_SELF'].' '.$name
+        );
+
+        return str_replace($placeholders, $replacements, $this->getHelp());
+    }
+
+    /**
+     * Sets the aliases for the command.
+     *
+     * @param array $aliases An array of aliases for the command
+     *
+     * @return Command The current instance
+     *
+     * @api
+     */
+    public function setAliases($aliases)
+    {
+        foreach ($aliases as $alias) {
+            $this->validateName($alias);
+        }
+
+        $this->aliases = $aliases;
+
+        return $this;
+    }
+
+    /**
+     * Returns the aliases for the command.
+     *
+     * @return array An array of aliases for the command
+     *
+     * @api
+     */
+    public function getAliases()
+    {
+        return $this->aliases;
+    }
+
+    /**
+     * Returns the synopsis for the command.
+     *
+     * @return string The synopsis
+     */
+    public function getSynopsis()
+    {
+        if (null === $this->synopsis) {
+            $this->synopsis = trim(sprintf('%s %s', $this->name, $this->definition->getSynopsis()));
+        }
+
+        return $this->synopsis;
+    }
+
+    /**
+     * Gets a helper instance by name.
+     *
+     * @param string $name The helper name
+     *
+     * @return mixed The helper value
+     *
+     * @throws \InvalidArgumentException if the helper is not defined
+     *
+     * @api
+     */
+    public function getHelper($name)
+    {
+        return $this->helperSet->get($name);
+    }
+
+    /**
+     * Returns a text representation of the command.
+     *
+     * @return string A string representing the command
+     */
+    public function asText()
+    {
+        if ($this->application && !$this->applicationDefinitionMerged) {
+            $this->getSynopsis();
+            $this->mergeApplicationDefinition(false);
+        }
+
+        $messages = array(
+            '<comment>Usage:</comment>',
+            ' '.$this->getSynopsis(),
+            '',
+        );
+
+        if ($this->getAliases()) {
+            $messages[] = '<comment>Aliases:</comment> <info>'.implode(', ', $this->getAliases()).'</info>';
+        }
+
+        $messages[] = $this->getNativeDefinition()->asText();
+
+        if ($help = $this->getProcessedHelp()) {
+            $messages[] = '<comment>Help:</comment>';
+            $messages[] = ' '.str_replace("\n", "\n ", $help)."\n";
+        }
+
+        return implode("\n", $messages);
+    }
+
+    /**
+     * Returns an XML representation of the command.
+     *
+     * @param Boolean $asDom Whether to return a DOM or an XML string
+     *
+     * @return string|DOMDocument An XML string representing the command
+     */
+    public function asXml($asDom = false)
+    {
+        if ($this->application && !$this->applicationDefinitionMerged) {
+            $this->getSynopsis();
+            $this->mergeApplicationDefinition(false);
+        }
+
+        $dom = new \DOMDocument('1.0', 'UTF-8');
+        $dom->formatOutput = true;
+        $dom->appendChild($commandXML = $dom->createElement('command'));
+        $commandXML->setAttribute('id', $this->name);
+        $commandXML->setAttribute('name', $this->name);
+
+        $commandXML->appendChild($usageXML = $dom->createElement('usage'));
+        $usageXML->appendChild($dom->createTextNode(sprintf($this->getSynopsis(), '')));
+
+        $commandXML->appendChild($descriptionXML = $dom->createElement('description'));
+        $descriptionXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $this->getDescription())));
+
+        $commandXML->appendChild($helpXML = $dom->createElement('help'));
+        $helpXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $this->getProcessedHelp())));
+
+        $commandXML->appendChild($aliasesXML = $dom->createElement('aliases'));
+        foreach ($this->getAliases() as $alias) {
+            $aliasesXML->appendChild($aliasXML = $dom->createElement('alias'));
+            $aliasXML->appendChild($dom->createTextNode($alias));
+        }
+
+        $definition = $this->getNativeDefinition()->asXml(true);
+        $commandXML->appendChild($dom->importNode($definition->getElementsByTagName('arguments')->item(0), true));
+        $commandXML->appendChild($dom->importNode($definition->getElementsByTagName('options')->item(0), true));
+
+        return $asDom ? $dom : $dom->saveXml();
+    }
+
+    private function validateName($name)
+    {
+        if (!preg_match('/^[^\:]+(\:[^\:]+)*$/', $name)) {
+            throw new \InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name));
+        }
+    }
+}

+ 85 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Command/HelpCommand.php

@@ -0,0 +1,85 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Command;
+
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Command\Command;
+
+/**
+ * HelpCommand displays the help for a given command.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+class HelpCommand extends Command
+{
+    private $command;
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function configure()
+    {
+        $this->ignoreValidationErrors();
+
+        $this
+            ->setName('help')
+            ->setDefinition(array(
+                new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'),
+                new InputOption('xml', null, InputOption::VALUE_NONE, 'To output help as XML'),
+            ))
+            ->setDescription('Displays help for a command')
+            ->setHelp(<<<EOF
+The <info>%command.name%</info> command displays help for a given command:
+
+  <info>php %command.full_name% list</info>
+
+You can also output the help as XML by using the <comment>--xml</comment> option:
+
+  <info>php %command.full_name% --xml list</info>
+
+To display the list of available commands, please use the <info>list</info> command.
+EOF
+            )
+        ;
+    }
+
+    /**
+     * Sets the command
+     *
+     * @param Command $command The command to set
+     */
+    public function setCommand(Command $command)
+    {
+        $this->command = $command;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+        if (null === $this->command) {
+            $this->command = $this->getApplication()->find($input->getArgument('command_name'));
+        }
+
+        if ($input->getOption('xml')) {
+            $output->writeln($this->command->asXml(), OutputInterface::OUTPUT_RAW);
+        } else {
+            $output->writeln($this->command->asText());
+        }
+
+        $this->command = null;
+    }
+}

+ 86 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Command/ListCommand.php

@@ -0,0 +1,86 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Command;
+
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputDefinition;
+
+/**
+ * ListCommand displays the list of all available commands for the application.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+class ListCommand extends Command
+{
+    /**
+     * {@inheritdoc}
+     */
+    protected function configure()
+    {
+        $this
+            ->setName('list')
+            ->setDefinition($this->createDefinition())
+            ->setDescription('Lists commands')
+            ->setHelp(<<<EOF
+The <info>%command.name%</info> command lists all commands:
+
+  <info>php %command.full_name%</info>
+
+You can also display the commands for a specific namespace:
+
+  <info>php %command.full_name% test</info>
+
+You can also output the information as XML by using the <comment>--xml</comment> option:
+
+  <info>php %command.full_name% --xml</info>
+
+It's also possible to get raw list of commands (useful for embedding command runner):
+
+  <info>php %command.full_name% --raw</info>
+EOF
+            )
+        ;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function getNativeDefinition()
+    {
+        return $this->createDefinition();
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+        if ($input->getOption('xml')) {
+            $output->writeln($this->getApplication()->asXml($input->getArgument('namespace')), OutputInterface::OUTPUT_RAW);
+        } else {
+            $output->writeln($this->getApplication()->asText($input->getArgument('namespace'), $input->getOption('raw')));
+        }
+    }
+
+    private function createDefinition()
+    {
+        return new InputDefinition(array(
+            new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'),
+            new InputOption('xml', null, InputOption::VALUE_NONE, 'To output help as XML'),
+            new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'),
+        ));
+    }
+}

+ 55 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/ConsoleEvents.php

@@ -0,0 +1,55 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console;
+
+/**
+ * Contains all events dispatched by an Application.
+ *
+ * @author Francesco Levorato <git@flevour.net>
+ */
+final class ConsoleEvents
+{
+    /**
+     * The COMMAND event allows you to attach listeners before any command is
+     * executed by the console. It also allows you to modify the command, input and output
+     * before they are handled to the command.
+     *
+     * The event listener method receives a Symfony\Component\Console\Event\ConsoleCommandEvent
+     * instance.
+     *
+     * @var string
+     */
+    const COMMAND = 'console.command';
+
+    /**
+     * The TERMINATE event allows you to attach listeners after a command is
+     * executed by the console.
+     *
+     * The event listener method receives a Symfony\Component\Console\Event\ConsoleTerminateEvent
+     * instance.
+     *
+     * @var string
+     */
+    const TERMINATE = 'console.terminate';
+
+    /**
+     * The EXCEPTION event occurs when an uncaught exception appears.
+     *
+     * This event allows you to deal with the exception or
+     * to modify the thrown exception. The event listener method receives
+     * a Symfony\Component\Console\Event\ConsoleForExceptionEvent
+     * instance.
+     *
+     * @var string
+     */
+    const EXCEPTION = 'console.exception';
+}

+ 25 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleCommandEvent.php

@@ -0,0 +1,25 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Event;
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * Allows to do things before the command is executed.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+class ConsoleCommandEvent extends ConsoleEvent
+{
+}

+ 67 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleEvent.php

@@ -0,0 +1,67 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Event;
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\EventDispatcher\Event;
+
+/**
+ * Allows to inspect input and output of a command.
+ *
+ * @author Francesco Levorato <git@flevour.net>
+ */
+class ConsoleEvent extends Event
+{
+    protected $command;
+
+    private $input;
+    private $output;
+
+    public function __construct(Command $command, InputInterface $input, OutputInterface $output)
+    {
+        $this->command = $command;
+        $this->input = $input;
+        $this->output = $output;
+    }
+
+    /**
+     * Gets the command that is executed.
+     *
+     * @return Command A Command instance
+     */
+    public function getCommand()
+    {
+        return $this->command;
+    }
+
+    /**
+     * Gets the input instance.
+     *
+     * @return InputInterface An InputInterface instance
+     */
+    public function getInput()
+    {
+        return $this->input;
+    }
+
+    /**
+     * Gets the output instance.
+     *
+     * @return OutputInterface An OutputInterface instance
+     */
+    public function getOutput()
+    {
+        return $this->output;
+    }
+}

+ 67 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleForExceptionEvent.php

@@ -0,0 +1,67 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Event;
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * Allows to handle exception thrown in a command.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+class ConsoleForExceptionEvent extends ConsoleEvent
+{
+    private $exception;
+    private $exitCode;
+
+    public function __construct(Command $command, InputInterface $input, OutputInterface $output, \Exception $exception, $exitCode)
+    {
+        parent::__construct($command, $input, $output);
+
+        $this->setException($exception);
+        $this->exitCode = $exitCode;
+    }
+
+    /**
+     * Returns the thrown exception.
+     *
+     * @return \Exception The thrown exception
+     */
+    public function getException()
+    {
+        return $this->exception;
+    }
+
+    /**
+     * Replaces the thrown exception.
+     *
+     * This exception will be thrown if no response is set in the event.
+     *
+     * @param \Exception $exception The thrown exception
+     */
+    public function setException(\Exception $exception)
+    {
+        $this->exception = $exception;
+    }
+
+    /**
+     * Gets the exit code.
+     *
+     * @return integer The command exit code
+     */
+    public function getExitCode()
+    {
+        return $this->exitCode;
+    }
+}

+ 58 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Event/ConsoleTerminateEvent.php

@@ -0,0 +1,58 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Event;
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * Allows to manipulate the exit code of a command after its execution.
+ *
+ * @author Francesco Levorato <git@flevour.net>
+ */
+class ConsoleTerminateEvent extends ConsoleEvent
+{
+    /**
+     * The exit code of the command.
+     *
+     * @var integer
+     */
+    private $exitCode;
+
+    public function __construct(Command $command, InputInterface $input, OutputInterface $output, $exitCode)
+    {
+        parent::__construct($command, $input, $output);
+
+        $this->setExitCode($exitCode);
+    }
+
+    /**
+     * Sets the exit code.
+     *
+     * @param integer $exitCode The command exit code
+     */
+    public function setExitCode($exitCode)
+    {
+        $this->exitCode = $exitCode;
+    }
+
+    /**
+     * Gets the exit code.
+     *
+     * @return integer The command exit code
+     */
+    public function getExitCode()
+    {
+        return $this->exitCode;
+    }
+}

+ 248 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatter.php

@@ -0,0 +1,248 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Formatter;
+
+/**
+ * Formatter class for console output.
+ *
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ *
+ * @api
+ */
+class OutputFormatter implements OutputFormatterInterface
+{
+    /**
+     * The pattern to phrase the format.
+     */
+    const FORMAT_PATTERN = '#(\\\\?)<(/?)([a-z][a-z0-9_=;-]+)?>((?: [^<\\\\]+ | (?!<(?:/?[a-z]|/>)). | .(?<=\\\\<) )*)#isx';
+
+    private $decorated;
+    private $styles = array();
+    private $styleStack;
+
+    /**
+     * Escapes "<" special char in given text.
+     *
+     * @param string $text Text to escape
+     *
+     * @return string Escaped text
+     */
+    public static function escape($text)
+    {
+        return preg_replace('/([^\\\\]?)</is', '$1\\<', $text);
+    }
+
+    /**
+     * Initializes console output formatter.
+     *
+     * @param Boolean          $decorated Whether this formatter should actually decorate strings
+     * @param FormatterStyle[] $styles    Array of "name => FormatterStyle" instances
+     *
+     * @api
+     */
+    public function __construct($decorated = null, array $styles = array())
+    {
+        $this->decorated = (Boolean) $decorated;
+
+        $this->setStyle('error', new OutputFormatterStyle('white', 'red'));
+        $this->setStyle('info', new OutputFormatterStyle('green'));
+        $this->setStyle('comment', new OutputFormatterStyle('yellow'));
+        $this->setStyle('question', new OutputFormatterStyle('black', 'cyan'));
+
+        foreach ($styles as $name => $style) {
+            $this->setStyle($name, $style);
+        }
+
+        $this->styleStack = new OutputFormatterStyleStack();
+    }
+
+    /**
+     * Sets the decorated flag.
+     *
+     * @param Boolean $decorated Whether to decorate the messages or not
+     *
+     * @api
+     */
+    public function setDecorated($decorated)
+    {
+        $this->decorated = (Boolean) $decorated;
+    }
+
+    /**
+     * Gets the decorated flag.
+     *
+     * @return Boolean true if the output will decorate messages, false otherwise
+     *
+     * @api
+     */
+    public function isDecorated()
+    {
+        return $this->decorated;
+    }
+
+    /**
+     * Sets a new style.
+     *
+     * @param string                        $name  The style name
+     * @param OutputFormatterStyleInterface $style The style instance
+     *
+     * @api
+     */
+    public function setStyle($name, OutputFormatterStyleInterface $style)
+    {
+        $this->styles[strtolower($name)] = $style;
+    }
+
+    /**
+     * Checks if output formatter has style with specified name.
+     *
+     * @param string $name
+     *
+     * @return Boolean
+     *
+     * @api
+     */
+    public function hasStyle($name)
+    {
+        return isset($this->styles[strtolower($name)]);
+    }
+
+    /**
+     * Gets style options from style with specified name.
+     *
+     * @param string $name
+     *
+     * @return OutputFormatterStyleInterface
+     *
+     * @throws \InvalidArgumentException When style isn't defined
+     *
+     * @api
+     */
+    public function getStyle($name)
+    {
+        if (!$this->hasStyle($name)) {
+            throw new \InvalidArgumentException(sprintf('Undefined style: %s', $name));
+        }
+
+        return $this->styles[strtolower($name)];
+    }
+
+    /**
+     * Formats a message according to the given styles.
+     *
+     * @param string $message The message to style
+     *
+     * @return string The styled message
+     *
+     * @api
+     */
+    public function format($message)
+    {
+        $message = preg_replace_callback(self::FORMAT_PATTERN, array($this, 'replaceStyle'), $message);
+
+        return str_replace('\\<', '<', $message);
+    }
+
+    /**
+     * @return OutputFormatterStyleStack
+     */
+    public function getStyleStack()
+    {
+        return $this->styleStack;
+    }
+
+    /**
+     * Replaces style of the output.
+     *
+     * @param array $match
+     *
+     * @return string The replaced style
+     */
+    private function replaceStyle($match)
+    {
+        // we got "\<" escaped char
+        if ('\\' === $match[1]) {
+            return $this->applyCurrentStyle($match[0]);
+        }
+
+        if ('' === $match[3]) {
+            if ('/' === $match[2]) {
+                // we got "</>" tag
+                $this->styleStack->pop();
+
+                return $this->applyCurrentStyle($match[4]);
+            }
+
+            // we got "<>" tag
+            return '<>'.$this->applyCurrentStyle($match[4]);
+        }
+
+        if (isset($this->styles[strtolower($match[3])])) {
+            $style = $this->styles[strtolower($match[3])];
+        } else {
+            $style = $this->createStyleFromString($match[3]);
+
+            if (false === $style) {
+                return $this->applyCurrentStyle($match[0]);
+            }
+        }
+
+        if ('/' === $match[2]) {
+            $this->styleStack->pop($style);
+        } else {
+            $this->styleStack->push($style);
+        }
+
+        return $this->applyCurrentStyle($match[4]);
+    }
+
+    /**
+     * Tries to create new style instance from string.
+     *
+     * @param string $string
+     *
+     * @return OutputFormatterStyle|Boolean false if string is not format string
+     */
+    private function createStyleFromString($string)
+    {
+        if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', strtolower($string), $matches, PREG_SET_ORDER)) {
+            return false;
+        }
+
+        $style = new OutputFormatterStyle();
+        foreach ($matches as $match) {
+            array_shift($match);
+
+            if ('fg' == $match[0]) {
+                $style->setForeground($match[1]);
+            } elseif ('bg' == $match[0]) {
+                $style->setBackground($match[1]);
+            } else {
+                $style->setOption($match[1]);
+            }
+        }
+
+        return $style;
+    }
+
+    /**
+     * Applies current style from stack to text, if must be applied.
+     *
+     * @param string $text Input text
+     *
+     * @return string string Styled text
+     */
+    private function applyCurrentStyle($text)
+    {
+        return $this->isDecorated() && strlen($text) > 0 ? $this->styleStack->getCurrent()->apply($text) : $text;
+    }
+}

+ 83 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterInterface.php

@@ -0,0 +1,83 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Formatter;
+
+/**
+ * Formatter interface for console output.
+ *
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ *
+ * @api
+ */
+interface OutputFormatterInterface
+{
+    /**
+     * Sets the decorated flag.
+     *
+     * @param Boolean $decorated Whether to decorate the messages or not
+     *
+     * @api
+     */
+    public function setDecorated($decorated);
+
+    /**
+     * Gets the decorated flag.
+     *
+     * @return Boolean true if the output will decorate messages, false otherwise
+     *
+     * @api
+     */
+    public function isDecorated();
+
+    /**
+     * Sets a new style.
+     *
+     * @param string                        $name  The style name
+     * @param OutputFormatterStyleInterface $style The style instance
+     *
+     * @api
+     */
+    public function setStyle($name, OutputFormatterStyleInterface $style);
+
+    /**
+     * Checks if output formatter has style with specified name.
+     *
+     * @param string $name
+     *
+     * @return Boolean
+     *
+     * @api
+     */
+    public function hasStyle($name);
+
+    /**
+     * Gets style options from style with specified name.
+     *
+     * @param string $name
+     *
+     * @return OutputFormatterStyleInterface
+     *
+     * @api
+     */
+    public function getStyle($name);
+
+    /**
+     * Formats a message according to the given styles.
+     *
+     * @param string $message The message to style
+     *
+     * @return string The styled message
+     *
+     * @api
+     */
+    public function format($message);
+}

+ 222 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyle.php

@@ -0,0 +1,222 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Formatter;
+
+/**
+ * Formatter style class for defining styles.
+ *
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ *
+ * @api
+ */
+class OutputFormatterStyle implements OutputFormatterStyleInterface
+{
+    private static $availableForegroundColors = array(
+        'black'     => 30,
+        'red'       => 31,
+        'green'     => 32,
+        'yellow'    => 33,
+        'blue'      => 34,
+        'magenta'   => 35,
+        'cyan'      => 36,
+        'white'     => 37
+    );
+    private static $availableBackgroundColors = array(
+        'black'     => 40,
+        'red'       => 41,
+        'green'     => 42,
+        'yellow'    => 43,
+        'blue'      => 44,
+        'magenta'   => 45,
+        'cyan'      => 46,
+        'white'     => 47
+    );
+    private static $availableOptions = array(
+        'bold'          => 1,
+        'underscore'    => 4,
+        'blink'         => 5,
+        'reverse'       => 7,
+        'conceal'       => 8
+    );
+
+    private $foreground;
+    private $background;
+    private $options = array();
+
+    /**
+     * Initializes output formatter style.
+     *
+     * @param string $foreground The style foreground color name
+     * @param string $background The style background color name
+     * @param array  $options    The style options
+     *
+     * @api
+     */
+    public function __construct($foreground = null, $background = null, array $options = array())
+    {
+        if (null !== $foreground) {
+            $this->setForeground($foreground);
+        }
+        if (null !== $background) {
+            $this->setBackground($background);
+        }
+        if (count($options)) {
+            $this->setOptions($options);
+        }
+    }
+
+    /**
+     * Sets style foreground color.
+     *
+     * @param string $color The color name
+     *
+     * @throws \InvalidArgumentException When the color name isn't defined
+     *
+     * @api
+     */
+    public function setForeground($color = null)
+    {
+        if (null === $color) {
+            $this->foreground = null;
+
+            return;
+        }
+
+        if (!isset(static::$availableForegroundColors[$color])) {
+            throw new \InvalidArgumentException(sprintf(
+                'Invalid foreground color specified: "%s". Expected one of (%s)',
+                $color,
+                implode(', ', array_keys(static::$availableForegroundColors))
+            ));
+        }
+
+        $this->foreground = static::$availableForegroundColors[$color];
+    }
+
+    /**
+     * Sets style background color.
+     *
+     * @param string $color The color name
+     *
+     * @throws \InvalidArgumentException When the color name isn't defined
+     *
+     * @api
+     */
+    public function setBackground($color = null)
+    {
+        if (null === $color) {
+            $this->background = null;
+
+            return;
+        }
+
+        if (!isset(static::$availableBackgroundColors[$color])) {
+            throw new \InvalidArgumentException(sprintf(
+                'Invalid background color specified: "%s". Expected one of (%s)',
+                $color,
+                implode(', ', array_keys(static::$availableBackgroundColors))
+            ));
+        }
+
+        $this->background = static::$availableBackgroundColors[$color];
+    }
+
+    /**
+     * Sets some specific style option.
+     *
+     * @param string $option The option name
+     *
+     * @throws \InvalidArgumentException When the option name isn't defined
+     *
+     * @api
+     */
+    public function setOption($option)
+    {
+        if (!isset(static::$availableOptions[$option])) {
+            throw new \InvalidArgumentException(sprintf(
+                'Invalid option specified: "%s". Expected one of (%s)',
+                $option,
+                implode(', ', array_keys(static::$availableOptions))
+            ));
+        }
+
+        if (false === array_search(static::$availableOptions[$option], $this->options)) {
+            $this->options[] = static::$availableOptions[$option];
+        }
+    }
+
+    /**
+     * Unsets some specific style option.
+     *
+     * @param string $option The option name
+     *
+     * @throws \InvalidArgumentException When the option name isn't defined
+     *
+     */
+    public function unsetOption($option)
+    {
+        if (!isset(static::$availableOptions[$option])) {
+            throw new \InvalidArgumentException(sprintf(
+                'Invalid option specified: "%s". Expected one of (%s)',
+                $option,
+                implode(', ', array_keys(static::$availableOptions))
+            ));
+        }
+
+        $pos = array_search(static::$availableOptions[$option], $this->options);
+        if (false !== $pos) {
+            unset($this->options[$pos]);
+        }
+    }
+
+    /**
+     * Sets multiple style options at once.
+     *
+     * @param array $options
+     */
+    public function setOptions(array $options)
+    {
+        $this->options = array();
+
+        foreach ($options as $option) {
+            $this->setOption($option);
+        }
+    }
+
+    /**
+     * Applies the style to a given text.
+     *
+     * @param string $text The text to style
+     *
+     * @return string
+     */
+    public function apply($text)
+    {
+        $codes = array();
+
+        if (null !== $this->foreground) {
+            $codes[] = $this->foreground;
+        }
+        if (null !== $this->background) {
+            $codes[] = $this->background;
+        }
+        if (count($this->options)) {
+            $codes = array_merge($codes, $this->options);
+        }
+
+        if (0 === count($codes)) {
+            return $text;
+        }
+
+        return sprintf("\033[%sm%s\033[0m", implode(';', $codes), $text);
+    }
+}

+ 72 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php

@@ -0,0 +1,72 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Formatter;
+
+/**
+ * Formatter style interface for defining styles.
+ *
+ * @author Konstantin Kudryashov <ever.zet@gmail.com>
+ *
+ * @api
+ */
+interface OutputFormatterStyleInterface
+{
+    /**
+     * Sets style foreground color.
+     *
+     * @param string $color The color name
+     *
+     * @api
+     */
+    public function setForeground($color = null);
+
+    /**
+     * Sets style background color.
+     *
+     * @param string $color The color name
+     *
+     * @api
+     */
+    public function setBackground($color = null);
+
+    /**
+     * Sets some specific style option.
+     *
+     * @param string $option The option name
+     *
+     * @api
+     */
+    public function setOption($option);
+
+    /**
+     * Unsets some specific style option.
+     *
+     * @param string $option The option name
+     */
+    public function unsetOption($option);
+
+    /**
+     * Sets multiple style options at once.
+     *
+     * @param array $options
+     */
+    public function setOptions(array $options);
+
+    /**
+     * Applies the style to a given text.
+     *
+     * @param string $text The text to style
+     *
+     * @return string
+     */
+    public function apply($text);
+}

+ 121 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php

@@ -0,0 +1,121 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Formatter;
+
+/**
+ * @author Jean-François Simon <contact@jfsimon.fr>
+ */
+class OutputFormatterStyleStack
+{
+    /**
+     * @var OutputFormatterStyleInterface[]
+     */
+    private $styles;
+
+    /**
+     * @var OutputFormatterStyleInterface
+     */
+    private $emptyStyle;
+
+    /**
+     * Constructor.
+     *
+     * @param OutputFormatterStyleInterface $emptyStyle
+     */
+    public function __construct(OutputFormatterStyleInterface $emptyStyle = null)
+    {
+        $this->emptyStyle = $emptyStyle ?: new OutputFormatterStyle();
+        $this->reset();
+    }
+
+    /**
+     * Resets stack (ie. empty internal arrays).
+     */
+    public function reset()
+    {
+        $this->styles = array();
+    }
+
+    /**
+     * Pushes a style in the stack.
+     *
+     * @param OutputFormatterStyleInterface $style
+     */
+    public function push(OutputFormatterStyleInterface $style)
+    {
+        $this->styles[] = $style;
+    }
+
+    /**
+     * Pops a style from the stack.
+     *
+     * @param OutputFormatterStyleInterface $style
+     *
+     * @return OutputFormatterStyleInterface
+     *
+     * @throws \InvalidArgumentException  When style tags incorrectly nested
+     */
+    public function pop(OutputFormatterStyleInterface $style = null)
+    {
+        if (empty($this->styles)) {
+            return $this->emptyStyle;
+        }
+
+        if (null === $style) {
+            return array_pop($this->styles);
+        }
+
+        foreach (array_reverse($this->styles, true) as $index => $stackedStyle) {
+            if ($style->apply('') === $stackedStyle->apply('')) {
+                $this->styles = array_slice($this->styles, 0, $index);
+
+                return $stackedStyle;
+            }
+        }
+
+        throw new \InvalidArgumentException('Incorrectly nested style tag found.');
+    }
+
+    /**
+     * Computes current style with stacks top codes.
+     *
+     * @return OutputFormatterStyle
+     */
+    public function getCurrent()
+    {
+        if (empty($this->styles)) {
+            return $this->emptyStyle;
+        }
+
+        return $this->styles[count($this->styles)-1];
+    }
+
+    /**
+     * @param OutputFormatterStyleInterface $emptyStyle
+     *
+     * @return OutputFormatterStyleStack
+     */
+    public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle)
+    {
+        $this->emptyStyle = $emptyStyle;
+
+        return $this;
+    }
+
+    /**
+     * @return OutputFormatterStyleInterface
+     */
+    public function getEmptyStyle()
+    {
+        return $this->emptyStyle;
+    }
+}

+ 444 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php

@@ -0,0 +1,444 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Helper;
+
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Formatter\OutputFormatterStyle;
+
+/**
+ * The Dialog class provides helpers to interact with the user.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+class DialogHelper extends Helper
+{
+    private $inputStream;
+    private static $shell;
+    private static $stty;
+
+    /**
+     * Asks the user to select a value.
+     *
+     * @param OutputInterface $output       An Output instance
+     * @param string|array    $question     The question to ask
+     * @param array           $choices      List of choices to pick from
+     * @param Boolean         $default      The default answer if the user enters nothing
+     * @param Boolean|integer $attempts Max number of times to ask before giving up (false by default, which means infinite)
+     * @param string          $errorMessage Message which will be shown if invalid value from choice list would be picked
+     *
+     * @return integer|string The selected value (the key of the choices array)
+     *
+     * @throws \InvalidArgumentException
+     */
+    public function select(OutputInterface $output, $question, $choices, $default = null, $attempts = false, $errorMessage = 'Value "%s" is invalid')
+    {
+        $width = max(array_map('strlen', array_keys($choices)));
+
+        $messages = (array) $question;
+        foreach ($choices as $key => $value) {
+            $messages[] = sprintf("  [<info>%-${width}s</info>] %s", $key, $value);
+        }
+
+        $output->writeln($messages);
+
+        $result = $this->askAndValidate($output, '> ', function ($picked) use ($choices, $errorMessage) {
+            if (empty($choices[$picked])) {
+                throw new \InvalidArgumentException(sprintf($errorMessage, $picked));
+            }
+
+            return $picked;
+        }, $attempts, $default);
+
+        return $result;
+    }
+
+    /**
+     * Asks a question to the user.
+     *
+     * @param OutputInterface $output       An Output instance
+     * @param string|array    $question     The question to ask
+     * @param string          $default      The default answer if none is given by the user
+     * @param array           $autocomplete List of values to autocomplete
+     *
+     * @return string The user answer
+     *
+     * @throws \RuntimeException If there is no data to read in the input stream
+     */
+    public function ask(OutputInterface $output, $question, $default = null, array $autocomplete = null)
+    {
+        $output->write($question);
+
+        $inputStream = $this->inputStream ?: STDIN;
+
+        if (null === $autocomplete || !$this->hasSttyAvailable()) {
+            $ret = fgets($inputStream, 4096);
+            if (false === $ret) {
+                throw new \RuntimeException('Aborted');
+            }
+            $ret = trim($ret);
+        } else {
+            $ret = '';
+
+            $i = 0;
+            $ofs = -1;
+            $matches = $autocomplete;
+            $numMatches = count($matches);
+
+            $sttyMode = shell_exec('stty -g');
+
+            // Disable icanon (so we can fread each keypress) and echo (we'll do echoing here instead)
+            shell_exec('stty -icanon -echo');
+
+            // Add highlighted text style
+            $output->getFormatter()->setStyle('hl', new OutputFormatterStyle('black', 'white'));
+
+            // Read a keypress
+            while ($c = fread($inputStream, 1)) {
+                // Backspace Character
+                if ("\177" === $c) {
+                    if (0 === $numMatches && 0 !== $i) {
+                        $i--;
+                        // Move cursor backwards
+                        $output->write("\033[1D");
+                    }
+
+                    if ($i === 0) {
+                        $ofs = -1;
+                        $matches = $autocomplete;
+                        $numMatches = count($matches);
+                    } else {
+                        $numMatches = 0;
+                    }
+
+                    // Pop the last character off the end of our string
+                    $ret = substr($ret, 0, $i);
+                } elseif ("\033" === $c) { // Did we read an escape sequence?
+                    $c .= fread($inputStream, 2);
+
+                    // A = Up Arrow. B = Down Arrow
+                    if ('A' === $c[2] || 'B' === $c[2]) {
+                        if ('A' === $c[2] && -1 === $ofs) {
+                            $ofs = 0;
+                        }
+
+                        if (0 === $numMatches) {
+                            continue;
+                        }
+
+                        $ofs += ('A' === $c[2]) ? -1 : 1;
+                        $ofs = ($numMatches + $ofs) % $numMatches;
+                    }
+                } elseif (ord($c) < 32) {
+                    if ("\t" === $c || "\n" === $c) {
+                        if ($numMatches > 0 && -1 !== $ofs) {
+                            $ret = $matches[$ofs];
+                            // Echo out remaining chars for current match
+                            $output->write(substr($ret, $i));
+                            $i = strlen($ret);
+                        }
+
+                        if ("\n" === $c) {
+                            $output->write($c);
+                            break;
+                        }
+
+                        $numMatches = 0;
+                    }
+
+                    continue;
+                } else {
+                    $output->write($c);
+                    $ret .= $c;
+                    $i++;
+
+                    $numMatches = 0;
+                    $ofs = 0;
+
+                    foreach ($autocomplete as $value) {
+                        // If typed characters match the beginning chunk of value (e.g. [AcmeDe]moBundle)
+                        if (0 === strpos($value, $ret) && $i !== strlen($value)) {
+                            $matches[$numMatches++] = $value;
+                        }
+                    }
+                }
+
+                // Erase characters from cursor to end of line
+                $output->write("\033[K");
+
+                if ($numMatches > 0 && -1 !== $ofs) {
+                    // Save cursor position
+                    $output->write("\0337");
+                    // Write highlighted text
+                    $output->write('<hl>'.substr($matches[$ofs], $i).'</hl>');
+                    // Restore cursor position
+                    $output->write("\0338");
+                }
+            }
+
+            // Reset stty so it behaves normally again
+            shell_exec(sprintf('stty %s', $sttyMode));
+        }
+
+        return strlen($ret) > 0 ? $ret : $default;
+    }
+
+    /**
+     * Asks a confirmation to the user.
+     *
+     * The question will be asked until the user answers by nothing, yes, or no.
+     *
+     * @param OutputInterface $output   An Output instance
+     * @param string|array    $question The question to ask
+     * @param Boolean         $default  The default answer if the user enters nothing
+     *
+     * @return Boolean true if the user has confirmed, false otherwise
+     */
+    public function askConfirmation(OutputInterface $output, $question, $default = true)
+    {
+        $answer = 'z';
+        while ($answer && !in_array(strtolower($answer[0]), array('y', 'n'))) {
+            $answer = $this->ask($output, $question);
+        }
+
+        if (false === $default) {
+            return $answer && 'y' == strtolower($answer[0]);
+        }
+
+        return !$answer || 'y' == strtolower($answer[0]);
+    }
+
+    /**
+     * Asks a question to the user, the response is hidden
+     *
+     * @param OutputInterface $output   An Output instance
+     * @param string|array    $question The question
+     * @param Boolean         $fallback In case the response can not be hidden, whether to fallback on non-hidden question or not
+     *
+     * @return string         The answer
+     *
+     * @throws \RuntimeException In case the fallback is deactivated and the response can not be hidden
+     */
+    public function askHiddenResponse(OutputInterface $output, $question, $fallback = true)
+    {
+        if (defined('PHP_WINDOWS_VERSION_BUILD')) {
+            $exe = __DIR__.'/../Resources/bin/hiddeninput.exe';
+
+            // handle code running from a phar
+            if ('phar:' === substr(__FILE__, 0, 5)) {
+                $tmpExe = sys_get_temp_dir().'/hiddeninput.exe';
+                copy($exe, $tmpExe);
+                $exe = $tmpExe;
+            }
+
+            $output->write($question);
+            $value = rtrim(shell_exec($exe));
+            $output->writeln('');
+
+            if (isset($tmpExe)) {
+                unlink($tmpExe);
+            }
+
+            return $value;
+        }
+
+        if ($this->hasSttyAvailable()) {
+            $output->write($question);
+
+            $sttyMode = shell_exec('stty -g');
+
+            shell_exec('stty -echo');
+            $value = fgets($this->inputStream ?: STDIN, 4096);
+            shell_exec(sprintf('stty %s', $sttyMode));
+
+            if (false === $value) {
+                throw new \RuntimeException('Aborted');
+            }
+
+            $value = trim($value);
+            $output->writeln('');
+
+            return $value;
+        }
+
+        if (false !== $shell = $this->getShell()) {
+            $output->write($question);
+            $readCmd = $shell === 'csh' ? 'set mypassword = $<' : 'read -r mypassword';
+            $command = sprintf("/usr/bin/env %s -c 'stty -echo; %s; stty echo; echo \$mypassword'", $shell, $readCmd);
+            $value = rtrim(shell_exec($command));
+            $output->writeln('');
+
+            return $value;
+        }
+
+        if ($fallback) {
+            return $this->ask($output, $question);
+        }
+
+        throw new \RuntimeException('Unable to hide the response');
+    }
+
+    /**
+     * Asks for a value and validates the response.
+     *
+     * The validator receives the data to validate. It must return the
+     * validated data when the data is valid and throw an exception
+     * otherwise.
+     *
+     * @param OutputInterface $output       An Output instance
+     * @param string|array    $question     The question to ask
+     * @param callable        $validator    A PHP callback
+     * @param integer         $attempts     Max number of times to ask before giving up (false by default, which means infinite)
+     * @param string          $default      The default answer if none is given by the user
+     * @param array           $autocomplete List of values to autocomplete
+     *
+     * @return mixed
+     *
+     * @throws \Exception When any of the validators return an error
+     */
+    public function askAndValidate(OutputInterface $output, $question, $validator, $attempts = false, $default = null, array $autocomplete = null)
+    {
+        $that = $this;
+
+        $interviewer = function() use ($output, $question, $default, $autocomplete, $that) {
+            return $that->ask($output, $question, $default, $autocomplete);
+        };
+
+        return $this->validateAttempts($interviewer, $output, $validator, $attempts);
+    }
+
+    /**
+     * Asks for a value, hide and validates the response.
+     *
+     * The validator receives the data to validate. It must return the
+     * validated data when the data is valid and throw an exception
+     * otherwise.
+     *
+     * @param OutputInterface $output    An Output instance
+     * @param string|array    $question  The question to ask
+     * @param callable        $validator A PHP callback
+     * @param integer         $attempts  Max number of times to ask before giving up (false by default, which means infinite)
+     * @param Boolean         $fallback  In case the response can not be hidden, whether to fallback on non-hidden question or not
+     *
+     * @return string         The response
+     *
+     * @throws \Exception        When any of the validators return an error
+     * @throws \RuntimeException In case the fallback is deactivated and the response can not be hidden
+     *
+     */
+    public function askHiddenResponseAndValidate(OutputInterface $output, $question, $validator, $attempts = false, $fallback = true)
+    {
+        $that = $this;
+
+        $interviewer = function() use ($output, $question, $fallback, $that) {
+            return $that->askHiddenResponse($output, $question, $fallback);
+        };
+
+        return $this->validateAttempts($interviewer, $output, $validator, $attempts);
+    }
+
+    /**
+     * Sets the input stream to read from when interacting with the user.
+     *
+     * This is mainly useful for testing purpose.
+     *
+     * @param resource $stream The input stream
+     */
+    public function setInputStream($stream)
+    {
+        $this->inputStream = $stream;
+    }
+
+    /**
+     * Returns the helper's input stream
+     *
+     * @return string
+     */
+    public function getInputStream()
+    {
+        return $this->inputStream;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function getName()
+    {
+        return 'dialog';
+    }
+
+    /**
+     * Return a valid unix shell
+     *
+     * @return string|Boolean  The valid shell name, false in case no valid shell is found
+     */
+    private function getShell()
+    {
+        if (null !== self::$shell) {
+            return self::$shell;
+        }
+
+        self::$shell = false;
+
+        if (file_exists('/usr/bin/env')) {
+            // handle other OSs with bash/zsh/ksh/csh if available to hide the answer
+            $test = "/usr/bin/env %s -c 'echo OK' 2> /dev/null";
+            foreach (array('bash', 'zsh', 'ksh', 'csh') as $sh) {
+                if ('OK' === rtrim(shell_exec(sprintf($test, $sh)))) {
+                    self::$shell = $sh;
+                    break;
+                }
+            }
+        }
+
+        return self::$shell;
+    }
+
+    private function hasSttyAvailable()
+    {
+        if (null !== self::$stty) {
+            return self::$stty;
+        }
+
+        exec('stty 2>&1', $output, $exitcode);
+
+        return self::$stty = $exitcode === 0;
+    }
+
+    /**
+     * Validate an attempt
+     *
+     * @param callable         $interviewer  A callable that will ask for a question and return the result
+     * @param OutputInterface  $output       An Output instance
+     * @param callable         $validator    A PHP callback
+     * @param integer          $attempts     Max number of times to ask before giving up ; false will ask infinitely
+     *
+     * @return string   The validated response
+     *
+     * @throws \Exception In case the max number of attempts has been reached and no valid response has been given
+     */
+    private function validateAttempts($interviewer, OutputInterface $output, $validator, $attempts)
+    {
+        $error = null;
+        while (false === $attempts || $attempts--) {
+            if (null !== $error) {
+                $output->writeln($this->getHelperSet()->get('formatter')->formatBlock($error->getMessage(), 'error'));
+            }
+
+            try {
+                return call_user_func($validator, $interviewer());
+            } catch (\Exception $error) {
+            }
+        }
+
+        throw $error;
+    }
+}

+ 80 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Helper/FormatterHelper.php

@@ -0,0 +1,80 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Helper;
+
+use Symfony\Component\Console\Formatter\OutputFormatter;
+
+/**
+ * The Formatter class provides helpers to format messages.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+class FormatterHelper extends Helper
+{
+    /**
+     * Formats a message within a section.
+     *
+     * @param string $section The section name
+     * @param string $message The message
+     * @param string $style   The style to apply to the section
+     *
+     * @return string The format section
+     */
+    public function formatSection($section, $message, $style = 'info')
+    {
+        return sprintf('<%s>[%s]</%s> %s', $style, $section, $style, $message);
+    }
+
+    /**
+     * Formats a message as a block of text.
+     *
+     * @param string|array $messages The message to write in the block
+     * @param string       $style    The style to apply to the whole block
+     * @param Boolean      $large    Whether to return a large block
+     *
+     * @return string The formatter message
+     */
+    public function formatBlock($messages, $style, $large = false)
+    {
+        $messages = (array) $messages;
+
+        $len = 0;
+        $lines = array();
+        foreach ($messages as $message) {
+            $message = OutputFormatter::escape($message);
+            $lines[] = sprintf($large ? '  %s  ' : ' %s ', $message);
+            $len = max($this->strlen($message) + ($large ? 4 : 2), $len);
+        }
+
+        $messages = $large ? array(str_repeat(' ', $len)) : array();
+        foreach ($lines as $line) {
+            $messages[] = $line.str_repeat(' ', $len - $this->strlen($line));
+        }
+        if ($large) {
+            $messages[] = str_repeat(' ', $len);
+        }
+
+        foreach ($messages as &$message) {
+            $message = sprintf('<%s>%s</%s>', $style, $message, $style);
+        }
+
+        return implode("\n", $messages);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function getName()
+    {
+        return 'formatter';
+    }
+}

+ 62 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Helper/Helper.php

@@ -0,0 +1,62 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Helper;
+
+/**
+ * Helper is the base class for all helper classes.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+abstract class Helper implements HelperInterface
+{
+    protected $helperSet = null;
+
+    /**
+     * Sets the helper set associated with this helper.
+     *
+     * @param HelperSet $helperSet A HelperSet instance
+     */
+    public function setHelperSet(HelperSet $helperSet = null)
+    {
+        $this->helperSet = $helperSet;
+    }
+
+    /**
+     * Gets the helper set associated with this helper.
+     *
+     * @return HelperSet A HelperSet instance
+     */
+    public function getHelperSet()
+    {
+        return $this->helperSet;
+    }
+
+    /**
+     * Returns the length of a string, using mb_strlen if it is available.
+     *
+     * @param string $string The string to check its length
+     *
+     * @return integer The length of the string
+     */
+    protected function strlen($string)
+    {
+        if (!function_exists('mb_strlen')) {
+            return strlen($string);
+        }
+
+        if (false === $encoding = mb_detect_encoding($string)) {
+            return strlen($string);
+        }
+
+        return mb_strlen($string, $encoding);
+    }
+}

+ 49 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Helper/HelperInterface.php

@@ -0,0 +1,49 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Helper;
+
+/**
+ * HelperInterface is the interface all helpers must implement.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @api
+ */
+interface HelperInterface
+{
+    /**
+     * Sets the helper set associated with this helper.
+     *
+     * @param HelperSet $helperSet A HelperSet instance
+     *
+     * @api
+     */
+    public function setHelperSet(HelperSet $helperSet = null);
+
+    /**
+     * Gets the helper set associated with this helper.
+     *
+     * @return HelperSet A HelperSet instance
+     *
+     * @api
+     */
+    public function getHelperSet();
+
+    /**
+     * Returns the canonical name of this helper.
+     *
+     * @return string The canonical name
+     *
+     * @api
+     */
+    public function getName();
+}

+ 104 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Helper/HelperSet.php

@@ -0,0 +1,104 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Helper;
+
+use Symfony\Component\Console\Command\Command;
+
+/**
+ * HelperSet represents a set of helpers to be used with a command.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+class HelperSet
+{
+    private $helpers;
+    private $command;
+
+    /**
+     * Constructor.
+     *
+     * @param Helper[] $helpers An array of helper.
+     */
+    public function __construct(array $helpers = array())
+    {
+        $this->helpers = array();
+        foreach ($helpers as $alias => $helper) {
+            $this->set($helper, is_int($alias) ? null : $alias);
+        }
+    }
+
+    /**
+     * Sets a helper.
+     *
+     * @param HelperInterface $helper The helper instance
+     * @param string          $alias  An alias
+     */
+    public function set(HelperInterface $helper, $alias = null)
+    {
+        $this->helpers[$helper->getName()] = $helper;
+        if (null !== $alias) {
+            $this->helpers[$alias] = $helper;
+        }
+
+        $helper->setHelperSet($this);
+    }
+
+    /**
+     * Returns true if the helper if defined.
+     *
+     * @param string $name The helper name
+     *
+     * @return Boolean true if the helper is defined, false otherwise
+     */
+    public function has($name)
+    {
+        return isset($this->helpers[$name]);
+    }
+
+    /**
+     * Gets a helper value.
+     *
+     * @param string $name The helper name
+     *
+     * @return HelperInterface The helper instance
+     *
+     * @throws \InvalidArgumentException if the helper is not defined
+     */
+    public function get($name)
+    {
+        if (!$this->has($name)) {
+            throw new \InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name));
+        }
+
+        return $this->helpers[$name];
+    }
+
+    /**
+     * Sets the command associated with this helper set.
+     *
+     * @param Command $command A Command instance
+     */
+    public function setCommand(Command $command = null)
+    {
+        $this->command = $command;
+    }
+
+    /**
+     * Gets the command associated with this helper set.
+     *
+     * @return Command A Command instance
+     */
+    public function getCommand()
+    {
+        return $this->command;
+    }
+}

+ 443 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Helper/ProgressHelper.php

@@ -0,0 +1,443 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Helper;
+
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * The Progress class provides helpers to display progress output.
+ *
+ * @author Chris Jones <leeked@gmail.com>
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+class ProgressHelper extends Helper
+{
+    const FORMAT_QUIET         = ' %percent%%';
+    const FORMAT_NORMAL        = ' %current%/%max% [%bar%] %percent%%';
+    const FORMAT_VERBOSE       = ' %current%/%max% [%bar%] %percent%% Elapsed: %elapsed%';
+    const FORMAT_QUIET_NOMAX   = ' %current%';
+    const FORMAT_NORMAL_NOMAX  = ' %current% [%bar%]';
+    const FORMAT_VERBOSE_NOMAX = ' %current% [%bar%] Elapsed: %elapsed%';
+
+    // options
+    private $barWidth     = 28;
+    private $barChar      = '=';
+    private $emptyBarChar = '-';
+    private $progressChar = '>';
+    private $format       = null;
+    private $redrawFreq   = 1;
+
+    private $lastMessagesLength;
+    private $barCharOriginal;
+
+    /**
+     * @var OutputInterface
+     */
+    private $output;
+
+    /**
+     * Current step
+     *
+     * @var integer
+     */
+    private $current;
+
+    /**
+     * Maximum number of steps
+     *
+     * @var integer
+     */
+    private $max;
+
+    /**
+     * Start time of the progress bar
+     *
+     * @var integer
+     */
+    private $startTime;
+
+    /**
+     * List of formatting variables
+     *
+     * @var array
+     */
+    private $defaultFormatVars = array(
+        'current',
+        'max',
+        'bar',
+        'percent',
+        'elapsed',
+    );
+
+    /**
+     * Available formatting variables
+     *
+     * @var array
+     */
+    private $formatVars;
+
+    /**
+     * Stored format part widths (used for padding)
+     *
+     * @var array
+     */
+    private $widths = array(
+        'current' => 4,
+        'max'     => 4,
+        'percent' => 3,
+        'elapsed' => 6,
+    );
+
+    /**
+     * Various time formats
+     *
+     * @var array
+     */
+    private $timeFormats = array(
+        array(0, '???'),
+        array(2, '1 sec'),
+        array(59, 'secs', 1),
+        array(60, '1 min'),
+        array(3600, 'mins', 60),
+        array(5400, '1 hr'),
+        array(86400, 'hrs', 3600),
+        array(129600, '1 day'),
+        array(604800, 'days', 86400),
+    );
+
+    /**
+     * Sets the progress bar width.
+     *
+     * @param int $size The progress bar size
+     */
+    public function setBarWidth($size)
+    {
+        $this->barWidth = (int) $size;
+    }
+
+    /**
+     * Sets the bar character.
+     *
+     * @param string $char A character
+     */
+    public function setBarCharacter($char)
+    {
+        $this->barChar = $char;
+    }
+
+    /**
+     * Sets the empty bar character.
+     *
+     * @param string $char A character
+     */
+    public function setEmptyBarCharacter($char)
+    {
+        $this->emptyBarChar = $char;
+    }
+
+    /**
+     * Sets the progress bar character.
+     *
+     * @param string $char A character
+     */
+    public function setProgressCharacter($char)
+    {
+        $this->progressChar = $char;
+    }
+
+    /**
+     * Sets the progress bar format.
+     *
+     * @param string $format The format
+     */
+    public function setFormat($format)
+    {
+        $this->format = $format;
+    }
+
+    /**
+     * Sets the redraw frequency.
+     *
+     * @param int $freq The frequency in seconds
+     */
+    public function setRedrawFrequency($freq)
+    {
+        $this->redrawFreq = (int) $freq;
+    }
+
+    /**
+     * Starts the progress output.
+     *
+     * @param OutputInterface $output An Output instance
+     * @param integer         $max    Maximum steps
+     */
+    public function start(OutputInterface $output, $max = null)
+    {
+        $this->startTime = time();
+        $this->current   = 0;
+        $this->max       = (int) $max;
+        $this->output    = $output;
+
+        if (null === $this->format) {
+            switch ($output->getVerbosity()) {
+                case OutputInterface::VERBOSITY_QUIET:
+                    $this->format = self::FORMAT_QUIET_NOMAX;
+                    if ($this->max > 0) {
+                        $this->format = self::FORMAT_QUIET;
+                    }
+                    break;
+                case OutputInterface::VERBOSITY_VERBOSE:
+                    $this->format = self::FORMAT_VERBOSE_NOMAX;
+                    if ($this->max > 0) {
+                        $this->format = self::FORMAT_VERBOSE;
+                    }
+                    break;
+                default:
+                    $this->format = self::FORMAT_NORMAL_NOMAX;
+                    if ($this->max > 0) {
+                        $this->format = self::FORMAT_NORMAL;
+                    }
+                    break;
+            }
+        }
+
+        $this->initialize();
+    }
+
+    /**
+     * Advances the progress output X steps.
+     *
+     * @param integer $step   Number of steps to advance
+     * @param Boolean $redraw Whether to redraw or not
+     *
+     * @throws \LogicException
+     */
+    public function advance($step = 1, $redraw = false)
+    {
+        if (null === $this->startTime) {
+            throw new \LogicException('You must start the progress bar before calling advance().');
+        }
+
+        if (0 === $this->current) {
+            $redraw = true;
+        }
+
+        $this->current += $step;
+        if ($redraw || 0 === $this->current % $this->redrawFreq) {
+            $this->display();
+        }
+    }
+
+    /**
+     * Sets the current progress.
+     *
+     * @param integer $current The current progress
+     * @param Boolean $redraw  Whether to redraw or not
+     *
+     * @throws \LogicException
+     */
+    public function setCurrent($current, $redraw = false)
+    {
+        if (null === $this->startTime) {
+            throw new \LogicException('You must start the progress bar before calling setCurrent().');
+        }
+
+        $current = (int) $current;
+
+        if ($current < $this->current) {
+            throw new \LogicException('You can\'t regress the progress bar');
+        }
+
+        if (0 === $this->current) {
+            $redraw = true;
+        }
+
+        $this->current = $current;
+        if ($redraw || 0 === $this->current % $this->redrawFreq) {
+            $this->display();
+        }
+    }
+
+    /**
+     * Outputs the current progress string.
+     *
+     * @param Boolean $finish Forces the end result
+     *
+     * @throws \LogicException
+     */
+    public function display($finish = false)
+    {
+        if (null === $this->startTime) {
+            throw new \LogicException('You must start the progress bar before calling display().');
+        }
+
+        $message = $this->format;
+        foreach ($this->generate($finish) as $name => $value) {
+            $message = str_replace("%{$name}%", $value, $message);
+        }
+        $this->overwrite($this->output, $message);
+    }
+
+    /**
+     * Finishes the progress output.
+     */
+    public function finish()
+    {
+        if (null === $this->startTime) {
+            throw new \LogicException('You must start the progress bar before calling finish().');
+        }
+
+        if (null !== $this->startTime) {
+            if (!$this->max) {
+                $this->barChar = $this->barCharOriginal;
+                $this->display(true);
+            }
+            $this->startTime = null;
+            $this->output->writeln('');
+            $this->output = null;
+        }
+    }
+
+    /**
+     * Initializes the progress helper.
+     */
+    private function initialize()
+    {
+        $this->formatVars = array();
+        foreach ($this->defaultFormatVars as $var) {
+            if (false !== strpos($this->format, "%{$var}%")) {
+                $this->formatVars[$var] = true;
+            }
+        }
+
+        if ($this->max > 0) {
+            $this->widths['max']     = $this->strlen($this->max);
+            $this->widths['current'] = $this->widths['max'];
+        } else {
+            $this->barCharOriginal = $this->barChar;
+            $this->barChar         = $this->emptyBarChar;
+        }
+    }
+
+    /**
+     * Generates the array map of format variables to values.
+     *
+     * @param Boolean $finish Forces the end result
+     *
+     * @return array Array of format vars and values
+     */
+    private function generate($finish = false)
+    {
+        $vars    = array();
+        $percent = 0;
+        if ($this->max > 0) {
+            $percent = (double) round($this->current / $this->max, 2);
+        }
+
+        if (isset($this->formatVars['bar'])) {
+            $completeBars = 0;
+            $emptyBars = 0;
+            if ($this->max > 0) {
+                $completeBars = floor($percent * $this->barWidth);
+            } else {
+                if (!$finish) {
+                    $completeBars = floor($this->current % $this->barWidth);
+                } else {
+                    $completeBars = $this->barWidth;
+                }
+            }
+
+            $emptyBars = $this->barWidth - $completeBars - $this->strlen($this->progressChar);
+            $bar = str_repeat($this->barChar, $completeBars);
+            if ($completeBars < $this->barWidth) {
+                $bar .= $this->progressChar;
+                $bar .= str_repeat($this->emptyBarChar, $emptyBars);
+            }
+
+            $vars['bar'] = $bar;
+        }
+
+        if (isset($this->formatVars['elapsed'])) {
+            $elapsed = time() - $this->startTime;
+            $vars['elapsed'] = str_pad($this->humaneTime($elapsed), $this->widths['elapsed'], ' ', STR_PAD_LEFT);
+        }
+
+        if (isset($this->formatVars['current'])) {
+            $vars['current'] = str_pad($this->current, $this->widths['current'], ' ', STR_PAD_LEFT);
+        }
+
+        if (isset($this->formatVars['max'])) {
+            $vars['max'] = $this->max;
+        }
+
+        if (isset($this->formatVars['percent'])) {
+            $vars['percent'] = str_pad($percent * 100, $this->widths['percent'], ' ', STR_PAD_LEFT);
+        }
+
+        return $vars;
+    }
+
+    /**
+     * Converts seconds into human-readable format.
+     *
+     * @param integer $secs Number of seconds
+     *
+     * @return string Time in readable format
+     */
+    private function humaneTime($secs)
+    {
+        $text = '';
+        foreach ($this->timeFormats as $format) {
+            if ($secs < $format[0]) {
+                if (count($format) == 2) {
+                    $text = $format[1];
+                    break;
+                } else {
+                    $text = ceil($secs / $format[2]).' '.$format[1];
+                    break;
+                }
+            }
+        }
+
+        return $text;
+    }
+
+    /**
+     * Overwrites a previous message to the output.
+     *
+     * @param OutputInterface $output   An Output instance
+     * @param string          $messages The message
+     */
+    private function overwrite(OutputInterface $output, $message)
+    {
+        $length = $this->strlen($message);
+
+        // append whitespace to match the last line's length
+        if (null !== $this->lastMessagesLength && $this->lastMessagesLength > $length) {
+            $message = str_pad($message, $this->lastMessagesLength, "\x20", STR_PAD_RIGHT);
+        }
+
+        // carriage return
+        $output->write("\x0D");
+        $output->write($message);
+
+        $this->lastMessagesLength = $this->strlen($message);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function getName()
+    {
+        return 'progress';
+    }
+}

+ 453 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Helper/TableHelper.php

@@ -0,0 +1,453 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Helper;
+
+use Symfony\Component\Console\Output\OutputInterface;
+use InvalidArgumentException;
+
+/**
+ * Provides helpers to display table output.
+ *
+ * @author Саша Стаменковић <umpirsky@gmail.com>
+ */
+class TableHelper extends Helper
+{
+    const LAYOUT_DEFAULT = 0;
+    const LAYOUT_BORDERLESS = 1;
+
+    /**
+     * Table headers.
+     *
+     * @var array
+     */
+    private $headers = array();
+
+    /**
+     * Table rows.
+     *
+     * @var array
+     */
+    private $rows = array();
+
+    // Rendering options
+    private $paddingChar;
+    private $horizontalBorderChar;
+    private $verticalBorderChar;
+    private $crossingChar;
+    private $cellHeaderFormat;
+    private $cellRowFormat;
+    private $borderFormat;
+    private $padType;
+
+    /**
+     * Column widths cache.
+     *
+     * @var array
+     */
+    private $columnWidths = array();
+
+    /**
+     * Number of columns cache.
+     *
+     * @var array
+     */
+    private $numberOfColumns;
+
+    /**
+     * @var OutputInterface
+     */
+    private $output;
+
+    public function __construct()
+    {
+        $this->setLayout(self::LAYOUT_DEFAULT);
+    }
+
+    /**
+     * Sets table layout type.
+     *
+     * @param int $layout self::LAYOUT_*
+     *
+     * @return TableHelper
+     */
+    public function setLayout($layout)
+    {
+        switch ($layout) {
+            case self::LAYOUT_BORDERLESS:
+                $this
+                    ->setPaddingChar(' ')
+                    ->setHorizontalBorderChar('=')
+                    ->setVerticalBorderChar(' ')
+                    ->setCrossingChar(' ')
+                    ->setCellHeaderFormat('<info>%s</info>')
+                    ->setCellRowFormat('<comment>%s</comment>')
+                    ->setBorderFormat('%s')
+                    ->setPadType(STR_PAD_RIGHT)
+                ;
+                break;
+
+            case self::LAYOUT_DEFAULT:
+                $this
+                    ->setPaddingChar(' ')
+                    ->setHorizontalBorderChar('-')
+                    ->setVerticalBorderChar('|')
+                    ->setCrossingChar('+')
+                    ->setCellHeaderFormat('<info>%s</info>')
+                    ->setCellRowFormat('<comment>%s</comment>')
+                    ->setBorderFormat('%s')
+                    ->setPadType(STR_PAD_RIGHT)
+                ;
+                break;
+
+            default:
+                throw new InvalidArgumentException(sprintf('Invalid table layout "%s".', $layout));
+                break;
+        };
+
+        return $this;
+    }
+
+    public function setHeaders(array $headers)
+    {
+        $this->headers = array_values($headers);
+
+        return $this;
+    }
+
+    public function setRows(array $rows)
+    {
+        $this->rows = array();
+
+        return $this->addRows($rows);
+    }
+
+    public function addRows(array $rows)
+    {
+        foreach ($rows as $row) {
+            $this->addRow($row);
+        }
+
+        return $this;
+    }
+
+    public function addRow(array $row)
+    {
+        $this->rows[] = array_values($row);
+
+        return $this;
+    }
+
+    public function setRow($column, array $row)
+    {
+        $this->rows[$column] = $row;
+
+        return $this;
+    }
+
+    /**
+     * Sets padding character, used for cell padding.
+     *
+     * @param string $paddingChar
+     *
+     * @return TableHelper
+     */
+    public function setPaddingChar($paddingChar)
+    {
+        $this->paddingChar = $paddingChar;
+
+        return $this;
+    }
+
+    /**
+     * Sets horizontal border character.
+     *
+     * @param string $horizontalBorderChar
+     *
+     * @return TableHelper
+     */
+    public function setHorizontalBorderChar($horizontalBorderChar)
+    {
+        $this->horizontalBorderChar = $horizontalBorderChar;
+
+        return $this;
+    }
+
+    /**
+     * Sets vertical border character.
+     *
+     * @param string $verticalBorderChar
+     *
+     * @return TableHelper
+     */
+    public function setVerticalBorderChar($verticalBorderChar)
+    {
+        $this->verticalBorderChar = $verticalBorderChar;
+
+        return $this;
+    }
+
+    /**
+     * Sets crossing character.
+     *
+     * @param string $crossingChar
+     *
+     * @return TableHelper
+     */
+    public function setCrossingChar($crossingChar)
+    {
+        $this->crossingChar = $crossingChar;
+
+        return $this;
+    }
+
+    /**
+     * Sets header cell format.
+     *
+     * @param string $cellHeaderFormat
+     *
+     * @return TableHelper
+     */
+    public function setCellHeaderFormat($cellHeaderFormat)
+    {
+        $this->cellHeaderFormat = $cellHeaderFormat;
+
+        return $this;
+    }
+
+    /**
+     * Sets row cell format.
+     *
+     * @param string $cellRowFormat
+     *
+     * @return TableHelper
+     */
+    public function setCellRowFormat($cellRowFormat)
+    {
+        $this->cellRowFormat = $cellRowFormat;
+
+        return $this;
+    }
+
+    /**
+     * Sets table border format.
+     *
+     * @param string $borderFormat
+     *
+     * @return TableHelper
+     */
+    public function setBorderFormat($borderFormat)
+    {
+        $this->borderFormat = $borderFormat;
+
+        return $this;
+    }
+
+    /**
+     * Sets cell padding type.
+     *
+     * @param integer $padType STR_PAD_*
+     *
+     * @return TableHelper
+     */
+    public function setPadType($padType)
+    {
+        $this->padType = $padType;
+
+        return $this;
+    }
+
+    /**
+     * Renders table to output.
+     *
+     * Example:
+     * +---------------+-----------------------+------------------+
+     * | ISBN          | Title                 | Author           |
+     * +---------------+-----------------------+------------------+
+     * | 99921-58-10-7 | Divine Comedy         | Dante Alighieri  |
+     * | 9971-5-0210-0 | A Tale of Two Cities  | Charles Dickens  |
+     * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
+     * +---------------+-----------------------+------------------+
+     *
+     * @param OutputInterface $output
+     */
+    public function render(OutputInterface $output)
+    {
+        $this->output = $output;
+
+        $this->renderRowSeparator();
+        $this->renderRow($this->headers, $this->cellHeaderFormat);
+        if (!empty($this->headers)) {
+            $this->renderRowSeparator();
+        }
+        foreach ($this->rows as $row) {
+            $this->renderRow($row, $this->cellRowFormat);
+        }
+        if (!empty($this->rows)) {
+            $this->renderRowSeparator();
+        }
+
+        $this->cleanup();
+    }
+
+    /**
+     * Renders horizontal header separator.
+     *
+     * Example: +-----+-----------+-------+
+     */
+    private function renderRowSeparator()
+    {
+        if (0 === $count = $this->getNumberOfColumns()) {
+            return;
+        }
+
+        $markup = $this->crossingChar;
+        for ($column = 0; $column < $count; $column++) {
+            $markup .= str_repeat($this->horizontalBorderChar, $this->getColumnWidth($column))
+                    .$this->crossingChar
+            ;
+        }
+
+        $this->output->writeln(sprintf($this->borderFormat, $markup));
+    }
+
+    /**
+     * Renders vertical column separator.
+     */
+    private function renderColumnSeparator()
+    {
+        $this->output->write(sprintf($this->borderFormat, $this->verticalBorderChar));
+    }
+
+    /**
+     * Renders table row.
+     *
+     * Example: | 9971-5-0210-0 | A Tale of Two Cities  | Charles Dickens  |
+     *
+     * @param array  $row
+     * @param string $cellFormat
+     */
+    private function renderRow(array $row, $cellFormat)
+    {
+        if (empty($row)) {
+            return;
+        }
+
+        $this->renderColumnSeparator();
+        for ($column = 0, $count = $this->getNumberOfColumns(); $column < $count; $column++) {
+            $this->renderCell($row, $column, $cellFormat);
+            $this->renderColumnSeparator();
+        }
+        $this->output->writeln('');
+    }
+
+    /**
+     * Renders table cell with padding.
+     *
+     * @param array   $row
+     * @param integer $column
+     * @param string  $cellFormat
+     */
+    private function renderCell(array $row, $column, $cellFormat)
+    {
+        $cell = isset($row[$column]) ? $row[$column] : '';
+
+        $this->output->write(sprintf(
+            $cellFormat,
+            str_pad(
+                $this->paddingChar.$cell.$this->paddingChar,
+                $this->getColumnWidth($column),
+                $this->paddingChar,
+                $this->padType
+            )
+        ));
+    }
+
+    /**
+     * Gets number of columns for this table.
+     *
+     * @return int
+     */
+    private function getNumberOfColumns()
+    {
+        if (null !== $this->numberOfColumns) {
+            return $this->numberOfColumns;
+        }
+
+        $columns = array(0);
+        $columns[] = count($this->headers);
+        foreach ($this->rows as $row) {
+            $columns[] = count($row);
+        }
+
+        return $this->numberOfColumns = max($columns);
+    }
+
+    /**
+     * Gets column width.
+     *
+     * @param integer $column
+     *
+     * @return int
+     */
+    private function getColumnWidth($column)
+    {
+        if (isset($this->columnWidths[$column])) {
+            return $this->columnWidths[$column];
+        }
+
+        $lengths = array(0);
+        $lengths[] = $this->getCellWidth($this->headers, $column);
+        foreach ($this->rows as $row) {
+            $lengths[] = $this->getCellWidth($row, $column);
+        }
+
+        return $this->columnWidths[$column] = max($lengths) + 2;
+    }
+
+    /**
+     * Gets cell width.
+     *
+     * @param array   $row
+     * @param integer $column
+     *
+     * @return int
+     */
+    private function getCellWidth(array $row, $column)
+    {
+        if ($column < 0) {
+            return 0;
+        }
+
+        if (isset($row[$column])) {
+            return $this->strlen($row[$column]);
+        }
+
+        return $this->getCellWidth($row, $column - 1);
+    }
+
+    /**
+     * Called after rendering to cleanup cache data.
+     */
+    private function cleanup()
+    {
+        $this->columnWidths = array();
+        $this->numberOfColumns = null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function getName()
+    {
+        return 'table';
+    }
+}

+ 338 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php

@@ -0,0 +1,338 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Input;
+
+/**
+ * ArgvInput represents an input coming from the CLI arguments.
+ *
+ * Usage:
+ *
+ *     $input = new ArgvInput();
+ *
+ * By default, the `$_SERVER['argv']` array is used for the input values.
+ *
+ * This can be overridden by explicitly passing the input values in the constructor:
+ *
+ *     $input = new ArgvInput($_SERVER['argv']);
+ *
+ * If you pass it yourself, don't forget that the first element of the array
+ * is the name of the running application.
+ *
+ * When passing an argument to the constructor, be sure that it respects
+ * the same rules as the argv one. It's almost always better to use the
+ * `StringInput` when you want to provide your own input.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @see    http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
+ * @see    http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02
+ *
+ * @api
+ */
+class ArgvInput extends Input
+{
+    private $tokens;
+    private $parsed;
+
+    /**
+     * Constructor.
+     *
+     * @param array           $argv       An array of parameters from the CLI (in the argv format)
+     * @param InputDefinition $definition A InputDefinition instance
+     *
+     * @api
+     */
+    public function __construct(array $argv = null, InputDefinition $definition = null)
+    {
+        if (null === $argv) {
+            $argv = $_SERVER['argv'];
+        }
+
+        // strip the application name
+        array_shift($argv);
+
+        $this->tokens = $argv;
+
+        parent::__construct($definition);
+    }
+
+    protected function setTokens(array $tokens)
+    {
+        $this->tokens = $tokens;
+    }
+
+    /**
+     * Processes command line arguments.
+     */
+    protected function parse()
+    {
+        $parseOptions = true;
+        $this->parsed = $this->tokens;
+        while (null !== $token = array_shift($this->parsed)) {
+            if ($parseOptions && '' == $token) {
+                $this->parseArgument($token);
+            } elseif ($parseOptions && '--' == $token) {
+                $parseOptions = false;
+            } elseif ($parseOptions && 0 === strpos($token, '--')) {
+                $this->parseLongOption($token);
+            } elseif ($parseOptions && '-' === $token[0]) {
+                $this->parseShortOption($token);
+            } else {
+                $this->parseArgument($token);
+            }
+        }
+    }
+
+    /**
+     * Parses a short option.
+     *
+     * @param string $token The current token.
+     */
+    private function parseShortOption($token)
+    {
+        $name = substr($token, 1);
+
+        if (strlen($name) > 1) {
+            if ($this->definition->hasShortcut($name[0]) && $this->definition->getOptionForShortcut($name[0])->acceptValue()) {
+                // an option with a value (with no space)
+                $this->addShortOption($name[0], substr($name, 1));
+            } else {
+                $this->parseShortOptionSet($name);
+            }
+        } else {
+            $this->addShortOption($name, null);
+        }
+    }
+
+    /**
+     * Parses a short option set.
+     *
+     * @param string $name The current token
+     *
+     * @throws \RuntimeException When option given doesn't exist
+     */
+    private function parseShortOptionSet($name)
+    {
+        $len = strlen($name);
+        for ($i = 0; $i < $len; $i++) {
+            if (!$this->definition->hasShortcut($name[$i])) {
+                throw new \RuntimeException(sprintf('The "-%s" option does not exist.', $name[$i]));
+            }
+
+            $option = $this->definition->getOptionForShortcut($name[$i]);
+            if ($option->acceptValue()) {
+                $this->addLongOption($option->getName(), $i === $len - 1 ? null : substr($name, $i + 1));
+
+                break;
+            } else {
+                $this->addLongOption($option->getName(), true);
+            }
+        }
+    }
+
+    /**
+     * Parses a long option.
+     *
+     * @param string $token The current token
+     */
+    private function parseLongOption($token)
+    {
+        $name = substr($token, 2);
+
+        if (false !== $pos = strpos($name, '=')) {
+            $this->addLongOption(substr($name, 0, $pos), substr($name, $pos + 1));
+        } else {
+            $this->addLongOption($name, null);
+        }
+    }
+
+    /**
+     * Parses an argument.
+     *
+     * @param string $token The current token
+     *
+     * @throws \RuntimeException When too many arguments are given
+     */
+    private function parseArgument($token)
+    {
+        $c = count($this->arguments);
+
+        // if input is expecting another argument, add it
+        if ($this->definition->hasArgument($c)) {
+            $arg = $this->definition->getArgument($c);
+            $this->arguments[$arg->getName()] = $arg->isArray()? array($token) : $token;
+
+        // if last argument isArray(), append token to last argument
+        } elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) {
+            $arg = $this->definition->getArgument($c - 1);
+            $this->arguments[$arg->getName()][] = $token;
+
+        // unexpected argument
+        } else {
+            throw new \RuntimeException('Too many arguments.');
+        }
+    }
+
+    /**
+     * Adds a short option value.
+     *
+     * @param string $shortcut The short option key
+     * @param mixed  $value    The value for the option
+     *
+     * @throws \RuntimeException When option given doesn't exist
+     */
+    private function addShortOption($shortcut, $value)
+    {
+        if (!$this->definition->hasShortcut($shortcut)) {
+            throw new \RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut));
+        }
+
+        $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value);
+    }
+
+    /**
+     * Adds a long option value.
+     *
+     * @param string $name  The long option key
+     * @param mixed  $value The value for the option
+     *
+     * @throws \RuntimeException When option given doesn't exist
+     */
+    private function addLongOption($name, $value)
+    {
+        if (!$this->definition->hasOption($name)) {
+            throw new \RuntimeException(sprintf('The "--%s" option does not exist.', $name));
+        }
+
+        $option = $this->definition->getOption($name);
+
+        if (null === $value && $option->acceptValue() && count($this->parsed)) {
+            // if option accepts an optional or mandatory argument
+            // let's see if there is one provided
+            $next = array_shift($this->parsed);
+            if (isset($next[0]) && '-' !== $next[0]) {
+                $value = $next;
+            } elseif (empty($next)) {
+                $value = '';
+            } else {
+                array_unshift($this->parsed, $next);
+            }
+        }
+
+        if (null === $value) {
+            if ($option->isValueRequired()) {
+                throw new \RuntimeException(sprintf('The "--%s" option requires a value.', $name));
+            }
+
+            $value = $option->isValueOptional() ? $option->getDefault() : true;
+        }
+
+        if ($option->isArray()) {
+            $this->options[$name][] = $value;
+        } else {
+            $this->options[$name] = $value;
+        }
+    }
+
+    /**
+     * Returns the first argument from the raw parameters (not parsed).
+     *
+     * @return string The value of the first argument or null otherwise
+     */
+    public function getFirstArgument()
+    {
+        foreach ($this->tokens as $token) {
+            if ($token && '-' === $token[0]) {
+                continue;
+            }
+
+            return $token;
+        }
+    }
+
+    /**
+     * Returns true if the raw parameters (not parsed) contain a value.
+     *
+     * This method is to be used to introspect the input parameters
+     * before they have been validated. It must be used carefully.
+     *
+     * @param string|array $values The value(s) to look for in the raw parameters (can be an array)
+     *
+     * @return Boolean true if the value is contained in the raw parameters
+     */
+    public function hasParameterOption($values)
+    {
+        $values = (array) $values;
+
+        foreach ($this->tokens as $v) {
+            if (in_array($v, $values)) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Returns the value of a raw option (not parsed).
+     *
+     * This method is to be used to introspect the input parameters
+     * before they have been validated. It must be used carefully.
+     *
+     * @param string|array $values  The value(s) to look for in the raw parameters (can be an array)
+     * @param mixed        $default The default value to return if no result is found
+     *
+     * @return mixed The option value
+     */
+    public function getParameterOption($values, $default = false)
+    {
+        $values = (array) $values;
+
+        $tokens = $this->tokens;
+        while ($token = array_shift($tokens)) {
+            foreach ($values as $value) {
+                if (0 === strpos($token, $value)) {
+                    if (false !== $pos = strpos($token, '=')) {
+                        return substr($token, $pos + 1);
+                    }
+
+                    return array_shift($tokens);
+                }
+            }
+        }
+
+        return $default;
+    }
+
+    /**
+     * Returns a stringified representation of the args passed to the command
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        $self = $this;
+        $tokens = array_map(function ($token) use ($self) {
+            if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) {
+                return $match[1] . $self->escapeToken($match[2]);
+            }
+
+            if ($token && $token[0] !== '-') {
+                return $self->escapeToken($token);
+            }
+
+            return $token;
+        }, $this->tokens);
+
+        return implode(' ', $tokens);
+    }
+}

+ 209 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Input/ArrayInput.php

@@ -0,0 +1,209 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Input;
+
+/**
+ * ArrayInput represents an input provided as an array.
+ *
+ * Usage:
+ *
+ *     $input = new ArrayInput(array('name' => 'foo', '--bar' => 'foobar'));
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @api
+ */
+class ArrayInput extends Input
+{
+    private $parameters;
+
+    /**
+     * Constructor.
+     *
+     * @param array           $parameters An array of parameters
+     * @param InputDefinition $definition A InputDefinition instance
+     *
+     * @api
+     */
+    public function __construct(array $parameters, InputDefinition $definition = null)
+    {
+        $this->parameters = $parameters;
+
+        parent::__construct($definition);
+    }
+
+    /**
+     * Returns the first argument from the raw parameters (not parsed).
+     *
+     * @return string The value of the first argument or null otherwise
+     */
+    public function getFirstArgument()
+    {
+        foreach ($this->parameters as $key => $value) {
+            if ($key && '-' === $key[0]) {
+                continue;
+            }
+
+            return $value;
+        }
+    }
+
+    /**
+     * Returns true if the raw parameters (not parsed) contain a value.
+     *
+     * This method is to be used to introspect the input parameters
+     * before they have been validated. It must be used carefully.
+     *
+     * @param string|array $values The values to look for in the raw parameters (can be an array)
+     *
+     * @return Boolean true if the value is contained in the raw parameters
+     */
+    public function hasParameterOption($values)
+    {
+        $values = (array) $values;
+
+        foreach ($this->parameters as $k => $v) {
+            if (!is_int($k)) {
+                $v = $k;
+            }
+
+            if (in_array($v, $values)) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Returns the value of a raw option (not parsed).
+     *
+     * This method is to be used to introspect the input parameters
+     * before they have been validated. It must be used carefully.
+     *
+     * @param string|array $values  The value(s) to look for in the raw parameters (can be an array)
+     * @param mixed        $default The default value to return if no result is found
+     *
+     * @return mixed The option value
+     */
+    public function getParameterOption($values, $default = false)
+    {
+        $values = (array) $values;
+
+        foreach ($this->parameters as $k => $v) {
+            if (is_int($k) && in_array($v, $values)) {
+                return true;
+            } elseif (in_array($k, $values)) {
+                return $v;
+            }
+        }
+
+        return $default;
+    }
+
+    /**
+     * Returns a stringified representation of the args passed to the command
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        $params = array();
+        foreach ($this->parameters as $param => $val) {
+            if ($param && '-' === $param[0]) {
+                $params[] = $param . ('' != $val ? '='.$this->escapeToken($val) : '');
+            } else {
+                $params[] = $this->escapeToken($val);
+            }
+        }
+
+        return implode(' ', $params);
+    }
+
+    /**
+     * Processes command line arguments.
+     */
+    protected function parse()
+    {
+        foreach ($this->parameters as $key => $value) {
+            if (0 === strpos($key, '--')) {
+                $this->addLongOption(substr($key, 2), $value);
+            } elseif ('-' === $key[0]) {
+                $this->addShortOption(substr($key, 1), $value);
+            } else {
+                $this->addArgument($key, $value);
+            }
+        }
+    }
+
+    /**
+     * Adds a short option value.
+     *
+     * @param string $shortcut The short option key
+     * @param mixed  $value    The value for the option
+     *
+     * @throws \InvalidArgumentException When option given doesn't exist
+     */
+    private function addShortOption($shortcut, $value)
+    {
+        if (!$this->definition->hasShortcut($shortcut)) {
+            throw new \InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut));
+        }
+
+        $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value);
+    }
+
+    /**
+     * Adds a long option value.
+     *
+     * @param string $name  The long option key
+     * @param mixed  $value The value for the option
+     *
+     * @throws \InvalidArgumentException When option given doesn't exist
+     * @throws \InvalidArgumentException When a required value is missing
+     */
+    private function addLongOption($name, $value)
+    {
+        if (!$this->definition->hasOption($name)) {
+            throw new \InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name));
+        }
+
+        $option = $this->definition->getOption($name);
+
+        if (null === $value) {
+            if ($option->isValueRequired()) {
+                throw new \InvalidArgumentException(sprintf('The "--%s" option requires a value.', $name));
+            }
+
+            $value = $option->isValueOptional() ? $option->getDefault() : true;
+        }
+
+        $this->options[$name] = $value;
+    }
+
+    /**
+     * Adds an argument value.
+     *
+     * @param string $name  The argument name
+     * @param mixed  $value The value for the argument
+     *
+     * @throws \InvalidArgumentException When argument given doesn't exist
+     */
+    private function addArgument($name, $value)
+    {
+        if (!$this->definition->hasArgument($name)) {
+            throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
+        }
+
+        $this->arguments[$name] = $value;
+    }
+}

+ 225 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Input/Input.php

@@ -0,0 +1,225 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Input;
+
+/**
+ * Input is the base class for all concrete Input classes.
+ *
+ * Three concrete classes are provided by default:
+ *
+ *  * `ArgvInput`: The input comes from the CLI arguments (argv)
+ *  * `StringInput`: The input is provided as a string
+ *  * `ArrayInput`: The input is provided as an array
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+abstract class Input implements InputInterface
+{
+    protected $definition;
+    protected $options;
+    protected $arguments;
+    protected $interactive = true;
+
+    /**
+     * Constructor.
+     *
+     * @param InputDefinition $definition A InputDefinition instance
+     */
+    public function __construct(InputDefinition $definition = null)
+    {
+        if (null === $definition) {
+            $this->arguments = array();
+            $this->options = array();
+            $this->definition = new InputDefinition();
+        } else {
+            $this->bind($definition);
+            $this->validate();
+        }
+    }
+
+    /**
+     * Binds the current Input instance with the given arguments and options.
+     *
+     * @param InputDefinition $definition A InputDefinition instance
+     */
+    public function bind(InputDefinition $definition)
+    {
+        $this->arguments = array();
+        $this->options = array();
+        $this->definition = $definition;
+
+        $this->parse();
+    }
+
+    /**
+     * Processes command line arguments.
+     */
+    abstract protected function parse();
+
+    /**
+     * Validates the input.
+     *
+     * @throws \RuntimeException When not enough arguments are given
+     */
+    public function validate()
+    {
+        if (count($this->arguments) < $this->definition->getArgumentRequiredCount()) {
+            throw new \RuntimeException('Not enough arguments.');
+        }
+    }
+
+    /**
+     * Checks if the input is interactive.
+     *
+     * @return Boolean Returns true if the input is interactive
+     */
+    public function isInteractive()
+    {
+        return $this->interactive;
+    }
+
+    /**
+     * Sets the input interactivity.
+     *
+     * @param Boolean $interactive If the input should be interactive
+     */
+    public function setInteractive($interactive)
+    {
+        $this->interactive = (Boolean) $interactive;
+    }
+
+    /**
+     * Returns the argument values.
+     *
+     * @return array An array of argument values
+     */
+    public function getArguments()
+    {
+        return array_merge($this->definition->getArgumentDefaults(), $this->arguments);
+    }
+
+    /**
+     * Returns the argument value for a given argument name.
+     *
+     * @param string $name The argument name
+     *
+     * @return mixed The argument value
+     *
+     * @throws \InvalidArgumentException When argument given doesn't exist
+     */
+    public function getArgument($name)
+    {
+        if (!$this->definition->hasArgument($name)) {
+            throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
+        }
+
+        return isset($this->arguments[$name]) ? $this->arguments[$name] : $this->definition->getArgument($name)->getDefault();
+    }
+
+    /**
+     * Sets an argument value by name.
+     *
+     * @param string $name  The argument name
+     * @param string $value The argument value
+     *
+     * @throws \InvalidArgumentException When argument given doesn't exist
+     */
+    public function setArgument($name, $value)
+    {
+        if (!$this->definition->hasArgument($name)) {
+            throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
+        }
+
+        $this->arguments[$name] = $value;
+    }
+
+    /**
+     * Returns true if an InputArgument object exists by name or position.
+     *
+     * @param string|integer $name The InputArgument name or position
+     *
+     * @return Boolean true if the InputArgument object exists, false otherwise
+     */
+    public function hasArgument($name)
+    {
+        return $this->definition->hasArgument($name);
+    }
+
+    /**
+     * Returns the options values.
+     *
+     * @return array An array of option values
+     */
+    public function getOptions()
+    {
+        return array_merge($this->definition->getOptionDefaults(), $this->options);
+    }
+
+    /**
+     * Returns the option value for a given option name.
+     *
+     * @param string $name The option name
+     *
+     * @return mixed The option value
+     *
+     * @throws \InvalidArgumentException When option given doesn't exist
+     */
+    public function getOption($name)
+    {
+        if (!$this->definition->hasOption($name)) {
+            throw new \InvalidArgumentException(sprintf('The "%s" option does not exist.', $name));
+        }
+
+        return isset($this->options[$name]) ? $this->options[$name] : $this->definition->getOption($name)->getDefault();
+    }
+
+    /**
+     * Sets an option value by name.
+     *
+     * @param string $name  The option name
+     * @param string $value The option value
+     *
+     * @throws \InvalidArgumentException When option given doesn't exist
+     */
+    public function setOption($name, $value)
+    {
+        if (!$this->definition->hasOption($name)) {
+            throw new \InvalidArgumentException(sprintf('The "%s" option does not exist.', $name));
+        }
+
+        $this->options[$name] = $value;
+    }
+
+    /**
+     * Returns true if an InputOption object exists by name.
+     *
+     * @param string $name The InputOption name
+     *
+     * @return Boolean true if the InputOption object exists, false otherwise
+     */
+    public function hasOption($name)
+    {
+        return $this->definition->hasOption($name);
+    }
+
+    /**
+     * Escapes a token through escapeshellarg if it contains unsafe chars
+     *
+     * @param string $token
+     *
+     * @return string
+     */
+    public function escapeToken($token)
+    {
+        return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token);
+    }
+}

+ 132 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Input/InputArgument.php

@@ -0,0 +1,132 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Input;
+
+/**
+ * Represents a command line argument.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @api
+ */
+class InputArgument
+{
+    const REQUIRED = 1;
+    const OPTIONAL = 2;
+    const IS_ARRAY = 4;
+
+    private $name;
+    private $mode;
+    private $default;
+    private $description;
+
+    /**
+     * Constructor.
+     *
+     * @param string  $name        The argument name
+     * @param integer $mode        The argument mode: self::REQUIRED or self::OPTIONAL
+     * @param string  $description A description text
+     * @param mixed   $default     The default value (for self::OPTIONAL mode only)
+     *
+     * @throws \InvalidArgumentException When argument mode is not valid
+     *
+     * @api
+     */
+    public function __construct($name, $mode = null, $description = '', $default = null)
+    {
+        if (null === $mode) {
+            $mode = self::OPTIONAL;
+        } elseif (!is_int($mode) || $mode > 7 || $mode < 1) {
+            throw new \InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode));
+        }
+
+        $this->name        = $name;
+        $this->mode        = $mode;
+        $this->description = $description;
+
+        $this->setDefault($default);
+    }
+
+    /**
+     * Returns the argument name.
+     *
+     * @return string The argument name
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * Returns true if the argument is required.
+     *
+     * @return Boolean true if parameter mode is self::REQUIRED, false otherwise
+     */
+    public function isRequired()
+    {
+        return self::REQUIRED === (self::REQUIRED & $this->mode);
+    }
+
+    /**
+     * Returns true if the argument can take multiple values.
+     *
+     * @return Boolean true if mode is self::IS_ARRAY, false otherwise
+     */
+    public function isArray()
+    {
+        return self::IS_ARRAY === (self::IS_ARRAY & $this->mode);
+    }
+
+    /**
+     * Sets the default value.
+     *
+     * @param mixed $default The default value
+     *
+     * @throws \LogicException When incorrect default value is given
+     */
+    public function setDefault($default = null)
+    {
+        if (self::REQUIRED === $this->mode && null !== $default) {
+            throw new \LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.');
+        }
+
+        if ($this->isArray()) {
+            if (null === $default) {
+                $default = array();
+            } elseif (!is_array($default)) {
+                throw new \LogicException('A default value for an array argument must be an array.');
+            }
+        }
+
+        $this->default = $default;
+    }
+
+    /**
+     * Returns the default value.
+     *
+     * @return mixed The default value
+     */
+    public function getDefault()
+    {
+        return $this->default;
+    }
+
+    /**
+     * Returns the description text.
+     *
+     * @return string The description text
+     */
+    public function getDescription()
+    {
+        return $this->description;
+    }
+}

+ 535 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Input/InputDefinition.php

@@ -0,0 +1,535 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Input;
+
+/**
+ * A InputDefinition represents a set of valid command line arguments and options.
+ *
+ * Usage:
+ *
+ *     $definition = new InputDefinition(array(
+ *       new InputArgument('name', InputArgument::REQUIRED),
+ *       new InputOption('foo', 'f', InputOption::VALUE_REQUIRED),
+ *     ));
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @api
+ */
+class InputDefinition
+{
+    private $arguments;
+    private $requiredCount;
+    private $hasAnArrayArgument = false;
+    private $hasOptional;
+    private $options;
+    private $shortcuts;
+
+    /**
+     * Constructor.
+     *
+     * @param array $definition An array of InputArgument and InputOption instance
+     *
+     * @api
+     */
+    public function __construct(array $definition = array())
+    {
+        $this->setDefinition($definition);
+    }
+
+    /**
+     * Sets the definition of the input.
+     *
+     * @param array $definition The definition array
+     *
+     * @api
+     */
+    public function setDefinition(array $definition)
+    {
+        $arguments = array();
+        $options = array();
+        foreach ($definition as $item) {
+            if ($item instanceof InputOption) {
+                $options[] = $item;
+            } else {
+                $arguments[] = $item;
+            }
+        }
+
+        $this->setArguments($arguments);
+        $this->setOptions($options);
+    }
+
+    /**
+     * Sets the InputArgument objects.
+     *
+     * @param InputArgument[] $arguments An array of InputArgument objects
+     *
+     * @api
+     */
+    public function setArguments($arguments = array())
+    {
+        $this->arguments          = array();
+        $this->requiredCount      = 0;
+        $this->hasOptional        = false;
+        $this->hasAnArrayArgument = false;
+        $this->addArguments($arguments);
+    }
+
+    /**
+     * Adds an array of InputArgument objects.
+     *
+     * @param InputArgument[] $arguments An array of InputArgument objects
+     *
+     * @api
+     */
+    public function addArguments($arguments = array())
+    {
+        if (null !== $arguments) {
+            foreach ($arguments as $argument) {
+                $this->addArgument($argument);
+            }
+        }
+    }
+
+    /**
+     * Adds an InputArgument object.
+     *
+     * @param InputArgument $argument An InputArgument object
+     *
+     * @throws \LogicException When incorrect argument is given
+     *
+     * @api
+     */
+    public function addArgument(InputArgument $argument)
+    {
+        if (isset($this->arguments[$argument->getName()])) {
+            throw new \LogicException(sprintf('An argument with name "%s" already exists.', $argument->getName()));
+        }
+
+        if ($this->hasAnArrayArgument) {
+            throw new \LogicException('Cannot add an argument after an array argument.');
+        }
+
+        if ($argument->isRequired() && $this->hasOptional) {
+            throw new \LogicException('Cannot add a required argument after an optional one.');
+        }
+
+        if ($argument->isArray()) {
+            $this->hasAnArrayArgument = true;
+        }
+
+        if ($argument->isRequired()) {
+            ++$this->requiredCount;
+        } else {
+            $this->hasOptional = true;
+        }
+
+        $this->arguments[$argument->getName()] = $argument;
+    }
+
+    /**
+     * Returns an InputArgument by name or by position.
+     *
+     * @param string|integer $name The InputArgument name or position
+     *
+     * @return InputArgument An InputArgument object
+     *
+     * @throws \InvalidArgumentException When argument given doesn't exist
+     *
+     * @api
+     */
+    public function getArgument($name)
+    {
+        $arguments = is_int($name) ? array_values($this->arguments) : $this->arguments;
+
+        if (!$this->hasArgument($name)) {
+            throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
+        }
+
+        return $arguments[$name];
+    }
+
+    /**
+     * Returns true if an InputArgument object exists by name or position.
+     *
+     * @param string|integer $name The InputArgument name or position
+     *
+     * @return Boolean true if the InputArgument object exists, false otherwise
+     *
+     * @api
+     */
+    public function hasArgument($name)
+    {
+        $arguments = is_int($name) ? array_values($this->arguments) : $this->arguments;
+
+        return isset($arguments[$name]);
+    }
+
+    /**
+     * Gets the array of InputArgument objects.
+     *
+     * @return InputArgument[] An array of InputArgument objects
+     *
+     * @api
+     */
+    public function getArguments()
+    {
+        return $this->arguments;
+    }
+
+    /**
+     * Returns the number of InputArguments.
+     *
+     * @return integer The number of InputArguments
+     */
+    public function getArgumentCount()
+    {
+        return $this->hasAnArrayArgument ? PHP_INT_MAX : count($this->arguments);
+    }
+
+    /**
+     * Returns the number of required InputArguments.
+     *
+     * @return integer The number of required InputArguments
+     */
+    public function getArgumentRequiredCount()
+    {
+        return $this->requiredCount;
+    }
+
+    /**
+     * Gets the default values.
+     *
+     * @return array An array of default values
+     */
+    public function getArgumentDefaults()
+    {
+        $values = array();
+        foreach ($this->arguments as $argument) {
+            $values[$argument->getName()] = $argument->getDefault();
+        }
+
+        return $values;
+    }
+
+    /**
+     * Sets the InputOption objects.
+     *
+     * @param InputOption[] $options An array of InputOption objects
+     *
+     * @api
+     */
+    public function setOptions($options = array())
+    {
+        $this->options = array();
+        $this->shortcuts = array();
+        $this->addOptions($options);
+    }
+
+    /**
+     * Adds an array of InputOption objects.
+     *
+     * @param InputOption[] $options An array of InputOption objects
+     *
+     * @api
+     */
+    public function addOptions($options = array())
+    {
+        foreach ($options as $option) {
+            $this->addOption($option);
+        }
+    }
+
+    /**
+     * Adds an InputOption object.
+     *
+     * @param InputOption $option An InputOption object
+     *
+     * @throws \LogicException When option given already exist
+     *
+     * @api
+     */
+    public function addOption(InputOption $option)
+    {
+        if (isset($this->options[$option->getName()]) && !$option->equals($this->options[$option->getName()])) {
+            throw new \LogicException(sprintf('An option named "%s" already exists.', $option->getName()));
+        } elseif (isset($this->shortcuts[$option->getShortcut()]) && !$option->equals($this->options[$this->shortcuts[$option->getShortcut()]])) {
+            throw new \LogicException(sprintf('An option with shortcut "%s" already exists.', $option->getShortcut()));
+        }
+
+        $this->options[$option->getName()] = $option;
+        if ($option->getShortcut()) {
+            $this->shortcuts[$option->getShortcut()] = $option->getName();
+        }
+    }
+
+    /**
+     * Returns an InputOption by name.
+     *
+     * @param string $name The InputOption name
+     *
+     * @return InputOption A InputOption object
+     *
+     * @throws \InvalidArgumentException When option given doesn't exist
+     *
+     * @api
+     */
+    public function getOption($name)
+    {
+        if (!$this->hasOption($name)) {
+            throw new \InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name));
+        }
+
+        return $this->options[$name];
+    }
+
+    /**
+     * Returns true if an InputOption object exists by name.
+     *
+     * @param string $name The InputOption name
+     *
+     * @return Boolean true if the InputOption object exists, false otherwise
+     *
+     * @api
+     */
+    public function hasOption($name)
+    {
+        return isset($this->options[$name]);
+    }
+
+    /**
+     * Gets the array of InputOption objects.
+     *
+     * @return InputOption[] An array of InputOption objects
+     *
+     * @api
+     */
+    public function getOptions()
+    {
+        return $this->options;
+    }
+
+    /**
+     * Returns true if an InputOption object exists by shortcut.
+     *
+     * @param string $name The InputOption shortcut
+     *
+     * @return Boolean true if the InputOption object exists, false otherwise
+     */
+    public function hasShortcut($name)
+    {
+        return isset($this->shortcuts[$name]);
+    }
+
+    /**
+     * Gets an InputOption by shortcut.
+     *
+     * @param string $shortcut the Shortcut name
+     *
+     * @return InputOption An InputOption object
+     */
+    public function getOptionForShortcut($shortcut)
+    {
+        return $this->getOption($this->shortcutToName($shortcut));
+    }
+
+    /**
+     * Gets an array of default values.
+     *
+     * @return array An array of all default values
+     */
+    public function getOptionDefaults()
+    {
+        $values = array();
+        foreach ($this->options as $option) {
+            $values[$option->getName()] = $option->getDefault();
+        }
+
+        return $values;
+    }
+
+    /**
+     * Returns the InputOption name given a shortcut.
+     *
+     * @param string $shortcut The shortcut
+     *
+     * @return string The InputOption name
+     *
+     * @throws \InvalidArgumentException When option given does not exist
+     */
+    private function shortcutToName($shortcut)
+    {
+        if (!isset($this->shortcuts[$shortcut])) {
+            throw new \InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut));
+        }
+
+        return $this->shortcuts[$shortcut];
+    }
+
+    /**
+     * Gets the synopsis.
+     *
+     * @return string The synopsis
+     */
+    public function getSynopsis()
+    {
+        $elements = array();
+        foreach ($this->getOptions() as $option) {
+            $shortcut = $option->getShortcut() ? sprintf('-%s|', $option->getShortcut()) : '';
+            $elements[] = sprintf('['.($option->isValueRequired() ? '%s--%s="..."' : ($option->isValueOptional() ? '%s--%s[="..."]' : '%s--%s')).']', $shortcut, $option->getName());
+        }
+
+        foreach ($this->getArguments() as $argument) {
+            $elements[] = sprintf($argument->isRequired() ? '%s' : '[%s]', $argument->getName().($argument->isArray() ? '1' : ''));
+
+            if ($argument->isArray()) {
+                $elements[] = sprintf('... [%sN]', $argument->getName());
+            }
+        }
+
+        return implode(' ', $elements);
+    }
+
+    /**
+     * Returns a textual representation of the InputDefinition.
+     *
+     * @return string A string representing the InputDefinition
+     */
+    public function asText()
+    {
+        // find the largest option or argument name
+        $max = 0;
+        foreach ($this->getOptions() as $option) {
+            $nameLength = strlen($option->getName()) + 2;
+            if ($option->getShortcut()) {
+                $nameLength += strlen($option->getShortcut()) + 3;
+            }
+
+            $max = max($max, $nameLength);
+        }
+        foreach ($this->getArguments() as $argument) {
+            $max = max($max, strlen($argument->getName()));
+        }
+        ++$max;
+
+        $text = array();
+
+        if ($this->getArguments()) {
+            $text[] = '<comment>Arguments:</comment>';
+            foreach ($this->getArguments() as $argument) {
+                if (null !== $argument->getDefault() && (!is_array($argument->getDefault()) || count($argument->getDefault()))) {
+                    $default = sprintf('<comment> (default: %s)</comment>', $this->formatDefaultValue($argument->getDefault()));
+                } else {
+                    $default = '';
+                }
+
+                $description = str_replace("\n", "\n".str_repeat(' ', $max + 2), $argument->getDescription());
+
+                $text[] = sprintf(" <info>%-${max}s</info> %s%s", $argument->getName(), $description, $default);
+            }
+
+            $text[] = '';
+        }
+
+        if ($this->getOptions()) {
+            $text[] = '<comment>Options:</comment>';
+
+            foreach ($this->getOptions() as $option) {
+                if ($option->acceptValue() && null !== $option->getDefault() && (!is_array($option->getDefault()) || count($option->getDefault()))) {
+                    $default = sprintf('<comment> (default: %s)</comment>', $this->formatDefaultValue($option->getDefault()));
+                } else {
+                    $default = '';
+                }
+
+                $multiple = $option->isArray() ? '<comment> (multiple values allowed)</comment>' : '';
+                $description = str_replace("\n", "\n".str_repeat(' ', $max + 2), $option->getDescription());
+
+                $optionMax = $max - strlen($option->getName()) - 2;
+                $text[] = sprintf(" <info>%s</info> %-${optionMax}s%s%s%s",
+                    '--'.$option->getName(),
+                    $option->getShortcut() ? sprintf('(-%s) ', $option->getShortcut()) : '',
+                    $description,
+                    $default,
+                    $multiple
+                );
+            }
+
+            $text[] = '';
+        }
+
+        return implode("\n", $text);
+    }
+
+    /**
+     * Returns an XML representation of the InputDefinition.
+     *
+     * @param Boolean $asDom Whether to return a DOM or an XML string
+     *
+     * @return string|DOMDocument An XML string representing the InputDefinition
+     */
+    public function asXml($asDom = false)
+    {
+        $dom = new \DOMDocument('1.0', 'UTF-8');
+        $dom->formatOutput = true;
+        $dom->appendChild($definitionXML = $dom->createElement('definition'));
+
+        $definitionXML->appendChild($argumentsXML = $dom->createElement('arguments'));
+        foreach ($this->getArguments() as $argument) {
+            $argumentsXML->appendChild($argumentXML = $dom->createElement('argument'));
+            $argumentXML->setAttribute('name', $argument->getName());
+            $argumentXML->setAttribute('is_required', $argument->isRequired() ? 1 : 0);
+            $argumentXML->setAttribute('is_array', $argument->isArray() ? 1 : 0);
+            $argumentXML->appendChild($descriptionXML = $dom->createElement('description'));
+            $descriptionXML->appendChild($dom->createTextNode($argument->getDescription()));
+
+            $argumentXML->appendChild($defaultsXML = $dom->createElement('defaults'));
+            $defaults = is_array($argument->getDefault()) ? $argument->getDefault() : (is_bool($argument->getDefault()) ? array(var_export($argument->getDefault(), true)) : ($argument->getDefault() ? array($argument->getDefault()) : array()));
+            foreach ($defaults as $default) {
+                $defaultsXML->appendChild($defaultXML = $dom->createElement('default'));
+                $defaultXML->appendChild($dom->createTextNode($default));
+            }
+        }
+
+        $definitionXML->appendChild($optionsXML = $dom->createElement('options'));
+        foreach ($this->getOptions() as $option) {
+            $optionsXML->appendChild($optionXML = $dom->createElement('option'));
+            $optionXML->setAttribute('name', '--'.$option->getName());
+            $optionXML->setAttribute('shortcut', $option->getShortcut() ? '-'.$option->getShortcut() : '');
+            $optionXML->setAttribute('accept_value', $option->acceptValue() ? 1 : 0);
+            $optionXML->setAttribute('is_value_required', $option->isValueRequired() ? 1 : 0);
+            $optionXML->setAttribute('is_multiple', $option->isArray() ? 1 : 0);
+            $optionXML->appendChild($descriptionXML = $dom->createElement('description'));
+            $descriptionXML->appendChild($dom->createTextNode($option->getDescription()));
+
+            if ($option->acceptValue()) {
+                $optionXML->appendChild($defaultsXML = $dom->createElement('defaults'));
+                $defaults = is_array($option->getDefault()) ? $option->getDefault() : (is_bool($option->getDefault()) ? array(var_export($option->getDefault(), true)) : ($option->getDefault() ? array($option->getDefault()) : array()));
+                foreach ($defaults as $default) {
+                    $defaultsXML->appendChild($defaultXML = $dom->createElement('default'));
+                    $defaultXML->appendChild($dom->createTextNode($default));
+                }
+            }
+        }
+
+        return $asDom ? $dom : $dom->saveXml();
+    }
+
+    private function formatDefaultValue($default)
+    {
+        if (version_compare(PHP_VERSION, '5.4', '<')) {
+            return str_replace('\/', '/', json_encode($default));
+        }
+
+        return json_encode($default, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
+    }
+}

+ 152 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Input/InputInterface.php

@@ -0,0 +1,152 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Input;
+
+/**
+ * InputInterface is the interface implemented by all input classes.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+interface InputInterface
+{
+    /**
+     * Returns the first argument from the raw parameters (not parsed).
+     *
+     * @return string The value of the first argument or null otherwise
+     */
+    public function getFirstArgument();
+
+    /**
+     * Returns true if the raw parameters (not parsed) contain a value.
+     *
+     * This method is to be used to introspect the input parameters
+     * before they have been validated. It must be used carefully.
+     *
+     * @param string|array $values The values to look for in the raw parameters (can be an array)
+     *
+     * @return Boolean true if the value is contained in the raw parameters
+     */
+    public function hasParameterOption($values);
+
+    /**
+     * Returns the value of a raw option (not parsed).
+     *
+     * This method is to be used to introspect the input parameters
+     * before they have been validated. It must be used carefully.
+     *
+     * @param string|array $values  The value(s) to look for in the raw parameters (can be an array)
+     * @param mixed        $default The default value to return if no result is found
+     *
+     * @return mixed The option value
+     */
+    public function getParameterOption($values, $default = false);
+
+    /**
+     * Binds the current Input instance with the given arguments and options.
+     *
+     * @param InputDefinition $definition A InputDefinition instance
+     */
+    public function bind(InputDefinition $definition);
+
+    /**
+     * Validates if arguments given are correct.
+     *
+     * Throws an exception when not enough arguments are given.
+     *
+     * @throws \RuntimeException
+     */
+    public function validate();
+
+    /**
+     * Returns all the given arguments merged with the default values.
+     *
+     * @return array
+     */
+    public function getArguments();
+
+    /**
+     * Gets argument by name.
+     *
+     * @param string $name The name of the argument
+     *
+     * @return mixed
+     */
+    public function getArgument($name);
+
+    /**
+     * Sets an argument value by name.
+     *
+     * @param string $name  The argument name
+     * @param string $value The argument value
+     *
+     * @throws \InvalidArgumentException When argument given doesn't exist
+     */
+    public function setArgument($name, $value);
+
+    /**
+     * Returns true if an InputArgument object exists by name or position.
+     *
+     * @param string|integer $name The InputArgument name or position
+     *
+     * @return Boolean true if the InputArgument object exists, false otherwise
+     */
+    public function hasArgument($name);
+
+    /**
+     * Returns all the given options merged with the default values.
+     *
+     * @return array
+     */
+    public function getOptions();
+
+    /**
+     * Gets an option by name.
+     *
+     * @param string $name The name of the option
+     *
+     * @return mixed
+     */
+    public function getOption($name);
+
+    /**
+     * Sets an option value by name.
+     *
+     * @param string $name  The option name
+     * @param string $value The option value
+     *
+     * @throws \InvalidArgumentException When option given doesn't exist
+     */
+    public function setOption($name, $value);
+
+    /**
+     * Returns true if an InputOption object exists by name.
+     *
+     * @param string $name The InputOption name
+     *
+     * @return Boolean true if the InputOption object exists, false otherwise
+     */
+    public function hasOption($name);
+
+    /**
+     * Is this input means interactive?
+     *
+     * @return Boolean
+     */
+    public function isInteractive();
+
+    /**
+     * Sets the input interactivity.
+     *
+     * @param Boolean $interactive If the input should be interactive
+     */
+    public function setInteractive($interactive);
+}

+ 209 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Input/InputOption.php

@@ -0,0 +1,209 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Input;
+
+/**
+ * Represents a command line option.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @api
+ */
+class InputOption
+{
+    const VALUE_NONE     = 1;
+    const VALUE_REQUIRED = 2;
+    const VALUE_OPTIONAL = 4;
+    const VALUE_IS_ARRAY = 8;
+
+    private $name;
+    private $shortcut;
+    private $mode;
+    private $default;
+    private $description;
+
+    /**
+     * Constructor.
+     *
+     * @param string  $name        The option name
+     * @param string  $shortcut    The shortcut (can be null)
+     * @param integer $mode        The option mode: One of the VALUE_* constants
+     * @param string  $description A description text
+     * @param mixed   $default     The default value (must be null for self::VALUE_REQUIRED or self::VALUE_NONE)
+     *
+     * @throws \InvalidArgumentException If option mode is invalid or incompatible
+     *
+     * @api
+     */
+    public function __construct($name, $shortcut = null, $mode = null, $description = '', $default = null)
+    {
+        if (0 === strpos($name, '--')) {
+            $name = substr($name, 2);
+        }
+
+        if (empty($name)) {
+            throw new \InvalidArgumentException('An option name cannot be empty.');
+        }
+
+        if (empty($shortcut)) {
+            $shortcut = null;
+        }
+
+        if (null !== $shortcut) {
+            if ('-' === $shortcut[0]) {
+                $shortcut = substr($shortcut, 1);
+            }
+
+            if (empty($shortcut)) {
+                throw new \InvalidArgumentException('An option shortcut cannot be empty.');
+            }
+        }
+
+        if (null === $mode) {
+            $mode = self::VALUE_NONE;
+        } elseif (!is_int($mode) || $mode > 15 || $mode < 1) {
+            throw new \InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode));
+        }
+
+        $this->name        = $name;
+        $this->shortcut    = $shortcut;
+        $this->mode        = $mode;
+        $this->description = $description;
+
+        if ($this->isArray() && !$this->acceptValue()) {
+            throw new \InvalidArgumentException('Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.');
+        }
+
+        $this->setDefault($default);
+    }
+
+    /**
+     * Returns the option shortcut.
+     *
+     * @return string The shortcut
+     */
+    public function getShortcut()
+    {
+        return $this->shortcut;
+    }
+
+    /**
+     * Returns the option name.
+     *
+     * @return string The name
+     */
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    /**
+     * Returns true if the option accepts a value.
+     *
+     * @return Boolean true if value mode is not self::VALUE_NONE, false otherwise
+     */
+    public function acceptValue()
+    {
+        return $this->isValueRequired() || $this->isValueOptional();
+    }
+
+    /**
+     * Returns true if the option requires a value.
+     *
+     * @return Boolean true if value mode is self::VALUE_REQUIRED, false otherwise
+     */
+    public function isValueRequired()
+    {
+        return self::VALUE_REQUIRED === (self::VALUE_REQUIRED & $this->mode);
+    }
+
+    /**
+     * Returns true if the option takes an optional value.
+     *
+     * @return Boolean true if value mode is self::VALUE_OPTIONAL, false otherwise
+     */
+    public function isValueOptional()
+    {
+        return self::VALUE_OPTIONAL === (self::VALUE_OPTIONAL & $this->mode);
+    }
+
+    /**
+     * Returns true if the option can take multiple values.
+     *
+     * @return Boolean true if mode is self::VALUE_IS_ARRAY, false otherwise
+     */
+    public function isArray()
+    {
+        return self::VALUE_IS_ARRAY === (self::VALUE_IS_ARRAY & $this->mode);
+    }
+
+    /**
+     * Sets the default value.
+     *
+     * @param mixed $default The default value
+     *
+     * @throws \LogicException When incorrect default value is given
+     */
+    public function setDefault($default = null)
+    {
+        if (self::VALUE_NONE === (self::VALUE_NONE & $this->mode) && null !== $default) {
+            throw new \LogicException('Cannot set a default value when using InputOption::VALUE_NONE mode.');
+        }
+
+        if ($this->isArray()) {
+            if (null === $default) {
+                $default = array();
+            } elseif (!is_array($default)) {
+                throw new \LogicException('A default value for an array option must be an array.');
+            }
+        }
+
+        $this->default = $this->acceptValue() ? $default : false;
+    }
+
+    /**
+     * Returns the default value.
+     *
+     * @return mixed The default value
+     */
+    public function getDefault()
+    {
+        return $this->default;
+    }
+
+    /**
+     * Returns the description text.
+     *
+     * @return string The description text
+     */
+    public function getDescription()
+    {
+        return $this->description;
+    }
+
+    /**
+     * Checks whether the given option equals this one
+     *
+     * @param InputOption $option option to compare
+     * @return Boolean
+     */
+    public function equals(InputOption $option)
+    {
+        return $option->getName() === $this->getName()
+            && $option->getShortcut() === $this->getShortcut()
+            && $option->getDefault() === $this->getDefault()
+            && $option->isArray() === $this->isArray()
+            && $option->isValueRequired() === $this->isValueRequired()
+            && $option->isValueOptional() === $this->isValueOptional()
+        ;
+    }
+}

+ 85 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Input/StringInput.php

@@ -0,0 +1,85 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Input;
+
+/**
+ * StringInput represents an input provided as a string.
+ *
+ * Usage:
+ *
+ *     $input = new StringInput('foo --bar="foobar"');
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @api
+ */
+class StringInput extends ArgvInput
+{
+    const REGEX_STRING = '([^\s]+?)(?:\s|(?<!\\\\)"|(?<!\\\\)\'|$)';
+    const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')';
+
+    /**
+     * Constructor.
+     *
+     * @param string          $input      An array of parameters from the CLI (in the argv format)
+     * @param InputDefinition $definition A InputDefinition instance
+     *
+     * @deprecated The second argument is deprecated as it does not work (will be removed in 3.0), use 'bind' method instead
+     *
+     * @api
+     */
+    public function __construct($input, InputDefinition $definition = null)
+    {
+        parent::__construct(array(), null);
+
+        $this->setTokens($this->tokenize($input));
+
+        if (null !== $definition) {
+            $this->bind($definition);
+        }
+    }
+
+    /**
+     * Tokenizes a string.
+     *
+     * @param string $input The input to tokenize
+     *
+     * @return array An array of tokens
+     *
+     * @throws \InvalidArgumentException When unable to parse input (should never happen)
+     */
+    private function tokenize($input)
+    {
+        $tokens = array();
+        $length = strlen($input);
+        $cursor = 0;
+        while ($cursor < $length) {
+            if (preg_match('/\s+/A', $input, $match, null, $cursor)) {
+            } elseif (preg_match('/([^="\'\s]+?)(=?)('.self::REGEX_QUOTED_STRING.'+)/A', $input, $match, null, $cursor)) {
+                $tokens[] = $match[1].$match[2].stripcslashes(str_replace(array('"\'', '\'"', '\'\'', '""'), '', substr($match[3], 1, strlen($match[3]) - 2)));
+            } elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A', $input, $match, null, $cursor)) {
+                $tokens[] = stripcslashes(substr($match[0], 1, strlen($match[0]) - 2));
+            } elseif (preg_match('/'.self::REGEX_STRING.'/A', $input, $match, null, $cursor)) {
+                $tokens[] = stripcslashes($match[1]);
+            } else {
+                // should never happen
+                // @codeCoverageIgnoreStart
+                throw new \InvalidArgumentException(sprintf('Unable to parse input near "... %s ..."', substr($input, $cursor, 10)));
+                // @codeCoverageIgnoreEnd
+            }
+
+            $cursor += strlen($match[0]);
+        }
+
+        return $tokens;
+    }
+}

+ 19 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/LICENSE

@@ -0,0 +1,19 @@
+Copyright (c) 2004-2013 Fabien Potencier
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

+ 103 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutput.php

@@ -0,0 +1,103 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Output;
+
+use Symfony\Component\Console\Formatter\OutputFormatterInterface;
+use Symfony\Component\Console\Output\ConsoleOutputInterface;
+
+/**
+ * ConsoleOutput is the default class for all CLI output. It uses STDOUT.
+ *
+ * This class is a convenient wrapper around `StreamOutput`.
+ *
+ *     $output = new ConsoleOutput();
+ *
+ * This is equivalent to:
+ *
+ *     $output = new StreamOutput(fopen('php://stdout', 'w'));
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @api
+ */
+class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
+{
+    private $stderr;
+
+    /**
+     * Constructor.
+     *
+     * @param integer                  $verbosity The verbosity level (self::VERBOSITY_QUIET, self::VERBOSITY_NORMAL,
+     *                                                                 self::VERBOSITY_VERBOSE)
+     * @param Boolean                  $decorated Whether to decorate messages or not (null for auto-guessing)
+     * @param OutputFormatterInterface $formatter Output formatter instance
+     *
+     * @api
+     */
+    public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
+    {
+        $outputStream = 'php://stdout';
+        if (!$this->hasStdoutSupport()) {
+            $outputStream = 'php://output';
+        }
+
+        parent::__construct(fopen($outputStream, 'w'), $verbosity, $decorated, $formatter);
+
+        $this->stderr = new StreamOutput(fopen('php://stderr', 'w'), $verbosity, $decorated, $formatter);
+    }
+
+    public function setDecorated($decorated)
+    {
+        parent::setDecorated($decorated);
+        $this->stderr->setDecorated($decorated);
+    }
+
+    public function setFormatter(OutputFormatterInterface $formatter)
+    {
+        parent::setFormatter($formatter);
+        $this->stderr->setFormatter($formatter);
+    }
+
+    public function setVerbosity($level)
+    {
+        parent::setVerbosity($level);
+        $this->stderr->setVerbosity($level);
+    }
+
+    /**
+     * @return OutputInterface
+     */
+    public function getErrorOutput()
+    {
+        return $this->stderr;
+    }
+
+    public function setErrorOutput(OutputInterface $error)
+    {
+        $this->stderr = $error;
+    }
+
+    /**
+     * Returns true if current environment supports writing console output to
+     * STDOUT.
+     *
+     * IBM iSeries (OS400) exhibits character-encoding issues when writing to
+     * STDOUT and doesn't properly convert ASCII to EBCDIC, resulting in garbage
+     * output.
+     *
+     * @return boolean
+     */
+    protected function hasStdoutSupport()
+    {
+        return ('OS400' != php_uname('s'));
+    }
+}

+ 30 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Output/ConsoleOutputInterface.php

@@ -0,0 +1,30 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Output;
+
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * ConsoleOutputInterface is the interface implemented by ConsoleOutput class.
+ * This adds information about stderr output stream.
+ *
+ * @author Dariusz Górecki <darek.krk@gmail.com>
+ */
+interface ConsoleOutputInterface extends OutputInterface
+{
+    /**
+     * @return OutputInterface
+     */
+    public function getErrorOutput();
+
+    public function setErrorOutput(OutputInterface $error);
+}

+ 34 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Output/NullOutput.php

@@ -0,0 +1,34 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Output;
+
+/**
+ * NullOutput suppresses all output.
+ *
+ *     $output = new NullOutput();
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @api
+ */
+class NullOutput extends Output
+{
+    /**
+     * Writes a message to the output.
+     *
+     * @param string  $message A message to write to the output
+     * @param Boolean $newline Whether to add a newline or not
+     */
+    protected function doWrite($message, $newline)
+    {
+    }
+}

+ 180 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Output/Output.php

@@ -0,0 +1,180 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Output;
+
+use Symfony\Component\Console\Formatter\OutputFormatterInterface;
+use Symfony\Component\Console\Formatter\OutputFormatter;
+
+/**
+ * Base class for output classes.
+ *
+ * There are three levels of verbosity:
+ *
+ *  * normal: no option passed (normal output - information)
+ *  * verbose: -v (more output - debug)
+ *  * quiet: -q (no output)
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @api
+ */
+abstract class Output implements OutputInterface
+{
+    private $verbosity;
+    private $formatter;
+
+    /**
+     * Constructor.
+     *
+     * @param integer                  $verbosity The verbosity level (self::VERBOSITY_QUIET, self::VERBOSITY_NORMAL, self::VERBOSITY_VERBOSE)
+     * @param Boolean                  $decorated Whether to decorate messages or not (null for auto-guessing)
+     * @param OutputFormatterInterface $formatter Output formatter instance
+     *
+     * @api
+     */
+    public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
+    {
+        $this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity;
+        $this->formatter = null === $formatter ? new OutputFormatter() : $formatter;
+        $this->formatter->setDecorated((Boolean) $decorated);
+    }
+
+    /**
+     * Sets output formatter.
+     *
+     * @param OutputFormatterInterface $formatter
+     *
+     * @api
+     */
+    public function setFormatter(OutputFormatterInterface $formatter)
+    {
+        $this->formatter = $formatter;
+    }
+
+    /**
+     * Returns current output formatter instance.
+     *
+     * @return  OutputFormatterInterface
+     *
+     * @api
+     */
+    public function getFormatter()
+    {
+        return $this->formatter;
+    }
+
+    /**
+     * Sets the decorated flag.
+     *
+     * @param Boolean $decorated Whether to decorate the messages or not
+     *
+     * @api
+     */
+    public function setDecorated($decorated)
+    {
+        $this->formatter->setDecorated((Boolean) $decorated);
+    }
+
+    /**
+     * Gets the decorated flag.
+     *
+     * @return Boolean true if the output will decorate messages, false otherwise
+     *
+     * @api
+     */
+    public function isDecorated()
+    {
+        return $this->formatter->isDecorated();
+    }
+
+    /**
+     * Sets the verbosity of the output.
+     *
+     * @param integer $level The level of verbosity
+     *
+     * @api
+     */
+    public function setVerbosity($level)
+    {
+        $this->verbosity = (int) $level;
+    }
+
+    /**
+     * Gets the current verbosity of the output.
+     *
+     * @return integer The current level of verbosity
+     *
+     * @api
+     */
+    public function getVerbosity()
+    {
+        return $this->verbosity;
+    }
+
+    /**
+     * Writes a message to the output and adds a newline at the end.
+     *
+     * @param string|array $messages The message as an array of lines or a single string
+     * @param integer      $type     The type of output
+     *
+     * @api
+     */
+    public function writeln($messages, $type = 0)
+    {
+        $this->write($messages, true, $type);
+    }
+
+    /**
+     * Writes a message to the output.
+     *
+     * @param string|array $messages The message as an array of lines or a single string
+     * @param Boolean      $newline  Whether to add a newline or not
+     * @param integer      $type     The type of output
+     *
+     * @throws \InvalidArgumentException When unknown output type is given
+     *
+     * @api
+     */
+    public function write($messages, $newline = false, $type = 0)
+    {
+        if (self::VERBOSITY_QUIET === $this->verbosity) {
+            return;
+        }
+
+        $messages = (array) $messages;
+
+        foreach ($messages as $message) {
+            switch ($type) {
+                case OutputInterface::OUTPUT_NORMAL:
+                    $message = $this->formatter->format($message);
+                    break;
+                case OutputInterface::OUTPUT_RAW:
+                    break;
+                case OutputInterface::OUTPUT_PLAIN:
+                    $message = strip_tags($this->formatter->format($message));
+                    break;
+                default:
+                    throw new \InvalidArgumentException(sprintf('Unknown output type given (%s)', $type));
+            }
+
+            $this->doWrite($message, $newline);
+        }
+    }
+
+    /**
+     * Writes a message to the output.
+     *
+     * @param string  $message A message to write to the output
+     * @param Boolean $newline Whether to add a newline or not
+     */
+    abstract protected function doWrite($message, $newline);
+}

+ 109 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Output/OutputInterface.php

@@ -0,0 +1,109 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Output;
+
+use Symfony\Component\Console\Formatter\OutputFormatterInterface;
+
+/**
+ * OutputInterface is the interface implemented by all Output classes.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @api
+ */
+interface OutputInterface
+{
+    const VERBOSITY_QUIET   = 0;
+    const VERBOSITY_NORMAL  = 1;
+    const VERBOSITY_VERBOSE = 2;
+
+    const OUTPUT_NORMAL = 0;
+    const OUTPUT_RAW = 1;
+    const OUTPUT_PLAIN = 2;
+
+    /**
+     * Writes a message to the output.
+     *
+     * @param string|array $messages The message as an array of lines or a single string
+     * @param Boolean      $newline  Whether to add a newline or not
+     * @param integer      $type     The type of output (0: normal, 1: raw, 2: plain)
+     *
+     * @throws \InvalidArgumentException When unknown output type is given
+     *
+     * @api
+     */
+    public function write($messages, $newline = false, $type = 0);
+
+    /**
+     * Writes a message to the output and adds a newline at the end.
+     *
+     * @param string|array $messages The message as an array of lines of a single string
+     * @param integer      $type     The type of output (0: normal, 1: raw, 2: plain)
+     *
+     * @api
+     */
+    public function writeln($messages, $type = 0);
+
+    /**
+     * Sets the verbosity of the output.
+     *
+     * @param integer $level The level of verbosity
+     *
+     * @api
+     */
+    public function setVerbosity($level);
+
+    /**
+     * Gets the current verbosity of the output.
+     *
+     * @return integer The current level of verbosity
+     *
+     * @api
+     */
+    public function getVerbosity();
+
+    /**
+     * Sets the decorated flag.
+     *
+     * @param Boolean $decorated Whether to decorate the messages or not
+     *
+     * @api
+     */
+    public function setDecorated($decorated);
+
+    /**
+     * Gets the decorated flag.
+     *
+     * @return Boolean true if the output will decorate messages, false otherwise
+     *
+     * @api
+     */
+    public function isDecorated();
+
+    /**
+     * Sets output formatter.
+     *
+     * @param OutputFormatterInterface $formatter
+     *
+     * @api
+     */
+    public function setFormatter(OutputFormatterInterface $formatter);
+
+    /**
+     * Returns current output formatter instance.
+     *
+     * @return  OutputFormatterInterface
+     *
+     * @api
+     */
+    public function getFormatter();
+}

+ 113 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Output/StreamOutput.php

@@ -0,0 +1,113 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Output;
+
+use Symfony\Component\Console\Formatter\OutputFormatterInterface;
+
+/**
+ * StreamOutput writes the output to a given stream.
+ *
+ * Usage:
+ *
+ * $output = new StreamOutput(fopen('php://stdout', 'w'));
+ *
+ * As `StreamOutput` can use any stream, you can also use a file:
+ *
+ * $output = new StreamOutput(fopen('/path/to/output.log', 'a', false));
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @api
+ */
+class StreamOutput extends Output
+{
+    private $stream;
+
+    /**
+     * Constructor.
+     *
+     * @param mixed                    $stream    A stream resource
+     * @param integer                  $verbosity The verbosity level (self::VERBOSITY_QUIET, self::VERBOSITY_NORMAL,
+     *                                                                 self::VERBOSITY_VERBOSE)
+     * @param Boolean                  $decorated Whether to decorate messages or not (null for auto-guessing)
+     * @param OutputFormatterInterface $formatter Output formatter instance
+     *
+     * @throws \InvalidArgumentException When first argument is not a real stream
+     *
+     * @api
+     */
+    public function __construct($stream, $verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
+    {
+        if (!is_resource($stream) || 'stream' !== get_resource_type($stream)) {
+            throw new \InvalidArgumentException('The StreamOutput class needs a stream as its first argument.');
+        }
+
+        $this->stream = $stream;
+
+        if (null === $decorated) {
+            $decorated = $this->hasColorSupport();
+        }
+
+        parent::__construct($verbosity, $decorated, $formatter);
+    }
+
+    /**
+     * Gets the stream attached to this StreamOutput instance.
+     *
+     * @return resource A stream resource
+     */
+    public function getStream()
+    {
+        return $this->stream;
+    }
+
+    /**
+     * Writes a message to the output.
+     *
+     * @param string  $message A message to write to the output
+     * @param Boolean $newline Whether to add a newline or not
+     *
+     * @throws \RuntimeException When unable to write output (should never happen)
+     */
+    protected function doWrite($message, $newline)
+    {
+        if (false === @fwrite($this->stream, $message.($newline ? PHP_EOL : ''))) {
+            // @codeCoverageIgnoreStart
+            // should never happen
+            throw new \RuntimeException('Unable to write output.');
+            // @codeCoverageIgnoreEnd
+        }
+
+        fflush($this->stream);
+    }
+
+    /**
+     * Returns true if the stream supports colorization.
+     *
+     * Colorization is disabled if not supported by the stream:
+     *
+     *  -  windows without ansicon and ConEmu
+     *  -  non tty consoles
+     *
+     * @return Boolean true if the stream supports colorization, false otherwise
+     */
+    protected function hasColorSupport()
+    {
+        // @codeCoverageIgnoreStart
+        if (DIRECTORY_SEPARATOR == '\\') {
+            return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI');
+        }
+
+        return function_exists('posix_isatty') && @posix_isatty($this->stream);
+        // @codeCoverageIgnoreEnd
+    }
+}

+ 63 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/README.md

@@ -0,0 +1,63 @@
+Console Component
+=================
+
+Console eases the creation of beautiful and testable command line interfaces.
+
+The Application object manages the CLI application:
+
+    use Symfony\Component\Console\Application;
+
+    $console = new Application();
+    $console->run();
+
+The ``run()`` method parses the arguments and options passed on the command
+line and executes the right command.
+
+Registering a new command can easily be done via the ``register()`` method,
+which returns a ``Command`` instance:
+
+    use Symfony\Component\Console\Input\InputInterface;
+    use Symfony\Component\Console\Input\InputArgument;
+    use Symfony\Component\Console\Input\InputOption;
+    use Symfony\Component\Console\Output\OutputInterface;
+
+    $console
+        ->register('ls')
+        ->setDefinition(array(
+            new InputArgument('dir', InputArgument::REQUIRED, 'Directory name'),
+        ))
+        ->setDescription('Displays the files in the given directory')
+        ->setCode(function (InputInterface $input, OutputInterface $output) {
+            $dir = $input->getArgument('dir');
+
+            $output->writeln(sprintf('Dir listing for <info>%s</info>', $dir));
+        })
+    ;
+
+You can also register new commands via classes.
+
+The component provides a lot of features like output coloring, input and
+output abstractions (so that you can easily unit-test your commands),
+validation, automatic help messages, ...
+
+Tests
+-----
+
+You can run the unit tests with the following command:
+
+    $ cd path/to/Symfony/Component/Console/
+    $ composer.phar install --dev
+    $ phpunit
+
+Third Party
+-----------
+
+`Resources/bin/hiddeninput.exe` is a third party binary provided within this
+component. Find sources and license at https://github.com/Seldaek/hidden-input.
+
+Resources
+---------
+
+[The Console Component](http://symfony.com/doc/current/components/console.html)
+
+[How to create a Console Command](http://symfony.com/doc/current/cookbook/console/console_command.html)

BIN
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Resources/bin/hiddeninput.exe


+ 211 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Shell.php

@@ -0,0 +1,211 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console;
+
+use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Input\StringInput;
+use Symfony\Component\Console\Output\ConsoleOutput;
+use Symfony\Component\Process\ProcessBuilder;
+use Symfony\Component\Process\PhpExecutableFinder;
+
+/**
+ * A Shell wraps an Application to add shell capabilities to it.
+ *
+ * Support for history and completion only works with a PHP compiled
+ * with readline support (either --with-readline or --with-libedit)
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ * @author Martin Hasoň <martin.hason@gmail.com>
+ */
+class Shell
+{
+    private $application;
+    private $history;
+    private $output;
+    private $hasReadline;
+    private $prompt;
+    private $processIsolation;
+
+    /**
+     * Constructor.
+     *
+     * If there is no readline support for the current PHP executable
+     * a \RuntimeException exception is thrown.
+     *
+     * @param Application $application An application instance
+     */
+    public function __construct(Application $application)
+    {
+        $this->hasReadline = function_exists('readline');
+        $this->application = $application;
+        $this->history = getenv('HOME').'/.history_'.$application->getName();
+        $this->output = new ConsoleOutput();
+        $this->prompt = $application->getName().' > ';
+        $this->processIsolation = false;
+    }
+
+    /**
+     * Runs the shell.
+     */
+    public function run()
+    {
+        $this->application->setAutoExit(false);
+        $this->application->setCatchExceptions(true);
+
+        if ($this->hasReadline) {
+            readline_read_history($this->history);
+            readline_completion_function(array($this, 'autocompleter'));
+        }
+
+        $this->output->writeln($this->getHeader());
+        $php = null;
+        if ($this->processIsolation) {
+            $finder = new PhpExecutableFinder();
+            $php = $finder->find();
+            $this->output->writeln(<<<EOF
+<info>Running with process isolation, you should consider this:</info>
+  * each command is executed as separate process,
+  * commands don't support interactivity, all params must be passed explicitly,
+  * commands output is not colorized.
+
+EOF
+            );
+        }
+
+        while (true) {
+            $command = $this->readline();
+
+            if (false === $command) {
+                $this->output->writeln("\n");
+
+                break;
+            }
+
+            if ($this->hasReadline) {
+                readline_add_history($command);
+                readline_write_history($this->history);
+            }
+
+            if ($this->processIsolation) {
+                $pb = new ProcessBuilder();
+
+                $process = $pb
+                    ->add($php)
+                    ->add($_SERVER['argv'][0])
+                    ->add($command)
+                    ->inheritEnvironmentVariables(true)
+                    ->getProcess()
+                ;
+
+                $output = $this->output;
+                $process->run(function($type, $data) use ($output) {
+                    $output->writeln($data);
+                });
+
+                $ret = $process->getExitCode();
+            } else {
+                $ret = $this->application->run(new StringInput($command), $this->output);
+            }
+
+            if (0 !== $ret) {
+                $this->output->writeln(sprintf('<error>The command terminated with an error status (%s)</error>', $ret));
+            }
+        }
+    }
+
+    /**
+     * Returns the shell header.
+     *
+     * @return string The header string
+     */
+    protected function getHeader()
+    {
+        return <<<EOF
+
+Welcome to the <info>{$this->application->getName()}</info> shell (<comment>{$this->application->getVersion()}</comment>).
+
+At the prompt, type <comment>help</comment> for some help,
+or <comment>list</comment> to get a list of available commands.
+
+To exit the shell, type <comment>^D</comment>.
+
+EOF;
+    }
+
+    /**
+     * Tries to return autocompletion for the current entered text.
+     *
+     * @param string $text The last segment of the entered text
+     *
+     * @return Boolean|array A list of guessed strings or true
+     */
+    private function autocompleter($text)
+    {
+        $info = readline_info();
+        $text = substr($info['line_buffer'], 0, $info['end']);
+
+        if ($info['point'] !== $info['end']) {
+            return true;
+        }
+
+        // task name?
+        if (false === strpos($text, ' ') || !$text) {
+            return array_keys($this->application->all());
+        }
+
+        // options and arguments?
+        try {
+            $command = $this->application->find(substr($text, 0, strpos($text, ' ')));
+        } catch (\Exception $e) {
+            return true;
+        }
+
+        $list = array('--help');
+        foreach ($command->getDefinition()->getOptions() as $option) {
+            $list[] = '--'.$option->getName();
+        }
+
+        return $list;
+    }
+
+    /**
+     * Reads a single line from standard input.
+     *
+     * @return string The single line from standard input
+     */
+    private function readline()
+    {
+        if ($this->hasReadline) {
+            $line = readline($this->prompt);
+        } else {
+            $this->output->write($this->prompt);
+            $line = fgets(STDIN, 1024);
+            $line = (!$line && strlen($line) == 0) ? false : rtrim($line);
+        }
+
+        return $line;
+    }
+
+    public function getProcessIsolation()
+    {
+        return $this->processIsolation;
+    }
+
+    public function setProcessIsolation($processIsolation)
+    {
+        $this->processIsolation = (Boolean) $processIsolation;
+
+        if ($this->processIsolation && !class_exists('Symfony\\Component\\Process\\Process')) {
+            throw new \RuntimeException('Unable to isolate processes as the Symfony Process Component is not installed.');
+        }
+    }
+}

+ 117 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tester/ApplicationTester.php

@@ -0,0 +1,117 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Tester;
+
+use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Input\ArrayInput;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Output\StreamOutput;
+
+/**
+ * Eases the testing of console applications.
+ *
+ * When testing an application, don't forget to disable the auto exit flag:
+ *
+ *     $application = new Application();
+ *     $application->setAutoExit(false);
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+class ApplicationTester
+{
+    private $application;
+    private $input;
+    private $output;
+
+    /**
+     * Constructor.
+     *
+     * @param Application $application An Application instance to test.
+     */
+    public function __construct(Application $application)
+    {
+        $this->application = $application;
+    }
+
+    /**
+     * Executes the application.
+     *
+     * Available options:
+     *
+     *  * interactive: Sets the input interactive flag
+     *  * decorated:   Sets the output decorated flag
+     *  * verbosity:   Sets the output verbosity flag
+     *
+     * @param array $input   An array of arguments and options
+     * @param array $options An array of options
+     *
+     * @return integer The command exit code
+     */
+    public function run(array $input, $options = array())
+    {
+        $this->input = new ArrayInput($input);
+        if (isset($options['interactive'])) {
+            $this->input->setInteractive($options['interactive']);
+        }
+
+        $this->output = new StreamOutput(fopen('php://memory', 'w', false));
+        if (isset($options['decorated'])) {
+            $this->output->setDecorated($options['decorated']);
+        }
+        if (isset($options['verbosity'])) {
+            $this->output->setVerbosity($options['verbosity']);
+        }
+
+        return $this->application->run($this->input, $this->output);
+    }
+
+    /**
+     * Gets the display returned by the last execution of the application.
+     *
+     * @param Boolean $normalize Whether to normalize end of lines to \n or not
+     *
+     * @return string The display
+     */
+    public function getDisplay($normalize = false)
+    {
+        rewind($this->output->getStream());
+
+        $display = stream_get_contents($this->output->getStream());
+
+        if ($normalize) {
+            $display = str_replace(PHP_EOL, "\n", $display);
+        }
+
+        return $display;
+    }
+
+    /**
+     * Gets the input instance used by the last execution of the application.
+     *
+     * @return InputInterface The current input instance
+     */
+    public function getInput()
+    {
+        return $this->input;
+    }
+
+    /**
+     * Gets the output instance used by the last execution of the application.
+     *
+     * @return OutputInterface The current output instance
+     */
+    public function getOutput()
+    {
+        return $this->output;
+    }
+}

+ 110 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tester/CommandTester.php

@@ -0,0 +1,110 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Tester;
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\ArrayInput;
+use Symfony\Component\Console\Output\StreamOutput;
+
+/**
+ * Eases the testing of console commands.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+class CommandTester
+{
+    private $command;
+    private $input;
+    private $output;
+
+    /**
+     * Constructor.
+     *
+     * @param Command $command A Command instance to test.
+     */
+    public function __construct(Command $command)
+    {
+        $this->command = $command;
+    }
+
+    /**
+     * Executes the command.
+     *
+     * Available options:
+     *
+     *  * interactive: Sets the input interactive flag
+     *  * decorated:   Sets the output decorated flag
+     *  * verbosity:   Sets the output verbosity flag
+     *
+     * @param array $input   An array of arguments and options
+     * @param array $options An array of options
+     *
+     * @return integer The command exit code
+     */
+    public function execute(array $input, array $options = array())
+    {
+        $this->input = new ArrayInput($input);
+        if (isset($options['interactive'])) {
+            $this->input->setInteractive($options['interactive']);
+        }
+
+        $this->output = new StreamOutput(fopen('php://memory', 'w', false));
+        if (isset($options['decorated'])) {
+            $this->output->setDecorated($options['decorated']);
+        }
+        if (isset($options['verbosity'])) {
+            $this->output->setVerbosity($options['verbosity']);
+        }
+
+        return $this->command->run($this->input, $this->output);
+    }
+
+    /**
+     * Gets the display returned by the last execution of the command.
+     *
+     * @param Boolean $normalize Whether to normalize end of lines to \n or not
+     *
+     * @return string The display
+     */
+    public function getDisplay($normalize = false)
+    {
+        rewind($this->output->getStream());
+
+        $display = stream_get_contents($this->output->getStream());
+
+        if ($normalize) {
+            $display = str_replace(PHP_EOL, "\n", $display);
+        }
+
+        return $display;
+    }
+
+    /**
+     * Gets the input instance used by the last execution of the command.
+     *
+     * @return InputInterface The current input instance
+     */
+    public function getInput()
+    {
+        return $this->input;
+    }
+
+    /**
+     * Gets the output instance used by the last execution of the command.
+     *
+     * @return OutputInterface The current output instance
+     */
+    public function getOutput()
+    {
+        return $this->output;
+    }
+}

+ 767 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/ApplicationTest.php

@@ -0,0 +1,767 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Tests;
+
+use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Helper\HelperSet;
+use Symfony\Component\Console\Helper\FormatterHelper;
+use Symfony\Component\Console\Input\ArrayInput;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputDefinition;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\NullOutput;
+use Symfony\Component\Console\Output\Output;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Tester\ApplicationTester;
+use Symfony\Component\Console\Event\ConsoleCommandEvent;
+use Symfony\Component\Console\Event\ConsoleForExceptionEvent;
+use Symfony\Component\Console\Event\ConsoleTerminateEvent;
+use Symfony\Component\EventDispatcher\EventDispatcher;
+
+class ApplicationTest extends \PHPUnit_Framework_TestCase
+{
+    protected static $fixturesPath;
+
+    public static function setUpBeforeClass()
+    {
+        self::$fixturesPath = realpath(__DIR__.'/Fixtures/');
+        require_once self::$fixturesPath.'/FooCommand.php';
+        require_once self::$fixturesPath.'/Foo1Command.php';
+        require_once self::$fixturesPath.'/Foo2Command.php';
+        require_once self::$fixturesPath.'/Foo3Command.php';
+        require_once self::$fixturesPath.'/Foo4Command.php';
+    }
+
+    protected function normalizeLineBreaks($text)
+    {
+        return str_replace(PHP_EOL, "\n", $text);
+    }
+
+    /**
+     * Replaces the dynamic placeholders of the command help text with a static version.
+     * The placeholder %command.full_name% includes the script path that is not predictable
+     * and can not be tested against.
+     */
+    protected function ensureStaticCommandHelp(Application $application)
+    {
+        foreach ($application->all() as $command) {
+            $command->setHelp(str_replace('%command.full_name%', 'app/console %command.name%', $command->getHelp()));
+        }
+    }
+
+    public function testConstructor()
+    {
+        $application = new Application('foo', 'bar');
+        $this->assertEquals('foo', $application->getName(), '__construct() takes the application name as its first argument');
+        $this->assertEquals('bar', $application->getVersion(), '__construct() takes the application version as its first argument');
+        $this->assertEquals(array('help', 'list'), array_keys($application->all()), '__construct() registered the help and list commands by default');
+    }
+
+    public function testSetGetName()
+    {
+        $application = new Application();
+        $application->setName('foo');
+        $this->assertEquals('foo', $application->getName(), '->setName() sets the name of the application');
+    }
+
+    public function testSetGetVersion()
+    {
+        $application = new Application();
+        $application->setVersion('bar');
+        $this->assertEquals('bar', $application->getVersion(), '->setVersion() sets the version of the application');
+    }
+
+    public function testGetLongVersion()
+    {
+        $application = new Application('foo', 'bar');
+        $this->assertEquals('<info>foo</info> version <comment>bar</comment>', $application->getLongVersion(), '->getLongVersion() returns the long version of the application');
+    }
+
+    public function testHelp()
+    {
+        $application = new Application();
+        $this->assertStringEqualsFile(self::$fixturesPath.'/application_gethelp.txt', $this->normalizeLineBreaks($application->getHelp()), '->setHelp() returns a help message');
+    }
+
+    public function testAll()
+    {
+        $application = new Application();
+        $commands = $application->all();
+        $this->assertEquals('Symfony\\Component\\Console\\Command\\HelpCommand', get_class($commands['help']), '->all() returns the registered commands');
+
+        $application->add(new \FooCommand());
+        $commands = $application->all('foo');
+        $this->assertEquals(1, count($commands), '->all() takes a namespace as its first argument');
+    }
+
+    public function testRegister()
+    {
+        $application = new Application();
+        $command = $application->register('foo');
+        $this->assertEquals('foo', $command->getName(), '->register() registers a new command');
+    }
+
+    public function testAdd()
+    {
+        $application = new Application();
+        $application->add($foo = new \FooCommand());
+        $commands = $application->all();
+        $this->assertEquals($foo, $commands['foo:bar'], '->add() registers a command');
+
+        $application = new Application();
+        $application->addCommands(array($foo = new \FooCommand(), $foo1 = new \Foo1Command()));
+        $commands = $application->all();
+        $this->assertEquals(array($foo, $foo1), array($commands['foo:bar'], $commands['foo:bar1']), '->addCommands() registers an array of commands');
+    }
+
+    public function testHasGet()
+    {
+        $application = new Application();
+        $this->assertTrue($application->has('list'), '->has() returns true if a named command is registered');
+        $this->assertFalse($application->has('afoobar'), '->has() returns false if a named command is not registered');
+
+        $application->add($foo = new \FooCommand());
+        $this->assertTrue($application->has('afoobar'), '->has() returns true if an alias is registered');
+        $this->assertEquals($foo, $application->get('foo:bar'), '->get() returns a command by name');
+        $this->assertEquals($foo, $application->get('afoobar'), '->get() returns a command by alias');
+
+        $application = new Application();
+        $application->add($foo = new \FooCommand());
+        // simulate --help
+        $r = new \ReflectionObject($application);
+        $p = $r->getProperty('wantHelps');
+        $p->setAccessible(true);
+        $p->setValue($application, true);
+        $command = $application->get('foo:bar');
+        $this->assertInstanceOf('Symfony\Component\Console\Command\HelpCommand', $command, '->get() returns the help command if --help is provided as the input');
+    }
+
+    /**
+     * @expectedException        \InvalidArgumentException
+     * @expectedExceptionMessage The command "foofoo" does not exist.
+     */
+    public function testGetInvalidCommand()
+    {
+        $application = new Application();
+        $application->get('foofoo');
+    }
+
+    public function testGetNamespaces()
+    {
+        $application = new Application();
+        $application->add(new \FooCommand());
+        $application->add(new \Foo1Command());
+        $this->assertEquals(array('foo'), $application->getNamespaces(), '->getNamespaces() returns an array of unique used namespaces');
+    }
+
+    public function testFindNamespace()
+    {
+        $application = new Application();
+        $application->add(new \FooCommand());
+        $this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns the given namespace if it exists');
+        $this->assertEquals('foo', $application->findNamespace('f'), '->findNamespace() finds a namespace given an abbreviation');
+        $application->add(new \Foo2Command());
+        $this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns the given namespace if it exists');
+    }
+
+    /**
+     * @expectedException        \InvalidArgumentException
+     * @expectedExceptionMessage The namespace "f" is ambiguous (foo, foo1).
+     */
+    public function testFindAmbiguousNamespace()
+    {
+        $application = new Application();
+        $application->add(new \FooCommand());
+        $application->add(new \Foo2Command());
+        $application->findNamespace('f');
+    }
+
+    /**
+     * @expectedException        \InvalidArgumentException
+     * @expectedExceptionMessage There are no commands defined in the "bar" namespace.
+     */
+    public function testFindInvalidNamespace()
+    {
+        $application = new Application();
+        $application->findNamespace('bar');
+    }
+
+    public function testFind()
+    {
+        $application = new Application();
+        $application->add(new \FooCommand());
+
+        $this->assertInstanceOf('FooCommand', $application->find('foo:bar'), '->find() returns a command if its name exists');
+        $this->assertInstanceOf('Symfony\Component\Console\Command\HelpCommand', $application->find('h'), '->find() returns a command if its name exists');
+        $this->assertInstanceOf('FooCommand', $application->find('f:bar'), '->find() returns a command if the abbreviation for the namespace exists');
+        $this->assertInstanceOf('FooCommand', $application->find('f:b'), '->find() returns a command if the abbreviation for the namespace and the command name exist');
+        $this->assertInstanceOf('FooCommand', $application->find('a'), '->find() returns a command if the abbreviation exists for an alias');
+    }
+
+    /**
+     * @dataProvider provideAmbiguousAbbreviations
+     */
+    public function testFindWithAmbiguousAbbreviations($abbreviation, $expectedExceptionMessage)
+    {
+        $this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage);
+
+        $application = new Application();
+        $application->add(new \FooCommand());
+        $application->add(new \Foo1Command());
+        $application->add(new \Foo2Command());
+
+        $application->find($abbreviation);
+    }
+
+    public function provideAmbiguousAbbreviations()
+    {
+        return array(
+            array('f', 'Command "f" is not defined.'),
+            array('a', 'Command "a" is ambiguous (afoobar, afoobar1 and 1 more).'),
+            array('foo:b', 'Command "foo:b" is ambiguous (foo:bar, foo:bar1).')
+        );
+    }
+
+    /**
+     * @dataProvider             provideInvalidCommandNamesSingle
+     * @expectedException        \InvalidArgumentException
+     * @expectedExceptionMessage Did you mean this
+     */
+    public function testFindAlternativeExceptionMessageSingle($name)
+    {
+        $application = new Application();
+        $application->add(new \FooCommand());
+        $application->find($name);
+    }
+
+    public function provideInvalidCommandNamesSingle()
+    {
+        return array(
+            array('foo:baR'),
+            array('foO:bar')
+        );
+    }
+
+    public function testFindAlternativeExceptionMessageMultiple()
+    {
+        $application = new Application();
+        $application->add(new \FooCommand());
+        $application->add(new \Foo1Command());
+        $application->add(new \Foo2Command());
+
+        // Command + plural
+        try {
+            $application->find('foo:baR');
+            $this->fail('->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
+        } catch (\Exception $e) {
+            $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
+            $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
+        }
+
+        // Namespace + plural
+        try {
+            $application->find('foo2:bar');
+            $this->fail('->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
+        } catch (\Exception $e) {
+            $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
+            $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
+        }
+
+        $application->add(new \Foo3Command());
+        $application->add(new \Foo4Command());
+
+        // Subnamespace + plural
+        try {
+            $a = $application->find('foo3:');
+            $this->fail('->find() should throw an \InvalidArgumentException if a command is ambiguous because of a subnamespace, with alternatives');
+        } catch (\Exception $e) {
+            $this->assertInstanceOf('\InvalidArgumentException', $e);
+            $this->assertRegExp('/foo3:bar/', $e->getMessage());
+            $this->assertRegExp('/foo3:bar:toh/', $e->getMessage());
+        }
+    }
+
+    public function testFindAlternativeCommands()
+    {
+        $application = new Application();
+
+        $application->add(new \FooCommand());
+        $application->add(new \Foo1Command());
+        $application->add(new \Foo2Command());
+
+        try {
+            $application->find($commandName = 'Unknown command');
+            $this->fail('->find() throws an \InvalidArgumentException if command does not exist');
+        } catch (\Exception $e) {
+            $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist');
+            $this->assertEquals(sprintf('Command "%s" is not defined.', $commandName), $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, without alternatives');
+        }
+
+        try {
+            $application->find($commandName = 'foo');
+            $this->fail('->find() throws an \InvalidArgumentException if command does not exist');
+        } catch (\Exception $e) {
+            $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist');
+            $this->assertRegExp(sprintf('/Command "%s" is not defined./', $commandName), $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
+            $this->assertRegExp('/foo:bar/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternative : "foo:bar"');
+            $this->assertRegExp('/foo1:bar/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternative : "foo1:bar"');
+            $this->assertRegExp('/foo:bar1/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternative : "foo:bar1"');
+        }
+
+        // Test if "foo1" command throw an "\InvalidArgumentException" and does not contain
+        // "foo:bar" as alternative because "foo1" is too far from "foo:bar"
+        try {
+            $application->find($commandName = 'foo1');
+            $this->fail('->find() throws an \InvalidArgumentException if command does not exist');
+        } catch (\Exception $e) {
+            $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist');
+            $this->assertRegExp(sprintf('/Command "%s" is not defined./', $commandName), $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
+            $this->assertFalse(strpos($e->getMessage(), 'foo:bar'), '->find() throws an \InvalidArgumentException if command does not exist, without "foo:bar" alternative');
+        }
+    }
+
+    public function testFindAlternativeNamespace()
+    {
+        $application = new Application();
+
+        $application->add(new \FooCommand());
+        $application->add(new \Foo1Command());
+        $application->add(new \Foo2Command());
+        $application->add(new \foo3Command());
+
+        try {
+            $application->find('Unknown-namespace:Unknown-command');
+            $this->fail('->find() throws an \InvalidArgumentException if namespace does not exist');
+        } catch (\Exception $e) {
+            $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if namespace does not exist');
+            $this->assertEquals('There are no commands defined in the "Unknown-namespace" namespace.', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, without alternatives');
+        }
+
+        try {
+            $application->find('foo2:command');
+            $this->fail('->find() throws an \InvalidArgumentException if namespace does not exist');
+        } catch (\Exception $e) {
+            $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if namespace does not exist');
+            $this->assertRegExp('/There are no commands defined in the "foo2" namespace./', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative');
+            $this->assertRegExp('/foo/', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative : "foo"');
+            $this->assertRegExp('/foo1/', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative : "foo1"');
+            $this->assertRegExp('/foo3/', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative : "foo3"');
+        }
+    }
+
+    public function testFindNamespaceDoesNotFailOnDeepSimilarNamespaces()
+    {
+        $application = $this->getMock('Symfony\Component\Console\Application', array('getNamespaces'));
+        $application->expects($this->once())
+            ->method('getNamespaces')
+            ->will($this->returnValue(array('foo:sublong', 'bar:sub')));
+
+        $this->assertEquals('foo:sublong', $application->findNamespace('f:sub'));
+    }
+
+    public function testSetCatchExceptions()
+    {
+        $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
+        $application->setAutoExit(false);
+        $application->expects($this->any())
+            ->method('getTerminalWidth')
+            ->will($this->returnValue(120));
+        $tester = new ApplicationTester($application);
+
+        $application->setCatchExceptions(true);
+        $tester->run(array('command' => 'foo'), array('decorated' => false));
+        $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $tester->getDisplay(true), '->setCatchExceptions() sets the catch exception flag');
+
+        $application->setCatchExceptions(false);
+        try {
+            $tester->run(array('command' => 'foo'), array('decorated' => false));
+            $this->fail('->setCatchExceptions() sets the catch exception flag');
+        } catch (\Exception $e) {
+            $this->assertInstanceOf('\Exception', $e, '->setCatchExceptions() sets the catch exception flag');
+            $this->assertEquals('Command "foo" is not defined.', $e->getMessage(), '->setCatchExceptions() sets the catch exception flag');
+        }
+    }
+
+    public function testAsText()
+    {
+        $application = new Application();
+        $application->add(new \FooCommand);
+        $this->ensureStaticCommandHelp($application);
+        $this->assertStringEqualsFile(self::$fixturesPath.'/application_astext1.txt', $this->normalizeLineBreaks($application->asText()), '->asText() returns a text representation of the application');
+        $this->assertStringEqualsFile(self::$fixturesPath.'/application_astext2.txt', $this->normalizeLineBreaks($application->asText('foo')), '->asText() returns a text representation of the application');
+    }
+
+    public function testAsXml()
+    {
+        $application = new Application();
+        $application->add(new \FooCommand);
+        $this->ensureStaticCommandHelp($application);
+        $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/application_asxml1.txt', $application->asXml(), '->asXml() returns an XML representation of the application');
+        $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/application_asxml2.txt', $application->asXml('foo'), '->asXml() returns an XML representation of the application');
+    }
+
+    public function testRenderException()
+    {
+        $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
+        $application->setAutoExit(false);
+        $application->expects($this->any())
+            ->method('getTerminalWidth')
+            ->will($this->returnValue(120));
+        $tester = new ApplicationTester($application);
+
+        $tester->run(array('command' => 'foo'), array('decorated' => false));
+        $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $tester->getDisplay(true), '->renderException() renders a pretty exception');
+
+        $tester->run(array('command' => 'foo'), array('decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE));
+        $this->assertContains('Exception trace', $tester->getDisplay(), '->renderException() renders a pretty exception with a stack trace when verbosity is verbose');
+
+        $tester->run(array('command' => 'list', '--foo' => true), array('decorated' => false));
+        $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception2.txt', $tester->getDisplay(true), '->renderException() renders the command synopsis when an exception occurs in the context of a command');
+
+        $application->add(new \Foo3Command);
+        $tester = new ApplicationTester($application);
+        $tester->run(array('command' => 'foo3:bar'), array('decorated' => false));
+        $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3.txt', $tester->getDisplay(true), '->renderException() renders a pretty exceptions with previous exceptions');
+
+        $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
+        $application->setAutoExit(false);
+        $application->expects($this->any())
+            ->method('getTerminalWidth')
+            ->will($this->returnValue(32));
+        $tester = new ApplicationTester($application);
+
+        $tester->run(array('command' => 'foo'), array('decorated' => false));
+        $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception4.txt', $tester->getDisplay(true), '->renderException() wraps messages when they are bigger than the terminal');
+    }
+
+    public function testRun()
+    {
+        $application = new Application();
+        $application->setAutoExit(false);
+        $application->setCatchExceptions(false);
+        $application->add($command = new \Foo1Command());
+        $_SERVER['argv'] = array('cli.php', 'foo:bar1');
+
+        ob_start();
+        $application->run();
+        ob_end_clean();
+
+        $this->assertSame('Symfony\Component\Console\Input\ArgvInput', get_class($command->input), '->run() creates an ArgvInput by default if none is given');
+        $this->assertSame('Symfony\Component\Console\Output\ConsoleOutput', get_class($command->output), '->run() creates a ConsoleOutput by default if none is given');
+
+        $application = new Application();
+        $application->setAutoExit(false);
+        $application->setCatchExceptions(false);
+
+        $this->ensureStaticCommandHelp($application);
+        $tester = new ApplicationTester($application);
+
+        $tester->run(array(), array('decorated' => false));
+        $this->assertStringEqualsFile(self::$fixturesPath.'/application_run1.txt', $tester->getDisplay(true), '->run() runs the list command if no argument is passed');
+
+        $tester->run(array('--help' => true), array('decorated' => false));
+        $this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $tester->getDisplay(true), '->run() runs the help command if --help is passed');
+
+        $tester->run(array('-h' => true), array('decorated' => false));
+        $this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $tester->getDisplay(true), '->run() runs the help command if -h is passed');
+
+        $tester->run(array('command' => 'list', '--help' => true), array('decorated' => false));
+        $this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $tester->getDisplay(true), '->run() displays the help if --help is passed');
+
+        $tester->run(array('command' => 'list', '-h' => true), array('decorated' => false));
+        $this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $tester->getDisplay(true), '->run() displays the help if -h is passed');
+
+        $tester->run(array('--ansi' => true));
+        $this->assertTrue($tester->getOutput()->isDecorated(), '->run() forces color output if --ansi is passed');
+
+        $tester->run(array('--no-ansi' => true));
+        $this->assertFalse($tester->getOutput()->isDecorated(), '->run() forces color output to be disabled if --no-ansi is passed');
+
+        $tester->run(array('--version' => true), array('decorated' => false));
+        $this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $tester->getDisplay(true), '->run() displays the program version if --version is passed');
+
+        $tester->run(array('-V' => true), array('decorated' => false));
+        $this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $tester->getDisplay(true), '->run() displays the program version if -v is passed');
+
+        $tester->run(array('command' => 'list', '--quiet' => true));
+        $this->assertSame('', $tester->getDisplay(), '->run() removes all output if --quiet is passed');
+
+        $tester->run(array('command' => 'list', '-q' => true));
+        $this->assertSame('', $tester->getDisplay(), '->run() removes all output if -q is passed');
+
+        $tester->run(array('command' => 'list', '--verbose' => true));
+        $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose is passed');
+
+        $tester->run(array('command' => 'list', '-v' => true));
+        $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if -v is passed');
+
+        $application = new Application();
+        $application->setAutoExit(false);
+        $application->setCatchExceptions(false);
+        $application->add(new \FooCommand());
+        $tester = new ApplicationTester($application);
+
+        $tester->run(array('command' => 'foo:bar', '--no-interaction' => true), array('decorated' => false));
+        $this->assertSame('called'.PHP_EOL, $tester->getDisplay(), '->run() does not call interact() if --no-interaction is passed');
+
+        $tester->run(array('command' => 'foo:bar', '-n' => true), array('decorated' => false));
+        $this->assertSame('called'.PHP_EOL, $tester->getDisplay(), '->run() does not call interact() if -n is passed');
+    }
+
+    /**
+     * @expectedException \LogicException
+     * @dataProvider getAddingAlreadySetDefinitionElementData
+     */
+    public function testAddingAlreadySetDefinitionElementData($def)
+    {
+        $application = new Application();
+        $application->setAutoExit(false);
+        $application->setCatchExceptions(false);
+        $application
+            ->register('foo')
+            ->setDefinition(array($def))
+            ->setCode(function (InputInterface $input, OutputInterface $output) {})
+        ;
+
+        $input = new ArrayInput(array('command' => 'foo'));
+        $output = new NullOutput();
+        $application->run($input, $output);
+    }
+
+    public function getAddingAlreadySetDefinitionElementData()
+    {
+        return array(
+            array(new InputArgument('command', InputArgument::REQUIRED)),
+            array(new InputOption('quiet', '', InputOption::VALUE_NONE)),
+            array(new InputOption('query', 'q', InputOption::VALUE_NONE)),
+        );
+    }
+
+    public function testGetDefaultHelperSetReturnsDefaultValues()
+    {
+        $application = new Application();
+        $application->setAutoExit(false);
+        $application->setCatchExceptions(false);
+
+        $helperSet = $application->getHelperSet();
+
+        $this->assertTrue($helperSet->has('formatter'));
+        $this->assertTrue($helperSet->has('dialog'));
+        $this->assertTrue($helperSet->has('progress'));
+    }
+
+    public function testAddingSingleHelperSetOverwritesDefaultValues()
+    {
+        $application = new Application();
+        $application->setAutoExit(false);
+        $application->setCatchExceptions(false);
+
+        $application->setHelperSet(new HelperSet(array(new FormatterHelper())));
+
+        $helperSet = $application->getHelperSet();
+
+        $this->assertTrue($helperSet->has('formatter'));
+
+        // no other default helper set should be returned
+        $this->assertFalse($helperSet->has('dialog'));
+        $this->assertFalse($helperSet->has('progress'));
+    }
+
+    public function testOverwritingDefaultHelperSetOverwritesDefaultValues()
+    {
+        $application = new CustomApplication();
+        $application->setAutoExit(false);
+        $application->setCatchExceptions(false);
+
+        $application->setHelperSet(new HelperSet(array(new FormatterHelper())));
+
+        $helperSet = $application->getHelperSet();
+
+        $this->assertTrue($helperSet->has('formatter'));
+
+        // no other default helper set should be returned
+        $this->assertFalse($helperSet->has('dialog'));
+        $this->assertFalse($helperSet->has('progress'));
+    }
+
+    public function testGetDefaultInputDefinitionReturnsDefaultValues()
+    {
+        $application = new Application();
+        $application->setAutoExit(false);
+        $application->setCatchExceptions(false);
+
+        $inputDefinition = $application->getDefinition();
+
+        $this->assertTrue($inputDefinition->hasArgument('command'));
+
+        $this->assertTrue($inputDefinition->hasOption('help'));
+        $this->assertTrue($inputDefinition->hasOption('quiet'));
+        $this->assertTrue($inputDefinition->hasOption('verbose'));
+        $this->assertTrue($inputDefinition->hasOption('version'));
+        $this->assertTrue($inputDefinition->hasOption('ansi'));
+        $this->assertTrue($inputDefinition->hasOption('no-ansi'));
+        $this->assertTrue($inputDefinition->hasOption('no-interaction'));
+    }
+
+    public function testOverwritingDefaultInputDefinitionOverwritesDefaultValues()
+    {
+        $application = new CustomApplication();
+        $application->setAutoExit(false);
+        $application->setCatchExceptions(false);
+
+        $inputDefinition = $application->getDefinition();
+
+        // check whether the default arguments and options are not returned any more
+        $this->assertFalse($inputDefinition->hasArgument('command'));
+
+        $this->assertFalse($inputDefinition->hasOption('help'));
+        $this->assertFalse($inputDefinition->hasOption('quiet'));
+        $this->assertFalse($inputDefinition->hasOption('verbose'));
+        $this->assertFalse($inputDefinition->hasOption('version'));
+        $this->assertFalse($inputDefinition->hasOption('ansi'));
+        $this->assertFalse($inputDefinition->hasOption('no-ansi'));
+        $this->assertFalse($inputDefinition->hasOption('no-interaction'));
+
+        $this->assertTrue($inputDefinition->hasOption('custom'));
+    }
+
+    public function testSettingCustomInputDefinitionOverwritesDefaultValues()
+    {
+        $application = new Application();
+        $application->setAutoExit(false);
+        $application->setCatchExceptions(false);
+
+        $application->setDefinition(new InputDefinition(array(new InputOption('--custom', '-c', InputOption::VALUE_NONE, 'Set the custom input definition.'))));
+
+        $inputDefinition = $application->getDefinition();
+
+        // check whether the default arguments and options are not returned any more
+        $this->assertFalse($inputDefinition->hasArgument('command'));
+
+        $this->assertFalse($inputDefinition->hasOption('help'));
+        $this->assertFalse($inputDefinition->hasOption('quiet'));
+        $this->assertFalse($inputDefinition->hasOption('verbose'));
+        $this->assertFalse($inputDefinition->hasOption('version'));
+        $this->assertFalse($inputDefinition->hasOption('ansi'));
+        $this->assertFalse($inputDefinition->hasOption('no-ansi'));
+        $this->assertFalse($inputDefinition->hasOption('no-interaction'));
+
+        $this->assertTrue($inputDefinition->hasOption('custom'));
+    }
+
+    public function testRunWithDispatcher()
+    {
+        if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
+            $this->markTestSkipped('The "EventDispatcher" component is not available');
+        }
+
+        $application = new Application();
+        $application->setAutoExit(false);
+        $application->setDispatcher($this->getDispatcher());
+
+        $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) {
+            $output->write('foo.');
+        });
+
+        $tester = new ApplicationTester($application);
+        $tester->run(array('command' => 'foo'));
+        $this->assertEquals('before.foo.after.', $tester->getDisplay());
+    }
+
+    /**
+     * @expectedException        \LogicException
+     * @expectedExceptionMessage caught
+     */
+    public function testRunWithExceptionAndDispatcher()
+    {
+        if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
+            $this->markTestSkipped('The "EventDispatcher" component is not available');
+        }
+
+        $application = new Application();
+        $application->setDispatcher($this->getDispatcher());
+        $application->setAutoExit(false);
+        $application->setCatchExceptions(false);
+
+        $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) {
+            throw new \RuntimeException('foo');
+        });
+
+        $tester = new ApplicationTester($application);
+        $tester->run(array('command' => 'foo'));
+    }
+
+    public function testRunDispatchesAllEventsWithException()
+    {
+        if (!class_exists('Symfony\Component\EventDispatcher\EventDispatcher')) {
+            $this->markTestSkipped('The "EventDispatcher" component is not available');
+        }
+
+        $application = new Application();
+        $application->setDispatcher($this->getDispatcher());
+        $application->setAutoExit(false);
+
+        $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) {
+            $output->write('foo.');
+
+            throw new \RuntimeException('foo');
+        });
+
+        $tester = new ApplicationTester($application);
+        $tester->run(array('command' => 'foo'));
+        $this->assertContains('before.foo.after.caught.', $tester->getDisplay());
+    }
+
+    protected function getDispatcher()
+    {
+        $dispatcher = new EventDispatcher;
+        $dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) {
+            $event->getOutput()->write('before.');
+        });
+        $dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) {
+            $event->getOutput()->write('after.');
+
+            $event->setExitCode(128);
+        });
+        $dispatcher->addListener('console.exception', function (ConsoleForExceptionEvent $event) {
+            $event->getOutput()->writeln('caught.');
+
+            $event->setException(new \LogicException('caught.', $event->getExitCode(), $event->getException()));
+        });
+
+        return $dispatcher;
+    }
+}
+
+class CustomApplication extends Application
+{
+    /**
+     * Overwrites the default input definition.
+     *
+     * @return InputDefinition An InputDefinition instance
+     */
+    protected function getDefaultInputDefinition()
+    {
+        return new InputDefinition(array(new InputOption('--custom', '-c', InputOption::VALUE_NONE, 'Set the custom input definition.')));
+    }
+
+    /**
+     * Gets the default helper set with the helpers that should always be available.
+     *
+     * @return HelperSet A HelperSet instance
+     */
+    protected function getDefaultHelperSet()
+    {
+        return new HelperSet(array(new FormatterHelper()));
+    }
+}

+ 301 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Command/CommandTest.php

@@ -0,0 +1,301 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Tests\Command;
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Helper\FormatterHelper;
+use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Input\InputDefinition;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\StringInput;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Output\NullOutput;
+use Symfony\Component\Console\Tester\CommandTester;
+
+class CommandTest extends \PHPUnit_Framework_TestCase
+{
+    protected static $fixturesPath;
+
+    public static function setUpBeforeClass()
+    {
+        self::$fixturesPath = __DIR__.'/../Fixtures/';
+        require_once self::$fixturesPath.'/TestCommand.php';
+    }
+
+    public function testConstructor()
+    {
+        $command = new Command('foo:bar');
+        $this->assertEquals('foo:bar', $command->getName(), '__construct() takes the command name as its first argument');
+    }
+
+    /**
+     * @expectedException        \LogicException
+     * @expectedExceptionMessage The command name cannot be empty.
+     */
+    public function testCommandNameCannotBeEmpty()
+    {
+        new Command();
+    }
+
+    public function testSetApplication()
+    {
+        $application = new Application();
+        $command = new \TestCommand();
+        $command->setApplication($application);
+        $this->assertEquals($application, $command->getApplication(), '->setApplication() sets the current application');
+    }
+
+    public function testSetGetDefinition()
+    {
+        $command = new \TestCommand();
+        $ret = $command->setDefinition($definition = new InputDefinition());
+        $this->assertEquals($command, $ret, '->setDefinition() implements a fluent interface');
+        $this->assertEquals($definition, $command->getDefinition(), '->setDefinition() sets the current InputDefinition instance');
+        $command->setDefinition(array(new InputArgument('foo'), new InputOption('bar')));
+        $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->setDefinition() also takes an array of InputArguments and InputOptions as an argument');
+        $this->assertTrue($command->getDefinition()->hasOption('bar'), '->setDefinition() also takes an array of InputArguments and InputOptions as an argument');
+        $command->setDefinition(new InputDefinition());
+    }
+
+    public function testAddArgument()
+    {
+        $command = new \TestCommand();
+        $ret = $command->addArgument('foo');
+        $this->assertEquals($command, $ret, '->addArgument() implements a fluent interface');
+        $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->addArgument() adds an argument to the command');
+    }
+
+    public function testAddOption()
+    {
+        $command = new \TestCommand();
+        $ret = $command->addOption('foo');
+        $this->assertEquals($command, $ret, '->addOption() implements a fluent interface');
+        $this->assertTrue($command->getDefinition()->hasOption('foo'), '->addOption() adds an option to the command');
+    }
+
+    public function testGetNamespaceGetNameSetName()
+    {
+        $command = new \TestCommand();
+        $this->assertEquals('namespace:name', $command->getName(), '->getName() returns the command name');
+        $command->setName('foo');
+        $this->assertEquals('foo', $command->getName(), '->setName() sets the command name');
+
+        $ret = $command->setName('foobar:bar');
+        $this->assertEquals($command, $ret, '->setName() implements a fluent interface');
+        $this->assertEquals('foobar:bar', $command->getName(), '->setName() sets the command name');
+    }
+
+    /**
+     * @dataProvider provideInvalidCommandNames
+     */
+    public function testInvalidCommandNames($name)
+    {
+        $this->setExpectedException('InvalidArgumentException', sprintf('Command name "%s" is invalid.', $name));
+
+        $command = new \TestCommand();
+        $command->setName($name);
+    }
+
+    public function provideInvalidCommandNames()
+    {
+        return array(
+            array(''),
+            array('foo:')
+        );
+    }
+
+    public function testGetSetDescription()
+    {
+        $command = new \TestCommand();
+        $this->assertEquals('description', $command->getDescription(), '->getDescription() returns the description');
+        $ret = $command->setDescription('description1');
+        $this->assertEquals($command, $ret, '->setDescription() implements a fluent interface');
+        $this->assertEquals('description1', $command->getDescription(), '->setDescription() sets the description');
+    }
+
+    public function testGetSetHelp()
+    {
+        $command = new \TestCommand();
+        $this->assertEquals('help', $command->getHelp(), '->getHelp() returns the help');
+        $ret = $command->setHelp('help1');
+        $this->assertEquals($command, $ret, '->setHelp() implements a fluent interface');
+        $this->assertEquals('help1', $command->getHelp(), '->setHelp() sets the help');
+    }
+
+    public function testGetProcessedHelp()
+    {
+        $command = new \TestCommand();
+        $command->setHelp('The %command.name% command does... Example: php %command.full_name%.');
+        $this->assertContains('The namespace:name command does...', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.name% correctly');
+        $this->assertNotContains('%command.full_name%', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.full_name%');
+    }
+
+    public function testGetSetAliases()
+    {
+        $command = new \TestCommand();
+        $this->assertEquals(array('name'), $command->getAliases(), '->getAliases() returns the aliases');
+        $ret = $command->setAliases(array('name1'));
+        $this->assertEquals($command, $ret, '->setAliases() implements a fluent interface');
+        $this->assertEquals(array('name1'), $command->getAliases(), '->setAliases() sets the aliases');
+    }
+
+    public function testGetSynopsis()
+    {
+        $command = new \TestCommand();
+        $command->addOption('foo');
+        $command->addArgument('foo');
+        $this->assertEquals('namespace:name [--foo] [foo]', $command->getSynopsis(), '->getSynopsis() returns the synopsis');
+    }
+
+    public function testGetHelper()
+    {
+        $application = new Application();
+        $command = new \TestCommand();
+        $command->setApplication($application);
+        $formatterHelper = new FormatterHelper();
+        $this->assertEquals($formatterHelper->getName(), $command->getHelper('formatter')->getName(), '->getHelper() returns the correct helper');
+    }
+
+    public function testGet()
+    {
+        $application = new Application();
+        $command = new \TestCommand();
+        $command->setApplication($application);
+        $formatterHelper = new FormatterHelper();
+        $this->assertEquals($formatterHelper->getName(), $command->getHelper('formatter')->getName(), '->__get() returns the correct helper');
+    }
+
+    public function testMergeApplicationDefinition()
+    {
+        $application1 = new Application();
+        $application1->getDefinition()->addArguments(array(new InputArgument('foo')));
+        $application1->getDefinition()->addOptions(array(new InputOption('bar')));
+        $command = new \TestCommand();
+        $command->setApplication($application1);
+        $command->setDefinition($definition = new InputDefinition(array(new InputArgument('bar'), new InputOption('foo'))));
+
+        $r = new \ReflectionObject($command);
+        $m = $r->getMethod('mergeApplicationDefinition');
+        $m->setAccessible(true);
+        $m->invoke($command);
+        $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->mergeApplicationDefinition() merges the application arguments and the command arguments');
+        $this->assertTrue($command->getDefinition()->hasArgument('bar'), '->mergeApplicationDefinition() merges the application arguments and the command arguments');
+        $this->assertTrue($command->getDefinition()->hasOption('foo'), '->mergeApplicationDefinition() merges the application options and the command options');
+        $this->assertTrue($command->getDefinition()->hasOption('bar'), '->mergeApplicationDefinition() merges the application options and the command options');
+
+        $m->invoke($command);
+        $this->assertEquals(3, $command->getDefinition()->getArgumentCount(), '->mergeApplicationDefinition() does not try to merge twice the application arguments and options');
+    }
+
+    public function testRunInteractive()
+    {
+        $tester = new CommandTester(new \TestCommand());
+
+        $tester->execute(array(), array('interactive' => true));
+
+        $this->assertEquals('interact called'.PHP_EOL.'execute called'.PHP_EOL, $tester->getDisplay(), '->run() calls the interact() method if the input is interactive');
+    }
+
+    public function testRunNonInteractive()
+    {
+        $tester = new CommandTester(new \TestCommand());
+
+        $tester->execute(array(), array('interactive' => false));
+
+        $this->assertEquals('execute called'.PHP_EOL, $tester->getDisplay(), '->run() does not call the interact() method if the input is not interactive');
+    }
+
+    /**
+     * @expectedException        \LogicException
+     * @expectedExceptionMessage You must override the execute() method in the concrete command class.
+     */
+    public function testExecuteMethodNeedsToBeOverriden()
+    {
+        $command = new Command('foo');
+        $command->run(new StringInput(''), new NullOutput());
+    }
+
+    /**
+     * @expectedException        \InvalidArgumentException
+     * @expectedExceptionMessage The "--bar" option does not exist.
+     */
+    public function testRunWithInvalidOption()
+    {
+        $command = new \TestCommand();
+        $tester = new CommandTester($command);
+        $tester->execute(array('--bar' => true));
+    }
+
+    public function testRunReturnsAlwaysInteger()
+    {
+        $command = new \TestCommand();
+
+        $this->assertSame(0, $command->run(new StringInput(''), new NullOutput()));
+    }
+
+    public function testSetCode()
+    {
+        $command = new \TestCommand();
+        $ret = $command->setCode(function (InputInterface $input, OutputInterface $output) {
+            $output->writeln('from the code...');
+        });
+        $this->assertEquals($command, $ret, '->setCode() implements a fluent interface');
+        $tester = new CommandTester($command);
+        $tester->execute(array());
+        $this->assertEquals('interact called'.PHP_EOL.'from the code...'.PHP_EOL, $tester->getDisplay());
+    }
+
+    public function testSetCodeWithNonClosureCallable()
+    {
+        $command = new \TestCommand();
+        $ret = $command->setCode(array($this, 'callableMethodCommand'));
+        $this->assertEquals($command, $ret, '->setCode() implements a fluent interface');
+        $tester = new CommandTester($command);
+        $tester->execute(array());
+        $this->assertEquals('interact called'.PHP_EOL.'from the code...'.PHP_EOL, $tester->getDisplay());
+    }
+
+    /**
+     * @expectedException        \InvalidArgumentException
+     * @expectedExceptionMessage Invalid callable provided to Command::setCode.
+     */
+    public function testSetCodeWithNonCallable()
+    {
+        $command = new \TestCommand();
+        $command->setCode(array($this, 'nonExistentMethod'));
+    }
+
+    public function callableMethodCommand(InputInterface $input, OutputInterface $output)
+    {
+        $output->writeln('from the code...');
+    }
+
+    public function testAsText()
+    {
+        $command = new \TestCommand();
+        $command->setApplication(new Application());
+        $tester = new CommandTester($command);
+        $tester->execute(array('command' => $command->getName()));
+        $this->assertStringEqualsFile(self::$fixturesPath.'/command_astext.txt', $command->asText(), '->asText() returns a text representation of the command');
+    }
+
+    public function testAsXml()
+    {
+        $command = new \TestCommand();
+        $command->setApplication(new Application());
+        $tester = new CommandTester($command);
+        $tester->execute(array('command' => $command->getName()));
+        $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/command_asxml.txt', $command->asXml(), '->asXml() returns an XML representation of the command');
+    }
+}

+ 68 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Command/HelpCommandTest.php

@@ -0,0 +1,68 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Tests\Command;
+
+use Symfony\Component\Console\Tester\CommandTester;
+use Symfony\Component\Console\Command\HelpCommand;
+use Symfony\Component\Console\Command\ListCommand;
+use Symfony\Component\Console\Application;
+
+class HelpCommandTest extends \PHPUnit_Framework_TestCase
+{
+    public function testExecuteForCommandAlias()
+    {
+        $command = new HelpCommand();
+        $command->setApplication(new Application());
+        $commandTester = new CommandTester($command);
+        $commandTester->execute(array('command_name' => 'li'));
+
+        $this->assertRegExp('/list \[--xml\] \[--raw\] \[namespace\]/', $commandTester->getDisplay(), '->execute() returns a text help for the given command alias');
+    }
+
+    public function testExecuteForCommand()
+    {
+        $command = new HelpCommand();
+        $commandTester = new CommandTester($command);
+        $command->setCommand(new ListCommand());
+        $commandTester->execute(array());
+
+        $this->assertRegExp('/list \[--xml\] \[--raw\] \[namespace\]/', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
+    }
+
+    public function testExecuteForCommandWithXmlOption()
+    {
+        $command = new HelpCommand();
+        $commandTester = new CommandTester($command);
+        $command->setCommand(new ListCommand());
+        $commandTester->execute(array('--xml' => true));
+
+        $this->assertRegExp('/<command/', $commandTester->getDisplay(), '->execute() returns an XML help text if --xml is passed');
+    }
+
+    public function testExecuteForApplicationCommand()
+    {
+        $application = new Application();
+        $commandTester = new CommandTester($application->get('help'));
+        $commandTester->execute(array('command_name' => 'list'));
+
+        $this->assertRegExp('/list \[--xml\] \[--raw\] \[namespace\]/', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
+    }
+
+    public function testExecuteForApplicationCommandWithXmlOption()
+    {
+        $application = new Application();
+        $commandTester = new CommandTester($application->get('help'));
+        $commandTester->execute(array('command_name' => 'list', '--xml' => true));
+
+        $this->assertRegExp('/<command/', $commandTester->getDisplay(), '->execute() returns an XML help text if --xml is passed');
+    }
+}

+ 50 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Command/ListCommandTest.php

@@ -0,0 +1,50 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Tests\Command;
+
+use Symfony\Component\Console\Tester\CommandTester;
+use Symfony\Component\Console\Application;
+
+class ListCommandTest extends \PHPUnit_Framework_TestCase
+{
+    public function testExecuteListsCommands()
+    {
+        $application = new Application();
+        $commandTester = new CommandTester($command = $application->get('list'));
+        $commandTester->execute(array('command' => $command->getName()), array('decorated' => false));
+
+        $this->assertRegExp('/help   Displays help for a command/', $commandTester->getDisplay(), '->execute() returns a list of available commands');
+    }
+
+    public function testExecuteListsCommandsWithXmlOption()
+    {
+        $application = new Application();
+        $commandTester = new CommandTester($command = $application->get('list'));
+        $commandTester->execute(array('command' => $command->getName(), '--xml' => true));
+
+        $this->assertRegExp('/<command id="list" name="list">/', $commandTester->getDisplay(), '->execute() returns a list of available commands in XML if --xml is passed');
+    }
+
+    public function testExecuteListsCommandsWithRawOption()
+    {
+        $application = new Application();
+        $commandTester = new CommandTester($command = $application->get('list'));
+        $commandTester->execute(array('command' => $command->getName(), '--raw' => true));
+        $output = <<<EOF
+help   Displays help for a command
+list   Lists commands
+
+EOF;
+
+        $this->assertEquals(str_replace("\n", PHP_EOL, $output), $commandTester->getDisplay());
+    }
+}

+ 26 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo1Command.php

@@ -0,0 +1,26 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class Foo1Command extends Command
+{
+    public $input;
+    public $output;
+
+    protected function configure()
+    {
+        $this
+            ->setName('foo:bar1')
+            ->setDescription('The foo:bar1 command')
+            ->setAliases(array('afoobar1'))
+        ;
+    }
+
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+        $this->input = $input;
+        $this->output = $output;
+    }
+}

+ 21 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo2Command.php

@@ -0,0 +1,21 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class Foo2Command extends Command
+{
+    protected function configure()
+    {
+        $this
+            ->setName('foo1:bar')
+            ->setDescription('The foo1:bar command')
+            ->setAliases(array('afoobar2'))
+        ;
+    }
+
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+    }
+}

+ 25 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo3Command.php

@@ -0,0 +1,25 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class Foo3Command extends Command
+{
+    protected function configure()
+    {
+        $this
+            ->setName('foo3:bar')
+            ->setDescription('The foo3:bar command')
+        ;
+    }
+
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+        try {
+            throw new \Exception("First exception");
+        } catch (\Exception $e) {
+            throw new \Exception("Second exception", 0, $e);
+        }
+    }
+}

+ 11 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo4Command.php

@@ -0,0 +1,11 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+
+class Foo4Command extends Command
+{
+    protected function configure()
+    {
+        $this->setName('foo3:bar:toh');
+    }
+}

+ 33 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/FooCommand.php

@@ -0,0 +1,33 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class FooCommand extends Command
+{
+    public $input;
+    public $output;
+
+    protected function configure()
+    {
+        $this
+            ->setName('foo:bar')
+            ->setDescription('The foo:bar command')
+            ->setAliases(array('afoobar'))
+        ;
+    }
+
+    protected function interact(InputInterface $input, OutputInterface $output)
+    {
+        $output->writeln('interact called');
+    }
+
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+        $this->input = $input;
+        $this->output = $output;
+
+        $output->writeln('called');
+    }
+}

+ 28 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/TestCommand.php

@@ -0,0 +1,28 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class TestCommand extends Command
+{
+    protected function configure()
+    {
+        $this
+            ->setName('namespace:name')
+            ->setAliases(array('name'))
+            ->setDescription('description')
+            ->setHelp('help')
+        ;
+    }
+
+    protected function execute(InputInterface $input, OutputInterface $output)
+    {
+        $output->writeln('execute called');
+    }
+
+    protected function interact(InputInterface $input, OutputInterface $output)
+    {
+        $output->writeln('interact called');
+    }
+}

+ 20 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt

@@ -0,0 +1,20 @@
+<info>Console Tool</info>
+
+<comment>Usage:</comment>
+  [options] command [arguments]
+
+<comment>Options:</comment>
+  <info>--help</info>           <info>-h</info> Display this help message.
+  <info>--quiet</info>          <info>-q</info> Do not output any message.
+  <info>--verbose</info>        <info>-v</info> Increase verbosity of messages.
+  <info>--version</info>        <info>-V</info> Display this application version.
+  <info>--ansi</info>              Force ANSI output.
+  <info>--no-ansi</info>           Disable ANSI output.
+  <info>--no-interaction</info> <info>-n</info> Do not ask any interactive question.
+
+<comment>Available commands:</comment>
+  <info>afoobar  </info> The foo:bar command
+  <info>help     </info> Displays help for a command
+  <info>list     </info> Lists commands
+<comment>foo</comment>
+  <info>foo:bar  </info> The foo:bar command

+ 16 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt

@@ -0,0 +1,16 @@
+<info>Console Tool</info>
+
+<comment>Usage:</comment>
+  [options] command [arguments]
+
+<comment>Options:</comment>
+  <info>--help</info>           <info>-h</info> Display this help message.
+  <info>--quiet</info>          <info>-q</info> Do not output any message.
+  <info>--verbose</info>        <info>-v</info> Increase verbosity of messages.
+  <info>--version</info>        <info>-V</info> Display this application version.
+  <info>--ansi</info>              Force ANSI output.
+  <info>--no-ansi</info>           Disable ANSI output.
+  <info>--no-interaction</info> <info>-n</info> Do not ask any interactive question.
+
+<comment>Available commands for the "foo" namespace:</comment>
+  <info>foo:bar  </info> The foo:bar command

+ 128 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt

@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<symfony>
+  <commands>
+    <command id="help" name="help">
+  <usage>help [--xml] [command_name]</usage>
+  <description>Displays help for a command</description>
+  <help>The &lt;info&gt;help&lt;/info&gt; command displays help for a given command:
+ 
+   &lt;info&gt;php app/console help list&lt;/info&gt;
+ 
+ You can also output the help as XML by using the &lt;comment&gt;--xml&lt;/comment&gt; option:
+ 
+   &lt;info&gt;php app/console help --xml list&lt;/info&gt;
+ 
+ To display the list of available commands, please use the &lt;info&gt;list&lt;/info&gt; command.</help>
+  <aliases />
+  <arguments>
+    <argument name="command_name" is_required="0" is_array="0">
+      <description>The command name</description>
+      <defaults>
+        <default>help</default>
+      </defaults>
+    </argument>
+  </arguments>
+  <options>
+    <option name="--xml" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
+      <description>To output help as XML</description>
+    </option>
+    <option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
+      <description>Display this help message.</description>
+    </option>
+    <option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
+      <description>Do not output any message.</description>
+    </option>
+    <option name="--verbose" shortcut="-v" accept_value="0" is_value_required="0" is_multiple="0">
+      <description>Increase verbosity of messages.</description>
+    </option>
+    <option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
+      <description>Display this application version.</description>
+    </option>
+    <option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
+      <description>Force ANSI output.</description>
+    </option>
+    <option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
+      <description>Disable ANSI output.</description>
+    </option>
+    <option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
+      <description>Do not ask any interactive question.</description>
+    </option>
+  </options>
+</command>
+    <command id="list" name="list">
+  <usage>list [--xml] [--raw] [namespace]</usage>
+  <description>Lists commands</description>
+  <help>The &lt;info&gt;list&lt;/info&gt; command lists all commands:
+ 
+   &lt;info&gt;php app/console list&lt;/info&gt;
+ 
+ You can also display the commands for a specific namespace:
+ 
+   &lt;info&gt;php app/console list test&lt;/info&gt;
+ 
+ You can also output the information as XML by using the &lt;comment&gt;--xml&lt;/comment&gt; option:
+ 
+   &lt;info&gt;php app/console list --xml&lt;/info&gt;
+ 
+ It's also possible to get raw list of commands (useful for embedding command runner):
+ 
+   &lt;info&gt;php app/console list --raw&lt;/info&gt;</help>
+  <aliases/>
+  <arguments>
+    <argument name="namespace" is_required="0" is_array="0">
+      <description>The namespace name</description>
+      <defaults/>
+    </argument>
+  </arguments>
+  <options>
+    <option name="--xml" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
+      <description>To output help as XML</description>
+    </option>
+    <option name="--raw" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
+      <description>To output raw command list</description>
+    </option>
+  </options>
+</command>
+    <command id="foo:bar" name="foo:bar">
+  <usage>foo:bar</usage>
+  <description>The foo:bar command</description>
+  <help/>
+  <aliases>
+    <alias>afoobar</alias>
+  </aliases>
+  <arguments/>
+    <options>
+      <option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
+        <description>Display this help message.</description>
+      </option>
+      <option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
+        <description>Do not output any message.</description>
+      </option>
+      <option name="--verbose" shortcut="-v" accept_value="0" is_value_required="0" is_multiple="0">
+        <description>Increase verbosity of messages.</description>
+      </option>
+      <option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
+        <description>Display this application version.</description>
+      </option>
+      <option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
+        <description>Force ANSI output.</description>
+      </option>
+      <option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
+        <description>Disable ANSI output.</description>
+      </option>
+      <option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
+        <description>Do not ask any interactive question.</description>
+      </option>
+    </options>
+</command>
+  </commands>
+  <namespaces>
+    <namespace id="_global">
+      <command>help</command>
+      <command>list</command>
+    </namespace>
+    <namespace id="foo">
+      <command>foo:bar</command>
+    </namespace>
+  </namespaces>
+</symfony>

+ 37 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<symfony>
+  <commands namespace="foo">
+    <command id="foo:bar" name="foo:bar">
+  <usage>foo:bar</usage>
+  <description>The foo:bar command</description>
+  <help/>
+  <aliases>
+    <alias>afoobar</alias>
+  </aliases>
+  <arguments/>
+    <options>
+      <option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
+        <description>Display this help message.</description>
+      </option>
+      <option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
+        <description>Do not output any message.</description>
+      </option>
+      <option name="--verbose" shortcut="-v" accept_value="0" is_value_required="0" is_multiple="0">
+        <description>Increase verbosity of messages.</description>
+      </option>
+      <option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
+        <description>Display this application version.</description>
+      </option>
+      <option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
+        <description>Force ANSI output.</description>
+      </option>
+      <option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
+        <description>Disable ANSI output.</description>
+      </option>
+      <option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
+        <description>Do not ask any interactive question.</description>
+      </option>
+    </options>
+</command>
+  </commands>
+</symfony>

+ 13 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_gethelp.txt

@@ -0,0 +1,13 @@
+<info>Console Tool</info>
+
+<comment>Usage:</comment>
+  [options] command [arguments]
+
+<comment>Options:</comment>
+  <info>--help</info>           <info>-h</info> Display this help message.
+  <info>--quiet</info>          <info>-q</info> Do not output any message.
+  <info>--verbose</info>        <info>-v</info> Increase verbosity of messages.
+  <info>--version</info>        <info>-V</info> Display this application version.
+  <info>--ansi</info>              Force ANSI output.
+  <info>--no-ansi</info>           Disable ANSI output.
+  <info>--no-interaction</info> <info>-n</info> Do not ask any interactive question.

+ 8 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception1.txt

@@ -0,0 +1,8 @@
+
+
+                                 
+  [InvalidArgumentException]     
+  Command "foo" is not defined.  
+                                 
+
+

+ 11 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception2.txt

@@ -0,0 +1,11 @@
+
+
+                                      
+  [InvalidArgumentException]          
+  The "--foo" option does not exist.  
+                                      
+
+
+list [--xml] [--raw] [namespace]
+
+

+ 19 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception3.txt

@@ -0,0 +1,19 @@
+
+
+                    
+  [Exception]       
+  Second exception  
+                    
+
+
+
+
+                   
+  [Exception]      
+  First exception  
+                   
+
+
+foo3:bar
+
+

+ 9 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception4.txt

@@ -0,0 +1,9 @@
+
+
+                               
+  [InvalidArgumentException]   
+  Command "foo" is not define  
+  d.                           
+                               
+
+

+ 17 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run1.txt

@@ -0,0 +1,17 @@
+Console Tool
+
+Usage:
+  [options] command [arguments]
+
+Options:
+  --help           -h Display this help message.
+  --quiet          -q Do not output any message.
+  --verbose        -v Increase verbosity of messages.
+  --version        -V Display this application version.
+  --ansi              Force ANSI output.
+  --no-ansi           Disable ANSI output.
+  --no-interaction -n Do not ask any interactive question.
+
+Available commands:
+  help   Displays help for a command
+  list   Lists commands

+ 28 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run2.txt

@@ -0,0 +1,28 @@
+Usage:
+ help [--xml] [command_name]
+
+Arguments:
+ command               The command to execute
+ command_name          The command name (default: "help")
+
+Options:
+ --xml                 To output help as XML
+ --help (-h)           Display this help message.
+ --quiet (-q)          Do not output any message.
+ --verbose (-v)        Increase verbosity of messages.
+ --version (-V)        Display this application version.
+ --ansi                Force ANSI output.
+ --no-ansi             Disable ANSI output.
+ --no-interaction (-n) Do not ask any interactive question.
+
+Help:
+ The help command displays help for a given command:
+ 
+   php app/console help list
+ 
+ You can also output the help as XML by using the --xml option:
+ 
+   php app/console help --xml list
+ 
+ To display the list of available commands, please use the list command.
+

+ 27 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run3.txt

@@ -0,0 +1,27 @@
+Usage:
+ list [--xml] [--raw] [namespace]
+
+Arguments:
+ namespace  The namespace name
+
+Options:
+ --xml      To output help as XML
+ --raw      To output raw command list
+
+Help:
+ The list command lists all commands:
+ 
+   php app/console list
+ 
+ You can also display the commands for a specific namespace:
+ 
+   php app/console list test
+ 
+ You can also output the information as XML by using the --xml option:
+ 
+   php app/console list --xml
+ 
+ It's also possible to get raw list of commands (useful for embedding command runner):
+ 
+   php app/console list --raw
+

+ 1 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run4.txt

@@ -0,0 +1 @@
+Console Tool

+ 18 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_astext.txt

@@ -0,0 +1,18 @@
+<comment>Usage:</comment>
+ namespace:name
+
+<comment>Aliases:</comment> <info>name</info>
+<comment>Arguments:</comment>
+ <info>command              </info> The command to execute
+
+<comment>Options:</comment>
+ <info>--help</info> (-h)           Display this help message.
+ <info>--quiet</info> (-q)          Do not output any message.
+ <info>--verbose</info> (-v)        Increase verbosity of messages.
+ <info>--version</info> (-V)        Display this application version.
+ <info>--ansi</info>                Force ANSI output.
+ <info>--no-ansi</info>             Disable ANSI output.
+ <info>--no-interaction</info> (-n) Do not ask any interactive question.
+
+<comment>Help:</comment>
+ help

+ 38 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<command id="namespace:name" name="namespace:name">
+  <usage>namespace:name</usage>
+  <description>description</description>
+  <help>help</help>
+  <aliases>
+    <alias>name</alias>
+  </aliases>
+  <arguments>
+    <argument name="command" is_required="1" is_array="0">
+      <description>The command to execute</description>
+      <defaults/>
+    </argument>
+  </arguments>
+  <options>
+    <option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
+      <description>Display this help message.</description>
+    </option>
+    <option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
+      <description>Do not output any message.</description>
+    </option>
+    <option name="--verbose" shortcut="-v" accept_value="0" is_value_required="0" is_multiple="0">
+      <description>Increase verbosity of messages.</description>
+    </option>
+    <option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
+      <description>Display this application version.</description>
+    </option>
+    <option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
+      <description>Force ANSI output.</description>
+    </option>
+    <option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
+      <description>Disable ANSI output.</description>
+    </option>
+    <option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
+      <description>Do not ask any interactive question.</description>
+    </option>
+  </options>
+</command>

+ 11 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/definition_astext.txt

@@ -0,0 +1,11 @@
+<comment>Arguments:</comment>
+ <info>foo       </info> The foo argument
+ <info>baz       </info> The baz argument<comment> (default: true)</comment>
+ <info>bar       </info> The bar argument<comment> (default: ["http://foo.com/"])</comment>
+
+<comment>Options:</comment>
+ <info>--foo</info> (-f) The foo option
+ <info>--baz</info>      The baz option<comment> (default: false)</comment>
+ <info>--bar</info> (-b) The bar option<comment> (default: "bar")</comment>
+ <info>--qux</info>      The qux option<comment> (default: ["http://foo.com/","bar"])</comment><comment> (multiple values allowed)</comment>
+ <info>--qux2</info>     The qux2 option<comment> (default: {"foo":"bar"})</comment><comment> (multiple values allowed)</comment>

+ 39 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/definition_asxml.txt

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definition>
+  <arguments>
+    <argument name="foo" is_required="0" is_array="0">
+      <description>The foo argument</description>
+      <defaults/>
+    </argument>
+    <argument name="baz" is_required="0" is_array="0">
+      <description>The baz argument</description>
+      <defaults>
+        <default>true</default>
+      </defaults>
+    </argument>
+    <argument name="bar" is_required="0" is_array="1">
+      <description>The bar argument</description>
+      <defaults>
+        <default>bar</default>
+      </defaults>
+    </argument>
+  </arguments>
+  <options>
+    <option name="--foo" shortcut="-f" accept_value="1" is_value_required="1" is_multiple="0">
+      <description>The foo option</description>
+      <defaults/>
+    </option>
+    <option name="--baz" shortcut="" accept_value="1" is_value_required="0" is_multiple="0">
+      <description>The baz option</description>
+      <defaults>
+        <default>false</default>
+      </defaults>
+    </option>
+    <option name="--bar" shortcut="-b" accept_value="1" is_value_required="0" is_multiple="0">
+      <description>The bar option</description>
+      <defaults>
+        <default>bar</default>
+      </defaults>
+    </option>
+  </options>
+</definition>

+ 70 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleStackTest.php

@@ -0,0 +1,70 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Tests\Formatter;
+
+use Symfony\Component\Console\Formatter\OutputFormatterStyleStack;
+use Symfony\Component\Console\Formatter\OutputFormatterStyle;
+
+class OutputFormatterStyleStackTest extends \PHPUnit_Framework_TestCase
+{
+    public function testPush()
+    {
+        $stack = new OutputFormatterStyleStack();
+        $stack->push($s1 = new OutputFormatterStyle('white', 'black'));
+        $stack->push($s2 = new OutputFormatterStyle('yellow', 'blue'));
+
+        $this->assertEquals($s2, $stack->getCurrent());
+
+        $stack->push($s3 = new OutputFormatterStyle('green', 'red'));
+
+        $this->assertEquals($s3, $stack->getCurrent());
+    }
+
+    public function testPop()
+    {
+        $stack = new OutputFormatterStyleStack();
+        $stack->push($s1 = new OutputFormatterStyle('white', 'black'));
+        $stack->push($s2 = new OutputFormatterStyle('yellow', 'blue'));
+
+        $this->assertEquals($s2, $stack->pop());
+        $this->assertEquals($s1, $stack->pop());
+    }
+
+    public function testPopEmpty()
+    {
+        $stack = new OutputFormatterStyleStack();
+        $style = new OutputFormatterStyle();
+
+        $this->assertEquals($style, $stack->pop());
+    }
+
+    public function testPopNotLast()
+    {
+        $stack = new OutputFormatterStyleStack();
+        $stack->push($s1 = new OutputFormatterStyle('white', 'black'));
+        $stack->push($s2 = new OutputFormatterStyle('yellow', 'blue'));
+        $stack->push($s3 = new OutputFormatterStyle('green', 'red'));
+
+        $this->assertEquals($s2, $stack->pop($s2));
+        $this->assertEquals($s1, $stack->pop());
+    }
+
+    /**
+     * @expectedException InvalidArgumentException
+     */
+    public function testInvalidPop()
+    {
+        $stack = new OutputFormatterStyleStack();
+        $stack->push(new OutputFormatterStyle('white', 'black'));
+        $stack->pop(new OutputFormatterStyle('yellow', 'blue'));
+    }
+}

+ 77 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleTest.php

@@ -0,0 +1,77 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Tests\Formatter;
+
+use Symfony\Component\Console\Formatter\OutputFormatterStyle;
+
+class OutputFormatterStyleTest extends \PHPUnit_Framework_TestCase
+{
+    public function testConstructor()
+    {
+        $style = new OutputFormatterStyle('green', 'black', array('bold', 'underscore'));
+        $this->assertEquals("\033[32;40;1;4mfoo\033[0m", $style->apply('foo'));
+
+        $style = new OutputFormatterStyle('red', null, array('blink'));
+        $this->assertEquals("\033[31;5mfoo\033[0m", $style->apply('foo'));
+
+        $style = new OutputFormatterStyle(null, 'white');
+        $this->assertEquals("\033[47mfoo\033[0m", $style->apply('foo'));
+    }
+
+    public function testForeground()
+    {
+        $style = new OutputFormatterStyle();
+
+        $style->setForeground('black');
+        $this->assertEquals("\033[30mfoo\033[0m", $style->apply('foo'));
+
+        $style->setForeground('blue');
+        $this->assertEquals("\033[34mfoo\033[0m", $style->apply('foo'));
+
+        $this->setExpectedException('InvalidArgumentException');
+        $style->setForeground('undefined-color');
+    }
+
+    public function testBackground()
+    {
+        $style = new OutputFormatterStyle();
+
+        $style->setBackground('black');
+        $this->assertEquals("\033[40mfoo\033[0m", $style->apply('foo'));
+
+        $style->setBackground('yellow');
+        $this->assertEquals("\033[43mfoo\033[0m", $style->apply('foo'));
+
+        $this->setExpectedException('InvalidArgumentException');
+        $style->setBackground('undefined-color');
+    }
+
+    public function testOptions()
+    {
+        $style = new OutputFormatterStyle();
+
+        $style->setOptions(array('reverse', 'conceal'));
+        $this->assertEquals("\033[7;8mfoo\033[0m", $style->apply('foo'));
+
+        $style->setOption('bold');
+        $this->assertEquals("\033[7;8;1mfoo\033[0m", $style->apply('foo'));
+
+        $style->unsetOption('reverse');
+        $this->assertEquals("\033[8;1mfoo\033[0m", $style->apply('foo'));
+
+        $style->setOption('bold');
+        $this->assertEquals("\033[8;1mfoo\033[0m", $style->apply('foo'));
+
+        $style->setOptions(array('bold'));
+        $this->assertEquals("\033[1mfoo\033[0m", $style->apply('foo'));
+    }
+}

+ 231 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php

@@ -0,0 +1,231 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Tests\Formatter;
+
+use Symfony\Component\Console\Formatter\OutputFormatter;
+use Symfony\Component\Console\Formatter\OutputFormatterStyle;
+
+class FormatterStyleTest extends \PHPUnit_Framework_TestCase
+{
+    public function testEmptyTag()
+    {
+        $formatter = new OutputFormatter(true);
+        $this->assertEquals("foo<>bar", $formatter->format('foo<>bar'));
+    }
+
+    public function testLGCharEscaping()
+    {
+        $formatter = new OutputFormatter(true);
+
+        $this->assertEquals("foo<bar", $formatter->format('foo\\<bar'));
+        $this->assertEquals("<info>some info</info>", $formatter->format('\\<info>some info\\</info>'));
+        $this->assertEquals("\\<info>some info\\</info>", OutputFormatter::escape('<info>some info</info>'));
+
+        $this->assertEquals(
+            "\033[33mSymfony\\Component\\Console does work very well!\033[0m",
+            $formatter->format('<comment>Symfony\Component\Console does work very well!</comment>')
+        );
+    }
+
+    public function testBundledStyles()
+    {
+        $formatter = new OutputFormatter(true);
+
+        $this->assertTrue($formatter->hasStyle('error'));
+        $this->assertTrue($formatter->hasStyle('info'));
+        $this->assertTrue($formatter->hasStyle('comment'));
+        $this->assertTrue($formatter->hasStyle('question'));
+
+        $this->assertEquals(
+            "\033[37;41msome error\033[0m",
+            $formatter->format('<error>some error</error>')
+        );
+        $this->assertEquals(
+            "\033[32msome info\033[0m",
+            $formatter->format('<info>some info</info>')
+        );
+        $this->assertEquals(
+            "\033[33msome comment\033[0m",
+            $formatter->format('<comment>some comment</comment>')
+        );
+        $this->assertEquals(
+            "\033[30;46msome question\033[0m",
+            $formatter->format('<question>some question</question>')
+        );
+    }
+
+    public function testNestedStyles()
+    {
+        $formatter = new OutputFormatter(true);
+
+        $this->assertEquals(
+            "\033[37;41msome \033[0m\033[32msome info\033[0m\033[37;41m error\033[0m",
+            $formatter->format('<error>some <info>some info</info> error</error>')
+        );
+    }
+
+    public function testStyleMatchingNotGreedy()
+    {
+        $formatter = new OutputFormatter(true);
+
+        $this->assertEquals(
+            "(\033[32m>=2.0,<2.3\033[0m)",
+            $formatter->format('(<info>>=2.0,<2.3</info>)')
+        );
+    }
+
+    public function testStyleEscaping()
+    {
+        $formatter = new OutputFormatter(true);
+
+        $this->assertEquals(
+            "(\033[32mz>=2.0,<a2.3\033[0m)",
+            $formatter->format('(<info>'.$formatter->escape('z>=2.0,<a2.3').'</info>)')
+        );
+    }
+
+    public function testDeepNestedStyles()
+    {
+        $formatter = new OutputFormatter(true);
+
+        $this->assertEquals(
+            "\033[37;41merror\033[0m\033[32minfo\033[0m\033[33mcomment\033[0m\033[37;41merror\033[0m",
+            $formatter->format('<error>error<info>info<comment>comment</info>error</error>')
+        );
+    }
+
+    public function testNewStyle()
+    {
+        $formatter = new OutputFormatter(true);
+
+        $style = new OutputFormatterStyle('blue', 'white');
+        $formatter->setStyle('test', $style);
+
+        $this->assertEquals($style, $formatter->getStyle('test'));
+        $this->assertNotEquals($style, $formatter->getStyle('info'));
+
+        $this->assertEquals("\033[34;47msome custom msg\033[0m", $formatter->format('<test>some custom msg</test>'));
+    }
+
+    public function testRedefineStyle()
+    {
+        $formatter = new OutputFormatter(true);
+
+        $style = new OutputFormatterStyle('blue', 'white');
+        $formatter->setStyle('info', $style);
+
+        $this->assertEquals("\033[34;47msome custom msg\033[0m", $formatter->format('<info>some custom msg</info>'));
+    }
+
+    public function testInlineStyle()
+    {
+        $formatter = new OutputFormatter(true);
+
+        $this->assertEquals("\033[34;41msome text\033[0m", $formatter->format('<fg=blue;bg=red>some text</>'));
+        $this->assertEquals("\033[34;41msome text\033[0m", $formatter->format('<fg=blue;bg=red>some text</fg=blue;bg=red>'));
+    }
+
+    public function testNonStyleTag()
+    {
+        $formatter = new OutputFormatter(true);
+        $this->assertEquals("\033[32msome \033[0m\033[32m<tag> styled\033[0m", $formatter->format('<info>some <tag> styled</info>'));
+    }
+
+    public function testNotDecoratedFormatter()
+    {
+        $formatter = new OutputFormatter(false);
+
+        $this->assertTrue($formatter->hasStyle('error'));
+        $this->assertTrue($formatter->hasStyle('info'));
+        $this->assertTrue($formatter->hasStyle('comment'));
+        $this->assertTrue($formatter->hasStyle('question'));
+
+        $this->assertEquals(
+            "some error", $formatter->format('<error>some error</error>')
+        );
+        $this->assertEquals(
+            "some info", $formatter->format('<info>some info</info>')
+        );
+        $this->assertEquals(
+            "some comment", $formatter->format('<comment>some comment</comment>')
+        );
+        $this->assertEquals(
+            "some question", $formatter->format('<question>some question</question>')
+        );
+
+        $formatter->setDecorated(true);
+
+        $this->assertEquals(
+            "\033[37;41msome error\033[0m", $formatter->format('<error>some error</error>')
+        );
+        $this->assertEquals(
+            "\033[32msome info\033[0m", $formatter->format('<info>some info</info>')
+        );
+        $this->assertEquals(
+            "\033[33msome comment\033[0m", $formatter->format('<comment>some comment</comment>')
+        );
+        $this->assertEquals(
+            "\033[30;46msome question\033[0m", $formatter->format('<question>some question</question>')
+        );
+    }
+
+    public function testContentWithLineBreaks()
+    {
+        $formatter = new OutputFormatter(true);
+
+        $this->assertEquals(<<<EOF
+\033[32m
+some text\033[0m
+EOF
+            , $formatter->format(<<<EOF
+<info>
+some text</info>
+EOF
+        ));
+
+        $this->assertEquals(<<<EOF
+\033[32msome text
+\033[0m
+EOF
+            , $formatter->format(<<<EOF
+<info>some text
+</info>
+EOF
+        ));
+
+        $this->assertEquals(<<<EOF
+\033[32m
+some text
+\033[0m
+EOF
+            , $formatter->format(<<<EOF
+<info>
+some text
+</info>
+EOF
+        ));
+
+        $this->assertEquals(<<<EOF
+\033[32m
+some text
+more text
+\033[0m
+EOF
+            , $formatter->format(<<<EOF
+<info>
+some text
+more text
+</info>
+EOF
+        ));
+    }
+}

+ 167 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php

@@ -0,0 +1,167 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Tests\Helper;
+
+use Symfony\Component\Console\Helper\DialogHelper;
+use Symfony\Component\Console\Helper\HelperSet;
+use Symfony\Component\Console\Helper\FormatterHelper;
+use Symfony\Component\Console\Output\StreamOutput;
+
+class DialogHelperTest extends \PHPUnit_Framework_TestCase
+{
+    public function testSelect()
+    {
+        $dialog = new DialogHelper();
+
+        $helperSet = new HelperSet(array(new FormatterHelper()));
+        $dialog->setHelperSet($helperSet);
+
+        $heroes = array('Superman', 'Batman', 'Spiderman');
+
+        $dialog->setInputStream($this->getInputStream("\n1\nFabien\n1\nFabien\nFabien\n"));
+        $this->assertEquals('2', $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, '2'));
+        $this->assertEquals('1', $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes));
+        $this->assertEquals('1', $dialog->select($output = $this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!'));
+
+        rewind($output->getStream());
+        $this->assertContains('Input "Fabien" is not a superhero!', stream_get_contents($output->getStream()));
+
+        try {
+            $this->assertEquals('1', $dialog->select($output = $this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, 1));
+            $this->fail();
+        } catch (\InvalidArgumentException $e) {
+            $this->assertEquals('Value "Fabien" is invalid', $e->getMessage());
+        }
+    }
+
+    public function testAsk()
+    {
+        $dialog = new DialogHelper();
+
+        $dialog->setInputStream($this->getInputStream("\n8AM\n"));
+
+        $this->assertEquals('2PM', $dialog->ask($this->getOutputStream(), 'What time is it?', '2PM'));
+        $this->assertEquals('8AM', $dialog->ask($output = $this->getOutputStream(), 'What time is it?', '2PM'));
+
+        rewind($output->getStream());
+        $this->assertEquals('What time is it?', stream_get_contents($output->getStream()));
+    }
+
+    public function testAskWithAutocomplete()
+    {
+        if (!$this->hasSttyAvailable()) {
+            $this->markTestSkipped('`stty` is required to test autocomplete functionality');
+        }
+
+        // Acm<NEWLINE>
+        // Ac<BACKSPACE><BACKSPACE>s<TAB>Test<NEWLINE>
+        // <NEWLINE>
+        // <UP ARROW><UP ARROW><NEWLINE>
+        // <UP ARROW><UP ARROW><UP ARROW><UP ARROW><UP ARROW><TAB>Test<NEWLINE>
+        // <DOWN ARROW><NEWLINE>
+        // S<BACKSPACE><BACKSPACE><DOWN ARROW><DOWN ARROW><NEWLINE>
+        $inputStream = $this->getInputStream("Acm\nAc\177\177s\tTest\n\n\033[A\033[A\n\033[A\033[A\033[A\033[A\033[A\tTest\n\033[B\nS\177\177\033[B\033[B\n");
+
+        $dialog = new DialogHelper();
+        $dialog->setInputStream($inputStream);
+
+        $bundles = array('AcmeDemoBundle', 'AsseticBundle', 'SecurityBundle', 'FooBundle');
+
+        $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles));
+        $this->assertEquals('AsseticBundleTest', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles));
+        $this->assertEquals('FrameworkBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles));
+        $this->assertEquals('SecurityBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles));
+        $this->assertEquals('FooBundleTest', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles));
+        $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles));
+        $this->assertEquals('AsseticBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles));
+    }
+
+    public function testAskHiddenResponse()
+    {
+        if (defined('PHP_WINDOWS_VERSION_BUILD')) {
+            $this->markTestSkipped('This test is not supported on Windows');
+        }
+
+        $dialog = new DialogHelper();
+
+        $dialog->setInputStream($this->getInputStream("8AM\n"));
+
+        $this->assertEquals('8AM', $dialog->askHiddenResponse($this->getOutputStream(), 'What time is it?'));
+    }
+
+    public function testAskConfirmation()
+    {
+        $dialog = new DialogHelper();
+
+        $dialog->setInputStream($this->getInputStream("\n\n"));
+        $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?'));
+        $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false));
+
+        $dialog->setInputStream($this->getInputStream("y\nyes\n"));
+        $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false));
+        $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false));
+
+        $dialog->setInputStream($this->getInputStream("n\nno\n"));
+        $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', true));
+        $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', true));
+    }
+
+    public function testAskAndValidate()
+    {
+        $dialog = new DialogHelper();
+        $helperSet = new HelperSet(array(new FormatterHelper()));
+        $dialog->setHelperSet($helperSet);
+
+        $question ='What color was the white horse of Henry IV?';
+        $error = 'This is not a color!';
+        $validator = function ($color) use ($error) {
+            if (!in_array($color, array('white', 'black'))) {
+                throw new \InvalidArgumentException($error);
+            }
+
+            return $color;
+        };
+
+        $dialog->setInputStream($this->getInputStream("\nblack\n"));
+        $this->assertEquals('white', $dialog->askAndValidate($this->getOutputStream(), $question, $validator, 2, 'white'));
+        $this->assertEquals('black', $dialog->askAndValidate($this->getOutputStream(), $question, $validator, 2, 'white'));
+
+        $dialog->setInputStream($this->getInputStream("green\nyellow\norange\n"));
+        try {
+            $this->assertEquals('white', $dialog->askAndValidate($this->getOutputStream(), $question, $validator, 2, 'white'));
+            $this->fail();
+        } catch (\InvalidArgumentException $e) {
+            $this->assertEquals($error, $e->getMessage());
+        }
+    }
+
+    protected function getInputStream($input)
+    {
+        $stream = fopen('php://memory', 'r+', false);
+        fputs($stream, $input);
+        rewind($stream);
+
+        return $stream;
+    }
+
+    protected function getOutputStream()
+    {
+        return new StreamOutput(fopen('php://memory', 'r+', false));
+    }
+
+    private function hasSttyAvailable()
+    {
+        exec('stty 2>&1', $output, $exitcode);
+
+        return $exitcode === 0;
+    }
+}

+ 84 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/FormatterHelperTest.php

@@ -0,0 +1,84 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Tests\Helper;
+
+use Symfony\Component\Console\Helper\FormatterHelper;
+
+class FormatterHelperTest extends \PHPUnit_Framework_TestCase
+{
+    public function testFormatSection()
+    {
+        $formatter = new FormatterHelper();
+
+        $this->assertEquals(
+            '<info>[cli]</info> Some text to display',
+            $formatter->formatSection('cli', 'Some text to display'),
+            '::formatSection() formats a message in a section'
+        );
+    }
+
+    public function testFormatBlock()
+    {
+        $formatter = new FormatterHelper();
+
+        $this->assertEquals(
+            '<error> Some text to display </error>',
+            $formatter->formatBlock('Some text to display', 'error'),
+            '::formatBlock() formats a message in a block'
+        );
+
+        $this->assertEquals(
+            '<error> Some text to display </error>'."\n" .
+            '<error> foo bar              </error>',
+            $formatter->formatBlock(array('Some text to display', 'foo bar'), 'error'),
+            '::formatBlock() formats a message in a block'
+        );
+
+        $this->assertEquals(
+            '<error>                        </error>'."\n" .
+            '<error>  Some text to display  </error>'."\n" .
+            '<error>                        </error>',
+            $formatter->formatBlock('Some text to display', 'error', true),
+            '::formatBlock() formats a message in a block'
+        );
+    }
+
+    public function testFormatBlockWithDiacriticLetters()
+    {
+        if (!extension_loaded('mbstring')) {
+            $this->markTestSkipped('This test requires mbstring to work.');
+        }
+
+        $formatter = new FormatterHelper();
+
+        $this->assertEquals(
+            '<error>                       </error>'."\n" .
+            '<error>  Du texte à afficher  </error>'."\n" .
+            '<error>                       </error>',
+            $formatter->formatBlock('Du texte à afficher', 'error', true),
+            '::formatBlock() formats a message in a block'
+        );
+    }
+
+    public function testFormatBlockLGEscaping()
+    {
+        $formatter = new FormatterHelper();
+
+        $this->assertEquals(
+            '<error>                            </error>'."\n" .
+            '<error>  \<info>some info\</info>  </error>'."\n" .
+            '<error>                            </error>',
+            $formatter->formatBlock('<info>some info</info>', 'error', true),
+            '::formatBlock() escapes \'<\' chars'
+        );
+    }
+}

+ 173 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/ProgressHelperTest.php

@@ -0,0 +1,173 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Tests\Helper;
+
+use Symfony\Component\Console\Helper\ProgressHelper;
+use Symfony\Component\Console\Output\StreamOutput;
+
+class ProgressHelperTest extends \PHPUnit_Framework_TestCase
+{
+    public function testAdvance()
+    {
+        $progress = new ProgressHelper();
+        $progress->start($output = $this->getOutputStream());
+        $progress->advance();
+
+        rewind($output->getStream());
+        $this->assertEquals($this->generateOutput('    1 [->--------------------------]'), stream_get_contents($output->getStream()));
+    }
+
+    public function testAdvanceWithStep()
+    {
+        $progress = new ProgressHelper();
+        $progress->start($output = $this->getOutputStream());
+        $progress->advance(5);
+
+        rewind($output->getStream());
+        $this->assertEquals($this->generateOutput('    5 [----->----------------------]'), stream_get_contents($output->getStream()));
+    }
+
+    public function testAdvanceMultipleTimes()
+    {
+        $progress = new ProgressHelper();
+        $progress->start($output = $this->getOutputStream());
+        $progress->advance(3);
+        $progress->advance(2);
+
+        rewind($output->getStream());
+        $this->assertEquals($this->generateOutput('    3 [--->------------------------]').$this->generateOutput('    5 [----->----------------------]'), stream_get_contents($output->getStream()));
+    }
+
+    public function testCustomizations()
+    {
+        $progress = new ProgressHelper();
+        $progress->setBarWidth(10);
+        $progress->setBarCharacter('_');
+        $progress->setEmptyBarCharacter(' ');
+        $progress->setProgressCharacter('/');
+        $progress->setFormat(' %current%/%max% [%bar%] %percent%%');
+        $progress->start($output = $this->getOutputStream(), 10);
+        $progress->advance();
+
+        rewind($output->getStream());
+        $this->assertEquals($this->generateOutput('  1/10 [_/        ]  10%'), stream_get_contents($output->getStream()));
+    }
+
+    public function testPercent()
+    {
+        $progress = new ProgressHelper();
+        $progress->start($output = $this->getOutputStream(), 50);
+        $progress->display();
+        $progress->advance();
+        $progress->advance();
+
+        rewind($output->getStream());
+        $this->assertEquals($this->generateOutput('  0/50 [>---------------------------]   0%').$this->generateOutput('  1/50 [>---------------------------]   2%').$this->generateOutput('  2/50 [=>--------------------------]   4%'), stream_get_contents($output->getStream()));
+    }
+
+    public function testOverwriteWithShorterLine()
+    {
+        $progress = new ProgressHelper();
+        $progress->setFormat(' %current%/%max% [%bar%] %percent%%');
+        $progress->start($output = $this->getOutputStream(), 50);
+        $progress->display();
+        $progress->advance();
+
+        // set shorter format
+        $progress->setFormat(' %current%/%max% [%bar%]');
+        $progress->advance();
+
+        rewind($output->getStream());
+        $this->assertEquals(
+            $this->generateOutput('  0/50 [>---------------------------]   0%') .
+            $this->generateOutput('  1/50 [>---------------------------]   2%') .
+            $this->generateOutput('  2/50 [=>--------------------------]     '),
+            stream_get_contents($output->getStream())
+        );
+    }
+
+    public function testSetCurrentProgress()
+    {
+        $progress = new ProgressHelper();
+        $progress->start($output = $this->getOutputStream(), 50);
+        $progress->display();
+        $progress->advance();
+        $progress->setCurrent(15);
+        $progress->setCurrent(25);
+
+        rewind($output->getStream());
+        $this->assertEquals(
+            $this->generateOutput('  0/50 [>---------------------------]   0%') .
+            $this->generateOutput('  1/50 [>---------------------------]   2%') .
+            $this->generateOutput(' 15/50 [========>-------------------]  30%') .
+            $this->generateOutput(' 25/50 [==============>-------------]  50%'),
+            stream_get_contents($output->getStream())
+        );
+    }
+
+    /**
+     * @expectedException        \LogicException
+     * @expectedExceptionMessage You must start the progress bar
+     */
+    public function testSetCurrentBeforeStarting()
+    {
+        $progress = new ProgressHelper();
+        $progress->setCurrent(15);
+    }
+
+    /**
+     * @expectedException        \LogicException
+     * @expectedExceptionMessage You can't regress the progress bar
+     */
+    public function testRegressProgress()
+    {
+        $progress = new ProgressHelper();
+        $progress->start($output = $this->getOutputStream(), 50);
+        $progress->setCurrent(15);
+        $progress->setCurrent(10);
+    }
+
+    public function testMultiByteSupport()
+    {
+        if (!function_exists('mb_strlen') || (false === $encoding = mb_detect_encoding('■'))) {
+            $this->markTestSkipped('The mbstring extension is needed for multi-byte support');
+        }
+
+        $progress = new ProgressHelper();
+        $progress->start($output = $this->getOutputStream());
+        $progress->setBarCharacter('■');
+        $progress->advance(3);
+
+        rewind($output->getStream());
+        $this->assertEquals($this->generateOutput('    3 [■■■>------------------------]'), stream_get_contents($output->getStream()));
+    }
+
+    protected function getOutputStream()
+    {
+        return new StreamOutput(fopen('php://memory', 'r+', false));
+    }
+
+    protected $lastMessagesLength;
+
+    protected function generateOutput($expected)
+    {
+        $expectedout = $expected;
+
+        if ($this->lastMessagesLength !== null) {
+            $expectedout = str_pad($expected, $this->lastMessagesLength, "\x20", STR_PAD_RIGHT);
+        }
+
+        $this->lastMessagesLength = strlen($expectedout);
+
+        return "\x0D".$expectedout;
+    }
+}

+ 188 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/TableHelperTest.php

@@ -0,0 +1,188 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Tests\Helper;
+
+use Symfony\Component\Console\Helper\TableHelper;
+use Symfony\Component\Console\Output\StreamOutput;
+
+class TableHelperTest extends \PHPUnit_Framework_TestCase
+{
+    protected $stream;
+
+    protected function setUp()
+    {
+        $this->stream = fopen('php://memory', 'r+');
+    }
+
+    protected function tearDown()
+    {
+        fclose($this->stream);
+        $this->stream = null;
+    }
+
+    /**
+     * @dataProvider testRenderProvider
+     */
+    public function testRender($headers, $rows, $layout, $expected)
+    {
+        $table = new TableHelper();
+        $table
+            ->setHeaders($headers)
+            ->setRows($rows)
+            ->setLayout($layout)
+        ;
+        $table->render($output = $this->getOutputStream());
+
+        $this->assertEquals($expected, $this->getOutputContent($output));
+    }
+
+    /**
+     * @dataProvider testRenderProvider
+     */
+    public function testRenderAddRows($headers, $rows, $layout, $expected)
+    {
+        $table = new TableHelper();
+        $table
+            ->setHeaders($headers)
+            ->addRows($rows)
+            ->setLayout($layout)
+        ;
+        $table->render($output = $this->getOutputStream());
+
+        $this->assertEquals($expected, $this->getOutputContent($output));
+    }
+
+    /**
+     * @dataProvider testRenderProvider
+     */
+    public function testRenderAddRowsOneByOne($headers, $rows, $layout, $expected)
+    {
+        $table = new TableHelper();
+        $table
+            ->setHeaders($headers)
+            ->setLayout($layout)
+        ;
+        foreach ($rows as $row) {
+            $table->addRow($row);
+        }
+        $table->render($output = $this->getOutputStream());
+
+        $this->assertEquals($expected, $this->getOutputContent($output));
+    }
+
+    public function testRenderProvider()
+    {
+        return array(
+            array(
+                array('ISBN', 'Title', 'Author'),
+                array(
+                    array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),
+                    array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'),
+                    array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'),
+                    array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'),
+                ),
+                TableHelper::LAYOUT_DEFAULT,
+<<<TABLE
++---------------+--------------------------+------------------+
+| ISBN          | Title                    | Author           |
++---------------+--------------------------+------------------+
+| 99921-58-10-7 | Divine Comedy            | Dante Alighieri  |
+| 9971-5-0210-0 | A Tale of Two Cities     | Charles Dickens  |
+| 960-425-059-0 | The Lord of the Rings    | J. R. R. Tolkien |
+| 80-902734-1-6 | And Then There Were None | Agatha Christie  |
++---------------+--------------------------+------------------+
+
+TABLE
+            ),
+            array(
+                array('ISBN', 'Title', 'Author'),
+                array(
+                    array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),
+                    array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'),
+                    array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'),
+                    array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'),
+                ),
+                TableHelper::LAYOUT_BORDERLESS,
+                " =============== ========================== ================== \n  ISBN            Title                      Author            \n =============== ========================== ================== \n  99921-58-10-7   Divine Comedy              Dante Alighieri   \n  9971-5-0210-0   A Tale of Two Cities       Charles Dickens   \n  960-425-059-0   The Lord of the Rings      J. R. R. Tolkien  \n  80-902734-1-6   And Then There Were None   Agatha Christie   \n =============== ========================== ================== \n"
+            ),
+            array(
+                array('ISBN', 'Title'),
+                array(
+                    array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),
+                    array('9971-5-0210-0'),
+                    array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'),
+                    array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'),
+                ),
+                TableHelper::LAYOUT_DEFAULT,
+<<<TABLE
++---------------+--------------------------+------------------+
+| ISBN          | Title                    |                  |
++---------------+--------------------------+------------------+
+| 99921-58-10-7 | Divine Comedy            | Dante Alighieri  |
+| 9971-5-0210-0 |                          |                  |
+| 960-425-059-0 | The Lord of the Rings    | J. R. R. Tolkien |
+| 80-902734-1-6 | And Then There Were None | Agatha Christie  |
++---------------+--------------------------+------------------+
+
+TABLE
+            ),
+            array(
+                array(),
+                array(
+                    array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),
+                    array('9971-5-0210-0'),
+                    array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'),
+                    array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'),
+                ),
+                TableHelper::LAYOUT_DEFAULT,
+<<<TABLE
++---------------+--------------------------+------------------+
+| 99921-58-10-7 | Divine Comedy            | Dante Alighieri  |
+| 9971-5-0210-0 |                          |                  |
+| 960-425-059-0 | The Lord of the Rings    | J. R. R. Tolkien |
+| 80-902734-1-6 | And Then There Were None | Agatha Christie  |
++---------------+--------------------------+------------------+
+
+TABLE
+            ),
+            array(
+                array('ISBN', 'Title'),
+                array(),
+                TableHelper::LAYOUT_DEFAULT,
+<<<TABLE
++------+-------+
+| ISBN | Title |
++------+-------+
+
+TABLE
+            ),
+            array(
+                array(),
+                array(),
+                TableHelper::LAYOUT_DEFAULT,
+                '',
+            ),
+        );
+    }
+
+    protected function getOutputStream()
+    {
+        return new StreamOutput($this->stream);
+    }
+
+    protected function getOutputContent(StreamOutput $output)
+    {
+        rewind($output->getStream());
+
+        return stream_get_contents($output->getStream());
+    }
+}

+ 285 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Input/ArgvInputTest.php

@@ -0,0 +1,285 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Tests\Input;
+
+use Symfony\Component\Console\Input\ArgvInput;
+use Symfony\Component\Console\Input\InputDefinition;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+
+class ArgvInputTest extends \PHPUnit_Framework_TestCase
+{
+    public function testConstructor()
+    {
+        $_SERVER['argv'] = array('cli.php', 'foo');
+        $input = new ArgvInput();
+        $r = new \ReflectionObject($input);
+        $p = $r->getProperty('tokens');
+        $p->setAccessible(true);
+
+        $this->assertEquals(array('foo'), $p->getValue($input), '__construct() automatically get its input from the argv server variable');
+    }
+
+    public function testParseArguments()
+    {
+        $input = new ArgvInput(array('cli.php', 'foo'));
+        $input->bind(new InputDefinition(array(new InputArgument('name'))));
+        $this->assertEquals(array('name' => 'foo'), $input->getArguments(), '->parse() parses required arguments');
+
+        $input->bind(new InputDefinition(array(new InputArgument('name'))));
+        $this->assertEquals(array('name' => 'foo'), $input->getArguments(), '->parse() is stateless');
+    }
+
+    /**
+     * @dataProvider provideOptions
+     */
+    public function testParseOptions($input, $options, $expectedOptions, $message)
+    {
+        $input = new ArgvInput($input);
+        $input->bind(new InputDefinition($options));
+
+        $this->assertEquals($expectedOptions, $input->getOptions(), $message);
+    }
+
+    public function provideOptions()
+    {
+        return array(
+            array(
+                array('cli.php', '--foo'),
+                array(new InputOption('foo')),
+                array('foo' => true),
+                '->parse() parses long options without a value'
+            ),
+            array(
+                array('cli.php', '--foo=bar'),
+                array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
+                array('foo' => 'bar'),
+                '->parse() parses long options with a required value (with a = separator)'
+            ),
+            array(
+                array('cli.php', '--foo', 'bar'),
+                array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
+                array('foo' => 'bar'),
+                '->parse() parses long options with a required value (with a space separator)'
+            ),
+            array(
+                array('cli.php', '-f'),
+                array(new InputOption('foo', 'f')),
+                array('foo' => true),
+                '->parse() parses short options without a value'
+            ),
+            array(
+                array('cli.php', '-fbar'),
+                array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
+                array('foo' => 'bar'),
+                '->parse() parses short options with a required value (with no separator)'
+            ),
+            array(
+                array('cli.php', '-f', 'bar'),
+                array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
+                array('foo' => 'bar'),
+                '->parse() parses short options with a required value (with a space separator)'
+            ),
+            array(
+                array('cli.php', '-f', ''),
+                array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)),
+                array('foo' => ''),
+                '->parse() parses short options with an optional empty value'
+            ),
+            array(
+                array('cli.php', '-f', '', 'foo'),
+                array(new InputArgument('name'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)),
+                array('foo' => ''),
+                '->parse() parses short options with an optional empty value followed by an argument'
+            ),
+            array(
+                array('cli.php', '-f', '', '-b'),
+                array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b')),
+                array('foo' => '', 'bar' => true),
+                '->parse() parses short options with an optional empty value followed by an option'
+            ),
+            array(
+                array('cli.php', '-f', '-b', 'foo'),
+                array(new InputArgument('name'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b')),
+                array('foo' => null, 'bar' => true),
+                '->parse() parses short options with an optional value which is not present'
+            ),
+            array(
+                array('cli.php', '-fb'),
+                array(new InputOption('foo', 'f'), new InputOption('bar', 'b')),
+                array('foo' => true, 'bar' => true),
+                '->parse() parses short options when they are aggregated as a single one'
+            ),
+            array(
+                array('cli.php', '-fb', 'bar'),
+                array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_REQUIRED)),
+                array('foo' => true, 'bar' => 'bar'),
+                '->parse() parses short options when they are aggregated as a single one and the last one has a required value'
+            ),
+            array(
+                array('cli.php', '-fb', 'bar'),
+                array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)),
+                array('foo' => true, 'bar' => 'bar'),
+                '->parse() parses short options when they are aggregated as a single one and the last one has an optional value'
+            ),
+            array(
+                array('cli.php', '-fbbar'),
+                array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)),
+                array('foo' => true, 'bar' => 'bar'),
+                '->parse() parses short options when they are aggregated as a single one and the last one has an optional value with no separator'
+            ),
+            array(
+                array('cli.php', '-fbbar'),
+                array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)),
+                array('foo' => 'bbar', 'bar' => null),
+                '->parse() parses short options when they are aggregated as a single one and one of them takes a value'
+            )
+        );
+    }
+
+    /**
+     * @dataProvider provideInvalidInput
+     */
+    public function testInvalidInput($argv, $definition, $expectedExceptionMessage)
+    {
+        $this->setExpectedException('RuntimeException', $expectedExceptionMessage);
+
+        $input = new ArgvInput($argv);
+        $input->bind($definition);
+    }
+
+    public function provideInvalidInput()
+    {
+        return array(
+            array(
+                array('cli.php', '--foo'),
+                new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))),
+                'The "--foo" option requires a value.'
+            ),
+            array(
+                array('cli.php', '-f'),
+                new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))),
+                'The "--foo" option requires a value.'
+            ),
+            array(
+                array('cli.php', '-ffoo'),
+                new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_NONE))),
+                'The "-o" option does not exist.'
+            ),
+            array(
+                array('cli.php', 'foo', 'bar'),
+                new InputDefinition(),
+                'Too many arguments.'
+            ),
+            array(
+                array('cli.php', '--foo'),
+                new InputDefinition(),
+                'The "--foo" option does not exist.'
+            ),
+            array(
+                array('cli.php', '-f'),
+                new InputDefinition(),
+                'The "-f" option does not exist.'
+            ),
+            array(
+                array('cli.php', '-1'),
+                new InputDefinition(array(new InputArgument('number'))),
+                'The "-1" option does not exist.'
+            )
+        );
+    }
+
+    public function testParseArrayArgument()
+    {
+        $input = new ArgvInput(array('cli.php', 'foo', 'bar', 'baz', 'bat'));
+        $input->bind(new InputDefinition(array(new InputArgument('name', InputArgument::IS_ARRAY))));
+
+        $this->assertEquals(array('name' => array('foo', 'bar', 'baz', 'bat')), $input->getArguments(), '->parse() parses array arguments');
+    }
+
+    public function testParseArrayOption()
+    {
+        $input = new ArgvInput(array('cli.php', '--name=foo', '--name=bar', '--name=baz'));
+        $input->bind(new InputDefinition(array(new InputOption('name', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY))));
+
+        $this->assertEquals(array('name' => array('foo', 'bar', 'baz')), $input->getOptions());
+    }
+
+    public function testParseNegativeNumberAfterDoubleDash()
+    {
+        $input = new ArgvInput(array('cli.php', '--', '-1'));
+        $input->bind(new InputDefinition(array(new InputArgument('number'))));
+        $this->assertEquals(array('number' => '-1'), $input->getArguments(), '->parse() parses arguments with leading dashes as arguments after having encountered a double-dash sequence');
+
+        $input = new ArgvInput(array('cli.php', '-f', 'bar', '--', '-1'));
+        $input->bind(new InputDefinition(array(new InputArgument('number'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL))));
+        $this->assertEquals(array('foo' => 'bar'), $input->getOptions(), '->parse() parses arguments with leading dashes as options before having encountered a double-dash sequence');
+        $this->assertEquals(array('number' => '-1'), $input->getArguments(), '->parse() parses arguments with leading dashes as arguments after having encountered a double-dash sequence');
+    }
+
+    public function testParseEmptyStringArgument()
+    {
+        $input = new ArgvInput(array('cli.php', '-f', 'bar', ''));
+        $input->bind(new InputDefinition(array(new InputArgument('empty'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL))));
+
+        $this->assertEquals(array('empty' => ''), $input->getArguments(), '->parse() parses empty string arguments');
+    }
+
+    public function testGetFirstArgument()
+    {
+        $input = new ArgvInput(array('cli.php', '-fbbar'));
+        $this->assertEquals('', $input->getFirstArgument(), '->getFirstArgument() returns the first argument from the raw input');
+
+        $input = new ArgvInput(array('cli.php', '-fbbar', 'foo'));
+        $this->assertEquals('foo', $input->getFirstArgument(), '->getFirstArgument() returns the first argument from the raw input');
+    }
+
+    public function testHasParameterOption()
+    {
+        $input = new ArgvInput(array('cli.php', '-f', 'foo'));
+        $this->assertTrue($input->hasParameterOption('-f'), '->hasParameterOption() returns true if the given short option is in the raw input');
+
+        $input = new ArgvInput(array('cli.php', '--foo', 'foo'));
+        $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if the given short option is in the raw input');
+
+        $input = new ArgvInput(array('cli.php', 'foo'));
+        $this->assertFalse($input->hasParameterOption('--foo'), '->hasParameterOption() returns false if the given short option is not in the raw input');
+    }
+
+    public function testToString()
+    {
+        $input = new ArgvInput(array('cli.php', '-f', 'foo'));
+        $this->assertEquals('-f foo', (string) $input);
+
+        $input = new ArgvInput(array('cli.php', '-f', '--bar=foo', 'a b c d', "A\nB'C"));
+        $this->assertEquals('-f --bar=foo '.escapeshellarg('a b c d').' '.escapeshellarg("A\nB'C"), (string) $input);
+    }
+
+    /**
+     * @dataProvider provideGetParameterOptionValues
+     */
+    public function testGetParameterOptionEqualSign($argv, $key, $expected)
+    {
+        $input = new ArgvInput($argv);
+        $this->assertEquals($expected, $input->getParameterOption($key), '->getParameterOption() returns the expected value');
+    }
+
+    public function provideGetParameterOptionValues()
+    {
+        return array(
+            array(array('app/console', 'foo:bar', '-e', 'dev'), '-e', 'dev'),
+            array(array('app/console', 'foo:bar', '--env=dev'), '--env', 'dev'),
+            array(array('app/console', 'foo:bar', '-e', 'dev'), array('-e', '--env'), 'dev'),
+            array(array('app/console', 'foo:bar', '--env=dev'), array('-e', '--env'), 'dev'),
+        );
+    }
+}

+ 129 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Input/ArrayInputTest.php

@@ -0,0 +1,129 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Tests\Input;
+
+use Symfony\Component\Console\Input\ArrayInput;
+use Symfony\Component\Console\Input\InputDefinition;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+
+class ArrayInputTest extends \PHPUnit_Framework_TestCase
+{
+    public function testGetFirstArgument()
+    {
+        $input = new ArrayInput(array());
+        $this->assertNull($input->getFirstArgument(), '->getFirstArgument() returns null if no argument were passed');
+        $input = new ArrayInput(array('name' => 'Fabien'));
+        $this->assertEquals('Fabien', $input->getFirstArgument(), '->getFirstArgument() returns the first passed argument');
+        $input = new ArrayInput(array('--foo' => 'bar', 'name' => 'Fabien'));
+        $this->assertEquals('Fabien', $input->getFirstArgument(), '->getFirstArgument() returns the first passed argument');
+    }
+
+    public function testHasParameterOption()
+    {
+        $input = new ArrayInput(array('name' => 'Fabien', '--foo' => 'bar'));
+        $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if an option is present in the passed parameters');
+        $this->assertFalse($input->hasParameterOption('--bar'), '->hasParameterOption() returns false if an option is not present in the passed parameters');
+
+        $input = new ArrayInput(array('--foo'));
+        $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if an option is present in the passed parameters');
+    }
+
+    public function testParseArguments()
+    {
+        $input = new ArrayInput(array('name' => 'foo'), new InputDefinition(array(new InputArgument('name'))));
+
+        $this->assertEquals(array('name' => 'foo'), $input->getArguments(), '->parse() parses required arguments');
+    }
+
+    /**
+     * @dataProvider provideOptions
+     */
+    public function testParseOptions($input, $options, $expectedOptions, $message)
+    {
+        $input = new ArrayInput($input, new InputDefinition($options));
+
+        $this->assertEquals($expectedOptions, $input->getOptions(), $message);
+    }
+
+    public function provideOptions()
+    {
+        return array(
+            array(
+                array('--foo' => 'bar'),
+                array(new InputOption('foo')),
+                array('foo' => 'bar'),
+                '->parse() parses long options'
+            ),
+            array(
+                array('--foo' => 'bar'),
+                array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')),
+                array('foo' => 'bar'),
+                '->parse() parses long options with a default value'
+            ),
+            array(
+                array('--foo' => null),
+                array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')),
+                array('foo' => 'default'),
+                '->parse() parses long options with a default value'
+            ),
+            array(
+                array('-f' => 'bar'),
+                array(new InputOption('foo', 'f')),
+                array('foo' => 'bar'),
+                '->parse() parses short options'
+            )
+        );
+    }
+
+    /**
+     * @dataProvider provideInvalidInput
+     */
+    public function testParseInvalidInput($parameters, $definition, $expectedExceptionMessage)
+    {
+        $this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage);
+
+        new ArrayInput($parameters, $definition);
+    }
+
+    public function provideInvalidInput()
+    {
+        return array(
+            array(
+                array('foo' => 'foo'),
+                new InputDefinition(array(new InputArgument('name'))),
+                'The "foo" argument does not exist.'
+            ),
+            array(
+                array('--foo' => null),
+                new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))),
+                'The "--foo" option requires a value.'
+            ),
+            array(
+                array('--foo' => 'foo'),
+                new InputDefinition(),
+                'The "--foo" option does not exist.'
+            ),
+            array(
+                array('-o' => 'foo'),
+                new InputDefinition(),
+                'The "-o" option does not exist.'
+            )
+        );
+    }
+
+    public function testToString()
+    {
+        $input = new ArrayInput(array('-f' => null, '-b' => 'bar', '--foo' => 'b a z', '--lala' => null, 'test' => 'Foo', 'test2' => "A\nB'C"));
+        $this->assertEquals('-f -b=bar --foo='.escapeshellarg('b a z').' --lala Foo '.escapeshellarg("A\nB'C"), (string) $input);
+    }
+}

+ 111 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputArgumentTest.php

@@ -0,0 +1,111 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Tests\Input;
+
+use Symfony\Component\Console\Input\InputArgument;
+
+class InputArgumentTest extends \PHPUnit_Framework_TestCase
+{
+    public function testConstructor()
+    {
+        $argument = new InputArgument('foo');
+        $this->assertEquals('foo', $argument->getName(), '__construct() takes a name as its first argument');
+    }
+
+    public function testModes()
+    {
+        $argument = new InputArgument('foo');
+        $this->assertFalse($argument->isRequired(), '__construct() gives a "InputArgument::OPTIONAL" mode by default');
+
+        $argument = new InputArgument('foo', null);
+        $this->assertFalse($argument->isRequired(), '__construct() can take "InputArgument::OPTIONAL" as its mode');
+
+        $argument = new InputArgument('foo', InputArgument::OPTIONAL);
+        $this->assertFalse($argument->isRequired(), '__construct() can take "InputArgument::OPTIONAL" as its mode');
+
+        $argument = new InputArgument('foo', InputArgument::REQUIRED);
+        $this->assertTrue($argument->isRequired(), '__construct() can take "InputArgument::REQUIRED" as its mode');
+    }
+
+    /**
+     * @dataProvider provideInvalidModes
+     */
+    public function testInvalidModes($mode)
+    {
+        $this->setExpectedException('InvalidArgumentException', sprintf('Argument mode "%s" is not valid.', $mode));
+
+        new InputArgument('foo', $mode);
+    }
+
+    public function provideInvalidModes()
+    {
+        return array(
+            array('ANOTHER_ONE'),
+            array(-1)
+        );
+    }
+
+    public function testIsArray()
+    {
+        $argument = new InputArgument('foo', InputArgument::IS_ARRAY);
+        $this->assertTrue($argument->isArray(), '->isArray() returns true if the argument can be an array');
+        $argument = new InputArgument('foo', InputArgument::OPTIONAL | InputArgument::IS_ARRAY);
+        $this->assertTrue($argument->isArray(), '->isArray() returns true if the argument can be an array');
+        $argument = new InputArgument('foo', InputArgument::OPTIONAL);
+        $this->assertFalse($argument->isArray(), '->isArray() returns false if the argument can not be an array');
+    }
+
+    public function testGetDescription()
+    {
+        $argument = new InputArgument('foo', null, 'Some description');
+        $this->assertEquals('Some description', $argument->getDescription(), '->getDescription() return the message description');
+    }
+
+    public function testGetDefault()
+    {
+        $argument = new InputArgument('foo', InputArgument::OPTIONAL, '', 'default');
+        $this->assertEquals('default', $argument->getDefault(), '->getDefault() return the default value');
+    }
+
+    public function testSetDefault()
+    {
+        $argument = new InputArgument('foo', InputArgument::OPTIONAL, '', 'default');
+        $argument->setDefault(null);
+        $this->assertNull($argument->getDefault(), '->setDefault() can reset the default value by passing null');
+        $argument->setDefault('another');
+        $this->assertEquals('another', $argument->getDefault(), '->setDefault() changes the default value');
+
+        $argument = new InputArgument('foo', InputArgument::OPTIONAL | InputArgument::IS_ARRAY);
+        $argument->setDefault(array(1, 2));
+        $this->assertEquals(array(1, 2), $argument->getDefault(), '->setDefault() changes the default value');
+    }
+
+    /**
+     * @expectedException        \LogicException
+     * @expectedExceptionMessage Cannot set a default value except for InputArgument::OPTIONAL mode.
+     */
+    public function testSetDefaultWithRequiredArgument()
+    {
+        $argument = new InputArgument('foo', InputArgument::REQUIRED);
+        $argument->setDefault('default');
+    }
+
+    /**
+     * @expectedException        \LogicException
+     * @expectedExceptionMessage A default value for an array argument must be an array.
+     */
+    public function testSetDefaultWithArrayArgument()
+    {
+        $argument = new InputArgument('foo', InputArgument::IS_ARRAY);
+        $argument->setDefault('default');
+    }
+}

+ 410 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php

@@ -0,0 +1,410 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Tests\Input;
+
+use Symfony\Component\Console\Input\InputDefinition;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+
+class InputDefinitionTest extends \PHPUnit_Framework_TestCase
+{
+    protected static $fixtures;
+
+    protected $foo, $bar, $foo1, $foo2;
+
+    public static function setUpBeforeClass()
+    {
+        self::$fixtures = __DIR__.'/../Fixtures/';
+    }
+
+    public function testConstructorArguments()
+    {
+        $this->initializeArguments();
+
+        $definition = new InputDefinition();
+        $this->assertEquals(array(), $definition->getArguments(), '__construct() creates a new InputDefinition object');
+
+        $definition = new InputDefinition(array($this->foo, $this->bar));
+        $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getArguments(), '__construct() takes an array of InputArgument objects as its first argument');
+    }
+
+    public function testConstructorOptions()
+    {
+        $this->initializeOptions();
+
+        $definition = new InputDefinition();
+        $this->assertEquals(array(), $definition->getOptions(), '__construct() creates a new InputDefinition object');
+
+        $definition = new InputDefinition(array($this->foo, $this->bar));
+        $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getOptions(), '__construct() takes an array of InputOption objects as its first argument');
+    }
+
+    public function testSetArguments()
+    {
+        $this->initializeArguments();
+
+        $definition = new InputDefinition();
+        $definition->setArguments(array($this->foo));
+        $this->assertEquals(array('foo' => $this->foo), $definition->getArguments(), '->setArguments() sets the array of InputArgument objects');
+        $definition->setArguments(array($this->bar));
+
+        $this->assertEquals(array('bar' => $this->bar), $definition->getArguments(), '->setArguments() clears all InputArgument objects');
+    }
+
+    public function testAddArguments()
+    {
+        $this->initializeArguments();
+
+        $definition = new InputDefinition();
+        $definition->addArguments(array($this->foo));
+        $this->assertEquals(array('foo' => $this->foo), $definition->getArguments(), '->addArguments() adds an array of InputArgument objects');
+        $definition->addArguments(array($this->bar));
+        $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getArguments(), '->addArguments() does not clear existing InputArgument objects');
+    }
+
+    public function testAddArgument()
+    {
+        $this->initializeArguments();
+
+        $definition = new InputDefinition();
+        $definition->addArgument($this->foo);
+        $this->assertEquals(array('foo' => $this->foo), $definition->getArguments(), '->addArgument() adds a InputArgument object');
+        $definition->addArgument($this->bar);
+        $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getArguments(), '->addArgument() adds a InputArgument object');
+    }
+
+    /**
+     * @expectedException        \LogicException
+     * @expectedExceptionMessage An argument with name "foo" already exists.
+     */
+    public function testArgumentsMustHaveDifferentNames()
+    {
+        $this->initializeArguments();
+
+        $definition = new InputDefinition();
+        $definition->addArgument($this->foo);
+        $definition->addArgument($this->foo1);
+    }
+
+    /**
+     * @expectedException        \LogicException
+     * @expectedExceptionMessage Cannot add an argument after an array argument.
+     */
+    public function testArrayArgumentHasToBeLast()
+    {
+        $this->initializeArguments();
+
+        $definition = new InputDefinition();
+        $definition->addArgument(new InputArgument('fooarray', InputArgument::IS_ARRAY));
+        $definition->addArgument(new InputArgument('anotherbar'));
+    }
+
+    /**
+     * @expectedException        \LogicException
+     * @expectedExceptionMessage Cannot add a required argument after an optional one.
+     */
+    public function testRequiredArgumentCannotFollowAnOptionalOne()
+    {
+        $this->initializeArguments();
+
+        $definition = new InputDefinition();
+        $definition->addArgument($this->foo);
+        $definition->addArgument($this->foo2);
+    }
+
+    public function testGetArgument()
+    {
+        $this->initializeArguments();
+
+        $definition = new InputDefinition();
+        $definition->addArguments(array($this->foo));
+        $this->assertEquals($this->foo, $definition->getArgument('foo'), '->getArgument() returns a InputArgument by its name');
+    }
+
+    /**
+     * @expectedException        \InvalidArgumentException
+     * @expectedExceptionMessage The "bar" argument does not exist.
+     */
+    public function testGetInvalidArgument()
+    {
+        $this->initializeArguments();
+
+        $definition = new InputDefinition();
+        $definition->addArguments(array($this->foo));
+        $definition->getArgument('bar');
+    }
+
+    public function testHasArgument()
+    {
+        $this->initializeArguments();
+
+        $definition = new InputDefinition();
+        $definition->addArguments(array($this->foo));
+
+        $this->assertTrue($definition->hasArgument('foo'), '->hasArgument() returns true if a InputArgument exists for the given name');
+        $this->assertFalse($definition->hasArgument('bar'), '->hasArgument() returns false if a InputArgument exists for the given name');
+    }
+
+    public function testGetArgumentRequiredCount()
+    {
+        $this->initializeArguments();
+
+        $definition = new InputDefinition();
+        $definition->addArgument($this->foo2);
+        $this->assertEquals(1, $definition->getArgumentRequiredCount(), '->getArgumentRequiredCount() returns the number of required arguments');
+        $definition->addArgument($this->foo);
+        $this->assertEquals(1, $definition->getArgumentRequiredCount(), '->getArgumentRequiredCount() returns the number of required arguments');
+    }
+
+    public function testGetArgumentCount()
+    {
+        $this->initializeArguments();
+
+        $definition = new InputDefinition();
+        $definition->addArgument($this->foo2);
+        $this->assertEquals(1, $definition->getArgumentCount(), '->getArgumentCount() returns the number of arguments');
+        $definition->addArgument($this->foo);
+        $this->assertEquals(2, $definition->getArgumentCount(), '->getArgumentCount() returns the number of arguments');
+    }
+
+    public function testGetArgumentDefaults()
+    {
+        $definition = new InputDefinition(array(
+            new InputArgument('foo1', InputArgument::OPTIONAL),
+            new InputArgument('foo2', InputArgument::OPTIONAL, '', 'default'),
+            new InputArgument('foo3', InputArgument::OPTIONAL | InputArgument::IS_ARRAY),
+        //  new InputArgument('foo4', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, '', array(1, 2)),
+        ));
+        $this->assertEquals(array('foo1' => null, 'foo2' => 'default', 'foo3' => array()), $definition->getArgumentDefaults(), '->getArgumentDefaults() return the default values for each argument');
+
+        $definition = new InputDefinition(array(
+            new InputArgument('foo4', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, '', array(1, 2)),
+        ));
+        $this->assertEquals(array('foo4' => array(1, 2)), $definition->getArgumentDefaults(), '->getArgumentDefaults() return the default values for each argument');
+    }
+
+    public function testSetOptions()
+    {
+        $this->initializeOptions();
+
+        $definition = new InputDefinition(array($this->foo));
+        $this->assertEquals(array('foo' => $this->foo), $definition->getOptions(), '->setOptions() sets the array of InputOption objects');
+        $definition->setOptions(array($this->bar));
+        $this->assertEquals(array('bar' => $this->bar), $definition->getOptions(), '->setOptions() clears all InputOption objects');
+    }
+
+    /**
+     * @expectedException        \InvalidArgumentException
+     * @expectedExceptionMessage The "-f" option does not exist.
+     */
+    public function testSetOptionsClearsOptions()
+    {
+        $this->initializeOptions();
+
+        $definition = new InputDefinition(array($this->foo));
+        $definition->setOptions(array($this->bar));
+        $definition->getOptionForShortcut('f');
+    }
+
+    public function testAddOptions()
+    {
+        $this->initializeOptions();
+
+        $definition = new InputDefinition(array($this->foo));
+        $this->assertEquals(array('foo' => $this->foo), $definition->getOptions(), '->addOptions() adds an array of InputOption objects');
+        $definition->addOptions(array($this->bar));
+        $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getOptions(), '->addOptions() does not clear existing InputOption objects');
+    }
+
+    public function testAddOption()
+    {
+        $this->initializeOptions();
+
+        $definition = new InputDefinition();
+        $definition->addOption($this->foo);
+        $this->assertEquals(array('foo' => $this->foo), $definition->getOptions(), '->addOption() adds a InputOption object');
+        $definition->addOption($this->bar);
+        $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getOptions(), '->addOption() adds a InputOption object');
+    }
+
+    /**
+     * @expectedException        \LogicException
+     * @expectedExceptionMessage An option named "foo" already exists.
+     */
+    public function testAddDuplicateOption()
+    {
+        $this->initializeOptions();
+
+        $definition = new InputDefinition();
+        $definition->addOption($this->foo);
+        $definition->addOption($this->foo2);
+    }
+
+    /**
+     * @expectedException        \LogicException
+     * @expectedExceptionMessage An option with shortcut "f" already exists.
+     */
+    public function testAddDuplicateShortcutOption()
+    {
+        $this->initializeOptions();
+
+        $definition = new InputDefinition();
+        $definition->addOption($this->foo);
+        $definition->addOption($this->foo1);
+    }
+
+    public function testGetOption()
+    {
+        $this->initializeOptions();
+
+        $definition = new InputDefinition(array($this->foo));
+        $this->assertEquals($this->foo, $definition->getOption('foo'), '->getOption() returns a InputOption by its name');
+    }
+
+    /**
+     * @expectedException        \InvalidArgumentException
+     * @expectedExceptionMessage The "--bar" option does not exist.
+     */
+    public function testGetInvalidOption()
+    {
+        $this->initializeOptions();
+
+        $definition = new InputDefinition(array($this->foo));
+        $definition->getOption('bar');
+    }
+
+    public function testHasOption()
+    {
+        $this->initializeOptions();
+
+        $definition = new InputDefinition(array($this->foo));
+        $this->assertTrue($definition->hasOption('foo'), '->hasOption() returns true if a InputOption exists for the given name');
+        $this->assertFalse($definition->hasOption('bar'), '->hasOption() returns false if a InputOption exists for the given name');
+    }
+
+    public function testHasShortcut()
+    {
+        $this->initializeOptions();
+
+        $definition = new InputDefinition(array($this->foo));
+        $this->assertTrue($definition->hasShortcut('f'), '->hasShortcut() returns true if a InputOption exists for the given shortcut');
+        $this->assertFalse($definition->hasShortcut('b'), '->hasShortcut() returns false if a InputOption exists for the given shortcut');
+    }
+
+    public function testGetOptionForShortcut()
+    {
+        $this->initializeOptions();
+
+        $definition = new InputDefinition(array($this->foo));
+        $this->assertEquals($this->foo, $definition->getOptionForShortcut('f'), '->getOptionForShortcut() returns a InputOption by its shortcut');
+    }
+
+    /**
+     * @expectedException        \InvalidArgumentException
+     * @expectedExceptionMessage The "-l" option does not exist.
+     */
+    public function testGetOptionForInvalidShortcut()
+    {
+        $this->initializeOptions();
+
+        $definition = new InputDefinition(array($this->foo));
+        $definition->getOptionForShortcut('l');
+    }
+
+    public function testGetOptionDefaults()
+    {
+        $definition = new InputDefinition(array(
+            new InputOption('foo1', null, InputOption::VALUE_NONE),
+            new InputOption('foo2', null, InputOption::VALUE_REQUIRED),
+            new InputOption('foo3', null, InputOption::VALUE_REQUIRED, '', 'default'),
+            new InputOption('foo4', null, InputOption::VALUE_OPTIONAL),
+            new InputOption('foo5', null, InputOption::VALUE_OPTIONAL, '', 'default'),
+            new InputOption('foo6', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY),
+            new InputOption('foo7', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, '', array(1, 2)),
+        ));
+        $defaults = array(
+            'foo1' => null,
+            'foo2' => null,
+            'foo3' => 'default',
+            'foo4' => null,
+            'foo5' => 'default',
+            'foo6' => array(),
+            'foo7' => array(1, 2),
+        );
+        $this->assertEquals($defaults, $definition->getOptionDefaults(), '->getOptionDefaults() returns the default values for all options');
+    }
+
+    public function testGetSynopsis()
+    {
+        $definition = new InputDefinition(array(new InputOption('foo')));
+        $this->assertEquals('[--foo]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options');
+        $definition = new InputDefinition(array(new InputOption('foo', 'f')));
+        $this->assertEquals('[-f|--foo]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options');
+        $definition = new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)));
+        $this->assertEquals('[-f|--foo="..."]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options');
+        $definition = new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)));
+        $this->assertEquals('[-f|--foo[="..."]]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options');
+
+        $definition = new InputDefinition(array(new InputArgument('foo')));
+        $this->assertEquals('[foo]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options');
+        $definition = new InputDefinition(array(new InputArgument('foo', InputArgument::REQUIRED)));
+        $this->assertEquals('foo', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options');
+        $definition = new InputDefinition(array(new InputArgument('foo', InputArgument::IS_ARRAY)));
+        $this->assertEquals('[foo1] ... [fooN]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options');
+        $definition = new InputDefinition(array(new InputArgument('foo', InputArgument::REQUIRED | InputArgument::IS_ARRAY)));
+        $this->assertEquals('foo1 ... [fooN]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options');
+    }
+
+    public function testAsText()
+    {
+        $definition = new InputDefinition(array(
+            new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'),
+            new InputArgument('baz', InputArgument::OPTIONAL, 'The baz argument', true),
+            new InputArgument('bar', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'The bar argument', array('http://foo.com/')),
+            new InputOption('foo', 'f', InputOption::VALUE_REQUIRED, 'The foo option'),
+            new InputOption('baz', null, InputOption::VALUE_OPTIONAL, 'The baz option', false),
+            new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL, 'The bar option', 'bar'),
+            new InputOption('qux', '', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The qux option', array('http://foo.com/', 'bar')),
+            new InputOption('qux2', '', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The qux2 option', array('foo' => 'bar')),
+        ));
+        $this->assertStringEqualsFile(self::$fixtures.'/definition_astext.txt', $definition->asText(), '->asText() returns a textual representation of the InputDefinition');
+    }
+
+    public function testAsXml()
+    {
+        $definition = new InputDefinition(array(
+            new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'),
+            new InputArgument('baz', InputArgument::OPTIONAL, 'The baz argument', true),
+            new InputArgument('bar', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'The bar argument', array('bar')),
+            new InputOption('foo', 'f', InputOption::VALUE_REQUIRED, 'The foo option'),
+            new InputOption('baz', null, InputOption::VALUE_OPTIONAL, 'The baz option', false),
+            new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL, 'The bar option', 'bar'),
+        ));
+        $this->assertXmlStringEqualsXmlFile(self::$fixtures.'/definition_asxml.txt', $definition->asXml(), '->asText() returns a textual representation of the InputDefinition');
+    }
+
+    protected function initializeArguments()
+    {
+        $this->foo = new InputArgument('foo');
+        $this->bar = new InputArgument('bar');
+        $this->foo1 = new InputArgument('foo');
+        $this->foo2 = new InputArgument('foo2', InputArgument::REQUIRED);
+    }
+
+    protected function initializeOptions()
+    {
+        $this->foo = new InputOption('foo', 'f');
+        $this->bar = new InputOption('bar', 'b');
+        $this->foo1 = new InputOption('fooBis', 'f');
+        $this->foo2 = new InputOption('foo', 'p');
+    }
+}

+ 202 - 0
vendor/chamilo/chash/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputOptionTest.php

@@ -0,0 +1,202 @@
+<?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.
+ */
+
+namespace Symfony\Component\Console\Tests\Input;
+
+use Symfony\Component\Console\Input\InputOption;
+
+class InputOptionTest extends \PHPUnit_Framework_TestCase
+{
+    public function testConstructor()
+    {
+        $option = new InputOption('foo');
+        $this->assertEquals('foo', $option->getName(), '__construct() takes a name as its first argument');
+        $option = new InputOption('--foo');
+        $this->assertEquals('foo', $option->getName(), '__construct() removes the leading -- of the option name');
+    }
+
+    /**
+     * @expectedException        \InvalidArgumentException
+     * @expectedExceptionMessage Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.
+     */
+    public function testArrayModeWithoutValue()
+    {
+        new InputOption('foo', 'f', InputOption::VALUE_IS_ARRAY);
+    }
+
+    public function testShortcut()
+    {
+        $option = new InputOption('foo', 'f');
+        $this->assertEquals('f', $option->getShortcut(), '__construct() can take a shortcut as its second argument');
+        $option = new InputOption('foo', '-f');
+        $this->assertEquals('f', $option->getShortcut(), '__construct() removes the leading - of the shortcut');
+        $option = new InputOption('foo');
+        $this->assertNull($option->getShortcut(), '__construct() makes the shortcut null by default');
+    }
+
+    public function testModes()
+    {
+        $option = new InputOption('foo', 'f');
+        $this->assertFalse($option->acceptValue(), '__construct() gives a "InputOption::VALUE_NONE" mode by default');
+        $this->assertFalse($option->isValueRequired(), '__construct() gives a "InputOption::VALUE_NONE" mode by default');
+        $this->assertFalse($option->isValueOptional(), '__construct() gives a "InputOption::VALUE_NONE" mode by default');
+
+        $option = new InputOption('foo', 'f', null);
+        $this->assertFalse($option->acceptValue(), '__construct() can take "InputOption::VALUE_NONE" as its mode');
+        $this->assertFalse($option->isValueRequired(), '__construct() can take "InputOption::VALUE_NONE" as its mode');
+        $this->assertFalse($option->isValueOptional(), '__construct() can take "InputOption::VALUE_NONE" as its mode');
+
+        $option = new InputOption('foo', 'f', InputOption::VALUE_NONE);
+        $this->assertFalse($option->acceptValue(), '__construct() can take "InputOption::VALUE_NONE" as its mode');
+        $this->assertFalse($option->isValueRequired(), '__construct() can take "InputOption::VALUE_NONE" as its mode');
+        $this->assertFalse($option->isValueOptional(), '__construct() can take "InputOption::VALUE_NONE" as its mode');
+
+        $option = new InputOption('foo', 'f', InputOption::VALUE_REQUIRED);
+        $this->assertTrue($option->acceptValue(), '__construct() can take "InputOption::VALUE_REQUIRED" as its mode');
+        $this->assertTrue($option->isValueRequired(), '__construct() can take "InputOption::VALUE_REQUIRED" as its mode');
+        $this->assertFalse($option->isValueOptional(), '__construct() can take "InputOption::VALUE_REQUIRED" as its mode');
+
+        $option = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL);
+        $this->assertTrue($option->acceptValue(), '__construct() can take "InputOption::VALUE_OPTIONAL" as its mode');
+        $this->assertFalse($option->isValueRequired(), '__construct() can take "InputOption::VALUE_OPTIONAL" as its mode');
+        $this->assertTrue($option->isValueOptional(), '__construct() can take "InputOption::VALUE_OPTIONAL" as its mode');
+    }
+
+    /**
+     * @dataProvider provideInvalidModes
+     */
+    public function testInvalidModes($mode)
+    {
+        $this->setExpectedException('InvalidArgumentException', sprintf('Option mode "%s" is not valid.', $mode));
+
+        new InputOption('foo', 'f', $mode);
+    }
+
+    public function provideInvalidModes()
+    {
+        return array(
+            array('ANOTHER_ONE'),
+            array(-1)
+        );
+    }
+
+    /**
+     * @expectedException \InvalidArgumentException
+     */
+    public function testEmptyNameIsInvalid()
+    {
+        new InputOption('');
+    }
+
+    /**
+     * @expectedException \InvalidArgumentException
+     */
+    public function testDoubleDashNameIsInvalid()
+    {
+        new InputOption('--');
+    }
+
+    /**
+     * @expectedException \InvalidArgumentException
+     */
+    public function testSingleDashOptionIsInvalid()
+    {
+        new InputOption('foo', '-');
+    }
+
+    public function testIsArray()
+    {
+        $option = new InputOption('foo', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY);
+        $this->assertTrue($option->isArray(), '->isArray() returns true if the option can be an array');
+        $option = new InputOption('foo', null, InputOption::VALUE_NONE);
+        $this->assertFalse($option->isArray(), '->isArray() returns false if the option can not be an array');
+    }
+
+    public function testGetDescription()
+    {
+        $option = new InputOption('foo', 'f', null, 'Some description');
+        $this->assertEquals('Some description', $option->getDescription(), '->getDescription() returns the description message');
+    }
+
+    public function testGetDefault()
+    {
+        $option = new InputOption('foo', null, InputOption::VALUE_OPTIONAL, '', 'default');
+        $this->assertEquals('default', $option->getDefault(), '->getDefault() returns the default value');
+
+        $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED, '', 'default');
+        $this->assertEquals('default', $option->getDefault(), '->getDefault() returns the default value');
+
+        $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED);
+        $this->assertNull($option->getDefault(), '->getDefault() returns null if no default value is configured');
+
+        $option = new InputOption('foo', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY);
+        $this->assertEquals(array(), $option->getDefault(), '->getDefault() returns an empty array if option is an array');
+
+        $option = new InputOption('foo', null, InputOption::VALUE_NONE);
+        $this->assertFalse($option->getDefault(), '->getDefault() returns false if the option does not take a value');
+    }
+
+    public function testSetDefault()
+    {
+        $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED, '', 'default');
+        $option->setDefault(null);
+        $this->assertNull($option->getDefault(), '->setDefault() can reset the default value by passing null');
+        $option->setDefault('another');
+        $this->assertEquals('another', $option->getDefault(), '->setDefault() changes the default value');
+
+        $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY);
+        $option->setDefault(array(1, 2));
+        $this->assertEquals(array(1, 2), $option->getDefault(), '->setDefault() changes the default value');
+    }
+
+    /**
+     * @expectedException        \LogicException
+     * @expectedExceptionMessage Cannot set a default value when using InputOption::VALUE_NONE mode.
+     */
+    public function testDefaultValueWithValueNoneMode()
+    {
+        $option = new InputOption('foo', 'f', InputOption::VALUE_NONE);
+        $option->setDefault('default');
+    }
+
+    /**
+     * @expectedException        \LogicException
+     * @expectedExceptionMessage A default value for an array option must be an array.
+     */
+    public function testDefaultValueWithIsArrayMode()
+    {
+        $option = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY);
+        $option->setDefault('default');
+    }
+
+    public function testEquals()
+    {
+        $option = new InputOption('foo', 'f', null, 'Some description');
+        $option2 = new InputOption('foo', 'f', null, 'Alternative description');
+        $this->assertTrue($option->equals($option2));
+
+        $option = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, 'Some description');
+        $option2 = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, 'Some description', true);
+        $this->assertFalse($option->equals($option2));
+
+        $option = new InputOption('foo', 'f', null, 'Some description');
+        $option2 = new InputOption('bar', 'f', null, 'Some description');
+        $this->assertFalse($option->equals($option2));
+
+        $option = new InputOption('foo', 'f', null, 'Some description');
+        $option2 = new InputOption('foo', '', null, 'Some description');
+        $this->assertFalse($option->equals($option2));
+
+        $option = new InputOption('foo', 'f', null, 'Some description');
+        $option2 = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, 'Some description');
+        $this->assertFalse($option->equals($option2));
+    }
+}

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików