diff --git a/vendor/autoload.php b/vendor/autoload.php index e5050a2056..088c34b044 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInitdf03d0b60b557a405349a3b4c320474a::getLoader(); +return ComposerAutoloaderInit68de3dbf4a2a3e667c00f4d8391e6581::getLoader(); diff --git a/vendor/chamilo/chash/chash.php b/vendor/chamilo/chash/chash.php index 32d17679e0..b241f52afd 100755 --- a/vendor/chamilo/chash/chash.php +++ b/vendor/chamilo/chash/chash.php @@ -59,15 +59,16 @@ $application->addCommands( new Chash\Command\Database\DropDatabaseCommand(), new Chash\Command\Database\ShowConnInfoCommand(), + new Chash\Command\Files\CleanConfigFilesCommand(), new Chash\Command\Files\CleanCoursesFilesCommand(), new Chash\Command\Files\CleanDeletedDocumentsCommand(), new Chash\Command\Files\CleanTempFolderCommand(), - new Chash\Command\Files\CleanConfigFilesCommand(), + new Chash\Command\Files\ConvertVideosCommand(), + new Chash\Command\Files\GenerateTempFileStructureCommand(), new Chash\Command\Files\MailConfCommand(), new Chash\Command\Files\SetPermissionsAfterInstallCommand(), - new Chash\Command\Files\GenerateTempFileStructureCommand(), - new Chash\Command\Files\ConvertVideosCommand(), new Chash\Command\Files\ShowDiskUsageCommand(), + new Chash\Command\Files\UpdateDirectoryMaxSizeCommand(), new Chash\Command\Installation\InstallCommand(), new Chash\Command\Installation\WipeCommand(), diff --git a/vendor/chamilo/chash/src/Chash/Command/Files/UpdateDirectoryMaxSizeCommand.php b/vendor/chamilo/chash/src/Chash/Command/Files/UpdateDirectoryMaxSizeCommand.php new file mode 100644 index 0000000000..73bfcf46a8 --- /dev/null +++ b/vendor/chamilo/chash/src/Chash/Command/Files/UpdateDirectoryMaxSizeCommand.php @@ -0,0 +1,120 @@ +setName('files:update_directory_max_size') + ->setAliases(array('fudms')) + ->setDescription('Increases the max disk space for all the courses reaching a certain threshold. Max space needs to be of at least 1MB for each course first.') + ->addOption( + 'threshold', + null, + InputOption::VALUE_NONE, + 'Sets the threshold, in %, above which a course size should be automatically increased' + ) + ->addOption( + 'add-size', + null, + InputOption::VALUE_NONE, + 'Number of MB to add to the max size of the course' + ) + ; + } + + /** + * @param InputInterface $input + * @param OutputInterface $output + * @return bool|int|null|void + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + parent::execute($input, $output); + $add = $input->getOption('add-size'); //1 if the option was set + if (empty($add)) { + $add = 100; + } + $theshold = $input->getOption('threshold'); + if (empty($threshold)) { + $threshold = 75; + } + $this->writeCommandHeader($output, 'Checking courses dir...'); + + // Get database and path information + $coursesPath = $this->getConfigurationHelper()->getSysPath(); + $this->getConfigurationHelper()->getConnection(); + $_configuration = $this->getConfigurationHelper()->getConfiguration(); + + $courseTable = $_configuration['main_database'].'.course'; + $globalCourses = array(); + $sql = "SELECT c.id as cid, c.code as ccode, c.directory as cdir, c.disk_quota as cquota + FROM $courseTable c"; + $res = mysql_query($sql); + if ($res && mysql_num_rows($res) > 0) { + while ($row = mysql_fetch_assoc($res)) { + $globalCourses[$row['cdir']] = array('id' => $row['cid'], 'code' => $row['ccode'], 'quota' => $row['cquota']); + } + } + + $dirs = $this->getConfigurationHelper()->getDataFolders(1); + if (count($dirs) > 0) { + foreach ($dirs as $dir) { + $file = $dir->getFileName(); + $res = exec('du -s '.$dir->getRealPath()); // results are returned in KB (under Linux) + $res = preg_split('/\s/',$res); + $size = round($res[0]/1024,1); // $size is stored in MB + if (isset($globalCourses[$file]['code'])) { + $code = $globalCourses[$file]['code']; + $quota = round($globalCourses[$file]['quota']/(1024*1024), 0); //quota is originally in Bytes in DB. Store in MB + $rate = '-'; + if ($quota > 0) { + $newAllowedSize = $quota; + $rate = round(($size/$newAllowedSize)*100, 0); //rate is a percentage of disk use vs allowed quota, in MB + $increase = false; + while ($rate > $threshold) { // Typically 80 > 75 -> increase quota + //$output->writeln('...Rate '.$rate.' is larger than '.$threshold.', so increase allowed size'); + // Current disk usage goes beyond threshold. Increase allowed size by 100MB + $newAllowedSize += $add; + //$output->writeln('....New allowed size is '.$newAllowedSize); + $rate = round(($size/$newAllowedSize)*100, 0); + //$output->writeln('...Rate is now '.$rate); + $increase = true; + } + $newAllowedSize = $newAllowedSize*1024*1024; + //$output->writeln('Allowed size is '.$newAllowedSize.' Bytes, or '.round($newAllowedSize/(1024*1024))); + $sql = "UPDATE $courseTable SET disk_quota = $newAllowedSize WHERE id = ".$globalCourses[$file]['id']; + $res = mysql_query($sql); + if ($increase) { + $output->writeln('Increased max size of '.$globalCourses[$file]['code'].'('.$globalCourses[$file]['id'].') to '.$newAllowedSize); + } + } else { + //Quota is 0 (unlimited?) + } + } + } + } + $output->writeln('Done increasing disk space'); + } +} diff --git a/vendor/chamilo/chash/src/Chash/Resources/Database/1.10.0/db_main.sql b/vendor/chamilo/chash/src/Chash/Resources/Database/1.10.0/db_main.sql index e9413a3e57..4e0a93d74a 100644 --- a/vendor/chamilo/chash/src/Chash/Resources/Database/1.10.0/db_main.sql +++ b/vendor/chamilo/chash/src/Chash/Resources/Database/1.10.0/db_main.sql @@ -967,7 +967,8 @@ VALUES ('breadcrumb_navigation_display', NULL, 'radio', 'Platform','true','BreadcrumbNavigationDisplayTitle', 'BreadcrumbNavigationDisplayComment', NULL, NULL, 1), ('default_calendar_view', NULL, 'radio', 'Platform','month','DefaultCalendarViewTitle', 'DefaultCalendarViewComment', NULL, NULL, 1), ('documents_default_visibility_defined_in_course', NULL,'checkbox','Tools','false','DocumentsDefaultVisibilityDefinedInCourseTitle','DocumentsDefaultVisibilityDefinedInCourseComment',NULL, NULL, 1), -('allow_personal_user_files', NULL,'radio','Tools','false','AllowPersonalUserFilesTitle','AllowPersonalUserFilesComment',NULL, NULL, 1), +('allow_personal_user_files', NULL,'radio','Tools','false','AllowPersonalUserFilesTitle','AllowPersonalUserFilesComment', NULL, NULL, 1), +('bug_report_link', NULL, 'textfield','Platform', '','BugReportLinkTitle','BugReportLinkComment', NULL, NULL, 1), ('chamilo_database_version', NULL, 'textfield', NULL, '1.10.0.001', 'DatabaseVersion', '', NULL, NULL, 0); -- base value, updated at end of file. Don't change here UNLOCK TABLES; @@ -3643,4 +3644,4 @@ CREATE TABLE user_session_path ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Do not move this -UPDATE settings_current SET selected_value = '1.10.0.060' WHERE variable = 'chamilo_database_version'; +UPDATE settings_current SET selected_value = '1.10.0.061' WHERE variable = 'chamilo_database_version'; diff --git a/vendor/chamilo/chash/src/Chash/Resources/Database/1.10.0/migrate-db-1.9.0-1.10.0-pre.sql b/vendor/chamilo/chash/src/Chash/Resources/Database/1.10.0/migrate-db-1.9.0-1.10.0-pre.sql index 1f81c2b3ca..39ef2ce8dc 100644 --- a/vendor/chamilo/chash/src/Chash/Resources/Database/1.10.0/migrate-db-1.9.0-1.10.0-pre.sql +++ b/vendor/chamilo/chash/src/Chash/Resources/Database/1.10.0/migrate-db-1.9.0-1.10.0-pre.sql @@ -184,7 +184,7 @@ INSERT INTO settings_current (variable, subkey, type, category, selected_value, INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('showonline','session','checkbox','Platform','true','ShowOnlineTitle','ShowOnlineComment',NULL,'ShowOnlineSession', 0); INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('documents_default_visibility_defined_in_course', NULL,'radio','Tools','false','DocumentsDefaultVisibilityDefinedInCourseTitle','DocumentsDefaultVisibilityDefinedInCourseComment',NULL, NULL, 1); INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('allow_personal_user_files', NULL,'radio','Tools','false','AllowPersonalUserFilesTitle','AllowPersonalUserFilesComment',NULL, NULL, 1); - +INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('bug_report_link', NULL, 'textfield','Platform','','BugReportLinkTitle','BugReportLinkComment', NULL, NULL, 1); DELETE FROM settings_current WHERE variable = 'upload_extensions_whitelist'; INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('upload_extensions_whitelist', NULL, 'textfield', 'Security', 'htm;html;jpg;jpeg;gif;png;swf;avi;mpg;mpeg;mov;flv;doc;docx;xls;xlsx;ppt;pptx;odt;odp;ods;pdf,webm,oga,ogg,ogv,h264', 'UploadExtensionsWhitelist', 'UploadExtensionsWhitelistComment', NULL, NULL, 0); @@ -222,4 +222,4 @@ INSERT INTO branch_transaction_status VALUES (1, 'To be executed'), (2, 'Execute UPDATE course_field SET field_type = 3 WHERE field_variable = 'special_course'; -- Do not move this -UPDATE settings_current SET selected_value = '1.10.0.060' WHERE variable = 'chamilo_database_version'; +UPDATE settings_current SET selected_value = '1.10.0.061' WHERE variable = 'chamilo_database_version'; diff --git a/vendor/chamilo/chash/tests/Chash/Tests/Command/Files/UpdateDirectoryMaxSizeCommandTest.php b/vendor/chamilo/chash/tests/Chash/Tests/Command/Files/UpdateDirectoryMaxSizeCommandTest.php new file mode 100644 index 0000000000..298de371ce --- /dev/null +++ b/vendor/chamilo/chash/tests/Chash/Tests/Command/Files/UpdateDirectoryMaxSizeCommandTest.php @@ -0,0 +1,15 @@ +findFile($class)) { - include $file; + includeFile($file); return true; } @@ -352,3 +352,13 @@ class ClassLoader return $this->classMap[$class] = false; } } + +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + */ +function includeFile($file) +{ + include $file; +} diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index 3d3576645d..055d1f18f2 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -6,9 +6,9 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( - $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php', $vendorDir . '/symfony/intl/Symfony/Component/Intl/Resources/stubs/functions.php', $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php', $vendorDir . '/flint/tacker/src/Tacker/functions.php', $vendorDir . '/kriswallsmith/assetic/src/functions.php', + $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php', ); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index d64fbb3cde..b6ead455f1 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -96,6 +96,6 @@ return array( 'Bt51\\Silex\\Provider\\GaufretteServiceProvider' => array($vendorDir . '/bt51/gaufrette-serviceprovider/src'), 'Bc\\Bundle\\BootstrapBundle' => array($vendorDir . '/braincrafted/bootstrap-bundle'), 'Assetic' => array($vendorDir . '/kriswallsmith/assetic/src'), - 'Alchemy' => array($vendorDir . '/alchemy/binary-driver/src', $vendorDir . '/alchemy/zippy/src'), + 'Alchemy' => array($vendorDir . '/alchemy/zippy/src', $vendorDir . '/alchemy/binary-driver/src'), '' => array($vendorDir . '/opauth/openid', $vendorDir . '/opauth/facebook', $vendorDir . '/opauth/google'), ); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index ffbfb5a99d..0ab3fdf783 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitdf03d0b60b557a405349a3b4c320474a +class ComposerAutoloaderInit68de3dbf4a2a3e667c00f4d8391e6581 { private static $loader; @@ -19,9 +19,9 @@ class ComposerAutoloaderInitdf03d0b60b557a405349a3b4c320474a return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitdf03d0b60b557a405349a3b4c320474a', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit68de3dbf4a2a3e667c00f4d8391e6581', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInitdf03d0b60b557a405349a3b4c320474a', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit68de3dbf4a2a3e667c00f4d8391e6581', 'loadClassLoader')); $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); @@ -45,9 +45,14 @@ class ComposerAutoloaderInitdf03d0b60b557a405349a3b4c320474a $includeFiles = require __DIR__ . '/autoload_files.php'; foreach ($includeFiles as $file) { - require $file; + composerRequire68de3dbf4a2a3e667c00f4d8391e6581($file); } return $loader; } } + +function composerRequire68de3dbf4a2a3e667c00f4d8391e6581($file) +{ + require $file; +} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 613c42a9b8..77d07774a5 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -105,23 +105,23 @@ }, { "name": "ezyang/htmlpurifier", - "version": "v4.5.0", - "version_normalized": "4.5.0.0", + "version": "v4.6.0", + "version_normalized": "4.6.0.0", "source": { "type": "git", "url": "https://github.com/ezyang/htmlpurifier.git", - "reference": "d516e2f8de435ea78cc6152abc425d3ff2c4d289" + "reference": "6f389f0f25b90d0b495308efcfa073981177f0fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/d516e2f8de435ea78cc6152abc425d3ff2c4d289", - "reference": "d516e2f8de435ea78cc6152abc425d3ff2c4d289", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/6f389f0f25b90d0b495308efcfa073981177f0fd", + "reference": "6f389f0f25b90d0b495308efcfa073981177f0fd", "shasum": "" }, "require": { "php": ">=5.2" }, - "time": "2013-02-18 00:04:08", + "time": "2013-11-30 08:25:19", "type": "library", "installation-source": "dist", "autoload": { @@ -226,6 +226,65 @@ "psr-3" ] }, + { + "name": "twig/twig", + "version": "v1.15.1", + "version_normalized": "1.15.1.0", + "source": { + "type": "git", + "url": "https://github.com/fabpot/Twig.git", + "reference": "1fb5784662f438d7d96a541e305e28b812e2eeed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fabpot/Twig/zipball/1fb5784662f438d7d96a541e305e28b812e2eeed", + "reference": "1fb5784662f438d7d96a541e305e28b812e2eeed", + "shasum": "" + }, + "require": { + "php": ">=5.2.4" + }, + "time": "2014-02-13 10:19:29", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.15-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Twig_": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + }, + { + "name": "Twig Team", + "homepage": "https://github.com/fabpot/Twig/graphs/contributors", + "role": "Contributors" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "http://twig.sensiolabs.org", + "keywords": [ + "templating" + ] + }, { "name": "doctrine/lexer", "version": "v1.0", @@ -269,7 +328,7 @@ { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", + "homepage": "http://jmsyst.com", "role": "Developer of wrapped JMSSerializerBundle" } ], @@ -321,7 +380,7 @@ ], "authors": [ { - "name": "Jonathan H. Wage", + "name": "Jonathan Wage", "email": "jonwage@gmail.com", "homepage": "http://www.jwage.com/", "role": "Creator" @@ -354,6 +413,76 @@ "parser" ] }, + { + "name": "doctrine/collections", + "version": "v1.2", + "version_normalized": "1.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/collections.git", + "reference": "b99c5c46c87126201899afe88ec490a25eedd6a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/collections/zipball/b99c5c46c87126201899afe88ec490a25eedd6a2", + "reference": "b99c5c46c87126201899afe88ec490a25eedd6a2", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "time": "2014-02-03 23:07:43", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Doctrine\\Common\\Collections\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com", + "homepage": "http://www.jwage.com/", + "role": "Creator" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com", + "homepage": "http://www.instaclick.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "http://jmsyst.com", + "role": "Developer of wrapped JMSSerializerBundle" + } + ], + "description": "Collections Abstraction library", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "array", + "collections", + "iterator" + ] + }, { "name": "doctrine/cache", "version": "v1.3.0", @@ -624,69 +753,49 @@ ] }, { - "name": "silex/silex", - "version": "v1.1.2", - "version_normalized": "1.1.2.0", + "name": "symfony/intl", + "version": "v2.4.2", + "version_normalized": "2.4.2.0", + "target-dir": "Symfony/Component/Intl", "source": { "type": "git", - "url": "https://github.com/silexphp/Silex.git", - "reference": "47cc7d6545450ef8a91f50c04e8c7b3b04fceae9" + "url": "https://github.com/symfony/Intl.git", + "reference": "ab12f91c6b4a073007db3c478707ace276738a13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/silexphp/Silex/zipball/47cc7d6545450ef8a91f50c04e8c7b3b04fceae9", - "reference": "47cc7d6545450ef8a91f50c04e8c7b3b04fceae9", + "url": "https://api.github.com/repos/symfony/Intl/zipball/ab12f91c6b4a073007db3c478707ace276738a13", + "reference": "ab12f91c6b4a073007db3c478707ace276738a13", "shasum": "" }, "require": { "php": ">=5.3.3", - "pimple/pimple": "~1.0", - "symfony/event-dispatcher": ">=2.3,<2.5-dev", - "symfony/http-foundation": ">=2.3,<2.5-dev", - "symfony/http-kernel": ">=2.3,<2.5-dev", - "symfony/routing": ">=2.3,<2.5-dev" + "symfony/icu": "~1.0-RC" }, "require-dev": { - "doctrine/dbal": ">=2.2.0,<2.4.0-dev", - "monolog/monolog": "~1.4,>=1.4.1", - "phpunit/phpunit": "~3.7", - "swiftmailer/swiftmailer": "5.*", - "symfony/browser-kit": ">=2.3,<2.5-dev", - "symfony/config": ">=2.3,<2.5-dev", - "symfony/css-selector": ">=2.3,<2.5-dev", - "symfony/debug": ">=2.3,<2.5-dev", - "symfony/dom-crawler": ">=2.3,<2.5-dev", - "symfony/finder": ">=2.3,<2.5-dev", - "symfony/form": ">=2.3,<2.5-dev", - "symfony/locale": ">=2.3,<2.5-dev", - "symfony/monolog-bridge": ">=2.3,<2.5-dev", - "symfony/options-resolver": ">=2.3,<2.5-dev", - "symfony/process": ">=2.3,<2.5-dev", - "symfony/security": ">=2.3,<2.5-dev", - "symfony/serializer": ">=2.3,<2.5-dev", - "symfony/translation": ">=2.3,<2.5-dev", - "symfony/twig-bridge": ">=2.3,<2.5-dev", - "symfony/validator": ">=2.3,<2.5-dev", - "twig/twig": ">=1.8.0,<2.0-dev" + "symfony/filesystem": ">=2.1" }, "suggest": { - "symfony/browser-kit": ">=2.3,<2.5-dev", - "symfony/css-selector": ">=2.3,<2.5-dev", - "symfony/dom-crawler": ">=2.3,<2.5-dev", - "symfony/form": ">=2.3,<2.5-dev" + "ext-intl": "to use the component with locales other than \"en\"" }, - "time": "2013-10-30 08:53:26", + "time": "2014-02-11 13:52:09", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "2.4-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "Silex": "src/" - } + "Symfony\\Component\\Intl\\": "" + }, + "classmap": [ + "Symfony/Component/Intl/Resources/stubs" + ], + "files": [ + "Symfony/Component/Intl/Resources/stubs/functions.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -694,58 +803,77 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" }, { "name": "Igor Wiedler", "email": "igor@wiedler.ch", "homepage": "http://wiedler.ch/igor/" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + }, + { + "name": "Eriksen Costa", + "email": "eriksen.costa@infranology.com.br" } ], - "description": "The PHP micro-framework based on the Symfony2 Components", - "homepage": "http://silex.sensiolabs.org", + "description": "A PHP replacement layer for the C intl extension that includes additional data from the ICU library.", + "homepage": "http://symfony.com", "keywords": [ - "microframework" + "i18n", + "icu", + "internationalization", + "intl", + "l10n", + "localization" ] }, { - "name": "imagine/imagine", - "version": "dev-develop", - "version_normalized": "dev-develop", + "name": "symfony/routing", + "version": "v2.4.2", + "version_normalized": "2.4.2.0", + "target-dir": "Symfony/Component/Routing", "source": { "type": "git", - "url": "https://github.com/avalanche123/Imagine.git", - "reference": "5e013323dacbb7d6ab0c0d55692e6b75d1fb30d2" + "url": "https://github.com/symfony/Routing.git", + "reference": "b2fdea8b60400bb84e4931d71101ebbb3a08c1eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/avalanche123/Imagine/zipball/5e013323dacbb7d6ab0c0d55692e6b75d1fb30d2", - "reference": "5e013323dacbb7d6ab0c0d55692e6b75d1fb30d2", + "url": "https://api.github.com/repos/symfony/Routing/zipball/b2fdea8b60400bb84e4931d71101ebbb3a08c1eb", + "reference": "b2fdea8b60400bb84e4931d71101ebbb3a08c1eb", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": ">=5.3.3" }, "require-dev": { - "sami/sami": "dev-master" + "doctrine/annotations": "~1.0", + "psr/log": "~1.0", + "symfony/config": "~2.2", + "symfony/expression-language": "~2.4", + "symfony/yaml": "~2.0" }, "suggest": { - "ext-gd": "to use the GD implementation", - "ext-gmagick": "to use the Gmagick implementation", - "ext-imagick": "to use the Imagick implementation" + "doctrine/annotations": "For using the annotation loader", + "symfony/config": "For using the all-in-one router or any loader", + "symfony/expression-language": "For using expression matching", + "symfony/yaml": "For using the YAML loader" }, - "time": "2013-12-23 10:54:18", + "time": "2014-02-11 13:52:09", "type": "library", "extra": { "branch-alias": { - "dev-develop": "0.6-dev" + "dev-master": "2.4-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-0": { - "Imagine": "lib/" + "Symfony\\Component\\Routing\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -754,49 +882,63 @@ ], "authors": [ { - "name": "Bulat Shakirzyanov", - "email": "mallluhuct@gmail.com", - "homepage": "http://avalanche123.com" - } - ], - "description": "Image processing for PHP 5.3", - "homepage": "http://imagine.readthedocs.org/", + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Routing Component", + "homepage": "http://symfony.com", "keywords": [ - "drawing", - "graphics", - "image manipulation", - "image processing" + "router", + "routing", + "uri", + "url" ] }, { - "name": "knplabs/knp-snappy", - "version": "dev-master", - "version_normalized": "9999999-dev", + "name": "symfony/debug", + "version": "v2.4.2", + "version_normalized": "2.4.2.0", + "target-dir": "Symfony/Component/Debug", "source": { "type": "git", - "url": "https://github.com/KnpLabs/snappy.git", - "reference": "1f56b336f8e158b57dcfce007234363cbb54192b" + "url": "https://github.com/symfony/Debug.git", + "reference": "23b5f4fcad883679d9a6e1cbc568247fe606d8ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/KnpLabs/snappy/zipball/1f56b336f8e158b57dcfce007234363cbb54192b", - "reference": "1f56b336f8e158b57dcfce007234363cbb54192b", + "url": "https://api.github.com/repos/symfony/Debug/zipball/23b5f4fcad883679d9a6e1cbc568247fe606d8ee", + "reference": "23b5f4fcad883679d9a6e1cbc568247fe606d8ee", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/http-foundation": "~2.1", + "symfony/http-kernel": "~2.1" }, "suggest": { - "google/wkhtmltopdf-amd64": "Provide wkhtmltopdf-amd64 binary, use version `0.11.0-RC1` as dependency", - "google/wkhtmltopdf-i386": "Provide wkhtmltopdf-i386 binary, use version `0.11.0-RC1` as dependency", - "symfony/process": "Process Component of Symfony2." + "symfony/http-foundation": "", + "symfony/http-kernel": "" }, - "time": "2013-09-06 14:16:50", + "time": "2014-02-11 13:52:09", "type": "library", - "installation-source": "source", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "installation-source": "dist", "autoload": { "psr-0": { - "Knp\\Snappy": "src/" + "Symfony\\Component\\Debug\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -805,52 +947,53 @@ ], "authors": [ { - "name": "KnpLabs Team", - "homepage": "http://knplabs.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" }, { "name": "Symfony Community", - "homepage": "http://github.com/KnpLabs/snappy/contributors" + "homepage": "http://symfony.com/contributors" } ], - "description": "PHP5 library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage.", - "homepage": "http://github.com/KnpLabs/snappy", - "keywords": [ - "knp", - "knplabs", - "pdf", - "snapshot", - "thumbnail", - "wkhtmltopdf" - ] + "description": "Symfony Debug Component", + "homepage": "http://symfony.com" }, { - "name": "grom/silex-service-provider", - "version": "dev-master", - "version_normalized": "9999999-dev", + "name": "symfony/http-foundation", + "version": "v2.4.2", + "version_normalized": "2.4.2.0", + "target-dir": "Symfony/Component/HttpFoundation", "source": { "type": "git", - "url": "https://github.com/GromNaN/SilexServiceProvider.git", - "reference": "2ffe8f4fa66456690e4b0c679e3701ca0b4fa31e" + "url": "https://github.com/symfony/HttpFoundation.git", + "reference": "cdee7c84ba8b2a8aafa1c055f5cb4f640d81c129" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GromNaN/SilexServiceProvider/zipball/2ffe8f4fa66456690e4b0c679e3701ca0b4fa31e", - "reference": "2ffe8f4fa66456690e4b0c679e3701ca0b4fa31e", + "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/cdee7c84ba8b2a8aafa1c055f5cb4f640d81c129", + "reference": "cdee7c84ba8b2a8aafa1c055f5cb4f640d81c129", "shasum": "" }, "require": { - "imagine/imagine": "*", - "knplabs/knp-snappy": "dev-master", - "silex/silex": "~1.0" + "php": ">=5.3.3" }, - "time": "2013-10-15 06:58:44", + "time": "2014-02-11 15:39:28", "type": "library", - "installation-source": "source", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "installation-source": "dist", "autoload": { "psr-0": { - "Grom\\Silex": "src" - } + "Symfony\\Component\\HttpFoundation\\": "" + }, + "classmap": [ + "Symfony/Component/HttpFoundation/Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -858,45 +1001,56 @@ ], "authors": [ { - "name": "Jérôme Tamarelle", - "email": "jerome@tamarelle.net" + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" } ], - "description": "Imagine & KnpSnappy integration for Silex.", - "homepage": "http://github.com/GromNaN/SilexServiceProvider", - "keywords": [ - "image", - "imagine", - "pdf", - "silex", - "snappy" - ] + "description": "Symfony HttpFoundation Component", + "homepage": "http://symfony.com" }, { - "name": "knplabs/console-service-provider", - "version": "dev-master", - "version_normalized": "9999999-dev", + "name": "symfony/event-dispatcher", + "version": "v2.4.2", + "version_normalized": "2.4.2.0", + "target-dir": "Symfony/Component/EventDispatcher", "source": { "type": "git", - "url": "https://github.com/KnpLabs/ConsoleServiceProvider.git", - "reference": "1f1a3315409814d01702a47a8823549c6996de41" + "url": "https://github.com/symfony/EventDispatcher.git", + "reference": "4708b8cd41984a5ba29fe7dd40716f7f761ac501" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/KnpLabs/ConsoleServiceProvider/zipball/1f1a3315409814d01702a47a8823549c6996de41", - "reference": "1f1a3315409814d01702a47a8823549c6996de41", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/4708b8cd41984a5ba29fe7dd40716f7f761ac501", + "reference": "4708b8cd41984a5ba29fe7dd40716f7f761ac501", "shasum": "" }, "require": { - "php": ">=5.3.2", - "symfony/console": "~2.1" + "php": ">=5.3.3" }, - "time": "2013-06-13 12:43:39", + "require-dev": { + "symfony/dependency-injection": "~2.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "time": "2014-02-11 13:52:09", "type": "library", - "installation-source": "source", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "installation-source": "dist", "autoload": { "psr-0": { - "Knp\\": "" + "Symfony\\Component\\EventDispatcher\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -905,87 +1059,123 @@ ], "authors": [ { - "name": "KnpLabs", - "homepage": "http://knplabs.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" } ], - "description": "console service provider for Silex", - "homepage": "http://knplabs.com", - "keywords": [ - "console", - "silex" - ] + "description": "Symfony EventDispatcher Component", + "homepage": "http://symfony.com" }, { - "name": "jmontoyaa/phpqrcode", - "version": "dev-master", - "version_normalized": "9999999-dev", + "name": "symfony/http-kernel", + "version": "v2.4.2", + "version_normalized": "2.4.2.0", + "target-dir": "Symfony/Component/HttpKernel", "source": { "type": "git", - "url": "https://github.com/jmontoyaa/phpqrcode.git", - "reference": "f7b600722469b0d98de509206afc4e0738cb44cb" + "url": "https://github.com/symfony/HttpKernel.git", + "reference": "445d6eee0eab2a6cfab41b5dc43f1b86ec34d110" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jmontoyaa/phpqrcode/zipball/f7b600722469b0d98de509206afc4e0738cb44cb", - "reference": "f7b600722469b0d98de509206afc4e0738cb44cb", + "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/445d6eee0eab2a6cfab41b5dc43f1b86ec34d110", + "reference": "445d6eee0eab2a6cfab41b5dc43f1b86ec34d110", "shasum": "" }, "require": { - "php": ">=4.3.10" + "php": ">=5.3.3", + "psr/log": "~1.0", + "symfony/debug": "~2.3", + "symfony/event-dispatcher": "~2.1", + "symfony/http-foundation": "~2.4" }, - "time": "2013-05-10 14:08:33", + "require-dev": { + "symfony/browser-kit": "~2.2", + "symfony/class-loader": "~2.1", + "symfony/config": "~2.0", + "symfony/console": "~2.2", + "symfony/dependency-injection": "~2.0", + "symfony/finder": "~2.0", + "symfony/process": "~2.0", + "symfony/routing": "~2.2", + "symfony/stopwatch": "~2.2", + "symfony/templating": "~2.2" + }, + "suggest": { + "symfony/browser-kit": "", + "symfony/class-loader": "", + "symfony/config": "", + "symfony/console": "", + "symfony/dependency-injection": "", + "symfony/finder": "" + }, + "time": "2014-02-12 19:27:03", "type": "library", - "installation-source": "source", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "installation-source": "dist", "autoload": { - "classmap": [ - "." - ] + "psr-0": { + "Symfony\\Component\\HttpKernel\\": "" + } }, + "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL" + "MIT" ], "authors": [ { - "name": "Julio Montoya" + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" } ], - "description": "A PHP class to generate QR Code", - "homepage": "http://github.com/jmontoyaa/phpqrcode/", - "keywords": [ - "php", - "qrcode" - ], - "support": { - "source": "https://github.com/jmontoyaa/phpqrcode/tree/master" - } + "description": "Symfony HttpKernel Component", + "homepage": "http://symfony.com" }, { - "name": "neutron/silex-filesystem-provider", - "version": "dev-master", - "version_normalized": "9999999-dev", + "name": "pimple/pimple", + "version": "v1.1.1", + "version_normalized": "1.1.1.0", "source": { "type": "git", - "url": "https://github.com/romainneutron/Silex-Filesystem-Service-Provider.git", - "reference": "45440ffe6d327a79f11b20ecdb2e3b2523da46a2" + "url": "https://github.com/fabpot/Pimple.git", + "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/romainneutron/Silex-Filesystem-Service-Provider/zipball/45440ffe6d327a79f11b20ecdb2e3b2523da46a2", - "reference": "45440ffe6d327a79f11b20ecdb2e3b2523da46a2", + "url": "https://api.github.com/repos/fabpot/Pimple/zipball/2019c145fe393923f3441b23f29bbdfaa5c58c4d", + "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d", "shasum": "" }, "require": { - "php": ">=5.3.3", - "silex/silex": ">=1.0", - "symfony/filesystem": ">=2.0" + "php": ">=5.3.0" }, - "time": "2013-09-17 10:37:23", + "time": "2013-11-22 08:30:29", "type": "library", - "installation-source": "source", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "installation-source": "dist", "autoload": { "psr-0": { - "Neutron": "src" + "Pimple": "lib/" } }, "notification-url": "https://packagist.org/downloads/", @@ -994,42 +1184,82 @@ ], "authors": [ { - "name": "Romain Neutron", - "email": "imprec@gmail.com", - "homepage": "http://www.lickmychip.com/" + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" } ], - "description": "A Silex Provider for Symfony Filesystem component", + "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", + "homepage": "http://pimple.sensiolabs.org", "keywords": [ - "filesystem", - "silex", - "temporary-filesystem" + "container", + "dependency injection" ] }, { - "name": "jbroadway/urlify", - "version": "1.0.0-stable", - "version_normalized": "1.0.0.0", + "name": "silex/silex", + "version": "v1.1.2", + "version_normalized": "1.1.2.0", "source": { "type": "git", - "url": "https://github.com/jbroadway/urlify.git", - "reference": "2fa0f7b38d4faebbb94f62e97bd86e740e68f75a" + "url": "https://github.com/silexphp/Silex.git", + "reference": "47cc7d6545450ef8a91f50c04e8c7b3b04fceae9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jbroadway/urlify/zipball/2fa0f7b38d4faebbb94f62e97bd86e740e68f75a", - "reference": "2fa0f7b38d4faebbb94f62e97bd86e740e68f75a", + "url": "https://api.github.com/repos/silexphp/Silex/zipball/47cc7d6545450ef8a91f50c04e8c7b3b04fceae9", + "reference": "47cc7d6545450ef8a91f50c04e8c7b3b04fceae9", "shasum": "" }, - "require": { - "php": ">=5.3.0" + "require": { + "php": ">=5.3.3", + "pimple/pimple": "~1.0", + "symfony/event-dispatcher": ">=2.3,<2.5-dev", + "symfony/http-foundation": ">=2.3,<2.5-dev", + "symfony/http-kernel": ">=2.3,<2.5-dev", + "symfony/routing": ">=2.3,<2.5-dev" + }, + "require-dev": { + "doctrine/dbal": ">=2.2.0,<2.4.0-dev", + "monolog/monolog": "~1.4,>=1.4.1", + "phpunit/phpunit": "~3.7", + "swiftmailer/swiftmailer": "5.*", + "symfony/browser-kit": ">=2.3,<2.5-dev", + "symfony/config": ">=2.3,<2.5-dev", + "symfony/css-selector": ">=2.3,<2.5-dev", + "symfony/debug": ">=2.3,<2.5-dev", + "symfony/dom-crawler": ">=2.3,<2.5-dev", + "symfony/finder": ">=2.3,<2.5-dev", + "symfony/form": ">=2.3,<2.5-dev", + "symfony/locale": ">=2.3,<2.5-dev", + "symfony/monolog-bridge": ">=2.3,<2.5-dev", + "symfony/options-resolver": ">=2.3,<2.5-dev", + "symfony/process": ">=2.3,<2.5-dev", + "symfony/security": ">=2.3,<2.5-dev", + "symfony/serializer": ">=2.3,<2.5-dev", + "symfony/translation": ">=2.3,<2.5-dev", + "symfony/twig-bridge": ">=2.3,<2.5-dev", + "symfony/validator": ">=2.3,<2.5-dev", + "twig/twig": ">=1.8.0,<2.0-dev" }, - "time": "2013-02-11 14:41:22", + "suggest": { + "symfony/browser-kit": ">=2.3,<2.5-dev", + "symfony/css-selector": ">=2.3,<2.5-dev", + "symfony/dom-crawler": ">=2.3,<2.5-dev", + "symfony/form": ">=2.3,<2.5-dev" + }, + "time": "2013-10-30 08:53:26", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, "installation-source": "dist", "autoload": { "psr-0": { - "URLify": "" + "Silex": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1038,107 +1268,111 @@ ], "authors": [ { - "name": "Johnny Broadway", - "email": "johnny@johnnybroadway.com", - "homepage": "http://www.johnnybroadway.com/", - "role": "Main Developer" + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch", + "homepage": "http://wiedler.ch/igor/" } ], - "description": "PHP port of URLify.js from the Django project. Transliterates non-ascii characters for use in URLs.", - "homepage": "https://github.com/jbroadway/urlify", + "description": "The PHP micro-framework based on the Symfony2 Components", + "homepage": "http://silex.sensiolabs.org", "keywords": [ - "encode", - "iconv", - "link", - "slug", - "translit", - "transliterate", - "transliteration", - "url", - "urlify" + "microframework" ] }, { - "name": "swiftmailer/swiftmailer", - "version": "v4.1.8", - "version_normalized": "4.1.8.0", + "name": "imagine/imagine", + "version": "dev-develop", + "version_normalized": "dev-develop", "source": { "type": "git", - "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "28ac862c8d5ccbe5c7ee8cecc07e1ca9d5195b56" + "url": "https://github.com/avalanche123/Imagine.git", + "reference": "852d86227059f2c418f7bb6d1d2058f7bdc4ffa2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/28ac862c8d5ccbe5c7ee8cecc07e1ca9d5195b56", - "reference": "28ac862c8d5ccbe5c7ee8cecc07e1ca9d5195b56", + "url": "https://api.github.com/repos/avalanche123/Imagine/zipball/852d86227059f2c418f7bb6d1d2058f7bdc4ffa2", + "reference": "852d86227059f2c418f7bb6d1d2058f7bdc4ffa2", "shasum": "" }, "require": { - "php": ">=5.2.4" + "php": ">=5.3.2" }, - "time": "2012-06-17 20:55:34", + "require-dev": { + "sami/sami": "dev-master" + }, + "suggest": { + "ext-gd": "to use the GD implementation", + "ext-gmagick": "to use the Gmagick implementation", + "ext-imagick": "to use the Imagick implementation" + }, + "time": "2014-03-05 12:40:36", "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-develop": "0.6-dev" } }, - "installation-source": "dist", + "installation-source": "source", "autoload": { - "files": [ - "lib/swift_required.php" - ] + "psr-0": { + "Imagine": "lib/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL" + "MIT" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Chris Corbyn" + "name": "Bulat Shakirzyanov", + "email": "mallluhuct@gmail.com", + "homepage": "http://avalanche123.com" } ], - "description": "Swiftmailer, free feature-rich PHP mailer", - "homepage": "http://swiftmailer.org", + "description": "Image processing for PHP 5.3", + "homepage": "http://imagine.readthedocs.org/", "keywords": [ - "mail", - "mailer" + "drawing", + "graphics", + "image manipulation", + "image processing" ] }, { - "name": "symfony/finder", - "version": "2.3.x-dev", - "version_normalized": "2.3.9999999.9999999-dev", - "target-dir": "Symfony/Component/Finder", + "name": "knplabs/knp-snappy", + "version": "dev-master", + "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/symfony/Finder.git", - "reference": "c39a28f2e6bcea817dd696993d528b67917f324e" + "url": "https://github.com/KnpLabs/snappy.git", + "reference": "0e79d842ec642a0d12359b82af975a01e061e5fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Finder/zipball/c39a28f2e6bcea817dd696993d528b67917f324e", - "reference": "c39a28f2e6bcea817dd696993d528b67917f324e", + "url": "https://api.github.com/repos/KnpLabs/snappy/zipball/0e79d842ec642a0d12359b82af975a01e061e5fa", + "reference": "0e79d842ec642a0d12359b82af975a01e061e5fa", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.0" }, - "time": "2014-01-07 13:19:25", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } + "suggest": { + "google/wkhtmltopdf-amd64": "Provide wkhtmltopdf-amd64 binary, use version `0.11.0-RC1` as dependency", + "google/wkhtmltopdf-i386": "Provide wkhtmltopdf-i386 binary, use version `0.11.0-RC1` as dependency", + "symfony/process": "Process Component of Symfony2." }, + "time": "2014-03-01 20:46:15", + "type": "library", "installation-source": "source", "autoload": { "psr-0": { - "Symfony\\Component\\Finder\\": "" + "Knp\\Snappy": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1147,54 +1381,51 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "KnpLabs Team", + "homepage": "http://knplabs.com" }, { "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "homepage": "http://github.com/KnpLabs/snappy/contributors" } ], - "description": "Symfony Finder Component", - "homepage": "http://symfony.com" + "description": "PHP5 library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage.", + "homepage": "http://github.com/KnpLabs/snappy", + "keywords": [ + "knp", + "knplabs", + "pdf", + "snapshot", + "thumbnail", + "wkhtmltopdf" + ] }, { - "name": "igorw/config-service-provider", + "name": "grom/silex-service-provider", "version": "dev-master", "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/igorw/ConfigServiceProvider.git", - "reference": "8ccf0f6e9324629720c58fa071e74dbd2501f437" + "url": "https://github.com/GromNaN/SilexServiceProvider.git", + "reference": "2ffe8f4fa66456690e4b0c679e3701ca0b4fa31e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/igorw/ConfigServiceProvider/zipball/8ccf0f6e9324629720c58fa071e74dbd2501f437", - "reference": "8ccf0f6e9324629720c58fa071e74dbd2501f437", + "url": "https://api.github.com/repos/GromNaN/SilexServiceProvider/zipball/2ffe8f4fa66456690e4b0c679e3701ca0b4fa31e", + "reference": "2ffe8f4fa66456690e4b0c679e3701ca0b4fa31e", "shasum": "" }, "require": { + "imagine/imagine": "*", + "knplabs/knp-snappy": "dev-master", "silex/silex": "~1.0" }, - "require-dev": { - "jamesmoss/toml": "~0.1", - "symfony/yaml": "~2.1" - }, - "suggest": { - "jamesmoss/toml": "~0.1", - "symfony/yaml": "~2.1" - }, - "time": "2013-10-30 14:42:08", + "time": "2013-10-15 06:58:44", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, "installation-source": "source", "autoload": { "psr-0": { - "Igorw\\Silex": "src" + "Grom\\Silex": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1203,47 +1434,56 @@ ], "authors": [ { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch", - "homepage": "http://wiedler.ch/igor/" - }, - { - "name": "Contributors", - "homepage": "https://github.com/igorw/ConfigServiceProvider/contributors" + "name": "Jérôme Tamarelle", + "email": "jerome@tamarelle.net" } ], - "description": "A config ServiceProvider for Silex with support for php, json and yaml.", + "description": "Imagine & KnpSnappy integration for Silex.", + "homepage": "http://github.com/GromNaN/SilexServiceProvider", "keywords": [ - "silex" + "image", + "imagine", + "pdf", + "silex", + "snappy" ] }, { - "name": "seld/jsonlint", - "version": "1.1.2", - "version_normalized": "1.1.2.0", + "name": "symfony/console", + "version": "v2.4.2", + "version_normalized": "2.4.2.0", + "target-dir": "Symfony/Component/Console", "source": { "type": "git", - "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "7cd4c4965e17e6e4c07f26d566619a4c76f8c672" + "url": "https://github.com/symfony/Console.git", + "reference": "940f217cbc3c8a33e5403e7c595495c4884400fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/7cd4c4965e17e6e4c07f26d566619a4c76f8c672", - "reference": "7cd4c4965e17e6e4c07f26d566619a4c76f8c672", + "url": "https://api.github.com/repos/symfony/Console/zipball/940f217cbc3c8a33e5403e7c595495c4884400fe", + "reference": "940f217cbc3c8a33e5403e7c595495c4884400fe", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=5.3.3" }, - "time": "2013-11-04 15:41:11", - "bin": [ - "bin/jsonlint" - ], + "require-dev": { + "symfony/event-dispatcher": "~2.1" + }, + "suggest": { + "symfony/event-dispatcher": "" + }, + "time": "2014-02-11 13:52:09", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, "installation-source": "dist", "autoload": { "psr-0": { - "Seld\\JsonLint": "src/" + "Symfony\\Component\\Console\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1252,274 +1492,228 @@ ], "authors": [ { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be", - "role": "Developer" + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" } ], - "description": "JSON Linter", - "keywords": [ - "json", - "linter", - "parser", - "validator" - ] + "description": "Symfony Console Component", + "homepage": "http://symfony.com" }, { - "name": "justinrainbow/json-schema", - "version": "1.1.0", - "version_normalized": "1.1.0.0", + "name": "knplabs/console-service-provider", + "version": "dev-master", + "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "05ff6d8d79fe3ad190b0663d80d3f9deee79416c" + "url": "https://github.com/KnpLabs/ConsoleServiceProvider.git", + "reference": "1f1a3315409814d01702a47a8823549c6996de41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/05ff6d8d79fe3ad190b0663d80d3f9deee79416c", - "reference": "05ff6d8d79fe3ad190b0663d80d3f9deee79416c", + "url": "https://api.github.com/repos/KnpLabs/ConsoleServiceProvider/zipball/1f1a3315409814d01702a47a8823549c6996de41", + "reference": "1f1a3315409814d01702a47a8823549c6996de41", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=5.3.2", + "symfony/console": "~2.1" }, - "time": "2012-01-03 00:33:17", + "time": "2013-06-13 12:43:39", "type": "library", - "installation-source": "dist", + "installation-source": "source", "autoload": { "psr-0": { - "JsonSchema": "src/" + "Knp\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "NewBSD" + "MIT" ], "authors": [ { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch", - "homepage": "http://wiedler.ch/igor/" - }, - { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com", - "homepage": "http://digitalkaoz.net" + "name": "KnpLabs", + "homepage": "http://knplabs.com" } ], - "description": "A library to validate a json schema.", - "homepage": "https://github.com/justinrainbow/json-schema", + "description": "console service provider for Silex", + "homepage": "http://knplabs.com", "keywords": [ - "json", - "schema" + "console", + "silex" ] }, { - "name": "composer/composer", - "version": "1.0.0-alpha7", - "version_normalized": "1.0.0.0-alpha7", + "name": "jmontoyaa/phpqrcode", + "version": "dev-master", + "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/composer/composer.git", - "reference": "3e6afd8975b6ff6eb3045ba00e532d6c0e302fe6" + "url": "https://github.com/jmontoyaa/phpqrcode.git", + "reference": "f7b600722469b0d98de509206afc4e0738cb44cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/3e6afd8975b6ff6eb3045ba00e532d6c0e302fe6", - "reference": "3e6afd8975b6ff6eb3045ba00e532d6c0e302fe6", + "url": "https://api.github.com/repos/jmontoyaa/phpqrcode/zipball/f7b600722469b0d98de509206afc4e0738cb44cb", + "reference": "f7b600722469b0d98de509206afc4e0738cb44cb", "shasum": "" }, "require": { - "justinrainbow/json-schema": "1.1.*", - "php": ">=5.3.2", - "seld/jsonlint": "1.*", - "symfony/console": "~2.3@dev", - "symfony/finder": "~2.1", - "symfony/process": "~2.1@dev" - }, - "require-dev": { - "phpunit/phpunit": "~3.7.10" - }, - "suggest": { - "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", - "ext-zip": "Enabling the zip extension allows you to unzip archives, and allows gzip compression of all internet traffic" + "php": ">=4.3.10" }, - "time": "2013-05-04 09:15:22", - "bin": [ - "bin/composer" - ], + "time": "2013-05-10 14:08:33", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", + "installation-source": "source", "autoload": { - "psr-0": { - "Composer": "src/" - } + "classmap": [ + "." + ] }, - "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "LGPL" ], "authors": [ { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be", - "role": "Developer" - }, - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" + "name": "Julio Montoya" } ], - "description": "Dependency Manager", - "homepage": "http://getcomposer.org/", + "description": "A PHP class to generate QR Code", + "homepage": "http://github.com/jmontoyaa/phpqrcode/", "keywords": [ - "autoload", - "dependency", - "package" - ] + "php", + "qrcode" + ], + "support": { + "source": "https://github.com/jmontoyaa/phpqrcode/tree/master" + } }, { - "name": "zendframework/zend-stdlib", - "version": "2.2.5", - "version_normalized": "2.2.5.0", - "target-dir": "Zend/Stdlib", + "name": "symfony/filesystem", + "version": "v2.4.2", + "version_normalized": "2.4.2.0", + "target-dir": "Symfony/Component/Filesystem", "source": { "type": "git", - "url": "https://github.com/zendframework/Component_ZendStdlib.git", - "reference": "f440ecfc828d61d620662a03987c8287e1e4801e" + "url": "https://github.com/symfony/Filesystem.git", + "reference": "7e65abb06d3b38f4be89266fe3fb4a759544e713" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/Component_ZendStdlib/zipball/f440ecfc828d61d620662a03987c8287e1e4801e", - "reference": "f440ecfc828d61d620662a03987c8287e1e4801e", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/7e65abb06d3b38f4be89266fe3fb4a759544e713", + "reference": "7e65abb06d3b38f4be89266fe3fb4a759544e713", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "suggest": { - "zendframework/zend-eventmanager": "To support aggregate hydrator usage", - "zendframework/zend-servicemanager": "To support hydrator plugin manager usage" - }, - "time": "2013-10-20 06:00:20", + "time": "2014-01-07 13:28:54", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev", - "dev-develop": "2.3-dev" + "dev-master": "2.4-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "Zend\\Stdlib\\": "" + "Symfony\\Component\\Filesystem\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], - "keywords": [ - "stdlib", - "zf2" - ] + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "http://symfony.com" }, { - "name": "zendframework/zend-config", - "version": "2.2.5", - "version_normalized": "2.2.5.0", - "target-dir": "Zend/Config", + "name": "neutron/silex-filesystem-provider", + "version": "dev-master", + "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/zendframework/Component_ZendConfig.git", - "reference": "e3457e088f641bfd5b02d9985c1ef504a571bc62" + "url": "https://github.com/romainneutron/Silex-Filesystem-Service-Provider.git", + "reference": "45440ffe6d327a79f11b20ecdb2e3b2523da46a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/Component_ZendConfig/zipball/e3457e088f641bfd5b02d9985c1ef504a571bc62", - "reference": "e3457e088f641bfd5b02d9985c1ef504a571bc62", + "url": "https://api.github.com/repos/romainneutron/Silex-Filesystem-Service-Provider/zipball/45440ffe6d327a79f11b20ecdb2e3b2523da46a2", + "reference": "45440ffe6d327a79f11b20ecdb2e3b2523da46a2", "shasum": "" }, "require": { "php": ">=5.3.3", - "zendframework/zend-stdlib": "self.version" - }, - "suggest": { - "zendframework/zend-json": "Zend\\Json to use the Json reader or writer classes", - "zendframework/zend-servicemanager": "Zend\\ServiceManager for use with the Config Factory to retrieve reader and writer instances" + "silex/silex": ">=1.0", + "symfony/filesystem": ">=2.0" }, - "time": "2013-10-02 08:00:13", + "time": "2013-09-17 10:37:23", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2-dev", - "dev-develop": "2.3-dev" - } - }, - "installation-source": "dist", + "installation-source": "source", "autoload": { "psr-0": { - "Zend\\Config\\": "" + "Neutron": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], - "description": "provides a nested object property based user interface for accessing this configuration data within application code", + "authors": [ + { + "name": "Romain Neutron", + "email": "imprec@gmail.com", + "homepage": "http://www.lickmychip.com/" + } + ], + "description": "A Silex Provider for Symfony Filesystem component", "keywords": [ - "config", - "zf2" + "filesystem", + "silex", + "temporary-filesystem" ] }, { - "name": "doctrine/dbal", - "version": "v2.4.2", - "version_normalized": "2.4.2.0", + "name": "jbroadway/urlify", + "version": "1.0.0-stable", + "version_normalized": "1.0.0.0", "source": { "type": "git", - "url": "https://github.com/doctrine/dbal.git", - "reference": "fec965d330c958e175c39e61c3f6751955af32d0" + "url": "https://github.com/jbroadway/urlify.git", + "reference": "2fa0f7b38d4faebbb94f62e97bd86e740e68f75a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/fec965d330c958e175c39e61c3f6751955af32d0", - "reference": "fec965d330c958e175c39e61c3f6751955af32d0", + "url": "https://api.github.com/repos/jbroadway/urlify/zipball/2fa0f7b38d4faebbb94f62e97bd86e740e68f75a", + "reference": "2fa0f7b38d4faebbb94f62e97bd86e740e68f75a", "shasum": "" }, "require": { - "doctrine/common": "~2.4", - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "3.7.*", - "symfony/console": "~2.0" - }, - "suggest": { - "symfony/console": "Allows use of the command line interface" + "php": ">=5.3.0" }, - "time": "2014-01-01 16:43:57", + "time": "2013-02-11 14:41:22", "type": "library", "installation-source": "dist", "autoload": { "psr-0": { - "Doctrine\\DBAL\\": "lib/" + "URLify": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1527,73 +1721,57 @@ "MIT" ], "authors": [ - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com", - "homepage": "http://www.jwage.com/", - "role": "Creator" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" + { + "name": "Johnny Broadway", + "email": "johnny@johnnybroadway.com", + "homepage": "http://www.johnnybroadway.com/", + "role": "Main Developer" } ], - "description": "Database Abstraction Layer", - "homepage": "http://www.doctrine-project.org", + "description": "PHP port of URLify.js from the Django project. Transliterates non-ascii characters for use in URLs.", + "homepage": "https://github.com/jbroadway/urlify", "keywords": [ - "database", - "dbal", - "persistence", - "queryobject" + "encode", + "iconv", + "link", + "slug", + "translit", + "transliterate", + "transliteration", + "url", + "urlify" ] }, { - "name": "doctrine/migrations", - "version": "dev-master", - "version_normalized": "9999999-dev", + "name": "swiftmailer/swiftmailer", + "version": "v4.1.8", + "version_normalized": "4.1.8.0", "source": { "type": "git", - "url": "https://github.com/doctrine/migrations.git", - "reference": "0742fc7167a4deedaabc8639849a3e71082999f1" + "url": "https://github.com/swiftmailer/swiftmailer.git", + "reference": "28ac862c8d5ccbe5c7ee8cecc07e1ca9d5195b56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/migrations/zipball/0742fc7167a4deedaabc8639849a3e71082999f1", - "reference": "0742fc7167a4deedaabc8639849a3e71082999f1", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/28ac862c8d5ccbe5c7ee8cecc07e1ca9d5195b56", + "reference": "28ac862c8d5ccbe5c7ee8cecc07e1ca9d5195b56", "shasum": "" }, "require": { - "doctrine/dbal": "~2.0", - "php": ">=5.3.2" - }, - "require-dev": { - "symfony/console": "2.*", - "symfony/yaml": "2.*" - }, - "suggest": { - "symfony/console": "to run the migration from the console" + "php": ">=5.2.4" }, - "time": "2014-01-20 11:29:43", + "time": "2012-06-17 20:55:34", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "4.1-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { - "psr-0": { - "Doctrine\\DBAL\\Migrations": "lib" - } + "files": [ + "lib/swift_required.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1601,59 +1779,52 @@ ], "authors": [ { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com", - "homepage": "http://www.jwage.com/", - "role": "Creator" + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" }, { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" + "name": "Chris Corbyn" } ], - "description": "Database Schema migrations using Doctrine DBAL", - "homepage": "http://www.doctrine-project.org", + "description": "Swiftmailer, free feature-rich PHP mailer", + "homepage": "http://swiftmailer.org", "keywords": [ - "database", - "migrations" + "mail", + "mailer" ] }, { - "name": "flint/flint", - "version": "1.6.0", - "version_normalized": "1.6.0.0", + "name": "symfony/process", + "version": "v2.4.2", + "version_normalized": "2.4.2.0", + "target-dir": "Symfony/Component/Process", "source": { "type": "git", - "url": "https://github.com/flint/flint.git", - "reference": "bf8896ac62973cd82c1a510d0ee33a76d12f072e" + "url": "https://github.com/symfony/Process.git", + "reference": "c175448bac997556f8ab972908a4e14c7291fb03" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/flint/flint/zipball/bf8896ac62973cd82c1a510d0ee33a76d12f072e", - "reference": "bf8896ac62973cd82c1a510d0ee33a76d12f072e", + "url": "https://api.github.com/repos/symfony/Process/zipball/c175448bac997556f8ab972908a4e14c7291fb03", + "reference": "c175448bac997556f8ab972908a4e14c7291fb03", "shasum": "" }, "require": { - "flint/tacker": "~0.3", - "php": ">=5.3.3", - "silex/silex": "~1.1", - "twig/twig": "~1.10" - }, - "require-dev": { - "symfony/console": "~2.2", - "symfony/yaml": "~2.2" + "php": ">=5.3.3" }, - "time": "2013-11-26 12:34:35", + "time": "2014-02-11 13:52:09", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "2.4-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "Flint": "src" + "Symfony\\Component\\Process\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1662,43 +1833,50 @@ ], "authors": [ { - "name": "Henrik Bjornskov", - "email": "henrik@bjrnskov.dk", - "homepage": "http://henrik.bjrnskov.dk" + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" } ], - "description": "Enhanced Silex" + "description": "Symfony Process Component", + "homepage": "http://symfony.com" }, { - "name": "opauth/opauth", - "version": "0.4.4", - "version_normalized": "0.4.4.0", + "name": "symfony/finder", + "version": "v2.4.2", + "version_normalized": "2.4.2.0", + "target-dir": "Symfony/Component/Finder", "source": { "type": "git", - "url": "https://github.com/opauth/opauth.git", - "reference": "436fb98c2374c9e8ae4d8adddf83214bee4d9c72" + "url": "https://github.com/symfony/Finder.git", + "reference": "b6735d1fc16da13c4c7dddfe78366a4a098cf011" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opauth/opauth/zipball/436fb98c2374c9e8ae4d8adddf83214bee4d9c72", - "reference": "436fb98c2374c9e8ae4d8adddf83214bee4d9c72", + "url": "https://api.github.com/repos/symfony/Finder/zipball/b6735d1fc16da13c4c7dddfe78366a4a098cf011", + "reference": "b6735d1fc16da13c4c7dddfe78366a4a098cf011", "shasum": "" }, "require": { - "php": ">=5.2.0" - }, - "suggest": { - "opauth/facebook": "Allows Facebook authentication", - "opauth/google": "Allows Google authentication", - "opauth/twitter": "Allows Twitter authentication" + "php": ">=5.3.3" }, - "time": "2013-05-10 09:01:52", + "time": "2014-01-07 13:28:54", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, "installation-source": "dist", "autoload": { - "classmap": [ - "lib/Opauth/" - ] + "psr-0": { + "Symfony\\Component\\Finder\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1706,100 +1884,108 @@ ], "authors": [ { - "name": "U-Zyn Chua", - "email": "chua@uzyn.com", - "homepage": "http://uzyn.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" } ], - "description": "Multi-provider authentication framework for PHP", - "homepage": "http://opauth.org", - "keywords": [ - "Authentication", - "OpenId", - "auth", - "facebook", - "google", - "oauth", - "omniauth", - "twitter" - ] + "description": "Symfony Finder Component", + "homepage": "http://symfony.com" }, { - "name": "icehero/silex-opauth", - "version": "dev-master", - "version_normalized": "9999999-dev", + "name": "symfony/config", + "version": "v2.4.2", + "version_normalized": "2.4.2.0", + "target-dir": "Symfony/Component/Config", "source": { "type": "git", - "url": "https://github.com/icehero/silex-opauth.git", - "reference": "e4be31b76f2033d7401fadb7093de3d56625c050" + "url": "https://github.com/symfony/Config.git", + "reference": "d81bd01eac1514c10dcb3b11eaa9048d6b87dd1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/icehero/silex-opauth/zipball/e4be31b76f2033d7401fadb7093de3d56625c050", - "reference": "e4be31b76f2033d7401fadb7093de3d56625c050", + "url": "https://api.github.com/repos/symfony/Config/zipball/d81bd01eac1514c10dcb3b11eaa9048d6b87dd1f", + "reference": "d81bd01eac1514c10dcb3b11eaa9048d6b87dd1f", "shasum": "" }, "require": { - "opauth/opauth": "*" - }, - "require-dev": { - "opauth/facebook": "*", - "silex/silex": "dev-master" + "php": ">=5.3.3", + "symfony/filesystem": "~2.3" }, - "time": "2014-01-05 16:52:17", + "time": "2014-01-07 13:28:54", "type": "library", - "installation-source": "source", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "installation-source": "dist", "autoload": { "psr-0": { - "SilexOpauth": "src" + "Symfony\\Component\\Config\\": "" } }, "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], "authors": [ { - "name": "Florin Popa", - "email": "pp.flrn@gmail.com", - "homepage": "http://florinpopa.net" + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" }, { - "name": "Rafal Lindemann", - "email": "rl@stamina.pl", - "homepage": "http://stamina.pl" + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" } ], - "description": "Opauth silex framework service provider.", - "homepage": "https://github.com/icehero/silex-opauth", - "keywords": [ - "OPAuth", - "oauth", - "silex" - ] + "description": "Symfony Config Component", + "homepage": "http://symfony.com" }, { - "name": "opauth/openid", - "version": "0.1.0", - "version_normalized": "0.1.0.0", + "name": "igorw/config-service-provider", + "version": "dev-master", + "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/opauth/openid.git", - "reference": "ebf166cddbaff78e740234189073ab6919e85eb7" + "url": "https://github.com/igorw/ConfigServiceProvider.git", + "reference": "8ccf0f6e9324629720c58fa071e74dbd2501f437" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opauth/openid/zipball/ebf166cddbaff78e740234189073ab6919e85eb7", - "reference": "ebf166cddbaff78e740234189073ab6919e85eb7", + "url": "https://api.github.com/repos/igorw/ConfigServiceProvider/zipball/8ccf0f6e9324629720c58fa071e74dbd2501f437", + "reference": "8ccf0f6e9324629720c58fa071e74dbd2501f437", "shasum": "" }, "require": { - "opauth/opauth": ">=0.2.0", - "php": ">=5.2.0" + "silex/silex": "~1.0" + }, + "require-dev": { + "jamesmoss/toml": "~0.1", + "symfony/yaml": "~2.1" + }, + "suggest": { + "jamesmoss/toml": "~0.1", + "symfony/yaml": "~2.1" }, - "time": "2012-06-08 07:00:03", + "time": "2013-10-30 14:42:08", "type": "library", - "installation-source": "dist", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "installation-source": "source", "autoload": { "psr-0": { - "": "." + "Igorw\\Silex": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1808,44 +1994,50 @@ ], "authors": [ { - "name": "U-Zyn Chua", - "email": "chua@uzyn.com", - "homepage": "http://uzyn.com" + "name": "Igor Wiedler", + "email": "igor@wiedler.ch", + "homepage": "http://wiedler.ch/igor/" + }, + { + "name": "Contributors", + "homepage": "https://github.com/igorw/ConfigServiceProvider/contributors" } ], - "description": "OpenID strategy for Opauth", - "homepage": "http://opauth.org", + "description": "A config ServiceProvider for Silex with support for php, json and yaml.", "keywords": [ - "Authentication", - "OpenId", - "auth" + "silex" ] }, { - "name": "opauth/facebook", - "version": "0.2.1", - "version_normalized": "0.2.1.0", + "name": "symfony/yaml", + "version": "v2.4.2", + "version_normalized": "2.4.2.0", + "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", - "url": "https://github.com/opauth/facebook.git", - "reference": "28c0e53393a03a66cbfea03073d1d6aacfaddb69" + "url": "https://github.com/symfony/Yaml.git", + "reference": "bb6ddaf8956139d1b8c360b4b713ed0138e876b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opauth/facebook/zipball/28c0e53393a03a66cbfea03073d1d6aacfaddb69", - "reference": "28c0e53393a03a66cbfea03073d1d6aacfaddb69", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/bb6ddaf8956139d1b8c360b4b713ed0138e876b3", + "reference": "bb6ddaf8956139d1b8c360b4b713ed0138e876b3", "shasum": "" }, "require": { - "opauth/opauth": ">=0.2.0", - "php": ">=5.2.0" + "php": ">=5.3.3" }, - "time": "2012-09-21 04:47:35", + "time": "2014-01-07 13:28:54", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, "installation-source": "dist", "autoload": { "psr-0": { - "": "." + "Symfony\\Component\\Yaml\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1854,44 +2046,84 @@ ], "authors": [ { - "name": "U-Zyn Chua", - "email": "chua@uzyn.com", - "homepage": "http://uzyn.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" } ], - "description": "Facebook strategy for Opauth", - "homepage": "http://opauth.org", - "keywords": [ - "Authentication", - "auth", - "facebook" - ] + "description": "Symfony Yaml Component", + "homepage": "http://symfony.com" }, { - "name": "opauth/google", - "version": "0.2.2", - "version_normalized": "0.2.2.0", + "name": "guzzle/guzzle", + "version": "v3.8.1", + "version_normalized": "3.8.1.0", "source": { "type": "git", - "url": "https://github.com/opauth/google.git", - "reference": "35df77684c14acb346a8c3753ae3809852d1a47e" + "url": "https://github.com/guzzle/guzzle.git", + "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opauth/google/zipball/35df77684c14acb346a8c3753ae3809852d1a47e", - "reference": "35df77684c14acb346a8c3753ae3809852d1a47e", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/4de0618a01b34aa1c8c33a3f13f396dcd3882eba", + "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba", "shasum": "" }, "require": { - "opauth/opauth": ">=0.2.0", - "php": ">=5.2.0" + "ext-curl": "*", + "php": ">=5.3.3", + "symfony/event-dispatcher": ">=2.1" }, - "time": "2012-10-18 14:39:52", + "replace": { + "guzzle/batch": "self.version", + "guzzle/cache": "self.version", + "guzzle/common": "self.version", + "guzzle/http": "self.version", + "guzzle/inflection": "self.version", + "guzzle/iterator": "self.version", + "guzzle/log": "self.version", + "guzzle/parser": "self.version", + "guzzle/plugin": "self.version", + "guzzle/plugin-async": "self.version", + "guzzle/plugin-backoff": "self.version", + "guzzle/plugin-cache": "self.version", + "guzzle/plugin-cookie": "self.version", + "guzzle/plugin-curlauth": "self.version", + "guzzle/plugin-error-response": "self.version", + "guzzle/plugin-history": "self.version", + "guzzle/plugin-log": "self.version", + "guzzle/plugin-md5": "self.version", + "guzzle/plugin-mock": "self.version", + "guzzle/plugin-oauth": "self.version", + "guzzle/service": "self.version", + "guzzle/stream": "self.version" + }, + "require-dev": { + "doctrine/cache": "*", + "monolog/monolog": "1.*", + "phpunit/phpunit": "3.7.*", + "psr/log": "1.0.*", + "symfony/class-loader": "*", + "zendframework/zend-cache": "<2.3", + "zendframework/zend-log": "<2.3" + }, + "time": "2014-01-28 22:29:15", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.8-dev" + } + }, "installation-source": "dist", "autoload": { "psr-0": { - "": "." + "Guzzle": "src/", + "Guzzle\\Tests": "tests/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1900,66 +2132,69 @@ ], "authors": [ { - "name": "U-Zyn Chua", - "email": "chua@uzyn.com", - "homepage": "http://uzyn.com" + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Guzzle Community", + "homepage": "https://github.com/guzzle/guzzle/contributors" } ], - "description": "Google strategy for Opauth", - "homepage": "http://opauth.org", + "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", + "homepage": "http://guzzlephp.org/", "keywords": [ - "Authentication", - "auth", - "google" + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" ] }, { - "name": "monolog/monolog", - "version": "1.7.0", - "version_normalized": "1.7.0.0", + "name": "alchemy/zippy", + "version": "0.1.1", + "version_normalized": "0.1.1.0", "source": { "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "6225b22de9dcf36546be3a0b2fa8e3d986153f57" + "url": "https://github.com/alchemy-fr/Zippy.git", + "reference": "7c9211377881a98f84ca382f1e5792e8a27019e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/6225b22de9dcf36546be3a0b2fa8e3d986153f57", - "reference": "6225b22de9dcf36546be3a0b2fa8e3d986153f57", + "url": "https://api.github.com/repos/alchemy-fr/Zippy/zipball/7c9211377881a98f84ca382f1e5792e8a27019e5", + "reference": "7c9211377881a98f84ca382f1e5792e8a27019e5", "shasum": "" }, "require": { - "php": ">=5.3.0", - "psr/log": "~1.0" + "doctrine/collections": "~1.0", + "guzzle/guzzle": "~3.0", + "php": ">=5.3.3", + "pimple/pimple": "~1.0", + "symfony/filesystem": "~2.0", + "symfony/process": "~2.0" }, "require-dev": { - "aws/aws-sdk-php": "~2.4.8", - "doctrine/couchdb": "dev-master", - "mlehner/gelf-php": "1.0.*", - "phpunit/phpunit": "~3.7.0", - "raven/raven": "0.5.*", - "ruflin/elastica": "0.90.*" + "ext-zip": "*", + "sami/sami": "dev-master@dev", + "symfony/finder": "~2.0" }, "suggest": { - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-mongo": "Allow sending log messages to a MongoDB server", - "mlehner/gelf-php": "Allow sending log messages to a GrayLog2 server", - "raven/raven": "Allow sending log messages to a Sentry server", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + "ext-zip": "To use the ZipExtensionAdapter" }, - "time": "2013-11-14 19:48:31", + "time": "2013-04-12 10:24:45", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "0.1.x-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "Monolog": "src/" + "Alchemy": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1968,44 +2203,46 @@ ], "authors": [ { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be", - "role": "Developer" + "name": "Alchemy", + "email": "dev.team@alchemy.fr", + "homepage": "http://www.alchemy.fr/" } ], - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "http://github.com/Seldaek/monolog", + "description": "Zippy, the archive manager companion", "keywords": [ - "log", - "logging", - "psr-3" + "bzip", + "compression", + "tar", + "zip" ] }, { - "name": "evenement/evenement", - "version": "v1.0.0", - "version_normalized": "1.0.0.0", + "name": "seld/jsonlint", + "version": "1.1.2", + "version_normalized": "1.1.2.0", "source": { "type": "git", - "url": "https://github.com/igorw/evenement.git", - "reference": "fa966683e7df3e5dd5929d984a44abfbd6bafe8d" + "url": "https://github.com/Seldaek/jsonlint.git", + "reference": "7cd4c4965e17e6e4c07f26d566619a4c76f8c672" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/igorw/evenement/zipball/fa966683e7df3e5dd5929d984a44abfbd6bafe8d", - "reference": "fa966683e7df3e5dd5929d984a44abfbd6bafe8d", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/7cd4c4965e17e6e4c07f26d566619a4c76f8c672", + "reference": "7cd4c4965e17e6e4c07f26d566619a4c76f8c672", "shasum": "" }, "require": { "php": ">=5.3.0" }, - "time": "2012-05-30 15:01:08", + "time": "2013-11-04 15:41:11", + "bin": [ + "bin/jsonlint" + ], "type": "library", "installation-source": "dist", "autoload": { "psr-0": { - "Evenement": "src" + "Seld\\JsonLint": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2014,106 +2251,121 @@ ], "authors": [ { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch", - "homepage": "http://wiedler.ch/igor/" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be", + "role": "Developer" } ], - "description": "Événement is a very simple event dispatching library for PHP 5.3", + "description": "JSON Linter", "keywords": [ - "event-dispatcher" + "json", + "linter", + "parser", + "validator" ] }, { - "name": "alchemy/binary-driver", - "version": "1.5.0", - "version_normalized": "1.5.0.0", + "name": "justinrainbow/json-schema", + "version": "1.1.0", + "version_normalized": "1.1.0.0", "source": { "type": "git", - "url": "https://github.com/alchemy-fr/BinaryDriver.git", - "reference": "b32c03d4b56ce29f783051eac55887adae654b41" + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "05ff6d8d79fe3ad190b0663d80d3f9deee79416c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/alchemy-fr/BinaryDriver/zipball/b32c03d4b56ce29f783051eac55887adae654b41", - "reference": "b32c03d4b56ce29f783051eac55887adae654b41", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/05ff6d8d79fe3ad190b0663d80d3f9deee79416c", + "reference": "05ff6d8d79fe3ad190b0663d80d3f9deee79416c", "shasum": "" }, "require": { - "evenement/evenement": "~1.0", - "monolog/monolog": "~1.3", - "php": ">=5.3.3", - "psr/log": "~1.0", - "symfony/process": "~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~3.7" + "php": ">=5.3.0" }, - "time": "2013-06-21 15:51:20", + "time": "2012-01-03 00:33:17", "type": "library", "installation-source": "dist", "autoload": { "psr-0": { - "Alchemy": "src" + "JsonSchema": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "NewBSD" ], "authors": [ { - "name": "Romain Neutron", - "email": "imprec@gmail.com", - "homepage": "http://www.lickmychip.com/" + "name": "Igor Wiedler", + "email": "igor@wiedler.ch", + "homepage": "http://wiedler.ch/igor/" }, { - "name": "Nicolas Le Goff", - "email": "legoff.n@gmail.com" + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" }, { - "name": "Phraseanet Team", - "email": "info@alchemy.fr", - "homepage": "http://www.phraseanet.com/" + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com", + "homepage": "http://digitalkaoz.net" } ], - "description": "A set of tools to build binary drivers", + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", "keywords": [ - "binary", - "driver" + "json", + "schema" ] }, { - "name": "swftools/swftools", - "version": "0.3.1", - "version_normalized": "0.3.1.0", + "name": "composer/composer", + "version": "1.0.0-alpha7", + "version_normalized": "1.0.0.0-alpha7", "source": { "type": "git", - "url": "https://github.com/alchemy-fr/PHPSwftools.git", - "reference": "5a0fefbd5a518c9b1ec2ba247640aadbab4cc396" + "url": "https://github.com/composer/composer.git", + "reference": "3e6afd8975b6ff6eb3045ba00e532d6c0e302fe6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/alchemy-fr/PHPSwftools/zipball/5a0fefbd5a518c9b1ec2ba247640aadbab4cc396", - "reference": "5a0fefbd5a518c9b1ec2ba247640aadbab4cc396", + "url": "https://api.github.com/repos/composer/composer/zipball/3e6afd8975b6ff6eb3045ba00e532d6c0e302fe6", + "reference": "3e6afd8975b6ff6eb3045ba00e532d6c0e302fe6", "shasum": "" }, "require": { - "alchemy/binary-driver": "~1.5", - "php": ">=5.3.3", - "pimple/pimple": "~1.0" + "justinrainbow/json-schema": "1.1.*", + "php": ">=5.3.2", + "seld/jsonlint": "1.*", + "symfony/console": "~2.3@dev", + "symfony/finder": "~2.1", + "symfony/process": "~2.1@dev" }, "require-dev": { - "phpunit/phpunit": "~3.7", - "sami/sami": "~1.0", - "silex/silex": "~1.0" + "phpunit/phpunit": "~3.7.10" }, - "time": "2013-07-03 13:11:36", + "suggest": { + "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", + "ext-zip": "Enabling the zip extension allows you to unzip archives, and allows gzip compression of all internet traffic" + }, + "time": "2013-05-04 09:15:22", + "bin": [ + "bin/composer" + ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, "installation-source": "dist", "autoload": { "psr-0": { - "SwfTools": "src" + "Composer": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2122,155 +2374,151 @@ ], "authors": [ { - "name": "Romain Neutron", - "email": "imprec@gmail.com", - "homepage": "http://www.lickmychip.com/" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be", + "role": "Developer" }, { - "name": "Phraseanet Team", - "email": "support@alchemy.fr", - "homepage": "http://www.phraseanet.com/" + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" } ], - "description": "PHP SwfTools", + "description": "Dependency Manager", + "homepage": "http://getcomposer.org/", "keywords": [ - "adobe flash", - "flash", - "swf" + "autoload", + "dependency", + "package" ] }, { - "name": "php-mp4box/php-mp4box", - "version": "0.3.0", - "version_normalized": "0.3.0.0", + "name": "zendframework/zend-stdlib", + "version": "2.2.6", + "version_normalized": "2.2.6.0", + "target-dir": "Zend/Stdlib", "source": { "type": "git", - "url": "https://github.com/alchemy-fr/PHP-MP4Box.git", - "reference": "baa466be3f6d0b46d27bc0e255e958a95cb7738c" + "url": "https://github.com/zendframework/Component_ZendStdlib.git", + "reference": "e646729f2274f4552b6a92e38d8e458efe08ebc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/alchemy-fr/PHP-MP4Box/zipball/baa466be3f6d0b46d27bc0e255e958a95cb7738c", - "reference": "baa466be3f6d0b46d27bc0e255e958a95cb7738c", + "url": "https://api.github.com/repos/zendframework/Component_ZendStdlib/zipball/e646729f2274f4552b6a92e38d8e458efe08ebc5", + "reference": "e646729f2274f4552b6a92e38d8e458efe08ebc5", "shasum": "" }, "require": { - "alchemy/binary-driver": "~1.5", "php": ">=5.3.3" }, - "require-dev": { - "phpunit/phpunit": "~3.7", - "silex/silex": "~1.0" + "suggest": { + "zendframework/zend-eventmanager": "To support aggregate hydrator usage", + "zendframework/zend-servicemanager": "To support hydrator plugin manager usage" }, - "time": "2013-06-25 10:13:06", + "time": "2014-01-04 13:00:28", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, "installation-source": "dist", "autoload": { "psr-0": { - "MP4Box": "src" + "Zend\\Stdlib\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" - ], - "authors": [ - { - "name": "Romain Neutron", - "email": "imprec@gmail.com", - "homepage": "http://www.lickmychip.com/" - }, - { - "name": "Phraseanet Team", - "email": "info@alchemy.fr", - "homepage": "http://www.phraseanet.com/" - } + "BSD-3-Clause" ], - "description": "PHP MP4Box, an Object Oriented library for easy file conversion with MP4 Box", "keywords": [ - "gpac", - "mp4box" + "stdlib", + "zf2" ] }, { - "name": "php-unoconv/php-unoconv", - "version": "0.3.0", - "version_normalized": "0.3.0.0", + "name": "zendframework/zend-config", + "version": "2.2.6", + "version_normalized": "2.2.6.0", + "target-dir": "Zend/Config", "source": { "type": "git", - "url": "https://github.com/alchemy-fr/PHP-Unoconv.git", - "reference": "6d1e14a7467b5d637741396549529dc4d5f9f355" + "url": "https://github.com/zendframework/Component_ZendConfig.git", + "reference": "a31c3980cf7ec88418a931e9cf4ba21079f47a08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/alchemy-fr/PHP-Unoconv/zipball/6d1e14a7467b5d637741396549529dc4d5f9f355", - "reference": "6d1e14a7467b5d637741396549529dc4d5f9f355", + "url": "https://api.github.com/repos/zendframework/Component_ZendConfig/zipball/a31c3980cf7ec88418a931e9cf4ba21079f47a08", + "reference": "a31c3980cf7ec88418a931e9cf4ba21079f47a08", "shasum": "" }, "require": { - "alchemy/binary-driver": "~1.5", - "php": ">=5.3.3" + "php": ">=5.3.3", + "zendframework/zend-stdlib": "self.version" }, - "require-dev": { - "phpunit/phpunit": "~3.7", - "silex/silex": "~1.0" + "suggest": { + "zendframework/zend-json": "Zend\\Json to use the Json reader or writer classes", + "zendframework/zend-servicemanager": "Zend\\ServiceManager for use with the Config Factory to retrieve reader and writer instances" }, - "time": "2013-06-25 10:09:59", + "time": "2014-01-02 18:00:10", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" + } + }, "installation-source": "dist", "autoload": { "psr-0": { - "Unoconv": "src" + "Zend\\Config\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" - ], - "authors": [ - { - "name": "Romain Neutron", - "email": "imprec@gmail.com", - "homepage": "http://www.lickmychip.com/" - }, - { - "name": "Phraseanet Team", - "email": "info@alchemy.fr", - "homepage": "http://www.phraseanet.com/" - } + "BSD-3-Clause" ], - "description": "Unoconv PHP, an Object Oriented library for easy file conversion with LibreOffice's unoconv", + "description": "provides a nested object property based user interface for accessing this configuration data within application code", "keywords": [ - "unoconv" + "config", + "zf2" ] }, { - "name": "neutron/temporary-filesystem", - "version": "2.1.1", - "version_normalized": "2.1.1.0", + "name": "doctrine/dbal", + "version": "v2.4.2", + "version_normalized": "2.4.2.0", "source": { "type": "git", - "url": "https://github.com/romainneutron/Temporary-Filesystem.git", - "reference": "6b21fa99fd452efea16b9a7adb7304ccfff854d0" + "url": "https://github.com/doctrine/dbal.git", + "reference": "fec965d330c958e175c39e61c3f6751955af32d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/romainneutron/Temporary-Filesystem/zipball/6b21fa99fd452efea16b9a7adb7304ccfff854d0", - "reference": "6b21fa99fd452efea16b9a7adb7304ccfff854d0", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/fec965d330c958e175c39e61c3f6751955af32d0", + "reference": "fec965d330c958e175c39e61c3f6751955af32d0", "shasum": "" }, "require": { - "symfony/filesystem": "~2.0" + "doctrine/common": "~2.4", + "php": ">=5.3.2" }, "require-dev": { - "phpunit/phpunit": "~3.7" + "phpunit/phpunit": "3.7.*", + "symfony/console": "~2.0" }, - "time": "2013-10-10 10:58:09", + "suggest": { + "symfony/console": "Allows use of the command line interface" + }, + "time": "2014-01-01 16:43:57", "type": "library", "installation-source": "dist", "autoload": { "psr-0": { - "Neutron": "src" + "Doctrine\\DBAL\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2279,132 +2527,140 @@ ], "authors": [ { - "name": "Romain Neutron", - "email": "imprec@gmail.com", - "homepage": "http://www.lickmychip.com/" + "name": "Jonathan Wage", + "email": "jonwage@gmail.com", + "homepage": "http://www.jwage.com/", + "role": "Creator" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com", + "homepage": "http://www.instaclick.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" } ], - "description": "Symfony filesystem extension to handle temporary files" + "description": "Database Abstraction Layer", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "database", + "dbal", + "persistence", + "queryobject" + ] }, { - "name": "php-ffmpeg/php-ffmpeg", - "version": "0.3.x-dev", - "version_normalized": "0.3.9999999.9999999-dev", + "name": "doctrine/migrations", + "version": "dev-master", + "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/PHP-FFMpeg/PHP-FFMpeg.git", - "reference": "185fb5c33da594db7ffbf3f89d48e9841bc666a0" + "url": "https://github.com/doctrine/migrations.git", + "reference": "4837b4afac4469c8740f33eae6bdcd8bd1545d2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-FFMpeg/PHP-FFMpeg/zipball/185fb5c33da594db7ffbf3f89d48e9841bc666a0", - "reference": "185fb5c33da594db7ffbf3f89d48e9841bc666a0", + "url": "https://api.github.com/repos/doctrine/migrations/zipball/4837b4afac4469c8740f33eae6bdcd8bd1545d2e", + "reference": "4837b4afac4469c8740f33eae6bdcd8bd1545d2e", "shasum": "" }, "require": { - "alchemy/binary-driver": "~1.5", - "doctrine/cache": "~1.0", - "evenement/evenement": "~1.0", - "neutron/temporary-filesystem": "~2.1, >=2.1.1", - "php": ">=5.3.3" + "doctrine/dbal": "~2.0", + "php": ">=5.3.2" }, "require-dev": { - "phpunit/phpunit": "~3.7", - "sami/sami": "~1.0", - "silex/silex": "~1.0" + "symfony/console": "2.*", + "symfony/yaml": "2.*" }, "suggest": { - "php-ffmpeg/extras": "A compilation of common audio & video drivers for PHP-FFMpeg" + "symfony/console": "to run the migration from the console" }, - "time": "2013-10-21 12:13:46", + "time": "2014-03-04 01:42:11", "type": "library", "extra": { "branch-alias": { - "dev-master": "0.4-dev" + "dev-master": "1.0.x-dev" } }, "installation-source": "source", "autoload": { "psr-0": { - "FFMpeg": "src" + "Doctrine\\DBAL\\Migrations": "lib" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "LGPL" ], "authors": [ { - "name": "Romain Neutron", - "email": "imprec@gmail.com", - "homepage": "http://www.lickmychip.com/" + "name": "Jonathan Wage", + "email": "jonwage@gmail.com", + "homepage": "http://www.jwage.com/", + "role": "Creator" }, { - "name": "Phraseanet Team", - "email": "info@alchemy.fr", - "homepage": "http://www.phraseanet.com/" + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" } ], - "description": "FFMpeg PHP, an Object Oriented library to communicate with AVconv / ffmpeg", + "description": "Database Schema migrations using Doctrine DBAL", + "homepage": "http://www.doctrine-project.org", "keywords": [ - "audio", - "audio processing", - "avconv", - "avprobe", - "ffmpeg", - "ffprobe", - "video", - "video processing" + "database", + "migrations" ] }, { - "name": "phpexiftool/phpexiftool", - "version": "0.3.0", - "version_normalized": "0.3.0.0", + "name": "doctrine/orm", + "version": "v2.4.2", + "version_normalized": "2.4.2.0", "source": { "type": "git", - "url": "https://github.com/romainneutron/PHPExiftool.git", - "reference": "5c7d6124729eb34f2d86f730e534067e6be31ab9" + "url": "https://github.com/doctrine/doctrine2.git", + "reference": "0363a5548d9263f979f9ca149decb9cfc66419ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/romainneutron/PHPExiftool/zipball/5c7d6124729eb34f2d86f730e534067e6be31ab9", - "reference": "5c7d6124729eb34f2d86f730e534067e6be31ab9", + "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/0363a5548d9263f979f9ca149decb9cfc66419ab", + "reference": "0363a5548d9263f979f9ca149decb9cfc66419ab", "shasum": "" }, "require": { - "doctrine/cache": "~1.0", - "doctrine/collections": "~1.0", - "monolog/monolog": "~1.3", - "php": ">=5.3.3", - "phpexiftool/exiftool": "9.15", - "symfony/process": "~2.0" + "doctrine/collections": "~1.1", + "doctrine/dbal": "~2.4", + "ext-pdo": "*", + "php": ">=5.3.2", + "symfony/console": "~2.0" }, "require-dev": { - "jms/serializer": "~0.10", - "sami/sami": "~1.0", - "silex/silex": "~1.0", - "symfony/console": "~2.0", - "symfony/css-selector": "~2.0", - "symfony/dom-crawler": "~2.0", - "symfony/finder": "~2.0", - "symfony/yaml": "~2.0" + "satooshi/php-coveralls": "dev-master", + "symfony/yaml": "~2.1" }, "suggest": { - "jms/serializer": "To serialize tags", - "symfony/yaml": "To serialize tags in Yaml format" + "symfony/yaml": "If you want to use YAML Metadata Mapping Driver" }, - "time": "2013-08-07 13:54:27", + "time": "2014-02-08 16:35:09", + "bin": [ + "bin/doctrine", + "bin/doctrine.php" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "0.3-dev" + "dev-master": "2.4.x-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "PHPExiftool": "lib" + "Doctrine\\ORM\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2413,219 +2669,162 @@ ], "authors": [ { - "name": "Romain Neutron", - "email": "imprec@gmail.com", - "homepage": "http://www.lickmychip.com/" - } - ], - "description": "Exiftool driver for PHP", - "keywords": [ - "exiftool", - "metadata" - ] - }, - { - "name": "phpexiftool/exiftool", - "version": "9.15", - "version_normalized": "9.15.0.0", - "source": { - "type": "git", - "url": "https://github.com/alchemy-fr/exiftool.git", - "reference": "0b05edb639d032181f3fae7df8dc1194e9210dc4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/alchemy-fr/exiftool/zipball/0b05edb639d032181f3fae7df8dc1194e9210dc4", - "reference": "0b05edb639d032181f3fae7df8dc1194e9210dc4", - "shasum": "" - }, - "require": { - "phpexiftool/phpexiftool": "*" - }, - "time": "2013-01-30 18:48:32", - "type": "library", - "installation-source": "dist", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Perl Licensing" - ], - "authors": [ + "name": "Jonathan Wage", + "email": "jonwage@gmail.com", + "homepage": "http://www.jwage.com/", + "role": "Creator" + }, { - "name": "Phil Harvey", - "email": "phil@owl.phy.queensu.ca", - "homepage": "http://www.sno.phy.queensu.ca/~phil/exiftool/" + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com", + "homepage": "http://www.instaclick.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" } ], - "description": "Exiftool is a library for reading, writing and editing meta information. This package is not PHP, but required for the main PHP driver : PHP Exiftool", + "description": "Object-Relational-Mapper for PHP", + "homepage": "http://www.doctrine-project.org", "keywords": [ - "exiftool", - "metadatas" + "database", + "orm" ] }, { - "name": "mediavorus/mediavorus", - "version": "0.4.3", - "version_normalized": "0.4.3.0", + "name": "chamilo/chash", + "version": "dev-master", + "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/romainneutron/MediaVorus.git", - "reference": "7cc8c0b8d3440eaff9aa68fff2185216fd72bd75" + "url": "https://github.com/chamilo/chash.git", + "reference": "e0736933e4d4bc17faafeaaec5b8b18ab27212a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/romainneutron/MediaVorus/zipball/7cc8c0b8d3440eaff9aa68fff2185216fd72bd75", - "reference": "7cc8c0b8d3440eaff9aa68fff2185216fd72bd75", + "url": "https://api.github.com/repos/chamilo/chash/zipball/e0736933e4d4bc17faafeaaec5b8b18ab27212a3", + "reference": "e0736933e4d4bc17faafeaaec5b8b18ab27212a3", "shasum": "" }, "require": { - "doctrine/collections": "~1.0", - "monolog/monolog": "~1.0", - "php": ">=5.3.0", - "php-ffmpeg/php-ffmpeg": "~0.3", - "phpexiftool/phpexiftool": "~0.1", - "symfony/console": "~2.0", - "symfony/http-foundation": "~2.0" + "alchemy/zippy": "~0.1", + "composer/composer": "1.0.*@dev", + "doctrine/dbal": "~2.3", + "doctrine/migrations": "dev-master", + "doctrine/orm": "~2.3", + "php": ">=5.3.2", + "symfony/console": "~2.3", + "symfony/filesystem": "~2.3", + "symfony/finder": "~2.3", + "symfony/yaml": "~2.3", + "zendframework/zend-config": "2.2.*@dev", + "zendframework/zend-stdlib": "2.2.*@dev" }, "require-dev": { - "jms/serializer": "~0.12.0", - "phpunit/phpunit": "~3.7", - "silex/silex": "~1.0", - "symfony/yaml": "~2.0" - }, - "suggest": { - "jms/serializer": "To serialize Medias", - "symfony/yaml": "To serialize Medias in Yaml format" + "mikey179/vfsstream": ">=1.2", + "phpunit/phpunit": "3.7.*" }, - "time": "2014-01-06 15:45:32", + "time": "2014-02-18 20:29:46", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.5.x-dev" - } - }, - "installation-source": "dist", + "installation-source": "source", "autoload": { "psr-0": { - "MediaVorus": "src" + "Chash": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" - ], - "authors": [ - { - "name": "Romain Neutron", - "email": "imprec@gmail.com", - "homepage": "http://www.lickmychip.com/" - } + "GPL-3.0" ], - "description": "MediaVorus", - "keywords": [ - "metadata" - ] + "description": "Chamilo Shell", + "homepage": "http://www.chamilo.org" }, { - "name": "alchemy/ghostscript", - "version": "0.4.0", - "version_normalized": "0.4.0.0", + "name": "flint/tacker", + "version": "0.4.2", + "version_normalized": "0.4.2.0", "source": { "type": "git", - "url": "https://github.com/alchemy-fr/Ghostscript-PHP.git", - "reference": "a5d40c29efa4c4e4016a1f83cd5645300ad602d7" + "url": "https://github.com/flint/tacker.git", + "reference": "22de786dc27cde4dbb226e509fc87783e5aef49e" }, "dist": { - "type": "zip", - "url": "https://api.github.com/repos/alchemy-fr/Ghostscript-PHP/zipball/a5d40c29efa4c4e4016a1f83cd5645300ad602d7", - "reference": "a5d40c29efa4c4e4016a1f83cd5645300ad602d7", + "type": "zip", + "url": "https://api.github.com/repos/flint/tacker/zipball/22de786dc27cde4dbb226e509fc87783e5aef49e", + "reference": "22de786dc27cde4dbb226e509fc87783e5aef49e", "shasum": "" }, "require": { - "alchemy/binary-driver": "~1.5", - "php": ">=5.3.3" + "php": ">=5.3.3", + "symfony/config": "~2.3" }, "require-dev": { - "phpunit/phpunit": "~3.7", - "sami/sami": "~1.0", - "silex/silex": "~1.0" + "phpspec/phpspec": "2.0.0-BETA4", + "pimple/pimple": "~1.0", + "symfony/yaml": "~2.3" }, - "time": "2013-06-25 09:12:58", + "time": "2014-02-03 11:50:22", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "installation-source": "dist", "autoload": { "psr-0": { - "Ghostscript": "src" - } + "Tacker\\": "src" + }, + "files": [ + "src/Tacker/functions.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Romain Neutron", - "email": "imprec@gmail.com", - "homepage": "http://www.lickmychip.com/" - }, - { - "name": "Phraseanet Team", - "email": "info@alchemy.fr", - "homepage": "http://www.phraseanet.com/" - } - ], - "description": "Ghostscript PDF, a library to handle PDF through ghostscript", - "keywords": [ - "ghostscript", - "pdf" - ] + "description": "Easy configuration based on Symfony Config" }, { - "name": "media-alchemyst/media-alchemyst", - "version": "0.3.6", - "version_normalized": "0.3.6.0", + "name": "flint/flint", + "version": "1.6.0", + "version_normalized": "1.6.0.0", "source": { "type": "git", - "url": "https://github.com/alchemy-fr/Media-Alchemyst.git", - "reference": "86a16aab82b6e31d2e70050f61fa815a98037253" + "url": "https://github.com/flint/flint.git", + "reference": "bf8896ac62973cd82c1a510d0ee33a76d12f072e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/alchemy-fr/Media-Alchemyst/zipball/86a16aab82b6e31d2e70050f61fa815a98037253", - "reference": "86a16aab82b6e31d2e70050f61fa815a98037253", + "url": "https://api.github.com/repos/flint/flint/zipball/bf8896ac62973cd82c1a510d0ee33a76d12f072e", + "reference": "bf8896ac62973cd82c1a510d0ee33a76d12f072e", "shasum": "" }, "require": { - "alchemy/ghostscript": "~0.4.0", - "imagine/imagine": "0.6.x@dev", - "mediavorus/mediavorus": "~0.4.0", - "monolog/monolog": "~1.0", - "neutron/temporary-filesystem": "~2.1", + "flint/tacker": "~0.3", "php": ">=5.3.3", - "php-ffmpeg/php-ffmpeg": "~0.3, >=0.3.4", - "php-mp4box/php-mp4box": "~0.3.0", - "php-unoconv/php-unoconv": "~0.3.0", - "pimple/pimple": "~1.0", - "swftools/swftools": "~0.3.0", - "symfony/console": "~2.0", - "symfony/filesystem": "~2.0" + "silex/silex": "~1.1", + "twig/twig": "~1.10" }, "require-dev": { - "neutron/silex-imagine-provider": "~0.1", - "phpexiftool/phpexiftool": "~0.1", - "phpunit/phpunit": "~3.7", - "silex/silex": "~1.0" + "symfony/console": "~2.2", + "symfony/yaml": "~2.2" }, - "time": "2013-10-21 12:41:18", + "time": "2013-11-26 12:34:35", "type": "library", "extra": { "branch-alias": { - "dev-master": "0.4-dev" + "dev-master": "1.6.x-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "MediaAlchemyst": "src" + "Flint": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -2634,87 +2833,43 @@ ], "authors": [ { - "name": "Romain Neutron", - "email": "imprec@gmail.com", - "homepage": "http://www.lickmychip.com/" - }, - { - "name": "Phraseanet Team", - "email": "info@alchemy.fr", - "homepage": "http://www.phraseanet.com/" + "name": "Henrik Bjornskov", + "email": "henrik@bjrnskov.dk", + "homepage": "http://henrik.bjrnskov.dk" } ], - "description": "An Object Oriented wrapper for easy multimedia conversion, based on Imagine, FFMpeg, SwfTools, Unoconv and other libs", - "keywords": [ - "audio", - "audio processing", - "image", - "image processing", - "video", - "video processing" - ] + "description": "Enhanced Silex" }, { - "name": "knplabs/gaufrette", - "version": "dev-master", - "version_normalized": "9999999-dev", + "name": "opauth/opauth", + "version": "0.4.4", + "version_normalized": "0.4.4.0", "source": { "type": "git", - "url": "https://github.com/KnpLabs/Gaufrette.git", - "reference": "b72a040c6501ff1205669086a145b830c39932d3" + "url": "https://github.com/opauth/opauth.git", + "reference": "436fb98c2374c9e8ae4d8adddf83214bee4d9c72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/KnpLabs/Gaufrette/zipball/b72a040c6501ff1205669086a145b830c39932d3", - "reference": "b72a040c6501ff1205669086a145b830c39932d3", + "url": "https://api.github.com/repos/opauth/opauth/zipball/436fb98c2374c9e8ae4d8adddf83214bee4d9c72", + "reference": "436fb98c2374c9e8ae4d8adddf83214bee4d9c72", "shasum": "" }, "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "amazonwebservices/aws-sdk-for-php": "1.5.*", - "aws/aws-sdk-php": "~2", - "doctrine/dbal": ">=2.3", - "dropbox-php/dropbox-php": "*", - "herzult/php-ssh": "*", - "microsoft/windowsazure": "dev-master", - "mikey179/vfsstream": "~1.2.0", - "phpseclib/phpseclib": "dev-master", - "phpspec/phpspec": "2.0.*", - "phpunit/phpunit": "3.7.*", - "rackspace/php-cloudfiles": "*", - "rackspace/php-opencloud": "1.6.*" + "php": ">=5.2.0" }, "suggest": { - "amazonwebservices/aws-sdk-for-php": "to use the legacy Amazon S3 adapters", - "aws/aws-sdk-php": "to use the Amazon S3 adapter", - "doctrine/dbal": "to use the Doctrine DBAL adapter", - "dropbox-php/dropbox-php": "to use the Dropbox adapter", - "ext-apc": "to use the APC adapter", - "ext-curl": "*", - "ext-fileinfo": "This extension is used to automatically detect the content-type of a file in the AwsS3, OpenCloud, and AzureBlogStorage adapters", - "ext-mbstring": "*", - "ext-mongo": "*", - "ext-zip": "to use the Zip adapter", - "herzult/php-ssh": "to use SFtp adapter", - "knplabs/knp-gaufrette-bundle": "to use with Symfony2", - "microsoft/windowsazure": "to use Microsoft Azure Blob Storage adapter", - "phpseclib/phpseclib": "to user PhpseclibSftp adapter", - "rackspace/php-opencloud": "to use Opencloud adapter" + "opauth/facebook": "Allows Facebook authentication", + "opauth/google": "Allows Google authentication", + "opauth/twitter": "Allows Twitter authentication" }, - "time": "2014-01-28 08:20:10", + "time": "2013-05-10 09:01:52", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.2.x-dev" - } - }, - "installation-source": "source", + "installation-source": "dist", "autoload": { - "psr-0": { - "Gaufrette": "src/" - } + "classmap": [ + "lib/Opauth/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2722,104 +2877,100 @@ ], "authors": [ { - "name": "The contributors", - "homepage": "http://github.com/knplabs/Gaufrette/contributors" - }, - { - "name": "KnpLabs Team", - "homepage": "http://knplabs.com" + "name": "U-Zyn Chua", + "email": "chua@uzyn.com", + "homepage": "http://uzyn.com" } ], - "description": "PHP5 library that provides a filesystem abstraction layer", - "homepage": "http://knplabs.com", + "description": "Multi-provider authentication framework for PHP", + "homepage": "http://opauth.org", "keywords": [ - "abstraction", - "file", - "filesystem", - "media" + "Authentication", + "OpenId", + "auth", + "facebook", + "google", + "oauth", + "omniauth", + "twitter" ] }, { - "name": "bt51/gaufrette-serviceprovider", + "name": "icehero/silex-opauth", "version": "dev-master", "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/bt51/GaufretteServiceProvider.git", - "reference": "6bba885170beb6719e7256e407b172f90af3159a" + "url": "https://github.com/icehero/silex-opauth.git", + "reference": "e4be31b76f2033d7401fadb7093de3d56625c050" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bt51/GaufretteServiceProvider/zipball/6bba885170beb6719e7256e407b172f90af3159a", - "reference": "6bba885170beb6719e7256e407b172f90af3159a", + "url": "https://api.github.com/repos/icehero/silex-opauth/zipball/e4be31b76f2033d7401fadb7093de3d56625c050", + "reference": "e4be31b76f2033d7401fadb7093de3d56625c050", "shasum": "" }, "require": { - "knplabs/gaufrette": "dev-master@dev", - "php": ">=5.3.2" + "opauth/opauth": "*" }, "require-dev": { - "silex/silex": "1.0.x-dev" + "opauth/facebook": "*", + "silex/silex": "dev-master" }, - "time": "2012-12-07 00:50:44", + "time": "2014-01-05 16:52:17", "type": "library", "installation-source": "source", "autoload": { "psr-0": { - "Bt51\\Silex\\Provider\\GaufretteServiceProvider": "src/" + "SilexOpauth": "src" } }, "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], "authors": [ { - "name": "Ben Tollakson", - "email": "ben.tollakson@gmail.com" + "name": "Florin Popa", + "email": "pp.flrn@gmail.com", + "homepage": "http://florinpopa.net" + }, + { + "name": "Rafal Lindemann", + "email": "rl@stamina.pl", + "homepage": "http://stamina.pl" } ], - "description": "Gaufrette service provider for silex", - "homepage": "https://github.com/bt51/GaufretteServiceProvider", + "description": "Opauth silex framework service provider.", + "homepage": "https://github.com/icehero/silex-opauth", "keywords": [ - "extension", - "gaufrette", - "silex", - "silex-extension" + "OPAuth", + "oauth", + "silex" ] }, { - "name": "silex/web-profiler", - "version": "dev-master", - "version_normalized": "9999999-dev", - "target-dir": "Silex/Provider", + "name": "opauth/openid", + "version": "0.1.0", + "version_normalized": "0.1.0.0", "source": { "type": "git", - "url": "https://github.com/silexphp/Silex-WebProfiler.git", - "reference": "2d153ae71c8445cb90535fbdd82b92e39d9f67e0" + "url": "https://github.com/opauth/openid.git", + "reference": "ebf166cddbaff78e740234189073ab6919e85eb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/silexphp/Silex-WebProfiler/zipball/2d153ae71c8445cb90535fbdd82b92e39d9f67e0", - "reference": "2d153ae71c8445cb90535fbdd82b92e39d9f67e0", + "url": "https://api.github.com/repos/opauth/openid/zipball/ebf166cddbaff78e740234189073ab6919e85eb7", + "reference": "ebf166cddbaff78e740234189073ab6919e85eb7", "shasum": "" }, - "require": { - "silex/silex": "~1.0", - "symfony/stopwatch": "~2.2", - "symfony/web-profiler-bundle": "~2.2" - }, - "time": "2014-01-30 06:11:24", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } + "require": { + "opauth/opauth": ">=0.2.0", + "php": ">=5.2.0" }, - "installation-source": "source", + "time": "2012-06-08 07:00:03", + "type": "library", + "installation-source": "dist", "autoload": { "psr-0": { - "Silex\\Provider\\": "" + "": "." } }, "notification-url": "https://packagist.org/downloads/", @@ -2828,40 +2979,45 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "name": "U-Zyn Chua", + "email": "chua@uzyn.com", + "homepage": "http://uzyn.com" } ], - "description": "A WebProfiler for Silex", - "homepage": "http://silex.sensiolabs.org/" + "description": "OpenID strategy for Opauth", + "homepage": "http://opauth.org", + "keywords": [ + "Authentication", + "OpenId", + "auth" + ] }, { - "name": "natxet/CssMin", - "version": "dev-master", - "version_normalized": "9999999-dev", + "name": "opauth/facebook", + "version": "0.2.1", + "version_normalized": "0.2.1.0", "source": { "type": "git", - "url": "https://github.com/natxet/CssMin.git", - "reference": "afdcdbdb5fc332313f47a79ae60346df3e69a572" + "url": "https://github.com/opauth/facebook.git", + "reference": "28c0e53393a03a66cbfea03073d1d6aacfaddb69" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/natxet/CssMin/zipball/afdcdbdb5fc332313f47a79ae60346df3e69a572", - "reference": "afdcdbdb5fc332313f47a79ae60346df3e69a572", + "url": "https://api.github.com/repos/opauth/facebook/zipball/28c0e53393a03a66cbfea03073d1d6aacfaddb69", + "reference": "28c0e53393a03a66cbfea03073d1d6aacfaddb69", "shasum": "" }, "require": { - "php": ">=5.0" + "opauth/opauth": ">=0.2.0", + "php": ">=5.2.0" }, - "time": "2013-07-02 20:53:35", + "time": "2012-09-21 04:47:35", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { - "classmap": [ - "src/" - ] + "psr-0": { + "": "." + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2869,48 +3025,44 @@ ], "authors": [ { - "name": "Joe Scylla", - "email": "joe.scylla@gmail.com", - "homepage": "https://profiles.google.com/joe.scylla" + "name": "U-Zyn Chua", + "email": "chua@uzyn.com", + "homepage": "http://uzyn.com" } ], - "description": "Minifying CSS", - "homepage": "http://code.google.com/p/cssmin/", + "description": "Facebook strategy for Opauth", + "homepage": "http://opauth.org", "keywords": [ - "css", - "minify" + "Authentication", + "auth", + "facebook" ] }, { - "name": "symfony/property-access", - "version": "2.3.x-dev", - "version_normalized": "2.3.9999999.9999999-dev", - "target-dir": "Symfony/Component/PropertyAccess", + "name": "opauth/google", + "version": "0.2.2", + "version_normalized": "0.2.2.0", "source": { "type": "git", - "url": "https://github.com/symfony/PropertyAccess.git", - "reference": "3ecd2f9fc90706dd9998f893ae830166c768bd20" + "url": "https://github.com/opauth/google.git", + "reference": "35df77684c14acb346a8c3753ae3809852d1a47e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/PropertyAccess/zipball/3ecd2f9fc90706dd9998f893ae830166c768bd20", - "reference": "3ecd2f9fc90706dd9998f893ae830166c768bd20", + "url": "https://api.github.com/repos/opauth/google/zipball/35df77684c14acb346a8c3753ae3809852d1a47e", + "reference": "35df77684c14acb346a8c3753ae3809852d1a47e", "shasum": "" }, "require": { - "php": ">=5.3.3" + "opauth/opauth": ">=0.2.0", + "php": ">=5.2.0" }, - "time": "2014-01-07 13:19:25", + "time": "2012-10-18 14:39:52", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Component\\PropertyAccess\\": "" + "": "." } }, "notification-url": "https://packagist.org/downloads/", @@ -2919,69 +3071,66 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "name": "U-Zyn Chua", + "email": "chua@uzyn.com", + "homepage": "http://uzyn.com" } ], - "description": "Symfony PropertyAccess Component", - "homepage": "http://symfony.com", + "description": "Google strategy for Opauth", + "homepage": "http://opauth.org", "keywords": [ - "access", - "array", - "extraction", - "index", - "injection", - "object", - "property", - "property path", - "reflection" + "Authentication", + "auth", + "google" ] }, { - "name": "dflydev/doctrine-orm-service-provider", - "version": "dev-master", - "version_normalized": "9999999-dev", + "name": "monolog/monolog", + "version": "1.7.0", + "version_normalized": "1.7.0.0", "source": { "type": "git", - "url": "https://github.com/dflydev/dflydev-doctrine-orm-service-provider.git", - "reference": "3e5aaadd536b38cb8c6cc5bfbe220ff7d366b206" + "url": "https://github.com/Seldaek/monolog.git", + "reference": "6225b22de9dcf36546be3a0b2fa8e3d986153f57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dflydev/dflydev-doctrine-orm-service-provider/zipball/3e5aaadd536b38cb8c6cc5bfbe220ff7d366b206", - "reference": "3e5aaadd536b38cb8c6cc5bfbe220ff7d366b206", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/6225b22de9dcf36546be3a0b2fa8e3d986153f57", + "reference": "6225b22de9dcf36546be3a0b2fa8e3d986153f57", "shasum": "" }, "require": { - "doctrine/orm": "~2.3", - "php": ">=5.3.3", - "pimple/pimple": "1.*@dev" + "php": ">=5.3.0", + "psr/log": "~1.0" }, "require-dev": { - "cilex/cilex": "1.*@dev", - "cilex/console-service-provider": "@dev", - "silex/silex": "1.*@dev" + "aws/aws-sdk-php": "~2.4.8", + "doctrine/couchdb": "dev-master", + "mlehner/gelf-php": "1.0.*", + "phpunit/phpunit": "~3.7.0", + "raven/raven": "0.5.*", + "ruflin/elastica": "0.90.*" }, "suggest": { - "dflydev/psr0-resource-locator-service-provider": "1.0.*@dev" + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "mlehner/gelf-php": "Allow sending log messages to a GrayLog2 server", + "raven/raven": "Allow sending log messages to a Sentry server", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" }, - "time": "2014-01-21 21:52:29", + "time": "2013-11-14 19:48:31", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.7.x-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-0": { - "Dflydev\\Cilex\\Provider\\DoctrineOrm": "src", - "Dflydev\\Pimple\\Provider\\DoctrineOrm": "src", - "Dflydev\\Silex\\Provider\\DoctrineOrm": "src" + "Monolog": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2990,70 +3139,44 @@ ], "authors": [ { - "name": "Dragonfly Development Inc.", - "email": "info@dflydev.com", - "homepage": "http://dflydev.com" - }, - { - "name": "Beau Simensen", - "email": "beau@dflydev.com", - "homepage": "http://beausimensen.com" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be", + "role": "Developer" } ], - "description": "Doctrine ORM Service Provider", - "homepage": "http://dflydev.com/projects/doctrine-orm-service-provider/", + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", "keywords": [ - "cilex", - "doctrine", - "orm", - "pimple", - "silex" + "log", + "logging", + "psr-3" ] }, { - "name": "gedmo/doctrine-extensions", - "version": "dev-master", - "version_normalized": "9999999-dev", + "name": "evenement/evenement", + "version": "v1.0.0", + "version_normalized": "1.0.0.0", "source": { "type": "git", - "url": "https://github.com/l3pp4rd/DoctrineExtensions.git", - "reference": "1215dac3c9ebfb93cfe358a45685f188ebcd8644" + "url": "https://github.com/igorw/evenement.git", + "reference": "fa966683e7df3e5dd5929d984a44abfbd6bafe8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/l3pp4rd/DoctrineExtensions/zipball/1215dac3c9ebfb93cfe358a45685f188ebcd8644", - "reference": "1215dac3c9ebfb93cfe358a45685f188ebcd8644", + "url": "https://api.github.com/repos/igorw/evenement/zipball/fa966683e7df3e5dd5929d984a44abfbd6bafe8d", + "reference": "fa966683e7df3e5dd5929d984a44abfbd6bafe8d", "shasum": "" }, "require": { - "doctrine/common": "~2.2", - "php": ">=5.3.2" - }, - "require-dev": { - "doctrine/common": ">=2.4.0-RC3", - "doctrine/dbal": ">=2.4.0-RC1", - "doctrine/mongodb": ">=1.0.3", - "doctrine/mongodb-odm": ">=1.0.0-BETA9", - "doctrine/orm": ">=2.4.0-RC1", - "symfony/yaml": "2.3.1" - }, - "suggest": { - "doctrine/dbal": ">=2.3.2", - "doctrine/mongodb": ">=1.0.1", - "doctrine/mongodb-odm": ">=1.0.0-BETA7", - "doctrine/orm": ">=2.3.2" + "php": ">=5.3.0" }, - "time": "2014-02-08 16:28:39", + "time": "2012-05-30 15:01:08", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-0": { - "Gedmo\\": "lib/" + "Evenement": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -3062,83 +3185,47 @@ ], "authors": [ { - "name": "David Buchmann", - "email": "david@liip.ch" - }, - { - "name": "Gediminas Morkevicius", - "email": "gediminas.morkevicius@gmail.com" - }, - { - "name": "Gustavo Falco", - "email": "comfortablynumb84@gmail.com" + "name": "Igor Wiedler", + "email": "igor@wiedler.ch", + "homepage": "http://wiedler.ch/igor/" } ], - "description": "Doctrine2 behavioral extensions", - "homepage": "http://gediminasm.org/", + "description": "Événement is a very simple event dispatching library for PHP 5.3", "keywords": [ - "Blameable", - "behaviors", - "doctrine2", - "extensions", - "gedmo", - "loggable", - "nestedset", - "sluggable", - "sortable", - "timestampable", - "translatable", - "tree", - "uploadable" + "event-dispatcher" ] }, { - "name": "pagerfanta/pagerfanta", - "version": "dev-master", - "version_normalized": "9999999-dev", + "name": "alchemy/binary-driver", + "version": "1.5.0", + "version_normalized": "1.5.0.0", "source": { "type": "git", - "url": "https://github.com/whiteoctober/Pagerfanta.git", - "reference": "431c22dbc515c81379c8235e633de721e9cb74f2" + "url": "https://github.com/alchemy-fr/BinaryDriver.git", + "reference": "b32c03d4b56ce29f783051eac55887adae654b41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/whiteoctober/Pagerfanta/zipball/431c22dbc515c81379c8235e633de721e9cb74f2", - "reference": "431c22dbc515c81379c8235e633de721e9cb74f2", + "url": "https://api.github.com/repos/alchemy-fr/BinaryDriver/zipball/b32c03d4b56ce29f783051eac55887adae654b41", + "reference": "b32c03d4b56ce29f783051eac55887adae654b41", "shasum": "" }, "require": { - "php": ">=5.3.0" + "evenement/evenement": "~1.0", + "monolog/monolog": "~1.3", + "php": ">=5.3.3", + "psr/log": "~1.0", + "symfony/process": "~2.0" }, "require-dev": { - "doctrine/mongodb-odm": "1.0.*@dev", - "doctrine/orm": "2.3.*", - "doctrine/phpcr-odm": "1.0.*", - "jmikola/geojson": "1.0.*", - "mandango/mandango": "1.0.*@dev", - "phpunit/phpunit": "3.7.*", - "propel/propel1": "~1.6", - "solarium/solarium": "3.1.*" - }, - "suggest": { - "doctrine/mongodb-odm": "To use the DoctrineODMMongoDBAdapter.", - "doctrine/orm": "To use the DoctrineORMAdapter.", - "doctrine/phpcr-odm": "To use the DoctrineODMPhpcrAdapter. >= 1.1.0", - "mandango/mandango": "To use the MandangoAdapter.", - "propel/propel1": "To use the PropelAdapter", - "solarium/solarium": "To use the SolariumAdapter." + "phpunit/phpunit": "~3.7" }, - "time": "2014-01-06 01:39:45", + "time": "2013-06-21 15:51:20", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-0": { - "Pagerfanta\\": "src/" + "Alchemy": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -3147,112 +3234,111 @@ ], "authors": [ { - "name": "Pablo Díez", - "email": "pablodip@gmail.com", - "homepage": "http://github.com/pablodip" + "name": "Romain Neutron", + "email": "imprec@gmail.com", + "homepage": "http://www.lickmychip.com/" + }, + { + "name": "Nicolas Le Goff", + "email": "legoff.n@gmail.com" + }, + { + "name": "Phraseanet Team", + "email": "info@alchemy.fr", + "homepage": "http://www.phraseanet.com/" } ], - "description": "Pagination for PHP 5.3", + "description": "A set of tools to build binary drivers", "keywords": [ - "page", - "pagination", - "paginator", - "paging" + "binary", + "driver" ] }, { - "name": "franmomu/silex-pagerfanta-provider", - "version": "dev-master", - "version_normalized": "9999999-dev", + "name": "swftools/swftools", + "version": "0.3.1", + "version_normalized": "0.3.1.0", "source": { "type": "git", - "url": "https://github.com/jmontoyaa/silex-pagerfanta-provider.git", - "reference": "d957fb8fbfb27c65495df1be7023cb074e6b4d25" + "url": "https://github.com/alchemy-fr/PHPSwftools.git", + "reference": "5a0fefbd5a518c9b1ec2ba247640aadbab4cc396" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jmontoyaa/silex-pagerfanta-provider/zipball/d957fb8fbfb27c65495df1be7023cb074e6b4d25", - "reference": "d957fb8fbfb27c65495df1be7023cb074e6b4d25", + "url": "https://api.github.com/repos/alchemy-fr/PHPSwftools/zipball/5a0fefbd5a518c9b1ec2ba247640aadbab4cc396", + "reference": "5a0fefbd5a518c9b1ec2ba247640aadbab4cc396", "shasum": "" }, "require": { - "pagerfanta/pagerfanta": "dev-master", - "silex/silex": "1.*", - "symfony/property-access": "~2.3" + "alchemy/binary-driver": "~1.5", + "php": ">=5.3.3", + "pimple/pimple": "~1.0" }, - "time": "2013-08-15 16:35:05", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } + "require-dev": { + "phpunit/phpunit": "~3.7", + "sami/sami": "~1.0", + "silex/silex": "~1.0" }, - "installation-source": "source", + "time": "2013-07-03 13:11:36", + "type": "library", + "installation-source": "dist", "autoload": { "psr-0": { - "FranMoreno": "src/" + "SwfTools": "src" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { - "name": "Fran Moreno", - "email": "franmomu@gmail.com", - "homepage": "http://showmethecode.es" + "name": "Romain Neutron", + "email": "imprec@gmail.com", + "homepage": "http://www.lickmychip.com/" + }, + { + "name": "Phraseanet Team", + "email": "support@alchemy.fr", + "homepage": "http://www.phraseanet.com/" } ], - "description": "Silex ServiceProvider for Pagerfanta Library", - "homepage": "https://github.com/franmomu/silex-pagerfanta-provider", + "description": "PHP SwfTools", "keywords": [ - "pagerfanta", - "service provider", - "silex" - ], - "support": { - "source": "https://github.com/jmontoyaa/silex-pagerfanta-provider/tree/master" - } + "adobe flash", + "flash", + "swf" + ] }, { - "name": "knplabs/knp-menu", - "version": "dev-master", - "version_normalized": "9999999-dev", + "name": "php-mp4box/php-mp4box", + "version": "0.3.0", + "version_normalized": "0.3.0.0", "source": { "type": "git", - "url": "https://github.com/KnpLabs/KnpMenu.git", - "reference": "835ee51d911e4d8c9adf129907ebbebfa9a1e906" + "url": "https://github.com/alchemy-fr/PHP-MP4Box.git", + "reference": "baa466be3f6d0b46d27bc0e255e958a95cb7738c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/KnpLabs/KnpMenu/zipball/835ee51d911e4d8c9adf129907ebbebfa9a1e906", - "reference": "835ee51d911e4d8c9adf129907ebbebfa9a1e906", + "url": "https://api.github.com/repos/alchemy-fr/PHP-MP4Box/zipball/baa466be3f6d0b46d27bc0e255e958a95cb7738c", + "reference": "baa466be3f6d0b46d27bc0e255e958a95cb7738c", "shasum": "" }, "require": { - "php": ">=5.3.0" + "alchemy/binary-driver": "~1.5", + "php": ">=5.3.3" }, "require-dev": { - "pimple/pimple": "1.0.*", - "silex/silex": "1.0.*", - "twig/twig": ">=1.2,<2.0-dev" - }, - "suggest": { - "pimple/pimple": "for the built-in implementations of the menu provider and renderer provider", - "silex/silex": "for the integration with your silex application", - "twig/twig": "for the TwigRenderer and the integration with your templates" + "phpunit/phpunit": "~3.7", + "silex/silex": "~1.0" }, - "time": "2014-02-03 10:44:10", + "time": "2013-06-25 10:13:06", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-0": { - "Knp\\Menu\\": "src/" + "MP4Box": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -3261,56 +3347,51 @@ ], "authors": [ { - "name": "Christophe Coevoet", - "email": "stof@notk.org" - }, - { - "name": "KnpLabs", - "homepage": "http://knplabs.com" + "name": "Romain Neutron", + "email": "imprec@gmail.com", + "homepage": "http://www.lickmychip.com/" }, { - "name": "Symfony Community", - "homepage": "https://github.com/KnpLabs/KnpMenu/contributors" + "name": "Phraseanet Team", + "email": "info@alchemy.fr", + "homepage": "http://www.phraseanet.com/" } ], - "description": "An object oriented menu library", - "homepage": "http://knplabs.com", + "description": "PHP MP4Box, an Object Oriented library for easy file conversion with MP4 Box", "keywords": [ - "menu", - "tree" + "gpac", + "mp4box" ] }, { - "name": "sensio/framework-extra-bundle", - "version": "2.3.x-dev", - "version_normalized": "2.3.9999999.9999999-dev", - "target-dir": "Sensio/Bundle/FrameworkExtraBundle", + "name": "php-unoconv/php-unoconv", + "version": "0.3.0", + "version_normalized": "0.3.0.0", "source": { "type": "git", - "url": "https://github.com/sensiolabs/SensioFrameworkExtraBundle.git", - "reference": "fa362cd7327727bf2b4f53971d121f0e7687deac" + "url": "https://github.com/alchemy-fr/PHP-Unoconv.git", + "reference": "6d1e14a7467b5d637741396549529dc4d5f9f355" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/fa362cd7327727bf2b4f53971d121f0e7687deac", - "reference": "fa362cd7327727bf2b4f53971d121f0e7687deac", + "url": "https://api.github.com/repos/alchemy-fr/PHP-Unoconv/zipball/6d1e14a7467b5d637741396549529dc4d5f9f355", + "reference": "6d1e14a7467b5d637741396549529dc4d5f9f355", "shasum": "" }, "require": { - "doctrine/common": "~2.2", - "symfony/framework-bundle": "~2.2" + "alchemy/binary-driver": "~1.5", + "php": ">=5.3.3" }, - "time": "2013-12-18 08:55:22", - "type": "symfony-bundle", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } + "require-dev": { + "phpunit/phpunit": "~3.7", + "silex/silex": "~1.0" }, - "installation-source": "source", + "time": "2013-06-25 10:09:59", + "type": "library", + "installation-source": "dist", "autoload": { "psr-0": { - "Sensio\\Bundle\\FrameworkExtraBundle": "" + "Unoconv": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -3319,69 +3400,49 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Romain Neutron", + "email": "imprec@gmail.com", + "homepage": "http://www.lickmychip.com/" + }, + { + "name": "Phraseanet Team", + "email": "info@alchemy.fr", + "homepage": "http://www.phraseanet.com/" } ], - "description": "This bundle provides a way to configure your controllers with annotations", + "description": "Unoconv PHP, an Object Oriented library for easy file conversion with LibreOffice's unoconv", "keywords": [ - "annotations", - "controllers" + "unoconv" ] }, { - "name": "kriswallsmith/assetic", - "version": "v1.1.2", - "version_normalized": "1.1.2.0", + "name": "neutron/temporary-filesystem", + "version": "2.1.1", + "version_normalized": "2.1.1.0", "source": { "type": "git", - "url": "https://github.com/kriswallsmith/assetic.git", - "reference": "735cffd3982c6e8cdebe292d5db39d077f65890f" + "url": "https://github.com/romainneutron/Temporary-Filesystem.git", + "reference": "6b21fa99fd452efea16b9a7adb7304ccfff854d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kriswallsmith/assetic/zipball/735cffd3982c6e8cdebe292d5db39d077f65890f", - "reference": "735cffd3982c6e8cdebe292d5db39d077f65890f", + "url": "https://api.github.com/repos/romainneutron/Temporary-Filesystem/zipball/6b21fa99fd452efea16b9a7adb7304ccfff854d0", + "reference": "6b21fa99fd452efea16b9a7adb7304ccfff854d0", "shasum": "" }, "require": { - "php": ">=5.3.1", - "symfony/process": "~2.1" - }, - "require-dev": { - "cssmin/cssmin": "*", - "joliclic/javascript-packer": "*", - "kamicane/packager": "*", - "leafo/lessphp": "*", - "leafo/scssphp": "*", - "leafo/scssphp-compass": "*", - "mrclay/minify": "*", - "phpunit/phpunit": "~3.7", - "ptachoire/cssembed": "*", - "twig/twig": "~1.6" - }, - "suggest": { - "leafo/lessphp": "Assetic provides the integration with the lessphp LESS compiler", - "leafo/scssphp": "Assetic provides the integration with the scssphp SCSS compiler", - "leafo/scssphp-compass": "Assetic provides the integration with the SCSS compass plugin", - "ptachoire/cssembed": "Assetic provides the integration with phpcssembed to embed data uris", - "twig/twig": "Assetic provides the integration with the Twig templating engine" + "symfony/filesystem": "~2.0" }, - "time": "2013-07-19 00:03:27", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } + "require-dev": { + "phpunit/phpunit": "~3.7" }, + "time": "2013-10-10 10:58:09", + "type": "library", "installation-source": "dist", "autoload": { "psr-0": { - "Assetic": "src/" - }, - "files": [ - "src/functions.php" - ] + "Neutron": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3389,107 +3450,132 @@ ], "authors": [ { - "name": "Kris Wallsmith", - "email": "kris.wallsmith@gmail.com", - "homepage": "http://kriswallsmith.net/" + "name": "Romain Neutron", + "email": "imprec@gmail.com", + "homepage": "http://www.lickmychip.com/" } ], - "description": "Asset Management for PHP", - "homepage": "https://github.com/kriswallsmith/assetic", - "keywords": [ - "assets", - "compression", - "minification" - ] + "description": "Symfony filesystem extension to handle temporary files" }, { - "name": "twig/twig", - "version": "v1.15.1", - "version_normalized": "1.15.1.0", + "name": "php-ffmpeg/php-ffmpeg", + "version": "0.4.4", + "version_normalized": "0.4.4.0", "source": { "type": "git", - "url": "https://github.com/fabpot/Twig.git", - "reference": "1fb5784662f438d7d96a541e305e28b812e2eeed" + "url": "https://github.com/PHP-FFMpeg/PHP-FFMpeg.git", + "reference": "8dfaf1815802614352bbd10eac7299a100bf9757" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fabpot/Twig/zipball/1fb5784662f438d7d96a541e305e28b812e2eeed", - "reference": "1fb5784662f438d7d96a541e305e28b812e2eeed", + "url": "https://api.github.com/repos/PHP-FFMpeg/PHP-FFMpeg/zipball/8dfaf1815802614352bbd10eac7299a100bf9757", + "reference": "8dfaf1815802614352bbd10eac7299a100bf9757", "shasum": "" }, "require": { - "php": ">=5.2.4" + "alchemy/binary-driver": "~1.5", + "doctrine/cache": "~1.0", + "evenement/evenement": "~1.0", + "neutron/temporary-filesystem": "~2.1, >=2.1.1", + "php": ">=5.3.3" }, - "time": "2014-02-13 10:19:29", + "require-dev": { + "phpunit/phpunit": "~3.7", + "sami/sami": "~1.0", + "silex/silex": "~1.0" + }, + "suggest": { + "php-ffmpeg/extras": "A compilation of common audio & video drivers for PHP-FFMpeg" + }, + "time": "2013-12-17 16:54:46", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.15-dev" + "dev-master": "0.4-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "Twig_": "lib/" + "FFMpeg": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" + "name": "Romain Neutron", + "email": "imprec@gmail.com", + "homepage": "http://www.lickmychip.com/" }, { - "name": "Twig Team", - "homepage": "https://github.com/fabpot/Twig/graphs/contributors", - "role": "Contributors" + "name": "Phraseanet Team", + "email": "info@alchemy.fr", + "homepage": "http://www.phraseanet.com/" } ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "http://twig.sensiolabs.org", + "description": "FFMpeg PHP, an Object Oriented library to communicate with AVconv / ffmpeg", "keywords": [ - "templating" + "audio", + "audio processing", + "avconv", + "avprobe", + "ffmpeg", + "ffprobe", + "video", + "video processing" ] }, { - "name": "doctrine/collections", - "version": "v1.2", - "version_normalized": "1.2.0.0", + "name": "phpexiftool/phpexiftool", + "version": "0.3.0", + "version_normalized": "0.3.0.0", "source": { "type": "git", - "url": "https://github.com/doctrine/collections.git", - "reference": "b99c5c46c87126201899afe88ec490a25eedd6a2" + "url": "https://github.com/romainneutron/PHPExiftool.git", + "reference": "5c7d6124729eb34f2d86f730e534067e6be31ab9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/b99c5c46c87126201899afe88ec490a25eedd6a2", - "reference": "b99c5c46c87126201899afe88ec490a25eedd6a2", + "url": "https://api.github.com/repos/romainneutron/PHPExiftool/zipball/5c7d6124729eb34f2d86f730e534067e6be31ab9", + "reference": "5c7d6124729eb34f2d86f730e534067e6be31ab9", "shasum": "" }, "require": { - "php": ">=5.3.2" + "doctrine/cache": "~1.0", + "doctrine/collections": "~1.0", + "monolog/monolog": "~1.3", + "php": ">=5.3.3", + "phpexiftool/exiftool": "9.15", + "symfony/process": "~2.0" }, - "time": "2014-02-03 23:07:43", + "require-dev": { + "jms/serializer": "~0.10", + "sami/sami": "~1.0", + "silex/silex": "~1.0", + "symfony/console": "~2.0", + "symfony/css-selector": "~2.0", + "symfony/dom-crawler": "~2.0", + "symfony/finder": "~2.0", + "symfony/yaml": "~2.0" + }, + "suggest": { + "jms/serializer": "To serialize tags", + "symfony/yaml": "To serialize tags in Yaml format" + }, + "time": "2013-08-07 13:54:27", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "0.3-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "Doctrine\\Common\\Collections\\": "lib/" + "PHPExiftool": "lib" } }, "notification-url": "https://packagist.org/downloads/", @@ -3498,148 +3584,100 @@ ], "authors": [ { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com", - "homepage": "http://www.jwage.com/", - "role": "Creator" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "http://jmsyst.com", - "role": "Developer of wrapped JMSSerializerBundle" + "name": "Romain Neutron", + "email": "imprec@gmail.com", + "homepage": "http://www.lickmychip.com/" } ], - "description": "Collections Abstraction library", - "homepage": "http://www.doctrine-project.org", + "description": "Exiftool driver for PHP", "keywords": [ - "array", - "collections", - "iterator" + "exiftool", + "metadata" ] }, { - "name": "symfony/intl", - "version": "v2.4.2", - "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/Intl", + "name": "phpexiftool/exiftool", + "version": "9.15", + "version_normalized": "9.15.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/Intl.git", - "reference": "ab12f91c6b4a073007db3c478707ace276738a13" + "url": "https://github.com/alchemy-fr/exiftool.git", + "reference": "0b05edb639d032181f3fae7df8dc1194e9210dc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Intl/zipball/ab12f91c6b4a073007db3c478707ace276738a13", - "reference": "ab12f91c6b4a073007db3c478707ace276738a13", + "url": "https://api.github.com/repos/alchemy-fr/exiftool/zipball/0b05edb639d032181f3fae7df8dc1194e9210dc4", + "reference": "0b05edb639d032181f3fae7df8dc1194e9210dc4", "shasum": "" }, "require": { - "php": ">=5.3.3", - "symfony/icu": "~1.0-RC" - }, - "require-dev": { - "symfony/filesystem": ">=2.1" - }, - "suggest": { - "ext-intl": "to use the component with locales other than \"en\"" + "phpexiftool/phpexiftool": "*" }, - "time": "2014-02-11 13:52:09", + "time": "2013-01-30 18:48:32", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, "installation-source": "dist", - "autoload": { - "psr-0": { - "Symfony\\Component\\Intl\\": "" - }, - "classmap": [ - "Symfony/Component/Intl/Resources/stubs" - ], - "files": [ - "Symfony/Component/Intl/Resources/stubs/functions.php" - ] - }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "Perl Licensing" ], "authors": [ { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch", - "homepage": "http://wiedler.ch/igor/" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - }, - { - "name": "Eriksen Costa", - "email": "eriksen.costa@infranology.com.br" + "name": "Phil Harvey", + "email": "phil@owl.phy.queensu.ca", + "homepage": "http://www.sno.phy.queensu.ca/~phil/exiftool/" } ], - "description": "A PHP replacement layer for the C intl extension that includes additional data from the ICU library.", - "homepage": "http://symfony.com", + "description": "Exiftool is a library for reading, writing and editing meta information. This package is not PHP, but required for the main PHP driver : PHP Exiftool", "keywords": [ - "i18n", - "icu", - "internationalization", - "intl", - "l10n", - "localization" + "exiftool", + "metadatas" ] }, { - "name": "symfony/options-resolver", - "version": "v2.4.2", - "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/OptionsResolver", + "name": "mediavorus/mediavorus", + "version": "0.4.3", + "version_normalized": "0.4.3.0", "source": { "type": "git", - "url": "https://github.com/symfony/OptionsResolver.git", - "reference": "723ec89b49960211ccf2ab46b77185f2616169c3" + "url": "https://github.com/romainneutron/MediaVorus.git", + "reference": "7cc8c0b8d3440eaff9aa68fff2185216fd72bd75" }, "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/OptionsResolver/zipball/723ec89b49960211ccf2ab46b77185f2616169c3", - "reference": "723ec89b49960211ccf2ab46b77185f2616169c3", + "type": "zip", + "url": "https://api.github.com/repos/romainneutron/MediaVorus/zipball/7cc8c0b8d3440eaff9aa68fff2185216fd72bd75", + "reference": "7cc8c0b8d3440eaff9aa68fff2185216fd72bd75", "shasum": "" }, "require": { - "php": ">=5.3.3" + "doctrine/collections": "~1.0", + "monolog/monolog": "~1.0", + "php": ">=5.3.0", + "php-ffmpeg/php-ffmpeg": "~0.3", + "phpexiftool/phpexiftool": "~0.1", + "symfony/console": "~2.0", + "symfony/http-foundation": "~2.0" }, - "time": "2014-01-07 13:28:54", + "require-dev": { + "jms/serializer": "~0.12.0", + "phpunit/phpunit": "~3.7", + "silex/silex": "~1.0", + "symfony/yaml": "~2.0" + }, + "suggest": { + "jms/serializer": "To serialize Medias", + "symfony/yaml": "To serialize Medias in Yaml format" + }, + "time": "2014-01-06 15:45:32", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "0.5.x-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Component\\OptionsResolver\\": "" + "MediaVorus": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -3648,61 +3686,46 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "name": "Romain Neutron", + "email": "imprec@gmail.com", + "homepage": "http://www.lickmychip.com/" } ], - "description": "Symfony OptionsResolver Component", - "homepage": "http://symfony.com", + "description": "MediaVorus", "keywords": [ - "config", - "configuration", - "options" + "metadata" ] }, { - "name": "symfony/event-dispatcher", - "version": "v2.4.2", - "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/EventDispatcher", + "name": "alchemy/ghostscript", + "version": "0.4.0", + "version_normalized": "0.4.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "4708b8cd41984a5ba29fe7dd40716f7f761ac501" + "url": "https://github.com/alchemy-fr/Ghostscript-PHP.git", + "reference": "a5d40c29efa4c4e4016a1f83cd5645300ad602d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/4708b8cd41984a5ba29fe7dd40716f7f761ac501", - "reference": "4708b8cd41984a5ba29fe7dd40716f7f761ac501", + "url": "https://api.github.com/repos/alchemy-fr/Ghostscript-PHP/zipball/a5d40c29efa4c4e4016a1f83cd5645300ad602d7", + "reference": "a5d40c29efa4c4e4016a1f83cd5645300ad602d7", "shasum": "" }, "require": { + "alchemy/binary-driver": "~1.5", "php": ">=5.3.3" }, "require-dev": { - "symfony/dependency-injection": "~2.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "phpunit/phpunit": "~3.7", + "sami/sami": "~1.0", + "silex/silex": "~1.0" }, - "time": "2014-02-11 13:52:09", + "time": "2013-06-25 09:12:58", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Component\\EventDispatcher\\": "" + "Ghostscript": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -3711,64 +3734,69 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "name": "Romain Neutron", + "email": "imprec@gmail.com", + "homepage": "http://www.lickmychip.com/" }, { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "name": "Phraseanet Team", + "email": "info@alchemy.fr", + "homepage": "http://www.phraseanet.com/" } ], - "description": "Symfony EventDispatcher Component", - "homepage": "http://symfony.com" + "description": "Ghostscript PDF, a library to handle PDF through ghostscript", + "keywords": [ + "ghostscript", + "pdf" + ] }, { - "name": "symfony/form", - "version": "v2.4.2", - "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/Form", + "name": "media-alchemyst/media-alchemyst", + "version": "0.3.6", + "version_normalized": "0.3.6.0", "source": { "type": "git", - "url": "https://github.com/symfony/Form.git", - "reference": "6a881fd2050e2ef88e15fe92bfbfcdfc7aa2c76a" + "url": "https://github.com/alchemy-fr/Media-Alchemyst.git", + "reference": "86a16aab82b6e31d2e70050f61fa815a98037253" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Form/zipball/6a881fd2050e2ef88e15fe92bfbfcdfc7aa2c76a", - "reference": "6a881fd2050e2ef88e15fe92bfbfcdfc7aa2c76a", + "url": "https://api.github.com/repos/alchemy-fr/Media-Alchemyst/zipball/86a16aab82b6e31d2e70050f61fa815a98037253", + "reference": "86a16aab82b6e31d2e70050f61fa815a98037253", "shasum": "" }, "require": { + "alchemy/ghostscript": "~0.4.0", + "imagine/imagine": "0.6.x@dev", + "mediavorus/mediavorus": "~0.4.0", + "monolog/monolog": "~1.0", + "neutron/temporary-filesystem": "~2.1", "php": ">=5.3.3", - "symfony/event-dispatcher": "~2.1", - "symfony/intl": "~2.3", - "symfony/options-resolver": "~2.1", - "symfony/property-access": "~2.3" + "php-ffmpeg/php-ffmpeg": "~0.3, >=0.3.4", + "php-mp4box/php-mp4box": "~0.3.0", + "php-unoconv/php-unoconv": "~0.3.0", + "pimple/pimple": "~1.0", + "swftools/swftools": "~0.3.0", + "symfony/console": "~2.0", + "symfony/filesystem": "~2.0" }, "require-dev": { - "symfony/http-foundation": "~2.2", - "symfony/security-csrf": "~2.4", - "symfony/validator": "~2.2" - }, - "suggest": { - "symfony/framework-bundle": "For templating with PHP.", - "symfony/security-csrf": "For protecting forms against CSRF attacks.", - "symfony/twig-bridge": "For templating with Twig.", - "symfony/validator": "For form validation." + "neutron/silex-imagine-provider": "~0.1", + "phpexiftool/phpexiftool": "~0.1", + "phpunit/phpunit": "~3.7", + "silex/silex": "~1.0" }, - "time": "2014-02-11 13:52:09", + "time": "2013-10-21 12:41:18", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "0.4-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Component\\Form\\": "" + "MediaAlchemyst": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -3777,57 +3805,86 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "name": "Romain Neutron", + "email": "imprec@gmail.com", + "homepage": "http://www.lickmychip.com/" }, { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "name": "Phraseanet Team", + "email": "info@alchemy.fr", + "homepage": "http://www.phraseanet.com/" } ], - "description": "Symfony Form Component", - "homepage": "http://symfony.com" + "description": "An Object Oriented wrapper for easy multimedia conversion, based on Imagine, FFMpeg, SwfTools, Unoconv and other libs", + "keywords": [ + "audio", + "audio processing", + "image", + "image processing", + "video", + "video processing" + ] }, { - "name": "symfony/translation", - "version": "v2.4.2", - "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/Translation", + "name": "knplabs/gaufrette", + "version": "dev-master", + "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/symfony/Translation.git", - "reference": "b00fd07417e493e08488e87bcebeb9681fc7323b" + "url": "https://github.com/KnpLabs/Gaufrette.git", + "reference": "338febb0137b971152363fe184cfb6f01871e665" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Translation/zipball/b00fd07417e493e08488e87bcebeb9681fc7323b", - "reference": "b00fd07417e493e08488e87bcebeb9681fc7323b", + "url": "https://api.github.com/repos/KnpLabs/Gaufrette/zipball/338febb0137b971152363fe184cfb6f01871e665", + "reference": "338febb0137b971152363fe184cfb6f01871e665", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.2" }, "require-dev": { - "symfony/config": "~2.0", - "symfony/yaml": "~2.2" + "amazonwebservices/aws-sdk-for-php": "1.5.*", + "aws/aws-sdk-php": "~2", + "doctrine/dbal": ">=2.3", + "dropbox-php/dropbox-php": "*", + "herzult/php-ssh": "*", + "microsoft/windowsazure": "dev-master", + "mikey179/vfsstream": "~1.2.0", + "phpseclib/phpseclib": "dev-master", + "phpspec/phpspec": "2.0.*", + "phpunit/phpunit": "3.7.*", + "rackspace/php-cloudfiles": "*", + "rackspace/php-opencloud": "1.9.*" }, "suggest": { - "symfony/config": "", - "symfony/yaml": "" + "amazonwebservices/aws-sdk-for-php": "to use the legacy Amazon S3 adapters", + "aws/aws-sdk-php": "to use the Amazon S3 adapter", + "doctrine/dbal": "to use the Doctrine DBAL adapter", + "dropbox-php/dropbox-php": "to use the Dropbox adapter", + "ext-apc": "to use the APC adapter", + "ext-curl": "*", + "ext-fileinfo": "This extension is used to automatically detect the content-type of a file in the AwsS3, OpenCloud, and AzureBlogStorage adapters", + "ext-mbstring": "*", + "ext-mongo": "*", + "ext-zip": "to use the Zip adapter", + "herzult/php-ssh": "to use SFtp adapter", + "knplabs/knp-gaufrette-bundle": "to use with Symfony2", + "microsoft/windowsazure": "to use Microsoft Azure Blob Storage adapter", + "phpseclib/phpseclib": "to user PhpseclibSftp adapter", + "rackspace/php-opencloud": "to use Opencloud adapter" }, - "time": "2014-02-03 17:15:33", + "time": "2014-03-05 19:58:17", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "0.2.x-dev" } }, - "installation-source": "dist", + "installation-source": "source", "autoload": { "psr-0": { - "Symfony\\Component\\Translation\\": "" + "Gaufrette": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3836,67 +3893,51 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "name": "The contributors", + "homepage": "http://github.com/knplabs/Gaufrette/contributors" }, { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "name": "KnpLabs Team", + "homepage": "http://knplabs.com" } ], - "description": "Symfony Translation Component", - "homepage": "http://symfony.com" + "description": "PHP5 library that provides a filesystem abstraction layer", + "homepage": "http://knplabs.com", + "keywords": [ + "abstraction", + "file", + "filesystem", + "media" + ] }, { - "name": "symfony/validator", - "version": "v2.4.2", - "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/Validator", + "name": "bt51/gaufrette-serviceprovider", + "version": "dev-master", + "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/symfony/Validator.git", - "reference": "64d7a54f97a5f53a98864a7461822e341f9416b5" + "url": "https://github.com/bt51/GaufretteServiceProvider.git", + "reference": "6bba885170beb6719e7256e407b172f90af3159a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Validator/zipball/64d7a54f97a5f53a98864a7461822e341f9416b5", - "reference": "64d7a54f97a5f53a98864a7461822e341f9416b5", + "url": "https://api.github.com/repos/bt51/GaufretteServiceProvider/zipball/6bba885170beb6719e7256e407b172f90af3159a", + "reference": "6bba885170beb6719e7256e407b172f90af3159a", "shasum": "" }, "require": { - "php": ">=5.3.3", - "symfony/property-access": "~2.2", - "symfony/translation": "~2.0" + "knplabs/gaufrette": "dev-master@dev", + "php": ">=5.3.2" }, "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/cache": "~1.0", - "symfony/config": "~2.2", - "symfony/http-foundation": "~2.1", - "symfony/intl": "~2.3", - "symfony/yaml": "~2.0" - }, - "suggest": { - "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", - "doctrine/cache": "For using the default cached annotation reader", - "symfony/config": "", - "symfony/http-foundation": "", - "symfony/intl": "", - "symfony/yaml": "" + "silex/silex": "1.0.x-dev" }, - "time": "2014-02-11 13:52:09", + "time": "2012-12-07 00:50:44", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "installation-source": "dist", + "installation-source": "source", "autoload": { "psr-0": { - "Symfony\\Component\\Validator\\": "" + "Bt51\\Silex\\Provider\\GaufretteServiceProvider": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3905,50 +3946,44 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "name": "Ben Tollakson", + "email": "ben.tollakson@gmail.com" } ], - "description": "Symfony Validator Component", - "homepage": "http://symfony.com" + "description": "Gaufrette service provider for silex", + "homepage": "https://github.com/bt51/GaufretteServiceProvider", + "keywords": [ + "extension", + "gaufrette", + "silex", + "silex-extension" + ] }, { - "name": "symfony/yaml", - "version": "v2.4.2", - "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/Yaml", + "name": "natxet/CssMin", + "version": "dev-master", + "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "bb6ddaf8956139d1b8c360b4b713ed0138e876b3" + "url": "https://github.com/natxet/CssMin.git", + "reference": "afdcdbdb5fc332313f47a79ae60346df3e69a572" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/bb6ddaf8956139d1b8c360b4b713ed0138e876b3", - "reference": "bb6ddaf8956139d1b8c360b4b713ed0138e876b3", + "url": "https://api.github.com/repos/natxet/CssMin/zipball/afdcdbdb5fc332313f47a79ae60346df3e69a572", + "reference": "afdcdbdb5fc332313f47a79ae60346df3e69a572", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.0" }, - "time": "2014-01-07 13:28:54", + "time": "2013-07-02 20:53:35", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "installation-source": "dist", + "installation-source": "source", "autoload": { - "psr-0": { - "Symfony\\Component\\Yaml\\": "" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3956,112 +3991,94 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "name": "Joe Scylla", + "email": "joe.scylla@gmail.com", + "homepage": "https://profiles.google.com/joe.scylla" } ], - "description": "Symfony Yaml Component", - "homepage": "http://symfony.com" + "description": "Minifying CSS", + "homepage": "http://code.google.com/p/cssmin/", + "keywords": [ + "css", + "minify" + ] }, { - "name": "symfony/locale", - "version": "v2.4.2", - "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/Locale", + "name": "leafo/lessphp", + "version": "dev-master", + "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/symfony/Locale.git", - "reference": "7f38bea9f5afb24d720931dd4469fbc798bcce63" + "url": "https://github.com/leafo/lessphp.git", + "reference": "b7cd5c79e82666bcd2dfadb304342311209fb527" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Locale/zipball/7f38bea9f5afb24d720931dd4469fbc798bcce63", - "reference": "7f38bea9f5afb24d720931dd4469fbc798bcce63", + "url": "https://api.github.com/repos/leafo/lessphp/zipball/b7cd5c79e82666bcd2dfadb304342311209fb527", + "reference": "b7cd5c79e82666bcd2dfadb304342311209fb527", "shasum": "" }, - "require": { - "php": ">=5.3.3", - "symfony/intl": ">=2.3" - }, - "time": "2014-01-07 13:28:54", + "time": "2014-02-05 19:36:35", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "0.4.x-dev" } }, - "installation-source": "dist", + "installation-source": "source", "autoload": { - "psr-0": { - "Symfony\\Component\\Locale\\": "" - } + "classmap": [ + "lessc.inc.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "MIT", + "GPL-3.0" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "name": "Leaf Corcoran", + "email": "leafot@gmail.com", + "homepage": "http://leafo.net" } ], - "description": "Symfony Locale Component", - "homepage": "http://symfony.com" + "description": "lessphp is a compiler for LESS written in PHP.", + "homepage": "http://leafo.net/lessphp/" }, { - "name": "symfony/monolog-bridge", - "version": "v2.4.2", - "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Bridge/Monolog", + "name": "filp/whoops", + "version": "dev-master", + "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/symfony/MonologBridge.git", - "reference": "041d2c9ead709bed730eda07882b62dba8233ba2" + "url": "https://github.com/filp/whoops.git", + "reference": "e3d1ad7ff7b417cb98d6d860f7040ba5bb75cb0d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/MonologBridge/zipball/041d2c9ead709bed730eda07882b62dba8233ba2", - "reference": "041d2c9ead709bed730eda07882b62dba8233ba2", + "url": "https://api.github.com/repos/filp/whoops/zipball/e3d1ad7ff7b417cb98d6d860f7040ba5bb75cb0d", + "reference": "e3d1ad7ff7b417cb98d6d860f7040ba5bb75cb0d", "shasum": "" }, "require": { - "monolog/monolog": "~1.3", - "php": ">=5.3.3" + "php": ">=5.3.0" }, "require-dev": { - "symfony/console": "~2.3", - "symfony/event-dispatcher": "~2.2", - "symfony/http-kernel": "~2.2" - }, - "suggest": { - "symfony/console": "For the possibility to show log messages in console commands depending on verbosity settings. You need version ~2.3 of the console for it.", - "symfony/event-dispatcher": "Needed when using log messages in console commands", - "symfony/http-kernel": "For using the debugging handlers together with the response life cycle of the HTTP kernel." + "mockery/mockery": "0.9.*", + "php": ">=5.3.3" }, - "time": "2014-01-07 13:28:54", - "type": "symfony-bridge", + "time": "2014-03-03 12:19:05", + "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "1.1-dev" } }, - "installation-source": "dist", + "installation-source": "source", "autoload": { "psr-0": { - "Symfony\\Bridge\\Monolog\\": "" + "Whoops": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -4070,43 +4087,68 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "name": "Filipe Dobreira", + "homepage": "https://github.com/filp", + "role": "Developer" } ], - "description": "Symfony Monolog Bridge", - "homepage": "http://symfony.com" + "description": "php error handling for cool kids", + "homepage": "https://github.com/filp/whoops", + "keywords": [ + "error", + "exception", + "handling", + "library", + "silex-provider", + "whoops", + "zf2" + ] }, { - "name": "symfony/dom-crawler", + "name": "symfony/security", "version": "v2.4.2", "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/DomCrawler", + "target-dir": "Symfony/Component/Security", "source": { "type": "git", - "url": "https://github.com/symfony/DomCrawler.git", - "reference": "5962504de9b36d955d88b08c1434d420627c8c01" + "url": "https://github.com/symfony/Security.git", + "reference": "ae020b9dc10e6438dc4033103c16bae7d46a4dd6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/5962504de9b36d955d88b08c1434d420627c8c01", - "reference": "5962504de9b36d955d88b08c1434d420627c8c01", + "url": "https://api.github.com/repos/symfony/Security/zipball/ae020b9dc10e6438dc4033103c16bae7d46a4dd6", + "reference": "ae020b9dc10e6438dc4033103c16bae7d46a4dd6", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.3", + "symfony/event-dispatcher": "~2.1", + "symfony/http-foundation": "~2.1", + "symfony/http-kernel": "~2.4" + }, + "replace": { + "symfony/security-acl": "self.version", + "symfony/security-core": "self.version", + "symfony/security-csrf": "self.version", + "symfony/security-http": "self.version" }, "require-dev": { - "symfony/css-selector": "~2.0" + "doctrine/common": "~2.2", + "doctrine/dbal": "~2.2", + "ircmaxell/password-compat": "1.0.*", + "psr/log": "~1.0", + "symfony/expression-language": "~2.4", + "symfony/routing": "~2.2", + "symfony/validator": "~2.2" }, "suggest": { - "symfony/css-selector": "" + "doctrine/dbal": "For using the built-in ACL implementation", + "ircmaxell/password-compat": "For using the BCrypt password encoder in PHP <5.5", + "symfony/class-loader": "For using the ACL generateSql script", + "symfony/expression-language": "For using the expression voter", + "symfony/finder": "For using the ACL generateSql script", + "symfony/routing": "For using the HttpUtils class to create sub-requests, redirect the user, and match URLs", + "symfony/validator": "For using the user password constraint" }, "time": "2014-02-11 13:52:09", "type": "library", @@ -4118,7 +4160,7 @@ "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Component\\DomCrawler\\": "" + "Symfony\\Component\\Security\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -4137,38 +4179,54 @@ "homepage": "http://symfony.com/contributors" } ], - "description": "Symfony DomCrawler Component", + "description": "Symfony Security Component", "homepage": "http://symfony.com" }, { - "name": "symfony/browser-kit", + "name": "symfony/twig-bridge", "version": "v2.4.2", "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/BrowserKit", + "target-dir": "Symfony/Bridge/Twig", "source": { "type": "git", - "url": "https://github.com/symfony/BrowserKit.git", - "reference": "3898f9f9aafc853124c90a9d1a4f98c1034e627e" + "url": "https://github.com/symfony/TwigBridge.git", + "reference": "0f087fa433a8666820192958dae5738aeb023456" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/3898f9f9aafc853124c90a9d1a4f98c1034e627e", - "reference": "3898f9f9aafc853124c90a9d1a4f98c1034e627e", + "url": "https://api.github.com/repos/symfony/TwigBridge/zipball/0f087fa433a8666820192958dae5738aeb023456", + "reference": "0f087fa433a8666820192958dae5738aeb023456", "shasum": "" }, "require": { "php": ">=5.3.3", - "symfony/dom-crawler": "~2.0" + "symfony/security-csrf": "~2.4", + "twig/twig": "~1.12" }, "require-dev": { - "symfony/css-selector": "~2.0", - "symfony/process": "~2.0" + "symfony/expression-language": "~2.4", + "symfony/form": "~2.2", + "symfony/http-kernel": "~2.2", + "symfony/routing": "~2.2", + "symfony/security": "~2.4", + "symfony/stopwatch": "~2.2", + "symfony/templating": "~2.1", + "symfony/translation": "~2.2", + "symfony/yaml": "~2.0" }, "suggest": { - "symfony/process": "" + "symfony/expression": "For using the ExpressionExtension", + "symfony/form": "For using the FormExtension", + "symfony/http-kernel": "For using the HttpKernelExtension", + "symfony/routing": "For using the RoutingExtension", + "symfony/security": "For using the SecurityExtension", + "symfony/stopwatch": "For using the StopwatchExtension", + "symfony/templating": "For using the TwigEngine", + "symfony/translation": "For using the TranslationExtension", + "symfony/yaml": "For using the YamlExtension" }, - "time": "2014-01-24 14:36:08", - "type": "library", + "time": "2014-01-26 21:33:04", + "type": "symfony-bridge", "extra": { "branch-alias": { "dev-master": "2.4-dev" @@ -4177,7 +4235,7 @@ "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Component\\BrowserKit\\": "" + "Symfony\\Bridge\\Twig\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -4196,30 +4254,50 @@ "homepage": "http://symfony.com/contributors" } ], - "description": "Symfony BrowserKit Component", + "description": "Symfony Twig Bridge", "homepage": "http://symfony.com" }, { - "name": "symfony/http-foundation", + "name": "symfony/doctrine-bridge", "version": "v2.4.2", "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/HttpFoundation", + "target-dir": "Symfony/Bridge/Doctrine", "source": { "type": "git", - "url": "https://github.com/symfony/HttpFoundation.git", - "reference": "cdee7c84ba8b2a8aafa1c055f5cb4f640d81c129" + "url": "https://github.com/symfony/DoctrineBridge.git", + "reference": "dec8ae317321c9646ff259b5adf53aae3f989f85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/cdee7c84ba8b2a8aafa1c055f5cb4f640d81c129", - "reference": "cdee7c84ba8b2a8aafa1c055f5cb4f640d81c129", + "url": "https://api.github.com/repos/symfony/DoctrineBridge/zipball/dec8ae317321c9646ff259b5adf53aae3f989f85", + "reference": "dec8ae317321c9646ff259b5adf53aae3f989f85", "shasum": "" }, "require": { + "doctrine/common": "~2.2", "php": ">=5.3.3" }, - "time": "2014-02-11 15:39:28", - "type": "library", + "require-dev": { + "doctrine/data-fixtures": "1.0.*", + "doctrine/dbal": "~2.2", + "doctrine/orm": "~2.2,>=2.2.3", + "symfony/dependency-injection": "~2.0", + "symfony/expression-language": "~2.2", + "symfony/form": "~2.2", + "symfony/http-kernel": "~2.2", + "symfony/security": "~2.2", + "symfony/stopwatch": "~2.2", + "symfony/validator": "~2.2" + }, + "suggest": { + "doctrine/data-fixtures": "", + "doctrine/dbal": "", + "doctrine/orm": "", + "symfony/form": "", + "symfony/validator": "" + }, + "time": "2014-02-11 13:52:09", + "type": "symfony-bridge", "extra": { "branch-alias": { "dev-master": "2.4-dev" @@ -4228,11 +4306,8 @@ "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Component\\HttpFoundation\\": "" - }, - "classmap": [ - "Symfony/Component/HttpFoundation/Resources/stubs" - ] + "Symfony\\Bridge\\Doctrine\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -4250,37 +4325,29 @@ "homepage": "http://symfony.com/contributors" } ], - "description": "Symfony HttpFoundation Component", + "description": "Symfony Doctrine Bridge", "homepage": "http://symfony.com" }, { - "name": "symfony/debug", + "name": "symfony/property-access", "version": "v2.4.2", "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/Debug", + "target-dir": "Symfony/Component/PropertyAccess", "source": { "type": "git", - "url": "https://github.com/symfony/Debug.git", - "reference": "23b5f4fcad883679d9a6e1cbc568247fe606d8ee" + "url": "https://github.com/symfony/PropertyAccess.git", + "reference": "37fe0c2dc494b47db4b0850e9dcba3a27cc45c0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Debug/zipball/23b5f4fcad883679d9a6e1cbc568247fe606d8ee", - "reference": "23b5f4fcad883679d9a6e1cbc568247fe606d8ee", + "url": "https://api.github.com/repos/symfony/PropertyAccess/zipball/37fe0c2dc494b47db4b0850e9dcba3a27cc45c0c", + "reference": "37fe0c2dc494b47db4b0850e9dcba3a27cc45c0c", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "require-dev": { - "symfony/http-foundation": "~2.1", - "symfony/http-kernel": "~2.1" - }, - "suggest": { - "symfony/http-foundation": "", - "symfony/http-kernel": "" - }, - "time": "2014-02-11 13:52:09", + "time": "2014-02-11 15:39:28", "type": "library", "extra": { "branch-alias": { @@ -4290,7 +4357,7 @@ "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Component\\Debug\\": "" + "Symfony\\Component\\PropertyAccess\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -4309,53 +4376,40 @@ "homepage": "http://symfony.com/contributors" } ], - "description": "Symfony Debug Component", - "homepage": "http://symfony.com" + "description": "Symfony PropertyAccess Component", + "homepage": "http://symfony.com", + "keywords": [ + "access", + "array", + "extraction", + "index", + "injection", + "object", + "property", + "property path", + "reflection" + ] }, { - "name": "symfony/http-kernel", + "name": "symfony/options-resolver", "version": "v2.4.2", "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/HttpKernel", + "target-dir": "Symfony/Component/OptionsResolver", "source": { "type": "git", - "url": "https://github.com/symfony/HttpKernel.git", - "reference": "445d6eee0eab2a6cfab41b5dc43f1b86ec34d110" + "url": "https://github.com/symfony/OptionsResolver.git", + "reference": "723ec89b49960211ccf2ab46b77185f2616169c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/445d6eee0eab2a6cfab41b5dc43f1b86ec34d110", - "reference": "445d6eee0eab2a6cfab41b5dc43f1b86ec34d110", + "url": "https://api.github.com/repos/symfony/OptionsResolver/zipball/723ec89b49960211ccf2ab46b77185f2616169c3", + "reference": "723ec89b49960211ccf2ab46b77185f2616169c3", "shasum": "" }, "require": { - "php": ">=5.3.3", - "psr/log": "~1.0", - "symfony/debug": "~2.3", - "symfony/event-dispatcher": "~2.1", - "symfony/http-foundation": "~2.4" - }, - "require-dev": { - "symfony/browser-kit": "~2.2", - "symfony/class-loader": "~2.1", - "symfony/config": "~2.0", - "symfony/console": "~2.2", - "symfony/dependency-injection": "~2.0", - "symfony/finder": "~2.0", - "symfony/process": "~2.0", - "symfony/routing": "~2.2", - "symfony/stopwatch": "~2.2", - "symfony/templating": "~2.2" - }, - "suggest": { - "symfony/browser-kit": "", - "symfony/class-loader": "", - "symfony/config": "", - "symfony/console": "", - "symfony/dependency-injection": "", - "symfony/finder": "" + "php": ">=5.3.3" }, - "time": "2014-02-12 19:27:03", + "time": "2014-01-07 13:28:54", "type": "library", "extra": { "branch-alias": { @@ -4365,7 +4419,7 @@ "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Component\\HttpKernel\\": "" + "Symfony\\Component\\OptionsResolver\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -4384,54 +4438,47 @@ "homepage": "http://symfony.com/contributors" } ], - "description": "Symfony HttpKernel Component", - "homepage": "http://symfony.com" + "description": "Symfony OptionsResolver Component", + "homepage": "http://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ] }, { - "name": "symfony/security", + "name": "symfony/form", "version": "v2.4.2", "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/Security", + "target-dir": "Symfony/Component/Form", "source": { "type": "git", - "url": "https://github.com/symfony/Security.git", - "reference": "ae020b9dc10e6438dc4033103c16bae7d46a4dd6" + "url": "https://github.com/symfony/Form.git", + "reference": "6a881fd2050e2ef88e15fe92bfbfcdfc7aa2c76a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Security/zipball/ae020b9dc10e6438dc4033103c16bae7d46a4dd6", - "reference": "ae020b9dc10e6438dc4033103c16bae7d46a4dd6", + "url": "https://api.github.com/repos/symfony/Form/zipball/6a881fd2050e2ef88e15fe92bfbfcdfc7aa2c76a", + "reference": "6a881fd2050e2ef88e15fe92bfbfcdfc7aa2c76a", "shasum": "" }, "require": { "php": ">=5.3.3", "symfony/event-dispatcher": "~2.1", - "symfony/http-foundation": "~2.1", - "symfony/http-kernel": "~2.4" - }, - "replace": { - "symfony/security-acl": "self.version", - "symfony/security-core": "self.version", - "symfony/security-csrf": "self.version", - "symfony/security-http": "self.version" + "symfony/intl": "~2.3", + "symfony/options-resolver": "~2.1", + "symfony/property-access": "~2.3" }, "require-dev": { - "doctrine/common": "~2.2", - "doctrine/dbal": "~2.2", - "ircmaxell/password-compat": "1.0.*", - "psr/log": "~1.0", - "symfony/expression-language": "~2.4", - "symfony/routing": "~2.2", + "symfony/http-foundation": "~2.2", + "symfony/security-csrf": "~2.4", "symfony/validator": "~2.2" }, "suggest": { - "doctrine/dbal": "For using the built-in ACL implementation", - "ircmaxell/password-compat": "For using the BCrypt password encoder in PHP <5.5", - "symfony/class-loader": "For using the ACL generateSql script", - "symfony/expression-language": "For using the expression voter", - "symfony/finder": "For using the ACL generateSql script", - "symfony/routing": "For using the HttpUtils class to create sub-requests, redirect the user, and match URLs", - "symfony/validator": "For using the user password constraint" + "symfony/framework-bundle": "For templating with PHP.", + "symfony/security-csrf": "For protecting forms against CSRF attacks.", + "symfony/twig-bridge": "For templating with Twig.", + "symfony/validator": "For form validation." }, "time": "2014-02-11 13:52:09", "type": "library", @@ -4443,7 +4490,7 @@ "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Component\\Security\\": "" + "Symfony\\Component\\Form\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -4462,54 +4509,38 @@ "homepage": "http://symfony.com/contributors" } ], - "description": "Symfony Security Component", + "description": "Symfony Form Component", "homepage": "http://symfony.com" }, { - "name": "symfony/twig-bridge", + "name": "symfony/translation", "version": "v2.4.2", "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Bridge/Twig", + "target-dir": "Symfony/Component/Translation", "source": { "type": "git", - "url": "https://github.com/symfony/TwigBridge.git", - "reference": "0f087fa433a8666820192958dae5738aeb023456" + "url": "https://github.com/symfony/Translation.git", + "reference": "b00fd07417e493e08488e87bcebeb9681fc7323b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/TwigBridge/zipball/0f087fa433a8666820192958dae5738aeb023456", - "reference": "0f087fa433a8666820192958dae5738aeb023456", + "url": "https://api.github.com/repos/symfony/Translation/zipball/b00fd07417e493e08488e87bcebeb9681fc7323b", + "reference": "b00fd07417e493e08488e87bcebeb9681fc7323b", "shasum": "" }, "require": { - "php": ">=5.3.3", - "symfony/security-csrf": "~2.4", - "twig/twig": "~1.12" + "php": ">=5.3.3" }, "require-dev": { - "symfony/expression-language": "~2.4", - "symfony/form": "~2.2", - "symfony/http-kernel": "~2.2", - "symfony/routing": "~2.2", - "symfony/security": "~2.4", - "symfony/stopwatch": "~2.2", - "symfony/templating": "~2.1", - "symfony/translation": "~2.2", - "symfony/yaml": "~2.0" + "symfony/config": "~2.0", + "symfony/yaml": "~2.2" }, "suggest": { - "symfony/expression": "For using the ExpressionExtension", - "symfony/form": "For using the FormExtension", - "symfony/http-kernel": "For using the HttpKernelExtension", - "symfony/routing": "For using the RoutingExtension", - "symfony/security": "For using the SecurityExtension", - "symfony/stopwatch": "For using the StopwatchExtension", - "symfony/templating": "For using the TwigEngine", - "symfony/translation": "For using the TranslationExtension", - "symfony/yaml": "For using the YamlExtension" + "symfony/config": "", + "symfony/yaml": "" }, - "time": "2014-01-26 21:33:04", - "type": "symfony-bridge", + "time": "2014-02-03 17:15:33", + "type": "library", "extra": { "branch-alias": { "dev-master": "2.4-dev" @@ -4518,7 +4549,7 @@ "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Bridge\\Twig\\": "" + "Symfony\\Component\\Translation\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -4537,40 +4568,45 @@ "homepage": "http://symfony.com/contributors" } ], - "description": "Symfony Twig Bridge", + "description": "Symfony Translation Component", "homepage": "http://symfony.com" }, { - "name": "symfony/routing", + "name": "symfony/validator", "version": "v2.4.2", "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/Routing", + "target-dir": "Symfony/Component/Validator", "source": { "type": "git", - "url": "https://github.com/symfony/Routing.git", - "reference": "b2fdea8b60400bb84e4931d71101ebbb3a08c1eb" + "url": "https://github.com/symfony/Validator.git", + "reference": "64d7a54f97a5f53a98864a7461822e341f9416b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Routing/zipball/b2fdea8b60400bb84e4931d71101ebbb3a08c1eb", - "reference": "b2fdea8b60400bb84e4931d71101ebbb3a08c1eb", + "url": "https://api.github.com/repos/symfony/Validator/zipball/64d7a54f97a5f53a98864a7461822e341f9416b5", + "reference": "64d7a54f97a5f53a98864a7461822e341f9416b5", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.3", + "symfony/property-access": "~2.2", + "symfony/translation": "~2.0" }, "require-dev": { "doctrine/annotations": "~1.0", - "psr/log": "~1.0", + "doctrine/cache": "~1.0", "symfony/config": "~2.2", - "symfony/expression-language": "~2.4", + "symfony/http-foundation": "~2.1", + "symfony/intl": "~2.3", "symfony/yaml": "~2.0" }, "suggest": { - "doctrine/annotations": "For using the annotation loader", - "symfony/config": "For using the all-in-one router or any loader", - "symfony/expression-language": "For using expression matching", - "symfony/yaml": "For using the YAML loader" + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader", + "symfony/config": "", + "symfony/http-foundation": "", + "symfony/intl": "", + "symfony/yaml": "" }, "time": "2014-02-11 13:52:09", "type": "library", @@ -4582,7 +4618,7 @@ "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Component\\Routing\\": "" + "Symfony\\Component\\Validator\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -4601,44 +4637,31 @@ "homepage": "http://symfony.com/contributors" } ], - "description": "Symfony Routing Component", - "homepage": "http://symfony.com", - "keywords": [ - "router", - "routing", - "uri", - "url" - ] + "description": "Symfony Validator Component", + "homepage": "http://symfony.com" }, { - "name": "symfony/web-profiler-bundle", + "name": "symfony/locale", "version": "v2.4.2", "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Bundle/WebProfilerBundle", + "target-dir": "Symfony/Component/Locale", "source": { "type": "git", - "url": "https://github.com/symfony/WebProfilerBundle.git", - "reference": "b7267d6c96cbfd1c52c55ada475da74fd4a0bb59" + "url": "https://github.com/symfony/Locale.git", + "reference": "7f38bea9f5afb24d720931dd4469fbc798bcce63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/WebProfilerBundle/zipball/b7267d6c96cbfd1c52c55ada475da74fd4a0bb59", - "reference": "b7267d6c96cbfd1c52c55ada475da74fd4a0bb59", + "url": "https://api.github.com/repos/symfony/Locale/zipball/7f38bea9f5afb24d720931dd4469fbc798bcce63", + "reference": "7f38bea9f5afb24d720931dd4469fbc798bcce63", "shasum": "" }, "require": { "php": ">=5.3.3", - "symfony/http-kernel": "~2.2", - "symfony/routing": "~2.2", - "symfony/twig-bridge": "~2.2" - }, - "require-dev": { - "symfony/config": "~2.2", - "symfony/dependency-injection": "~2.0", - "symfony/stopwatch": "~2.2" + "symfony/intl": ">=2.3" }, - "time": "2014-02-11 13:52:09", - "type": "symfony-bundle", + "time": "2014-01-07 13:28:54", + "type": "library", "extra": { "branch-alias": { "dev-master": "2.4-dev" @@ -4647,7 +4670,7 @@ "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Bundle\\WebProfilerBundle\\": "" + "Symfony\\Component\\Locale\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -4666,30 +4689,41 @@ "homepage": "http://symfony.com/contributors" } ], - "description": "Symfony WebProfilerBundle", + "description": "Symfony Locale Component", "homepage": "http://symfony.com" }, { - "name": "symfony/process", + "name": "symfony/monolog-bridge", "version": "v2.4.2", "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/Process", + "target-dir": "Symfony/Bridge/Monolog", "source": { "type": "git", - "url": "https://github.com/symfony/Process.git", - "reference": "c175448bac997556f8ab972908a4e14c7291fb03" + "url": "https://github.com/symfony/MonologBridge.git", + "reference": "041d2c9ead709bed730eda07882b62dba8233ba2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/c175448bac997556f8ab972908a4e14c7291fb03", - "reference": "c175448bac997556f8ab972908a4e14c7291fb03", + "url": "https://api.github.com/repos/symfony/MonologBridge/zipball/041d2c9ead709bed730eda07882b62dba8233ba2", + "reference": "041d2c9ead709bed730eda07882b62dba8233ba2", "shasum": "" }, "require": { + "monolog/monolog": "~1.3", "php": ">=5.3.3" }, - "time": "2014-02-11 13:52:09", - "type": "library", + "require-dev": { + "symfony/console": "~2.3", + "symfony/event-dispatcher": "~2.2", + "symfony/http-kernel": "~2.2" + }, + "suggest": { + "symfony/console": "For the possibility to show log messages in console commands depending on verbosity settings. You need version ~2.3 of the console for it.", + "symfony/event-dispatcher": "Needed when using log messages in console commands", + "symfony/http-kernel": "For using the debugging handlers together with the response life cycle of the HTTP kernel." + }, + "time": "2014-01-07 13:28:54", + "type": "symfony-bridge", "extra": { "branch-alias": { "dev-master": "2.4-dev" @@ -4698,7 +4732,7 @@ "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Component\\Process\\": "" + "Symfony\\Bridge\\Monolog\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -4717,45 +4751,50 @@ "homepage": "http://symfony.com/contributors" } ], - "description": "Symfony Process Component", + "description": "Symfony Monolog Bridge", "homepage": "http://symfony.com" }, { - "name": "symfony/console", - "version": "v2.4.2", - "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/Console", + "name": "dflydev/doctrine-orm-service-provider", + "version": "dev-master", + "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/symfony/Console.git", - "reference": "940f217cbc3c8a33e5403e7c595495c4884400fe" + "url": "https://github.com/dflydev/dflydev-doctrine-orm-service-provider.git", + "reference": "3e5aaadd536b38cb8c6cc5bfbe220ff7d366b206" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/940f217cbc3c8a33e5403e7c595495c4884400fe", - "reference": "940f217cbc3c8a33e5403e7c595495c4884400fe", + "url": "https://api.github.com/repos/dflydev/dflydev-doctrine-orm-service-provider/zipball/3e5aaadd536b38cb8c6cc5bfbe220ff7d366b206", + "reference": "3e5aaadd536b38cb8c6cc5bfbe220ff7d366b206", "shasum": "" }, "require": { - "php": ">=5.3.3" + "doctrine/orm": "~2.3", + "php": ">=5.3.3", + "pimple/pimple": "1.*@dev" }, "require-dev": { - "symfony/event-dispatcher": "~2.1" + "cilex/cilex": "1.*@dev", + "cilex/console-service-provider": "@dev", + "silex/silex": "1.*@dev" }, "suggest": { - "symfony/event-dispatcher": "" + "dflydev/psr0-resource-locator-service-provider": "1.0.*@dev" }, - "time": "2014-02-11 13:52:09", + "time": "2014-01-21 21:52:29", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "1.0-dev" } }, - "installation-source": "dist", + "installation-source": "source", "autoload": { "psr-0": { - "Symfony\\Component\\Console\\": "" + "Dflydev\\Cilex\\Provider\\DoctrineOrm": "src", + "Dflydev\\Pimple\\Provider\\DoctrineOrm": "src", + "Dflydev\\Silex\\Provider\\DoctrineOrm": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -4764,48 +4803,70 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" }, { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" } ], - "description": "Symfony Console Component", - "homepage": "http://symfony.com" + "description": "Doctrine ORM Service Provider", + "homepage": "http://dflydev.com/projects/doctrine-orm-service-provider/", + "keywords": [ + "cilex", + "doctrine", + "orm", + "pimple", + "silex" + ] }, { - "name": "pimple/pimple", - "version": "v1.1.1", - "version_normalized": "1.1.1.0", + "name": "gedmo/doctrine-extensions", + "version": "v2.3.9", + "version_normalized": "2.3.9.0", "source": { "type": "git", - "url": "https://github.com/fabpot/Pimple.git", - "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d" + "url": "https://github.com/l3pp4rd/DoctrineExtensions.git", + "reference": "35adcaae1a3f50d0d5b73aa50ed8fd28ee35ce54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fabpot/Pimple/zipball/2019c145fe393923f3441b23f29bbdfaa5c58c4d", - "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d", + "url": "https://api.github.com/repos/l3pp4rd/DoctrineExtensions/zipball/35adcaae1a3f50d0d5b73aa50ed8fd28ee35ce54", + "reference": "35adcaae1a3f50d0d5b73aa50ed8fd28ee35ce54", "shasum": "" }, "require": { - "php": ">=5.3.0" + "doctrine/common": ">=2.2,<2.5-dev", + "php": ">=5.3.2" }, - "time": "2013-11-22 08:30:29", + "require-dev": { + "doctrine/common": ">=2.4.0-RC3", + "doctrine/dbal": ">=2.4.0-RC1", + "doctrine/mongodb": ">=1.0.3", + "doctrine/mongodb-odm": ">=1.0.0-BETA9", + "doctrine/orm": ">=2.4.0-RC1", + "symfony/yaml": "2.3.1" + }, + "suggest": { + "doctrine/dbal": ">=2.3.2", + "doctrine/mongodb": ">=1.0.1", + "doctrine/mongodb-odm": ">=1.0.0-BETA7", + "doctrine/orm": ">=2.3.2" + }, + "time": "2014-01-12 16:34:06", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "2.3.x-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "Pimple": "lib/" + "Gedmo\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", @@ -4814,49 +4875,83 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "name": "David Buchmann", + "email": "david@liip.ch" + }, + { + "name": "Gediminas Morkevicius", + "email": "gediminas.morkevicius@gmail.com" + }, + { + "name": "Gustavo Falco", + "email": "comfortablynumb84@gmail.com" } ], - "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", - "homepage": "http://pimple.sensiolabs.org", + "description": "Doctrine2 behavioral extensions", + "homepage": "http://gediminasm.org/", "keywords": [ - "container", - "dependency injection" + "Blameable", + "behaviors", + "doctrine2", + "extensions", + "gedmo", + "loggable", + "nestedset", + "sluggable", + "sortable", + "timestampable", + "translatable", + "tree", + "uploadable" ] }, { - "name": "symfony/filesystem", - "version": "v2.4.2", - "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/Filesystem", + "name": "pagerfanta/pagerfanta", + "version": "dev-master", + "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/symfony/Filesystem.git", - "reference": "7e65abb06d3b38f4be89266fe3fb4a759544e713" + "url": "https://github.com/whiteoctober/Pagerfanta.git", + "reference": "e413b68dd4653104f94bba4b96c2ffb38468bd6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/7e65abb06d3b38f4be89266fe3fb4a759544e713", - "reference": "7e65abb06d3b38f4be89266fe3fb4a759544e713", + "url": "https://api.github.com/repos/whiteoctober/Pagerfanta/zipball/e413b68dd4653104f94bba4b96c2ffb38468bd6f", + "reference": "e413b68dd4653104f94bba4b96c2ffb38468bd6f", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.0" + }, + "require-dev": { + "doctrine/mongodb-odm": "1.0.*@dev", + "doctrine/orm": "2.3.*", + "doctrine/phpcr-odm": "1.0.*", + "jmikola/geojson": "1.0.*", + "mandango/mandango": "1.0.*@dev", + "phpunit/phpunit": "3.7.*", + "propel/propel1": "~1.6", + "solarium/solarium": "3.1.*" + }, + "suggest": { + "doctrine/mongodb-odm": "To use the DoctrineODMMongoDBAdapter.", + "doctrine/orm": "To use the DoctrineORMAdapter.", + "doctrine/phpcr-odm": "To use the DoctrineODMPhpcrAdapter. >= 1.1.0", + "mandango/mandango": "To use the MandangoAdapter.", + "propel/propel1": "To use the PropelAdapter", + "solarium/solarium": "To use the SolariumAdapter." }, - "time": "2014-01-07 13:28:54", + "time": "2014-02-19 13:57:56", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "1.0.x-dev" } }, - "installation-source": "dist", + "installation-source": "source", "autoload": { "psr-0": { - "Symfony\\Component\\Filesystem\\": "" + "Pagerfanta\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -4865,105 +4960,112 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "name": "Pablo Díez", + "email": "pablodip@gmail.com", + "homepage": "http://github.com/pablodip" } ], - "description": "Symfony Filesystem Component", - "homepage": "http://symfony.com" + "description": "Pagination for PHP 5.3", + "keywords": [ + "page", + "pagination", + "paginator", + "paging" + ] }, { - "name": "symfony/config", - "version": "v2.4.2", - "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/Config", + "name": "franmomu/silex-pagerfanta-provider", + "version": "dev-master", + "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/symfony/Config.git", - "reference": "d81bd01eac1514c10dcb3b11eaa9048d6b87dd1f" + "url": "https://github.com/jmontoyaa/silex-pagerfanta-provider.git", + "reference": "d957fb8fbfb27c65495df1be7023cb074e6b4d25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Config/zipball/d81bd01eac1514c10dcb3b11eaa9048d6b87dd1f", - "reference": "d81bd01eac1514c10dcb3b11eaa9048d6b87dd1f", + "url": "https://api.github.com/repos/jmontoyaa/silex-pagerfanta-provider/zipball/d957fb8fbfb27c65495df1be7023cb074e6b4d25", + "reference": "d957fb8fbfb27c65495df1be7023cb074e6b4d25", "shasum": "" }, "require": { - "php": ">=5.3.3", - "symfony/filesystem": "~2.3" + "pagerfanta/pagerfanta": "dev-master", + "silex/silex": "1.*", + "symfony/property-access": "~2.3" }, - "time": "2014-01-07 13:28:54", + "time": "2013-08-15 16:35:05", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "1.0.x-dev" } }, - "installation-source": "dist", + "installation-source": "source", "autoload": { "psr-0": { - "Symfony\\Component\\Config\\": "" + "FranMoreno": "src/" } }, - "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "name": "Fran Moreno", + "email": "franmomu@gmail.com", + "homepage": "http://showmethecode.es" } ], - "description": "Symfony Config Component", - "homepage": "http://symfony.com" + "description": "Silex ServiceProvider for Pagerfanta Library", + "homepage": "https://github.com/franmomu/silex-pagerfanta-provider", + "keywords": [ + "pagerfanta", + "service provider", + "silex" + ], + "support": { + "source": "https://github.com/jmontoyaa/silex-pagerfanta-provider/tree/master" + } }, { - "name": "mheap/silex-assetic", - "version": "1.0.4", - "version_normalized": "1.0.4.0", + "name": "knplabs/knp-menu", + "version": "dev-master", + "version_normalized": "9999999-dev", "source": { "type": "git", - "url": "https://github.com/mheap/Silex-Assetic.git", - "reference": "c0312e06926d10e3cb4444e61365ec8cd8e0fb31" + "url": "https://github.com/KnpLabs/KnpMenu.git", + "reference": "ff1a6e73e79c9f75c6a130d03b07f05c89fede63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mheap/Silex-Assetic/zipball/c0312e06926d10e3cb4444e61365ec8cd8e0fb31", - "reference": "c0312e06926d10e3cb4444e61365ec8cd8e0fb31", + "url": "https://api.github.com/repos/KnpLabs/KnpMenu/zipball/ff1a6e73e79c9f75c6a130d03b07f05c89fede63", + "reference": "ff1a6e73e79c9f75c6a130d03b07f05c89fede63", "shasum": "" }, "require": { - "kriswallsmith/assetic": "~1.0", - "php": ">=5.3.0", - "symfony/finder": "~2.1" + "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "~3.7.10", - "silex/silex": "~1.0@dev", - "twig/twig": "~1.2" + "pimple/pimple": "1.0.*", + "silex/silex": "1.0.*", + "twig/twig": ">=1.2,<2.0-dev" }, "suggest": { - "twig/twig": "~1.2" + "pimple/pimple": "for the built-in implementations of the menu provider and renderer provider", + "silex/silex": "for the integration with your silex application", + "twig/twig": "for the TwigRenderer and the integration with your templates" }, - "time": "2014-02-15 20:06:27", + "time": "2014-03-07 15:36:26", "type": "library", - "installation-source": "dist", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "installation-source": "source", "autoload": { "psr-0": { - "SilexAssetic": "src" + "Knp\\Menu\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -4972,67 +5074,61 @@ ], "authors": [ { - "name": "Sven Eisenschmidt", - "email": "sven.eisenschmidt@gmail.com", - "homepage": "http://unsicherheitsagent.de/" + "name": "Christophe Coevoet", + "email": "stof@notk.org" }, { - "name": "Michael Heap", - "email": "m@michaelheap.com", - "homepage": "http://michaelheap.com/" + "name": "KnpLabs", + "homepage": "http://knplabs.com" + }, + { + "name": "Symfony Community", + "homepage": "https://github.com/KnpLabs/KnpMenu/contributors" } ], - "description": "Assetic extension for Silex", - "homepage": "https://github.com/mheap/Silex-Assetic", + "description": "An object oriented menu library", + "homepage": "http://knplabs.com", "keywords": [ - "assetic", - "silex" + "menu", + "tree" ] }, { - "name": "doctrine/orm", + "name": "symfony/templating", "version": "v2.4.2", "version_normalized": "2.4.2.0", + "target-dir": "Symfony/Component/Templating", "source": { "type": "git", - "url": "https://github.com/doctrine/doctrine2.git", - "reference": "0363a5548d9263f979f9ca149decb9cfc66419ab" + "url": "https://github.com/symfony/Templating.git", + "reference": "2bd48c405223b719d3e38e9f071e00bdc4a9a780" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/0363a5548d9263f979f9ca149decb9cfc66419ab", - "reference": "0363a5548d9263f979f9ca149decb9cfc66419ab", + "url": "https://api.github.com/repos/symfony/Templating/zipball/2bd48c405223b719d3e38e9f071e00bdc4a9a780", + "reference": "2bd48c405223b719d3e38e9f071e00bdc4a9a780", "shasum": "" }, "require": { - "doctrine/collections": "~1.1", - "doctrine/dbal": "~2.4", - "ext-pdo": "*", - "php": ">=5.3.2", - "symfony/console": "~2.0" + "php": ">=5.3.3" }, "require-dev": { - "satooshi/php-coveralls": "dev-master", - "symfony/yaml": "~2.1" + "psr/log": "~1.0" }, "suggest": { - "symfony/yaml": "If you want to use YAML Metadata Mapping Driver" + "psr/log": "For using debug logging in loaders" }, - "time": "2014-02-08 16:35:09", - "bin": [ - "bin/doctrine", - "bin/doctrine.php" - ], + "time": "2014-02-11 15:39:28", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4.x-dev" + "dev-master": "2.4-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "Doctrine\\ORM\\": "lib/" + "Symfony\\Component\\Templating\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -5041,97 +5137,49 @@ ], "authors": [ { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com", - "homepage": "http://www.jwage.com/", - "role": "Creator" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com", - "homepage": "http://www.instaclick.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" }, { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" } ], - "description": "Object-Relational-Mapper for PHP", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "database", - "orm" - ] + "description": "Symfony Templating Component", + "homepage": "http://symfony.com" }, { - "name": "guzzle/guzzle", - "version": "v3.8.1", - "version_normalized": "3.8.1.0", + "name": "symfony/stopwatch", + "version": "v2.4.2", + "version_normalized": "2.4.2.0", + "target-dir": "Symfony/Component/Stopwatch", "source": { "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/4de0618a01b34aa1c8c33a3f13f396dcd3882eba", - "reference": "4de0618a01b34aa1c8c33a3f13f396dcd3882eba", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=5.3.3", - "symfony/event-dispatcher": ">=2.1" - }, - "replace": { - "guzzle/batch": "self.version", - "guzzle/cache": "self.version", - "guzzle/common": "self.version", - "guzzle/http": "self.version", - "guzzle/inflection": "self.version", - "guzzle/iterator": "self.version", - "guzzle/log": "self.version", - "guzzle/parser": "self.version", - "guzzle/plugin": "self.version", - "guzzle/plugin-async": "self.version", - "guzzle/plugin-backoff": "self.version", - "guzzle/plugin-cache": "self.version", - "guzzle/plugin-cookie": "self.version", - "guzzle/plugin-curlauth": "self.version", - "guzzle/plugin-error-response": "self.version", - "guzzle/plugin-history": "self.version", - "guzzle/plugin-log": "self.version", - "guzzle/plugin-md5": "self.version", - "guzzle/plugin-mock": "self.version", - "guzzle/plugin-oauth": "self.version", - "guzzle/service": "self.version", - "guzzle/stream": "self.version" - }, - "require-dev": { - "doctrine/cache": "*", - "monolog/monolog": "1.*", - "phpunit/phpunit": "3.7.*", - "psr/log": "1.0.*", - "symfony/class-loader": "*", - "zendframework/zend-cache": "<2.3", - "zendframework/zend-log": "<2.3" + "url": "https://github.com/symfony/Stopwatch.git", + "reference": "bffad325e36a3e71fba6d5dcce6e2f4b4637b91a" }, - "time": "2014-01-28 22:29:15", + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/bffad325e36a3e71fba6d5dcce6e2f4b4637b91a", + "reference": "bffad325e36a3e71fba6d5dcce6e2f4b4637b91a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2014-02-11 13:52:09", "type": "library", "extra": { "branch-alias": { - "dev-master": "3.8-dev" + "dev-master": "2.4-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "Guzzle": "src/", - "Guzzle\\Tests": "tests/" + "Symfony\\Component\\Stopwatch\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -5140,69 +5188,59 @@ ], "authors": [ { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" }, { - "name": "Guzzle Community", - "homepage": "https://github.com/guzzle/guzzle/contributors" + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" } ], - "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ] + "description": "Symfony Stopwatch Component", + "homepage": "http://symfony.com" }, { - "name": "alchemy/zippy", - "version": "0.1.1", - "version_normalized": "0.1.1.0", + "name": "symfony/dependency-injection", + "version": "v2.4.2", + "version_normalized": "2.4.2.0", + "target-dir": "Symfony/Component/DependencyInjection", "source": { "type": "git", - "url": "https://github.com/alchemy-fr/Zippy.git", - "reference": "7c9211377881a98f84ca382f1e5792e8a27019e5" + "url": "https://github.com/symfony/DependencyInjection.git", + "reference": "dde921399691bdb3b32a3c2557dcb2054db7593a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/alchemy-fr/Zippy/zipball/7c9211377881a98f84ca382f1e5792e8a27019e5", - "reference": "7c9211377881a98f84ca382f1e5792e8a27019e5", + "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/dde921399691bdb3b32a3c2557dcb2054db7593a", + "reference": "dde921399691bdb3b32a3c2557dcb2054db7593a", "shasum": "" }, "require": { - "doctrine/collections": "~1.0", - "guzzle/guzzle": "~3.0", - "php": ">=5.3.3", - "pimple/pimple": "~1.0", - "symfony/filesystem": "~2.0", - "symfony/process": "~2.0" + "php": ">=5.3.3" }, "require-dev": { - "ext-zip": "*", - "sami/sami": "dev-master@dev", - "symfony/finder": "~2.0" + "symfony/config": "~2.2", + "symfony/expression-language": "~2.4", + "symfony/yaml": "~2.0" }, "suggest": { - "ext-zip": "To use the ZipExtensionAdapter" + "symfony/config": "", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" }, - "time": "2013-04-12 10:24:45", + "time": "2014-02-11 13:52:09", "type": "library", "extra": { "branch-alias": { - "dev-master": "0.1.x-dev" + "dev-master": "2.4-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "Alchemy": "src" + "Symfony\\Component\\DependencyInjection\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -5211,101 +5249,128 @@ ], "authors": [ { - "name": "Alchemy", - "email": "dev.team@alchemy.fr", - "homepage": "http://www.alchemy.fr/" + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" } ], - "description": "Zippy, the archive manager companion", - "keywords": [ - "bzip", - "compression", - "tar", - "zip" - ] + "description": "Symfony DependencyInjection Component", + "homepage": "http://symfony.com" }, { - "name": "flint/tacker", - "version": "0.4.2", - "version_normalized": "0.4.2.0", + "name": "symfony/framework-bundle", + "version": "v2.4.2", + "version_normalized": "2.4.2.0", + "target-dir": "Symfony/Bundle/FrameworkBundle", "source": { "type": "git", - "url": "https://github.com/flint/tacker.git", - "reference": "22de786dc27cde4dbb226e509fc87783e5aef49e" + "url": "https://github.com/symfony/FrameworkBundle.git", + "reference": "aa3e1310b4d95570c8f813e90a89fe36bdfeb8b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/flint/tacker/zipball/22de786dc27cde4dbb226e509fc87783e5aef49e", - "reference": "22de786dc27cde4dbb226e509fc87783e5aef49e", + "url": "https://api.github.com/repos/symfony/FrameworkBundle/zipball/aa3e1310b4d95570c8f813e90a89fe36bdfeb8b2", + "reference": "aa3e1310b4d95570c8f813e90a89fe36bdfeb8b2", "shasum": "" }, "require": { + "doctrine/annotations": "~1.0", "php": ">=5.3.3", - "symfony/config": "~2.3" + "symfony/config": "~2.4", + "symfony/dependency-injection": "~2.2", + "symfony/event-dispatcher": "~2.1", + "symfony/filesystem": "~2.3", + "symfony/http-foundation": "~2.4", + "symfony/http-kernel": "~2.4", + "symfony/routing": "~2.2", + "symfony/security-core": "~2.4", + "symfony/security-csrf": "~2.4", + "symfony/stopwatch": "~2.3", + "symfony/templating": "~2.1", + "symfony/translation": "~2.3" }, "require-dev": { - "phpspec/phpspec": "2.0.0-BETA4", - "pimple/pimple": "~1.0", - "symfony/yaml": "~2.3" + "symfony/class-loader": "~2.1", + "symfony/finder": "~2.0", + "symfony/form": "~2.3", + "symfony/security": "~2.4", + "symfony/validator": "~2.1" }, - "time": "2014-02-03 11:50:22", - "type": "library", + "suggest": { + "doctrine/cache": "For using alternative cache drivers", + "symfony/console": "For using the console commands", + "symfony/finder": "For using the translation loader and cache warmer", + "symfony/form": "For using forms", + "symfony/validator": "For using validation" + }, + "time": "2014-02-11 13:52:09", + "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.4-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "Tacker\\": "src" - }, - "files": [ - "src/Tacker/functions.php" - ] + "Symfony\\Bundle\\FrameworkBundle\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Easy configuration based on Symfony Config" + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony FrameworkBundle", + "homepage": "http://symfony.com" }, { - "name": "symfony/templating", - "version": "v2.4.2", - "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/Templating", + "name": "sensio/framework-extra-bundle", + "version": "v2.3.4", + "version_normalized": "2.3.4.0", + "target-dir": "Sensio/Bundle/FrameworkExtraBundle", "source": { "type": "git", - "url": "https://github.com/symfony/Templating.git", - "reference": "2bd48c405223b719d3e38e9f071e00bdc4a9a780" + "url": "https://github.com/sensiolabs/SensioFrameworkExtraBundle.git", + "reference": "cce05719041d952bbec856789ca18646a1891d03" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Templating/zipball/2bd48c405223b719d3e38e9f071e00bdc4a9a780", - "reference": "2bd48c405223b719d3e38e9f071e00bdc4a9a780", + "url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/cce05719041d952bbec856789ca18646a1891d03", + "reference": "cce05719041d952bbec856789ca18646a1891d03", "shasum": "" }, "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "psr/log": "~1.0" - }, - "suggest": { - "psr/log": "For using debug logging in loaders" + "doctrine/common": "~2.2", + "symfony/framework-bundle": "~2.2" }, - "time": "2014-02-11 15:39:28", - "type": "library", + "time": "2013-07-24 08:49:53", + "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.3.x-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Component\\Templating\\": "" + "Sensio\\Bundle\\FrameworkExtraBundle": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -5318,34 +5383,39 @@ "email": "fabien@symfony.com", "homepage": "http://fabien.potencier.org", "role": "Lead Developer" - }, - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" } ], - "description": "Symfony Templating Component", - "homepage": "http://symfony.com" + "description": "This bundle provides a way to configure your controllers with annotations", + "keywords": [ + "annotations", + "controllers" + ] }, { - "name": "symfony/stopwatch", + "name": "symfony/dom-crawler", "version": "v2.4.2", "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/Stopwatch", + "target-dir": "Symfony/Component/DomCrawler", "source": { "type": "git", - "url": "https://github.com/symfony/Stopwatch.git", - "reference": "bffad325e36a3e71fba6d5dcce6e2f4b4637b91a" + "url": "https://github.com/symfony/DomCrawler.git", + "reference": "5962504de9b36d955d88b08c1434d420627c8c01" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/bffad325e36a3e71fba6d5dcce6e2f4b4637b91a", - "reference": "bffad325e36a3e71fba6d5dcce6e2f4b4637b91a", + "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/5962504de9b36d955d88b08c1434d420627c8c01", + "reference": "5962504de9b36d955d88b08c1434d420627c8c01", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "symfony/css-selector": "~2.0" + }, + "suggest": { + "symfony/css-selector": "" + }, "time": "2014-02-11 13:52:09", "type": "library", "extra": { @@ -5356,7 +5426,7 @@ "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Component\\Stopwatch\\": "" + "Symfony\\Component\\DomCrawler\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -5375,39 +5445,37 @@ "homepage": "http://symfony.com/contributors" } ], - "description": "Symfony Stopwatch Component", + "description": "Symfony DomCrawler Component", "homepage": "http://symfony.com" }, { - "name": "symfony/dependency-injection", + "name": "symfony/browser-kit", "version": "v2.4.2", "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Component/DependencyInjection", + "target-dir": "Symfony/Component/BrowserKit", "source": { "type": "git", - "url": "https://github.com/symfony/DependencyInjection.git", - "reference": "dde921399691bdb3b32a3c2557dcb2054db7593a" + "url": "https://github.com/symfony/BrowserKit.git", + "reference": "3898f9f9aafc853124c90a9d1a4f98c1034e627e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/dde921399691bdb3b32a3c2557dcb2054db7593a", - "reference": "dde921399691bdb3b32a3c2557dcb2054db7593a", + "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/3898f9f9aafc853124c90a9d1a4f98c1034e627e", + "reference": "3898f9f9aafc853124c90a9d1a4f98c1034e627e", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.3", + "symfony/dom-crawler": "~2.0" }, "require-dev": { - "symfony/config": "~2.2", - "symfony/expression-language": "~2.4", - "symfony/yaml": "~2.0" + "symfony/css-selector": "~2.0", + "symfony/process": "~2.0" }, "suggest": { - "symfony/config": "", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" + "symfony/process": "" }, - "time": "2014-02-11 13:52:09", + "time": "2014-01-24 14:36:08", "type": "library", "extra": { "branch-alias": { @@ -5417,7 +5485,7 @@ "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Component\\DependencyInjection\\": "" + "Symfony\\Component\\BrowserKit\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -5436,54 +5504,35 @@ "homepage": "http://symfony.com/contributors" } ], - "description": "Symfony DependencyInjection Component", + "description": "Symfony BrowserKit Component", "homepage": "http://symfony.com" }, { - "name": "symfony/framework-bundle", + "name": "symfony/web-profiler-bundle", "version": "v2.4.2", "version_normalized": "2.4.2.0", - "target-dir": "Symfony/Bundle/FrameworkBundle", + "target-dir": "Symfony/Bundle/WebProfilerBundle", "source": { "type": "git", - "url": "https://github.com/symfony/FrameworkBundle.git", - "reference": "aa3e1310b4d95570c8f813e90a89fe36bdfeb8b2" + "url": "https://github.com/symfony/WebProfilerBundle.git", + "reference": "b7267d6c96cbfd1c52c55ada475da74fd4a0bb59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/FrameworkBundle/zipball/aa3e1310b4d95570c8f813e90a89fe36bdfeb8b2", - "reference": "aa3e1310b4d95570c8f813e90a89fe36bdfeb8b2", + "url": "https://api.github.com/repos/symfony/WebProfilerBundle/zipball/b7267d6c96cbfd1c52c55ada475da74fd4a0bb59", + "reference": "b7267d6c96cbfd1c52c55ada475da74fd4a0bb59", "shasum": "" }, "require": { - "doctrine/annotations": "~1.0", "php": ">=5.3.3", - "symfony/config": "~2.4", - "symfony/dependency-injection": "~2.2", - "symfony/event-dispatcher": "~2.1", - "symfony/filesystem": "~2.3", - "symfony/http-foundation": "~2.4", - "symfony/http-kernel": "~2.4", + "symfony/http-kernel": "~2.2", "symfony/routing": "~2.2", - "symfony/security-core": "~2.4", - "symfony/security-csrf": "~2.4", - "symfony/stopwatch": "~2.3", - "symfony/templating": "~2.1", - "symfony/translation": "~2.3" + "symfony/twig-bridge": "~2.2" }, "require-dev": { - "symfony/class-loader": "~2.1", - "symfony/finder": "~2.0", - "symfony/form": "~2.3", - "symfony/security": "~2.4", - "symfony/validator": "~2.1" - }, - "suggest": { - "doctrine/cache": "For using alternative cache drivers", - "symfony/console": "For using the console commands", - "symfony/finder": "For using the translation loader and cache warmer", - "symfony/form": "For using forms", - "symfony/validator": "For using validation" + "symfony/config": "~2.2", + "symfony/dependency-injection": "~2.0", + "symfony/stopwatch": "~2.2" }, "time": "2014-02-11 13:52:09", "type": "symfony-bundle", @@ -5495,7 +5544,7 @@ "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Bundle\\FrameworkBundle\\": "" + "Symfony\\Bundle\\WebProfilerBundle\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -5514,135 +5563,111 @@ "homepage": "http://symfony.com/contributors" } ], - "description": "Symfony FrameworkBundle", + "description": "Symfony WebProfilerBundle", "homepage": "http://symfony.com" }, { - "name": "chamilo/chash", - "version": "dev-master", - "version_normalized": "9999999-dev", + "name": "silex/web-profiler", + "version": "v1.0.2", + "version_normalized": "1.0.2.0", + "target-dir": "Silex/Provider", "source": { "type": "git", - "url": "https://github.com/chamilo/chash.git", - "reference": "2fd423b7adf448e93477b49c29acaa25ef496621" + "url": "https://github.com/silexphp/Silex-WebProfiler.git", + "reference": "06bd4fcd563d1e114e5c1768dd87da771846fee6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/chamilo/chash/zipball/2fd423b7adf448e93477b49c29acaa25ef496621", - "reference": "2fd423b7adf448e93477b49c29acaa25ef496621", + "url": "https://api.github.com/repos/silexphp/Silex-WebProfiler/zipball/06bd4fcd563d1e114e5c1768dd87da771846fee6", + "reference": "06bd4fcd563d1e114e5c1768dd87da771846fee6", "shasum": "" }, "require": { - "alchemy/zippy": "~0.1", - "composer/composer": "1.0.*@dev", - "doctrine/dbal": "~2.3", - "doctrine/migrations": "dev-master", - "doctrine/orm": "~2.3", - "php": ">=5.3.2", - "symfony/console": "~2.3", - "symfony/filesystem": "~2.3", - "symfony/finder": "~2.3", - "symfony/yaml": "~2.3", - "zendframework/zend-config": "2.2.*@dev", - "zendframework/zend-stdlib": "2.2.*@dev" - }, - "require-dev": { - "mikey179/vfsstream": ">=1.2", - "phpunit/phpunit": "3.7.*" - }, - "time": "2014-02-17 12:26:27", - "type": "library", - "installation-source": "source", - "autoload": { - "psr-0": { - "Chash": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-3.0" - ], - "description": "Chamilo Shell", - "homepage": "http://www.chamilo.org" - }, - { - "name": "leafo/lessphp", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/leafo/lessphp.git", - "reference": "b7cd5c79e82666bcd2dfadb304342311209fb527" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/leafo/lessphp/zipball/b7cd5c79e82666bcd2dfadb304342311209fb527", - "reference": "b7cd5c79e82666bcd2dfadb304342311209fb527", - "shasum": "" + "silex/silex": "~1.0", + "symfony/stopwatch": "~2.2", + "symfony/web-profiler-bundle": "~2.2" }, - "time": "2014-02-05 19:36:35", + "time": "2013-12-05 21:22:21", "type": "library", "extra": { "branch-alias": { - "dev-master": "0.4.x-dev" + "dev-master": "1.0.x-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { - "classmap": [ - "lessc.inc.php" - ] + "psr-0": { + "Silex\\Provider\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT", - "GPL-3.0" + "MIT" ], "authors": [ { - "name": "Leaf Corcoran", - "email": "leafot@gmail.com", - "homepage": "http://leafo.net" + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" } ], - "description": "lessphp is a compiler for LESS written in PHP.", - "homepage": "http://leafo.net/lessphp/" + "description": "A WebProfiler for Silex", + "homepage": "http://silex.sensiolabs.org/" }, { - "name": "filp/whoops", - "version": "dev-master", - "version_normalized": "9999999-dev", + "name": "kriswallsmith/assetic", + "version": "v1.1.2", + "version_normalized": "1.1.2.0", "source": { "type": "git", - "url": "https://github.com/filp/whoops.git", - "reference": "029bb2be5a8ecfce317810a5d278edef0f9bda5c" + "url": "https://github.com/kriswallsmith/assetic.git", + "reference": "735cffd3982c6e8cdebe292d5db39d077f65890f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/029bb2be5a8ecfce317810a5d278edef0f9bda5c", - "reference": "029bb2be5a8ecfce317810a5d278edef0f9bda5c", + "url": "https://api.github.com/repos/kriswallsmith/assetic/zipball/735cffd3982c6e8cdebe292d5db39d077f65890f", + "reference": "735cffd3982c6e8cdebe292d5db39d077f65890f", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=5.3.1", + "symfony/process": "~2.1" }, "require-dev": { - "mockery/mockery": "0.9.*", - "php": ">=5.3.3", - "silex/silex": "1.1.*" + "cssmin/cssmin": "*", + "joliclic/javascript-packer": "*", + "kamicane/packager": "*", + "leafo/lessphp": "*", + "leafo/scssphp": "*", + "leafo/scssphp-compass": "*", + "mrclay/minify": "*", + "phpunit/phpunit": "~3.7", + "ptachoire/cssembed": "*", + "twig/twig": "~1.6" + }, + "suggest": { + "leafo/lessphp": "Assetic provides the integration with the lessphp LESS compiler", + "leafo/scssphp": "Assetic provides the integration with the scssphp SCSS compiler", + "leafo/scssphp-compass": "Assetic provides the integration with the SCSS compass plugin", + "ptachoire/cssembed": "Assetic provides the integration with phpcssembed to embed data uris", + "twig/twig": "Assetic provides the integration with the Twig templating engine" }, - "time": "2014-02-17 12:23:00", + "time": "2013-07-19 00:03:27", "type": "library", "extra": { "branch-alias": { "dev-master": "1.1-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-0": { - "Whoops": "src/" - } + "Assetic": "src/" + }, + "files": [ + "src/functions.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5650,72 +5675,53 @@ ], "authors": [ { - "name": "Filipe Dobreira", - "homepage": "https://github.com/filp", - "role": "Developer" + "name": "Kris Wallsmith", + "email": "kris.wallsmith@gmail.com", + "homepage": "http://kriswallsmith.net/" } ], - "description": "php error handling for cool kids", - "homepage": "https://github.com/filp/whoops", + "description": "Asset Management for PHP", + "homepage": "https://github.com/kriswallsmith/assetic", "keywords": [ - "error", - "exception", - "handling", - "library", - "silex-provider", - "whoops", - "zf2" + "assets", + "compression", + "minification" ] }, { - "name": "symfony/doctrine-bridge", - "version": "2.3.x-dev", - "version_normalized": "2.3.9999999.9999999-dev", - "target-dir": "Symfony/Bridge/Doctrine", + "name": "mheap/silex-assetic", + "version": "1.0.4", + "version_normalized": "1.0.4.0", "source": { "type": "git", - "url": "https://github.com/symfony/DoctrineBridge.git", - "reference": "1f416b522e1fbc2962fcc8de8202fc035bd0043f" + "url": "https://github.com/mheap/Silex-Assetic.git", + "reference": "c0312e06926d10e3cb4444e61365ec8cd8e0fb31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/DoctrineBridge/zipball/1f416b522e1fbc2962fcc8de8202fc035bd0043f", - "reference": "1f416b522e1fbc2962fcc8de8202fc035bd0043f", + "url": "https://api.github.com/repos/mheap/Silex-Assetic/zipball/c0312e06926d10e3cb4444e61365ec8cd8e0fb31", + "reference": "c0312e06926d10e3cb4444e61365ec8cd8e0fb31", "shasum": "" }, "require": { - "doctrine/common": "~2.2", - "php": ">=5.3.3" + "kriswallsmith/assetic": "~1.0", + "php": ">=5.3.0", + "symfony/finder": "~2.1" }, "require-dev": { - "doctrine/data-fixtures": "1.0.*", - "doctrine/dbal": "~2.2", - "doctrine/orm": "~2.2,>=2.2.3", - "symfony/dependency-injection": "~2.0", - "symfony/form": "~2.2", - "symfony/http-kernel": "~2.2", - "symfony/security": "~2.2", - "symfony/stopwatch": "~2.2", - "symfony/validator": "~2.2" + "phpunit/phpunit": "~3.7.10", + "silex/silex": "~1.0@dev", + "twig/twig": "~1.2" }, "suggest": { - "doctrine/data-fixtures": "", - "doctrine/dbal": "", - "doctrine/orm": "", - "symfony/form": "", - "symfony/validator": "" - }, - "time": "2014-02-11 10:29:24", - "type": "symfony-bridge", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } + "twig/twig": "~1.2" }, - "installation-source": "source", + "time": "2014-02-15 20:06:27", + "type": "library", + "installation-source": "dist", "autoload": { "psr-0": { - "Symfony\\Bridge\\Doctrine\\": "" + "SilexAssetic": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -5724,17 +5730,21 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "name": "Sven Eisenschmidt", + "email": "sven.eisenschmidt@gmail.com", + "homepage": "http://unsicherheitsagent.de/" }, { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "name": "Michael Heap", + "email": "m@michaelheap.com", + "homepage": "http://michaelheap.com/" } ], - "description": "Symfony Doctrine Bridge", - "homepage": "http://symfony.com" + "description": "Assetic extension for Silex", + "homepage": "https://github.com/mheap/Silex-Assetic", + "keywords": [ + "assetic", + "silex" + ] } ] diff --git a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/AbstractCommand.php b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/AbstractCommand.php index 97b976ee65..580c9a4f1c 100644 --- a/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/AbstractCommand.php +++ b/vendor/doctrine/migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/AbstractCommand.php @@ -111,6 +111,9 @@ abstract class AbstractCommand extends Command } elseif (file_exists('migrations.yml')) { $configuration = new YamlConfiguration($conn, $outputWriter); $configuration->load('migrations.yml'); + } elseif (file_exists('migrations.yaml')) { + $configuration = new YamlConfiguration($conn, $outputWriter); + $configuration->load('migrations.yaml'); } else { $configuration = new Configuration($conn, $outputWriter); } diff --git a/vendor/ezyang/htmlpurifier/.gitignore b/vendor/ezyang/htmlpurifier/.gitignore index 9fcd3c0eba..553f454dcc 100644 --- a/vendor/ezyang/htmlpurifier/.gitignore +++ b/vendor/ezyang/htmlpurifier/.gitignore @@ -22,3 +22,7 @@ docs/doxygen* /*.php vendor composer.lock +*.rej +*.orig +*.bak +core diff --git a/vendor/ezyang/htmlpurifier/Doxyfile b/vendor/ezyang/htmlpurifier/Doxyfile index 7a62422ddf..b6130b9b88 100644 --- a/vendor/ezyang/htmlpurifier/Doxyfile +++ b/vendor/ezyang/htmlpurifier/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = HTMLPurifier # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 4.5.0 +PROJECT_NUMBER = 4.6.0 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/vendor/ezyang/htmlpurifier/FOCUS b/vendor/ezyang/htmlpurifier/FOCUS index 590c186fc3..e13b9aa0ac 100644 --- a/vendor/ezyang/htmlpurifier/FOCUS +++ b/vendor/ezyang/htmlpurifier/FOCUS @@ -1,4 +1,4 @@ -4 - Minor feature enhancements +9 - Major security fixes [ Appendix A: Release focus IDs ] 0 - N/A diff --git a/vendor/ezyang/htmlpurifier/NEWS b/vendor/ezyang/htmlpurifier/NEWS index 2b2f0e6649..90a054620f 100644 --- a/vendor/ezyang/htmlpurifier/NEWS +++ b/vendor/ezyang/htmlpurifier/NEWS @@ -9,6 +9,28 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier . Internal change ========================== +4.6.0, released 2013-11-30 +# Secure URI munge hashing algorithm has changed to hash_hmac("sha256", $url, $secret). + Please update any verification scripts you may have. +# URI parsing algorithm was made more strict, so only prefixes which + looks like schemes will actually be schemes. Thanks + Michael Gusev for fixing. +# %Core.EscapeInvalidChildren is no longer supported, and no longer does + anything. +! New directive %Core.AllowHostnameUnderscore which allows underscores + in hostnames. +- Eliminate quadratic behavior in DOMLex by using a proper queue. + Thanks Ole Laursen for noticing this. +- Rewritten MakeWellFormed/FixNesting implementation eliminates quadratic + behavior in the rest of the purificaiton pipeline. Thanks Chedburn + Networks for sponsoring this work. +- Made Linkify URL parser a bit less permissive, so that non-breaking + spaces and commas are not included as part of URL. Thanks nAS for fixing. +- Fix some bad interactions with %HTML.Allowed and injectors. Thanks + David Hirtz for reporting. +- Fix infinite loop in DirectLex. Thanks Ashar Javed (@soaj1664ashar) + for reporting. + 4.5.0, released 2013-02-17 # Fix bug where stacked attribute transforms clobber each other; this also means it's no longer possible to override attribute @@ -20,10 +42,10 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier ! Permit underscores in font families ! Support for page-break-* CSS3 properties when proprietary properties are enabled. -! New directive %Core.EnableExcludes; can be set to 'false' to turn off +! New directive %Core.DisableExcludes; can be set to 'true' to turn off SGML excludes checking. If HTML Purifier is removing too much text and you don't care about full standards compliance, try setting this to - 'false'. + 'true'. - Use prepend for SPL autoloading on PHP 5.3 and later. - Fix bug with nofollow transform when pre-existing rel exists. - Fix bug where background:url() always gets lower-cased diff --git a/vendor/ezyang/htmlpurifier/VERSION b/vendor/ezyang/htmlpurifier/VERSION index ae153944ee..28446a5ea5 100644 --- a/vendor/ezyang/htmlpurifier/VERSION +++ b/vendor/ezyang/htmlpurifier/VERSION @@ -1 +1 @@ -4.5.0 \ No newline at end of file +4.6.0 \ No newline at end of file diff --git a/vendor/ezyang/htmlpurifier/WHATSNEW b/vendor/ezyang/htmlpurifier/WHATSNEW index 534cdede07..7464cbc354 100644 --- a/vendor/ezyang/htmlpurifier/WHATSNEW +++ b/vendor/ezyang/htmlpurifier/WHATSNEW @@ -1,6 +1,5 @@ -HTML Purifier 4.5.0 is a minor bugfix and feature release, containing an -accumulation of changes over a year. CSS support has been extended to -support display:inline-block, white-space, underscores in font families, -page-break-* CSS3 properties (when proprietary is enabled.) We now use -SHA-1 to identify cached definitions, and the semantics of stacked -attribute transforms has changed slightly. +HTML Purifier 4.6.0 is a major security release, fixing numerous bad +quadratic asymptotics in HTML Purifier's core algorithms. Most users will +see a decent speedup on large inputs, although small inputs may take +longer. Additionally, the secure URI munging algorithm has changed to +do a proper HMAC. There are some other miscellaneous bugfixes as well. diff --git a/vendor/ezyang/htmlpurifier/benchmarks/Lexer.php b/vendor/ezyang/htmlpurifier/benchmarks/Lexer.php index 686ef63e68..d612fc3c51 100644 --- a/vendor/ezyang/htmlpurifier/benchmarks/Lexer.php +++ b/vendor/ezyang/htmlpurifier/benchmarks/Lexer.php @@ -23,15 +23,16 @@ if (version_compare(PHP_VERSION, '5', '>=')) { class RowTimer extends Benchmark_Timer { - var $name; + public $name; - function RowTimer($name, $auto = false) { + public function RowTimer($name, $auto = false) + { $this->name = htmlentities($name); $this->Benchmark_Timer($auto); } - function getOutput() { - + public function getOutput() + { $total = $this->TimeElapsed(); $result = $this->getProfiling(); $dashes = ''; @@ -68,7 +69,8 @@ class RowTimer extends Benchmark_Timer } } -function print_lexers() { +function print_lexers() +{ global $LEXERS; $first = true; foreach ($LEXERS as $key => $value) { @@ -78,7 +80,8 @@ function print_lexers() { } } -function do_benchmark($name, $document) { +function do_benchmark($name, $document) +{ global $LEXERS, $RUNS; $config = HTMLPurifier_Config::createDefault(); diff --git a/vendor/ezyang/htmlpurifier/configdoc/usage.xml b/vendor/ezyang/htmlpurifier/configdoc/usage.xml index 79f38b855f..f3f7a36a28 100644 --- a/vendor/ezyang/htmlpurifier/configdoc/usage.xml +++ b/vendor/ezyang/htmlpurifier/configdoc/usage.xml @@ -2,546 +2,546 @@ - 131 + 162 - 81 - 284 + 85 + 315 - 53 - 73 - 348 + 67 + 87 + 385 - 50 + 57 - 157 + 226 - 215 + 319 - 219 + 323 - 223 + 327 - 227 + 331 - 302 + 447 - 316 + 463 - 49 + 66 - 83 + 119 - 85 + 123 - 88 + 128 - 93 + 133 - 337 - 372 + 374 + 422 - 341 - 379 + 382 + 433 - 373 + 423 - 61 + 70 - 62 + 71 - 63 + 72 - 64 + 73 - 93 + 104 - 107 + 122 - 266 + 297 - 108 + 123 - 222 + 263 - 230 + 273 - 247 + 291 - 248 + 292 - 251 + 295 - 342 + 399 - 343 + 400 - 204 + 234 - 271 + 302 - 27 + 37 - 36 + 47 - 23 + 30 - 211 + 241 - 212 + 242 - 222 + 256 - 225 + 259 - 228 + 262 - 231 + 265 - 17 + 22 - 234 + 268 - 237 + 271 - 26 + 27 - 88 + 93 - 76 + 80 - 80 + 84 - 48 + 62 - 282 + 313 - 303 + 334 - 60 + 65 - 12 + 46 - 70 + 76 - 81 + 89 - 71 + 77 - 78 + 84 - 41 + 48 - 42 + 49 - 28 + 47 - 12 + 19 - 12 + 19 - 50 + 64 - 18 + 33 - 19 + 34 - 15 + 32 - 30 + 41 - 36 + 51 - 38 - 41 + 53 + 58 - 64 + 89 - 30 + 46 + + + + + 77 - 67 + 96 - 13 + 22 - 18 + 24 - 20 + 27 - 19 + 27 - 25 + 33 - 33 + 41 - 11 + 18 - 13 + 19 - 38 - - - - - 62 + 53 - 91 + 171 - 107 - 124 + 188 + 206 - 55 + 94 - 79 + 122 - 277 + 327 - 17 + 28 - 23 + 48 - 14 + 21 - 13 + 18 - 19 + 24 - 45 + 50 - 49 + 54 - 50 + 55 - 15 + 31 - 15 + 46 - 16 + 47 - 44 + 54 - 70 + 84 - 57 + 54 - 53 + 72 - 19 + 26 - 24 + 31 - 25 + 32 - 28 + 35 - 29 + 36 - 12 + 25 - 14 + 48 - 15 + 49 - 18 + 35 diff --git a/vendor/ezyang/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php b/vendor/ezyang/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php index f7095285bb..1cfec5d762 100644 --- a/vendor/ezyang/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php +++ b/vendor/ezyang/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php @@ -11,7 +11,8 @@ class ConfigDoc_HTMLXSLTProcessor */ protected $xsltProcessor; - public function __construct($proc = false) { + public function __construct($proc = false) + { if ($proc === false) $proc = new XSLTProcessor(); $this->xsltProcessor = $proc; } @@ -19,7 +20,8 @@ class ConfigDoc_HTMLXSLTProcessor /** * @note Allows a string $xsl filename to be passed */ - public function importStylesheet($xsl) { + public function importStylesheet($xsl) + { if (is_string($xsl)) { $xsl_file = $xsl; $xsl = new DOMDocument(); @@ -34,7 +36,8 @@ class ConfigDoc_HTMLXSLTProcessor * @return string HTML output * @todo Rename to transformToXHTML, as transformToHTML is misleading */ - public function transformToHTML($xml) { + public function transformToHTML($xml) + { if (is_string($xml)) { $dom = new DOMDocument(); $dom->load($xml); @@ -68,7 +71,8 @@ class ConfigDoc_HTMLXSLTProcessor * Bulk sets parameters for the XSL stylesheet * @param array $options Associative array of options to set */ - public function setParameters($options) { + public function setParameters($options) + { foreach ($options as $name => $value) { $this->xsltProcessor->setParameter('', $name, $value); } @@ -77,7 +81,8 @@ class ConfigDoc_HTMLXSLTProcessor /** * Forward any other calls to the XSLT processor */ - public function __call($name, $arguments) { + public function __call($name, $arguments) + { call_user_func_array(array($this->xsltProcessor, $name), $arguments); } diff --git a/vendor/ezyang/htmlpurifier/extras/FSTools.php b/vendor/ezyang/htmlpurifier/extras/FSTools.php index 17c35ee6d0..ce00763166 100644 --- a/vendor/ezyang/htmlpurifier/extras/FSTools.php +++ b/vendor/ezyang/htmlpurifier/extras/FSTools.php @@ -15,7 +15,8 @@ class FSTools /** * Returns a global instance of FSTools */ - static public function singleton() { + public static function singleton() + { if (empty(FSTools::$singleton)) FSTools::$singleton = new FSTools(); return FSTools::$singleton; } @@ -24,7 +25,8 @@ class FSTools * Sets our global singleton to something else; useful for overloading * functions. */ - static public function setSingleton($singleton) { + public static function setSingleton($singleton) + { FSTools::$singleton = $singleton; } @@ -33,7 +35,8 @@ class FSTools * @param string $folder Name of folder to create * @note Adapted from the PHP manual comment 76612 */ - public function mkdirr($folder) { + public function mkdirr($folder) + { $folders = preg_split("#[\\\\/]#", $folder); $base = ''; for($i = 0, $c = count($folders); $i < $c; $i++) { @@ -57,7 +60,8 @@ class FSTools * so that copied files, if PHP, have includes removed * @note Adapted from http://aidanlister.com/repos/v/function.copyr.php */ - public function copyr($source, $dest) { + public function copyr($source, $dest) + { // Simple copy for a file if (is_file($source)) { return $this->copy($source, $dest); @@ -92,7 +96,8 @@ class FSTools * ignore hidden files, unreadable files, etc. This function * applies to copyr(). */ - public function copyable($file) { + public function copyable($file) + { return true; } @@ -131,7 +136,8 @@ class FSTools /** * Recursively globs a directory. */ - public function globr($dir, $pattern, $flags = NULL) { + public function globr($dir, $pattern, $flags = NULL) + { $files = $this->glob("$dir/$pattern", $flags); if ($files === false) $files = array(); $sub_dirs = $this->glob("$dir/*", GLOB_ONLYDIR); @@ -148,7 +154,8 @@ class FSTools * @warning This function will not work for functions that need * to pass references; manually define a stub function for those. */ - public function __call($name, $args) { + public function __call($name, $args) + { return call_user_func_array($name, $args); } diff --git a/vendor/ezyang/htmlpurifier/extras/FSTools/File.php b/vendor/ezyang/htmlpurifier/extras/FSTools/File.php index 1c76705d65..6453a7a450 100644 --- a/vendor/ezyang/htmlpurifier/extras/FSTools/File.php +++ b/vendor/ezyang/htmlpurifier/extras/FSTools/File.php @@ -23,7 +23,8 @@ class FSTools_File * Filename of file you wish to instantiate. * @note This file need not exist */ - public function __construct($name, $fs = false) { + public function __construct($name, $fs = false) + { $this->name = $name; $this->fs = $fs ? $fs : FSTools::singleton(); } @@ -38,27 +39,32 @@ class FSTools_File * Retrieves the contents of a file * @todo Throw an exception if file doesn't exist */ - public function get() { + public function get() + { return $this->fs->file_get_contents($this->name); } /** Writes contents to a file, creates new file if necessary */ - public function write($contents) { + public function write($contents) + { return $this->fs->file_put_contents($this->name, $contents); } /** Deletes the file */ - public function delete() { + public function delete() + { return $this->fs->unlink($this->name); } /** Returns true if file exists and is a file. */ - public function exists() { + public function exists() + { return $this->fs->is_file($this->name); } /** Returns last file modification time */ - public function getMTime() { + public function getMTime() + { return $this->fs->filemtime($this->name); } @@ -67,19 +73,22 @@ class FSTools_File * @note We ignore errors because of some weird owner trickery due * to SVN duality */ - public function chmod($octal_code) { + public function chmod($octal_code) + { return @$this->fs->chmod($this->name, $octal_code); } /** Opens file's handle */ - public function open($mode) { + public function open($mode) + { if ($this->handle) $this->close(); $this->handle = $this->fs->fopen($this->name, $mode); return true; } /** Closes file's handle */ - public function close() { + public function close() + { if (!$this->handle) return false; $status = $this->fs->fclose($this->handle); $this->handle = false; @@ -87,37 +96,43 @@ class FSTools_File } /** Retrieves a line from an open file, with optional max length $length */ - public function getLine($length = null) { + public function getLine($length = null) + { if (!$this->handle) $this->open('r'); if ($length === null) return $this->fs->fgets($this->handle); else return $this->fs->fgets($this->handle, $length); } /** Retrieves a character from an open file */ - public function getChar() { + public function getChar() + { if (!$this->handle) $this->open('r'); return $this->fs->fgetc($this->handle); } /** Retrieves an $length bytes of data from an open data */ - public function read($length) { + public function read($length) + { if (!$this->handle) $this->open('r'); return $this->fs->fread($this->handle, $length); } /** Writes to an open file */ - public function put($string) { + public function put($string) + { if (!$this->handle) $this->open('a'); return $this->fs->fwrite($this->handle, $string); } /** Returns TRUE if the end of the file has been reached */ - public function eof() { + public function eof() + { if (!$this->handle) return true; return $this->fs->feof($this->handle); } - public function __destruct() { + public function __destruct() + { if ($this->handle) $this->close(); } diff --git a/vendor/ezyang/htmlpurifier/extras/HTMLPurifierExtras.autoload.php b/vendor/ezyang/htmlpurifier/extras/HTMLPurifierExtras.autoload.php index 4285d62d19..de4a8aaafe 100644 --- a/vendor/ezyang/htmlpurifier/extras/HTMLPurifierExtras.autoload.php +++ b/vendor/ezyang/htmlpurifier/extras/HTMLPurifierExtras.autoload.php @@ -17,7 +17,8 @@ if (function_exists('spl_autoload_register')) { spl_autoload_register('__autoload'); } } elseif (!function_exists('__autoload')) { - function __autoload($class) { + function __autoload($class) + { return HTMLPurifierExtras::autoload($class); } } diff --git a/vendor/ezyang/htmlpurifier/extras/HTMLPurifierExtras.php b/vendor/ezyang/htmlpurifier/extras/HTMLPurifierExtras.php index 2a0c4d12d9..35c2ca7e72 100644 --- a/vendor/ezyang/htmlpurifier/extras/HTMLPurifierExtras.php +++ b/vendor/ezyang/htmlpurifier/extras/HTMLPurifierExtras.php @@ -7,14 +7,16 @@ class HTMLPurifierExtras { - public static function autoload($class) { + public static function autoload($class) + { $path = HTMLPurifierExtras::getPath($class); if (!$path) return false; require $path; return true; } - public static function getPath($class) { + public static function getPath($class) + { if ( strncmp('FSTools', $class, 7) !== 0 && strncmp('ConfigDoc', $class, 9) !== 0 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.autoload.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.autoload.php index 62da5b60d4..c3ea67e814 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.autoload.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.autoload.php @@ -14,7 +14,8 @@ if (function_exists('spl_autoload_register') && function_exists('spl_autoload_un spl_autoload_register('__autoload'); } } elseif (!function_exists('__autoload')) { - function __autoload($class) { + function __autoload($class) + { return HTMLPurifier_Bootstrap::autoload($class); } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.func.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.func.php index 56a55b2fed..64b140bec2 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.func.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.func.php @@ -8,11 +8,13 @@ /** * Purify HTML. - * @param $html String HTML to purify - * @param $config Configuration to use, can be any value accepted by + * @param string $html String HTML to purify + * @param mixed $config Configuration to use, can be any value accepted by * HTMLPurifier_Config::create() + * @return string */ -function HTMLPurifier($html, $config = null) { +function HTMLPurifier($html, $config = null) +{ static $purifier = false; if (!$purifier) { $purifier = new HTMLPurifier(); diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php index 18cb00130d..9b7b88a879 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php @@ -7,7 +7,7 @@ * primary concern and you are using an opcode cache. PLEASE DO NOT EDIT THIS * FILE, changes will be overwritten the next time the script is run. * - * @version 4.5.0 + * @version 4.6.0 * * @warning * You must *not* include any other HTML Purifier files before this file, @@ -19,6 +19,7 @@ */ require 'HTMLPurifier.php'; +require 'HTMLPurifier/Arborize.php'; require 'HTMLPurifier/AttrCollections.php'; require 'HTMLPurifier/AttrDef.php'; require 'HTMLPurifier/AttrTransform.php'; @@ -54,9 +55,11 @@ require 'HTMLPurifier/Language.php'; require 'HTMLPurifier/LanguageFactory.php'; require 'HTMLPurifier/Length.php'; require 'HTMLPurifier/Lexer.php'; +require 'HTMLPurifier/Node.php'; require 'HTMLPurifier/PercentEncoder.php'; require 'HTMLPurifier/PropertyList.php'; require 'HTMLPurifier/PropertyListIterator.php'; +require 'HTMLPurifier/Queue.php'; require 'HTMLPurifier/Strategy.php'; require 'HTMLPurifier/StringHash.php'; require 'HTMLPurifier/StringHashParser.php'; @@ -72,6 +75,7 @@ require 'HTMLPurifier/URISchemeRegistry.php'; require 'HTMLPurifier/UnitConverter.php'; require 'HTMLPurifier/VarParser.php'; require 'HTMLPurifier/VarParserException.php'; +require 'HTMLPurifier/Zipper.php'; require 'HTMLPurifier/AttrDef/CSS.php'; require 'HTMLPurifier/AttrDef/Clone.php'; require 'HTMLPurifier/AttrDef/Enum.php'; @@ -189,6 +193,9 @@ require 'HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php'; require 'HTMLPurifier/Injector/SafeObject.php'; require 'HTMLPurifier/Lexer/DOMLex.php'; require 'HTMLPurifier/Lexer/DirectLex.php'; +require 'HTMLPurifier/Node/Comment.php'; +require 'HTMLPurifier/Node/Element.php'; +require 'HTMLPurifier/Node/Text.php'; require 'HTMLPurifier/Strategy/Composite.php'; require 'HTMLPurifier/Strategy/Core.php'; require 'HTMLPurifier/Strategy/FixNesting.php'; diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.kses.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.kses.php index 3143feb17f..752290077f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.kses.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.kses.php @@ -7,7 +7,8 @@ require_once dirname(__FILE__) . '/HTMLPurifier.auto.php'; -function kses($string, $allowed_html, $allowed_protocols = null) { +function kses($string, $allowed_html, $allowed_protocols = null) +{ $config = HTMLPurifier_Config::createDefault(); $allowed_elements = array(); $allowed_attributes = array(); @@ -19,7 +20,6 @@ function kses($string, $allowed_html, $allowed_protocols = null) { } $config->set('HTML.AllowedElements', $allowed_elements); $config->set('HTML.AllowedAttributes', $allowed_attributes); - $allowed_schemes = array(); if ($allowed_protocols !== null) { $config->set('URI.AllowedSchemes', $allowed_protocols); } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php index fe5a9d5065..6f654fde5a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php @@ -19,7 +19,7 @@ */ /* - HTML Purifier 4.5.0 - Standards Compliant HTML Filtering + HTML Purifier 4.6.0 - Standards Compliant HTML Filtering Copyright (C) 2006-2008 Edward Z. Yang This library is free software; you can redistribute it and/or @@ -54,66 +54,97 @@ class HTMLPurifier { - /** Version of HTML Purifier */ - public $version = '4.5.0'; + /** + * Version of HTML Purifier. + * @type string + */ + public $version = '4.6.0'; - /** Constant with version of HTML Purifier */ - const VERSION = '4.5.0'; + /** + * Constant with version of HTML Purifier. + */ + const VERSION = '4.6.0'; - /** Global configuration object */ + /** + * Global configuration object. + * @type HTMLPurifier_Config + */ public $config; - /** Array of extra HTMLPurifier_Filter objects to run on HTML, for backwards compatibility */ + /** + * Array of extra filter objects to run on HTML, + * for backwards compatibility. + * @type HTMLPurifier_Filter[] + */ private $filters = array(); - /** Single instance of HTML Purifier */ + /** + * Single instance of HTML Purifier. + * @type HTMLPurifier + */ private static $instance; - protected $strategy, $generator; + /** + * @type HTMLPurifier_Strategy_Core + */ + protected $strategy; + + /** + * @type HTMLPurifier_Generator + */ + protected $generator; /** - * Resultant HTMLPurifier_Context of last run purification. Is an array - * of contexts if the last called method was purifyArray(). + * Resultant context of last run purification. + * Is an array of contexts if the last called method was purifyArray(). + * @type HTMLPurifier_Context */ public $context; /** * Initializes the purifier. - * @param $config Optional HTMLPurifier_Config object for all instances of - * the purifier, if omitted, a default configuration is - * supplied (which can be overridden on a per-use basis). + * + * @param HTMLPurifier_Config $config Optional HTMLPurifier_Config object + * for all instances of the purifier, if omitted, a default + * configuration is supplied (which can be overridden on a + * per-use basis). * The parameter can also be any type that * HTMLPurifier_Config::create() supports. */ - public function __construct($config = null) { - + public function __construct($config = null) + { $this->config = HTMLPurifier_Config::create($config); - - $this->strategy = new HTMLPurifier_Strategy_Core(); - + $this->strategy = new HTMLPurifier_Strategy_Core(); } /** * Adds a filter to process the output. First come first serve - * @param $filter HTMLPurifier_Filter object + * + * @param HTMLPurifier_Filter $filter HTMLPurifier_Filter object */ - public function addFilter($filter) { - trigger_error('HTMLPurifier->addFilter() is deprecated, use configuration directives in the Filter namespace or Filter.Custom', E_USER_WARNING); + public function addFilter($filter) + { + trigger_error( + 'HTMLPurifier->addFilter() is deprecated, use configuration directives' . + ' in the Filter namespace or Filter.Custom', + E_USER_WARNING + ); $this->filters[] = $filter; } /** * Filters an HTML snippet/document to be XSS-free and standards-compliant. * - * @param $html String of HTML to purify - * @param $config HTMLPurifier_Config object for this operation, if omitted, - * defaults to the config object specified during this + * @param string $html String of HTML to purify + * @param HTMLPurifier_Config $config Config object for this operation, + * if omitted, defaults to the config object specified during this * object's construction. The parameter can also be any type * that HTMLPurifier_Config::create() supports. - * @return Purified HTML + * + * @return string Purified HTML */ - public function purify($html, $config = null) { - + public function purify($html, $config = null) + { // :TODO: make the config merge in, instead of replace $config = $config ? HTMLPurifier_Config::create($config) : $this->config; @@ -151,8 +182,12 @@ class HTMLPurifier unset($filter_flags['Custom']); $filters = array(); foreach ($filter_flags as $filter => $flag) { - if (!$flag) continue; - if (strpos($filter, '.') !== false) continue; + if (!$flag) { + continue; + } + if (strpos($filter, '.') !== false) { + continue; + } $class = "HTMLPurifier_Filter_$filter"; $filters[] = new $class; } @@ -175,9 +210,12 @@ class HTMLPurifier // list of un-purified tokens $lexer->tokenizeHTML( // un-purified HTML - $html, $config, $context + $html, + $config, + $context ), - $config, $context + $config, + $context ) ); @@ -192,11 +230,15 @@ class HTMLPurifier /** * Filters an array of HTML snippets - * @param $config Optional HTMLPurifier_Config object for this operation. + * + * @param string[] $array_of_html Array of html snippets + * @param HTMLPurifier_Config $config Optional config object for this operation. * See HTMLPurifier::purify() for more details. - * @return Array of purified HTML + * + * @return string[] Array of purified HTML */ - public function purifyArray($array_of_html, $config = null) { + public function purifyArray($array_of_html, $config = null) + { $context_array = array(); foreach ($array_of_html as $key => $html) { $array_of_html[$key] = $this->purify($html, $config); @@ -208,11 +250,16 @@ class HTMLPurifier /** * Singleton for enforcing just one HTML Purifier in your system - * @param $prototype Optional prototype HTMLPurifier instance to - * overload singleton with, or HTMLPurifier_Config - * instance to configure the generated version with. + * + * @param HTMLPurifier|HTMLPurifier_Config $prototype Optional prototype + * HTMLPurifier instance to overload singleton with, + * or HTMLPurifier_Config instance to configure the + * generated version with. + * + * @return HTMLPurifier */ - public static function instance($prototype = null) { + public static function instance($prototype = null) + { if (!self::$instance || $prototype) { if ($prototype instanceof HTMLPurifier) { self::$instance = $prototype; @@ -226,12 +273,20 @@ class HTMLPurifier } /** + * Singleton for enforcing just one HTML Purifier in your system + * + * @param HTMLPurifier|HTMLPurifier_Config $prototype Optional prototype + * HTMLPurifier instance to overload singleton with, + * or HTMLPurifier_Config instance to configure the + * generated version with. + * + * @return HTMLPurifier * @note Backwards compatibility, see instance() */ - public static function getInstance($prototype = null) { + public static function getInstance($prototype = null) + { return HTMLPurifier::instance($prototype); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php index e23a81a71f..9dea6d1ed5 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php @@ -13,6 +13,7 @@ $__dir = dirname(__FILE__); require_once $__dir . '/HTMLPurifier.php'; +require_once $__dir . '/HTMLPurifier/Arborize.php'; require_once $__dir . '/HTMLPurifier/AttrCollections.php'; require_once $__dir . '/HTMLPurifier/AttrDef.php'; require_once $__dir . '/HTMLPurifier/AttrTransform.php'; @@ -48,9 +49,11 @@ require_once $__dir . '/HTMLPurifier/Language.php'; require_once $__dir . '/HTMLPurifier/LanguageFactory.php'; require_once $__dir . '/HTMLPurifier/Length.php'; require_once $__dir . '/HTMLPurifier/Lexer.php'; +require_once $__dir . '/HTMLPurifier/Node.php'; require_once $__dir . '/HTMLPurifier/PercentEncoder.php'; require_once $__dir . '/HTMLPurifier/PropertyList.php'; require_once $__dir . '/HTMLPurifier/PropertyListIterator.php'; +require_once $__dir . '/HTMLPurifier/Queue.php'; require_once $__dir . '/HTMLPurifier/Strategy.php'; require_once $__dir . '/HTMLPurifier/StringHash.php'; require_once $__dir . '/HTMLPurifier/StringHashParser.php'; @@ -66,6 +69,7 @@ require_once $__dir . '/HTMLPurifier/URISchemeRegistry.php'; require_once $__dir . '/HTMLPurifier/UnitConverter.php'; require_once $__dir . '/HTMLPurifier/VarParser.php'; require_once $__dir . '/HTMLPurifier/VarParserException.php'; +require_once $__dir . '/HTMLPurifier/Zipper.php'; require_once $__dir . '/HTMLPurifier/AttrDef/CSS.php'; require_once $__dir . '/HTMLPurifier/AttrDef/Clone.php'; require_once $__dir . '/HTMLPurifier/AttrDef/Enum.php'; @@ -183,6 +187,9 @@ require_once $__dir . '/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php'; require_once $__dir . '/HTMLPurifier/Injector/SafeObject.php'; require_once $__dir . '/HTMLPurifier/Lexer/DOMLex.php'; require_once $__dir . '/HTMLPurifier/Lexer/DirectLex.php'; +require_once $__dir . '/HTMLPurifier/Node/Comment.php'; +require_once $__dir . '/HTMLPurifier/Node/Element.php'; +require_once $__dir . '/HTMLPurifier/Node/Text.php'; require_once $__dir . '/HTMLPurifier/Strategy/Composite.php'; require_once $__dir . '/HTMLPurifier/Strategy/Core.php'; require_once $__dir . '/HTMLPurifier/Strategy/FixNesting.php'; diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Arborize.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Arborize.php new file mode 100644 index 0000000000..9e6617be5d --- /dev/null +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Arborize.php @@ -0,0 +1,71 @@ +getHTMLDefinition(); + $parent = new HTMLPurifier_Token_Start($definition->info_parent); + $stack = array($parent->toNode()); + foreach ($tokens as $token) { + $token->skip = null; // [MUT] + $token->carryover = null; // [MUT] + if ($token instanceof HTMLPurifier_Token_End) { + $token->start = null; // [MUT] + $r = array_pop($stack); + assert($r->name === $token->name); + assert(empty($token->attr)); + $r->endCol = $token->col; + $r->endLine = $token->line; + $r->endArmor = $token->armor; + continue; + } + $node = $token->toNode(); + $stack[count($stack)-1]->children[] = $node; + if ($token instanceof HTMLPurifier_Token_Start) { + $stack[] = $node; + } + } + assert(count($stack) == 1); + return $stack[0]; + } + + public static function flatten($node, $config, $context) { + $level = 0; + $nodes = array($level => new HTMLPurifier_Queue(array($node))); + $closingTokens = array(); + $tokens = array(); + do { + while (!$nodes[$level]->isEmpty()) { + $node = $nodes[$level]->shift(); // FIFO + list($start, $end) = $node->toTokenPair(); + if ($level > 0) { + $tokens[] = $start; + } + if ($end !== NULL) { + $closingTokens[$level][] = $end; + } + if ($node instanceof HTMLPurifier_Node_Element) { + $level++; + $nodes[$level] = new HTMLPurifier_Queue(); + foreach ($node->children as $childNode) { + $nodes[$level]->push($childNode); + } + } + } + $level--; + if ($level && isset($closingTokens[$level])) { + while ($token = array_pop($closingTokens[$level])) { + $tokens[] = $token; + } + } + } while ($level > 0); + return $tokens; + } +} diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrCollections.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrCollections.php index 555b86d042..4f6c2e39a2 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrCollections.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrCollections.php @@ -8,7 +8,8 @@ class HTMLPurifier_AttrCollections { /** - * Associative array of attribute collections, indexed by name + * Associative array of attribute collections, indexed by name. + * @type array */ public $info = array(); @@ -16,10 +17,11 @@ class HTMLPurifier_AttrCollections * Performs all expansions on internal data for use by other inclusions * It also collects all attribute collection extensions from * modules - * @param $attr_types HTMLPurifier_AttrTypes instance - * @param $modules Hash array of HTMLPurifier_HTMLModule members + * @param HTMLPurifier_AttrTypes $attr_types HTMLPurifier_AttrTypes instance + * @param HTMLPurifier_HTMLModule[] $modules Hash array of HTMLPurifier_HTMLModule members */ - public function __construct($attr_types, $modules) { + public function __construct($attr_types, $modules) + { // load extensions from the modules foreach ($modules as $module) { foreach ($module->attr_collections as $coll_i => $coll) { @@ -30,7 +32,9 @@ class HTMLPurifier_AttrCollections if ($attr_i === 0 && isset($this->info[$coll_i][$attr_i])) { // merge in includes $this->info[$coll_i][$attr_i] = array_merge( - $this->info[$coll_i][$attr_i], $attr); + $this->info[$coll_i][$attr_i], + $attr + ); continue; } $this->info[$coll_i][$attr_i] = $attr; @@ -49,20 +53,29 @@ class HTMLPurifier_AttrCollections /** * Takes a reference to an attribute associative array and performs * all inclusions specified by the zero index. - * @param &$attr Reference to attribute array + * @param array &$attr Reference to attribute array */ - public function performInclusions(&$attr) { - if (!isset($attr[0])) return; + public function performInclusions(&$attr) + { + if (!isset($attr[0])) { + return; + } $merge = $attr[0]; $seen = array(); // recursion guard // loop through all the inclusions for ($i = 0; isset($merge[$i]); $i++) { - if (isset($seen[$merge[$i]])) continue; + if (isset($seen[$merge[$i]])) { + continue; + } $seen[$merge[$i]] = true; // foreach attribute of the inclusion, copy it over - if (!isset($this->info[$merge[$i]])) continue; + if (!isset($this->info[$merge[$i]])) { + continue; + } foreach ($this->info[$merge[$i]] as $key => $value) { - if (isset($attr[$key])) continue; // also catches more inclusions + if (isset($attr[$key])) { + continue; + } // also catches more inclusions $attr[$key] = $value; } if (isset($this->info[$merge[$i]][0])) { @@ -76,20 +89,24 @@ class HTMLPurifier_AttrCollections /** * Expands all string identifiers in an attribute array by replacing * them with the appropriate values inside HTMLPurifier_AttrTypes - * @param &$attr Reference to attribute array - * @param $attr_types HTMLPurifier_AttrTypes instance + * @param array &$attr Reference to attribute array + * @param HTMLPurifier_AttrTypes $attr_types HTMLPurifier_AttrTypes instance */ - public function expandIdentifiers(&$attr, $attr_types) { - + public function expandIdentifiers(&$attr, $attr_types) + { // because foreach will process new elements we add, make sure we // skip duplicates $processed = array(); foreach ($attr as $def_i => $def) { // skip inclusions - if ($def_i === 0) continue; + if ($def_i === 0) { + continue; + } - if (isset($processed[$def_i])) continue; + if (isset($processed[$def_i])) { + continue; + } // determine whether or not attribute is required if ($required = (strpos($def_i, '*') !== false)) { @@ -120,9 +137,7 @@ class HTMLPurifier_AttrCollections unset($attr[$def_i]); } } - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef.php index b2e4f36c5d..5ac06522b9 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef.php @@ -14,23 +14,25 @@ abstract class HTMLPurifier_AttrDef { /** - * Tells us whether or not an HTML attribute is minimized. Has no - * meaning in other contexts. + * Tells us whether or not an HTML attribute is minimized. + * Has no meaning in other contexts. + * @type bool */ public $minimized = false; /** - * Tells us whether or not an HTML attribute is required. Has no - * meaning in other contexts + * Tells us whether or not an HTML attribute is required. + * Has no meaning in other contexts + * @type bool */ public $required = false; /** * Validates and cleans passed string according to a definition. * - * @param $string String to be validated and cleaned. - * @param $config Mandatory HTMLPurifier_Config object. - * @param $context Mandatory HTMLPurifier_AttrContext object. + * @param string $string String to be validated and cleaned. + * @param HTMLPurifier_Config $config Mandatory HTMLPurifier_Config object. + * @param HTMLPurifier_Context $context Mandatory HTMLPurifier_Context object. */ abstract public function validate($string, $config, $context); @@ -55,7 +57,8 @@ abstract class HTMLPurifier_AttrDef * parsing XML, thus, this behavior may still be correct. We * assume that newlines have been normalized. */ - public function parseCDATA($string) { + public function parseCDATA($string) + { $string = trim($string); $string = str_replace(array("\n", "\t", "\r"), ' ', $string); return $string; @@ -63,10 +66,11 @@ abstract class HTMLPurifier_AttrDef /** * Factory method for creating this class from a string. - * @param $string String construction info - * @return Created AttrDef object corresponding to $string + * @param string $string String construction info + * @return HTMLPurifier_AttrDef Created AttrDef object corresponding to $string */ - public function make($string) { + public function make($string) + { // default implementation, return a flyweight of this object. // If $string has an effect on the returned object (i.e. you // need to overload this method), it is best @@ -77,16 +81,20 @@ abstract class HTMLPurifier_AttrDef /** * Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work * properly. THIS IS A HACK! + * @param string $string a CSS colour definition + * @return string */ - protected function mungeRgb($string) { + protected function mungeRgb($string) + { return preg_replace('/rgb\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)\)/', 'rgb(\1,\2,\3)', $string); } /** - * Parses a possibly escaped CSS string and returns the "pure" + * Parses a possibly escaped CSS string and returns the "pure" * version of it. */ - protected function expandCSSEscape($string) { + protected function expandCSSEscape($string) + { // flexibly parse it $ret = ''; for ($i = 0, $c = strlen($string); $i < $c; $i++) { @@ -99,25 +107,32 @@ abstract class HTMLPurifier_AttrDef if (ctype_xdigit($string[$i])) { $code = $string[$i]; for ($a = 1, $i++; $i < $c && $a < 6; $i++, $a++) { - if (!ctype_xdigit($string[$i])) break; + if (!ctype_xdigit($string[$i])) { + break; + } $code .= $string[$i]; } // We have to be extremely careful when adding // new characters, to make sure we're not breaking // the encoding. $char = HTMLPurifier_Encoder::unichr(hexdec($code)); - if (HTMLPurifier_Encoder::cleanUTF8($char) === '') continue; + if (HTMLPurifier_Encoder::cleanUTF8($char) === '') { + continue; + } $ret .= $char; - if ($i < $c && trim($string[$i]) !== '') $i--; + if ($i < $c && trim($string[$i]) !== '') { + $i--; + } + continue; + } + if ($string[$i] === "\n") { continue; } - if ($string[$i] === "\n") continue; } $ret .= $string[$i]; } return $ret; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS.php index 953e706755..02c1641fb2 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS.php @@ -14,8 +14,14 @@ class HTMLPurifier_AttrDef_CSS extends HTMLPurifier_AttrDef { - public function validate($css, $config, $context) { - + /** + * @param string $css + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($css, $config, $context) + { $css = $this->parseCDATA($css); $definition = $config->getCSSDefinition(); @@ -36,34 +42,47 @@ class HTMLPurifier_AttrDef_CSS extends HTMLPurifier_AttrDef $context->register('CurrentCSSProperty', $property); foreach ($declarations as $declaration) { - if (!$declaration) continue; - if (!strpos($declaration, ':')) continue; + if (!$declaration) { + continue; + } + if (!strpos($declaration, ':')) { + continue; + } list($property, $value) = explode(':', $declaration, 2); $property = trim($property); - $value = trim($value); + $value = trim($value); $ok = false; do { if (isset($definition->info[$property])) { $ok = true; break; } - if (ctype_lower($property)) break; + if (ctype_lower($property)) { + break; + } $property = strtolower($property); if (isset($definition->info[$property])) { $ok = true; break; } - } while(0); - if (!$ok) continue; + } while (0); + if (!$ok) { + continue; + } // inefficient call, since the validator will do this again if (strtolower(trim($value)) !== 'inherit') { // inherit works for everything (but only on the base property) $result = $definition->info[$property]->validate( - $value, $config, $context ); + $value, + $config, + $context + ); } else { $result = 'inherit'; } - if ($result === false) continue; + if ($result === false) { + continue; + } $propvalues[$property] = $result; } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php index 292c040d4b..af2b83dff8 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php @@ -3,19 +3,32 @@ class HTMLPurifier_AttrDef_CSS_AlphaValue extends HTMLPurifier_AttrDef_CSS_Number { - public function __construct() { + public function __construct() + { parent::__construct(false); // opacity is non-negative, but we will clamp it } - public function validate($number, $config, $context) { + /** + * @param string $number + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string + */ + public function validate($number, $config, $context) + { $result = parent::validate($number, $config, $context); - if ($result === false) return $result; - $float = (float) $result; - if ($float < 0.0) $result = '0'; - if ($float > 1.0) $result = '1'; + if ($result === false) { + return $result; + } + $float = (float)$result; + if ($float < 0.0) { + $result = '0'; + } + if ($float > 1.0) { + $result = '1'; + } return $result; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php index e5b7438c21..7f1ea3b0f1 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php @@ -9,11 +9,16 @@ class HTMLPurifier_AttrDef_CSS_Background extends HTMLPurifier_AttrDef /** * Local copy of component validators. + * @type HTMLPurifier_AttrDef[] * @note See HTMLPurifier_AttrDef_Font::$info for a similar impl. */ protected $info; - public function __construct($config) { + /** + * @param HTMLPurifier_Config $config + */ + public function __construct($config) + { $def = $config->getCSSDefinition(); $this->info['background-color'] = $def->info['background-color']; $this->info['background-image'] = $def->info['background-image']; @@ -22,11 +27,19 @@ class HTMLPurifier_AttrDef_CSS_Background extends HTMLPurifier_AttrDef $this->info['background-position'] = $def->info['background-position']; } - public function validate($string, $config, $context) { - + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { // regular pre-processing $string = $this->parseCDATA($string); - if ($string === '') return false; + if ($string === '') { + return false; + } // munge rgb() decl if necessary $string = $this->mungeRgb($string); @@ -35,27 +48,34 @@ class HTMLPurifier_AttrDef_CSS_Background extends HTMLPurifier_AttrDef $bits = explode(' ', $string); // bits to process $caught = array(); - $caught['color'] = false; - $caught['image'] = false; - $caught['repeat'] = false; + $caught['color'] = false; + $caught['image'] = false; + $caught['repeat'] = false; $caught['attachment'] = false; $caught['position'] = false; $i = 0; // number of catches - $none = false; foreach ($bits as $bit) { - if ($bit === '') continue; + if ($bit === '') { + continue; + } foreach ($caught as $key => $status) { if ($key != 'position') { - if ($status !== false) continue; + if ($status !== false) { + continue; + } $r = $this->info['background-' . $key]->validate($bit, $config, $context); } else { $r = $bit; } - if ($r === false) continue; + if ($r === false) { + continue; + } if ($key == 'position') { - if ($caught[$key] === false) $caught[$key] = ''; + if ($caught[$key] === false) { + $caught[$key] = ''; + } $caught[$key] .= $r . ' '; } else { $caught[$key] = $r; @@ -65,7 +85,9 @@ class HTMLPurifier_AttrDef_CSS_Background extends HTMLPurifier_AttrDef } } - if (!$i) return false; + if (!$i) { + return false; + } if ($caught['position'] !== false) { $caught['position'] = $this->info['background-position']-> validate($caught['position'], $config, $context); @@ -73,15 +95,17 @@ class HTMLPurifier_AttrDef_CSS_Background extends HTMLPurifier_AttrDef $ret = array(); foreach ($caught as $value) { - if ($value === false) continue; + if ($value === false) { + continue; + } $ret[] = $value; } - if (empty($ret)) return false; + if (empty($ret)) { + return false; + } return implode(' ', $ret); - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php index fae82eaec8..4580ef5a91 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php @@ -44,15 +44,30 @@ class HTMLPurifier_AttrDef_CSS_BackgroundPosition extends HTMLPurifier_AttrDef { + /** + * @type HTMLPurifier_AttrDef_CSS_Length + */ protected $length; + + /** + * @type HTMLPurifier_AttrDef_CSS_Percentage + */ protected $percentage; - public function __construct() { - $this->length = new HTMLPurifier_AttrDef_CSS_Length(); + public function __construct() + { + $this->length = new HTMLPurifier_AttrDef_CSS_Length(); $this->percentage = new HTMLPurifier_AttrDef_CSS_Percentage(); } - public function validate($string, $config, $context) { + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { $string = $this->parseCDATA($string); $bits = explode(' ', $string); @@ -74,7 +89,9 @@ class HTMLPurifier_AttrDef_CSS_BackgroundPosition extends HTMLPurifier_AttrDef ); foreach ($bits as $bit) { - if ($bit === '') continue; + if ($bit === '') { + continue; + } // test for keyword $lbit = ctype_lower($bit) ? $bit : strtolower($bit); @@ -104,30 +121,37 @@ class HTMLPurifier_AttrDef_CSS_BackgroundPosition extends HTMLPurifier_AttrDef $measures[] = $r; $i++; } - } - if (!$i) return false; // no valid values were caught + if (!$i) { + return false; + } // no valid values were caught $ret = array(); // first keyword - if ($keywords['h']) $ret[] = $keywords['h']; - elseif ($keywords['ch']) { + if ($keywords['h']) { + $ret[] = $keywords['h']; + } elseif ($keywords['ch']) { $ret[] = $keywords['ch']; $keywords['cv'] = false; // prevent re-use: center = center center + } elseif (count($measures)) { + $ret[] = array_shift($measures); } - elseif (count($measures)) $ret[] = array_shift($measures); - if ($keywords['v']) $ret[] = $keywords['v']; - elseif ($keywords['cv']) $ret[] = $keywords['cv']; - elseif (count($measures)) $ret[] = array_shift($measures); + if ($keywords['v']) { + $ret[] = $keywords['v']; + } elseif ($keywords['cv']) { + $ret[] = $keywords['cv']; + } elseif (count($measures)) { + $ret[] = array_shift($measures); + } - if (empty($ret)) return false; + if (empty($ret)) { + return false; + } return implode(' ', $ret); - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Border.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Border.php index 42a1d1b4ae..16243ba1ed 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Border.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Border.php @@ -8,17 +8,29 @@ class HTMLPurifier_AttrDef_CSS_Border extends HTMLPurifier_AttrDef /** * Local copy of properties this property is shorthand for. + * @type HTMLPurifier_AttrDef[] */ protected $info = array(); - public function __construct($config) { + /** + * @param HTMLPurifier_Config $config + */ + public function __construct($config) + { $def = $config->getCSSDefinition(); $this->info['border-width'] = $def->info['border-width']; $this->info['border-style'] = $def->info['border-style']; $this->info['border-top-color'] = $def->info['border-top-color']; } - public function validate($string, $config, $context) { + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { $string = $this->parseCDATA($string); $string = $this->mungeRgb($string); $bits = explode(' ', $string); @@ -26,7 +38,9 @@ class HTMLPurifier_AttrDef_CSS_Border extends HTMLPurifier_AttrDef $ret = ''; // return value foreach ($bits as $bit) { foreach ($this->info as $propname => $validator) { - if (isset($done[$propname])) continue; + if (isset($done[$propname])) { + continue; + } $r = $validator->validate($bit, $config, $context); if ($r !== false) { $ret .= $r . ' '; @@ -37,7 +51,6 @@ class HTMLPurifier_AttrDef_CSS_Border extends HTMLPurifier_AttrDef } return rtrim($ret); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Color.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Color.php index 07f95a6719..16d2a6b98c 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Color.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Color.php @@ -6,29 +6,47 @@ class HTMLPurifier_AttrDef_CSS_Color extends HTMLPurifier_AttrDef { - public function validate($color, $config, $context) { - + /** + * @param string $color + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($color, $config, $context) + { static $colors = null; - if ($colors === null) $colors = $config->get('Core.ColorKeywords'); + if ($colors === null) { + $colors = $config->get('Core.ColorKeywords'); + } $color = trim($color); - if ($color === '') return false; + if ($color === '') { + return false; + } $lower = strtolower($color); - if (isset($colors[$lower])) return $colors[$lower]; + if (isset($colors[$lower])) { + return $colors[$lower]; + } if (strpos($color, 'rgb(') !== false) { // rgb literal handling $length = strlen($color); - if (strpos($color, ')') !== $length - 1) return false; + if (strpos($color, ')') !== $length - 1) { + return false; + } $triad = substr($color, 4, $length - 4 - 1); $parts = explode(',', $triad); - if (count($parts) !== 3) return false; + if (count($parts) !== 3) { + return false; + } $type = false; // to ensure that they're all the same type $new_parts = array(); foreach ($parts as $part) { $part = trim($part); - if ($part === '') return false; + if ($part === '') { + return false; + } $length = strlen($part); if ($part[$length - 1] === '%') { // handle percents @@ -37,9 +55,13 @@ class HTMLPurifier_AttrDef_CSS_Color extends HTMLPurifier_AttrDef } elseif ($type !== 'percentage') { return false; } - $num = (float) substr($part, 0, $length - 1); - if ($num < 0) $num = 0; - if ($num > 100) $num = 100; + $num = (float)substr($part, 0, $length - 1); + if ($num < 0) { + $num = 0; + } + if ($num > 100) { + $num = 100; + } $new_parts[] = "$num%"; } else { // handle integers @@ -48,10 +70,14 @@ class HTMLPurifier_AttrDef_CSS_Color extends HTMLPurifier_AttrDef } elseif ($type !== 'integer') { return false; } - $num = (int) $part; - if ($num < 0) $num = 0; - if ($num > 255) $num = 255; - $new_parts[] = (string) $num; + $num = (int)$part; + if ($num < 0) { + $num = 0; + } + if ($num > 255) { + $num = 255; + } + $new_parts[] = (string)$num; } } $new_triad = implode(',', $new_parts); @@ -65,14 +91,15 @@ class HTMLPurifier_AttrDef_CSS_Color extends HTMLPurifier_AttrDef $color = '#' . $color; } $length = strlen($hex); - if ($length !== 3 && $length !== 6) return false; - if (!ctype_xdigit($hex)) return false; + if ($length !== 3 && $length !== 6) { + return false; + } + if (!ctype_xdigit($hex)) { + return false; + } } - return $color; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Composite.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Composite.php index de1289cba8..9c1750554f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Composite.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Composite.php @@ -13,26 +13,36 @@ class HTMLPurifier_AttrDef_CSS_Composite extends HTMLPurifier_AttrDef { /** - * List of HTMLPurifier_AttrDef objects that may process strings + * List of objects that may process strings. + * @type HTMLPurifier_AttrDef[] * @todo Make protected */ public $defs; /** - * @param $defs List of HTMLPurifier_AttrDef objects + * @param HTMLPurifier_AttrDef[] $defs List of HTMLPurifier_AttrDef objects */ - public function __construct($defs) { + public function __construct($defs) + { $this->defs = $defs; } - public function validate($string, $config, $context) { + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { foreach ($this->defs as $i => $def) { $result = $this->defs[$i]->validate($string, $config, $context); - if ($result !== false) return $result; + if ($result !== false) { + return $result; + } } return false; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php index 6599c5b2dd..9d77cc9aaf 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php @@ -5,22 +5,38 @@ */ class HTMLPurifier_AttrDef_CSS_DenyElementDecorator extends HTMLPurifier_AttrDef { - public $def, $element; + /** + * @type HTMLPurifier_AttrDef + */ + public $def; + /** + * @type string + */ + public $element; /** - * @param $def Definition to wrap - * @param $element Element to deny + * @param HTMLPurifier_AttrDef $def Definition to wrap + * @param string $element Element to deny */ - public function __construct($def, $element) { + public function __construct($def, $element) + { $this->def = $def; $this->element = $element; } + /** * Checks if CurrentToken is set and equal to $this->element + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string */ - public function validate($string, $config, $context) { + public function validate($string, $config, $context) + { $token = $context->get('CurrentToken', true); - if ($token && $token->name == $this->element) return false; + if ($token && $token->name == $this->element) { + return false; + } return $this->def->validate($string, $config, $context); } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Filter.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Filter.php index 147894b861..bde4c3301f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Filter.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Filter.php @@ -7,23 +7,37 @@ */ class HTMLPurifier_AttrDef_CSS_Filter extends HTMLPurifier_AttrDef { - + /** + * @type HTMLPurifier_AttrDef_Integer + */ protected $intValidator; - public function __construct() { + public function __construct() + { $this->intValidator = new HTMLPurifier_AttrDef_Integer(); } - public function validate($value, $config, $context) { + /** + * @param string $value + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($value, $config, $context) + { $value = $this->parseCDATA($value); - if ($value === 'none') return $value; + if ($value === 'none') { + return $value; + } // if we looped this we could support multiple filters $function_length = strcspn($value, '('); $function = trim(substr($value, 0, $function_length)); if ($function !== 'alpha' && $function !== 'Alpha' && $function !== 'progid:DXImageTransform.Microsoft.Alpha' - ) return false; + ) { + return false; + } $cursor = $function_length + 1; $parameters_length = strcspn($value, ')', $cursor); $parameters = substr($value, $cursor, $parameters_length); @@ -32,15 +46,25 @@ class HTMLPurifier_AttrDef_CSS_Filter extends HTMLPurifier_AttrDef $lookup = array(); foreach ($params as $param) { list($key, $value) = explode('=', $param); - $key = trim($key); + $key = trim($key); $value = trim($value); - if (isset($lookup[$key])) continue; - if ($key !== 'opacity') continue; + if (isset($lookup[$key])) { + continue; + } + if ($key !== 'opacity') { + continue; + } $value = $this->intValidator->validate($value, $config, $context); - if ($value === false) continue; - $int = (int) $value; - if ($int > 100) $value = '100'; - if ($int < 0) $value = '0'; + if ($value === false) { + continue; + } + $int = (int)$value; + if ($int > 100) { + $value = '100'; + } + if ($int < 0) { + $value = '0'; + } $ret_params[] = "$key=$value"; $lookup[$key] = true; } @@ -48,7 +72,6 @@ class HTMLPurifier_AttrDef_CSS_Filter extends HTMLPurifier_AttrDef $ret_function = "$function($ret_parameters)"; return $ret_function; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Font.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Font.php index 699ee0b701..579b97ef1c 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Font.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Font.php @@ -7,8 +7,8 @@ class HTMLPurifier_AttrDef_CSS_Font extends HTMLPurifier_AttrDef { /** - * Local copy of component validators. - * + * Local copy of validators + * @type HTMLPurifier_AttrDef[] * @note If we moved specific CSS property definitions to their own * classes instead of having them be assembled at run time by * CSSDefinition, this wouldn't be necessary. We'd instantiate @@ -16,18 +16,28 @@ class HTMLPurifier_AttrDef_CSS_Font extends HTMLPurifier_AttrDef */ protected $info = array(); - public function __construct($config) { + /** + * @param HTMLPurifier_Config $config + */ + public function __construct($config) + { $def = $config->getCSSDefinition(); - $this->info['font-style'] = $def->info['font-style']; + $this->info['font-style'] = $def->info['font-style']; $this->info['font-variant'] = $def->info['font-variant']; - $this->info['font-weight'] = $def->info['font-weight']; - $this->info['font-size'] = $def->info['font-size']; - $this->info['line-height'] = $def->info['line-height']; - $this->info['font-family'] = $def->info['font-family']; + $this->info['font-weight'] = $def->info['font-weight']; + $this->info['font-size'] = $def->info['font-size']; + $this->info['line-height'] = $def->info['line-height']; + $this->info['font-family'] = $def->info['font-family']; } - public function validate($string, $config, $context) { - + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { static $system_fonts = array( 'caption' => true, 'icon' => true, @@ -39,7 +49,9 @@ class HTMLPurifier_AttrDef_CSS_Font extends HTMLPurifier_AttrDef // regular pre-processing $string = $this->parseCDATA($string); - if ($string === '') return false; + if ($string === '') { + return false; + } // check if it's one of the keywords $lowercase_string = strtolower($string); @@ -54,15 +66,20 @@ class HTMLPurifier_AttrDef_CSS_Font extends HTMLPurifier_AttrDef $final = ''; // output for ($i = 0, $size = count($bits); $i < $size; $i++) { - if ($bits[$i] === '') continue; + if ($bits[$i] === '') { + continue; + } switch ($stage) { - - // attempting to catch font-style, font-variant or font-weight - case 0: + case 0: // attempting to catch font-style, font-variant or font-weight foreach ($stage_1 as $validator_name) { - if (isset($caught[$validator_name])) continue; + if (isset($caught[$validator_name])) { + continue; + } $r = $this->info[$validator_name]->validate( - $bits[$i], $config, $context); + $bits[$i], + $config, + $context + ); if ($r !== false) { $final .= $r . ' '; $caught[$validator_name] = true; @@ -70,15 +87,17 @@ class HTMLPurifier_AttrDef_CSS_Font extends HTMLPurifier_AttrDef } } // all three caught, continue on - if (count($caught) >= 3) $stage = 1; - if ($r !== false) break; - - // attempting to catch font-size and perhaps line-height - case 1: + if (count($caught) >= 3) { + $stage = 1; + } + if ($r !== false) { + break; + } + case 1: // attempting to catch font-size and perhaps line-height $found_slash = false; if (strpos($bits[$i], '/') !== false) { list($font_size, $line_height) = - explode('/', $bits[$i]); + explode('/', $bits[$i]); if ($line_height === '') { // ooh, there's a space after the slash! $line_height = false; @@ -89,14 +108,19 @@ class HTMLPurifier_AttrDef_CSS_Font extends HTMLPurifier_AttrDef $line_height = false; } $r = $this->info['font-size']->validate( - $font_size, $config, $context); + $font_size, + $config, + $context + ); if ($r !== false) { $final .= $r; // attempt to catch line-height if ($line_height === false) { // we need to scroll forward for ($j = $i + 1; $j < $size; $j++) { - if ($bits[$j] === '') continue; + if ($bits[$j] === '') { + continue; + } if ($bits[$j] === '/') { if ($found_slash) { return false; @@ -116,7 +140,10 @@ class HTMLPurifier_AttrDef_CSS_Font extends HTMLPurifier_AttrDef if ($found_slash) { $i = $j; $r = $this->info['line-height']->validate( - $line_height, $config, $context); + $line_height, + $config, + $context + ); if ($r !== false) { $final .= '/' . $r; } @@ -126,13 +153,14 @@ class HTMLPurifier_AttrDef_CSS_Font extends HTMLPurifier_AttrDef break; } return false; - - // attempting to catch font-family - case 2: + case 2: // attempting to catch font-family $font_family = implode(' ', array_slice($bits, $i, $size - $i)); $r = $this->info['font-family']->validate( - $font_family, $config, $context); + $font_family, + $config, + $context + ); if ($r !== false) { $final .= $r . ' '; // processing completed successfully @@ -143,7 +171,6 @@ class HTMLPurifier_AttrDef_CSS_Font extends HTMLPurifier_AttrDef } return false; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php index 98dcf820dc..74e24c8816 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php @@ -8,11 +8,18 @@ class HTMLPurifier_AttrDef_CSS_FontFamily extends HTMLPurifier_AttrDef protected $mask = null; - public function __construct() { + public function __construct() + { $this->mask = '_- '; - for ($c = 'a'; $c <= 'z'; $c++) $this->mask .= $c; - for ($c = 'A'; $c <= 'Z'; $c++) $this->mask .= $c; - for ($c = '0'; $c <= '9'; $c++) $this->mask .= $c; // cast-y, but should be fine + for ($c = 'a'; $c <= 'z'; $c++) { + $this->mask .= $c; + } + for ($c = 'A'; $c <= 'Z'; $c++) { + $this->mask .= $c; + } + for ($c = '0'; $c <= '9'; $c++) { + $this->mask .= $c; + } // cast-y, but should be fine // special bytes used by UTF-8 for ($i = 0x80; $i <= 0xFF; $i++) { // We don't bother excluding invalid bytes in this range, @@ -39,7 +46,14 @@ class HTMLPurifier_AttrDef_CSS_FontFamily extends HTMLPurifier_AttrDef // possible optimization: invert the mask. } - public function validate($string, $config, $context) { + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { static $generic_names = array( 'serif' => true, 'sans-serif' => true, @@ -52,9 +66,11 @@ class HTMLPurifier_AttrDef_CSS_FontFamily extends HTMLPurifier_AttrDef // assume that no font names contain commas in them $fonts = explode(',', $string); $final = ''; - foreach($fonts as $font) { + foreach ($fonts as $font) { $font = trim($font); - if ($font === '') continue; + if ($font === '') { + continue; + } // match a generic name if (isset($generic_names[$font])) { if ($allowed_fonts === null || isset($allowed_fonts[$font])) { @@ -65,9 +81,13 @@ class HTMLPurifier_AttrDef_CSS_FontFamily extends HTMLPurifier_AttrDef // match a quoted name if ($font[0] === '"' || $font[0] === "'") { $length = strlen($font); - if ($length <= 2) continue; + if ($length <= 2) { + continue; + } $quote = $font[0]; - if ($font[$length - 1] !== $quote) continue; + if ($font[$length - 1] !== $quote) { + continue; + } $font = substr($font, 1, $length - 2); } @@ -188,7 +208,9 @@ class HTMLPurifier_AttrDef_CSS_FontFamily extends HTMLPurifier_AttrDef $final .= "'$font', "; } $final = rtrim($final, ', '); - if ($final === '') return false; + if ($final === '') { + return false; + } return $final; } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Ident.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Ident.php index 779794a0b3..973002c17f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Ident.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Ident.php @@ -6,19 +6,27 @@ class HTMLPurifier_AttrDef_CSS_Ident extends HTMLPurifier_AttrDef { - public function validate($string, $config, $context) { - + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { $string = trim($string); // early abort: '' and '0' (strings that convert to false) are invalid - if (!$string) return false; + if (!$string) { + return false; + } $pattern = '/^(-?[A-Za-z_][A-Za-z_\-0-9]*)$/'; - if (!preg_match($pattern, $string)) return false; + if (!preg_match($pattern, $string)) { + return false; + } return $string; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php index 4e6b35e5a0..ffc989fe80 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php @@ -5,20 +5,34 @@ */ class HTMLPurifier_AttrDef_CSS_ImportantDecorator extends HTMLPurifier_AttrDef { - public $def, $allow; + /** + * @type HTMLPurifier_AttrDef + */ + public $def; + /** + * @type bool + */ + public $allow; /** - * @param $def Definition to wrap - * @param $allow Whether or not to allow !important + * @param HTMLPurifier_AttrDef $def Definition to wrap + * @param bool $allow Whether or not to allow !important */ - public function __construct($def, $allow = false) { + public function __construct($def, $allow = false) + { $this->def = $def; $this->allow = $allow; } + /** * Intercepts and removes !important if necessary + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string */ - public function validate($string, $config, $context) { + public function validate($string, $config, $context) + { // test for ! and important tokens $string = trim($string); $is_important = false; @@ -32,7 +46,9 @@ class HTMLPurifier_AttrDef_CSS_ImportantDecorator extends HTMLPurifier_AttrDef } } $string = $this->def->validate($string, $config, $context); - if ($this->allow && $is_important) $string .= ' !important'; + if ($this->allow && $is_important) { + $string .= ' !important'; + } return $string; } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Length.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Length.php index a07ec58135..f12453a04a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Length.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Length.php @@ -6,42 +6,72 @@ class HTMLPurifier_AttrDef_CSS_Length extends HTMLPurifier_AttrDef { - protected $min, $max; + /** + * @type HTMLPurifier_Length|string + */ + protected $min; /** - * @param HTMLPurifier_Length $max Minimum length, or null for no bound. String is also acceptable. - * @param HTMLPurifier_Length $max Maximum length, or null for no bound. String is also acceptable. + * @type HTMLPurifier_Length|string */ - public function __construct($min = null, $max = null) { + protected $max; + + /** + * @param HTMLPurifier_Length|string $min Minimum length, or null for no bound. String is also acceptable. + * @param HTMLPurifier_Length|string $max Maximum length, or null for no bound. String is also acceptable. + */ + public function __construct($min = null, $max = null) + { $this->min = $min !== null ? HTMLPurifier_Length::make($min) : null; $this->max = $max !== null ? HTMLPurifier_Length::make($max) : null; } - public function validate($string, $config, $context) { + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { $string = $this->parseCDATA($string); // Optimizations - if ($string === '') return false; - if ($string === '0') return '0'; - if (strlen($string) === 1) return false; + if ($string === '') { + return false; + } + if ($string === '0') { + return '0'; + } + if (strlen($string) === 1) { + return false; + } $length = HTMLPurifier_Length::make($string); - if (!$length->isValid()) return false; + if (!$length->isValid()) { + return false; + } if ($this->min) { $c = $length->compareTo($this->min); - if ($c === false) return false; - if ($c < 0) return false; + if ($c === false) { + return false; + } + if ($c < 0) { + return false; + } } if ($this->max) { $c = $length->compareTo($this->max); - if ($c === false) return false; - if ($c > 0) return false; + if ($c === false) { + return false; + } + if ($c > 0) { + return false; + } } - return $length->toString(); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php index 4406868c08..e74d42654e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php @@ -8,46 +8,72 @@ class HTMLPurifier_AttrDef_CSS_ListStyle extends HTMLPurifier_AttrDef { /** - * Local copy of component validators. + * Local copy of validators. + * @type HTMLPurifier_AttrDef[] * @note See HTMLPurifier_AttrDef_CSS_Font::$info for a similar impl. */ protected $info; - public function __construct($config) { + /** + * @param HTMLPurifier_Config $config + */ + public function __construct($config) + { $def = $config->getCSSDefinition(); - $this->info['list-style-type'] = $def->info['list-style-type']; + $this->info['list-style-type'] = $def->info['list-style-type']; $this->info['list-style-position'] = $def->info['list-style-position']; $this->info['list-style-image'] = $def->info['list-style-image']; } - public function validate($string, $config, $context) { - + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { // regular pre-processing $string = $this->parseCDATA($string); - if ($string === '') return false; + if ($string === '') { + return false; + } // assumes URI doesn't have spaces in it $bits = explode(' ', strtolower($string)); // bits to process $caught = array(); - $caught['type'] = false; + $caught['type'] = false; $caught['position'] = false; - $caught['image'] = false; + $caught['image'] = false; $i = 0; // number of catches $none = false; foreach ($bits as $bit) { - if ($i >= 3) return; // optimization bit - if ($bit === '') continue; + if ($i >= 3) { + return; + } // optimization bit + if ($bit === '') { + continue; + } foreach ($caught as $key => $status) { - if ($status !== false) continue; + if ($status !== false) { + continue; + } $r = $this->info['list-style-' . $key]->validate($bit, $config, $context); - if ($r === false) continue; + if ($r === false) { + continue; + } if ($r === 'none') { - if ($none) continue; - else $none = true; - if ($key == 'image') continue; + if ($none) { + continue; + } else { + $none = true; + } + if ($key == 'image') { + continue; + } } $caught[$key] = $r; $i++; @@ -55,24 +81,32 @@ class HTMLPurifier_AttrDef_CSS_ListStyle extends HTMLPurifier_AttrDef } } - if (!$i) return false; + if (!$i) { + return false; + } $ret = array(); // construct type - if ($caught['type']) $ret[] = $caught['type']; + if ($caught['type']) { + $ret[] = $caught['type']; + } // construct image - if ($caught['image']) $ret[] = $caught['image']; + if ($caught['image']) { + $ret[] = $caught['image']; + } // construct position - if ($caught['position']) $ret[] = $caught['position']; + if ($caught['position']) { + $ret[] = $caught['position']; + } - if (empty($ret)) return false; + if (empty($ret)) { + return false; + } return implode(' ', $ret); - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php index 4d62a40d7f..9f266cdd15 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php @@ -13,9 +13,9 @@ */ class HTMLPurifier_AttrDef_CSS_Multiple extends HTMLPurifier_AttrDef { - /** * Instance of component definition to defer validation to. + * @type HTMLPurifier_AttrDef * @todo Make protected */ public $single; @@ -27,32 +27,45 @@ class HTMLPurifier_AttrDef_CSS_Multiple extends HTMLPurifier_AttrDef public $max; /** - * @param $single HTMLPurifier_AttrDef to multiply - * @param $max Max number of values allowed (usually four) + * @param HTMLPurifier_AttrDef $single HTMLPurifier_AttrDef to multiply + * @param int $max Max number of values allowed (usually four) */ - public function __construct($single, $max = 4) { + public function __construct($single, $max = 4) + { $this->single = $single; $this->max = $max; } - public function validate($string, $config, $context) { + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { $string = $this->parseCDATA($string); - if ($string === '') return false; + if ($string === '') { + return false; + } $parts = explode(' ', $string); // parseCDATA replaced \r, \t and \n $length = count($parts); $final = ''; for ($i = 0, $num = 0; $i < $length && $num < $this->max; $i++) { - if (ctype_space($parts[$i])) continue; + if (ctype_space($parts[$i])) { + continue; + } $result = $this->single->validate($parts[$i], $config, $context); if ($result !== false) { $final .= $result . ' '; $num++; } } - if ($final === '') return false; + if ($final === '') { + return false; + } return rtrim($final); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php index 3f99e12ec2..8edc159e72 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php @@ -7,32 +7,44 @@ class HTMLPurifier_AttrDef_CSS_Number extends HTMLPurifier_AttrDef { /** - * Bool indicating whether or not only positive values allowed. + * Indicates whether or not only positive values are allowed. + * @type bool */ protected $non_negative = false; /** - * @param $non_negative Bool indicating whether negatives are forbidden + * @param bool $non_negative indicates whether negatives are forbidden */ - public function __construct($non_negative = false) { + public function __construct($non_negative = false) + { $this->non_negative = $non_negative; } /** + * @param string $number + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string|bool * @warning Some contexts do not pass $config, $context. These * variables should not be used without checking HTMLPurifier_Length */ - public function validate($number, $config, $context) { - + public function validate($number, $config, $context) + { $number = $this->parseCDATA($number); - if ($number === '') return false; - if ($number === '0') return '0'; + if ($number === '') { + return false; + } + if ($number === '0') { + return '0'; + } $sign = ''; switch ($number[0]) { case '-': - if ($this->non_negative) return false; + if ($this->non_negative) { + return false; + } $sign = '-'; case '+': $number = substr($number, 1); @@ -44,14 +56,20 @@ class HTMLPurifier_AttrDef_CSS_Number extends HTMLPurifier_AttrDef } // Period is the only non-numeric character allowed - if (strpos($number, '.') === false) return false; + if (strpos($number, '.') === false) { + return false; + } list($left, $right) = explode('.', $number, 2); - if ($left === '' && $right === '') return false; - if ($left !== '' && !ctype_digit($left)) return false; + if ($left === '' && $right === '') { + return false; + } + if ($left !== '' && !ctype_digit($left)) { + return false; + } - $left = ltrim($left, '0'); + $left = ltrim($left, '0'); $right = rtrim($right, '0'); if ($right === '') { @@ -59,11 +77,8 @@ class HTMLPurifier_AttrDef_CSS_Number extends HTMLPurifier_AttrDef } elseif (!ctype_digit($right)) { return false; } - return $sign . $left . '.' . $right; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php index c34b8fc3c3..f0f25c50a8 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php @@ -7,34 +7,48 @@ class HTMLPurifier_AttrDef_CSS_Percentage extends HTMLPurifier_AttrDef { /** - * Instance of HTMLPurifier_AttrDef_CSS_Number to defer number validation + * Instance to defer number validation to. + * @type HTMLPurifier_AttrDef_CSS_Number */ protected $number_def; /** - * @param Bool indicating whether to forbid negative values + * @param bool $non_negative Whether to forbid negative values */ - public function __construct($non_negative = false) { + public function __construct($non_negative = false) + { $this->number_def = new HTMLPurifier_AttrDef_CSS_Number($non_negative); } - public function validate($string, $config, $context) { - + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { $string = $this->parseCDATA($string); - if ($string === '') return false; + if ($string === '') { + return false; + } $length = strlen($string); - if ($length === 1) return false; - if ($string[$length - 1] !== '%') return false; + if ($length === 1) { + return false; + } + if ($string[$length - 1] !== '%') { + return false; + } $number = substr($string, 0, $length - 1); $number = $this->number_def->validate($number, $config, $context); - if ($number === false) return false; + if ($number === false) { + return false; + } return "$number%"; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php index 772c922d80..5fd4b7f7b4 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php @@ -8,8 +8,14 @@ class HTMLPurifier_AttrDef_CSS_TextDecoration extends HTMLPurifier_AttrDef { - public function validate($string, $config, $context) { - + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { static $allowed_values = array( 'line-through' => true, 'overline' => true, @@ -18,7 +24,9 @@ class HTMLPurifier_AttrDef_CSS_TextDecoration extends HTMLPurifier_AttrDef $string = strtolower($this->parseCDATA($string)); - if ($string === 'none') return $string; + if ($string === 'none') { + return $string; + } $parts = explode(' ', $string); $final = ''; @@ -28,11 +36,11 @@ class HTMLPurifier_AttrDef_CSS_TextDecoration extends HTMLPurifier_AttrDef } } $final = rtrim($final); - if ($final === '') return false; + if ($final === '') { + return false; + } return $final; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php index c2f767e573..f9434230e2 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php @@ -12,25 +12,39 @@ class HTMLPurifier_AttrDef_CSS_URI extends HTMLPurifier_AttrDef_URI { - public function __construct() { + public function __construct() + { parent::__construct(true); // always embedded } - public function validate($uri_string, $config, $context) { + /** + * @param string $uri_string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($uri_string, $config, $context) + { // parse the URI out of the string and then pass it onto // the parent object $uri_string = $this->parseCDATA($uri_string); - if (strpos($uri_string, 'url(') !== 0) return false; + if (strpos($uri_string, 'url(') !== 0) { + return false; + } $uri_string = substr($uri_string, 4); $new_length = strlen($uri_string) - 1; - if ($uri_string[$new_length] != ')') return false; + if ($uri_string[$new_length] != ')') { + return false; + } $uri = trim(substr($uri_string, 0, $new_length)); if (!empty($uri) && ($uri[0] == "'" || $uri[0] == '"')) { $quote = $uri[0]; $new_length = strlen($uri) - 1; - if ($uri[$new_length] !== $quote) return false; + if ($uri[$new_length] !== $quote) { + return false; + } $uri = substr($uri, 1, $new_length - 1); } @@ -38,7 +52,9 @@ class HTMLPurifier_AttrDef_CSS_URI extends HTMLPurifier_AttrDef_URI $result = parent::validate($uri, $config, $context); - if ($result === false) return false; + if ($result === false) { + return false; + } // extra sanity check; should have been done by URI $result = str_replace(array('"', "\\", "\n", "\x0c", "\r"), "", $result); @@ -51,11 +67,8 @@ class HTMLPurifier_AttrDef_CSS_URI extends HTMLPurifier_AttrDef_URI // an innerHTML cycle, so a very unlucky query parameter could // then change the meaning of the URL. Unfortunately, there's // not much we can do about that... - return "url(\"$result\")"; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Clone.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Clone.php index ce68dbd546..6698a00c01 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Clone.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Clone.php @@ -7,22 +7,38 @@ class HTMLPurifier_AttrDef_Clone extends HTMLPurifier_AttrDef { /** - * What we're cloning + * What we're cloning. + * @type HTMLPurifier_AttrDef */ protected $clone; - public function __construct($clone) { + /** + * @param HTMLPurifier_AttrDef $clone + */ + public function __construct($clone) + { $this->clone = $clone; } - public function validate($v, $config, $context) { + /** + * @param string $v + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($v, $config, $context) + { return $this->clone->validate($v, $config, $context); } - public function make($string) { + /** + * @param string $string + * @return HTMLPurifier_AttrDef + */ + public function make($string) + { return clone $this->clone; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php index 5d603ebcc6..8abda7f6e2 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php @@ -12,9 +12,10 @@ class HTMLPurifier_AttrDef_Enum extends HTMLPurifier_AttrDef /** * Lookup table of valid values. + * @type array * @todo Make protected */ - public $valid_values = array(); + public $valid_values = array(); /** * Bool indicating whether or not enumeration is case sensitive. @@ -23,17 +24,23 @@ class HTMLPurifier_AttrDef_Enum extends HTMLPurifier_AttrDef protected $case_sensitive = false; // values according to W3C spec /** - * @param $valid_values List of valid values - * @param $case_sensitive Bool indicating whether or not case sensitive + * @param array $valid_values List of valid values + * @param bool $case_sensitive Whether or not case sensitive */ - public function __construct( - $valid_values = array(), $case_sensitive = false - ) { + public function __construct($valid_values = array(), $case_sensitive = false) + { $this->valid_values = array_flip($valid_values); $this->case_sensitive = $case_sensitive; } - public function validate($string, $config, $context) { + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { $string = trim($string); if (!$this->case_sensitive) { // we may want to do full case-insensitive libraries @@ -45,11 +52,13 @@ class HTMLPurifier_AttrDef_Enum extends HTMLPurifier_AttrDef } /** - * @param $string In form of comma-delimited list of case-insensitive + * @param string $string In form of comma-delimited list of case-insensitive * valid values. Example: "foo,bar,baz". Prepend "s:" to make * case sensitive + * @return HTMLPurifier_AttrDef_Enum */ - public function make($string) { + public function make($string) + { if (strlen($string) > 2 && $string[0] == 's' && $string[1] == ':') { $string = substr($string, 2); $sensitive = true; @@ -59,7 +68,6 @@ class HTMLPurifier_AttrDef_Enum extends HTMLPurifier_AttrDef $values = explode(',', $string); return new HTMLPurifier_AttrDef_Enum($values, $sensitive); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php index e06987eb8d..036a240e14 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php @@ -6,23 +6,46 @@ class HTMLPurifier_AttrDef_HTML_Bool extends HTMLPurifier_AttrDef { + /** + * @type bool + */ protected $name; + + /** + * @type bool + */ public $minimized = true; - public function __construct($name = false) {$this->name = $name;} + /** + * @param bool $name + */ + public function __construct($name = false) + { + $this->name = $name; + } - public function validate($string, $config, $context) { - if (empty($string)) return false; + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + if (empty($string)) { + return false; + } return $this->name; } /** - * @param $string Name of attribute + * @param string $string Name of attribute + * @return HTMLPurifier_AttrDef_HTML_Bool */ - public function make($string) { + public function make($string) + { return new HTMLPurifier_AttrDef_HTML_Bool($string); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php index 370068d975..d5013488fc 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php @@ -5,7 +5,14 @@ */ class HTMLPurifier_AttrDef_HTML_Class extends HTMLPurifier_AttrDef_HTML_Nmtokens { - protected function split($string, $config, $context) { + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + protected function split($string, $config, $context) + { // really, this twiddle should be lazy loaded $name = $config->getDefinition('HTML')->doctype->name; if ($name == "XHTML 1.1" || $name == "XHTML 2.0") { @@ -14,13 +21,20 @@ class HTMLPurifier_AttrDef_HTML_Class extends HTMLPurifier_AttrDef_HTML_Nmtokens return preg_split('/\s+/', $string); } } - protected function filter($tokens, $config, $context) { + + /** + * @param array $tokens + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + protected function filter($tokens, $config, $context) + { $allowed = $config->get('Attr.AllowedClasses'); $forbidden = $config->get('Attr.ForbiddenClasses'); $ret = array(); foreach ($tokens as $token) { - if ( - ($allowed === null || isset($allowed[$token])) && + if (($allowed === null || isset($allowed[$token])) && !isset($forbidden[$token]) && // We need this O(n) check because of PHP's array // implementation that casts -0 to 0. diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php index e02abb0759..946ebb7820 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php @@ -6,28 +6,46 @@ class HTMLPurifier_AttrDef_HTML_Color extends HTMLPurifier_AttrDef { - public function validate($string, $config, $context) { - + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { static $colors = null; - if ($colors === null) $colors = $config->get('Core.ColorKeywords'); + if ($colors === null) { + $colors = $config->get('Core.ColorKeywords'); + } $string = trim($string); - if (empty($string)) return false; + if (empty($string)) { + return false; + } $lower = strtolower($string); - if (isset($colors[$lower])) return $colors[$lower]; - if ($string[0] === '#') $hex = substr($string, 1); - else $hex = $string; + if (isset($colors[$lower])) { + return $colors[$lower]; + } + if ($string[0] === '#') { + $hex = substr($string, 1); + } else { + $hex = $string; + } $length = strlen($hex); - if ($length !== 3 && $length !== 6) return false; - if (!ctype_xdigit($hex)) return false; - if ($length === 3) $hex = $hex[0].$hex[0].$hex[1].$hex[1].$hex[2].$hex[2]; - + if ($length !== 3 && $length !== 6) { + return false; + } + if (!ctype_xdigit($hex)) { + return false; + } + if ($length === 3) { + $hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2]; + } return "#$hex"; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php index ae6ea7c01d..d79ba12b3f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php @@ -6,16 +6,33 @@ class HTMLPurifier_AttrDef_HTML_FrameTarget extends HTMLPurifier_AttrDef_Enum { + /** + * @type array + */ public $valid_values = false; // uninitialized value + + /** + * @type bool + */ protected $case_sensitive = false; - public function __construct() {} + public function __construct() + { + } - public function validate($string, $config, $context) { - if ($this->valid_values === false) $this->valid_values = $config->get('Attr.AllowedFrameTargets'); + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + if ($this->valid_values === false) { + $this->valid_values = $config->get('Attr.AllowedFrameTargets'); + } return parent::validate($string, $config, $context); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ID.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ID.php index 0015fa1ebb..3d86efb44c 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ID.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ID.php @@ -18,34 +18,56 @@ class HTMLPurifier_AttrDef_HTML_ID extends HTMLPurifier_AttrDef /** * Determines whether or not we're validating an ID in a CSS * selector context. + * @type bool */ protected $selector; - public function __construct($selector = false) { + /** + * @param bool $selector + */ + public function __construct($selector = false) + { $this->selector = $selector; } - public function validate($id, $config, $context) { - - if (!$this->selector && !$config->get('Attr.EnableID')) return false; + /** + * @param string $id + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($id, $config, $context) + { + if (!$this->selector && !$config->get('Attr.EnableID')) { + return false; + } $id = trim($id); // trim it first - if ($id === '') return false; + if ($id === '') { + return false; + } $prefix = $config->get('Attr.IDPrefix'); if ($prefix !== '') { $prefix .= $config->get('Attr.IDPrefixLocal'); // prevent re-appending the prefix - if (strpos($id, $prefix) !== 0) $id = $prefix . $id; + if (strpos($id, $prefix) !== 0) { + $id = $prefix . $id; + } } elseif ($config->get('Attr.IDPrefixLocal') !== '') { - trigger_error('%Attr.IDPrefixLocal cannot be used unless '. - '%Attr.IDPrefix is set', E_USER_WARNING); + trigger_error( + '%Attr.IDPrefixLocal cannot be used unless ' . + '%Attr.IDPrefix is set', + E_USER_WARNING + ); } if (!$this->selector) { $id_accumulator =& $context->get('IDAccumulator'); - if (isset($id_accumulator->ids[$id])) return false; + if (isset($id_accumulator->ids[$id])) { + return false; + } } // we purposely avoid using regex, hopefully this is faster @@ -53,11 +75,14 @@ class HTMLPurifier_AttrDef_HTML_ID extends HTMLPurifier_AttrDef if (ctype_alpha($id)) { $result = true; } else { - if (!ctype_alpha(@$id[0])) return false; - $trim = trim( // primitive style of regexps, I suppose + if (!ctype_alpha(@$id[0])) { + return false; + } + // primitive style of regexps, I suppose + $trim = trim( $id, 'A..Za..z0..9:-._' - ); + ); $result = ($trim === ''); } @@ -66,15 +91,15 @@ class HTMLPurifier_AttrDef_HTML_ID extends HTMLPurifier_AttrDef return false; } - if (!$this->selector && $result) $id_accumulator->add($id); + if (!$this->selector && $result) { + $id_accumulator->add($id); + } // if no change was made to the ID, return the result // else, return the new id if stripping whitespace made it // valid, or return false. return $result ? $id : false; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Length.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Length.php index a242f9c238..1c4006fbbd 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Length.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Length.php @@ -10,32 +10,47 @@ class HTMLPurifier_AttrDef_HTML_Length extends HTMLPurifier_AttrDef_HTML_Pixels { - public function validate($string, $config, $context) { - + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { $string = trim($string); - if ($string === '') return false; + if ($string === '') { + return false; + } $parent_result = parent::validate($string, $config, $context); - if ($parent_result !== false) return $parent_result; + if ($parent_result !== false) { + return $parent_result; + } $length = strlen($string); $last_char = $string[$length - 1]; - if ($last_char !== '%') return false; + if ($last_char !== '%') { + return false; + } $points = substr($string, 0, $length - 1); - if (!is_numeric($points)) return false; - - $points = (int) $points; + if (!is_numeric($points)) { + return false; + } - if ($points < 0) return '0%'; - if ($points > 100) return '100%'; - - return ((string) $points) . '%'; + $points = (int)$points; + if ($points < 0) { + return '0%'; + } + if ($points > 100) { + return '100%'; + } + return ((string)$points) . '%'; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php index 76d25ed088..63fa04c15c 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php @@ -9,26 +9,44 @@ class HTMLPurifier_AttrDef_HTML_LinkTypes extends HTMLPurifier_AttrDef { - /** Name config attribute to pull. */ + /** + * Name config attribute to pull. + * @type string + */ protected $name; - public function __construct($name) { + /** + * @param string $name + */ + public function __construct($name) + { $configLookup = array( 'rel' => 'AllowedRel', 'rev' => 'AllowedRev' ); if (!isset($configLookup[$name])) { - trigger_error('Unrecognized attribute name for link '. - 'relationship.', E_USER_ERROR); + trigger_error( + 'Unrecognized attribute name for link ' . + 'relationship.', + E_USER_ERROR + ); return; } $this->name = $configLookup[$name]; } - public function validate($string, $config, $context) { - + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { $allowed = $config->get('Attr.' . $this->name); - if (empty($allowed)) return false; + if (empty($allowed)) { + return false; + } $string = $this->parseCDATA($string); $parts = explode(' ', $string); @@ -37,17 +55,18 @@ class HTMLPurifier_AttrDef_HTML_LinkTypes extends HTMLPurifier_AttrDef $ret_lookup = array(); foreach ($parts as $part) { $part = strtolower(trim($part)); - if (!isset($allowed[$part])) continue; + if (!isset($allowed[$part])) { + continue; + } $ret_lookup[$part] = true; } - if (empty($ret_lookup)) return false; + if (empty($ret_lookup)) { + return false; + } $string = implode(' ', array_keys($ret_lookup)); - return $string; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/MultiLength.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/MultiLength.php index c72fc76e4d..bbb20f2f80 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/MultiLength.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/MultiLength.php @@ -9,33 +9,52 @@ class HTMLPurifier_AttrDef_HTML_MultiLength extends HTMLPurifier_AttrDef_HTML_Length { - public function validate($string, $config, $context) { - + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { $string = trim($string); - if ($string === '') return false; + if ($string === '') { + return false; + } $parent_result = parent::validate($string, $config, $context); - if ($parent_result !== false) return $parent_result; + if ($parent_result !== false) { + return $parent_result; + } $length = strlen($string); $last_char = $string[$length - 1]; - if ($last_char !== '*') return false; + if ($last_char !== '*') { + return false; + } $int = substr($string, 0, $length - 1); - if ($int == '') return '*'; - if (!is_numeric($int)) return false; - - $int = (int) $int; - - if ($int < 0) return false; - if ($int == 0) return '0'; - if ($int == 1) return '*'; - return ((string) $int) . '*'; - + if ($int == '') { + return '*'; + } + if (!is_numeric($int)) { + return false; + } + + $int = (int)$int; + if ($int < 0) { + return false; + } + if ($int == 0) { + return '0'; + } + if ($int == 1) { + return '*'; + } + return ((string)$int) . '*'; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Nmtokens.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Nmtokens.php index aa34120bd2..f79683b4fc 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Nmtokens.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Nmtokens.php @@ -6,24 +6,38 @@ class HTMLPurifier_AttrDef_HTML_Nmtokens extends HTMLPurifier_AttrDef { - public function validate($string, $config, $context) { - + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { $string = trim($string); // early abort: '' and '0' (strings that convert to false) are invalid - if (!$string) return false; + if (!$string) { + return false; + } $tokens = $this->split($string, $config, $context); $tokens = $this->filter($tokens, $config, $context); - if (empty($tokens)) return false; + if (empty($tokens)) { + return false; + } return implode(' ', $tokens); - } /** * Splits a space separated list of tokens into its constituent parts. + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array */ - protected function split($string, $config, $context) { + protected function split($string, $config, $context) + { // OPTIMIZABLE! // do the preg_match, capture all subpatterns for reformulation @@ -31,9 +45,9 @@ class HTMLPurifier_AttrDef_HTML_Nmtokens extends HTMLPurifier_AttrDef // escaping because I don't know how to do that with regexps // and plus it would complicate optimization efforts (you never // see that anyway). - $pattern = '/(?:(?<=\s)|\A)'. // look behind for space or string start - '((?:--|-?[A-Za-z_])[A-Za-z_\-0-9]*)'. - '(?:(?=\s)|\z)/'; // look ahead for space or string end + $pattern = '/(?:(?<=\s)|\A)' . // look behind for space or string start + '((?:--|-?[A-Za-z_])[A-Za-z_\-0-9]*)' . + '(?:(?=\s)|\z)/'; // look ahead for space or string end preg_match_all($pattern, $string, $matches); return $matches[1]; } @@ -42,11 +56,15 @@ class HTMLPurifier_AttrDef_HTML_Nmtokens extends HTMLPurifier_AttrDef * Template method for removing certain tokens based on arbitrary criteria. * @note If we wanted to be really functional, we'd do an array_filter * with a callback. But... we're not. + * @param array $tokens + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array */ - protected function filter($tokens, $config, $context) { + protected function filter($tokens, $config, $context) + { return $tokens; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Pixels.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Pixels.php index 4cb2c1b857..a1d019e095 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Pixels.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Pixels.php @@ -6,43 +6,71 @@ class HTMLPurifier_AttrDef_HTML_Pixels extends HTMLPurifier_AttrDef { + /** + * @type int + */ protected $max; - public function __construct($max = null) { + /** + * @param int $max + */ + public function __construct($max = null) + { $this->max = $max; } - public function validate($string, $config, $context) { - + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { $string = trim($string); - if ($string === '0') return $string; - if ($string === '') return false; + if ($string === '0') { + return $string; + } + if ($string === '') { + return false; + } $length = strlen($string); if (substr($string, $length - 2) == 'px') { $string = substr($string, 0, $length - 2); } - if (!is_numeric($string)) return false; - $int = (int) $string; + if (!is_numeric($string)) { + return false; + } + $int = (int)$string; - if ($int < 0) return '0'; + if ($int < 0) { + return '0'; + } // upper-bound value, extremely high values can // crash operating systems, see // WARNING, above link WILL crash you if you're using Windows - if ($this->max !== null && $int > $this->max) return (string) $this->max; - - return (string) $int; - + if ($this->max !== null && $int > $this->max) { + return (string)$this->max; + } + return (string)$int; } - public function make($string) { - if ($string === '') $max = null; - else $max = (int) $string; + /** + * @param string $string + * @return HTMLPurifier_AttrDef + */ + public function make($string) + { + if ($string === '') { + $max = null; + } else { + $max = (int)$string; + } $class = get_class($this); return new $class($max); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Integer.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Integer.php index d59738d2a2..400e707d2f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Integer.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Integer.php @@ -11,17 +11,20 @@ class HTMLPurifier_AttrDef_Integer extends HTMLPurifier_AttrDef { /** - * Bool indicating whether or not negative values are allowed + * Whether or not negative values are allowed. + * @type bool */ protected $negative = true; /** - * Bool indicating whether or not zero is allowed + * Whether or not zero is allowed. + * @type bool */ protected $zero = true; /** - * Bool indicating whether or not positive values are allowed + * Whether or not positive values are allowed. + * @type bool */ protected $positive = true; @@ -30,44 +33,59 @@ class HTMLPurifier_AttrDef_Integer extends HTMLPurifier_AttrDef * @param $zero Bool indicating whether or not zero is allowed * @param $positive Bool indicating whether or not positive values are allowed */ - public function __construct( - $negative = true, $zero = true, $positive = true - ) { + public function __construct($negative = true, $zero = true, $positive = true) + { $this->negative = $negative; - $this->zero = $zero; + $this->zero = $zero; $this->positive = $positive; } - public function validate($integer, $config, $context) { - + /** + * @param string $integer + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($integer, $config, $context) + { $integer = $this->parseCDATA($integer); - if ($integer === '') return false; + if ($integer === '') { + return false; + } // we could possibly simply typecast it to integer, but there are // certain fringe cases that must not return an integer. // clip leading sign - if ( $this->negative && $integer[0] === '-' ) { + if ($this->negative && $integer[0] === '-') { $digits = substr($integer, 1); - if ($digits === '0') $integer = '0'; // rm minus sign for zero - } elseif( $this->positive && $integer[0] === '+' ) { + if ($digits === '0') { + $integer = '0'; + } // rm minus sign for zero + } elseif ($this->positive && $integer[0] === '+') { $digits = $integer = substr($integer, 1); // rm unnecessary plus } else { $digits = $integer; } // test if it's numeric - if (!ctype_digit($digits)) return false; + if (!ctype_digit($digits)) { + return false; + } // perform scope tests - if (!$this->zero && $integer == 0) return false; - if (!$this->positive && $integer > 0) return false; - if (!$this->negative && $integer < 0) return false; + if (!$this->zero && $integer == 0) { + return false; + } + if (!$this->positive && $integer > 0) { + return false; + } + if (!$this->negative && $integer < 0) { + return false; + } return $integer; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Lang.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Lang.php index 10e6da56db..2a55cea642 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Lang.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Lang.php @@ -7,15 +7,25 @@ class HTMLPurifier_AttrDef_Lang extends HTMLPurifier_AttrDef { - public function validate($string, $config, $context) { - + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { $string = trim($string); - if (!$string) return false; + if (!$string) { + return false; + } $subtags = explode('-', $string); $num_subtags = count($subtags); - if ($num_subtags == 0) return false; // sanity check + if ($num_subtags == 0) { // sanity check + return false; + } // process primary subtag : $subtags[0] $length = strlen($subtags[0]); @@ -23,15 +33,15 @@ class HTMLPurifier_AttrDef_Lang extends HTMLPurifier_AttrDef case 0: return false; case 1: - if (! ($subtags[0] == 'x' || $subtags[0] == 'i') ) { + if (!($subtags[0] == 'x' || $subtags[0] == 'i')) { return false; } break; case 2: case 3: - if (! ctype_alpha($subtags[0]) ) { + if (!ctype_alpha($subtags[0])) { return false; - } elseif (! ctype_lower($subtags[0]) ) { + } elseif (!ctype_lower($subtags[0])) { $subtags[0] = strtolower($subtags[0]); } break; @@ -40,17 +50,23 @@ class HTMLPurifier_AttrDef_Lang extends HTMLPurifier_AttrDef } $new_string = $subtags[0]; - if ($num_subtags == 1) return $new_string; + if ($num_subtags == 1) { + return $new_string; + } // process second subtag : $subtags[1] $length = strlen($subtags[1]); if ($length == 0 || ($length == 1 && $subtags[1] != 'x') || $length > 8 || !ctype_alnum($subtags[1])) { return $new_string; } - if (!ctype_lower($subtags[1])) $subtags[1] = strtolower($subtags[1]); + if (!ctype_lower($subtags[1])) { + $subtags[1] = strtolower($subtags[1]); + } $new_string .= '-' . $subtags[1]; - if ($num_subtags == 2) return $new_string; + if ($num_subtags == 2) { + return $new_string; + } // process all other subtags, index 2 and up for ($i = 2; $i < $num_subtags; $i++) { @@ -63,11 +79,8 @@ class HTMLPurifier_AttrDef_Lang extends HTMLPurifier_AttrDef } $new_string .= '-' . $subtags[$i]; } - return $new_string; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Switch.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Switch.php index c9e3ed193e..c7eb3199a4 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Switch.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Switch.php @@ -6,21 +6,41 @@ class HTMLPurifier_AttrDef_Switch { + /** + * @type string + */ protected $tag; - protected $withTag, $withoutTag; + + /** + * @type HTMLPurifier_AttrDef + */ + protected $withTag; + + /** + * @type HTMLPurifier_AttrDef + */ + protected $withoutTag; /** * @param string $tag Tag name to switch upon * @param HTMLPurifier_AttrDef $with_tag Call if token matches tag * @param HTMLPurifier_AttrDef $without_tag Call if token doesn't match, or there is no token */ - public function __construct($tag, $with_tag, $without_tag) { + public function __construct($tag, $with_tag, $without_tag) + { $this->tag = $tag; $this->withTag = $with_tag; $this->withoutTag = $without_tag; } - public function validate($string, $config, $context) { + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { $token = $context->get('CurrentToken', true); if (!$token || $token->name !== $this->tag) { return $this->withoutTag->validate($string, $config, $context); @@ -28,7 +48,6 @@ class HTMLPurifier_AttrDef_Switch return $this->withTag->validate($string, $config, $context); } } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Text.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Text.php index c6216cc531..4553a4ea9b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Text.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Text.php @@ -6,10 +6,16 @@ class HTMLPurifier_AttrDef_Text extends HTMLPurifier_AttrDef { - public function validate($string, $config, $context) { + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { return $this->parseCDATA($string); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php index c2b6846712..c1cd89772c 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php @@ -7,31 +7,54 @@ class HTMLPurifier_AttrDef_URI extends HTMLPurifier_AttrDef { + /** + * @type HTMLPurifier_URIParser + */ protected $parser; + + /** + * @type bool + */ protected $embedsResource; /** - * @param $embeds_resource_resource Does the URI here result in an extra HTTP request? + * @param bool $embeds_resource Does the URI here result in an extra HTTP request? */ - public function __construct($embeds_resource = false) { + public function __construct($embeds_resource = false) + { $this->parser = new HTMLPurifier_URIParser(); - $this->embedsResource = (bool) $embeds_resource; + $this->embedsResource = (bool)$embeds_resource; } - public function make($string) { + /** + * @param string $string + * @return HTMLPurifier_AttrDef_URI + */ + public function make($string) + { $embeds = ($string === 'embedded'); return new HTMLPurifier_AttrDef_URI($embeds); } - public function validate($uri, $config, $context) { - - if ($config->get('URI.Disable')) return false; + /** + * @param string $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($uri, $config, $context) + { + if ($config->get('URI.Disable')) { + return false; + } $uri = $this->parseCDATA($uri); // parse the URI $uri = $this->parser->parse($uri); - if ($uri === false) return false; + if ($uri === false) { + return false; + } // add embedded flag to context for validators $context->register('EmbeddedURI', $this->embedsResource); @@ -41,23 +64,35 @@ class HTMLPurifier_AttrDef_URI extends HTMLPurifier_AttrDef // generic validation $result = $uri->validate($config, $context); - if (!$result) break; + if (!$result) { + break; + } // chained filtering $uri_def = $config->getDefinition('URI'); $result = $uri_def->filter($uri, $config, $context); - if (!$result) break; + if (!$result) { + break; + } // scheme-specific validation $scheme_obj = $uri->getSchemeObj($config, $context); - if (!$scheme_obj) break; - if ($this->embedsResource && !$scheme_obj->browsable) break; + if (!$scheme_obj) { + break; + } + if ($this->embedsResource && !$scheme_obj->browsable) { + break; + } $result = $scheme_obj->validate($uri, $config, $context); - if (!$result) break; + if (!$result) { + break; + } // Post chained filtering $result = $uri_def->postFilter($uri, $config, $context); - if (!$result) break; + if (!$result) { + break; + } // survived gauntlet $ok = true; @@ -65,13 +100,12 @@ class HTMLPurifier_AttrDef_URI extends HTMLPurifier_AttrDef } while (false); $context->destroy('EmbeddedURI'); - if (!$ok) return false; - + if (!$ok) { + return false; + } // back to string return $uri->toString(); - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email.php index bfee9d166c..daf32b7643 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email.php @@ -5,8 +5,11 @@ abstract class HTMLPurifier_AttrDef_URI_Email extends HTMLPurifier_AttrDef /** * Unpacks a mailbox into its display-name and address + * @param string $string + * @return mixed */ - function unpack($string) { + public function unpack($string) + { // needs to be implemented } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php index 94c715ab43..52c0d59683 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php @@ -7,15 +7,23 @@ class HTMLPurifier_AttrDef_URI_Email_SimpleCheck extends HTMLPurifier_AttrDef_URI_Email { - public function validate($string, $config, $context) { + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { // no support for named mailboxes i.e. "Bob " // that needs more percent encoding to be done - if ($string == '') return false; + if ($string == '') { + return false; + } $string = trim($string); $result = preg_match('/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i', $string); return $result ? $string : false; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php index 125decb2df..e7df800b1e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php @@ -7,21 +7,31 @@ class HTMLPurifier_AttrDef_URI_Host extends HTMLPurifier_AttrDef { /** - * Instance of HTMLPurifier_AttrDef_URI_IPv4 sub-validator + * IPv4 sub-validator. + * @type HTMLPurifier_AttrDef_URI_IPv4 */ protected $ipv4; /** - * Instance of HTMLPurifier_AttrDef_URI_IPv6 sub-validator + * IPv6 sub-validator. + * @type HTMLPurifier_AttrDef_URI_IPv6 */ protected $ipv6; - public function __construct() { + public function __construct() + { $this->ipv4 = new HTMLPurifier_AttrDef_URI_IPv4(); $this->ipv6 = new HTMLPurifier_AttrDef_URI_IPv6(); } - public function validate($string, $config, $context) { + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { $length = strlen($string); // empty hostname is OK; it's usually semantically equivalent: // the default host as defined by a URI scheme is used: @@ -29,32 +39,51 @@ class HTMLPurifier_AttrDef_URI_Host extends HTMLPurifier_AttrDef // If the URI scheme defines a default for host, then that // default applies when the host subcomponent is undefined // or when the registered name is empty (zero length). - if ($string === '') return ''; - if ($length > 1 && $string[0] === '[' && $string[$length-1] === ']') { + if ($string === '') { + return ''; + } + if ($length > 1 && $string[0] === '[' && $string[$length - 1] === ']') { //IPv6 $ip = substr($string, 1, $length - 2); $valid = $this->ipv6->validate($ip, $config, $context); - if ($valid === false) return false; - return '['. $valid . ']'; + if ($valid === false) { + return false; + } + return '[' . $valid . ']'; } // need to do checks on unusual encodings too $ipv4 = $this->ipv4->validate($string, $config, $context); - if ($ipv4 !== false) return $ipv4; + if ($ipv4 !== false) { + return $ipv4; + } // A regular domain name. // This doesn't match I18N domain names, but we don't have proper IRI support, // so force users to insert Punycode. + // There is not a good sense in which underscores should be + // allowed, since it's technically not! (And if you go as + // far to allow everything as specified by the DNS spec... + // well, that's literally everything, modulo some space limits + // for the components and the overall name (which, by the way, + // we are NOT checking!). So we (arbitrarily) decide this: + // let's allow underscores wherever we would have allowed + // hyphens, if they are enabled. This is a pretty good match + // for browser behavior, for example, a large number of browsers + // cannot handle foo_.example.com, but foo_bar.example.com is + // fairly well supported. + $underscore = $config->get('Core.AllowHostnameUnderscore') ? '_' : ''; + // The productions describing this are: $a = '[a-z]'; // alpha $an = '[a-z0-9]'; // alphanum - $and = '[a-z0-9-]'; // alphanum | "-" + $and = "[a-z0-9-$underscore]"; // alphanum | "-" // domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum - $domainlabel = "$an($and*$an)?"; + $domainlabel = "$an($and*$an)?"; // toplabel = alpha | alpha *( alphanum | "-" ) alphanum - $toplabel = "$a($and*$an)?"; + $toplabel = "$a($and*$an)?"; // hostname = *( domainlabel "." ) toplabel [ "." ] if (preg_match("/^($domainlabel\.)*$toplabel\.?$/i", $string)) { return $string; @@ -92,10 +121,8 @@ class HTMLPurifier_AttrDef_URI_Host extends HTMLPurifier_AttrDef // XXX error reporting } } - return false; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv4.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv4.php index ec4cf591b8..30ac16c9e7 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv4.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv4.php @@ -8,32 +8,38 @@ class HTMLPurifier_AttrDef_URI_IPv4 extends HTMLPurifier_AttrDef { /** - * IPv4 regex, protected so that IPv6 can reuse it + * IPv4 regex, protected so that IPv6 can reuse it. + * @type string */ protected $ip4; - public function validate($aIP, $config, $context) { - - if (!$this->ip4) $this->_loadRegex(); - - if (preg_match('#^' . $this->ip4 . '$#s', $aIP)) - { - return $aIP; + /** + * @param string $aIP + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($aIP, $config, $context) + { + if (!$this->ip4) { + $this->_loadRegex(); } + if (preg_match('#^' . $this->ip4 . '$#s', $aIP)) { + return $aIP; + } return false; - } /** * Lazy load function to prevent regex from being stuffed in * cache. */ - protected function _loadRegex() { + protected function _loadRegex() + { $oct = '(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])'; // 0-255 $this->ip4 = "(?:{$oct}\\.{$oct}\\.{$oct}\\.{$oct})"; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php index 9454e9be50..f243793eeb 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php @@ -9,91 +9,81 @@ class HTMLPurifier_AttrDef_URI_IPv6 extends HTMLPurifier_AttrDef_URI_IPv4 { - public function validate($aIP, $config, $context) { - - if (!$this->ip4) $this->_loadRegex(); + /** + * @param string $aIP + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($aIP, $config, $context) + { + if (!$this->ip4) { + $this->_loadRegex(); + } $original = $aIP; $hex = '[0-9a-fA-F]'; $blk = '(?:' . $hex . '{1,4})'; - $pre = '(?:/(?:12[0-8]|1[0-1][0-9]|[1-9][0-9]|[0-9]))'; // /0 - /128 + $pre = '(?:/(?:12[0-8]|1[0-1][0-9]|[1-9][0-9]|[0-9]))'; // /0 - /128 // prefix check - if (strpos($aIP, '/') !== false) - { - if (preg_match('#' . $pre . '$#s', $aIP, $find)) - { - $aIP = substr($aIP, 0, 0-strlen($find[0])); - unset($find); - } - else - { - return false; - } + if (strpos($aIP, '/') !== false) { + if (preg_match('#' . $pre . '$#s', $aIP, $find)) { + $aIP = substr($aIP, 0, 0 - strlen($find[0])); + unset($find); + } else { + return false; + } } // IPv4-compatiblity check - if (preg_match('#(?<=:'.')' . $this->ip4 . '$#s', $aIP, $find)) - { - $aIP = substr($aIP, 0, 0-strlen($find[0])); - $ip = explode('.', $find[0]); - $ip = array_map('dechex', $ip); - $aIP .= $ip[0] . $ip[1] . ':' . $ip[2] . $ip[3]; - unset($find, $ip); + if (preg_match('#(?<=:' . ')' . $this->ip4 . '$#s', $aIP, $find)) { + $aIP = substr($aIP, 0, 0 - strlen($find[0])); + $ip = explode('.', $find[0]); + $ip = array_map('dechex', $ip); + $aIP .= $ip[0] . $ip[1] . ':' . $ip[2] . $ip[3]; + unset($find, $ip); } // compression check $aIP = explode('::', $aIP); $c = count($aIP); - if ($c > 2) - { + if ($c > 2) { + return false; + } elseif ($c == 2) { + list($first, $second) = $aIP; + $first = explode(':', $first); + $second = explode(':', $second); + + if (count($first) + count($second) > 8) { return false; - } - elseif ($c == 2) - { - list($first, $second) = $aIP; - $first = explode(':', $first); - $second = explode(':', $second); - - if (count($first) + count($second) > 8) - { - return false; - } + } - while(count($first) < 8) - { - array_push($first, '0'); - } + while (count($first) < 8) { + array_push($first, '0'); + } - array_splice($first, 8 - count($second), 8, $second); - $aIP = $first; - unset($first,$second); - } - else - { - $aIP = explode(':', $aIP[0]); + array_splice($first, 8 - count($second), 8, $second); + $aIP = $first; + unset($first, $second); + } else { + $aIP = explode(':', $aIP[0]); } $c = count($aIP); - if ($c != 8) - { - return false; + if ($c != 8) { + return false; } // All the pieces should be 16-bit hex strings. Are they? - foreach ($aIP as $piece) - { - if (!preg_match('#^[0-9a-fA-F]{4}$#s', sprintf('%04s', $piece))) - { - return false; - } + foreach ($aIP as $piece) { + if (!preg_match('#^[0-9a-fA-F]{4}$#s', sprintf('%04s', $piece))) { + return false; + } } - return $original; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform.php index e61d3e01b6..b428331f15 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform.php @@ -20,37 +20,41 @@ abstract class HTMLPurifier_AttrTransform /** * Abstract: makes changes to the attributes dependent on multiple values. * - * @param $attr Assoc array of attributes, usually from + * @param array $attr Assoc array of attributes, usually from * HTMLPurifier_Token_Tag::$attr - * @param $config Mandatory HTMLPurifier_Config object. - * @param $context Mandatory HTMLPurifier_Context object - * @returns Processed attribute array. + * @param HTMLPurifier_Config $config Mandatory HTMLPurifier_Config object. + * @param HTMLPurifier_Context $context Mandatory HTMLPurifier_Context object + * @return array Processed attribute array. */ abstract public function transform($attr, $config, $context); /** * Prepends CSS properties to the style attribute, creating the * attribute if it doesn't exist. - * @param $attr Attribute array to process (passed by reference) - * @param $css CSS to prepend + * @param array &$attr Attribute array to process (passed by reference) + * @param string $css CSS to prepend */ - public function prependCSS(&$attr, $css) { + public function prependCSS(&$attr, $css) + { $attr['style'] = isset($attr['style']) ? $attr['style'] : ''; $attr['style'] = $css . $attr['style']; } /** * Retrieves and removes an attribute - * @param $attr Attribute array to process (passed by reference) - * @param $key Key of attribute to confiscate + * @param array &$attr Attribute array to process (passed by reference) + * @param mixed $key Key of attribute to confiscate + * @return mixed */ - public function confiscateAttr(&$attr, $key) { - if (!isset($attr[$key])) return null; + public function confiscateAttr(&$attr, $key) + { + if (!isset($attr[$key])) { + return null; + } $value = $attr[$key]; unset($attr[$key]); return $value; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Background.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Background.php index 0e1ff24a3e..2f72869a5e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Background.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Background.php @@ -3,21 +3,26 @@ /** * Pre-transform that changes proprietary background attribute to CSS. */ -class HTMLPurifier_AttrTransform_Background extends HTMLPurifier_AttrTransform { - - public function transform($attr, $config, $context) { - - if (!isset($attr['background'])) return $attr; +class HTMLPurifier_AttrTransform_Background extends HTMLPurifier_AttrTransform +{ + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + if (!isset($attr['background'])) { + return $attr; + } $background = $this->confiscateAttr($attr, 'background'); // some validation should happen here $this->prependCSS($attr, "background-image:url($background);"); - return $attr; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php index 4d1a05665e..d66c04a5b8 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php @@ -8,12 +8,20 @@ class HTMLPurifier_AttrTransform_BdoDir extends HTMLPurifier_AttrTransform { - public function transform($attr, $config, $context) { - if (isset($attr['dir'])) return $attr; + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + if (isset($attr['dir'])) { + return $attr; + } $attr['dir'] = $config->get('Attr.DefaultTextDir'); return $attr; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BgColor.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BgColor.php index ad3916bb96..0f51fd2cec 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BgColor.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BgColor.php @@ -3,21 +3,26 @@ /** * Pre-transform that changes deprecated bgcolor attribute to CSS. */ -class HTMLPurifier_AttrTransform_BgColor extends HTMLPurifier_AttrTransform { - - public function transform($attr, $config, $context) { - - if (!isset($attr['bgcolor'])) return $attr; +class HTMLPurifier_AttrTransform_BgColor extends HTMLPurifier_AttrTransform +{ + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + if (!isset($attr['bgcolor'])) { + return $attr; + } $bgcolor = $this->confiscateAttr($attr, 'bgcolor'); // some validation should happen here $this->prependCSS($attr, "background-color:$bgcolor;"); - return $attr; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php index 51159b6715..f25cd01955 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php @@ -3,34 +3,45 @@ /** * Pre-transform that changes converts a boolean attribute to fixed CSS */ -class HTMLPurifier_AttrTransform_BoolToCSS extends HTMLPurifier_AttrTransform { - +class HTMLPurifier_AttrTransform_BoolToCSS extends HTMLPurifier_AttrTransform +{ /** - * Name of boolean attribute that is trigger + * Name of boolean attribute that is trigger. + * @type string */ protected $attr; /** - * CSS declarations to add to style, needs trailing semicolon + * CSS declarations to add to style, needs trailing semicolon. + * @type string */ protected $css; /** - * @param $attr string attribute name to convert from - * @param $css string CSS declarations to add to style (needs semicolon) + * @param string $attr attribute name to convert from + * @param string $css CSS declarations to add to style (needs semicolon) */ - public function __construct($attr, $css) { + public function __construct($attr, $css) + { $this->attr = $attr; - $this->css = $css; + $this->css = $css; } - public function transform($attr, $config, $context) { - if (!isset($attr[$this->attr])) return $attr; + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + if (!isset($attr[$this->attr])) { + return $attr; + } unset($attr[$this->attr]); $this->prependCSS($attr, $this->css); return $attr; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Border.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Border.php index 476b0b079b..057dc017fa 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Border.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Border.php @@ -3,16 +3,24 @@ /** * Pre-transform that changes deprecated border attribute to CSS. */ -class HTMLPurifier_AttrTransform_Border extends HTMLPurifier_AttrTransform { - - public function transform($attr, $config, $context) { - if (!isset($attr['border'])) return $attr; +class HTMLPurifier_AttrTransform_Border extends HTMLPurifier_AttrTransform +{ + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + if (!isset($attr['border'])) { + return $attr; + } $border_width = $this->confiscateAttr($attr, 'border'); // some validation should happen here $this->prependCSS($attr, "border:{$border_width}px solid;"); return $attr; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/EnumToCSS.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/EnumToCSS.php index 2a5b4514ab..7ccd0e3fb7 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/EnumToCSS.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/EnumToCSS.php @@ -4,55 +4,65 @@ * Generic pre-transform that converts an attribute with a fixed number of * values (enumerated) to CSS. */ -class HTMLPurifier_AttrTransform_EnumToCSS extends HTMLPurifier_AttrTransform { - +class HTMLPurifier_AttrTransform_EnumToCSS extends HTMLPurifier_AttrTransform +{ /** - * Name of attribute to transform from + * Name of attribute to transform from. + * @type string */ protected $attr; /** - * Lookup array of attribute values to CSS + * Lookup array of attribute values to CSS. + * @type array */ protected $enumToCSS = array(); /** - * Case sensitivity of the matching + * Case sensitivity of the matching. + * @type bool * @warning Currently can only be guaranteed to work with ASCII * values. */ protected $caseSensitive = false; /** - * @param $attr String attribute name to transform from - * @param $enumToCSS Lookup array of attribute values to CSS - * @param $case_sensitive Boolean case sensitivity indicator, default false + * @param string $attr Attribute name to transform from + * @param array $enum_to_css Lookup array of attribute values to CSS + * @param bool $case_sensitive Case sensitivity indicator, default false */ - public function __construct($attr, $enum_to_css, $case_sensitive = false) { + public function __construct($attr, $enum_to_css, $case_sensitive = false) + { $this->attr = $attr; $this->enumToCSS = $enum_to_css; - $this->caseSensitive = (bool) $case_sensitive; + $this->caseSensitive = (bool)$case_sensitive; } - public function transform($attr, $config, $context) { - - if (!isset($attr[$this->attr])) return $attr; + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + if (!isset($attr[$this->attr])) { + return $attr; + } $value = trim($attr[$this->attr]); unset($attr[$this->attr]); - if (!$this->caseSensitive) $value = strtolower($value); + if (!$this->caseSensitive) { + $value = strtolower($value); + } if (!isset($this->enumToCSS[$value])) { return $attr; } - $this->prependCSS($attr, $this->enumToCSS[$value]); - return $attr; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgRequired.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgRequired.php index 7f0e4b7a59..7df6cb3e1b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgRequired.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgRequired.php @@ -11,11 +11,19 @@ class HTMLPurifier_AttrTransform_ImgRequired extends HTMLPurifier_AttrTransform { - public function transform($attr, $config, $context) { - + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { $src = true; if (!isset($attr['src'])) { - if ($config->get('Core.RemoveInvalidImg')) return $attr; + if ($config->get('Core.RemoveInvalidImg')) { + return $attr; + } $attr['src'] = $config->get('Attr.DefaultInvalidImage'); $src = false; } @@ -25,7 +33,7 @@ class HTMLPurifier_AttrTransform_ImgRequired extends HTMLPurifier_AttrTransform $alt = $config->get('Attr.DefaultImageAlt'); if ($alt === null) { // truncate if the alt is too long - $attr['alt'] = substr(basename($attr['src']),0,40); + $attr['alt'] = substr(basename($attr['src']), 0, 40); } else { $attr['alt'] = $alt; } @@ -33,11 +41,8 @@ class HTMLPurifier_AttrTransform_ImgRequired extends HTMLPurifier_AttrTransform $attr['alt'] = $config->get('Attr.DefaultInvalidImageAlt'); } } - return $attr; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgSpace.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgSpace.php index fd84c10c36..350b3358fc 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgSpace.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ImgSpace.php @@ -3,42 +3,59 @@ /** * Pre-transform that changes deprecated hspace and vspace attributes to CSS */ -class HTMLPurifier_AttrTransform_ImgSpace extends HTMLPurifier_AttrTransform { - +class HTMLPurifier_AttrTransform_ImgSpace extends HTMLPurifier_AttrTransform +{ + /** + * @type string + */ protected $attr; + + /** + * @type array + */ protected $css = array( 'hspace' => array('left', 'right'), 'vspace' => array('top', 'bottom') ); - public function __construct($attr) { + /** + * @param string $attr + */ + public function __construct($attr) + { $this->attr = $attr; if (!isset($this->css[$attr])) { trigger_error(htmlspecialchars($attr) . ' is not valid space attribute'); } } - public function transform($attr, $config, $context) { - - if (!isset($attr[$this->attr])) return $attr; + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + if (!isset($attr[$this->attr])) { + return $attr; + } $width = $this->confiscateAttr($attr, $this->attr); // some validation could happen here - if (!isset($this->css[$this->attr])) return $attr; + if (!isset($this->css[$this->attr])) { + return $attr; + } $style = ''; foreach ($this->css[$this->attr] as $suffix) { $property = "margin-$suffix"; $style .= "$property:{$width}px;"; } - $this->prependCSS($attr, $style); - return $attr; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Input.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Input.php index 16829552d1..3ab47ed8c9 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Input.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Input.php @@ -4,17 +4,31 @@ * Performs miscellaneous cross attribute validation and filtering for * input elements. This is meant to be a post-transform. */ -class HTMLPurifier_AttrTransform_Input extends HTMLPurifier_AttrTransform { - +class HTMLPurifier_AttrTransform_Input extends HTMLPurifier_AttrTransform +{ + /** + * @type HTMLPurifier_AttrDef_HTML_Pixels + */ protected $pixels; - public function __construct() { + public function __construct() + { $this->pixels = new HTMLPurifier_AttrDef_HTML_Pixels(); } - public function transform($attr, $config, $context) { - if (!isset($attr['type'])) $t = 'text'; - else $t = strtolower($attr['type']); + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + if (!isset($attr['type'])) { + $t = 'text'; + } else { + $t = strtolower($attr['type']); + } if (isset($attr['checked']) && $t !== 'radio' && $t !== 'checkbox') { unset($attr['checked']); } @@ -23,8 +37,11 @@ class HTMLPurifier_AttrTransform_Input extends HTMLPurifier_AttrTransform { } if (isset($attr['size']) && $t !== 'text' && $t !== 'password') { $result = $this->pixels->validate($attr['size'], $config, $context); - if ($result === false) unset($attr['size']); - else $attr['size'] = $result; + if ($result === false) { + unset($attr['size']); + } else { + $attr['size'] = $result; + } } if (isset($attr['src']) && $t !== 'image') { unset($attr['src']); @@ -34,7 +51,6 @@ class HTMLPurifier_AttrTransform_Input extends HTMLPurifier_AttrTransform { } return $attr; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Lang.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Lang.php index 5869e7f820..5b0aff0e40 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Lang.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Lang.php @@ -8,9 +8,15 @@ class HTMLPurifier_AttrTransform_Lang extends HTMLPurifier_AttrTransform { - public function transform($attr, $config, $context) { - - $lang = isset($attr['lang']) ? $attr['lang'] : false; + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + $lang = isset($attr['lang']) ? $attr['lang'] : false; $xml_lang = isset($attr['xml:lang']) ? $attr['xml:lang'] : false; if ($lang !== false && $xml_lang === false) { @@ -18,11 +24,8 @@ class HTMLPurifier_AttrTransform_Lang extends HTMLPurifier_AttrTransform } elseif ($xml_lang !== false) { $attr['lang'] = $xml_lang; } - return $attr; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Length.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Length.php index ea2f30473d..853f33549b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Length.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Length.php @@ -6,22 +6,40 @@ class HTMLPurifier_AttrTransform_Length extends HTMLPurifier_AttrTransform { + /** + * @type string + */ protected $name; + + /** + * @type string + */ protected $cssName; - public function __construct($name, $css_name = null) { + public function __construct($name, $css_name = null) + { $this->name = $name; $this->cssName = $css_name ? $css_name : $name; } - public function transform($attr, $config, $context) { - if (!isset($attr[$this->name])) return $attr; + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + if (!isset($attr[$this->name])) { + return $attr; + } $length = $this->confiscateAttr($attr, $this->name); - if(ctype_digit($length)) $length .= 'px'; + if (ctype_digit($length)) { + $length .= 'px'; + } $this->prependCSS($attr, $this->cssName . ":$length;"); return $attr; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Name.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Name.php index 15315bc735..63cce6837a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Name.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Name.php @@ -6,16 +6,28 @@ class HTMLPurifier_AttrTransform_Name extends HTMLPurifier_AttrTransform { - public function transform($attr, $config, $context) { + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { // Abort early if we're using relaxed definition of name - if ($config->get('HTML.Attr.Name.UseCDATA')) return $attr; - if (!isset($attr['name'])) return $attr; + if ($config->get('HTML.Attr.Name.UseCDATA')) { + return $attr; + } + if (!isset($attr['name'])) { + return $attr; + } $id = $this->confiscateAttr($attr, 'name'); - if ( isset($attr['id'])) return $attr; + if (isset($attr['id'])) { + return $attr; + } $attr['id'] = $id; return $attr; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php index a95638c140..36079b786f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php @@ -8,20 +8,34 @@ class HTMLPurifier_AttrTransform_NameSync extends HTMLPurifier_AttrTransform { - public function __construct() { + public function __construct() + { $this->idDef = new HTMLPurifier_AttrDef_HTML_ID(); } - public function transform($attr, $config, $context) { - if (!isset($attr['name'])) return $attr; + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + if (!isset($attr['name'])) { + return $attr; + } $name = $attr['name']; - if (isset($attr['id']) && $attr['id'] === $name) return $attr; + if (isset($attr['id']) && $attr['id'] === $name) { + return $attr; + } $result = $this->idDef->validate($name, $config, $context); - if ($result === false) unset($attr['name']); - else $attr['name'] = $result; + if ($result === false) { + unset($attr['name']); + } else { + $attr['name'] = $result; + } return $attr; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Nofollow.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Nofollow.php index e699c79a87..1057ebee1b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Nofollow.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Nofollow.php @@ -8,14 +8,24 @@ */ class HTMLPurifier_AttrTransform_Nofollow extends HTMLPurifier_AttrTransform { + /** + * @type HTMLPurifier_URIParser + */ private $parser; - public function __construct() { + public function __construct() + { $this->parser = new HTMLPurifier_URIParser(); } - public function transform($attr, $config, $context) { - + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { if (!isset($attr['href'])) { return $attr; } @@ -35,11 +45,8 @@ class HTMLPurifier_AttrTransform_Nofollow extends HTMLPurifier_AttrTransform $attr['rel'] = 'nofollow'; } } - return $attr; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeEmbed.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeEmbed.php index 4da449981f..231c81a3f0 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeEmbed.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeEmbed.php @@ -2,9 +2,19 @@ class HTMLPurifier_AttrTransform_SafeEmbed extends HTMLPurifier_AttrTransform { + /** + * @type string + */ public $name = "SafeEmbed"; - public function transform($attr, $config, $context) { + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { $attr['allowscriptaccess'] = 'never'; $attr['allownetworking'] = 'internal'; $attr['type'] = 'application/x-shockwave-flash'; diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeObject.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeObject.php index 1ed74898ba..d1f3a4d2ed 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeObject.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeObject.php @@ -5,10 +5,22 @@ */ class HTMLPurifier_AttrTransform_SafeObject extends HTMLPurifier_AttrTransform { + /** + * @type string + */ public $name = "SafeObject"; - function transform($attr, $config, $context) { - if (!isset($attr['type'])) $attr['type'] = 'application/x-shockwave-flash'; + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + if (!isset($attr['type'])) { + $attr['type'] = 'application/x-shockwave-flash'; + } return $attr; } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeParam.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeParam.php index bd86a74554..1143b4b493 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeParam.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeParam.php @@ -14,15 +14,30 @@ */ class HTMLPurifier_AttrTransform_SafeParam extends HTMLPurifier_AttrTransform { + /** + * @type string + */ public $name = "SafeParam"; + + /** + * @type HTMLPurifier_AttrDef_URI + */ private $uri; - public function __construct() { + public function __construct() + { $this->uri = new HTMLPurifier_AttrDef_URI(true); // embedded $this->wmode = new HTMLPurifier_AttrDef_Enum(array('window', 'opaque', 'transparent')); } - public function transform($attr, $config, $context) { + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { // If we add support for other objects, we'll need to alter the // transforms. switch ($attr['name']) { diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ScriptRequired.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ScriptRequired.php index 4499050a22..b7057bbf8e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ScriptRequired.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ScriptRequired.php @@ -5,7 +5,14 @@ */ class HTMLPurifier_AttrTransform_ScriptRequired extends HTMLPurifier_AttrTransform { - public function transform($attr, $config, $context) { + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { if (!isset($attr['type'])) { $attr['type'] = 'text/javascript'; } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetBlank.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetBlank.php index deba8b40fd..dd63ea89cb 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetBlank.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetBlank.php @@ -9,14 +9,24 @@ */ class HTMLPurifier_AttrTransform_TargetBlank extends HTMLPurifier_AttrTransform { + /** + * @type HTMLPurifier_URIParser + */ private $parser; - public function __construct() { + public function __construct() + { $this->parser = new HTMLPurifier_URIParser(); } - public function transform($attr, $config, $context) { - + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { if (!isset($attr['href'])) { return $attr; } @@ -28,11 +38,8 @@ class HTMLPurifier_AttrTransform_TargetBlank extends HTMLPurifier_AttrTransform if ($scheme->browsable && !$url->isBenign($config, $context)) { $attr['target'] = '_blank'; } - return $attr; - } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Textarea.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Textarea.php index 81ac3488ba..6a9f33a0c8 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Textarea.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Textarea.php @@ -5,14 +5,23 @@ */ class HTMLPurifier_AttrTransform_Textarea extends HTMLPurifier_AttrTransform { - - public function transform($attr, $config, $context) { + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { // Calculated from Firefox - if (!isset($attr['cols'])) $attr['cols'] = '22'; - if (!isset($attr['rows'])) $attr['rows'] = '3'; + if (!isset($attr['cols'])) { + $attr['cols'] = '22'; + } + if (!isset($attr['rows'])) { + $attr['rows'] = '3'; + } return $attr; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php index 6f985ff934..3b70520b6a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php @@ -6,7 +6,8 @@ class HTMLPurifier_AttrTypes { /** - * Lookup array of attribute string identifiers to concrete implementations + * Lookup array of attribute string identifiers to concrete implementations. + * @type HTMLPurifier_AttrDef[] */ protected $info = array(); @@ -14,7 +15,8 @@ class HTMLPurifier_AttrTypes * Constructs the info array, supplying default implementations for attribute * types. */ - public function __construct() { + public function __construct() + { // XXX This is kind of poor, since we don't actually /clone/ // instances; instead, we use the supplied make() attribute. So, // the underlying class must know how to deal with arguments. @@ -54,36 +56,39 @@ class HTMLPurifier_AttrTypes $this->info['Number'] = new HTMLPurifier_AttrDef_Integer(false, false, true); } - private static function makeEnum($in) { + private static function makeEnum($in) + { return new HTMLPurifier_AttrDef_Clone(new HTMLPurifier_AttrDef_Enum(explode(',', $in))); } /** * Retrieves a type - * @param $type String type name - * @return Object AttrDef for type + * @param string $type String type name + * @return HTMLPurifier_AttrDef Object AttrDef for type */ - public function get($type) { - + public function get($type) + { // determine if there is any extra info tacked on - if (strpos($type, '#') !== false) list($type, $string) = explode('#', $type, 2); - else $string = ''; + if (strpos($type, '#') !== false) { + list($type, $string) = explode('#', $type, 2); + } else { + $string = ''; + } if (!isset($this->info[$type])) { trigger_error('Cannot retrieve undefined attribute type ' . $type, E_USER_ERROR); return; } - return $this->info[$type]->make($string); - } /** * Sets a new implementation for a type - * @param $type String type name - * @param $impl Object AttrDef for type + * @param string $type String type name + * @param HTMLPurifier_AttrDef $impl Object AttrDef for type */ - public function set($type, $impl) { + public function set($type, $impl) + { $this->info[$type] = $impl; } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrValidator.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrValidator.php index 829a0f8f22..f97dc93edd 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrValidator.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrValidator.php @@ -9,17 +9,14 @@ class HTMLPurifier_AttrValidator { /** - * Validates the attributes of a token, returning a modified token + * Validates the attributes of a token, mutating it as necessary. * that has valid tokens - * @param $token Reference to token to validate. We require a reference - * because the operation this class performs on the token are - * not atomic, so the context CurrentToken to be updated - * throughout - * @param $config Instance of HTMLPurifier_Config - * @param $context Instance of HTMLPurifier_Context + * @param HTMLPurifier_Token $token Token to validate. + * @param HTMLPurifier_Config $config Instance of HTMLPurifier_Config + * @param HTMLPurifier_Context $context Instance of HTMLPurifier_Context */ - public function validateToken(&$token, &$config, $context) { - + public function validateToken($token, $config, $context) + { $definition = $config->getHTMLDefinition(); $e =& $context->get('ErrorCollector', true); @@ -32,12 +29,15 @@ class HTMLPurifier_AttrValidator // initialize CurrentToken if necessary $current_token =& $context->get('CurrentToken', true); - if (!$current_token) $context->register('CurrentToken', $token); + if (!$current_token) { + $context->register('CurrentToken', $token); + } - if ( - !$token instanceof HTMLPurifier_Token_Start && + if (!$token instanceof HTMLPurifier_Token_Start && !$token instanceof HTMLPurifier_Token_Empty - ) return $token; + ) { + return; + } // create alias to global definition array, see also $defs // DEFINITION CALL @@ -51,7 +51,9 @@ class HTMLPurifier_AttrValidator foreach ($definition->info_attr_transform_pre as $transform) { $attr = $transform->transform($o = $attr, $config, $context); if ($e) { - if ($attr != $o) $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); + if ($attr != $o) { + $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); + } } } @@ -60,7 +62,9 @@ class HTMLPurifier_AttrValidator foreach ($definition->info[$token->name]->attr_transform_pre as $transform) { $attr = $transform->transform($o = $attr, $config, $context); if ($e) { - if ($attr != $o) $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); + if ($attr != $o) { + $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); + } } } @@ -77,7 +81,7 @@ class HTMLPurifier_AttrValidator foreach ($attr as $attr_key => $value) { // call the definition - if ( isset($defs[$attr_key]) ) { + if (isset($defs[$attr_key])) { // there is a local definition defined if ($defs[$attr_key] === false) { // We've explicitly been told not to allow this element. @@ -89,15 +93,19 @@ class HTMLPurifier_AttrValidator } else { // validate according to the element's definition $result = $defs[$attr_key]->validate( - $value, $config, $context - ); + $value, + $config, + $context + ); } - } elseif ( isset($d_defs[$attr_key]) ) { + } elseif (isset($d_defs[$attr_key])) { // there is a global definition defined, validate according // to the global definition $result = $d_defs[$attr_key]->validate( - $value, $config, $context - ); + $value, + $config, + $context + ); } else { // system never heard of the attribute? DELETE! $result = false; @@ -107,7 +115,9 @@ class HTMLPurifier_AttrValidator if ($result === false || $result === null) { // this is a generic error message that should replaced // with more specific ones when possible - if ($e) $e->send(E_ERROR, 'AttrValidator: Attribute removed'); + if ($e) { + $e->send(E_ERROR, 'AttrValidator: Attribute removed'); + } // remove the attribute unset($attr[$attr_key]); @@ -137,7 +147,9 @@ class HTMLPurifier_AttrValidator foreach ($definition->info_attr_transform_post as $transform) { $attr = $transform->transform($o = $attr, $config, $context); if ($e) { - if ($attr != $o) $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); + if ($attr != $o) { + $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); + } } } @@ -145,14 +157,18 @@ class HTMLPurifier_AttrValidator foreach ($definition->info[$token->name]->attr_transform_post as $transform) { $attr = $transform->transform($o = $attr, $config, $context); if ($e) { - if ($attr != $o) $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); + if ($attr != $o) { + $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); + } } } $token->attr = $attr; // destroy CurrentToken if we made it ourselves - if (!$current_token) $context->destroy('CurrentToken'); + if (!$current_token) { + $context->destroy('CurrentToken'); + } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Bootstrap.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Bootstrap.php index ae50332031..707122bb29 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Bootstrap.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Bootstrap.php @@ -32,11 +32,15 @@ class HTMLPurifier_Bootstrap /** * Autoload function for HTML Purifier - * @param $class Class to load + * @param string $class Class to load + * @return bool */ - public static function autoload($class) { + public static function autoload($class) + { $file = HTMLPurifier_Bootstrap::getPath($class); - if (!$file) return false; + if (!$file) { + return false; + } // Technically speaking, it should be ok and more efficient to // just do 'require', but Antonio Parraga reports that with // Zend extensions such as Zend debugger and APC, this invariant @@ -48,9 +52,14 @@ class HTMLPurifier_Bootstrap /** * Returns the path for a specific class. + * @param string $class Class path to get + * @return string */ - public static function getPath($class) { - if (strncmp('HTMLPurifier', $class, 12) !== 0) return false; + public static function getPath($class) + { + if (strncmp('HTMLPurifier', $class, 12) !== 0) { + return false; + } // Custom implementations if (strncmp('HTMLPurifier_Language_', $class, 22) === 0) { $code = str_replace('_', '-', substr($class, 22)); @@ -58,16 +67,19 @@ class HTMLPurifier_Bootstrap } else { $file = str_replace('_', '/', $class) . '.php'; } - if (!file_exists(HTMLPURIFIER_PREFIX . '/' . $file)) return false; + if (!file_exists(HTMLPURIFIER_PREFIX . '/' . $file)) { + return false; + } return $file; } /** * "Pre-registers" our autoloader on the SPL stack. */ - public static function registerAutoload() { + public static function registerAutoload() + { $autoload = array('HTMLPurifier_Bootstrap', 'autoload'); - if ( ($funcs = spl_autoload_functions()) === false ) { + if (($funcs = spl_autoload_functions()) === false) { spl_autoload_register($autoload); } elseif (function_exists('spl_autoload_unregister')) { if (version_compare(PHP_VERSION, '5.3.0', '>=')) { @@ -83,27 +95,30 @@ class HTMLPurifier_Bootstrap // places where we need to error out $reflector = new ReflectionMethod($func[0], $func[1]); if (!$reflector->isStatic()) { - throw new Exception(' - HTML Purifier autoloader registrar is not compatible + throw new Exception( + 'HTML Purifier autoloader registrar is not compatible with non-static object methods due to PHP Bug #44144; Please do not use HTMLPurifier.autoload.php (or any file that includes this file); instead, place the code: spl_autoload_register(array(\'HTMLPurifier_Bootstrap\', \'autoload\')) - after your own autoloaders. - '); + after your own autoloaders.' + ); } // Suprisingly, spl_autoload_register supports the // Class::staticMethod callback format, although call_user_func doesn't - if ($compat) $func = implode('::', $func); + if ($compat) { + $func = implode('::', $func); + } } spl_autoload_unregister($func); } spl_autoload_register($autoload); - foreach ($funcs as $func) spl_autoload_register($func); + foreach ($funcs as $func) { + spl_autoload_register($func); + } } } } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php index 8c4c3127bc..0acdee2d96 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php @@ -11,35 +11,59 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition /** * Assoc array of attribute name to definition object. + * @type HTMLPurifier_AttrDef[] */ public $info = array(); /** * Constructs the info array. The meat of this class. + * @param HTMLPurifier_Config $config */ - protected function doSetup($config) { - + protected function doSetup($config) + { $this->info['text-align'] = new HTMLPurifier_AttrDef_Enum( - array('left', 'right', 'center', 'justify'), false); + array('left', 'right', 'center', 'justify'), + false + ); $border_style = - $this->info['border-bottom-style'] = - $this->info['border-right-style'] = - $this->info['border-left-style'] = - $this->info['border-top-style'] = new HTMLPurifier_AttrDef_Enum( - array('none', 'hidden', 'dotted', 'dashed', 'solid', 'double', - 'groove', 'ridge', 'inset', 'outset'), false); + $this->info['border-bottom-style'] = + $this->info['border-right-style'] = + $this->info['border-left-style'] = + $this->info['border-top-style'] = new HTMLPurifier_AttrDef_Enum( + array( + 'none', + 'hidden', + 'dotted', + 'dashed', + 'solid', + 'double', + 'groove', + 'ridge', + 'inset', + 'outset' + ), + false + ); $this->info['border-style'] = new HTMLPurifier_AttrDef_CSS_Multiple($border_style); $this->info['clear'] = new HTMLPurifier_AttrDef_Enum( - array('none', 'left', 'right', 'both'), false); + array('none', 'left', 'right', 'both'), + false + ); $this->info['float'] = new HTMLPurifier_AttrDef_Enum( - array('none', 'left', 'right'), false); + array('none', 'left', 'right'), + false + ); $this->info['font-style'] = new HTMLPurifier_AttrDef_Enum( - array('normal', 'italic', 'oblique'), false); + array('normal', 'italic', 'oblique'), + false + ); $this->info['font-variant'] = new HTMLPurifier_AttrDef_Enum( - array('normal', 'small-caps'), false); + array('normal', 'small-caps'), + false + ); $uri_or_none = new HTMLPurifier_AttrDef_CSS_Composite( array( @@ -49,16 +73,31 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition ); $this->info['list-style-position'] = new HTMLPurifier_AttrDef_Enum( - array('inside', 'outside'), false); + array('inside', 'outside'), + false + ); $this->info['list-style-type'] = new HTMLPurifier_AttrDef_Enum( - array('disc', 'circle', 'square', 'decimal', 'lower-roman', - 'upper-roman', 'lower-alpha', 'upper-alpha', 'none'), false); + array( + 'disc', + 'circle', + 'square', + 'decimal', + 'lower-roman', + 'upper-roman', + 'lower-alpha', + 'upper-alpha', + 'none' + ), + false + ); $this->info['list-style-image'] = $uri_or_none; $this->info['list-style'] = new HTMLPurifier_AttrDef_CSS_ListStyle($config); $this->info['text-transform'] = new HTMLPurifier_AttrDef_Enum( - array('capitalize', 'uppercase', 'lowercase', 'none'), false); + array('capitalize', 'uppercase', 'lowercase', 'none'), + false + ); $this->info['color'] = new HTMLPurifier_AttrDef_CSS_Color(); $this->info['background-image'] = $uri_or_none; @@ -71,104 +110,137 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition $this->info['background-position'] = new HTMLPurifier_AttrDef_CSS_BackgroundPosition(); $border_color = - $this->info['border-top-color'] = - $this->info['border-bottom-color'] = - $this->info['border-left-color'] = - $this->info['border-right-color'] = - $this->info['background-color'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('transparent')), - new HTMLPurifier_AttrDef_CSS_Color() - )); + $this->info['border-top-color'] = + $this->info['border-bottom-color'] = + $this->info['border-left-color'] = + $this->info['border-right-color'] = + $this->info['background-color'] = new HTMLPurifier_AttrDef_CSS_Composite( + array( + new HTMLPurifier_AttrDef_Enum(array('transparent')), + new HTMLPurifier_AttrDef_CSS_Color() + ) + ); $this->info['background'] = new HTMLPurifier_AttrDef_CSS_Background($config); $this->info['border-color'] = new HTMLPurifier_AttrDef_CSS_Multiple($border_color); $border_width = - $this->info['border-top-width'] = - $this->info['border-bottom-width'] = - $this->info['border-left-width'] = - $this->info['border-right-width'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('thin', 'medium', 'thick')), - new HTMLPurifier_AttrDef_CSS_Length('0') //disallow negative - )); + $this->info['border-top-width'] = + $this->info['border-bottom-width'] = + $this->info['border-left-width'] = + $this->info['border-right-width'] = new HTMLPurifier_AttrDef_CSS_Composite( + array( + new HTMLPurifier_AttrDef_Enum(array('thin', 'medium', 'thick')), + new HTMLPurifier_AttrDef_CSS_Length('0') //disallow negative + ) + ); $this->info['border-width'] = new HTMLPurifier_AttrDef_CSS_Multiple($border_width); - $this->info['letter-spacing'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('normal')), - new HTMLPurifier_AttrDef_CSS_Length() - )); - - $this->info['word-spacing'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('normal')), - new HTMLPurifier_AttrDef_CSS_Length() - )); - - $this->info['font-size'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('xx-small', 'x-small', - 'small', 'medium', 'large', 'x-large', 'xx-large', - 'larger', 'smaller')), - new HTMLPurifier_AttrDef_CSS_Percentage(), - new HTMLPurifier_AttrDef_CSS_Length() - )); - - $this->info['line-height'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('normal')), - new HTMLPurifier_AttrDef_CSS_Number(true), // no negatives - new HTMLPurifier_AttrDef_CSS_Length('0'), - new HTMLPurifier_AttrDef_CSS_Percentage(true) - )); + $this->info['letter-spacing'] = new HTMLPurifier_AttrDef_CSS_Composite( + array( + new HTMLPurifier_AttrDef_Enum(array('normal')), + new HTMLPurifier_AttrDef_CSS_Length() + ) + ); + + $this->info['word-spacing'] = new HTMLPurifier_AttrDef_CSS_Composite( + array( + new HTMLPurifier_AttrDef_Enum(array('normal')), + new HTMLPurifier_AttrDef_CSS_Length() + ) + ); + + $this->info['font-size'] = new HTMLPurifier_AttrDef_CSS_Composite( + array( + new HTMLPurifier_AttrDef_Enum( + array( + 'xx-small', + 'x-small', + 'small', + 'medium', + 'large', + 'x-large', + 'xx-large', + 'larger', + 'smaller' + ) + ), + new HTMLPurifier_AttrDef_CSS_Percentage(), + new HTMLPurifier_AttrDef_CSS_Length() + ) + ); + + $this->info['line-height'] = new HTMLPurifier_AttrDef_CSS_Composite( + array( + new HTMLPurifier_AttrDef_Enum(array('normal')), + new HTMLPurifier_AttrDef_CSS_Number(true), // no negatives + new HTMLPurifier_AttrDef_CSS_Length('0'), + new HTMLPurifier_AttrDef_CSS_Percentage(true) + ) + ); $margin = - $this->info['margin-top'] = - $this->info['margin-bottom'] = - $this->info['margin-left'] = - $this->info['margin-right'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_CSS_Length(), - new HTMLPurifier_AttrDef_CSS_Percentage(), - new HTMLPurifier_AttrDef_Enum(array('auto')) - )); + $this->info['margin-top'] = + $this->info['margin-bottom'] = + $this->info['margin-left'] = + $this->info['margin-right'] = new HTMLPurifier_AttrDef_CSS_Composite( + array( + new HTMLPurifier_AttrDef_CSS_Length(), + new HTMLPurifier_AttrDef_CSS_Percentage(), + new HTMLPurifier_AttrDef_Enum(array('auto')) + ) + ); $this->info['margin'] = new HTMLPurifier_AttrDef_CSS_Multiple($margin); // non-negative $padding = - $this->info['padding-top'] = - $this->info['padding-bottom'] = - $this->info['padding-left'] = - $this->info['padding-right'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_CSS_Length('0'), - new HTMLPurifier_AttrDef_CSS_Percentage(true) - )); + $this->info['padding-top'] = + $this->info['padding-bottom'] = + $this->info['padding-left'] = + $this->info['padding-right'] = new HTMLPurifier_AttrDef_CSS_Composite( + array( + new HTMLPurifier_AttrDef_CSS_Length('0'), + new HTMLPurifier_AttrDef_CSS_Percentage(true) + ) + ); $this->info['padding'] = new HTMLPurifier_AttrDef_CSS_Multiple($padding); - $this->info['text-indent'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_CSS_Length(), - new HTMLPurifier_AttrDef_CSS_Percentage() - )); + $this->info['text-indent'] = new HTMLPurifier_AttrDef_CSS_Composite( + array( + new HTMLPurifier_AttrDef_CSS_Length(), + new HTMLPurifier_AttrDef_CSS_Percentage() + ) + ); - $trusted_wh = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_CSS_Length('0'), - new HTMLPurifier_AttrDef_CSS_Percentage(true), - new HTMLPurifier_AttrDef_Enum(array('auto')) - )); + $trusted_wh = new HTMLPurifier_AttrDef_CSS_Composite( + array( + new HTMLPurifier_AttrDef_CSS_Length('0'), + new HTMLPurifier_AttrDef_CSS_Percentage(true), + new HTMLPurifier_AttrDef_Enum(array('auto')) + ) + ); $max = $config->get('CSS.MaxImgLength'); $this->info['width'] = $this->info['height'] = $max === null ? - $trusted_wh : - new HTMLPurifier_AttrDef_Switch('img', - // For img tags: - new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_CSS_Length('0', $max), - new HTMLPurifier_AttrDef_Enum(array('auto')) - )), - // For everyone else: - $trusted_wh - ); + $trusted_wh : + new HTMLPurifier_AttrDef_Switch( + 'img', + // For img tags: + new HTMLPurifier_AttrDef_CSS_Composite( + array( + new HTMLPurifier_AttrDef_CSS_Length('0', $max), + new HTMLPurifier_AttrDef_Enum(array('auto')) + ) + ), + // For everyone else: + $trusted_wh + ); $this->info['text-decoration'] = new HTMLPurifier_AttrDef_CSS_TextDecoration(); @@ -176,8 +248,23 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition // this could use specialized code $this->info['font-weight'] = new HTMLPurifier_AttrDef_Enum( - array('normal', 'bold', 'bolder', 'lighter', '100', '200', '300', - '400', '500', '600', '700', '800', '900'), false); + array( + 'normal', + 'bold', + 'bolder', + 'lighter', + '100', + '200', + '300', + '400', + '500', + '600', + '700', + '800', + '900' + ), + false + ); // MUST be called after other font properties, as it references // a CSSDefinition object @@ -190,27 +277,44 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition $this->info['border-left'] = $this->info['border-right'] = new HTMLPurifier_AttrDef_CSS_Border($config); - $this->info['border-collapse'] = new HTMLPurifier_AttrDef_Enum(array( - 'collapse', 'separate')); + $this->info['border-collapse'] = new HTMLPurifier_AttrDef_Enum( + array('collapse', 'separate') + ); - $this->info['caption-side'] = new HTMLPurifier_AttrDef_Enum(array( - 'top', 'bottom')); + $this->info['caption-side'] = new HTMLPurifier_AttrDef_Enum( + array('top', 'bottom') + ); - $this->info['table-layout'] = new HTMLPurifier_AttrDef_Enum(array( - 'auto', 'fixed')); + $this->info['table-layout'] = new HTMLPurifier_AttrDef_Enum( + array('auto', 'fixed') + ); - $this->info['vertical-align'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('baseline', 'sub', 'super', - 'top', 'text-top', 'middle', 'bottom', 'text-bottom')), - new HTMLPurifier_AttrDef_CSS_Length(), - new HTMLPurifier_AttrDef_CSS_Percentage() - )); + $this->info['vertical-align'] = new HTMLPurifier_AttrDef_CSS_Composite( + array( + new HTMLPurifier_AttrDef_Enum( + array( + 'baseline', + 'sub', + 'super', + 'top', + 'text-top', + 'middle', + 'bottom', + 'text-bottom' + ) + ), + new HTMLPurifier_AttrDef_CSS_Length(), + new HTMLPurifier_AttrDef_CSS_Percentage() + ) + ); $this->info['border-spacing'] = new HTMLPurifier_AttrDef_CSS_Multiple(new HTMLPurifier_AttrDef_CSS_Length(), 2); // These CSS properties don't work on many browsers, but we live // in THE FUTURE! - $this->info['white-space'] = new HTMLPurifier_AttrDef_Enum(array('nowrap', 'normal', 'pre', 'pre-wrap', 'pre-line')); + $this->info['white-space'] = new HTMLPurifier_AttrDef_Enum( + array('nowrap', 'normal', 'pre', 'pre-wrap', 'pre-line') + ); if ($config->get('CSS.Proprietary')) { $this->doSetupProprietary($config); @@ -233,76 +337,119 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition $this->setupConfigStuff($config); } - protected function doSetupProprietary($config) { + /** + * @param HTMLPurifier_Config $config + */ + protected function doSetupProprietary($config) + { // Internet Explorer only scrollbar colors - $this->info['scrollbar-arrow-color'] = new HTMLPurifier_AttrDef_CSS_Color(); - $this->info['scrollbar-base-color'] = new HTMLPurifier_AttrDef_CSS_Color(); - $this->info['scrollbar-darkshadow-color'] = new HTMLPurifier_AttrDef_CSS_Color(); - $this->info['scrollbar-face-color'] = new HTMLPurifier_AttrDef_CSS_Color(); - $this->info['scrollbar-highlight-color'] = new HTMLPurifier_AttrDef_CSS_Color(); - $this->info['scrollbar-shadow-color'] = new HTMLPurifier_AttrDef_CSS_Color(); + $this->info['scrollbar-arrow-color'] = new HTMLPurifier_AttrDef_CSS_Color(); + $this->info['scrollbar-base-color'] = new HTMLPurifier_AttrDef_CSS_Color(); + $this->info['scrollbar-darkshadow-color'] = new HTMLPurifier_AttrDef_CSS_Color(); + $this->info['scrollbar-face-color'] = new HTMLPurifier_AttrDef_CSS_Color(); + $this->info['scrollbar-highlight-color'] = new HTMLPurifier_AttrDef_CSS_Color(); + $this->info['scrollbar-shadow-color'] = new HTMLPurifier_AttrDef_CSS_Color(); // technically not proprietary, but CSS3, and no one supports it - $this->info['opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue(); - $this->info['-moz-opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue(); - $this->info['-khtml-opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue(); + $this->info['opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue(); + $this->info['-moz-opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue(); + $this->info['-khtml-opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue(); // only opacity, for now $this->info['filter'] = new HTMLPurifier_AttrDef_CSS_Filter(); // more CSS3 $this->info['page-break-after'] = - $this->info['page-break-before'] = new HTMLPurifier_AttrDef_Enum(array('auto','always','avoid','left','right')); - $this->info['page-break-inside'] = new HTMLPurifier_AttrDef_Enum(array('auto','avoid')); + $this->info['page-break-before'] = new HTMLPurifier_AttrDef_Enum( + array( + 'auto', + 'always', + 'avoid', + 'left', + 'right' + ) + ); + $this->info['page-break-inside'] = new HTMLPurifier_AttrDef_Enum(array('auto', 'avoid')); } - protected function doSetupTricky($config) { - $this->info['display'] = new HTMLPurifier_AttrDef_Enum(array( - 'inline', 'block', 'list-item', 'run-in', 'compact', - 'marker', 'table', 'inline-block', 'inline-table', 'table-row-group', - 'table-header-group', 'table-footer-group', 'table-row', - 'table-column-group', 'table-column', 'table-cell', 'table-caption', 'none' - )); - $this->info['visibility'] = new HTMLPurifier_AttrDef_Enum(array( - 'visible', 'hidden', 'collapse' - )); + /** + * @param HTMLPurifier_Config $config + */ + protected function doSetupTricky($config) + { + $this->info['display'] = new HTMLPurifier_AttrDef_Enum( + array( + 'inline', + 'block', + 'list-item', + 'run-in', + 'compact', + 'marker', + 'table', + 'inline-block', + 'inline-table', + 'table-row-group', + 'table-header-group', + 'table-footer-group', + 'table-row', + 'table-column-group', + 'table-column', + 'table-cell', + 'table-caption', + 'none' + ) + ); + $this->info['visibility'] = new HTMLPurifier_AttrDef_Enum( + array('visible', 'hidden', 'collapse') + ); $this->info['overflow'] = new HTMLPurifier_AttrDef_Enum(array('visible', 'hidden', 'auto', 'scroll')); } - protected function doSetupTrusted($config) { - $this->info['position'] = new HTMLPurifier_AttrDef_Enum(array( - 'static', 'relative', 'absolute', 'fixed' - )); + /** + * @param HTMLPurifier_Config $config + */ + protected function doSetupTrusted($config) + { + $this->info['position'] = new HTMLPurifier_AttrDef_Enum( + array('static', 'relative', 'absolute', 'fixed') + ); $this->info['top'] = $this->info['left'] = $this->info['right'] = - $this->info['bottom'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_CSS_Length(), - new HTMLPurifier_AttrDef_CSS_Percentage(), - new HTMLPurifier_AttrDef_Enum(array('auto')), - )); - $this->info['z-index'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Integer(), - new HTMLPurifier_AttrDef_Enum(array('auto')), - )); + $this->info['bottom'] = new HTMLPurifier_AttrDef_CSS_Composite( + array( + new HTMLPurifier_AttrDef_CSS_Length(), + new HTMLPurifier_AttrDef_CSS_Percentage(), + new HTMLPurifier_AttrDef_Enum(array('auto')), + ) + ); + $this->info['z-index'] = new HTMLPurifier_AttrDef_CSS_Composite( + array( + new HTMLPurifier_AttrDef_Integer(), + new HTMLPurifier_AttrDef_Enum(array('auto')), + ) + ); } /** * Performs extra config-based processing. Based off of * HTMLPurifier_HTMLDefinition. + * @param HTMLPurifier_Config $config * @todo Refactor duplicate elements into common class (probably using * composition, not inheritance). */ - protected function setupConfigStuff($config) { - + protected function setupConfigStuff($config) + { // setup allowed elements - $support = "(for information on implementing this, see the ". - "support forums) "; + $support = "(for information on implementing this, see the " . + "support forums) "; $allowed_properties = $config->get('CSS.AllowedProperties'); if ($allowed_properties !== null) { foreach ($this->info as $name => $d) { - if(!isset($allowed_properties[$name])) unset($this->info[$name]); + if (!isset($allowed_properties[$name])) { + unset($this->info[$name]); + } unset($allowed_properties[$name]); } // emit errors @@ -321,7 +468,6 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition } } } - } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef.php index c5d5216dab..8eb17b82e1 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef.php @@ -1,48 +1,52 @@ elements; } /** * Validates nodes according to definition and returns modification. * - * @param $tokens_of_children Array of HTMLPurifier_Token - * @param $config HTMLPurifier_Config object - * @param $context HTMLPurifier_Context object - * @return bool true to leave nodes as is - * @return bool false to remove parent node - * @return array of replacement child tokens + * @param HTMLPurifier_Node[] $children Array of HTMLPurifier_Node + * @param HTMLPurifier_Config $config HTMLPurifier_Config object + * @param HTMLPurifier_Context $context HTMLPurifier_Context object + * @return bool|array true to leave nodes as is, false to remove parent node, array of replacement children */ - abstract public function validateChildren($tokens_of_children, $config, $context); + abstract public function validateChildren($children, $config, $context); } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Chameleon.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Chameleon.php index 15c364ee33..7439be26b6 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Chameleon.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Chameleon.php @@ -14,33 +14,52 @@ class HTMLPurifier_ChildDef_Chameleon extends HTMLPurifier_ChildDef /** * Instance of the definition object to use when inline. Usually stricter. + * @type HTMLPurifier_ChildDef_Optional */ public $inline; /** * Instance of the definition object to use when block. + * @type HTMLPurifier_ChildDef_Optional */ public $block; + /** + * @type string + */ public $type = 'chameleon'; /** - * @param $inline List of elements to allow when inline. - * @param $block List of elements to allow when block. + * @param array $inline List of elements to allow when inline. + * @param array $block List of elements to allow when block. */ - public function __construct($inline, $block) { + public function __construct($inline, $block) + { $this->inline = new HTMLPurifier_ChildDef_Optional($inline); - $this->block = new HTMLPurifier_ChildDef_Optional($block); + $this->block = new HTMLPurifier_ChildDef_Optional($block); $this->elements = $this->block->elements; } - public function validateChildren($tokens_of_children, $config, $context) { + /** + * @param HTMLPurifier_Node[] $children + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function validateChildren($children, $config, $context) + { if ($context->get('IsInline') === false) { return $this->block->validateChildren( - $tokens_of_children, $config, $context); + $children, + $config, + $context + ); } else { return $this->inline->validateChildren( - $tokens_of_children, $config, $context); + $children, + $config, + $context + ); } } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Custom.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Custom.php index b68047b4b5..128132e96d 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Custom.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Custom.php @@ -8,28 +8,42 @@ */ class HTMLPurifier_ChildDef_Custom extends HTMLPurifier_ChildDef { + /** + * @type string + */ public $type = 'custom'; + + /** + * @type bool + */ public $allow_empty = false; + /** - * Allowed child pattern as defined by the DTD + * Allowed child pattern as defined by the DTD. + * @type string */ public $dtd_regex; + /** - * PCRE regex derived from $dtd_regex - * @private + * PCRE regex derived from $dtd_regex. + * @type string */ private $_pcre_regex; + /** * @param $dtd_regex Allowed child pattern from the DTD */ - public function __construct($dtd_regex) { + public function __construct($dtd_regex) + { $this->dtd_regex = $dtd_regex; $this->_compileRegex(); } + /** * Compiles the PCRE regex from a DTD regex ($dtd_regex to $_pcre_regex) */ - protected function _compileRegex() { + protected function _compileRegex() + { $raw = str_replace(' ', '', $this->dtd_regex); if ($raw{0} != '(') { $raw = "($raw)"; @@ -57,33 +71,31 @@ class HTMLPurifier_ChildDef_Custom extends HTMLPurifier_ChildDef $this->_pcre_regex = $reg; } - public function validateChildren($tokens_of_children, $config, $context) { + + /** + * @param HTMLPurifier_Node[] $children + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function validateChildren($children, $config, $context) + { $list_of_children = ''; $nesting = 0; // depth into the nest - foreach ($tokens_of_children as $token) { - if (!empty($token->is_whitespace)) continue; - - $is_child = ($nesting == 0); // direct - - if ($token instanceof HTMLPurifier_Token_Start) { - $nesting++; - } elseif ($token instanceof HTMLPurifier_Token_End) { - $nesting--; - } - - if ($is_child) { - $list_of_children .= $token->name . ','; + foreach ($children as $node) { + if (!empty($node->is_whitespace)) { + continue; } + $list_of_children .= $node->name . ','; } // add leading comma to deal with stray comma declarations $list_of_children = ',' . rtrim($list_of_children, ','); $okay = preg_match( - '/^,?'.$this->_pcre_regex.'$/', + '/^,?' . $this->_pcre_regex . '$/', $list_of_children ); - - return (bool) $okay; + return (bool)$okay; } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Empty.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Empty.php index 13171f6651..a8a6cbdd2c 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Empty.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Empty.php @@ -9,10 +9,28 @@ */ class HTMLPurifier_ChildDef_Empty extends HTMLPurifier_ChildDef { + /** + * @type bool + */ public $allow_empty = true; + + /** + * @type string + */ public $type = 'empty'; - public function __construct() {} - public function validateChildren($tokens_of_children, $config, $context) { + + public function __construct() + { + } + + /** + * @param HTMLPurifier_Node[] $children + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function validateChildren($children, $config, $context) + { return array(); } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/List.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/List.php index cdaa2893a7..891b9f6f5b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/List.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/List.php @@ -2,117 +2,83 @@ /** * Definition for list containers ul and ol. + * + * What does this do? The big thing is to handle ol/ul at the top + * level of list nodes, which should be handled specially by /folding/ + * them into the previous list node. We generally shouldn't ever + * see other disallowed elements, because the autoclose behavior + * in MakeWellFormed handles it. */ class HTMLPurifier_ChildDef_List extends HTMLPurifier_ChildDef { + /** + * @type string + */ public $type = 'list'; + /** + * @type array + */ // lying a little bit, so that we can handle ul and ol ourselves // XXX: This whole business with 'wrap' is all a bit unsatisfactory public $elements = array('li' => true, 'ul' => true, 'ol' => true); - public function validateChildren($tokens_of_children, $config, $context) { + + /** + * @param array $children + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function validateChildren($children, $config, $context) + { // Flag for subclasses $this->whitespace = false; // if there are no tokens, delete parent node - if (empty($tokens_of_children)) return false; + if (empty($children)) { + return false; + } // the new set of children $result = array(); - // current depth into the nest - $nesting = 0; - // a little sanity check to make sure it's not ALL whitespace $all_whitespace = true; - $seen_li = false; - $need_close_li = false; + $current_li = false; - foreach ($tokens_of_children as $token) { - if (!empty($token->is_whitespace)) { - $result[] = $token; + foreach ($children as $node) { + if (!empty($node->is_whitespace)) { + $result[] = $node; continue; } $all_whitespace = false; // phew, we're not talking about whitespace - if ($nesting == 1 && $need_close_li) { - $result[] = new HTMLPurifier_Token_End('li'); - $nesting--; - $need_close_li = false; - } - - $is_child = ($nesting == 0); - - if ($token instanceof HTMLPurifier_Token_Start) { - $nesting++; - } elseif ($token instanceof HTMLPurifier_Token_End) { - $nesting--; - } - - if ($is_child) { - if ($token->name === 'li') { - // good - $seen_li = true; - } elseif ($token->name === 'ul' || $token->name === 'ol') { - // we want to tuck this into the previous li - $need_close_li = true; - $nesting++; - if (!$seen_li) { - // create a new li element - $result[] = new HTMLPurifier_Token_Start('li'); - } else { - // backtrack until found - while(true) { - $t = array_pop($result); - if ($t instanceof HTMLPurifier_Token_End) { - // XXX actually, these invariants could very plausibly be violated - // if we are doing silly things with modifying the set of allowed elements. - // FORTUNATELY, it doesn't make a difference, since the allowed - // elements are hard-coded here! - if ($t->name !== 'li') { - trigger_error("Only li present invariant violated in List ChildDef", E_USER_ERROR); - return false; - } - break; - } elseif ($t instanceof HTMLPurifier_Token_Empty) { // bleagh - if ($t->name !== 'li') { - trigger_error("Only li present invariant violated in List ChildDef", E_USER_ERROR); - return false; - } - // XXX this should have a helper for it... - $result[] = new HTMLPurifier_Token_Start('li', $t->attr, $t->line, $t->col, $t->armor); - break; - } else { - if (!$t->is_whitespace) { - trigger_error("Only whitespace present invariant violated in List ChildDef", E_USER_ERROR); - return false; - } - } - } - } - } else { - // start wrapping (this doesn't precisely mimic - // browser behavior, but what browsers do is kind of - // hard to mimic in a standards compliant way - // XXX Actually, this has no impact in practice, - // because this gets handled earlier. Arguably, - // we should rip out all of that processing - $result[] = new HTMLPurifier_Token_Start('li'); - $nesting++; - $seen_li = true; - $need_close_li = true; + if ($node->name === 'li') { + // good + $current_li = $node; + $result[] = $node; + } else { + // we want to tuck this into the previous li + // Invariant: we expect the node to be ol/ul + // ToDo: Make this more robust in the case of not ol/ul + // by distinguishing between existing li and li created + // to handle non-list elements; non-list elements should + // not be appended to an existing li; only li created + // for non-list. This distinction is not currently made. + if ($current_li === false) { + $current_li = new HTMLPurifier_Node_Element('li'); + $result[] = $current_li; } + $current_li->children[] = $node; + $current_li->empty = false; // XXX fascinating! Check for this error elsewhere ToDo } - $result[] = $token; } - if ($need_close_li) { - $result[] = new HTMLPurifier_Token_End('li'); + if (empty($result)) { + return false; } - if (empty($result)) return false; if ($all_whitespace) { return false; } - if ($tokens_of_children == $result) return true; return $result; } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Optional.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Optional.php index 32bcb9898e..b9468063b1 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Optional.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Optional.php @@ -9,15 +9,34 @@ */ class HTMLPurifier_ChildDef_Optional extends HTMLPurifier_ChildDef_Required { + /** + * @type bool + */ public $allow_empty = true; + + /** + * @type string + */ public $type = 'optional'; - public function validateChildren($tokens_of_children, $config, $context) { - $result = parent::validateChildren($tokens_of_children, $config, $context); - // we assume that $tokens_of_children is not modified + + /** + * @param array $children + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function validateChildren($children, $config, $context) + { + $result = parent::validateChildren($children, $config, $context); + // we assume that $children is not modified if ($result === false) { - if (empty($tokens_of_children)) return true; - elseif ($this->whitespace) return $tokens_of_children; - else return array(); + if (empty($children)) { + return true; + } elseif ($this->whitespace) { + return $children; + } else { + return array(); + } } return $result; } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Required.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Required.php index 4889f249b8..0d1c8f5f39 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Required.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Required.php @@ -7,17 +7,21 @@ class HTMLPurifier_ChildDef_Required extends HTMLPurifier_ChildDef { /** * Lookup table of allowed elements. - * @public + * @type array */ public $elements = array(); + /** * Whether or not the last passed node was all whitespace. + * @type bool */ protected $whitespace = false; + /** - * @param $elements List of allowed element names (lowercase). + * @param array|string $elements List of allowed element names (lowercase). */ - public function __construct($elements) { + public function __construct($elements) + { if (is_string($elements)) { $elements = str_replace(' ', '', $elements); $elements = explode('|', $elements); @@ -27,29 +31,43 @@ class HTMLPurifier_ChildDef_Required extends HTMLPurifier_ChildDef $elements = array_flip($elements); foreach ($elements as $i => $x) { $elements[$i] = true; - if (empty($i)) unset($elements[$i]); // remove blank + if (empty($i)) { + unset($elements[$i]); + } // remove blank } } $this->elements = $elements; } + + /** + * @type bool + */ public $allow_empty = false; + + /** + * @type string + */ public $type = 'required'; - public function validateChildren($tokens_of_children, $config, $context) { + + /** + * @param array $children + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function validateChildren($children, $config, $context) + { // Flag for subclasses $this->whitespace = false; // if there are no tokens, delete parent node - if (empty($tokens_of_children)) return false; + if (empty($children)) { + return false; + } // the new set of children $result = array(); - // current depth into the nest - $nesting = 0; - - // whether or not we're deleting a node - $is_deleting = false; - // whether or not parsed character data is allowed // this controls whether or not we silently drop a tag // or generate escaped HTML from it @@ -58,58 +76,41 @@ class HTMLPurifier_ChildDef_Required extends HTMLPurifier_ChildDef // a little sanity check to make sure it's not ALL whitespace $all_whitespace = true; - // some configuration - $escape_invalid_children = $config->get('Core.EscapeInvalidChildren'); - - // generator - $gen = new HTMLPurifier_Generator($config, $context); - - foreach ($tokens_of_children as $token) { - if (!empty($token->is_whitespace)) { - $result[] = $token; + $stack = array_reverse($children); + while (!empty($stack)) { + $node = array_pop($stack); + if (!empty($node->is_whitespace)) { + $result[] = $node; continue; } $all_whitespace = false; // phew, we're not talking about whitespace - $is_child = ($nesting == 0); - - if ($token instanceof HTMLPurifier_Token_Start) { - $nesting++; - } elseif ($token instanceof HTMLPurifier_Token_End) { - $nesting--; - } - - if ($is_child) { - $is_deleting = false; - if (!isset($this->elements[$token->name])) { - $is_deleting = true; - if ($pcdata_allowed && $token instanceof HTMLPurifier_Token_Text) { - $result[] = $token; - } elseif ($pcdata_allowed && $escape_invalid_children) { - $result[] = new HTMLPurifier_Token_Text( - $gen->generateFromToken($token) - ); + if (!isset($this->elements[$node->name])) { + // special case text + // XXX One of these ought to be redundant or something + if ($pcdata_allowed && $node instanceof HTMLPurifier_Node_Text) { + $result[] = $node; + continue; + } + // spill the child contents in + // ToDo: Make configurable + if ($node instanceof HTMLPurifier_Node_Element) { + for ($i = count($node->children) - 1; $i >= 0; $i--) { + $stack[] = $node->children[$i]; } continue; } + continue; } - if (!$is_deleting || ($pcdata_allowed && $token instanceof HTMLPurifier_Token_Text)) { - $result[] = $token; - } elseif ($pcdata_allowed && $escape_invalid_children) { - $result[] = - new HTMLPurifier_Token_Text( - $gen->generateFromToken($token) - ); - } else { - // drop silently - } + $result[] = $node; + } + if (empty($result)) { + return false; } - if (empty($result)) return false; if ($all_whitespace) { $this->whitespace = true; return false; } - if ($tokens_of_children == $result) return true; return $result; } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/StrictBlockquote.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/StrictBlockquote.php index dfae8a6e5e..3270a46e1b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/StrictBlockquote.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/StrictBlockquote.php @@ -5,75 +5,97 @@ */ class HTMLPurifier_ChildDef_StrictBlockquote extends HTMLPurifier_ChildDef_Required { + /** + * @type array + */ protected $real_elements; + + /** + * @type array + */ protected $fake_elements; + + /** + * @type bool + */ public $allow_empty = true; + + /** + * @type string + */ public $type = 'strictblockquote'; + + /** + * @type bool + */ protected $init = false; /** + * @param HTMLPurifier_Config $config + * @return array * @note We don't want MakeWellFormed to auto-close inline elements since * they might be allowed. */ - public function getAllowedElements($config) { + public function getAllowedElements($config) + { $this->init($config); return $this->fake_elements; } - public function validateChildren($tokens_of_children, $config, $context) { - + /** + * @param array $children + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function validateChildren($children, $config, $context) + { $this->init($config); // trick the parent class into thinking it allows more $this->elements = $this->fake_elements; - $result = parent::validateChildren($tokens_of_children, $config, $context); + $result = parent::validateChildren($children, $config, $context); $this->elements = $this->real_elements; - if ($result === false) return array(); - if ($result === true) $result = $tokens_of_children; + if ($result === false) { + return array(); + } + if ($result === true) { + $result = $children; + } $def = $config->getHTMLDefinition(); - $block_wrap_start = new HTMLPurifier_Token_Start($def->info_block_wrapper); - $block_wrap_end = new HTMLPurifier_Token_End( $def->info_block_wrapper); - $is_inline = false; - $depth = 0; + $block_wrap_name = $def->info_block_wrapper; + $block_wrap = false; $ret = array(); - // assuming that there are no comment tokens - foreach ($result as $i => $token) { - $token = $result[$i]; - // ifs are nested for readability - if (!$is_inline) { - if (!$depth) { - if ( - ($token instanceof HTMLPurifier_Token_Text && !$token->is_whitespace) || - (!$token instanceof HTMLPurifier_Token_Text && !isset($this->elements[$token->name])) - ) { - $is_inline = true; - $ret[] = $block_wrap_start; - } + foreach ($result as $node) { + if ($block_wrap === false) { + if (($node instanceof HTMLPurifier_Node_Text && !$node->is_whitespace) || + ($node instanceof HTMLPurifier_Node_Element && !isset($this->elements[$node->name]))) { + $block_wrap = new HTMLPurifier_Node_Element($def->info_block_wrapper); + $ret[] = $block_wrap; } } else { - if (!$depth) { - // starting tokens have been inline text / empty - if ($token instanceof HTMLPurifier_Token_Start || $token instanceof HTMLPurifier_Token_Empty) { - if (isset($this->elements[$token->name])) { - // ended - $ret[] = $block_wrap_end; - $is_inline = false; - } - } + if ($node instanceof HTMLPurifier_Node_Element && isset($this->elements[$node->name])) { + $block_wrap = false; + } } - $ret[] = $token; - if ($token instanceof HTMLPurifier_Token_Start) $depth++; - if ($token instanceof HTMLPurifier_Token_End) $depth--; + if ($block_wrap) { + $block_wrap->children[] = $node; + } else { + $ret[] = $node; + } } - if ($is_inline) $ret[] = $block_wrap_end; return $ret; } - private function init($config) { + /** + * @param HTMLPurifier_Config $config + */ + private function init($config) + { if (!$this->init) { $def = $config->getHTMLDefinition(); // allow all inline elements diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php index 9a93421a1a..3e4a0f2182 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php @@ -31,195 +31,192 @@ */ class HTMLPurifier_ChildDef_Table extends HTMLPurifier_ChildDef { + /** + * @type bool + */ public $allow_empty = false; + + /** + * @type string + */ public $type = 'table'; - public $elements = array('tr' => true, 'tbody' => true, 'thead' => true, - 'tfoot' => true, 'caption' => true, 'colgroup' => true, 'col' => true); - public function __construct() {} - public function validateChildren($tokens_of_children, $config, $context) { - if (empty($tokens_of_children)) return false; - // this ensures that the loop gets run one last time before closing - // up. It's a little bit of a hack, but it works! Just make sure you - // get rid of the token later. - $tokens_of_children[] = false; + /** + * @type array + */ + public $elements = array( + 'tr' => true, + 'tbody' => true, + 'thead' => true, + 'tfoot' => true, + 'caption' => true, + 'colgroup' => true, + 'col' => true + ); + + public function __construct() + { + } + + /** + * @param array $children + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function validateChildren($children, $config, $context) + { + if (empty($children)) { + return false; + } // only one of these elements is allowed in a table $caption = false; - $thead = false; - $tfoot = false; + $thead = false; + $tfoot = false; + + // whitespace + $initial_ws = array(); + $after_caption_ws = array(); + $after_thead_ws = array(); + $after_tfoot_ws = array(); // as many of these as you want - $cols = array(); + $cols = array(); $content = array(); - $nesting = 0; // current depth so we can determine nodes - $is_collecting = false; // are we globbing together tokens to package - // into one of the collectors? - $collection = array(); // collected nodes - $tag_index = 0; // the first node might be whitespace, - // so this tells us where the start tag is $tbody_mode = false; // if true, then we need to wrap any stray // s with a . - foreach ($tokens_of_children as $token) { - $is_child = ($nesting == 0); + $ws_accum =& $initial_ws; - if ($token === false) { - // terminating sequence started - } elseif ($token instanceof HTMLPurifier_Token_Start) { - $nesting++; - } elseif ($token instanceof HTMLPurifier_Token_End) { - $nesting--; + foreach ($children as $node) { + if ($node instanceof HTMLPurifier_Node_Comment) { + $ws_accum[] = $node; + continue; } - - // handle node collection - if ($is_collecting) { - if ($is_child) { - // okay, let's stash the tokens away - // first token tells us the type of the collection - switch ($collection[$tag_index]->name) { - case 'tbody': - $tbody_mode = true; - case 'tr': - $content[] = $collection; - break; - case 'caption': - if ($caption !== false) break; - $caption = $collection; - break; - case 'thead': - case 'tfoot': - $tbody_mode = true; - // XXX This breaks rendering properties with - // Firefox, which never floats a to - // the top. Ever. (Our scheme will float the - // first to the top.) So maybe - // s that are not first should be - // turned into ? Very tricky, indeed. - - // access the appropriate variable, $thead or $tfoot - $var = $collection[$tag_index]->name; - if ($$var === false) { - $$var = $collection; - } else { - // Oops, there's a second one! What - // should we do? Current behavior is to - // transmutate the first and last entries into - // tbody tags, and then put into content. - // Maybe a better idea is to *attach - // it* to the existing thead or tfoot? - // We don't do this, because Firefox - // doesn't float an extra tfoot to the - // bottom like it does for the first one. - $collection[$tag_index]->name = 'tbody'; - $collection[count($collection)-1]->name = 'tbody'; - $content[] = $collection; - } - break; - case 'colgroup': - $cols[] = $collection; - break; - } - $collection = array(); - $is_collecting = false; - $tag_index = 0; + switch ($node->name) { + case 'tbody': + $tbody_mode = true; + // fall through + case 'tr': + $content[] = $node; + $ws_accum =& $content; + break; + case 'caption': + // there can only be one caption! + if ($caption !== false) break; + $caption = $node; + $ws_accum =& $after_caption_ws; + break; + case 'thead': + $tbody_mode = true; + // XXX This breaks rendering properties with + // Firefox, which never floats a to + // the top. Ever. (Our scheme will float the + // first to the top.) So maybe + // s that are not first should be + // turned into ? Very tricky, indeed. + if ($thead === false) { + $thead = $node; + $ws_accum =& $after_thead_ws; } else { - // add the node to the collection - $collection[] = $token; + // Oops, there's a second one! What + // should we do? Current behavior is to + // transmutate the first and last entries into + // tbody tags, and then put into content. + // Maybe a better idea is to *attach + // it* to the existing thead or tfoot? + // We don't do this, because Firefox + // doesn't float an extra tfoot to the + // bottom like it does for the first one. + $node->name = 'tbody'; + $content[] = $node; + $ws_accum =& $content; } - } - - // terminate - if ($token === false) break; - - if ($is_child) { - // determine what we're dealing with - if ($token->name == 'col') { - // the only empty tag in the possie, we can handle it - // immediately - $cols[] = array_merge($collection, array($token)); - $collection = array(); - $tag_index = 0; - continue; + break; + case 'tfoot': + // see above for some aveats + $tbody_mode = true; + if ($tfoot === false) { + $tfoot = $node; + $ws_accum =& $after_tfoot_ws; + } else { + $node->name = 'tbody'; + $content[] = $node; + $ws_accum =& $content; } - switch($token->name) { - case 'caption': - case 'colgroup': - case 'thead': - case 'tfoot': - case 'tbody': - case 'tr': - $is_collecting = true; - $collection[] = $token; - continue; - default: - if (!empty($token->is_whitespace)) { - $collection[] = $token; - $tag_index++; - } - continue; + break; + case 'colgroup': + case 'col': + $cols[] = $node; + $ws_accum =& $cols; + break; + case '#PCDATA': + // How is whitespace handled? We treat is as sticky to + // the *end* of the previous element. So all of the + // nonsense we have worked on is to keep things + // together. + if (!empty($node->is_whitespace)) { + $ws_accum[] = $node; } + break; } } - if (empty($content)) return false; + if (empty($content)) { + return false; + } - $ret = array(); - if ($caption !== false) $ret = array_merge($ret, $caption); - if ($cols !== false) foreach ($cols as $token_array) $ret = array_merge($ret, $token_array); - if ($thead !== false) $ret = array_merge($ret, $thead); - if ($tfoot !== false) $ret = array_merge($ret, $tfoot); + $ret = $initial_ws; + if ($caption !== false) { + $ret[] = $caption; + $ret = array_merge($ret, $after_caption_ws); + } + if ($cols !== false) { + $ret = array_merge($ret, $cols); + } + if ($thead !== false) { + $ret[] = $thead; + $ret = array_merge($ret, $after_thead_ws); + } + if ($tfoot !== false) { + $ret[] = $tfoot; + $ret = array_merge($ret, $after_tfoot_ws); + } if ($tbody_mode) { - // a little tricky, since the start of the collection may be - // whitespace - $inside_tbody = false; - foreach ($content as $token_array) { - // find the starting token - foreach ($token_array as $t) { - if ($t->name === 'tr' || $t->name === 'tbody') { - break; + // we have to shuffle tr into tbody + $current_tr_tbody = null; + + foreach($content as $node) { + switch ($node->name) { + case 'tbody': + $current_tr_tbody = null; + $ret[] = $node; + break; + case 'tr': + if ($current_tr_tbody === null) { + $current_tr_tbody = new HTMLPurifier_Node_Element('tbody'); + $ret[] = $current_tr_tbody; } - } // iterator variable carries over - if ($t->name === 'tr') { - if ($inside_tbody) { - $ret = array_merge($ret, $token_array); + $current_tr_tbody->children[] = $node; + break; + case '#PCDATA': + assert($node->is_whitespace); + if ($current_tr_tbody === null) { + $ret[] = $node; } else { - $ret[] = new HTMLPurifier_Token_Start('tbody'); - $ret = array_merge($ret, $token_array); - $inside_tbody = true; + $current_tr_tbody->children[] = $node; } - } elseif ($t->name === 'tbody') { - if ($inside_tbody) { - $ret[] = new HTMLPurifier_Token_End('tbody'); - $inside_tbody = false; - $ret = array_merge($ret, $token_array); - } else { - $ret = array_merge($ret, $token_array); - } - } else { - trigger_error("tr/tbody in content invariant failed in Table ChildDef", E_USER_ERROR); + break; } } - if ($inside_tbody) { - $ret[] = new HTMLPurifier_Token_End('tbody'); - } } else { - foreach ($content as $token_array) { - // invariant: everything in here is s - $ret = array_merge($ret, $token_array); - } + $ret = array_merge($ret, $content); } - if (!empty($collection) && $is_collecting == false){ - // grab the trailing space - $ret = array_merge($ret, $collection); - } - - array_pop($tokens_of_children); // remove phantom token - - return ($ret === $tokens_of_children) ? true : $ret; + return $ret; } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php index 489ea0464a..7ada59b949 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php @@ -19,78 +19,92 @@ class HTMLPurifier_Config /** * HTML Purifier's version + * @type string */ - public $version = '4.5.0'; + public $version = '4.6.0'; /** - * Bool indicator whether or not to automatically finalize - * the object if a read operation is done + * Whether or not to automatically finalize + * the object if a read operation is done. + * @type bool */ public $autoFinalize = true; // protected member variables /** - * Namespace indexed array of serials for specific namespaces (see - * getSerial() for more info). + * Namespace indexed array of serials for specific namespaces. + * @see getSerial() for more info. + * @type string[] */ protected $serials = array(); /** - * Serial for entire configuration object + * Serial for entire configuration object. + * @type string */ protected $serial; /** - * Parser for variables + * Parser for variables. + * @type HTMLPurifier_VarParser_Flexible */ protected $parser = null; /** - * Reference HTMLPurifier_ConfigSchema for value checking + * Reference HTMLPurifier_ConfigSchema for value checking. + * @type HTMLPurifier_ConfigSchema * @note This is public for introspective purposes. Please don't * abuse! */ public $def; /** - * Indexed array of definitions + * Indexed array of definitions. + * @type HTMLPurifier_Definition[] */ protected $definitions; /** - * Bool indicator whether or not config is finalized + * Whether or not config is finalized. + * @type bool */ protected $finalized = false; /** * Property list containing configuration directives. + * @type array */ protected $plist; /** - * Whether or not a set is taking place due to an - * alias lookup. + * Whether or not a set is taking place due to an alias lookup. + * @type bool */ private $aliasMode; /** - * Set to false if you do not want line and file numbers in errors + * Set to false if you do not want line and file numbers in errors. * (useful when unit testing). This will also compress some errors * and exceptions. + * @type bool */ public $chatty = true; /** * Current lock; only gets to this namespace are allowed. + * @type string */ private $lock; /** - * @param $definition HTMLPurifier_ConfigSchema that defines what directives - * are allowed. + * Constructor + * @param HTMLPurifier_ConfigSchema $definition ConfigSchema that defines + * what directives are allowed. + * @param HTMLPurifier_PropertyList $parent */ - public function __construct($definition, $parent = null) { + public function __construct($definition, $parent = null) + { $parent = $parent ? $parent : $definition->defaultPlist; $this->plist = new HTMLPurifier_PropertyList($parent); $this->def = $definition; // keep a copy around for checking @@ -103,10 +117,11 @@ class HTMLPurifier_Config * object. Can be: a HTMLPurifier_Config() object, * an array of directives based on loadArray(), * or a string filename of an ini file. - * @param HTMLPurifier_ConfigSchema Schema object - * @return Configured HTMLPurifier_Config object + * @param HTMLPurifier_ConfigSchema $schema Schema object + * @return HTMLPurifier_Config Configured object */ - public static function create($config, $schema = null) { + public static function create($config, $schema = null) + { if ($config instanceof HTMLPurifier_Config) { // pass-through return $config; @@ -116,57 +131,79 @@ class HTMLPurifier_Config } else { $ret = new HTMLPurifier_Config($schema); } - if (is_string($config)) $ret->loadIni($config); - elseif (is_array($config)) $ret->loadArray($config); + if (is_string($config)) { + $ret->loadIni($config); + } elseif (is_array($config)) $ret->loadArray($config); return $ret; } /** * Creates a new config object that inherits from a previous one. - * @param HTMLPurifier_Config $config Configuration object to inherit - * from. + * @param HTMLPurifier_Config $config Configuration object to inherit from. * @return HTMLPurifier_Config object with $config as its parent. */ - public static function inherit(HTMLPurifier_Config $config) { + public static function inherit(HTMLPurifier_Config $config) + { return new HTMLPurifier_Config($config->def, $config->plist); } /** * Convenience constructor that creates a default configuration object. - * @return Default HTMLPurifier_Config object. + * @return HTMLPurifier_Config default object. */ - public static function createDefault() { + public static function createDefault() + { $definition = HTMLPurifier_ConfigSchema::instance(); $config = new HTMLPurifier_Config($definition); return $config; } /** - * Retreives a value from the configuration. - * @param $key String key + * Retrieves a value from the configuration. + * + * @param string $key String key + * @param mixed $a + * + * @return mixed */ - public function get($key, $a = null) { + public function get($key, $a = null) + { if ($a !== null) { - $this->triggerError("Using deprecated API: use \$config->get('$key.$a') instead", E_USER_WARNING); + $this->triggerError( + "Using deprecated API: use \$config->get('$key.$a') instead", + E_USER_WARNING + ); $key = "$key.$a"; } - if (!$this->finalized) $this->autoFinalize(); + if (!$this->finalized) { + $this->autoFinalize(); + } if (!isset($this->def->info[$key])) { // can't add % due to SimpleTest bug - $this->triggerError('Cannot retrieve value of undefined directive ' . htmlspecialchars($key), - E_USER_WARNING); + $this->triggerError( + 'Cannot retrieve value of undefined directive ' . htmlspecialchars($key), + E_USER_WARNING + ); return; } if (isset($this->def->info[$key]->isAlias)) { $d = $this->def->info[$key]; - $this->triggerError('Cannot get value from aliased directive, use real name ' . $d->key, - E_USER_ERROR); + $this->triggerError( + 'Cannot get value from aliased directive, use real name ' . $d->key, + E_USER_ERROR + ); return; } if ($this->lock) { list($ns) = explode('.', $key); if ($ns !== $this->lock) { - $this->triggerError('Cannot get value of namespace ' . $ns . ' when lock for ' . $this->lock . ' is active, this probably indicates a Definition setup method is accessing directives that are not within its namespace', E_USER_ERROR); + $this->triggerError( + 'Cannot get value of namespace ' . $ns . ' when lock for ' . + $this->lock . + ' is active, this probably indicates a Definition setup method ' . + 'is accessing directives that are not within its namespace', + E_USER_ERROR + ); return; } } @@ -174,15 +211,24 @@ class HTMLPurifier_Config } /** - * Retreives an array of directives to values from a given namespace - * @param $namespace String namespace + * Retrieves an array of directives to values from a given namespace + * + * @param string $namespace String namespace + * + * @return array */ - public function getBatch($namespace) { - if (!$this->finalized) $this->autoFinalize(); + public function getBatch($namespace) + { + if (!$this->finalized) { + $this->autoFinalize(); + } $full = $this->getAll(); if (!isset($full[$namespace])) { - $this->triggerError('Cannot retrieve undefined namespace ' . htmlspecialchars($namespace), - E_USER_WARNING); + $this->triggerError( + 'Cannot retrieve undefined namespace ' . + htmlspecialchars($namespace), + E_USER_WARNING + ); return; } return $full[$namespace]; @@ -191,11 +237,15 @@ class HTMLPurifier_Config /** * Returns a SHA-1 signature of a segment of the configuration object * that uniquely identifies that particular configuration + * + * @param string $namespace Namespace to get serial for + * + * @return string * @note Revision is handled specially and is removed from the batch * before processing! - * @param $namespace Namespace to get serial for */ - public function getBatchSerial($namespace) { + public function getBatchSerial($namespace) + { if (empty($this->serials[$namespace])) { $batch = $this->getBatch($namespace); unset($batch['DefinitionRev']); @@ -207,8 +257,11 @@ class HTMLPurifier_Config /** * Returns a SHA-1 signature for the entire configuration object * that uniquely identifies that particular configuration + * + * @return string */ - public function getSerial() { + public function getSerial() + { if (empty($this->serial)) { $this->serial = sha1(serialize($this->getAll())); } @@ -217,10 +270,14 @@ class HTMLPurifier_Config /** * Retrieves all directives, organized by namespace + * * @warning This is a pretty inefficient function, avoid if you can */ - public function getAll() { - if (!$this->finalized) $this->autoFinalize(); + public function getAll() + { + if (!$this->finalized) { + $this->autoFinalize(); + } $ret = array(); foreach ($this->plist->squash() as $name => $value) { list($ns, $key) = explode('.', $name, 2); @@ -231,10 +288,13 @@ class HTMLPurifier_Config /** * Sets a value to configuration. - * @param $key String key - * @param $value Mixed value + * + * @param string $key key + * @param mixed $value value + * @param mixed $a */ - public function set($key, $value, $a = null) { + public function set($key, $value, $a = null) + { if (strpos($key, '.') === false) { $namespace = $key; $directive = $value; @@ -244,18 +304,25 @@ class HTMLPurifier_Config } else { list($namespace) = explode('.', $key); } - if ($this->isFinalized('Cannot set directive after finalization')) return; + if ($this->isFinalized('Cannot set directive after finalization')) { + return; + } if (!isset($this->def->info[$key])) { - $this->triggerError('Cannot set undefined directive ' . htmlspecialchars($key) . ' to value', - E_USER_WARNING); + $this->triggerError( + 'Cannot set undefined directive ' . htmlspecialchars($key) . ' to value', + E_USER_WARNING + ); return; } $def = $this->def->info[$key]; if (isset($def->isAlias)) { if ($this->aliasMode) { - $this->triggerError('Double-aliases not allowed, please fix '. - 'ConfigSchema bug with' . $key, E_USER_ERROR); + $this->triggerError( + 'Double-aliases not allowed, please fix '. + 'ConfigSchema bug with' . $key, + E_USER_ERROR + ); return; } $this->aliasMode = true; @@ -279,7 +346,11 @@ class HTMLPurifier_Config try { $value = $this->parser->parse($value, $type, $allow_null); } catch (HTMLPurifier_VarParserException $e) { - $this->triggerError('Value for ' . $key . ' is of invalid type, should be ' . HTMLPurifier_VarParser::getTypeName($type), E_USER_WARNING); + $this->triggerError( + 'Value for ' . $key . ' is of invalid type, should be ' . + HTMLPurifier_VarParser::getTypeName($type), + E_USER_WARNING + ); return; } if (is_string($value) && is_object($def)) { @@ -289,8 +360,11 @@ class HTMLPurifier_Config } // check to see if the value is allowed if (isset($def->allowed) && !isset($def->allowed[$value])) { - $this->triggerError('Value not supported, valid values are: ' . - $this->_listify($def->allowed), E_USER_WARNING); + $this->triggerError( + 'Value not supported, valid values are: ' . + $this->_listify($def->allowed), + E_USER_WARNING + ); return; } } @@ -308,63 +382,83 @@ class HTMLPurifier_Config /** * Convenience function for error reporting + * + * @param array $lookup + * + * @return string */ - private function _listify($lookup) { + private function _listify($lookup) + { $list = array(); - foreach ($lookup as $name => $b) $list[] = $name; + foreach ($lookup as $name => $b) { + $list[] = $name; + } return implode(', ', $list); } /** * Retrieves object reference to the HTML definition. - * @param $raw Return a copy that has not been setup yet. Must be + * + * @param bool $raw Return a copy that has not been setup yet. Must be * called before it's been setup, otherwise won't work. - * @param $optimized If true, this method may return null, to + * @param bool $optimized If true, this method may return null, to * indicate that a cached version of the modified * definition object is available and no further edits * are necessary. Consider using * maybeGetRawHTMLDefinition, which is more explicitly * named, instead. + * + * @return HTMLPurifier_HTMLDefinition */ - public function getHTMLDefinition($raw = false, $optimized = false) { + public function getHTMLDefinition($raw = false, $optimized = false) + { return $this->getDefinition('HTML', $raw, $optimized); } /** * Retrieves object reference to the CSS definition - * @param $raw Return a copy that has not been setup yet. Must be + * + * @param bool $raw Return a copy that has not been setup yet. Must be * called before it's been setup, otherwise won't work. - * @param $optimized If true, this method may return null, to + * @param bool $optimized If true, this method may return null, to * indicate that a cached version of the modified * definition object is available and no further edits * are necessary. Consider using * maybeGetRawCSSDefinition, which is more explicitly * named, instead. + * + * @return HTMLPurifier_CSSDefinition */ - public function getCSSDefinition($raw = false, $optimized = false) { + public function getCSSDefinition($raw = false, $optimized = false) + { return $this->getDefinition('CSS', $raw, $optimized); } /** * Retrieves object reference to the URI definition - * @param $raw Return a copy that has not been setup yet. Must be + * + * @param bool $raw Return a copy that has not been setup yet. Must be * called before it's been setup, otherwise won't work. - * @param $optimized If true, this method may return null, to + * @param bool $optimized If true, this method may return null, to * indicate that a cached version of the modified * definition object is available and no further edits * are necessary. Consider using * maybeGetRawURIDefinition, which is more explicitly * named, instead. + * + * @return HTMLPurifier_URIDefinition */ - public function getURIDefinition($raw = false, $optimized = false) { + public function getURIDefinition($raw = false, $optimized = false) + { return $this->getDefinition('URI', $raw, $optimized); } /** * Retrieves a definition - * @param $type Type of definition: HTML, CSS, etc - * @param $raw Whether or not definition should be returned raw - * @param $optimized Only has an effect when $raw is true. Whether + * + * @param string $type Type of definition: HTML, CSS, etc + * @param bool $raw Whether or not definition should be returned raw + * @param bool $optimized Only has an effect when $raw is true. Whether * or not to return null if the result is already present in * the cache. This is off by default for backwards * compatibility reasons, but you need to do things this @@ -372,12 +466,18 @@ class HTMLPurifier_Config * Check out enduser-customize.html for more details. * We probably won't ever change this default, as much as the * maybe semantics is the "right thing to do." + * + * @throws HTMLPurifier_Exception + * @return HTMLPurifier_Definition */ - public function getDefinition($type, $raw = false, $optimized = false) { + public function getDefinition($type, $raw = false, $optimized = false) + { if ($optimized && !$raw) { throw new HTMLPurifier_Exception("Cannot set optimized = true when raw = false"); } - if (!$this->finalized) $this->autoFinalize(); + if (!$this->finalized) { + $this->autoFinalize(); + } // temporarily suspend locks, so we can handle recursive definition calls $lock = $this->lock; $this->lock = null; @@ -395,7 +495,9 @@ class HTMLPurifier_Config return $def; } else { $def->setup($this); - if ($def->optimized) $cache->add($def, $this); + if ($def->optimized) { + $cache->add($def, $this); + } return $def; } } @@ -424,23 +526,36 @@ class HTMLPurifier_Config if ($optimized) { if (is_null($this->get($type . '.DefinitionID'))) { // fatally error out if definition ID not set - throw new HTMLPurifier_Exception("Cannot retrieve raw version without specifying %$type.DefinitionID"); + throw new HTMLPurifier_Exception( + "Cannot retrieve raw version without specifying %$type.DefinitionID" + ); } } if (!empty($this->definitions[$type])) { $def = $this->definitions[$type]; if ($def->setup && !$optimized) { - $extra = $this->chatty ? " (try moving this code block earlier in your initialization)" : ""; - throw new HTMLPurifier_Exception("Cannot retrieve raw definition after it has already been setup" . $extra); + $extra = $this->chatty ? + " (try moving this code block earlier in your initialization)" : + ""; + throw new HTMLPurifier_Exception( + "Cannot retrieve raw definition after it has already been setup" . + $extra + ); } if ($def->optimized === null) { $extra = $this->chatty ? " (try flushing your cache)" : ""; - throw new HTMLPurifier_Exception("Optimization status of definition is unknown" . $extra); + throw new HTMLPurifier_Exception( + "Optimization status of definition is unknown" . $extra + ); } if ($def->optimized !== $optimized) { $msg = $optimized ? "optimized" : "unoptimized"; - $extra = $this->chatty ? " (this backtrace is for the first inconsistent call, which was for a $msg raw definition)" : ""; - throw new HTMLPurifier_Exception("Inconsistent use of optimized and unoptimized raw definition retrievals" . $extra); + $extra = $this->chatty ? + " (this backtrace is for the first inconsistent call, which was for a $msg raw definition)" + : ""; + throw new HTMLPurifier_Exception( + "Inconsistent use of optimized and unoptimized raw definition retrievals" . $extra + ); } } // check if definition was in memory @@ -473,9 +588,22 @@ class HTMLPurifier_Config if (!$optimized) { if (!is_null($this->get($type . '.DefinitionID'))) { if ($this->chatty) { - $this->triggerError("Due to a documentation error in previous version of HTML Purifier, your definitions are not being cached. If this is OK, you can remove the %$type.DefinitionRev and %$type.DefinitionID declaration. Otherwise, modify your code to use maybeGetRawDefinition, and test if the returned value is null before making any edits (if it is null, that means that a cached version is available, and no raw operations are necessary). See Customize for more details", E_USER_WARNING); + $this->triggerError( + 'Due to a documentation error in previous version of HTML Purifier, your ' . + 'definitions are not being cached. If this is OK, you can remove the ' . + '%$type.DefinitionRev and %$type.DefinitionID declaration. Otherwise, ' . + 'modify your code to use maybeGetRawDefinition, and test if the returned ' . + 'value is null before making any edits (if it is null, that means that a ' . + 'cached version is available, and no raw operations are necessary). See ' . + '' . + 'Customize for more details', + E_USER_WARNING + ); } else { - $this->triggerError("Useless DefinitionID declaration", E_USER_WARNING); + $this->triggerError( + "Useless DefinitionID declaration", + E_USER_WARNING + ); } } } @@ -487,7 +615,16 @@ class HTMLPurifier_Config throw new HTMLPurifier_Exception("The impossible happened!"); } - private function initDefinition($type) { + /** + * Initialise definition + * + * @param string $type What type of definition to create + * + * @return HTMLPurifier_CSSDefinition|HTMLPurifier_HTMLDefinition|HTMLPurifier_URIDefinition + * @throws HTMLPurifier_Exception + */ + private function initDefinition($type) + { // quick checks failed, let's create the object if ($type == 'HTML') { $def = new HTMLPurifier_HTMLDefinition(); @@ -496,35 +633,45 @@ class HTMLPurifier_Config } elseif ($type == 'URI') { $def = new HTMLPurifier_URIDefinition(); } else { - throw new HTMLPurifier_Exception("Definition of $type type not supported"); + throw new HTMLPurifier_Exception( + "Definition of $type type not supported" + ); } $this->definitions[$type] = $def; return $def; } - public function maybeGetRawDefinition($name) { + public function maybeGetRawDefinition($name) + { return $this->getDefinition($name, true, true); } - public function maybeGetRawHTMLDefinition() { + public function maybeGetRawHTMLDefinition() + { return $this->getDefinition('HTML', true, true); } - public function maybeGetRawCSSDefinition() { + public function maybeGetRawCSSDefinition() + { return $this->getDefinition('CSS', true, true); } - public function maybeGetRawURIDefinition() { + public function maybeGetRawURIDefinition() + { return $this->getDefinition('URI', true, true); } /** * Loads configuration values from an array with the following structure: * Namespace.Directive => Value - * @param $config_array Configuration associative array + * + * @param array $config_array Configuration associative array */ - public function loadArray($config_array) { - if ($this->isFinalized('Cannot load directives after finalization')) return; + public function loadArray($config_array) + { + if ($this->isFinalized('Cannot load directives after finalization')) { + return; + } foreach ($config_array as $key => $value) { $key = str_replace('_', '.', $key); if (strpos($key, '.') !== false) { @@ -532,8 +679,8 @@ class HTMLPurifier_Config } else { $namespace = $key; $namespace_values = $value; - foreach ($namespace_values as $directive => $value) { - $this->set($namespace .'.'. $directive, $value); + foreach ($namespace_values as $directive => $value2) { + $this->set($namespace .'.'. $directive, $value2); } } } @@ -543,40 +690,55 @@ class HTMLPurifier_Config * Returns a list of array(namespace, directive) for all directives * that are allowed in a web-form context as per an allowed * namespaces/directives list. - * @param $allowed List of allowed namespaces/directives - */ - public static function getAllowedDirectivesForForm($allowed, $schema = null) { + * + * @param array $allowed List of allowed namespaces/directives + * @param HTMLPurifier_ConfigSchema $schema Schema to use, if not global copy + * + * @return array + */ + public static function getAllowedDirectivesForForm($allowed, $schema = null) + { if (!$schema) { $schema = HTMLPurifier_ConfigSchema::instance(); } if ($allowed !== true) { - if (is_string($allowed)) $allowed = array($allowed); - $allowed_ns = array(); - $allowed_directives = array(); - $blacklisted_directives = array(); - foreach ($allowed as $ns_or_directive) { - if (strpos($ns_or_directive, '.') !== false) { - // directive - if ($ns_or_directive[0] == '-') { - $blacklisted_directives[substr($ns_or_directive, 1)] = true; - } else { - $allowed_directives[$ns_or_directive] = true; - } - } else { - // namespace - $allowed_ns[$ns_or_directive] = true; - } - } + if (is_string($allowed)) { + $allowed = array($allowed); + } + $allowed_ns = array(); + $allowed_directives = array(); + $blacklisted_directives = array(); + foreach ($allowed as $ns_or_directive) { + if (strpos($ns_or_directive, '.') !== false) { + // directive + if ($ns_or_directive[0] == '-') { + $blacklisted_directives[substr($ns_or_directive, 1)] = true; + } else { + $allowed_directives[$ns_or_directive] = true; + } + } else { + // namespace + $allowed_ns[$ns_or_directive] = true; + } + } } $ret = array(); foreach ($schema->info as $key => $def) { list($ns, $directive) = explode('.', $key, 2); if ($allowed !== true) { - if (isset($blacklisted_directives["$ns.$directive"])) continue; - if (!isset($allowed_directives["$ns.$directive"]) && !isset($allowed_ns[$ns])) continue; + if (isset($blacklisted_directives["$ns.$directive"])) { + continue; + } + if (!isset($allowed_directives["$ns.$directive"]) && !isset($allowed_ns[$ns])) { + continue; + } + } + if (isset($def->isAlias)) { + continue; + } + if ($directive == 'DefinitionID' || $directive == 'DefinitionRev') { + continue; } - if (isset($def->isAlias)) continue; - if ($directive == 'DefinitionID' || $directive == 'DefinitionRev') continue; $ret[] = array($ns, $directive); } return $ret; @@ -585,13 +747,17 @@ class HTMLPurifier_Config /** * Loads configuration values from $_GET/$_POST that were posted * via ConfigForm - * @param $array $_GET or $_POST array to import - * @param $index Index/name that the config variables are in - * @param $allowed List of allowed namespaces/directives - * @param $mq_fix Boolean whether or not to enable magic quotes fix - * @param $schema Instance of HTMLPurifier_ConfigSchema to use, if not global copy - */ - public static function loadArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true, $schema = null) { + * + * @param array $array $_GET or $_POST array to import + * @param string|bool $index Index/name that the config variables are in + * @param array|bool $allowed List of allowed namespaces/directives + * @param bool $mq_fix Boolean whether or not to enable magic quotes fix + * @param HTMLPurifier_ConfigSchema $schema Schema to use, if not global copy + * + * @return mixed + */ + public static function loadArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true, $schema = null) + { $ret = HTMLPurifier_Config::prepareArrayFromForm($array, $index, $allowed, $mq_fix, $schema); $config = HTMLPurifier_Config::create($ret, $schema); return $config; @@ -599,9 +765,14 @@ class HTMLPurifier_Config /** * Merges in configuration values from $_GET/$_POST to object. NOT STATIC. - * @note Same parameters as loadArrayFromForm - */ - public function mergeArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true) { + * + * @param array $array $_GET or $_POST array to import + * @param string|bool $index Index/name that the config variables are in + * @param array|bool $allowed List of allowed namespaces/directives + * @param bool $mq_fix Boolean whether or not to enable magic quotes fix + */ + public function mergeArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true) + { $ret = HTMLPurifier_Config::prepareArrayFromForm($array, $index, $allowed, $mq_fix, $this->def); $this->loadArray($ret); } @@ -609,9 +780,20 @@ class HTMLPurifier_Config /** * Prepares an array from a form into something usable for the more * strict parts of HTMLPurifier_Config - */ - public static function prepareArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true, $schema = null) { - if ($index !== false) $array = (isset($array[$index]) && is_array($array[$index])) ? $array[$index] : array(); + * + * @param array $array $_GET or $_POST array to import + * @param string|bool $index Index/name that the config variables are in + * @param array|bool $allowed List of allowed namespaces/directives + * @param bool $mq_fix Boolean whether or not to enable magic quotes fix + * @param HTMLPurifier_ConfigSchema $schema Schema to use, if not global copy + * + * @return array + */ + public static function prepareArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true, $schema = null) + { + if ($index !== false) { + $array = (isset($array[$index]) && is_array($array[$index])) ? $array[$index] : array(); + } $mq = $mq_fix && function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc(); $allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $schema); @@ -623,7 +805,9 @@ class HTMLPurifier_Config $ret[$ns][$directive] = null; continue; } - if (!isset($array[$skey])) continue; + if (!isset($array[$skey])) { + continue; + } $value = $mq ? stripslashes($array[$skey]) : $array[$skey]; $ret[$ns][$directive] = $value; } @@ -632,19 +816,27 @@ class HTMLPurifier_Config /** * Loads configuration values from an ini file - * @param $filename Name of ini file + * + * @param string $filename Name of ini file */ - public function loadIni($filename) { - if ($this->isFinalized('Cannot load directives after finalization')) return; + public function loadIni($filename) + { + if ($this->isFinalized('Cannot load directives after finalization')) { + return; + } $array = parse_ini_file($filename, true); $this->loadArray($array); } /** * Checks whether or not the configuration object is finalized. - * @param $error String error message, or false for no error + * + * @param string|bool $error String error message, or false for no error + * + * @return bool */ - public function isFinalized($error = false) { + public function isFinalized($error = false) + { if ($this->finalized && $error) { $this->triggerError($error, E_USER_ERROR); } @@ -655,7 +847,8 @@ class HTMLPurifier_Config * Finalizes configuration only if auto finalize is on and not * already finalized */ - public function autoFinalize() { + public function autoFinalize() + { if ($this->autoFinalize) { $this->finalize(); } else { @@ -666,7 +859,8 @@ class HTMLPurifier_Config /** * Finalizes a configuration object, prohibiting further change */ - public function finalize() { + public function finalize() + { $this->finalized = true; $this->parser = null; } @@ -674,8 +868,12 @@ class HTMLPurifier_Config /** * Produces a nicely formatted error message by supplying the * stack frame information OUTSIDE of HTMLPurifier_Config. + * + * @param string $msg An error message + * @param int $no An error number */ - protected function triggerError($msg, $no) { + protected function triggerError($msg, $no) + { // determine previous stack frame $extra = ''; if ($this->chatty) { @@ -697,8 +895,11 @@ class HTMLPurifier_Config /** * Returns a serialized form of the configuration object that can * be reconstituted. + * + * @return string */ - public function serialize() { + public function serialize() + { $this->getDefinition('HTML'); $this->getDefinition('CSS'); $this->getDefinition('URI'); diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema.php index fadf7a5890..bfbb0f92f5 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema.php @@ -3,21 +3,24 @@ /** * Configuration definition, defines directives and their defaults. */ -class HTMLPurifier_ConfigSchema { - +class HTMLPurifier_ConfigSchema +{ /** * Defaults of the directives and namespaces. + * @type array * @note This shares the exact same structure as HTMLPurifier_Config::$conf */ public $defaults = array(); /** * The default property list. Do not edit this property list. + * @type array */ public $defaultPlist; /** - * Definition of the directives. The structure of this is: + * Definition of the directives. + * The structure of this is: * * array( * 'Namespace' => array( @@ -44,22 +47,27 @@ class HTMLPurifier_ConfigSchema { * This class is friendly with HTMLPurifier_Config. If you need introspection * about the schema, you're better of using the ConfigSchema_Interchange, * which uses more memory but has much richer information. + * @type array */ public $info = array(); /** * Application-wide singleton + * @type HTMLPurifier_ConfigSchema */ - static protected $singleton; + protected static $singleton; - public function __construct() { + public function __construct() + { $this->defaultPlist = new HTMLPurifier_PropertyList(); } /** * Unserializes the default ConfigSchema. + * @return HTMLPurifier_ConfigSchema */ - public static function makeFromSerial() { + public static function makeFromSerial() + { $contents = file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema.ser'); $r = unserialize($contents); if (!$r) { @@ -71,8 +79,11 @@ class HTMLPurifier_ConfigSchema { /** * Retrieves an instance of the application-wide configuration definition. + * @param HTMLPurifier_ConfigSchema $prototype + * @return HTMLPurifier_ConfigSchema */ - public static function instance($prototype = null) { + public static function instance($prototype = null) + { if ($prototype !== null) { HTMLPurifier_ConfigSchema::$singleton = $prototype; } elseif (HTMLPurifier_ConfigSchema::$singleton === null || $prototype === true) { @@ -86,17 +97,19 @@ class HTMLPurifier_ConfigSchema { * @warning Will fail of directive's namespace is defined. * @warning This method's signature is slightly different from the legacy * define() static method! Beware! - * @param $namespace Namespace the directive is in - * @param $name Key of directive - * @param $default Default value of directive - * @param $type Allowed type of the directive. See + * @param string $key Name of directive + * @param mixed $default Default value of directive + * @param string $type Allowed type of the directive. See * HTMLPurifier_DirectiveDef::$type for allowed values - * @param $allow_null Whether or not to allow null values + * @param bool $allow_null Whether or not to allow null values */ - public function add($key, $default, $type, $allow_null) { + public function add($key, $default, $type, $allow_null) + { $obj = new stdclass(); $obj->type = is_int($type) ? $type : HTMLPurifier_VarParser::$types[$type]; - if ($allow_null) $obj->allow_null = true; + if ($allow_null) { + $obj->allow_null = true; + } $this->info[$key] = $obj; $this->defaults[$key] = $default; $this->defaultPlist->set($key, $default); @@ -107,11 +120,11 @@ class HTMLPurifier_ConfigSchema { * * Directive value aliases are convenient for developers because it lets * them set a directive to several values and get the same result. - * @param $namespace Directive's namespace - * @param $name Name of Directive - * @param $aliases Hash of aliased values to the real alias + * @param string $key Name of Directive + * @param array $aliases Hash of aliased values to the real alias */ - public function addValueAliases($key, $aliases) { + public function addValueAliases($key, $aliases) + { if (!isset($this->info[$key]->aliases)) { $this->info[$key]->aliases = array(); } @@ -124,22 +137,21 @@ class HTMLPurifier_ConfigSchema { * Defines a set of allowed values for a directive. * @warning This is slightly different from the corresponding static * method definition. - * @param $namespace Namespace of directive - * @param $name Name of directive - * @param $allowed Lookup array of allowed values + * @param string $key Name of directive + * @param array $allowed Lookup array of allowed values */ - public function addAllowedValues($key, $allowed) { + public function addAllowedValues($key, $allowed) + { $this->info[$key]->allowed = $allowed; } /** * Defines a directive alias for backwards compatibility - * @param $namespace - * @param $name Directive that will be aliased - * @param $new_namespace - * @param $new_name Directive that the alias will be to + * @param string $key Directive that will be aliased + * @param string $new_key Directive that the alias will be to */ - public function addAlias($key, $new_key) { + public function addAlias($key, $new_key) + { $obj = new stdclass; $obj->key = $new_key; $obj->isAlias = true; @@ -149,7 +161,8 @@ class HTMLPurifier_ConfigSchema { /** * Replaces any stdclass that only has the type property with type integer. */ - public function postProcess() { + public function postProcess() + { foreach ($this->info as $key => $v) { if (count((array) $v) == 1) { $this->info[$key] = $v->type; @@ -158,7 +171,6 @@ class HTMLPurifier_ConfigSchema { } } } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php index c05668a706..d5906cd46d 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php @@ -7,7 +7,12 @@ class HTMLPurifier_ConfigSchema_Builder_ConfigSchema { - public function build($interchange) { + /** + * @param HTMLPurifier_ConfigSchema_Interchange $interchange + * @return HTMLPurifier_ConfigSchema + */ + public function build($interchange) + { $schema = new HTMLPurifier_ConfigSchema(); foreach ($interchange->directives as $d) { $schema->add( @@ -38,7 +43,6 @@ class HTMLPurifier_ConfigSchema_Builder_ConfigSchema $schema->postProcess(); return $schema; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/Xml.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/Xml.php index 244561a372..5fa56f7ddb 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/Xml.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/Xml.php @@ -7,10 +7,21 @@ class HTMLPurifier_ConfigSchema_Builder_Xml extends XMLWriter { + /** + * @type HTMLPurifier_ConfigSchema_Interchange + */ protected $interchange; + + /** + * @type string + */ private $namespace; - protected function writeHTMLDiv($html) { + /** + * @param string $html + */ + protected function writeHTMLDiv($html) + { $this->startElement('div'); $purifier = HTMLPurifier::getInstance(); @@ -21,12 +32,23 @@ class HTMLPurifier_ConfigSchema_Builder_Xml extends XMLWriter $this->endElement(); // div } - protected function export($var) { - if ($var === array()) return 'array()'; + /** + * @param mixed $var + * @return string + */ + protected function export($var) + { + if ($var === array()) { + return 'array()'; + } return var_export($var, true); } - public function build($interchange) { + /** + * @param HTMLPurifier_ConfigSchema_Interchange $interchange + */ + public function build($interchange) + { // global access, only use as last resort $this->interchange = $interchange; @@ -39,19 +61,26 @@ class HTMLPurifier_ConfigSchema_Builder_Xml extends XMLWriter $this->buildDirective($directive); } - if ($this->namespace) $this->endElement(); // namespace + if ($this->namespace) { + $this->endElement(); + } // namespace $this->endElement(); // configdoc $this->flush(); } - public function buildDirective($directive) { - + /** + * @param HTMLPurifier_ConfigSchema_Interchange_Directive $directive + */ + public function buildDirective($directive) + { // Kludge, although I suppose having a notion of a "root namespace" // certainly makes things look nicer when documentation is built. // Depends on things being sorted. if (!$this->namespace || $this->namespace !== $directive->id->getRootNamespace()) { - if ($this->namespace) $this->endElement(); // namespace + if ($this->namespace) { + $this->endElement(); + } // namespace $this->namespace = $directive->id->getRootNamespace(); $this->startElement('namespace'); $this->writeAttribute('id', $this->namespace); @@ -64,43 +93,52 @@ class HTMLPurifier_ConfigSchema_Builder_Xml extends XMLWriter $this->writeElement('name', $directive->id->getDirective()); $this->startElement('aliases'); - foreach ($directive->aliases as $alias) $this->writeElement('alias', $alias->toString()); + foreach ($directive->aliases as $alias) { + $this->writeElement('alias', $alias->toString()); + } $this->endElement(); // aliases $this->startElement('constraints'); - if ($directive->version) $this->writeElement('version', $directive->version); - $this->startElement('type'); - if ($directive->typeAllowsNull) $this->writeAttribute('allow-null', 'yes'); - $this->text($directive->type); - $this->endElement(); // type - if ($directive->allowed) { - $this->startElement('allowed'); - foreach ($directive->allowed as $value => $x) $this->writeElement('value', $value); - $this->endElement(); // allowed + if ($directive->version) { + $this->writeElement('version', $directive->version); + } + $this->startElement('type'); + if ($directive->typeAllowsNull) { + $this->writeAttribute('allow-null', 'yes'); + } + $this->text($directive->type); + $this->endElement(); // type + if ($directive->allowed) { + $this->startElement('allowed'); + foreach ($directive->allowed as $value => $x) { + $this->writeElement('value', $value); } - $this->writeElement('default', $this->export($directive->default)); - $this->writeAttribute('xml:space', 'preserve'); - if ($directive->external) { - $this->startElement('external'); - foreach ($directive->external as $project) $this->writeElement('project', $project); - $this->endElement(); + $this->endElement(); // allowed + } + $this->writeElement('default', $this->export($directive->default)); + $this->writeAttribute('xml:space', 'preserve'); + if ($directive->external) { + $this->startElement('external'); + foreach ($directive->external as $project) { + $this->writeElement('project', $project); } + $this->endElement(); + } $this->endElement(); // constraints if ($directive->deprecatedVersion) { $this->startElement('deprecated'); - $this->writeElement('version', $directive->deprecatedVersion); - $this->writeElement('use', $directive->deprecatedUse->toString()); + $this->writeElement('version', $directive->deprecatedVersion); + $this->writeElement('use', $directive->deprecatedUse->toString()); $this->endElement(); // deprecated } $this->startElement('description'); - $this->writeHTMLDiv($directive->description); + $this->writeHTMLDiv($directive->description); $this->endElement(); // description $this->endElement(); // directive } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange.php index 91a5aa7303..0e08ae8fe7 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange.php @@ -10,18 +10,23 @@ class HTMLPurifier_ConfigSchema_Interchange /** * Name of the application this schema is describing. + * @type string */ public $name; /** * Array of Directive ID => array(directive info) + * @type HTMLPurifier_ConfigSchema_Interchange_Directive[] */ public $directives = array(); /** * Adds a directive array to $directives + * @param HTMLPurifier_ConfigSchema_Interchange_Directive $directive + * @throws HTMLPurifier_ConfigSchema_Exception */ - public function addDirective($directive) { + public function addDirective($directive) + { if (isset($this->directives[$i = $directive->id->toString()])) { throw new HTMLPurifier_ConfigSchema_Exception("Cannot redefine directive '$i'"); } @@ -32,11 +37,11 @@ class HTMLPurifier_ConfigSchema_Interchange * Convenience function to perform standard validation. Throws exception * on failed validation. */ - public function validate() { + public function validate() + { $validator = new HTMLPurifier_ConfigSchema_Validator(); return $validator->validate($this); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php index ac8be0d970..127a39a673 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php @@ -7,71 +7,83 @@ class HTMLPurifier_ConfigSchema_Interchange_Directive { /** - * ID of directive, instance of HTMLPurifier_ConfigSchema_Interchange_Id. + * ID of directive. + * @type HTMLPurifier_ConfigSchema_Interchange_Id */ public $id; /** - * String type, e.g. 'integer' or 'istring'. + * Type, e.g. 'integer' or 'istring'. + * @type string */ public $type; /** * Default value, e.g. 3 or 'DefaultVal'. + * @type mixed */ public $default; /** * HTML description. + * @type string */ public $description; /** - * Boolean whether or not null is allowed as a value. + * Whether or not null is allowed as a value. + * @type bool */ public $typeAllowsNull = false; /** - * Lookup table of allowed scalar values, e.g. array('allowed' => true). + * Lookup table of allowed scalar values. + * e.g. array('allowed' => true). * Null if all values are allowed. + * @type array */ public $allowed; /** - * List of aliases for the directive, + * List of aliases for the directive. * e.g. array(new HTMLPurifier_ConfigSchema_Interchange_Id('Ns', 'Dir'))). + * @type HTMLPurifier_ConfigSchema_Interchange_Id[] */ public $aliases = array(); /** * Hash of value aliases, e.g. array('alt' => 'real'). Null if value * aliasing is disabled (necessary for non-scalar types). + * @type array */ public $valueAliases; /** * Version of HTML Purifier the directive was introduced, e.g. '1.3.1'. * Null if the directive has always existed. + * @type string */ public $version; /** - * ID of directive that supercedes this old directive, is an instance - * of HTMLPurifier_ConfigSchema_Interchange_Id. Null if not deprecated. + * ID of directive that supercedes this old directive. + * Null if not deprecated. + * @type HTMLPurifier_ConfigSchema_Interchange_Id */ public $deprecatedUse; /** * Version of HTML Purifier this directive was deprecated. Null if not * deprecated. + * @type string */ public $deprecatedVersion; /** * List of external projects this directive depends on, e.g. array('CSSTidy'). + * @type array */ public $external = array(); - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Id.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Id.php index b9b3c6f5cf..126f09d957 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Id.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Id.php @@ -6,32 +6,53 @@ class HTMLPurifier_ConfigSchema_Interchange_Id { + /** + * @type string + */ public $key; - public function __construct($key) { + /** + * @param string $key + */ + public function __construct($key) + { $this->key = $key; } /** + * @return string * @warning This is NOT magic, to ensure that people don't abuse SPL and * cause problems for PHP 5.0 support. */ - public function toString() { + public function toString() + { return $this->key; } - public function getRootNamespace() { + /** + * @return string + */ + public function getRootNamespace() + { return substr($this->key, 0, strpos($this->key, ".")); } - public function getDirective() { + /** + * @return string + */ + public function getDirective() + { return substr($this->key, strpos($this->key, ".") + 1); } - public static function make($id) { + /** + * @param string $id + * @return HTMLPurifier_ConfigSchema_Interchange_Id + */ + public static function make($id) + { return new HTMLPurifier_ConfigSchema_Interchange_Id($id); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php index 785b72ce8e..655e6dd1b9 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php @@ -5,21 +5,39 @@ class HTMLPurifier_ConfigSchema_InterchangeBuilder /** * Used for processing DEFAULT, nothing else. + * @type HTMLPurifier_VarParser */ protected $varParser; - public function __construct($varParser = null) { + /** + * @param HTMLPurifier_VarParser $varParser + */ + public function __construct($varParser = null) + { $this->varParser = $varParser ? $varParser : new HTMLPurifier_VarParser_Native(); } - public static function buildFromDirectory($dir = null) { - $builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder(); + /** + * @param string $dir + * @return HTMLPurifier_ConfigSchema_Interchange + */ + public static function buildFromDirectory($dir = null) + { + $builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder(); $interchange = new HTMLPurifier_ConfigSchema_Interchange(); return $builder->buildDir($interchange, $dir); } - public function buildDir($interchange, $dir = null) { - if (!$dir) $dir = HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema'; + /** + * @param HTMLPurifier_ConfigSchema_Interchange $interchange + * @param string $dir + * @return HTMLPurifier_ConfigSchema_Interchange + */ + public function buildDir($interchange, $dir = null) + { + if (!$dir) { + $dir = HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema'; + } if (file_exists($dir . '/info.ini')) { $info = parse_ini_file($dir . '/info.ini'); $interchange->name = $info['name']; @@ -39,24 +57,30 @@ class HTMLPurifier_ConfigSchema_InterchangeBuilder foreach ($files as $file) { $this->buildFile($interchange, $dir . '/' . $file); } - return $interchange; } - public function buildFile($interchange, $file) { + /** + * @param HTMLPurifier_ConfigSchema_Interchange $interchange + * @param string $file + */ + public function buildFile($interchange, $file) + { $parser = new HTMLPurifier_StringHashParser(); $this->build( $interchange, - new HTMLPurifier_StringHash( $parser->parseFile($file) ) + new HTMLPurifier_StringHash($parser->parseFile($file)) ); } /** * Builds an interchange object based on a hash. - * @param $interchange HTMLPurifier_ConfigSchema_Interchange object to build - * @param $hash HTMLPurifier_ConfigSchema_StringHash source data + * @param HTMLPurifier_ConfigSchema_Interchange $interchange HTMLPurifier_ConfigSchema_Interchange object to build + * @param HTMLPurifier_StringHash $hash source data + * @throws HTMLPurifier_ConfigSchema_Exception */ - public function build($interchange, $hash) { + public function build($interchange, $hash) + { if (!$hash instanceof HTMLPurifier_StringHash) { $hash = new HTMLPurifier_StringHash($hash); } @@ -75,7 +99,13 @@ class HTMLPurifier_ConfigSchema_InterchangeBuilder $this->_findUnused($hash); } - public function buildDirective($interchange, $hash) { + /** + * @param HTMLPurifier_ConfigSchema_Interchange $interchange + * @param HTMLPurifier_StringHash $hash + * @throws HTMLPurifier_ConfigSchema_Exception + */ + public function buildDirective($interchange, $hash) + { $directive = new HTMLPurifier_ConfigSchema_Interchange_Directive(); // These are required elements: @@ -84,7 +114,9 @@ class HTMLPurifier_ConfigSchema_InterchangeBuilder if (isset($hash['TYPE'])) { $type = explode('/', $hash->offsetGet('TYPE')); - if (isset($type[1])) $directive->typeAllowsNull = true; + if (isset($type[1])) { + $directive->typeAllowsNull = true; + } $directive->type = $type[0]; } else { throw new HTMLPurifier_ConfigSchema_Exception("TYPE in directive hash '$id' not defined"); @@ -92,7 +124,11 @@ class HTMLPurifier_ConfigSchema_InterchangeBuilder if (isset($hash['DEFAULT'])) { try { - $directive->default = $this->varParser->parse($hash->offsetGet('DEFAULT'), $directive->type, $directive->typeAllowsNull); + $directive->default = $this->varParser->parse( + $hash->offsetGet('DEFAULT'), + $directive->type, + $directive->typeAllowsNull + ); } catch (HTMLPurifier_VarParserException $e) { throw new HTMLPurifier_ConfigSchema_Exception($e->getMessage() . " in DEFAULT in directive hash '$id'"); } @@ -139,34 +175,45 @@ class HTMLPurifier_ConfigSchema_InterchangeBuilder /** * Evaluates an array PHP code string without array() wrapper + * @param string $contents */ - protected function evalArray($contents) { - return eval('return array('. $contents .');'); + protected function evalArray($contents) + { + return eval('return array(' . $contents . ');'); } /** * Converts an array list into a lookup array. + * @param array $array + * @return array */ - protected function lookup($array) { + protected function lookup($array) + { $ret = array(); - foreach ($array as $val) $ret[$val] = true; + foreach ($array as $val) { + $ret[$val] = true; + } return $ret; } /** * Convenience function that creates an HTMLPurifier_ConfigSchema_Interchange_Id * object based on a string Id. + * @param string $id + * @return HTMLPurifier_ConfigSchema_Interchange_Id */ - protected function id($id) { + protected function id($id) + { return HTMLPurifier_ConfigSchema_Interchange_Id::make($id); } /** * Triggers errors for any unused keys passed in the hash; such keys * may indicate typos, missing values, etc. - * @param $hash Instance of ConfigSchema_StringHash to check. + * @param HTMLPurifier_StringHash $hash Hash to check. */ - protected function _findUnused($hash) { + protected function _findUnused($hash) + { $accessed = $hash->getAccessed(); foreach ($hash as $k => $v) { if (!isset($accessed[$k])) { @@ -174,7 +221,6 @@ class HTMLPurifier_ConfigSchema_InterchangeBuilder } } } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Validator.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Validator.php index f374f6a022..fb31277889 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Validator.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Validator.php @@ -12,36 +12,48 @@ class HTMLPurifier_ConfigSchema_Validator { /** - * Easy to access global objects. + * @type HTMLPurifier_ConfigSchema_Interchange */ - protected $interchange, $aliases; + protected $interchange; + + /** + * @type array + */ + protected $aliases; /** * Context-stack to provide easy to read error messages. + * @type array */ protected $context = array(); /** - * HTMLPurifier_VarParser to test default's type. + * to test default's type. + * @type HTMLPurifier_VarParser */ protected $parser; - public function __construct() { + public function __construct() + { $this->parser = new HTMLPurifier_VarParser(); } /** - * Validates a fully-formed interchange object. Throws an - * HTMLPurifier_ConfigSchema_Exception if there's a problem. + * Validates a fully-formed interchange object. + * @param HTMLPurifier_ConfigSchema_Interchange $interchange + * @return bool */ - public function validate($interchange) { + public function validate($interchange) + { $this->interchange = $interchange; $this->aliases = array(); // PHP is a bit lax with integer <=> string conversions in // arrays, so we don't use the identical !== comparison foreach ($interchange->directives as $i => $directive) { $id = $directive->id->toString(); - if ($i != $id) $this->error(false, "Integrity violation: key '$i' does not match internal id '$id'"); + if ($i != $id) { + $this->error(false, "Integrity violation: key '$i' does not match internal id '$id'"); + } $this->validateDirective($directive); } return true; @@ -49,8 +61,10 @@ class HTMLPurifier_ConfigSchema_Validator /** * Validates a HTMLPurifier_ConfigSchema_Interchange_Id object. + * @param HTMLPurifier_ConfigSchema_Interchange_Id $id */ - public function validateId($id) { + public function validateId($id) + { $id_string = $id->toString(); $this->context[] = "id '$id_string'"; if (!$id instanceof HTMLPurifier_ConfigSchema_Interchange_Id) { @@ -67,8 +81,10 @@ class HTMLPurifier_ConfigSchema_Validator /** * Validates a HTMLPurifier_ConfigSchema_Interchange_Directive object. + * @param HTMLPurifier_ConfigSchema_Interchange_Directive $d */ - public function validateDirective($d) { + public function validateDirective($d) + { $id = $d->id->toString(); $this->context[] = "directive '$id'"; $this->validateId($d->id); @@ -108,9 +124,13 @@ class HTMLPurifier_ConfigSchema_Validator /** * Extra validation if $allowed member variable of * HTMLPurifier_ConfigSchema_Interchange_Directive is defined. + * @param HTMLPurifier_ConfigSchema_Interchange_Directive $d */ - public function validateDirectiveAllowed($d) { - if (is_null($d->allowed)) return; + public function validateDirectiveAllowed($d) + { + if (is_null($d->allowed)) { + return; + } $this->with($d, 'allowed') ->assertNotEmpty() ->assertIsLookup(); // handled by InterchangeBuilder @@ -119,7 +139,9 @@ class HTMLPurifier_ConfigSchema_Validator } $this->context[] = 'allowed'; foreach ($d->allowed as $val => $x) { - if (!is_string($val)) $this->error("value $val", 'must be a string'); + if (!is_string($val)) { + $this->error("value $val", 'must be a string'); + } } array_pop($this->context); } @@ -127,15 +149,23 @@ class HTMLPurifier_ConfigSchema_Validator /** * Extra validation if $valueAliases member variable of * HTMLPurifier_ConfigSchema_Interchange_Directive is defined. + * @param HTMLPurifier_ConfigSchema_Interchange_Directive $d */ - public function validateDirectiveValueAliases($d) { - if (is_null($d->valueAliases)) return; + public function validateDirectiveValueAliases($d) + { + if (is_null($d->valueAliases)) { + return; + } $this->with($d, 'valueAliases') ->assertIsArray(); // handled by InterchangeBuilder $this->context[] = 'valueAliases'; foreach ($d->valueAliases as $alias => $real) { - if (!is_string($alias)) $this->error("alias $alias", 'must be a string'); - if (!is_string($real)) $this->error("alias target $real from alias '$alias'", 'must be a string'); + if (!is_string($alias)) { + $this->error("alias $alias", 'must be a string'); + } + if (!is_string($real)) { + $this->error("alias target $real from alias '$alias'", 'must be a string'); + } if ($alias === $real) { $this->error("alias '$alias'", "must not be an alias to itself"); } @@ -155,8 +185,10 @@ class HTMLPurifier_ConfigSchema_Validator /** * Extra validation if $aliases member variable of * HTMLPurifier_ConfigSchema_Interchange_Directive is defined. + * @param HTMLPurifier_ConfigSchema_Interchange_Directive $d */ - public function validateDirectiveAliases($d) { + public function validateDirectiveAliases($d) + { $this->with($d, 'aliases') ->assertIsArray(); // handled by InterchangeBuilder $this->context[] = 'aliases'; @@ -180,27 +212,37 @@ class HTMLPurifier_ConfigSchema_Validator /** * Convenience function for generating HTMLPurifier_ConfigSchema_ValidatorAtom * for validating simple member variables of objects. + * @param $obj + * @param $member + * @return HTMLPurifier_ConfigSchema_ValidatorAtom */ - protected function with($obj, $member) { + protected function with($obj, $member) + { return new HTMLPurifier_ConfigSchema_ValidatorAtom($this->getFormattedContext(), $obj, $member); } /** * Emits an error, providing helpful context. + * @throws HTMLPurifier_ConfigSchema_Exception */ - protected function error($target, $msg) { - if ($target !== false) $prefix = ucfirst($target) . ' in ' . $this->getFormattedContext(); - else $prefix = ucfirst($this->getFormattedContext()); + protected function error($target, $msg) + { + if ($target !== false) { + $prefix = ucfirst($target) . ' in ' . $this->getFormattedContext(); + } else { + $prefix = ucfirst($this->getFormattedContext()); + } throw new HTMLPurifier_ConfigSchema_Exception(trim($prefix . ' ' . $msg)); } /** * Returns a formatted context string. + * @return string */ - protected function getFormattedContext() { + protected function getFormattedContext() + { return implode(' in ', array_reverse($this->context)); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php index b95aea18cc..c9aa3644af 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php @@ -8,59 +8,123 @@ */ class HTMLPurifier_ConfigSchema_ValidatorAtom { + /** + * @type string + */ + protected $context; - protected $context, $obj, $member, $contents; + /** + * @type object + */ + protected $obj; - public function __construct($context, $obj, $member) { - $this->context = $context; - $this->obj = $obj; - $this->member = $member; - $this->contents =& $obj->$member; + /** + * @type string + */ + protected $member; + + /** + * @type mixed + */ + protected $contents; + + public function __construct($context, $obj, $member) + { + $this->context = $context; + $this->obj = $obj; + $this->member = $member; + $this->contents =& $obj->$member; } - public function assertIsString() { - if (!is_string($this->contents)) $this->error('must be a string'); + /** + * @return HTMLPurifier_ConfigSchema_ValidatorAtom + */ + public function assertIsString() + { + if (!is_string($this->contents)) { + $this->error('must be a string'); + } return $this; } - public function assertIsBool() { - if (!is_bool($this->contents)) $this->error('must be a boolean'); + /** + * @return HTMLPurifier_ConfigSchema_ValidatorAtom + */ + public function assertIsBool() + { + if (!is_bool($this->contents)) { + $this->error('must be a boolean'); + } return $this; } - public function assertIsArray() { - if (!is_array($this->contents)) $this->error('must be an array'); + /** + * @return HTMLPurifier_ConfigSchema_ValidatorAtom + */ + public function assertIsArray() + { + if (!is_array($this->contents)) { + $this->error('must be an array'); + } return $this; } - public function assertNotNull() { - if ($this->contents === null) $this->error('must not be null'); + /** + * @return HTMLPurifier_ConfigSchema_ValidatorAtom + */ + public function assertNotNull() + { + if ($this->contents === null) { + $this->error('must not be null'); + } return $this; } - public function assertAlnum() { + /** + * @return HTMLPurifier_ConfigSchema_ValidatorAtom + */ + public function assertAlnum() + { $this->assertIsString(); - if (!ctype_alnum($this->contents)) $this->error('must be alphanumeric'); + if (!ctype_alnum($this->contents)) { + $this->error('must be alphanumeric'); + } return $this; } - public function assertNotEmpty() { - if (empty($this->contents)) $this->error('must not be empty'); + /** + * @return HTMLPurifier_ConfigSchema_ValidatorAtom + */ + public function assertNotEmpty() + { + if (empty($this->contents)) { + $this->error('must not be empty'); + } return $this; } - public function assertIsLookup() { + /** + * @return HTMLPurifier_ConfigSchema_ValidatorAtom + */ + public function assertIsLookup() + { $this->assertIsArray(); foreach ($this->contents as $v) { - if ($v !== true) $this->error('must be a lookup array'); + if ($v !== true) { + $this->error('must be a lookup array'); + } } return $this; } - protected function error($msg) { + /** + * @param string $msg + * @throws HTMLPurifier_ConfigSchema_Exception + */ + protected function error($msg) + { throw new HTMLPurifier_ConfigSchema_Exception(ucfirst($this->member) . ' in ' . $this->context . ' ' . $msg); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema.ser b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema.ser index fa0bacb947..22ea32185d 100644 Binary files a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema.ser and b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema.ser differ diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AllowHostnameUnderscore.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AllowHostnameUnderscore.txt new file mode 100644 index 0000000000..2c910cc7de --- /dev/null +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AllowHostnameUnderscore.txt @@ -0,0 +1,16 @@ +Core.AllowHostnameUnderscore +TYPE: bool +VERSION: 4.6.0 +DEFAULT: false +--DESCRIPTION-- +

+ By RFC 1123, underscores are not permitted in host names. + (This is in contrast to the specification for DNS, RFC + 2181, which allows underscores.) + However, most browsers do the right thing when faced with + an underscore in the host name, and so some poorly written + websites are written with the expectation this should work. + Setting this parameter to true relaxes our allowed character + check so that underscores are permitted. +

+--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt index 4d5b5055cd..a3881be75c 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt @@ -2,9 +2,11 @@ Core.EscapeInvalidChildren TYPE: bool DEFAULT: false --DESCRIPTION-- -When true, a child is found that is not allowed in the context of the +

Warning: this configuration option is no longer does anything as of 4.6.0.

+ +

When true, a child is found that is not allowed in the context of the parent element will be transformed into text as if it were ASCII. When false, that element and all internal tags will be dropped, though text will be preserved. There is no option for dropping the element but preserving -child nodes. +child nodes.

--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt index 0d00f62ea8..1e17c1d461 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt @@ -11,7 +11,7 @@ DEFAULT: NULL to check if a URI has passed through HTML Purifier with this line:

-
$checksum === sha1($secret_key . ':' . $url)
+
$checksum === hash_hmac("sha256", $url, $secret_key)

If the output is TRUE, the redirector script should accept the URI. diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ContentSets.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ContentSets.php index 3b6e96f5f5..543e3f8f11 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ContentSets.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ContentSets.php @@ -7,35 +7,42 @@ class HTMLPurifier_ContentSets { /** - * List of content set strings (pipe seperators) indexed by name. + * List of content set strings (pipe separators) indexed by name. + * @type array */ public $info = array(); /** * List of content set lookups (element => true) indexed by name. + * @type array * @note This is in HTMLPurifier_HTMLDefinition->info_content_sets */ public $lookup = array(); /** - * Synchronized list of defined content sets (keys of info) + * Synchronized list of defined content sets (keys of info). + * @type array */ protected $keys = array(); /** - * Synchronized list of defined content values (values of info) + * Synchronized list of defined content values (values of info). + * @type array */ protected $values = array(); /** * Merges in module's content sets, expands identifiers in the content * sets and populates the keys, values and lookup member variables. - * @param $modules List of HTMLPurifier_HTMLModule + * @param HTMLPurifier_HTMLModule[] $modules List of HTMLPurifier_HTMLModule */ - public function __construct($modules) { - if (!is_array($modules)) $modules = array($modules); + public function __construct($modules) + { + if (!is_array($modules)) { + $modules = array($modules); + } // populate content_sets based on module hints // sorry, no way of overloading - foreach ($modules as $module_i => $module) { + foreach ($modules as $module) { foreach ($module->content_sets as $key => $value) { $temp = $this->convertToLookup($value); if (isset($this->lookup[$key])) { @@ -70,11 +77,14 @@ class HTMLPurifier_ContentSets /** * Accepts a definition; generates and assigns a ChildDef for it - * @param $def HTMLPurifier_ElementDef reference - * @param $module Module that defined the ElementDef + * @param HTMLPurifier_ElementDef $def HTMLPurifier_ElementDef reference + * @param HTMLPurifier_HTMLModule $module Module that defined the ElementDef */ - public function generateChildDef(&$def, $module) { - if (!empty($def->child)) return; // already done! + public function generateChildDef(&$def, $module) + { + if (!empty($def->child)) { // already done! + return; + } $content_model = $def->content_model; if (is_string($content_model)) { // Assume that $this->keys is alphanumeric @@ -89,7 +99,8 @@ class HTMLPurifier_ContentSets $def->child = $this->getChildDef($def, $module); } - public function generateChildDefCallback($matches) { + public function generateChildDefCallback($matches) + { return $this->info[$matches[0]]; } @@ -98,10 +109,12 @@ class HTMLPurifier_ContentSets * member variables in HTMLPurifier_ElementDef * @note This will also defer to modules for custom HTMLPurifier_ChildDef * subclasses that need content set expansion - * @param $def HTMLPurifier_ElementDef to have ChildDef extracted + * @param HTMLPurifier_ElementDef $def HTMLPurifier_ElementDef to have ChildDef extracted + * @param HTMLPurifier_HTMLModule $module Module that defined the ElementDef * @return HTMLPurifier_ChildDef corresponding to ElementDef */ - public function getChildDef($def, $module) { + public function getChildDef($def, $module) + { $value = $def->content_model; if (is_object($value)) { trigger_error( @@ -126,7 +139,9 @@ class HTMLPurifier_ContentSets if ($module->defines_child_def) { // save a func call $return = $module->getChildDef($def); } - if ($return !== false) return $return; + if ($return !== false) { + return $return; + } // error-out trigger_error( 'Could not determine which ChildDef class to instantiate', @@ -138,18 +153,18 @@ class HTMLPurifier_ContentSets /** * Converts a string list of elements separated by pipes into * a lookup array. - * @param $string List of elements - * @return Lookup array of elements + * @param string $string List of elements + * @return array Lookup array of elements */ - protected function convertToLookup($string) { + protected function convertToLookup($string) + { $array = explode('|', str_replace(' ', '', $string)); $ret = array(); - foreach ($array as $i => $k) { + foreach ($array as $k) { $ret[$k] = true; } return $ret; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Context.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Context.php index 9ddf0c5476..00e509c85c 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Context.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Context.php @@ -12,18 +12,22 @@ class HTMLPurifier_Context /** * Private array that stores the references. + * @type array */ private $_storage = array(); /** * Registers a variable into the context. - * @param $name String name - * @param $ref Reference to variable to be registered + * @param string $name String name + * @param mixed $ref Reference to variable to be registered */ - public function register($name, &$ref) { - if (isset($this->_storage[$name])) { - trigger_error("Name $name produces collision, cannot re-register", - E_USER_ERROR); + public function register($name, &$ref) + { + if (array_key_exists($name, $this->_storage)) { + trigger_error( + "Name $name produces collision, cannot re-register", + E_USER_ERROR + ); return; } $this->_storage[$name] =& $ref; @@ -31,14 +35,18 @@ class HTMLPurifier_Context /** * Retrieves a variable reference from the context. - * @param $name String name - * @param $ignore_error Boolean whether or not to ignore error + * @param string $name String name + * @param bool $ignore_error Boolean whether or not to ignore error + * @return mixed */ - public function &get($name, $ignore_error = false) { - if (!isset($this->_storage[$name])) { + public function &get($name, $ignore_error = false) + { + if (!array_key_exists($name, $this->_storage)) { if (!$ignore_error) { - trigger_error("Attempted to retrieve non-existent variable $name", - E_USER_ERROR); + trigger_error( + "Attempted to retrieve non-existent variable $name", + E_USER_ERROR + ); } $var = null; // so we can return by reference return $var; @@ -47,13 +55,16 @@ class HTMLPurifier_Context } /** - * Destorys a variable in the context. - * @param $name String name + * Destroys a variable in the context. + * @param string $name String name */ - public function destroy($name) { - if (!isset($this->_storage[$name])) { - trigger_error("Attempted to destroy non-existent variable $name", - E_USER_ERROR); + public function destroy($name) + { + if (!array_key_exists($name, $this->_storage)) { + trigger_error( + "Attempted to destroy non-existent variable $name", + E_USER_ERROR + ); return; } unset($this->_storage[$name]); @@ -61,22 +72,24 @@ class HTMLPurifier_Context /** * Checks whether or not the variable exists. - * @param $name String name + * @param string $name String name + * @return bool */ - public function exists($name) { - return isset($this->_storage[$name]); + public function exists($name) + { + return array_key_exists($name, $this->_storage); } /** * Loads a series of variables from an associative array - * @param $context_array Assoc array of variables to load + * @param array $context_array Assoc array of variables to load */ - public function loadArray($context_array) { + public function loadArray($context_array) + { foreach ($context_array as $key => $discard) { $this->register($key, $context_array[$key]); } } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Definition.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Definition.php index c7f82eba43..bc6d433647 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Definition.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Definition.php @@ -9,6 +9,7 @@ abstract class HTMLPurifier_Definition /** * Has setup() been called yet? + * @type bool */ public $setup = false; @@ -20,31 +21,35 @@ abstract class HTMLPurifier_Definition * is used and any writes to the raw definition object are short * circuited. See enduser-customize.html for the high-level * picture. + * @type bool */ public $optimized = null; /** * What type of definition is it? + * @type string */ public $type; /** * Sets up the definition object into the final form, something * not done by the constructor - * @param $config HTMLPurifier_Config instance + * @param HTMLPurifier_Config $config */ abstract protected function doSetup($config); /** * Setup function that aborts if already setup - * @param $config HTMLPurifier_Config instance + * @param HTMLPurifier_Config $config */ - public function setup($config) { - if ($this->setup) return; + public function setup($config) + { + if ($this->setup) { + return; + } $this->setup = true; $this->doSetup($config); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache.php index c6e1e388c6..67bb5b1e69 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache.php @@ -10,22 +10,27 @@ */ abstract class HTMLPurifier_DefinitionCache { - + /** + * @type string + */ public $type; /** - * @param $name Type of definition objects this instance of the + * @param string $type Type of definition objects this instance of the * cache will handle. */ - public function __construct($type) { + public function __construct($type) + { $this->type = $type; } /** * Generates a unique identifier for a particular configuration - * @param Instance of HTMLPurifier_Config + * @param HTMLPurifier_Config $config Instance of HTMLPurifier_Config + * @return string */ - public function generateKey($config) { + public function generateKey($config) + { return $config->version . ',' . // possibly replace with function calls $config->getBatchSerial($this->type) . ',' . $config->get($this->type . '.DefinitionRev'); @@ -34,30 +39,37 @@ abstract class HTMLPurifier_DefinitionCache /** * Tests whether or not a key is old with respect to the configuration's * version and revision number. - * @param $key Key to test - * @param $config Instance of HTMLPurifier_Config to test against + * @param string $key Key to test + * @param HTMLPurifier_Config $config Instance of HTMLPurifier_Config to test against + * @return bool */ - public function isOld($key, $config) { - if (substr_count($key, ',') < 2) return true; + public function isOld($key, $config) + { + if (substr_count($key, ',') < 2) { + return true; + } list($version, $hash, $revision) = explode(',', $key, 3); $compare = version_compare($version, $config->version); // version mismatch, is always old - if ($compare != 0) return true; + if ($compare != 0) { + return true; + } // versions match, ids match, check revision number - if ( - $hash == $config->getBatchSerial($this->type) && - $revision < $config->get($this->type . '.DefinitionRev') - ) return true; + if ($hash == $config->getBatchSerial($this->type) && + $revision < $config->get($this->type . '.DefinitionRev')) { + return true; + } return false; } /** * Checks if a definition's type jives with the cache's type * @note Throws an error on failure - * @param $def Definition object to check - * @return Boolean true if good, false if not + * @param HTMLPurifier_Definition $def Definition object to check + * @return bool true if good, false if not */ - public function checkDefType($def) { + public function checkDefType($def) + { if ($def->type !== $this->type) { trigger_error("Cannot use definition of type {$def->type} in cache for {$this->type}"); return false; @@ -67,31 +79,40 @@ abstract class HTMLPurifier_DefinitionCache /** * Adds a definition object to the cache + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config */ abstract public function add($def, $config); /** * Unconditionally saves a definition object to the cache + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config */ abstract public function set($def, $config); /** * Replace an object in the cache + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config */ abstract public function replace($def, $config); /** * Retrieves a definition object from the cache + * @param HTMLPurifier_Config $config */ abstract public function get($config); /** * Removes a definition object to the cache + * @param HTMLPurifier_Config $config */ abstract public function remove($config); /** * Clears all objects from cache + * @param HTMLPurifier_Config $config */ abstract public function flush($config); @@ -100,9 +121,9 @@ abstract class HTMLPurifier_DefinitionCache * @note Be carefuly implementing this method as flush. Flush must * not interfere with other Definition types, and cleanup() * should not be repeatedly called by userland code. + * @param HTMLPurifier_Config $config */ abstract public function cleanup($config); - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator.php index b0fb6d0cd6..b57a51b6cb 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator.php @@ -5,58 +5,108 @@ class HTMLPurifier_DefinitionCache_Decorator extends HTMLPurifier_DefinitionCach /** * Cache object we are decorating + * @type HTMLPurifier_DefinitionCache */ public $cache; - public function __construct() {} + /** + * The name of the decorator + * @var string + */ + public $name; + + public function __construct() + { + } /** * Lazy decorator function - * @param $cache Reference to cache object to decorate + * @param HTMLPurifier_DefinitionCache $cache Reference to cache object to decorate + * @return HTMLPurifier_DefinitionCache_Decorator */ - public function decorate(&$cache) { + public function decorate(&$cache) + { $decorator = $this->copy(); // reference is necessary for mocks in PHP 4 $decorator->cache =& $cache; - $decorator->type = $cache->type; + $decorator->type = $cache->type; return $decorator; } /** * Cross-compatible clone substitute + * @return HTMLPurifier_DefinitionCache_Decorator */ - public function copy() { + public function copy() + { return new HTMLPurifier_DefinitionCache_Decorator(); } - public function add($def, $config) { + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function add($def, $config) + { return $this->cache->add($def, $config); } - public function set($def, $config) { + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function set($def, $config) + { return $this->cache->set($def, $config); } - public function replace($def, $config) { + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function replace($def, $config) + { return $this->cache->replace($def, $config); } - public function get($config) { + /** + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function get($config) + { return $this->cache->get($config); } - public function remove($config) { + /** + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function remove($config) + { return $this->cache->remove($config); } - public function flush($config) { + /** + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function flush($config) + { return $this->cache->flush($config); } - public function cleanup($config) { + /** + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function cleanup($config) + { return $this->cache->cleanup($config); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php index d4cc35c4bc..4991777ce1 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php @@ -4,40 +4,75 @@ * Definition cache decorator class that cleans up the cache * whenever there is a cache miss. */ -class HTMLPurifier_DefinitionCache_Decorator_Cleanup extends - HTMLPurifier_DefinitionCache_Decorator +class HTMLPurifier_DefinitionCache_Decorator_Cleanup extends HTMLPurifier_DefinitionCache_Decorator { - + /** + * @type string + */ public $name = 'Cleanup'; - public function copy() { + /** + * @return HTMLPurifier_DefinitionCache_Decorator_Cleanup + */ + public function copy() + { return new HTMLPurifier_DefinitionCache_Decorator_Cleanup(); } - public function add($def, $config) { + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function add($def, $config) + { $status = parent::add($def, $config); - if (!$status) parent::cleanup($config); + if (!$status) { + parent::cleanup($config); + } return $status; } - public function set($def, $config) { + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function set($def, $config) + { $status = parent::set($def, $config); - if (!$status) parent::cleanup($config); + if (!$status) { + parent::cleanup($config); + } return $status; } - public function replace($def, $config) { + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function replace($def, $config) + { $status = parent::replace($def, $config); - if (!$status) parent::cleanup($config); + if (!$status) { + parent::cleanup($config); + } return $status; } - public function get($config) { + /** + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function get($config) + { $ret = parent::get($config); - if (!$ret) parent::cleanup($config); + if (!$ret) { + parent::cleanup($config); + } return $ret; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Memory.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Memory.php index 18f16d32b6..d529dce48d 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Memory.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Memory.php @@ -5,42 +5,81 @@ * to PHP's memory; good for unit tests or circumstances where * there are lots of configuration objects floating around. */ -class HTMLPurifier_DefinitionCache_Decorator_Memory extends - HTMLPurifier_DefinitionCache_Decorator +class HTMLPurifier_DefinitionCache_Decorator_Memory extends HTMLPurifier_DefinitionCache_Decorator { - + /** + * @type array + */ protected $definitions; + + /** + * @type string + */ public $name = 'Memory'; - public function copy() { + /** + * @return HTMLPurifier_DefinitionCache_Decorator_Memory + */ + public function copy() + { return new HTMLPurifier_DefinitionCache_Decorator_Memory(); } - public function add($def, $config) { + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function add($def, $config) + { $status = parent::add($def, $config); - if ($status) $this->definitions[$this->generateKey($config)] = $def; + if ($status) { + $this->definitions[$this->generateKey($config)] = $def; + } return $status; } - public function set($def, $config) { + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function set($def, $config) + { $status = parent::set($def, $config); - if ($status) $this->definitions[$this->generateKey($config)] = $def; + if ($status) { + $this->definitions[$this->generateKey($config)] = $def; + } return $status; } - public function replace($def, $config) { + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function replace($def, $config) + { $status = parent::replace($def, $config); - if ($status) $this->definitions[$this->generateKey($config)] = $def; + if ($status) { + $this->definitions[$this->generateKey($config)] = $def; + } return $status; } - public function get($config) { + /** + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function get($config) + { $key = $this->generateKey($config); - if (isset($this->definitions[$key])) return $this->definitions[$key]; + if (isset($this->definitions[$key])) { + return $this->definitions[$key]; + } $this->definitions[$key] = parent::get($config); return $this->definitions[$key]; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in index 21a8fcfda2..b1fec8d367 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in @@ -5,43 +5,78 @@ require_once 'HTMLPurifier/DefinitionCache/Decorator.php'; /** * Definition cache decorator template. */ -class HTMLPurifier_DefinitionCache_Decorator_Template extends - HTMLPurifier_DefinitionCache_Decorator +class HTMLPurifier_DefinitionCache_Decorator_Template extends HTMLPurifier_DefinitionCache_Decorator { - var $name = 'Template'; // replace this + /** + * @type string + */ + public $name = 'Template'; // replace this - function copy() { + public function copy() + { // replace class name with yours return new HTMLPurifier_DefinitionCache_Decorator_Template(); } // remove methods you don't need - function add($def, $config) { + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function add($def, $config) + { return parent::add($def, $config); } - function set($def, $config) { + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function set($def, $config) + { return parent::set($def, $config); } - function replace($def, $config) { + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function replace($def, $config) + { return parent::replace($def, $config); } - function get($config) { + /** + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function get($config) + { return parent::get($config); } - function flush() { - return parent::flush(); + /** + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function flush($config) + { + return parent::flush($config); } - function cleanup($config) { + /** + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function cleanup($config) + { return parent::cleanup($config); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Null.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Null.php index 41d97e734f..d9a75ce227 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Null.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Null.php @@ -6,34 +6,71 @@ class HTMLPurifier_DefinitionCache_Null extends HTMLPurifier_DefinitionCache { - public function add($def, $config) { + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return bool + */ + public function add($def, $config) + { return false; } - public function set($def, $config) { + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return bool + */ + public function set($def, $config) + { return false; } - public function replace($def, $config) { + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return bool + */ + public function replace($def, $config) + { return false; } - public function remove($config) { + /** + * @param HTMLPurifier_Config $config + * @return bool + */ + public function remove($config) + { return false; } - public function get($config) { + /** + * @param HTMLPurifier_Config $config + * @return bool + */ + public function get($config) + { return false; } - public function flush($config) { + /** + * @param HTMLPurifier_Config $config + * @return bool + */ + public function flush($config) + { return false; } - public function cleanup($config) { + /** + * @param HTMLPurifier_Config $config + * @return bool + */ + public function cleanup($config) + { return false; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php index 73d5e90a60..ecacb88fe3 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php @@ -1,83 +1,160 @@ checkDefType($def)) return; + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return int|bool + */ + public function add($def, $config) + { + if (!$this->checkDefType($def)) { + return; + } $file = $this->generateFilePath($config); - if (file_exists($file)) return false; - if (!$this->_prepareDir($config)) return false; + if (file_exists($file)) { + return false; + } + if (!$this->_prepareDir($config)) { + return false; + } return $this->_write($file, serialize($def), $config); } - public function set($def, $config) { - if (!$this->checkDefType($def)) return; + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return int|bool + */ + public function set($def, $config) + { + if (!$this->checkDefType($def)) { + return; + } $file = $this->generateFilePath($config); - if (!$this->_prepareDir($config)) return false; + if (!$this->_prepareDir($config)) { + return false; + } return $this->_write($file, serialize($def), $config); } - public function replace($def, $config) { - if (!$this->checkDefType($def)) return; + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return int|bool + */ + public function replace($def, $config) + { + if (!$this->checkDefType($def)) { + return; + } $file = $this->generateFilePath($config); - if (!file_exists($file)) return false; - if (!$this->_prepareDir($config)) return false; + if (!file_exists($file)) { + return false; + } + if (!$this->_prepareDir($config)) { + return false; + } return $this->_write($file, serialize($def), $config); } - public function get($config) { + /** + * @param HTMLPurifier_Config $config + * @return bool|HTMLPurifier_Config + */ + public function get($config) + { $file = $this->generateFilePath($config); - if (!file_exists($file)) return false; + if (!file_exists($file)) { + return false; + } return unserialize(file_get_contents($file)); } - public function remove($config) { + /** + * @param HTMLPurifier_Config $config + * @return bool + */ + public function remove($config) + { $file = $this->generateFilePath($config); - if (!file_exists($file)) return false; + if (!file_exists($file)) { + return false; + } return unlink($file); } - public function flush($config) { - if (!$this->_prepareDir($config)) return false; + /** + * @param HTMLPurifier_Config $config + * @return bool + */ + public function flush($config) + { + if (!$this->_prepareDir($config)) { + return false; + } $dir = $this->generateDirectoryPath($config); - $dh = opendir($dir); + $dh = opendir($dir); while (false !== ($filename = readdir($dh))) { - if (empty($filename)) continue; - if ($filename[0] === '.') continue; + if (empty($filename)) { + continue; + } + if ($filename[0] === '.') { + continue; + } unlink($dir . '/' . $filename); } } - public function cleanup($config) { - if (!$this->_prepareDir($config)) return false; + /** + * @param HTMLPurifier_Config $config + * @return bool + */ + public function cleanup($config) + { + if (!$this->_prepareDir($config)) { + return false; + } $dir = $this->generateDirectoryPath($config); - $dh = opendir($dir); + $dh = opendir($dir); while (false !== ($filename = readdir($dh))) { - if (empty($filename)) continue; - if ($filename[0] === '.') continue; + if (empty($filename)) { + continue; + } + if ($filename[0] === '.') { + continue; + } $key = substr($filename, 0, strlen($filename) - 4); - if ($this->isOld($key, $config)) unlink($dir . '/' . $filename); + if ($this->isOld($key, $config)) { + unlink($dir . '/' . $filename); + } } } /** * Generates the file path to the serial file corresponding to * the configuration and definition name + * @param HTMLPurifier_Config $config + * @return string * @todo Make protected */ - public function generateFilePath($config) { + public function generateFilePath($config) + { $key = $this->generateKey($config); return $this->generateDirectoryPath($config) . '/' . $key . '.ser'; } /** * Generates the path to the directory contain this cache's serial files + * @param HTMLPurifier_Config $config + * @return string * @note No trailing slash * @todo Make protected */ - public function generateDirectoryPath($config) { + public function generateDirectoryPath($config) + { $base = $this->generateBaseDirectoryPath($config); return $base . '/' . $this->type; } @@ -85,9 +162,12 @@ class HTMLPurifier_DefinitionCache_Serializer extends /** * Generates path to base directory that contains all definition type * serials + * @param HTMLPurifier_Config $config + * @return mixed|string * @todo Make protected */ - public function generateBaseDirectoryPath($config) { + public function generateBaseDirectoryPath($config) + { $base = $config->get('Cache.SerializerPath'); $base = is_null($base) ? HTMLPURIFIER_PREFIX . '/HTMLPurifier/DefinitionCache/Serializer' : $base; return $base; @@ -95,12 +175,13 @@ class HTMLPurifier_DefinitionCache_Serializer extends /** * Convenience wrapper function for file_put_contents - * @param $file File name to write to - * @param $data Data to write into file - * @param $config Config object - * @return Number of bytes written if success, or false if failure. + * @param string $file File name to write to + * @param string $data Data to write into file + * @param HTMLPurifier_Config $config + * @return int|bool Number of bytes written if success, or false if failure. */ - private function _write($file, $data, $config) { + private function _write($file, $data, $config) + { $result = file_put_contents($file, $data); if ($result !== false) { // set permissions of the new file (no execute) @@ -116,10 +197,11 @@ class HTMLPurifier_DefinitionCache_Serializer extends /** * Prepares the directory that this type stores the serials in - * @param $config Config object - * @return True if successful + * @param HTMLPurifier_Config $config + * @return bool True if successful */ - private function _prepareDir($config) { + private function _prepareDir($config) + { $directory = $this->generateDirectoryPath($config); $chmod = $config->get('Cache.SerializerPermissions'); if (!$chmod) { @@ -128,9 +210,11 @@ class HTMLPurifier_DefinitionCache_Serializer extends if (!is_dir($directory)) { $base = $this->generateBaseDirectoryPath($config); if (!is_dir($base)) { - trigger_error('Base directory '.$base.' does not exist, + trigger_error( + 'Base directory ' . $base . ' does not exist, please create or change using %Cache.SerializerPath', - E_USER_WARNING); + E_USER_WARNING + ); return false; } elseif (!$this->_testPermissions($base, $chmod)) { return false; @@ -147,18 +231,23 @@ class HTMLPurifier_DefinitionCache_Serializer extends /** * Tests permissions on a directory and throws out friendly * error messages and attempts to chmod it itself if possible - * @param $dir Directory path - * @param $chmod Permissions - * @return True if directory writable + * @param string $dir Directory path + * @param int $chmod Permissions + * @return bool True if directory is writable */ - private function _testPermissions($dir, $chmod) { + private function _testPermissions($dir, $chmod) + { // early abort, if it is writable, everything is hunky-dory - if (is_writable($dir)) return true; + if (is_writable($dir)) { + return true; + } if (!is_dir($dir)) { // generally, you'll want to handle this beforehand // so a more specific error message can be given - trigger_error('Directory '.$dir.' does not exist', - E_USER_WARNING); + trigger_error( + 'Directory ' . $dir . ' does not exist', + E_USER_WARNING + ); return false; } if (function_exists('posix_getuid')) { @@ -166,7 +255,9 @@ class HTMLPurifier_DefinitionCache_Serializer extends if (fileowner($dir) === posix_getuid()) { // we can chmod it ourselves $chmod = $chmod | 0700; - if (chmod($dir, $chmod)) return true; + if (chmod($dir, $chmod)) { + return true; + } } elseif (filegroup($dir) === posix_getgid()) { $chmod = $chmod | 0070; } else { @@ -174,18 +265,21 @@ class HTMLPurifier_DefinitionCache_Serializer extends // need to give global permissions $chmod = $chmod | 0777; } - trigger_error('Directory '.$dir.' not writable, '. + trigger_error( + 'Directory ' . $dir . ' not writable, ' . 'please chmod to ' . decoct($chmod), - E_USER_WARNING); + E_USER_WARNING + ); } else { // generic error message - trigger_error('Directory '.$dir.' not writable, '. + trigger_error( + 'Directory ' . $dir . ' not writable, ' . 'please alter file permissions', - E_USER_WARNING); + E_USER_WARNING + ); } return false; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCacheFactory.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCacheFactory.php index a6ead62818..fd1cc9be46 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCacheFactory.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCacheFactory.php @@ -5,22 +5,36 @@ */ class HTMLPurifier_DefinitionCacheFactory { - + /** + * @type array + */ protected $caches = array('Serializer' => array()); + + /** + * @type array + */ protected $implementations = array(); + + /** + * @type HTMLPurifier_DefinitionCache_Decorator[] + */ protected $decorators = array(); /** * Initialize default decorators */ - public function setup() { + public function setup() + { $this->addDecorator('Cleanup'); } /** * Retrieves an instance of global definition cache factory. + * @param HTMLPurifier_DefinitionCacheFactory $prototype + * @return HTMLPurifier_DefinitionCacheFactory */ - public static function instance($prototype = null) { + public static function instance($prototype = null) + { static $instance; if ($prototype !== null) { $instance = $prototype; @@ -33,19 +47,22 @@ class HTMLPurifier_DefinitionCacheFactory /** * Registers a new definition cache object - * @param $short Short name of cache object, for reference - * @param $long Full class name of cache object, for construction + * @param string $short Short name of cache object, for reference + * @param string $long Full class name of cache object, for construction */ - public function register($short, $long) { + public function register($short, $long) + { $this->implementations[$short] = $long; } /** * Factory method that creates a cache object based on configuration - * @param $name Name of definitions handled by cache - * @param $config Instance of HTMLPurifier_Config + * @param string $type Name of definitions handled by cache + * @param HTMLPurifier_Config $config Config instance + * @return mixed */ - public function create($type, $config) { + public function create($type, $config) + { $method = $config->get('Cache.DefinitionImpl'); if ($method === null) { return new HTMLPurifier_DefinitionCache_Null($type); @@ -53,10 +70,8 @@ class HTMLPurifier_DefinitionCacheFactory if (!empty($this->caches[$method][$type])) { return $this->caches[$method][$type]; } - if ( - isset($this->implementations[$method]) && - class_exists($class = $this->implementations[$method], false) - ) { + if (isset($this->implementations[$method]) && + class_exists($class = $this->implementations[$method], false)) { $cache = new $class($type); } else { if ($method != 'Serializer') { @@ -76,16 +91,16 @@ class HTMLPurifier_DefinitionCacheFactory /** * Registers a decorator to add to all new cache objects - * @param + * @param HTMLPurifier_DefinitionCache_Decorator|string $decorator An instance or the name of a decorator */ - public function addDecorator($decorator) { + public function addDecorator($decorator) + { if (is_string($decorator)) { $class = "HTMLPurifier_DefinitionCache_Decorator_$decorator"; $decorator = new $class; } $this->decorators[$decorator->name] = $decorator; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Doctype.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Doctype.php index 1e3c574c06..4acd06e5bd 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Doctype.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Doctype.php @@ -10,42 +10,55 @@ class HTMLPurifier_Doctype { /** * Full name of doctype + * @type string */ public $name; /** * List of standard modules (string identifiers or literal objects) * that this doctype uses + * @type array */ public $modules = array(); /** * List of modules to use for tidying up code + * @type array */ public $tidyModules = array(); /** * Is the language derived from XML (i.e. XHTML)? + * @type bool */ public $xml = true; /** * List of aliases for this doctype + * @type array */ public $aliases = array(); /** * Public DTD identifier + * @type string */ public $dtdPublic; /** * System DTD identifier + * @type string */ public $dtdSystem; - public function __construct($name = null, $xml = true, $modules = array(), - $tidyModules = array(), $aliases = array(), $dtd_public = null, $dtd_system = null + public function __construct( + $name = null, + $xml = true, + $modules = array(), + $tidyModules = array(), + $aliases = array(), + $dtd_public = null, + $dtd_system = null ) { $this->name = $name; $this->xml = $xml; diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DoctypeRegistry.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DoctypeRegistry.php index 86049e9391..acc1d64a62 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DoctypeRegistry.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DoctypeRegistry.php @@ -4,12 +4,14 @@ class HTMLPurifier_DoctypeRegistry { /** - * Hash of doctype names to doctype objects + * Hash of doctype names to doctype objects. + * @type array */ protected $doctypes; /** - * Lookup table of aliases to real doctype names + * Lookup table of aliases to real doctype names. + * @type array */ protected $aliases; @@ -17,32 +19,57 @@ class HTMLPurifier_DoctypeRegistry * Registers a doctype to the registry * @note Accepts a fully-formed doctype object, or the * parameters for constructing a doctype object - * @param $doctype Name of doctype or literal doctype object - * @param $modules Modules doctype will load - * @param $modules_for_modes Modules doctype will load for certain modes - * @param $aliases Alias names for doctype - * @return Editable registered doctype + * @param string $doctype Name of doctype or literal doctype object + * @param bool $xml + * @param array $modules Modules doctype will load + * @param array $tidy_modules Modules doctype will load for certain modes + * @param array $aliases Alias names for doctype + * @param string $dtd_public + * @param string $dtd_system + * @return HTMLPurifier_Doctype Editable registered doctype */ - public function register($doctype, $xml = true, $modules = array(), - $tidy_modules = array(), $aliases = array(), $dtd_public = null, $dtd_system = null + public function register( + $doctype, + $xml = true, + $modules = array(), + $tidy_modules = array(), + $aliases = array(), + $dtd_public = null, + $dtd_system = null ) { - if (!is_array($modules)) $modules = array($modules); - if (!is_array($tidy_modules)) $tidy_modules = array($tidy_modules); - if (!is_array($aliases)) $aliases = array($aliases); + if (!is_array($modules)) { + $modules = array($modules); + } + if (!is_array($tidy_modules)) { + $tidy_modules = array($tidy_modules); + } + if (!is_array($aliases)) { + $aliases = array($aliases); + } if (!is_object($doctype)) { $doctype = new HTMLPurifier_Doctype( - $doctype, $xml, $modules, $tidy_modules, $aliases, $dtd_public, $dtd_system + $doctype, + $xml, + $modules, + $tidy_modules, + $aliases, + $dtd_public, + $dtd_system ); } $this->doctypes[$doctype->name] = $doctype; $name = $doctype->name; // hookup aliases foreach ($doctype->aliases as $alias) { - if (isset($this->doctypes[$alias])) continue; + if (isset($this->doctypes[$alias])) { + continue; + } $this->aliases[$alias] = $name; } // remove old aliases - if (isset($this->aliases[$name])) unset($this->aliases[$name]); + if (isset($this->aliases[$name])) { + unset($this->aliases[$name]); + } return $doctype; } @@ -50,11 +77,14 @@ class HTMLPurifier_DoctypeRegistry * Retrieves reference to a doctype of a certain name * @note This function resolves aliases * @note When possible, use the more fully-featured make() - * @param $doctype Name of doctype - * @return Editable doctype object + * @param string $doctype Name of doctype + * @return HTMLPurifier_Doctype Editable doctype object */ - public function get($doctype) { - if (isset($this->aliases[$doctype])) $doctype = $this->aliases[$doctype]; + public function get($doctype) + { + if (isset($this->aliases[$doctype])) { + $doctype = $this->aliases[$doctype]; + } if (!isset($this->doctypes[$doctype])) { trigger_error('Doctype ' . htmlspecialchars($doctype) . ' does not exist', E_USER_ERROR); $anon = new HTMLPurifier_Doctype($doctype); @@ -70,20 +100,30 @@ class HTMLPurifier_DoctypeRegistry * can hold on to (this is necessary in order to tell * Generator whether or not the current document is XML * based or not). + * @param HTMLPurifier_Config $config + * @return HTMLPurifier_Doctype */ - public function make($config) { + public function make($config) + { return clone $this->get($this->getDoctypeFromConfig($config)); } /** * Retrieves the doctype from the configuration object + * @param HTMLPurifier_Config $config + * @return string */ - public function getDoctypeFromConfig($config) { + public function getDoctypeFromConfig($config) + { // recommended test $doctype = $config->get('HTML.Doctype'); - if (!empty($doctype)) return $doctype; + if (!empty($doctype)) { + return $doctype; + } $doctype = $config->get('HTML.CustomDoctype'); - if (!empty($doctype)) return $doctype; + if (!empty($doctype)) { + return $doctype; + } // backwards-compatibility if ($config->get('HTML.XHTML')) { $doctype = 'XHTML 1.0'; @@ -97,7 +137,6 @@ class HTMLPurifier_DoctypeRegistry } return $doctype; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ElementDef.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ElementDef.php index 10f7ab7f8c..d5311cedcf 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ElementDef.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ElementDef.php @@ -10,15 +10,16 @@ */ class HTMLPurifier_ElementDef { - /** * Does the definition work by itself, or is it created solely * for the purpose of merging into another definition? + * @type bool */ public $standalone = true; /** - * Associative array of attribute name to HTMLPurifier_AttrDef + * Associative array of attribute name to HTMLPurifier_AttrDef. + * @type array * @note Before being processed by HTMLPurifier_AttrCollections * when modules are finalized during * HTMLPurifier_HTMLDefinition->setup(), this array may also @@ -43,26 +44,30 @@ class HTMLPurifier_ElementDef // nuking. /** - * List of tags HTMLPurifier_AttrTransform to be done before validation + * List of tags HTMLPurifier_AttrTransform to be done before validation. + * @type array */ public $attr_transform_pre = array(); /** - * List of tags HTMLPurifier_AttrTransform to be done after validation + * List of tags HTMLPurifier_AttrTransform to be done after validation. + * @type array */ public $attr_transform_post = array(); /** * HTMLPurifier_ChildDef of this tag. + * @type HTMLPurifier_ChildDef */ public $child; /** - * Abstract string representation of internal ChildDef rules. See - * HTMLPurifier_ContentSets for how this is parsed and then transformed + * Abstract string representation of internal ChildDef rules. + * @see HTMLPurifier_ContentSets for how this is parsed and then transformed * into an HTMLPurifier_ChildDef. * @warning This is a temporary variable that is not available after * being processed by HTMLDefinition + * @type string */ public $content_model; @@ -72,27 +77,29 @@ class HTMLPurifier_ElementDef * @warning This must be lowercase * @warning This is a temporary variable that is not available after * being processed by HTMLDefinition + * @type string */ public $content_model_type; - - /** * Does the element have a content model (#PCDATA | Inline)*? This * is important for chameleon ins and del processing in * HTMLPurifier_ChildDef_Chameleon. Dynamically set: modules don't * have to worry about this one. + * @type bool */ public $descendants_are_inline = false; /** - * List of the names of required attributes this element has. Dynamically - * populated by HTMLPurifier_HTMLDefinition::getElement + * List of the names of required attributes this element has. + * Dynamically populated by HTMLPurifier_HTMLDefinition::getElement() + * @type array */ public $required_attr = array(); /** * Lookup table of tags excluded from all descendants of this tag. + * @type array * @note SGML permits exclusions for all descendants, but this is * not possible with DTDs or XML Schemas. W3C has elected to * use complicated compositions of content_models to simulate @@ -106,6 +113,7 @@ class HTMLPurifier_ElementDef /** * This tag is explicitly auto-closed by the following tags. + * @type array */ public $autoclose = array(); @@ -113,19 +121,22 @@ class HTMLPurifier_ElementDef * If a foreign element is found in this element, test if it is * allowed by this sub-element; if it is, instead of closing the * current element, place it inside this element. + * @type string */ public $wrap; /** * Whether or not this is a formatting element affected by the * "Active Formatting Elements" algorithm. + * @type bool */ public $formatting; /** * Low-level factory constructor for creating new standalone element defs */ - public static function create($content_model, $content_model_type, $attr) { + public static function create($content_model, $content_model_type, $attr) + { $def = new HTMLPurifier_ElementDef(); $def->content_model = $content_model; $def->content_model_type = $content_model_type; @@ -137,11 +148,12 @@ class HTMLPurifier_ElementDef * Merges the values of another element definition into this one. * Values from the new element def take precedence if a value is * not mergeable. + * @param HTMLPurifier_ElementDef $def */ - public function mergeIn($def) { - + public function mergeIn($def) + { // later keys takes precedence - foreach($def->attr as $k => $v) { + foreach ($def->attr as $k => $v) { if ($k === 0) { // merge in the includes // sorry, no way to override an include @@ -151,7 +163,9 @@ class HTMLPurifier_ElementDef continue; } if ($v === false) { - if (isset($this->attr[$k])) unset($this->attr[$k]); + if (isset($this->attr[$k])) { + unset($this->attr[$k]); + } continue; } $this->attr[$k] = $v; @@ -160,19 +174,24 @@ class HTMLPurifier_ElementDef $this->attr_transform_pre = array_merge($this->attr_transform_pre, $def->attr_transform_pre); $this->attr_transform_post = array_merge($this->attr_transform_post, $def->attr_transform_post); - if(!empty($def->content_model)) { + if (!empty($def->content_model)) { $this->content_model = str_replace("#SUPER", $this->content_model, $def->content_model); $this->child = false; } - if(!empty($def->content_model_type)) { + if (!empty($def->content_model_type)) { $this->content_model_type = $def->content_model_type; $this->child = false; } - if(!is_null($def->child)) $this->child = $def->child; - if(!is_null($def->formatting)) $this->formatting = $def->formatting; - if($def->descendants_are_inline) $this->descendants_are_inline = $def->descendants_are_inline; - + if (!is_null($def->child)) { + $this->child = $def->child; + } + if (!is_null($def->formatting)) { + $this->formatting = $def->formatting; + } + if ($def->descendants_are_inline) { + $this->descendants_are_inline = $def->descendants_are_inline; + } } /** @@ -180,16 +199,18 @@ class HTMLPurifier_ElementDef * @param $a1 Array by reference that is merged into * @param $a2 Array that merges into $a1 */ - private function _mergeAssocArray(&$a1, $a2) { + private function _mergeAssocArray(&$a1, $a2) + { foreach ($a2 as $k => $v) { if ($v === false) { - if (isset($a1[$k])) unset($a1[$k]); + if (isset($a1[$k])) { + unset($a1[$k]); + } continue; } $a1[$k] = $v; } } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php index 77988a1925..fef9b58906 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php @@ -10,19 +10,27 @@ class HTMLPurifier_Encoder /** * Constructor throws fatal error if you attempt to instantiate class */ - private function __construct() { + private function __construct() + { trigger_error('Cannot instantiate encoder, call methods statically', E_USER_ERROR); } /** * Error-handler that mutes errors, alternative to shut-up operator. */ - public static function muteErrorHandler() {} + public static function muteErrorHandler() + { + } /** * iconv wrapper which mutes errors, but doesn't work around bugs. + * @param string $in Input encoding + * @param string $out Output encoding + * @param string $text The text to convert + * @return string */ - public static function unsafeIconv($in, $out, $text) { + public static function unsafeIconv($in, $out, $text) + { set_error_handler(array('HTMLPurifier_Encoder', 'muteErrorHandler')); $r = iconv($in, $out, $text); restore_error_handler(); @@ -31,8 +39,14 @@ class HTMLPurifier_Encoder /** * iconv wrapper which mutes errors and works around bugs. + * @param string $in Input encoding + * @param string $out Output encoding + * @param string $text The text to convert + * @param int $max_chunk_size + * @return string */ - public static function iconv($in, $out, $text, $max_chunk_size = 8000) { + public static function iconv($in, $out, $text, $max_chunk_size = 8000) + { $code = self::testIconvTruncateBug(); if ($code == self::ICONV_OK) { return self::unsafeIconv($in, $out, $text); @@ -87,6 +101,10 @@ class HTMLPurifier_Encoder * It will parse according to UTF-8 and return a valid UTF8 string, with * non-SGML codepoints excluded. * + * @param string $str The string to clean + * @param bool $force_php + * @return string + * * @note Just for reference, the non-SGML code points are 0 to 31 and * 127 to 159, inclusive. However, we allow code points 9, 10 * and 13, which are the tab, line feed and carriage return @@ -106,14 +124,17 @@ class HTMLPurifier_Encoder * would need that, and I'm probably not going to implement them. * Once again, PHP 6 should solve all our problems. */ - public static function cleanUTF8($str, $force_php = false) { - + public static function cleanUTF8($str, $force_php = false) + { // UTF-8 validity is checked since PHP 4.3.5 // This is an optimization: if the string is already valid UTF-8, no // need to do PHP stuff. 99% of the time, this will be the case. // The regexp matches the XML char production, as well as well as excluding // non-SGML codepoints U+007F to U+009F - if (preg_match('/^[\x{9}\x{A}\x{D}\x{20}-\x{7E}\x{A0}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]*$/Du', $str)) { + if (preg_match( + '/^[\x{9}\x{A}\x{D}\x{20}-\x{7E}\x{A0}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]*$/Du', + $str + )) { return $str; } @@ -132,7 +153,7 @@ class HTMLPurifier_Encoder $char = ''; $len = strlen($str); - for($i = 0; $i < $len; $i++) { + for ($i = 0; $i < $len; $i++) { $in = ord($str{$i}); $char .= $str[$i]; // append byte to char if (0 == $mState) { @@ -285,8 +306,9 @@ class HTMLPurifier_Encoder // | 00000000 | 00010000 | 11111111 | 11111111 | Defined upper limit of legal scalar codes // +----------+----------+----------+----------+ - public static function unichr($code) { - if($code > 1114111 or $code < 0 or + public static function unichr($code) + { + if ($code > 1114111 or $code < 0 or ($code >= 55296 and $code <= 57343) ) { // bits are set outside the "valid" range as defined // by UNICODE 4.1.0 @@ -304,7 +326,7 @@ class HTMLPurifier_Encoder $y = (($code & 2047) >> 6) | 192; } else { $y = (($code & 4032) >> 6) | 128; - if($code < 65536) { + if ($code < 65536) { $z = (($code >> 12) & 15) | 224; } else { $z = (($code >> 12) & 63) | 128; @@ -314,15 +336,25 @@ class HTMLPurifier_Encoder } // set up the actual character $ret = ''; - if($w) $ret .= chr($w); - if($z) $ret .= chr($z); - if($y) $ret .= chr($y); + if ($w) { + $ret .= chr($w); + } + if ($z) { + $ret .= chr($z); + } + if ($y) { + $ret .= chr($y); + } $ret .= chr($x); return $ret; } - public static function iconvAvailable() { + /** + * @return bool + */ + public static function iconvAvailable() + { static $iconv = null; if ($iconv === null) { $iconv = function_exists('iconv') && self::testIconvTruncateBug() != self::ICONV_UNUSABLE; @@ -331,13 +363,22 @@ class HTMLPurifier_Encoder } /** - * Converts a string to UTF-8 based on configuration. + * Convert a string to UTF-8 based on configuration. + * @param string $str The string to convert + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string */ - public static function convertToUTF8($str, $config, $context) { + public static function convertToUTF8($str, $config, $context) + { $encoding = $config->get('Core.Encoding'); - if ($encoding === 'utf-8') return $str; + if ($encoding === 'utf-8') { + return $str; + } static $iconv = null; - if ($iconv === null) $iconv = self::iconvAvailable(); + if ($iconv === null) { + $iconv = self::iconvAvailable(); + } if ($iconv && !$config->get('Test.ForceNoIconv')) { // unaffected by bugs, since UTF-8 support all characters $str = self::unsafeIconv($encoding, 'utf-8//IGNORE', $str); @@ -359,29 +400,44 @@ class HTMLPurifier_Encoder if ($bug == self::ICONV_OK) { trigger_error('Encoding not supported, please install iconv', E_USER_ERROR); } else { - trigger_error('You have a buggy version of iconv, see https://bugs.php.net/bug.php?id=48147 and http://sourceware.org/bugzilla/show_bug.cgi?id=13541', E_USER_ERROR); + trigger_error( + 'You have a buggy version of iconv, see https://bugs.php.net/bug.php?id=48147 ' . + 'and http://sourceware.org/bugzilla/show_bug.cgi?id=13541', + E_USER_ERROR + ); } } /** * Converts a string from UTF-8 based on configuration. + * @param string $str The string to convert + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string * @note Currently, this is a lossy conversion, with unexpressable * characters being omitted. */ - public static function convertFromUTF8($str, $config, $context) { + public static function convertFromUTF8($str, $config, $context) + { $encoding = $config->get('Core.Encoding'); if ($escape = $config->get('Core.EscapeNonASCIICharacters')) { $str = self::convertToASCIIDumbLossless($str); } - if ($encoding === 'utf-8') return $str; + if ($encoding === 'utf-8') { + return $str; + } static $iconv = null; - if ($iconv === null) $iconv = self::iconvAvailable(); + if ($iconv === null) { + $iconv = self::iconvAvailable(); + } if ($iconv && !$config->get('Test.ForceNoIconv')) { // Undo our previous fix in convertToUTF8, otherwise iconv will barf $ascii_fix = self::testEncodingSupportsASCII($encoding); if (!$escape && !empty($ascii_fix)) { $clear_fix = array(); - foreach ($ascii_fix as $utf8 => $native) $clear_fix[$utf8] = ''; + foreach ($ascii_fix as $utf8 => $native) { + $clear_fix[$utf8] = ''; + } $str = strtr($str, $clear_fix); } $str = strtr($str, array_flip($ascii_fix)); @@ -401,8 +457,8 @@ class HTMLPurifier_Encoder /** * Lossless (character-wise) conversion of HTML to ASCII - * @param $str UTF-8 string to be converted to ASCII - * @returns ASCII encoded string with non-ASCII character entity-ized + * @param string $str UTF-8 string to be converted to ASCII + * @return string ASCII encoded string with non-ASCII character entity-ized * @warning Adapted from MediaWiki, claiming fair use: this is a common * algorithm. If you disagree with this license fudgery, * implement it yourself. @@ -415,27 +471,28 @@ class HTMLPurifier_Encoder * @note Sort of with cleanUTF8() but it assumes that $str is * well-formed UTF-8 */ - public static function convertToASCIIDumbLossless($str) { + public static function convertToASCIIDumbLossless($str) + { $bytesleft = 0; $result = ''; $working = 0; $len = strlen($str); - for( $i = 0; $i < $len; $i++ ) { - $bytevalue = ord( $str[$i] ); - if( $bytevalue <= 0x7F ) { //0xxx xxxx - $result .= chr( $bytevalue ); + for ($i = 0; $i < $len; $i++) { + $bytevalue = ord($str[$i]); + if ($bytevalue <= 0x7F) { //0xxx xxxx + $result .= chr($bytevalue); $bytesleft = 0; - } elseif( $bytevalue <= 0xBF ) { //10xx xxxx + } elseif ($bytevalue <= 0xBF) { //10xx xxxx $working = $working << 6; $working += ($bytevalue & 0x3F); $bytesleft--; - if( $bytesleft <= 0 ) { + if ($bytesleft <= 0) { $result .= "&#" . $working . ";"; } - } elseif( $bytevalue <= 0xDF ) { //110x xxxx + } elseif ($bytevalue <= 0xDF) { //110x xxxx $working = $bytevalue & 0x1F; $bytesleft = 1; - } elseif( $bytevalue <= 0xEF ) { //1110 xxxx + } elseif ($bytevalue <= 0xEF) { //1110 xxxx $working = $bytevalue & 0x0F; $bytesleft = 2; } else { //1111 0xxx @@ -469,9 +526,10 @@ class HTMLPurifier_Encoder * characters, as long as PHP ignores the error code. If PHP starts * paying attention to the error code, iconv becomes unusable. * - * @returns Error code indicating severity of bug. + * @return int Error code indicating severity of bug. */ - public static function testIconvTruncateBug() { + public static function testIconvTruncateBug() + { static $code = null; if ($code === null) { // better not use iconv, otherwise infinite loop! @@ -481,7 +539,11 @@ class HTMLPurifier_Encoder } elseif (($c = strlen($r)) < 9000) { $code = self::ICONV_TRUNCATES; } elseif ($c > 9000) { - trigger_error('Your copy of iconv is extremely buggy. Please notify HTML Purifier maintainers: include your iconv version as per phpversion()', E_USER_ERROR); + trigger_error( + 'Your copy of iconv is extremely buggy. Please notify HTML Purifier maintainers: ' . + 'include your iconv version as per phpversion()', + E_USER_ERROR + ); } else { $code = self::ICONV_OK; } @@ -500,7 +562,8 @@ class HTMLPurifier_Encoder * @return Array of UTF-8 characters to their corresponding ASCII, * which can be used to "undo" any overzealous iconv action. */ - public static function testEncodingSupportsASCII($encoding, $bypass = false) { + public static function testEncodingSupportsASCII($encoding, $bypass = false) + { // All calls to iconv here are unsafe, proof by case analysis: // If ICONV_OK, no difference. // If ICONV_TRUNCATE, all calls involve one character inputs, @@ -508,7 +571,9 @@ class HTMLPurifier_Encoder // If ICONV_UNUSABLE, this call is irrelevant static $encodings = array(); if (!$bypass) { - if (isset($encodings[$encoding])) return $encodings[$encoding]; + if (isset($encodings[$encoding])) { + return $encodings[$encoding]; + } $lenc = strtolower($encoding); switch ($lenc) { case 'shift_jis': @@ -516,15 +581,18 @@ class HTMLPurifier_Encoder case 'johab': return array("\xE2\x82\xA9" => '\\'); } - if (strpos($lenc, 'iso-8859-') === 0) return array(); + if (strpos($lenc, 'iso-8859-') === 0) { + return array(); + } } $ret = array(); - if (self::unsafeIconv('UTF-8', $encoding, 'a') === false) return false; + if (self::unsafeIconv('UTF-8', $encoding, 'a') === false) { + return false; + } for ($i = 0x20; $i <= 0x7E; $i++) { // all printable ASCII chars $c = chr($i); // UTF-8 char $r = self::unsafeIconv('UTF-8', "$encoding//IGNORE", $c); // initial conversion - if ( - $r === '' || + if ($r === '' || // This line is needed for iconv implementations that do not // omit characters that do not exist in the target character set ($r === $c && self::unsafeIconv($encoding, 'UTF-8//IGNORE', $r) !== $c) @@ -538,8 +606,6 @@ class HTMLPurifier_Encoder $encodings[$encoding] = $ret; return $ret; } - - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/EntityLookup.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/EntityLookup.php index b4dfce94c3..f12ff13a35 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/EntityLookup.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/EntityLookup.php @@ -3,20 +3,23 @@ /** * Object that provides entity lookup table from entity name to character */ -class HTMLPurifier_EntityLookup { - +class HTMLPurifier_EntityLookup +{ /** * Assoc array of entity name to character represented. + * @type array */ public $table; /** * Sets up the entity lookup table from the serialized file contents. + * @param bool $file * @note The serialized contents are versioned, but were generated * using the maintenance script generate_entity_file.php * @warning This is not in constructor to help enforce the Singleton */ - public function setup($file = false) { + public function setup($file = false) + { if (!$file) { $file = HTMLPURIFIER_PREFIX . '/HTMLPurifier/EntityLookup/entities.ser'; } @@ -25,9 +28,11 @@ class HTMLPurifier_EntityLookup { /** * Retrieves sole instance of the object. - * @param Optional prototype of custom lookup table to overload with. + * @param bool|HTMLPurifier_EntityLookup $prototype Optional prototype of custom lookup table to overload with. + * @return HTMLPurifier_EntityLookup */ - public static function instance($prototype = false) { + public static function instance($prototype = false) + { // no references, since PHP doesn't copy unless modified static $instance = null; if ($prototype) { @@ -38,7 +43,6 @@ class HTMLPurifier_EntityLookup { } return $instance; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/EntityParser.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/EntityParser.php index 8c384472dc..61529dcd9d 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/EntityParser.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/EntityParser.php @@ -12,19 +12,21 @@ class HTMLPurifier_EntityParser /** * Reference to entity lookup table. + * @type HTMLPurifier_EntityLookup */ protected $_entity_lookup; /** * Callback regex string for parsing entities. + * @type string */ protected $_substituteEntitiesRegex = -'/&(?:[#]x([a-fA-F0-9]+)|[#]0*(\d+)|([A-Za-z_:][A-Za-z0-9.\-_:]*));?/'; -// 1. hex 2. dec 3. string (XML style) - + '/&(?:[#]x([a-fA-F0-9]+)|[#]0*(\d+)|([A-Za-z_:][A-Za-z0-9.\-_:]*));?/'; + // 1. hex 2. dec 3. string (XML style) /** * Decimal to parsed string conversion table for special entities. + * @type array */ protected $_special_dec2str = array( @@ -37,6 +39,7 @@ class HTMLPurifier_EntityParser /** * Stripped entity names to decimal conversion table for special entities. + * @type array */ protected $_special_ent2dec = array( @@ -51,41 +54,45 @@ class HTMLPurifier_EntityParser * running this whenever you have parsed character is t3h 5uck, we run * it before everything else. * - * @param $string String to have non-special entities parsed. - * @returns Parsed string. + * @param string $string String to have non-special entities parsed. + * @return string Parsed string. */ - public function substituteNonSpecialEntities($string) { + public function substituteNonSpecialEntities($string) + { // it will try to detect missing semicolons, but don't rely on it return preg_replace_callback( $this->_substituteEntitiesRegex, array($this, 'nonSpecialEntityCallback'), $string - ); + ); } /** * Callback function for substituteNonSpecialEntities() that does the work. * - * @param $matches PCRE matches array, with 0 the entire match, and + * @param array $matches PCRE matches array, with 0 the entire match, and * either index 1, 2 or 3 set with a hex value, dec value, * or string (respectively). - * @returns Replacement string. + * @return string Replacement string. */ - protected function nonSpecialEntityCallback($matches) { + protected function nonSpecialEntityCallback($matches) + { // replaces all but big five $entity = $matches[0]; $is_num = (@$matches[0][1] === '#'); if ($is_num) { $is_hex = (@$entity[2] === 'x'); $code = $is_hex ? hexdec($matches[1]) : (int) $matches[2]; - // abort for special characters - if (isset($this->_special_dec2str[$code])) return $entity; - + if (isset($this->_special_dec2str[$code])) { + return $entity; + } return HTMLPurifier_Encoder::unichr($code); } else { - if (isset($this->_special_ent2dec[$matches[3]])) return $entity; + if (isset($this->_special_ent2dec[$matches[3]])) { + return $entity; + } if (!$this->_entity_lookup) { $this->_entity_lookup = HTMLPurifier_EntityLookup::instance(); } @@ -103,14 +110,16 @@ class HTMLPurifier_EntityParser * @notice We try to avoid calling this function because otherwise, it * would have to be called a lot (for every parsed section). * - * @param $string String to have non-special entities parsed. - * @returns Parsed string. + * @param string $string String to have non-special entities parsed. + * @return string Parsed string. */ - public function substituteSpecialEntities($string) { + public function substituteSpecialEntities($string) + { return preg_replace_callback( $this->_substituteEntitiesRegex, array($this, 'specialEntityCallback'), - $string); + $string + ); } /** @@ -118,12 +127,13 @@ class HTMLPurifier_EntityParser * * This callback has same syntax as nonSpecialEntityCallback(). * - * @param $matches PCRE-style matches array, with 0 the entire match, and + * @param array $matches PCRE-style matches array, with 0 the entire match, and * either index 1, 2 or 3 set with a hex value, dec value, * or string (respectively). - * @returns Replacement string. + * @return string Replacement string. */ - protected function specialEntityCallback($matches) { + protected function specialEntityCallback($matches) + { $entity = $matches[0]; $is_num = (@$matches[0][1] === '#'); if ($is_num) { @@ -138,7 +148,6 @@ class HTMLPurifier_EntityParser $entity; } } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ErrorCollector.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ErrorCollector.php index 6713eaf773..d47e3f2e24 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ErrorCollector.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ErrorCollector.php @@ -16,16 +16,46 @@ class HTMLPurifier_ErrorCollector const MESSAGE = 2; const CHILDREN = 3; + /** + * @type array + */ protected $errors; + + /** + * @type array + */ protected $_current; + + /** + * @type array + */ protected $_stacks = array(array()); + + /** + * @type HTMLPurifier_Language + */ protected $locale; + + /** + * @type HTMLPurifier_Generator + */ protected $generator; + + /** + * @type HTMLPurifier_Context + */ protected $context; + /** + * @type array + */ protected $lines = array(); - public function __construct($context) { + /** + * @param HTMLPurifier_Context $context + */ + public function __construct($context) + { $this->locale =& $context->get('Locale'); $this->context = $context; $this->_current =& $this->_stacks[0]; @@ -34,13 +64,11 @@ class HTMLPurifier_ErrorCollector /** * Sends an error message to the collector for later use - * @param $severity int Error severity, PHP error style (don't use E_USER_) - * @param $msg string Error message text - * @param $subst1 string First substitution for $msg - * @param $subst2 string ... + * @param int $severity Error severity, PHP error style (don't use E_USER_) + * @param string $msg Error message text */ - public function send($severity, $msg) { - + public function send($severity, $msg) + { $args = array(); if (func_num_args() > 2) { $args = func_get_args(); @@ -50,7 +78,7 @@ class HTMLPurifier_ErrorCollector $token = $this->context->get('CurrentToken', true); $line = $token ? $token->line : $this->context->get('CurrentLine', true); - $col = $token ? $token->col : $this->context->get('CurrentCol', true); + $col = $token ? $token->col : $this->context->get('CurrentCol', true); $attr = $this->context->get('CurrentAttr', true); // perform special substitutions, also add custom parameters @@ -60,7 +88,9 @@ class HTMLPurifier_ErrorCollector } if (!is_null($attr)) { $subst['$CurrentAttr.Name'] = $attr; - if (isset($token->attr[$attr])) $subst['$CurrentAttr.Value'] = $token->attr[$attr]; + if (isset($token->attr[$attr])) { + $subst['$CurrentAttr.Value'] = $token->attr[$attr]; + } } if (empty($args)) { @@ -69,7 +99,9 @@ class HTMLPurifier_ErrorCollector $msg = $this->locale->formatMessage($msg, $args); } - if (!empty($subst)) $msg = strtr($msg, $subst); + if (!empty($subst)) { + $msg = strtr($msg, $subst); + } // (numerically indexed) $error = array( @@ -80,16 +112,15 @@ class HTMLPurifier_ErrorCollector ); $this->_current[] = $error; - // NEW CODE BELOW ... - - $struct = null; // Top-level errors are either: // TOKEN type, if $value is set appropriately, or // "syntax" type, if $value is null $new_struct = new HTMLPurifier_ErrorStruct(); $new_struct->type = HTMLPurifier_ErrorStruct::TOKEN; - if ($token) $new_struct->value = clone $token; + if ($token) { + $new_struct->value = clone $token; + } if (is_int($line) && is_int($col)) { if (isset($this->lines[$line][$col])) { $struct = $this->lines[$line][$col]; @@ -128,30 +159,34 @@ class HTMLPurifier_ErrorCollector /** * Retrieves raw error data for custom formatter to use - * @param List of arrays in format of array(line of error, - * error severity, error message, - * recursive sub-errors array) */ - public function getRaw() { + public function getRaw() + { return $this->errors; } /** * Default HTML formatting implementation for error messages - * @param $config Configuration array, vital for HTML output nature - * @param $errors Errors array to display; used for recursion. + * @param HTMLPurifier_Config $config Configuration, vital for HTML output nature + * @param array $errors Errors array to display; used for recursion. + * @return string */ - public function getHTMLFormatted($config, $errors = null) { + public function getHTMLFormatted($config, $errors = null) + { $ret = array(); $this->generator = new HTMLPurifier_Generator($config, $this->context); - if ($errors === null) $errors = $this->errors; + if ($errors === null) { + $errors = $this->errors; + } // 'At line' message needs to be removed // generation code for new structure goes here. It needs to be recursive. foreach ($this->lines as $line => $col_array) { - if ($line == -1) continue; + if ($line == -1) { + continue; + } foreach ($col_array as $col => $struct) { $this->_renderStruct($ret, $struct, $line, $col); } @@ -168,7 +203,8 @@ class HTMLPurifier_ErrorCollector } - private function _renderStruct(&$ret, $struct, $line = null, $col = null) { + private function _renderStruct(&$ret, $struct, $line = null, $col = null) + { $stack = array($struct); $context_stack = array(array()); while ($current = array_pop($stack)) { @@ -194,7 +230,7 @@ class HTMLPurifier_ErrorCollector //$string .= ''; $ret[] = $string; } - foreach ($current->children as $type => $array) { + foreach ($current->children as $array) { $context[] = $current; $stack = array_merge($stack, array_reverse($array, true)); for ($i = count($array); $i > 0; $i--) { @@ -203,7 +239,6 @@ class HTMLPurifier_ErrorCollector } } } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ErrorStruct.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ErrorStruct.php index 9bc8996ec1..cf869d3212 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ErrorStruct.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ErrorStruct.php @@ -19,6 +19,7 @@ class HTMLPurifier_ErrorStruct /** * Type of this struct. + * @type string */ public $type; @@ -28,11 +29,13 @@ class HTMLPurifier_ErrorStruct * - TOKEN: Instance of HTMLPurifier_Token * - ATTR: array('attr-name', 'value') * - CSSPROP: array('prop-name', 'value') + * @type mixed */ public $value; /** * Errors registered for this structure. + * @type array */ public $errors = array(); @@ -40,10 +43,17 @@ class HTMLPurifier_ErrorStruct * Child ErrorStructs that are from this structure. For example, a TOKEN * ErrorStruct would contain ATTR ErrorStructs. This is a multi-dimensional * array in structure: [TYPE]['identifier'] + * @type array */ public $children = array(); - public function getChild($type, $id) { + /** + * @param string $type + * @param string $id + * @return mixed + */ + public function getChild($type, $id) + { if (!isset($this->children[$type][$id])) { $this->children[$type][$id] = new HTMLPurifier_ErrorStruct(); $this->children[$type][$id]->type = $type; @@ -51,10 +61,14 @@ class HTMLPurifier_ErrorStruct return $this->children[$type][$id]; } - public function addError($severity, $message) { + /** + * @param int $severity + * @param string $message + */ + public function addError($severity, $message) + { $this->errors[] = array($severity, $message); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter.php index 9a0e7b09f3..c1f41ee162 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter.php @@ -23,24 +23,34 @@ class HTMLPurifier_Filter { /** - * Name of the filter for identification purposes + * Name of the filter for identification purposes. + * @type string */ public $name; /** * Pre-processor function, handles HTML before HTML Purifier + * @param string $html + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string */ - public function preFilter($html, $config, $context) { + public function preFilter($html, $config, $context) + { return $html; } /** * Post-processor function, handles HTML after HTML Purifier + * @param string $html + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string */ - public function postFilter($html, $config, $context) { + public function postFilter($html, $config, $context) + { return $html; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/ExtractStyleBlocks.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/ExtractStyleBlocks.php index df937ace73..08e62c16bf 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/ExtractStyleBlocks.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/ExtractStyleBlocks.php @@ -4,7 +4,9 @@ // understand how to interpret this filter if it's a static method. // It's all really silly, but if we go this route it might be reasonable // to coalesce all of these methods into one. -function htmlpurifier_filter_extractstyleblocks_muteerrorhandler() {} +function htmlpurifier_filter_extractstyleblocks_muteerrorhandler() +{ +} /** * This filter extracts #isU', array($this, 'styleCallback'), $html); $style_blocks = $this->_styleMatches; $this->_styleMatches = array(); // reset @@ -69,12 +110,14 @@ class HTMLPurifier_Filter_ExtractStyleBlocks extends HTMLPurifier_Filter /** * Takes CSS (the stuff found in in a font-family prop). if ($config->get('Filter.ExtractStyleBlocks.Escaping')) { $css = str_replace( - array('<', '>', '&'), + array('<', '>', '&'), array('\3C ', '\3E ', '\26 '), $css ); } return $css; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php index 23df221eaa..411519ad69 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php @@ -3,36 +3,62 @@ class HTMLPurifier_Filter_YouTube extends HTMLPurifier_Filter { + /** + * @type string + */ public $name = 'YouTube'; - public function preFilter($html, $config, $context) { - $pre_regex = '#]+>.+?'. + /** + * @param string $html + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string + */ + public function preFilter($html, $config, $context) + { + $pre_regex = '#]+>.+?' . 'http://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+).+?#s'; $pre_replace = '\1'; return preg_replace($pre_regex, $pre_replace, $html); } - public function postFilter($html, $config, $context) { + /** + * @param string $html + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string + */ + public function postFilter($html, $config, $context) + { $post_regex = '#((?:v|cp)/[A-Za-z0-9\-_=]+)#'; return preg_replace_callback($post_regex, array($this, 'postFilterCallback'), $html); } - protected function armorUrl($url) { + /** + * @param $url + * @return string + */ + protected function armorUrl($url) + { return str_replace('--', '--', $url); } - protected function postFilterCallback($matches) { + /** + * @param array $matches + * @return string + */ + protected function postFilterCallback($matches) + { $url = $this->armorUrl($matches[1]); - return ''. - ''. - ''. - ''; - + return '' . + '' . + '' . + ''; } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Generator.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Generator.php index fee1a5f84e..6fb5687146 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Generator.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Generator.php @@ -11,52 +11,61 @@ class HTMLPurifier_Generator { /** - * Whether or not generator should produce XML output + * Whether or not generator should produce XML output. + * @type bool */ private $_xhtml = true; /** - * :HACK: Whether or not generator should comment the insides of )#si', - array($this, 'scriptCallback'), $html); + $html = preg_replace_callback( + '#(]*>)(\s*[^<].+?)()#si', + array($this, 'scriptCallback'), + $html + ); } $html = $this->normalize($html, $config, $context); @@ -55,15 +69,15 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer if ($maintain_line_numbers) { $current_line = 1; - $current_col = 0; + $current_col = 0; $length = strlen($html); } else { $current_line = false; - $current_col = false; + $current_col = false; $length = false; } $context->register('CurrentLine', $current_line); - $context->register('CurrentCol', $current_col); + $context->register('CurrentCol', $current_col); $nl = "\n"; // how often to manually recalculate. This will ALWAYS be right, // but it's pretty wasteful. Set to 0 to turn off @@ -77,16 +91,14 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer // for testing synchronization $loops = 0; - while(++$loops) { - + while (++$loops) { // $cursor is either at the start of a token, or inside of // a tag (i.e. there was a < immediately before it), as indicated // by $inside_tag if ($maintain_line_numbers) { - // $rcursor, however, is always at the start of a token. - $rcursor = $cursor - (int) $inside_tag; + $rcursor = $cursor - (int)$inside_tag; // Column number is cheap, so we calculate it every round. // We're interested at the *end* of the newline string, so @@ -96,14 +108,11 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer $current_col = $rcursor - (is_bool($nl_pos) ? 0 : $nl_pos + 1); // recalculate lines - if ( - $synchronize_interval && // synchronization is on - $cursor > 0 && // cursor is further than zero - $loops % $synchronize_interval === 0 // time to synchronize! - ) { + if ($synchronize_interval && // synchronization is on + $cursor > 0 && // cursor is further than zero + $loops % $synchronize_interval === 0) { // time to synchronize! $current_line = 1 + $this->substrCount($html, $nl, 0, $cursor); } - } $position_next_lt = strpos($html, '<', $cursor); @@ -119,35 +128,42 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer if (!$inside_tag && $position_next_lt !== false) { // We are not inside tag and there still is another tag to parse $token = new - HTMLPurifier_Token_Text( - $this->parseData( - substr( - $html, $cursor, $position_next_lt - $cursor - ) + HTMLPurifier_Token_Text( + $this->parseData( + substr( + $html, + $cursor, + $position_next_lt - $cursor ) - ); + ) + ); if ($maintain_line_numbers) { $token->rawPosition($current_line, $current_col); $current_line += $this->substrCount($html, $nl, $cursor, $position_next_lt - $cursor); } $array[] = $token; - $cursor = $position_next_lt + 1; + $cursor = $position_next_lt + 1; $inside_tag = true; continue; } elseif (!$inside_tag) { // We are not inside tag but there are no more tags // If we're already at the end, break - if ($cursor === strlen($html)) break; + if ($cursor === strlen($html)) { + break; + } // Create Text of rest of string $token = new - HTMLPurifier_Token_Text( - $this->parseData( - substr( - $html, $cursor - ) + HTMLPurifier_Token_Text( + $this->parseData( + substr( + $html, + $cursor ) - ); - if ($maintain_line_numbers) $token->rawPosition($current_line, $current_col); + ) + ); + if ($maintain_line_numbers) { + $token->rawPosition($current_line, $current_col); + } $array[] = $token; break; } elseif ($inside_tag && $position_next_gt !== false) { @@ -171,16 +187,16 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer } // Check if it's a comment - if ( - substr($segment, 0, 3) === '!--' - ) { + if (substr($segment, 0, 3) === '!--') { // re-determine segment length, looking for --> $position_comment_end = strpos($html, '-->', $cursor); if ($position_comment_end === false) { // uh oh, we have a comment that extends to // infinity. Can't be helped: set comment // end position to end of string - if ($e) $e->send(E_WARNING, 'Lexer: Unclosed comment'); + if ($e) { + $e->send(E_WARNING, 'Lexer: Unclosed comment'); + } $position_comment_end = strlen($html); $end = true; } else { @@ -189,11 +205,13 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer $strlen_segment = $position_comment_end - $cursor; $segment = substr($html, $cursor, $strlen_segment); $token = new - HTMLPurifier_Token_Comment( - substr( - $segment, 3, $strlen_segment - 3 - ) - ); + HTMLPurifier_Token_Comment( + substr( + $segment, + 3, + $strlen_segment - 3 + ) + ); if ($maintain_line_numbers) { $token->rawPosition($current_line, $current_col); $current_line += $this->substrCount($html, $nl, $cursor, $strlen_segment); @@ -205,7 +223,7 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer } // Check if it's an end tag - $is_end_tag = (strpos($segment,'/') === 0); + $is_end_tag = (strpos($segment, '/') === 0); if ($is_end_tag) { $type = substr($segment, 1); $token = new HTMLPurifier_Token_End($type); @@ -224,7 +242,9 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer // text and go our merry way if (!ctype_alpha($segment[0])) { // XML: $segment[0] !== '_' && $segment[0] !== ':' - if ($e) $e->send(E_NOTICE, 'Lexer: Unescaped lt'); + if ($e) { + $e->send(E_NOTICE, 'Lexer: Unescaped lt'); + } $token = new HTMLPurifier_Token_Text('<'); if ($maintain_line_numbers) { $token->rawPosition($current_line, $current_col); @@ -239,7 +259,7 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer // trailing slash. Remember, we could have a tag like
, so // any later token processing scripts must convert improperly // classified EmptyTags from StartTags. - $is_self_closing = (strrpos($segment,'/') === $strlen_segment-1); + $is_self_closing = (strrpos($segment, '/') === $strlen_segment - 1); if ($is_self_closing) { $strlen_segment--; $segment = substr($segment, 0, $strlen_segment); @@ -269,14 +289,16 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer $attribute_string = trim( substr( - $segment, $position_first_space + $segment, + $position_first_space ) ); if ($attribute_string) { $attr = $this->parseAttributeString( - $attribute_string - , $config, $context - ); + $attribute_string, + $config, + $context + ); } else { $attr = array(); } @@ -296,15 +318,19 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer continue; } else { // inside tag, but there's no ending > sign - if ($e) $e->send(E_WARNING, 'Lexer: Missing gt'); + if ($e) { + $e->send(E_WARNING, 'Lexer: Missing gt'); + } $token = new - HTMLPurifier_Token_Text( - '<' . - $this->parseData( - substr($html, $cursor) - ) - ); - if ($maintain_line_numbers) $token->rawPosition($current_line, $current_col); + HTMLPurifier_Token_Text( + '<' . + $this->parseData( + substr($html, $cursor) + ) + ); + if ($maintain_line_numbers) { + $token->rawPosition($current_line, $current_col); + } // no cursor scroll? Hmm... $array[] = $token; break; @@ -319,8 +345,14 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer /** * PHP 5.0.x compatible substr_count that implements offset and length + * @param string $haystack + * @param string $needle + * @param int $offset + * @param int $length + * @return int */ - protected function substrCount($haystack, $needle, $offset, $length) { + protected function substrCount($haystack, $needle, $offset, $length) + { static $oldVersion; if ($oldVersion === null) { $oldVersion = version_compare(PHP_VERSION, '5.1', '<'); @@ -336,13 +368,18 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer /** * Takes the inside of an HTML tag and makes an assoc array of attributes. * - * @param $string Inside of tag excluding name. - * @returns Assoc array of attributes. + * @param string $string Inside of tag excluding name. + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array Assoc array of attributes. */ - public function parseAttributeString($string, $config, $context) { - $string = (string) $string; // quick typecast + public function parseAttributeString($string, $config, $context) + { + $string = (string)$string; // quick typecast - if ($string == '') return array(); // no attributes + if ($string == '') { + return array(); + } // no attributes $e = false; if ($config->get('Core.CollectErrors')) { @@ -361,46 +398,55 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer list($key, $quoted_value) = explode('=', $string); $quoted_value = trim($quoted_value); if (!$key) { - if ($e) $e->send(E_ERROR, 'Lexer: Missing attribute key'); + if ($e) { + $e->send(E_ERROR, 'Lexer: Missing attribute key'); + } return array(); } - if (!$quoted_value) return array($key => ''); + if (!$quoted_value) { + return array($key => ''); + } $first_char = @$quoted_value[0]; - $last_char = @$quoted_value[strlen($quoted_value)-1]; + $last_char = @$quoted_value[strlen($quoted_value) - 1]; $same_quote = ($first_char == $last_char); $open_quote = ($first_char == '"' || $first_char == "'"); - if ( $same_quote && $open_quote) { + if ($same_quote && $open_quote) { // well behaved $value = substr($quoted_value, 1, strlen($quoted_value) - 2); } else { // not well behaved if ($open_quote) { - if ($e) $e->send(E_ERROR, 'Lexer: Missing end quote'); + if ($e) { + $e->send(E_ERROR, 'Lexer: Missing end quote'); + } $value = substr($quoted_value, 1); } else { $value = $quoted_value; } } - if ($value === false) $value = ''; + if ($value === false) { + $value = ''; + } return array($key => $this->parseData($value)); } // setup loop environment - $array = array(); // return assoc array of attributes + $array = array(); // return assoc array of attributes $cursor = 0; // current position in string (moves forward) - $size = strlen($string); // size of the string (stays the same) + $size = strlen($string); // size of the string (stays the same) // if we have unquoted attributes, the parser expects a terminating // space, so let's guarantee that there's always a terminating space. $string .= ' '; - while(true) { - - if ($cursor >= $size) { - break; + $old_cursor = -1; + while ($cursor < $size) { + if ($old_cursor >= $cursor) { + throw new Exception("Infinite loop detected"); } + $old_cursor = $cursor; $cursor += ($value = strspn($string, $this->_whitespace, $cursor)); // grab the key @@ -415,8 +461,10 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer $key = substr($string, $key_begin, $key_end - $key_begin); if (!$key) { - if ($e) $e->send(E_ERROR, 'Lexer: Missing attribute key'); - $cursor += strcspn($string, $this->_whitespace, $cursor + 1); // prevent infinite loop + if ($e) { + $e->send(E_ERROR, 'Lexer: Missing attribute key'); + } + $cursor += 1 + strcspn($string, $this->_whitespace, $cursor + 1); // prevent infinite loop continue; // empty key } @@ -467,24 +515,25 @@ class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer } $value = substr($string, $value_begin, $value_end - $value_begin); - if ($value === false) $value = ''; + if ($value === false) { + $value = ''; + } $array[$key] = $this->parseData($value); $cursor++; - } else { // boolattr if ($key !== '') { $array[$key] = $key; } else { // purely theoretical - if ($e) $e->send(E_ERROR, 'Lexer: Missing attribute key'); + if ($e) { + $e->send(E_ERROR, 'Lexer: Missing attribute key'); + } } - } } return $array; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php index faf00b8291..a4587e4cdc 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php @@ -3,16 +3,23 @@ /** * Experimental HTML5-based parser using Jeroen van der Meer's PH5P library. * Occupies space in the HTML5 pseudo-namespace, which may cause conflicts. - * + * * @note * Recent changes to PHP's DOM extension have resulted in some fatal * error conditions with the original version of PH5P. Pending changes, - * this lexer will punt to DirectLex if DOM throughs an exception. + * this lexer will punt to DirectLex if DOM throws an exception. */ -class HTMLPurifier_Lexer_PH5P extends HTMLPurifier_Lexer_DOMLex { - - public function tokenizeHTML($html, $config, $context) { +class HTMLPurifier_Lexer_PH5P extends HTMLPurifier_Lexer_DOMLex +{ + /** + * @param string $html + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return HTMLPurifier_Token[] + */ + public function tokenizeHTML($html, $config, $context) + { $new_html = $this->normalize($html, $config, $context); $new_html = $this->wrapHTML($new_html, $config, $context); try { @@ -27,40 +34,42 @@ class HTMLPurifier_Lexer_PH5P extends HTMLPurifier_Lexer_DOMLex { $tokens = array(); $this->tokenizeDOM( $doc->getElementsByTagName('html')->item(0)-> // - getElementsByTagName('body')->item(0)-> // - getElementsByTagName('div')->item(0) //

- , $tokens); + getElementsByTagName('body')->item(0)-> // + getElementsByTagName('div')->item(0) //
+ , + $tokens + ); return $tokens; } - } /* -Copyright 2007 Jeroen van der Meer +Copyright 2007 Jeroen van der Meer -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: +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 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. +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. */ -class HTML5 { +class HTML5 +{ private $data; private $char; private $EOF; @@ -69,89 +78,418 @@ class HTML5 { private $token; private $content_model; private $escape = false; - private $entities = array('AElig;','AElig','AMP;','AMP','Aacute;','Aacute', - 'Acirc;','Acirc','Agrave;','Agrave','Alpha;','Aring;','Aring','Atilde;', - 'Atilde','Auml;','Auml','Beta;','COPY;','COPY','Ccedil;','Ccedil','Chi;', - 'Dagger;','Delta;','ETH;','ETH','Eacute;','Eacute','Ecirc;','Ecirc','Egrave;', - 'Egrave','Epsilon;','Eta;','Euml;','Euml','GT;','GT','Gamma;','Iacute;', - 'Iacute','Icirc;','Icirc','Igrave;','Igrave','Iota;','Iuml;','Iuml','Kappa;', - 'LT;','LT','Lambda;','Mu;','Ntilde;','Ntilde','Nu;','OElig;','Oacute;', - 'Oacute','Ocirc;','Ocirc','Ograve;','Ograve','Omega;','Omicron;','Oslash;', - 'Oslash','Otilde;','Otilde','Ouml;','Ouml','Phi;','Pi;','Prime;','Psi;', - 'QUOT;','QUOT','REG;','REG','Rho;','Scaron;','Sigma;','THORN;','THORN', - 'TRADE;','Tau;','Theta;','Uacute;','Uacute','Ucirc;','Ucirc','Ugrave;', - 'Ugrave','Upsilon;','Uuml;','Uuml','Xi;','Yacute;','Yacute','Yuml;','Zeta;', - 'aacute;','aacute','acirc;','acirc','acute;','acute','aelig;','aelig', - 'agrave;','agrave','alefsym;','alpha;','amp;','amp','and;','ang;','apos;', - 'aring;','aring','asymp;','atilde;','atilde','auml;','auml','bdquo;','beta;', - 'brvbar;','brvbar','bull;','cap;','ccedil;','ccedil','cedil;','cedil', - 'cent;','cent','chi;','circ;','clubs;','cong;','copy;','copy','crarr;', - 'cup;','curren;','curren','dArr;','dagger;','darr;','deg;','deg','delta;', - 'diams;','divide;','divide','eacute;','eacute','ecirc;','ecirc','egrave;', - 'egrave','empty;','emsp;','ensp;','epsilon;','equiv;','eta;','eth;','eth', - 'euml;','euml','euro;','exist;','fnof;','forall;','frac12;','frac12', - 'frac14;','frac14','frac34;','frac34','frasl;','gamma;','ge;','gt;','gt', - 'hArr;','harr;','hearts;','hellip;','iacute;','iacute','icirc;','icirc', - 'iexcl;','iexcl','igrave;','igrave','image;','infin;','int;','iota;', - 'iquest;','iquest','isin;','iuml;','iuml','kappa;','lArr;','lambda;','lang;', - 'laquo;','laquo','larr;','lceil;','ldquo;','le;','lfloor;','lowast;','loz;', - 'lrm;','lsaquo;','lsquo;','lt;','lt','macr;','macr','mdash;','micro;','micro', - 'middot;','middot','minus;','mu;','nabla;','nbsp;','nbsp','ndash;','ne;', - 'ni;','not;','not','notin;','nsub;','ntilde;','ntilde','nu;','oacute;', - 'oacute','ocirc;','ocirc','oelig;','ograve;','ograve','oline;','omega;', - 'omicron;','oplus;','or;','ordf;','ordf','ordm;','ordm','oslash;','oslash', - 'otilde;','otilde','otimes;','ouml;','ouml','para;','para','part;','permil;', - 'perp;','phi;','pi;','piv;','plusmn;','plusmn','pound;','pound','prime;', - 'prod;','prop;','psi;','quot;','quot','rArr;','radic;','rang;','raquo;', - 'raquo','rarr;','rceil;','rdquo;','real;','reg;','reg','rfloor;','rho;', - 'rlm;','rsaquo;','rsquo;','sbquo;','scaron;','sdot;','sect;','sect','shy;', - 'shy','sigma;','sigmaf;','sim;','spades;','sub;','sube;','sum;','sup1;', - 'sup1','sup2;','sup2','sup3;','sup3','sup;','supe;','szlig;','szlig','tau;', - 'there4;','theta;','thetasym;','thinsp;','thorn;','thorn','tilde;','times;', - 'times','trade;','uArr;','uacute;','uacute','uarr;','ucirc;','ucirc', - 'ugrave;','ugrave','uml;','uml','upsih;','upsilon;','uuml;','uuml','weierp;', - 'xi;','yacute;','yacute','yen;','yen','yuml;','yuml','zeta;','zwj;','zwnj;'); - - const PCDATA = 0; - const RCDATA = 1; - const CDATA = 2; + private $entities = array( + 'AElig;', + 'AElig', + 'AMP;', + 'AMP', + 'Aacute;', + 'Aacute', + 'Acirc;', + 'Acirc', + 'Agrave;', + 'Agrave', + 'Alpha;', + 'Aring;', + 'Aring', + 'Atilde;', + 'Atilde', + 'Auml;', + 'Auml', + 'Beta;', + 'COPY;', + 'COPY', + 'Ccedil;', + 'Ccedil', + 'Chi;', + 'Dagger;', + 'Delta;', + 'ETH;', + 'ETH', + 'Eacute;', + 'Eacute', + 'Ecirc;', + 'Ecirc', + 'Egrave;', + 'Egrave', + 'Epsilon;', + 'Eta;', + 'Euml;', + 'Euml', + 'GT;', + 'GT', + 'Gamma;', + 'Iacute;', + 'Iacute', + 'Icirc;', + 'Icirc', + 'Igrave;', + 'Igrave', + 'Iota;', + 'Iuml;', + 'Iuml', + 'Kappa;', + 'LT;', + 'LT', + 'Lambda;', + 'Mu;', + 'Ntilde;', + 'Ntilde', + 'Nu;', + 'OElig;', + 'Oacute;', + 'Oacute', + 'Ocirc;', + 'Ocirc', + 'Ograve;', + 'Ograve', + 'Omega;', + 'Omicron;', + 'Oslash;', + 'Oslash', + 'Otilde;', + 'Otilde', + 'Ouml;', + 'Ouml', + 'Phi;', + 'Pi;', + 'Prime;', + 'Psi;', + 'QUOT;', + 'QUOT', + 'REG;', + 'REG', + 'Rho;', + 'Scaron;', + 'Sigma;', + 'THORN;', + 'THORN', + 'TRADE;', + 'Tau;', + 'Theta;', + 'Uacute;', + 'Uacute', + 'Ucirc;', + 'Ucirc', + 'Ugrave;', + 'Ugrave', + 'Upsilon;', + 'Uuml;', + 'Uuml', + 'Xi;', + 'Yacute;', + 'Yacute', + 'Yuml;', + 'Zeta;', + 'aacute;', + 'aacute', + 'acirc;', + 'acirc', + 'acute;', + 'acute', + 'aelig;', + 'aelig', + 'agrave;', + 'agrave', + 'alefsym;', + 'alpha;', + 'amp;', + 'amp', + 'and;', + 'ang;', + 'apos;', + 'aring;', + 'aring', + 'asymp;', + 'atilde;', + 'atilde', + 'auml;', + 'auml', + 'bdquo;', + 'beta;', + 'brvbar;', + 'brvbar', + 'bull;', + 'cap;', + 'ccedil;', + 'ccedil', + 'cedil;', + 'cedil', + 'cent;', + 'cent', + 'chi;', + 'circ;', + 'clubs;', + 'cong;', + 'copy;', + 'copy', + 'crarr;', + 'cup;', + 'curren;', + 'curren', + 'dArr;', + 'dagger;', + 'darr;', + 'deg;', + 'deg', + 'delta;', + 'diams;', + 'divide;', + 'divide', + 'eacute;', + 'eacute', + 'ecirc;', + 'ecirc', + 'egrave;', + 'egrave', + 'empty;', + 'emsp;', + 'ensp;', + 'epsilon;', + 'equiv;', + 'eta;', + 'eth;', + 'eth', + 'euml;', + 'euml', + 'euro;', + 'exist;', + 'fnof;', + 'forall;', + 'frac12;', + 'frac12', + 'frac14;', + 'frac14', + 'frac34;', + 'frac34', + 'frasl;', + 'gamma;', + 'ge;', + 'gt;', + 'gt', + 'hArr;', + 'harr;', + 'hearts;', + 'hellip;', + 'iacute;', + 'iacute', + 'icirc;', + 'icirc', + 'iexcl;', + 'iexcl', + 'igrave;', + 'igrave', + 'image;', + 'infin;', + 'int;', + 'iota;', + 'iquest;', + 'iquest', + 'isin;', + 'iuml;', + 'iuml', + 'kappa;', + 'lArr;', + 'lambda;', + 'lang;', + 'laquo;', + 'laquo', + 'larr;', + 'lceil;', + 'ldquo;', + 'le;', + 'lfloor;', + 'lowast;', + 'loz;', + 'lrm;', + 'lsaquo;', + 'lsquo;', + 'lt;', + 'lt', + 'macr;', + 'macr', + 'mdash;', + 'micro;', + 'micro', + 'middot;', + 'middot', + 'minus;', + 'mu;', + 'nabla;', + 'nbsp;', + 'nbsp', + 'ndash;', + 'ne;', + 'ni;', + 'not;', + 'not', + 'notin;', + 'nsub;', + 'ntilde;', + 'ntilde', + 'nu;', + 'oacute;', + 'oacute', + 'ocirc;', + 'ocirc', + 'oelig;', + 'ograve;', + 'ograve', + 'oline;', + 'omega;', + 'omicron;', + 'oplus;', + 'or;', + 'ordf;', + 'ordf', + 'ordm;', + 'ordm', + 'oslash;', + 'oslash', + 'otilde;', + 'otilde', + 'otimes;', + 'ouml;', + 'ouml', + 'para;', + 'para', + 'part;', + 'permil;', + 'perp;', + 'phi;', + 'pi;', + 'piv;', + 'plusmn;', + 'plusmn', + 'pound;', + 'pound', + 'prime;', + 'prod;', + 'prop;', + 'psi;', + 'quot;', + 'quot', + 'rArr;', + 'radic;', + 'rang;', + 'raquo;', + 'raquo', + 'rarr;', + 'rceil;', + 'rdquo;', + 'real;', + 'reg;', + 'reg', + 'rfloor;', + 'rho;', + 'rlm;', + 'rsaquo;', + 'rsquo;', + 'sbquo;', + 'scaron;', + 'sdot;', + 'sect;', + 'sect', + 'shy;', + 'shy', + 'sigma;', + 'sigmaf;', + 'sim;', + 'spades;', + 'sub;', + 'sube;', + 'sum;', + 'sup1;', + 'sup1', + 'sup2;', + 'sup2', + 'sup3;', + 'sup3', + 'sup;', + 'supe;', + 'szlig;', + 'szlig', + 'tau;', + 'there4;', + 'theta;', + 'thetasym;', + 'thinsp;', + 'thorn;', + 'thorn', + 'tilde;', + 'times;', + 'times', + 'trade;', + 'uArr;', + 'uacute;', + 'uacute', + 'uarr;', + 'ucirc;', + 'ucirc', + 'ugrave;', + 'ugrave', + 'uml;', + 'uml', + 'upsih;', + 'upsilon;', + 'uuml;', + 'uuml', + 'weierp;', + 'xi;', + 'yacute;', + 'yacute', + 'yen;', + 'yen', + 'yuml;', + 'yuml', + 'zeta;', + 'zwj;', + 'zwnj;' + ); + + const PCDATA = 0; + const RCDATA = 1; + const CDATA = 2; const PLAINTEXT = 3; - const DOCTYPE = 0; + const DOCTYPE = 0; const STARTTAG = 1; - const ENDTAG = 2; - const COMMENT = 3; + const ENDTAG = 2; + const COMMENT = 3; const CHARACTR = 4; - const EOF = 5; - - public function __construct($data) { + const EOF = 5; + public function __construct($data) + { $this->data = $data; $this->char = -1; - $this->EOF = strlen($data); + $this->EOF = strlen($data); $this->tree = new HTML5TreeConstructer; $this->content_model = self::PCDATA; $this->state = 'data'; - while($this->state !== null) { - $this->{$this->state.'State'}(); + while ($this->state !== null) { + $this->{$this->state . 'State'}(); } } - public function save() { + public function save() + { return $this->tree->save(); } - private function char() { + private function char() + { return ($this->char < $this->EOF) ? $this->data[$this->char] : false; } - private function character($s, $l = 0) { - if($s + $l < $this->EOF) { - if($l === 0) { + private function character($s, $l = 0) + { + if ($s + $l < $this->EOF) { + if ($l === 0) { return $this->data[$s]; } else { return substr($this->data, $s, $l); @@ -159,46 +497,52 @@ class HTML5 { } } - private function characters($char_class, $start) { - return preg_replace('#^(['.$char_class.']+).*#s', '\\1', substr($this->data, $start)); + private function characters($char_class, $start) + { + return preg_replace('#^([' . $char_class . ']+).*#s', '\\1', substr($this->data, $start)); } - private function dataState() { + private function dataState() + { // Consume the next input character $this->char++; $char = $this->char(); - if($char === '&' && ($this->content_model === self::PCDATA || $this->content_model === self::RCDATA)) { + if ($char === '&' && ($this->content_model === self::PCDATA || $this->content_model === self::RCDATA)) { /* U+0026 AMPERSAND (&) When the content model flag is set to one of the PCDATA or RCDATA states: switch to the entity data state. Otherwise: treat it as per the "anything else" entry below. */ $this->state = 'entityData'; - } elseif($char === '-') { + } elseif ($char === '-') { /* If the content model flag is set to either the RCDATA state or the CDATA state, and the escape flag is false, and there are at least three characters before this one in the input stream, and the last four characters in the input stream, including this one, are U+003C LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, and U+002D HYPHEN-MINUS (""), set the escape flag to false. */ - if(($this->content_model === self::RCDATA || - $this->content_model === self::CDATA) && $this->escape === true && - $this->character($this->char, 3) === '-->') { + if (($this->content_model === self::RCDATA || + $this->content_model === self::CDATA) && $this->escape === true && + $this->character($this->char, 3) === '-->' + ) { $this->escape = false; } /* In any case, emit the input character as a character token. Stay in the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => $char - )); + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => $char + ) + ); - } elseif($this->char === $this->EOF) { + } elseif ($this->char === $this->EOF) { /* EOF Emit an end-of-file token. */ $this->EOF(); - } elseif($this->content_model === self::PLAINTEXT) { + } elseif ($this->content_model === self::PLAINTEXT) { /* When the content model flag is set to the PLAINTEXT state THIS DIFFERS GREATLY FROM THE SPEC: Get the remaining characters of the text and emit it as a character token. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => substr($this->data, $this->char) - )); + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => substr($this->data, $this->char) + ) + ); $this->EOF(); @@ -250,37 +599,43 @@ class HTML5 { THIS DIFFERS GREATLY FROM THE SPEC: Get as many character that otherwise would also be treated as a character token and emit it as a single character token. Stay in the data state. */ - $len = strcspn($this->data, '<&', $this->char); + $len = strcspn($this->data, '<&', $this->char); $char = substr($this->data, $this->char, $len); $this->char += $len - 1; - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => $char - )); + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => $char + ) + ); $this->state = 'data'; } } - private function entityDataState() { + private function entityDataState() + { // Attempt to consume an entity. $entity = $this->entity(); // If nothing is returned, emit a U+0026 AMPERSAND character token. // Otherwise, emit the character token that was returned. $char = (!$entity) ? '&' : $entity; - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => $char - )); + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => $char + ) + ); // Finally, switch to the data state. $this->state = 'data'; } - private function tagOpenState() { - switch($this->content_model) { + private function tagOpenState() + { + switch ($this->content_model) { case self::RCDATA: case self::CDATA: /* If the next input character is a U+002F SOLIDUS (/) character, @@ -288,19 +643,21 @@ class HTML5 { input character is not a U+002F SOLIDUS (/) character, emit a U+003C LESS-THAN SIGN character token and switch to the data state to process the next input character. */ - if($this->character($this->char + 1) === '/') { + if ($this->character($this->char + 1) === '/') { $this->char++; $this->state = 'closeTagOpen'; } else { - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => '<' - )); + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => '<' + ) + ); $this->state = 'data'; } - break; + break; case self::PCDATA: // If the content model flag is set to the PCDATA state @@ -308,42 +665,44 @@ class HTML5 { $this->char++; $char = $this->char(); - if($char === '!') { + if ($char === '!') { /* U+0021 EXCLAMATION MARK (!) Switch to the markup declaration open state. */ $this->state = 'markupDeclarationOpen'; - } elseif($char === '/') { + } elseif ($char === '/') { /* U+002F SOLIDUS (/) Switch to the close tag open state. */ $this->state = 'closeTagOpen'; - } elseif(preg_match('/^[A-Za-z]$/', $char)) { + } elseif (preg_match('/^[A-Za-z]$/', $char)) { /* U+0041 LATIN LETTER A through to U+005A LATIN LETTER Z Create a new start tag token, set its tag name to the lowercase version of the input character (add 0x0020 to the character's code point), then switch to the tag name state. (Don't emit the token yet; further details will be filled in before it is emitted.) */ $this->token = array( - 'name' => strtolower($char), - 'type' => self::STARTTAG, - 'attr' => array() + 'name' => strtolower($char), + 'type' => self::STARTTAG, + 'attr' => array() ); $this->state = 'tagName'; - } elseif($char === '>') { + } elseif ($char === '>') { /* U+003E GREATER-THAN SIGN (>) Parse error. Emit a U+003C LESS-THAN SIGN character token and a U+003E GREATER-THAN SIGN character token. Switch to the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => '<>' - )); + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => '<>' + ) + ); $this->state = 'data'; - } elseif($char === '?') { + } elseif ($char === '?') { /* U+003F QUESTION MARK (?) Parse error. Switch to the bogus comment state. */ $this->state = 'bogusComment'; @@ -352,25 +711,31 @@ class HTML5 { /* Anything else Parse error. Emit a U+003C LESS-THAN SIGN character token and reconsume the current input character in the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => '<' - )); + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => '<' + ) + ); $this->char--; $this->state = 'data'; } - break; + break; } } - private function closeTagOpenState() { + private function closeTagOpenState() + { $next_node = strtolower($this->characters('A-Za-z', $this->char + 1)); $the_same = count($this->tree->stack) > 0 && $next_node === end($this->tree->stack)->nodeName; - if(($this->content_model === self::RCDATA || $this->content_model === self::CDATA) && - (!$the_same || ($the_same && (!preg_match('/[\t\n\x0b\x0c >\/]/', - $this->character($this->char + 1 + strlen($next_node))) || $this->EOF === $this->char)))) { + if (($this->content_model === self::RCDATA || $this->content_model === self::CDATA) && + (!$the_same || ($the_same && (!preg_match( + '/[\t\n\x0b\x0c >\/]/', + $this->character($this->char + 1 + strlen($next_node)) + ) || $this->EOF === $this->char))) + ) { /* If the content model flag is set to the RCDATA or CDATA states then examine the next few characters. If they do not match the tag name of the last start tag token emitted (case insensitively), or if they do but @@ -386,10 +751,12 @@ class HTML5 { ...then there is a parse error. Emit a U+003C LESS-THAN SIGN character token, a U+002F SOLIDUS character token, and switch to the data state to process the next input character. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => 'emitToken( + array( + 'type' => self::CHARACTR, + 'data' => 'state = 'data'; @@ -400,32 +767,34 @@ class HTML5 { $this->char++; $char = $this->char(); - if(preg_match('/^[A-Za-z]$/', $char)) { + if (preg_match('/^[A-Za-z]$/', $char)) { /* U+0041 LATIN LETTER A through to U+005A LATIN LETTER Z Create a new end tag token, set its tag name to the lowercase version of the input character (add 0x0020 to the character's code point), then switch to the tag name state. (Don't emit the token yet; further details will be filled in before it is emitted.) */ $this->token = array( - 'name' => strtolower($char), - 'type' => self::ENDTAG + 'name' => strtolower($char), + 'type' => self::ENDTAG ); $this->state = 'tagName'; - } elseif($char === '>') { + } elseif ($char === '>') { /* U+003E GREATER-THAN SIGN (>) Parse error. Switch to the data state. */ $this->state = 'data'; - } elseif($this->char === $this->EOF) { + } elseif ($this->char === $this->EOF) { /* EOF Parse error. Emit a U+003C LESS-THAN SIGN character token and a U+002F SOLIDUS character token. Reconsume the EOF character in the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => 'emitToken( + array( + 'type' => self::CHARACTR, + 'data' => 'char--; $this->state = 'data'; @@ -437,12 +806,13 @@ class HTML5 { } } - private function tagNameState() { + private function tagNameState() + { // Consume the next input character: $this->char++; $char = $this->character($this->char); - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { /* U+0009 CHARACTER TABULATION U+000A LINE FEED (LF) U+000B LINE TABULATION @@ -451,13 +821,13 @@ class HTML5 { Switch to the before attribute name state. */ $this->state = 'beforeAttributeName'; - } elseif($char === '>') { + } elseif ($char === '>') { /* U+003E GREATER-THAN SIGN (>) Emit the current tag token. Switch to the data state. */ $this->emitToken($this->token); $this->state = 'data'; - } elseif($this->char === $this->EOF) { + } elseif ($this->char === $this->EOF) { /* EOF Parse error. Emit the current tag token. Reconsume the EOF character in the data state. */ @@ -466,7 +836,7 @@ class HTML5 { $this->char--; $this->state = 'data'; - } elseif($char === '/') { + } elseif ($char === '/') { /* U+002F SOLIDUS (/) Parse error unless this is a permitted slash. Switch to the before attribute name state. */ @@ -481,12 +851,13 @@ class HTML5 { } } - private function beforeAttributeNameState() { + private function beforeAttributeNameState() + { // Consume the next input character: $this->char++; $char = $this->character($this->char); - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { /* U+0009 CHARACTER TABULATION U+000A LINE FEED (LF) U+000B LINE TABULATION @@ -495,19 +866,19 @@ class HTML5 { Stay in the before attribute name state. */ $this->state = 'beforeAttributeName'; - } elseif($char === '>') { + } elseif ($char === '>') { /* U+003E GREATER-THAN SIGN (>) Emit the current tag token. Switch to the data state. */ $this->emitToken($this->token); $this->state = 'data'; - } elseif($char === '/') { + } elseif ($char === '/') { /* U+002F SOLIDUS (/) Parse error unless this is a permitted slash. Stay in the before attribute name state. */ $this->state = 'beforeAttributeName'; - } elseif($this->char === $this->EOF) { + } elseif ($this->char === $this->EOF) { /* EOF Parse error. Emit the current tag token. Reconsume the EOF character in the data state. */ @@ -522,7 +893,7 @@ class HTML5 { name to the current input character, and its value to the empty string. Switch to the attribute name state. */ $this->token['attr'][] = array( - 'name' => strtolower($char), + 'name' => strtolower($char), 'value' => null ); @@ -530,12 +901,13 @@ class HTML5 { } } - private function attributeNameState() { + private function attributeNameState() + { // Consume the next input character: $this->char++; $char = $this->character($this->char); - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { /* U+0009 CHARACTER TABULATION U+000A LINE FEED (LF) U+000B LINE TABULATION @@ -544,24 +916,24 @@ class HTML5 { Stay in the before attribute name state. */ $this->state = 'afterAttributeName'; - } elseif($char === '=') { + } elseif ($char === '=') { /* U+003D EQUALS SIGN (=) Switch to the before attribute value state. */ $this->state = 'beforeAttributeValue'; - } elseif($char === '>') { + } elseif ($char === '>') { /* U+003E GREATER-THAN SIGN (>) Emit the current tag token. Switch to the data state. */ $this->emitToken($this->token); $this->state = 'data'; - } elseif($char === '/' && $this->character($this->char + 1) !== '>') { + } elseif ($char === '/' && $this->character($this->char + 1) !== '>') { /* U+002F SOLIDUS (/) Parse error unless this is a permitted slash. Switch to the before attribute name state. */ $this->state = 'beforeAttributeName'; - } elseif($this->char === $this->EOF) { + } elseif ($this->char === $this->EOF) { /* EOF Parse error. Emit the current tag token. Reconsume the EOF character in the data state. */ @@ -581,12 +953,13 @@ class HTML5 { } } - private function afterAttributeNameState() { + private function afterAttributeNameState() + { // Consume the next input character: $this->char++; $char = $this->character($this->char); - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { /* U+0009 CHARACTER TABULATION U+000A LINE FEED (LF) U+000B LINE TABULATION @@ -595,24 +968,24 @@ class HTML5 { Stay in the after attribute name state. */ $this->state = 'afterAttributeName'; - } elseif($char === '=') { + } elseif ($char === '=') { /* U+003D EQUALS SIGN (=) Switch to the before attribute value state. */ $this->state = 'beforeAttributeValue'; - } elseif($char === '>') { + } elseif ($char === '>') { /* U+003E GREATER-THAN SIGN (>) Emit the current tag token. Switch to the data state. */ $this->emitToken($this->token); $this->state = 'data'; - } elseif($char === '/' && $this->character($this->char + 1) !== '>') { + } elseif ($char === '/' && $this->character($this->char + 1) !== '>') { /* U+002F SOLIDUS (/) Parse error unless this is a permitted slash. Switch to the before attribute name state. */ $this->state = 'beforeAttributeName'; - } elseif($this->char === $this->EOF) { + } elseif ($this->char === $this->EOF) { /* EOF Parse error. Emit the current tag token. Reconsume the EOF character in the data state. */ @@ -627,7 +1000,7 @@ class HTML5 { name to the current input character, and its value to the empty string. Switch to the attribute name state. */ $this->token['attr'][] = array( - 'name' => strtolower($char), + 'name' => strtolower($char), 'value' => null ); @@ -635,12 +1008,13 @@ class HTML5 { } } - private function beforeAttributeValueState() { + private function beforeAttributeValueState() + { // Consume the next input character: $this->char++; $char = $this->character($this->char); - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { /* U+0009 CHARACTER TABULATION U+000A LINE FEED (LF) U+000B LINE TABULATION @@ -649,24 +1023,24 @@ class HTML5 { Stay in the before attribute value state. */ $this->state = 'beforeAttributeValue'; - } elseif($char === '"') { + } elseif ($char === '"') { /* U+0022 QUOTATION MARK (") Switch to the attribute value (double-quoted) state. */ $this->state = 'attributeValueDoubleQuoted'; - } elseif($char === '&') { + } elseif ($char === '&') { /* U+0026 AMPERSAND (&) Switch to the attribute value (unquoted) state and reconsume this input character. */ $this->char--; $this->state = 'attributeValueUnquoted'; - } elseif($char === '\'') { + } elseif ($char === '\'') { /* U+0027 APOSTROPHE (') Switch to the attribute value (single-quoted) state. */ $this->state = 'attributeValueSingleQuoted'; - } elseif($char === '>') { + } elseif ($char === '>') { /* U+003E GREATER-THAN SIGN (>) Emit the current tag token. Switch to the data state. */ $this->emitToken($this->token); @@ -683,22 +1057,23 @@ class HTML5 { } } - private function attributeValueDoubleQuotedState() { + private function attributeValueDoubleQuotedState() + { // Consume the next input character: $this->char++; $char = $this->character($this->char); - if($char === '"') { + if ($char === '"') { /* U+0022 QUOTATION MARK (") Switch to the before attribute name state. */ $this->state = 'beforeAttributeName'; - } elseif($char === '&') { + } elseif ($char === '&') { /* U+0026 AMPERSAND (&) Switch to the entity in attribute value state. */ $this->entityInAttributeValueState('double'); - } elseif($this->char === $this->EOF) { + } elseif ($this->char === $this->EOF) { /* EOF Parse error. Emit the current tag token. Reconsume the character in the data state. */ @@ -718,22 +1093,23 @@ class HTML5 { } } - private function attributeValueSingleQuotedState() { + private function attributeValueSingleQuotedState() + { // Consume the next input character: $this->char++; $char = $this->character($this->char); - if($char === '\'') { + if ($char === '\'') { /* U+0022 QUOTATION MARK (') Switch to the before attribute name state. */ $this->state = 'beforeAttributeName'; - } elseif($char === '&') { + } elseif ($char === '&') { /* U+0026 AMPERSAND (&) Switch to the entity in attribute value state. */ $this->entityInAttributeValueState('single'); - } elseif($this->char === $this->EOF) { + } elseif ($this->char === $this->EOF) { /* EOF Parse error. Emit the current tag token. Reconsume the character in the data state. */ @@ -753,12 +1129,13 @@ class HTML5 { } } - private function attributeValueUnquotedState() { + private function attributeValueUnquotedState() + { // Consume the next input character: $this->char++; $char = $this->character($this->char); - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { /* U+0009 CHARACTER TABULATION U+000A LINE FEED (LF) U+000B LINE TABULATION @@ -767,12 +1144,12 @@ class HTML5 { Switch to the before attribute name state. */ $this->state = 'beforeAttributeName'; - } elseif($char === '&') { + } elseif ($char === '&') { /* U+0026 AMPERSAND (&) Switch to the entity in attribute value state. */ $this->entityInAttributeValueState(); - } elseif($char === '>') { + } elseif ($char === '>') { /* U+003E GREATER-THAN SIGN (>) Emit the current tag token. Switch to the data state. */ $this->emitToken($this->token); @@ -789,7 +1166,8 @@ class HTML5 { } } - private function entityInAttributeValueState() { + private function entityInAttributeValueState() + { // Attempt to consume an entity. $entity = $this->entity(); @@ -804,7 +1182,8 @@ class HTML5 { $this->token['attr'][$last]['value'] .= $char; } - private function bogusCommentState() { + private function bogusCommentState() + { /* Consume every character up to the first U+003E GREATER-THAN SIGN character (>) or the end of the file (EOF), whichever comes first. Emit a comment token whose data is the concatenation of all the characters @@ -814,10 +1193,12 @@ class HTML5 { end of the file otherwise. (If the comment was started by the end of the file (EOF), the token is empty.) */ $data = $this->characters('^>', $this->char); - $this->emitToken(array( - 'data' => $data, - 'type' => self::COMMENT - )); + $this->emitToken( + array( + 'data' => $data, + 'type' => self::COMMENT + ) + ); $this->char += strlen($data); @@ -825,16 +1206,17 @@ class HTML5 { $this->state = 'data'; /* If the end of the file was reached, reconsume the EOF character. */ - if($this->char === $this->EOF) { + if ($this->char === $this->EOF) { $this->char = $this->EOF - 1; } } - private function markupDeclarationOpenState() { + private function markupDeclarationOpenState() + { /* If the next two characters are both U+002D HYPHEN-MINUS (-) characters, consume those two characters, create a comment token whose data is the empty string, and switch to the comment state. */ - if($this->character($this->char + 1, 2) === '--') { + if ($this->character($this->char + 1, 2) === '--') { $this->char += 2; $this->state = 'comment'; $this->token = array( @@ -842,41 +1224,42 @@ class HTML5 { 'type' => self::COMMENT ); - /* Otherwise if the next seven chacacters are a case-insensitive match - for the word "DOCTYPE", then consume those characters and switch to the - DOCTYPE state. */ - } elseif(strtolower($this->character($this->char + 1, 7)) === 'doctype') { + /* Otherwise if the next seven chacacters are a case-insensitive match + for the word "DOCTYPE", then consume those characters and switch to the + DOCTYPE state. */ + } elseif (strtolower($this->character($this->char + 1, 7)) === 'doctype') { $this->char += 7; $this->state = 'doctype'; - /* Otherwise, is is a parse error. Switch to the bogus comment state. - The next character that is consumed, if any, is the first character - that will be in the comment. */ + /* Otherwise, is is a parse error. Switch to the bogus comment state. + The next character that is consumed, if any, is the first character + that will be in the comment. */ } else { $this->char++; $this->state = 'bogusComment'; } } - private function commentState() { + private function commentState() + { /* Consume the next input character: */ $this->char++; $char = $this->char(); /* U+002D HYPHEN-MINUS (-) */ - if($char === '-') { + if ($char === '-') { /* Switch to the comment dash state */ $this->state = 'commentDash'; - /* EOF */ - } elseif($this->char === $this->EOF) { + /* EOF */ + } elseif ($this->char === $this->EOF) { /* Parse error. Emit the comment token. Reconsume the EOF character in the data state. */ $this->emitToken($this->token); $this->char--; $this->state = 'data'; - /* Anything else */ + /* Anything else */ } else { /* Append the input character to the comment token's data. Stay in the comment state. */ @@ -884,62 +1267,65 @@ class HTML5 { } } - private function commentDashState() { + private function commentDashState() + { /* Consume the next input character: */ $this->char++; $char = $this->char(); /* U+002D HYPHEN-MINUS (-) */ - if($char === '-') { + if ($char === '-') { /* Switch to the comment end state */ $this->state = 'commentEnd'; - /* EOF */ - } elseif($this->char === $this->EOF) { + /* EOF */ + } elseif ($this->char === $this->EOF) { /* Parse error. Emit the comment token. Reconsume the EOF character in the data state. */ $this->emitToken($this->token); $this->char--; $this->state = 'data'; - /* Anything else */ + /* Anything else */ } else { /* Append a U+002D HYPHEN-MINUS (-) character and the input character to the comment token's data. Switch to the comment state. */ - $this->token['data'] .= '-'.$char; + $this->token['data'] .= '-' . $char; $this->state = 'comment'; } } - private function commentEndState() { + private function commentEndState() + { /* Consume the next input character: */ $this->char++; $char = $this->char(); - if($char === '>') { + if ($char === '>') { $this->emitToken($this->token); $this->state = 'data'; - } elseif($char === '-') { + } elseif ($char === '-') { $this->token['data'] .= '-'; - } elseif($this->char === $this->EOF) { + } elseif ($this->char === $this->EOF) { $this->emitToken($this->token); $this->char--; $this->state = 'data'; } else { - $this->token['data'] .= '--'.$char; + $this->token['data'] .= '--' . $char; $this->state = 'comment'; } } - private function doctypeState() { + private function doctypeState() + { /* Consume the next input character: */ $this->char++; $char = $this->char(); - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { $this->state = 'beforeDoctypeName'; } else { @@ -948,15 +1334,16 @@ class HTML5 { } } - private function beforeDoctypeNameState() { + private function beforeDoctypeNameState() + { /* Consume the next input character: */ $this->char++; $char = $this->char(); - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { // Stay in the before DOCTYPE name state. - } elseif(preg_match('/^[a-z]$/', $char)) { + } elseif (preg_match('/^[a-z]$/', $char)) { $this->token = array( 'name' => strtoupper($char), 'type' => self::DOCTYPE, @@ -965,21 +1352,25 @@ class HTML5 { $this->state = 'doctypeName'; - } elseif($char === '>') { - $this->emitToken(array( - 'name' => null, - 'type' => self::DOCTYPE, - 'error' => true - )); + } elseif ($char === '>') { + $this->emitToken( + array( + 'name' => null, + 'type' => self::DOCTYPE, + 'error' => true + ) + ); $this->state = 'data'; - } elseif($this->char === $this->EOF) { - $this->emitToken(array( - 'name' => null, - 'type' => self::DOCTYPE, - 'error' => true - )); + } elseif ($this->char === $this->EOF) { + $this->emitToken( + array( + 'name' => null, + 'type' => self::DOCTYPE, + 'error' => true + ) + ); $this->char--; $this->state = 'data'; @@ -995,22 +1386,23 @@ class HTML5 { } } - private function doctypeNameState() { + private function doctypeNameState() + { /* Consume the next input character: */ $this->char++; $char = $this->char(); - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { $this->state = 'AfterDoctypeName'; - } elseif($char === '>') { + } elseif ($char === '>') { $this->emitToken($this->token); $this->state = 'data'; - } elseif(preg_match('/^[a-z]$/', $char)) { + } elseif (preg_match('/^[a-z]$/', $char)) { $this->token['name'] .= strtoupper($char); - } elseif($this->char === $this->EOF) { + } elseif ($this->char === $this->EOF) { $this->emitToken($this->token); $this->char--; $this->state = 'data'; @@ -1024,19 +1416,20 @@ class HTML5 { : true; } - private function afterDoctypeNameState() { + private function afterDoctypeNameState() + { /* Consume the next input character: */ $this->char++; $char = $this->char(); - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { // Stay in the DOCTYPE name state. - } elseif($char === '>') { + } elseif ($char === '>') { $this->emitToken($this->token); $this->state = 'data'; - } elseif($this->char === $this->EOF) { + } elseif ($this->char === $this->EOF) { $this->emitToken($this->token); $this->char--; $this->state = 'data'; @@ -1047,16 +1440,17 @@ class HTML5 { } } - private function bogusDoctypeState() { + private function bogusDoctypeState() + { /* Consume the next input character: */ $this->char++; $char = $this->char(); - if($char === '>') { + if ($char === '>') { $this->emitToken($this->token); $this->state = 'data'; - } elseif($this->char === $this->EOF) { + } elseif ($this->char === $this->EOF) { $this->emitToken($this->token); $this->char--; $this->state = 'data'; @@ -1066,22 +1460,23 @@ class HTML5 { } } - private function entity() { + private function entity() + { $start = $this->char; // This section defines how to consume an entity. This definition is // used when parsing entities in text and in attributes. // The behaviour depends on the identity of the next character (the - // one immediately after the U+0026 AMPERSAND character): + // one immediately after the U+0026 AMPERSAND character): - switch($this->character($this->char + 1)) { + switch ($this->character($this->char + 1)) { // U+0023 NUMBER SIGN (#) case '#': // The behaviour further depends on the character after the // U+0023 NUMBER SIGN: - switch($this->character($this->char + 1)) { + switch ($this->character($this->char + 1)) { // U+0078 LATIN SMALL LETTER X // U+0058 LATIN CAPITAL LETTER X case 'x': @@ -1094,7 +1489,7 @@ class HTML5 { // words, 0-9, A-F, a-f). $char = 1; $char_class = '0-9A-Fa-f'; - break; + break; // Anything else default: @@ -1103,7 +1498,7 @@ class HTML5 { // NINE (i.e. just 0-9). $char = 0; $char_class = '0-9'; - break; + break; } // Consume as many characters as match the range of characters @@ -1114,7 +1509,7 @@ class HTML5 { $cond = strlen($e_name) > 0; // The rest of the parsing happens bellow. - break; + break; // Anything else default: @@ -1124,12 +1519,12 @@ class HTML5 { $e_name = $this->characters('0-9A-Za-z;', $this->char + 1); $len = strlen($e_name); - for($c = 1; $c <= $len; $c++) { + for ($c = 1; $c <= $len; $c++) { $id = substr($e_name, 0, $c); $this->char++; - if(in_array($id, $this->entities)) { - if ($e_name[$c-1] !== ';') { + if (in_array($id, $this->entities)) { + if ($e_name[$c - 1] !== ';') { if ($c < $len && $e_name[$c] == ';') { $this->char++; // consume extra semicolon } @@ -1141,10 +1536,10 @@ class HTML5 { $cond = isset($entity); // The rest of the parsing happens bellow. - break; + break; } - if(!$cond) { + if (!$cond) { // If no match can be made, then this is a parse error. No // characters are consumed, and nothing is returned. $this->char = $start; @@ -1153,81 +1548,157 @@ class HTML5 { // Return a character token for the character corresponding to the // entity name (as given by the second column of the entities table). - return html_entity_decode('&'.$entity.';', ENT_QUOTES, 'UTF-8'); + return html_entity_decode('&' . $entity . ';', ENT_QUOTES, 'UTF-8'); } - private function emitToken($token) { + private function emitToken($token) + { $emit = $this->tree->emitToken($token); - if(is_int($emit)) { + if (is_int($emit)) { $this->content_model = $emit; - } elseif($token['type'] === self::ENDTAG) { + } elseif ($token['type'] === self::ENDTAG) { $this->content_model = self::PCDATA; } } - private function EOF() { + private function EOF() + { $this->state = null; - $this->tree->emitToken(array( - 'type' => self::EOF - )); + $this->tree->emitToken( + array( + 'type' => self::EOF + ) + ); } } -class HTML5TreeConstructer { +class HTML5TreeConstructer +{ public $stack = array(); private $phase; private $mode; private $dom; private $foster_parent = null; - private $a_formatting = array(); + private $a_formatting = array(); private $head_pointer = null; private $form_pointer = null; - private $scoping = array('button','caption','html','marquee','object','table','td','th'); - private $formatting = array('a','b','big','em','font','i','nobr','s','small','strike','strong','tt','u'); - private $special = array('address','area','base','basefont','bgsound', - 'blockquote','body','br','center','col','colgroup','dd','dir','div','dl', - 'dt','embed','fieldset','form','frame','frameset','h1','h2','h3','h4','h5', - 'h6','head','hr','iframe','image','img','input','isindex','li','link', - 'listing','menu','meta','noembed','noframes','noscript','ol','optgroup', - 'option','p','param','plaintext','pre','script','select','spacer','style', - 'tbody','textarea','tfoot','thead','title','tr','ul','wbr'); + private $scoping = array('button', 'caption', 'html', 'marquee', 'object', 'table', 'td', 'th'); + private $formatting = array( + 'a', + 'b', + 'big', + 'em', + 'font', + 'i', + 'nobr', + 's', + 'small', + 'strike', + 'strong', + 'tt', + 'u' + ); + private $special = array( + 'address', + 'area', + 'base', + 'basefont', + 'bgsound', + 'blockquote', + 'body', + 'br', + 'center', + 'col', + 'colgroup', + 'dd', + 'dir', + 'div', + 'dl', + 'dt', + 'embed', + 'fieldset', + 'form', + 'frame', + 'frameset', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'head', + 'hr', + 'iframe', + 'image', + 'img', + 'input', + 'isindex', + 'li', + 'link', + 'listing', + 'menu', + 'meta', + 'noembed', + 'noframes', + 'noscript', + 'ol', + 'optgroup', + 'option', + 'p', + 'param', + 'plaintext', + 'pre', + 'script', + 'select', + 'spacer', + 'style', + 'tbody', + 'textarea', + 'tfoot', + 'thead', + 'title', + 'tr', + 'ul', + 'wbr' + ); // The different phases. const INIT_PHASE = 0; const ROOT_PHASE = 1; const MAIN_PHASE = 2; - const END_PHASE = 3; + const END_PHASE = 3; // The different insertion modes for the main phase. const BEFOR_HEAD = 0; - const IN_HEAD = 1; + const IN_HEAD = 1; const AFTER_HEAD = 2; - const IN_BODY = 3; - const IN_TABLE = 4; + const IN_BODY = 3; + const IN_TABLE = 4; const IN_CAPTION = 5; - const IN_CGROUP = 6; - const IN_TBODY = 7; - const IN_ROW = 8; - const IN_CELL = 9; - const IN_SELECT = 10; + const IN_CGROUP = 6; + const IN_TBODY = 7; + const IN_ROW = 8; + const IN_CELL = 9; + const IN_SELECT = 10; const AFTER_BODY = 11; - const IN_FRAME = 12; + const IN_FRAME = 12; const AFTR_FRAME = 13; // The different types of elements. - const SPECIAL = 0; - const SCOPING = 1; + const SPECIAL = 0; + const SCOPING = 1; const FORMATTING = 2; - const PHRASING = 3; + const PHRASING = 3; - const MARKER = 0; + const MARKER = 0; - public function __construct() { + public function __construct() + { $this->phase = self::INIT_PHASE; $this->mode = self::BEFOR_HEAD; $this->dom = new DOMDocument; @@ -1239,16 +1710,26 @@ class HTML5TreeConstructer { } // Process tag tokens - public function emitToken($token) { - switch($this->phase) { - case self::INIT_PHASE: return $this->initPhase($token); break; - case self::ROOT_PHASE: return $this->rootElementPhase($token); break; - case self::MAIN_PHASE: return $this->mainPhase($token); break; - case self::END_PHASE : return $this->trailingEndPhase($token); break; + public function emitToken($token) + { + switch ($this->phase) { + case self::INIT_PHASE: + return $this->initPhase($token); + break; + case self::ROOT_PHASE: + return $this->rootElementPhase($token); + break; + case self::MAIN_PHASE: + return $this->mainPhase($token); + break; + case self::END_PHASE : + return $this->trailingEndPhase($token); + break; } } - private function initPhase($token) { + private function initPhase($token) + { /* Initially, the tree construction stage must handle each token emitted from the tokenisation stage as follows: */ @@ -1260,13 +1741,14 @@ class HTML5TreeConstructer { U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), or U+0020 SPACE An end-of-file token */ - if((isset($token['error']) && $token['error']) || - $token['type'] === HTML5::COMMENT || - $token['type'] === HTML5::STARTTAG || - $token['type'] === HTML5::ENDTAG || - $token['type'] === HTML5::EOF || - ($token['type'] === HTML5::CHARACTR && isset($token['data']) && - !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']))) { + if ((isset($token['error']) && $token['error']) || + $token['type'] === HTML5::COMMENT || + $token['type'] === HTML5::STARTTAG || + $token['type'] === HTML5::ENDTAG || + $token['type'] === HTML5::EOF || + ($token['type'] === HTML5::CHARACTR && isset($token['data']) && + !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) + ) { /* This specification does not define how to handle this case. In particular, user agents may ignore the entirety of this specification altogether for such documents, and instead invoke special parse modes @@ -1275,8 +1757,8 @@ class HTML5TreeConstructer { $this->phase = self::ROOT_PHASE; return $this->rootElementPhase($token); - /* A DOCTYPE token marked as being correct */ - } elseif(isset($token['error']) && !$token['error']) { + /* A DOCTYPE token marked as being correct */ + } elseif (isset($token['error']) && !$token['error']) { /* Append a DocumentType node to the Document node, with the name attribute set to the name given in the DOCTYPE token (which will be "HTML"), and the other attributes specific to DocumentType objects @@ -1287,52 +1769,58 @@ class HTML5TreeConstructer { stage. */ $this->phase = self::ROOT_PHASE; - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif(isset($token['data']) && preg_match('/^[\t\n\x0b\x0c ]+$/', - $token['data'])) { + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + } elseif (isset($token['data']) && preg_match( + '/^[\t\n\x0b\x0c ]+$/', + $token['data'] + ) + ) { /* Append that character to the Document node. */ $text = $this->dom->createTextNode($token['data']); $this->dom->appendChild($text); } } - private function rootElementPhase($token) { + private function rootElementPhase($token) + { /* After the initial phase, as each token is emitted from the tokenisation stage, it must be processed as described in this section. */ /* A DOCTYPE token */ - if($token['type'] === HTML5::DOCTYPE) { + if ($token['type'] === HTML5::DOCTYPE) { // Parse error. Ignore the token. - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { /* Append a Comment node to the Document object with the data attribute set to the data given in the comment token. */ $comment = $this->dom->createComment($token['data']); $this->dom->appendChild($comment); - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + } elseif ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { /* Append that character to the Document node. */ $text = $this->dom->createTextNode($token['data']); $this->dom->appendChild($text); - /* A character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED - (FF), or U+0020 SPACE - A start tag token - An end tag token - An end-of-file token */ - } elseif(($token['type'] === HTML5::CHARACTR && - !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || - $token['type'] === HTML5::STARTTAG || - $token['type'] === HTML5::ENDTAG || - $token['type'] === HTML5::EOF) { + /* A character token that is not one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED + (FF), or U+0020 SPACE + A start tag token + An end tag token + An end-of-file token */ + } elseif (($token['type'] === HTML5::CHARACTR && + !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || + $token['type'] === HTML5::STARTTAG || + $token['type'] === HTML5::ENDTAG || + $token['type'] === HTML5::EOF + ) { /* Create an HTMLElement node with the tag name html, in the HTML namespace. Append it to the Document object. Switch to the main phase and reprocess the current token. */ @@ -1345,15 +1833,16 @@ class HTML5TreeConstructer { } } - private function mainPhase($token) { + private function mainPhase($token) + { /* Tokens in the main phase must be handled as follows: */ /* A DOCTYPE token */ - if($token['type'] === HTML5::DOCTYPE) { + if ($token['type'] === HTML5::DOCTYPE) { // Parse error. Ignore the token. - /* A start tag token with the tag name "html" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'html') { + /* A start tag token with the tag name "html" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'html') { /* If this start tag token was not the first start tag token, then it is a parse error. */ @@ -1361,59 +1850,91 @@ class HTML5TreeConstructer { is already present on the top element of the stack of open elements. If it is not, add the attribute and its corresponding value to that element. */ - foreach($token['attr'] as $attr) { - if(!$this->stack[0]->hasAttribute($attr['name'])) { + foreach ($token['attr'] as $attr) { + if (!$this->stack[0]->hasAttribute($attr['name'])) { $this->stack[0]->setAttribute($attr['name'], $attr['value']); } } - /* An end-of-file token */ - } elseif($token['type'] === HTML5::EOF) { + /* An end-of-file token */ + } elseif ($token['type'] === HTML5::EOF) { /* Generate implied end tags. */ $this->generateImpliedEndTags(); - /* Anything else. */ + /* Anything else. */ } else { /* Depends on the insertion mode: */ - switch($this->mode) { - case self::BEFOR_HEAD: return $this->beforeHead($token); break; - case self::IN_HEAD: return $this->inHead($token); break; - case self::AFTER_HEAD: return $this->afterHead($token); break; - case self::IN_BODY: return $this->inBody($token); break; - case self::IN_TABLE: return $this->inTable($token); break; - case self::IN_CAPTION: return $this->inCaption($token); break; - case self::IN_CGROUP: return $this->inColumnGroup($token); break; - case self::IN_TBODY: return $this->inTableBody($token); break; - case self::IN_ROW: return $this->inRow($token); break; - case self::IN_CELL: return $this->inCell($token); break; - case self::IN_SELECT: return $this->inSelect($token); break; - case self::AFTER_BODY: return $this->afterBody($token); break; - case self::IN_FRAME: return $this->inFrameset($token); break; - case self::AFTR_FRAME: return $this->afterFrameset($token); break; - case self::END_PHASE: return $this->trailingEndPhase($token); break; + switch ($this->mode) { + case self::BEFOR_HEAD: + return $this->beforeHead($token); + break; + case self::IN_HEAD: + return $this->inHead($token); + break; + case self::AFTER_HEAD: + return $this->afterHead($token); + break; + case self::IN_BODY: + return $this->inBody($token); + break; + case self::IN_TABLE: + return $this->inTable($token); + break; + case self::IN_CAPTION: + return $this->inCaption($token); + break; + case self::IN_CGROUP: + return $this->inColumnGroup($token); + break; + case self::IN_TBODY: + return $this->inTableBody($token); + break; + case self::IN_ROW: + return $this->inRow($token); + break; + case self::IN_CELL: + return $this->inCell($token); + break; + case self::IN_SELECT: + return $this->inSelect($token); + break; + case self::AFTER_BODY: + return $this->afterBody($token); + break; + case self::IN_FRAME: + return $this->inFrameset($token); + break; + case self::AFTR_FRAME: + return $this->afterFrameset($token); + break; + case self::END_PHASE: + return $this->trailingEndPhase($token); + break; } } } - private function beforeHead($token) { + private function beforeHead($token) + { /* Handle the token as follows: */ /* A character token that is one of one of U+0009 CHARACTER TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { /* Append the character to the current node. */ $this->insertText($token['data']); - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { /* Append a Comment node to the current node with the data attribute set to the data given in the comment token. */ $this->insertComment($token['data']); - /* A start tag token with the tag name "head" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') { + /* A start tag token with the tag name "head" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') { /* Create an element for the token, append the new element to the current node and push it onto the stack of open elements. */ $element = $this->insertElement($token); @@ -1424,32 +1945,38 @@ class HTML5TreeConstructer { /* Change the insertion mode to "in head". */ $this->mode = self::IN_HEAD; - /* A start tag token whose tag name is one of: "base", "link", "meta", - "script", "style", "title". Or an end tag with the tag name "html". - Or a character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. Or any other start tag token */ - } elseif($token['type'] === HTML5::STARTTAG || - ($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') || - ($token['type'] === HTML5::CHARACTR && !preg_match('/^[\t\n\x0b\x0c ]$/', - $token['data']))) { + /* A start tag token whose tag name is one of: "base", "link", "meta", + "script", "style", "title". Or an end tag with the tag name "html". + Or a character token that is not one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE. Or any other start tag token */ + } elseif ($token['type'] === HTML5::STARTTAG || + ($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') || + ($token['type'] === HTML5::CHARACTR && !preg_match( + '/^[\t\n\x0b\x0c ]$/', + $token['data'] + )) + ) { /* Act as if a start tag token with the tag name "head" and no attributes had been seen, then reprocess the current token. */ - $this->beforeHead(array( - 'name' => 'head', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); + $this->beforeHead( + array( + 'name' => 'head', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); return $this->inHead($token); - /* Any other end tag */ - } elseif($token['type'] === HTML5::ENDTAG) { + /* Any other end tag */ + } elseif ($token['type'] === HTML5::ENDTAG) { /* Parse error. Ignore the token. */ } } - private function inHead($token) { + private function inHead($token) + { /* Handle the token as follows: */ /* A character token that is one of one of U+0009 CHARACTER TABULATION, @@ -1459,30 +1986,34 @@ class HTML5TreeConstructer { THIS DIFFERS FROM THE SPEC: If the current node is either a title, style or script element, append the character to the current node regardless of its content. */ - if(($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || ( - $token['type'] === HTML5::CHARACTR && in_array(end($this->stack)->nodeName, - array('title', 'style', 'script')))) { + if (($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || ( + $token['type'] === HTML5::CHARACTR && in_array( + end($this->stack)->nodeName, + array('title', 'style', 'script') + )) + ) { /* Append the character to the current node. */ $this->insertText($token['data']); - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { /* Append a Comment node to the current node with the data attribute set to the data given in the comment token. */ $this->insertComment($token['data']); - } elseif($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('title', 'style', 'script'))) { + } elseif ($token['type'] === HTML5::ENDTAG && + in_array($token['name'], array('title', 'style', 'script')) + ) { array_pop($this->stack); return HTML5::PCDATA; - /* A start tag with the tag name "title" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'title') { + /* A start tag with the tag name "title" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'title') { /* Create an element for the token and append the new element to the node pointed to by the head element pointer, or, if that is null (innerHTML case), to the current node. */ - if($this->head_pointer !== null) { + if ($this->head_pointer !== null) { $element = $this->insertElement($token, false); $this->head_pointer->appendChild($element); @@ -1493,12 +2024,12 @@ class HTML5TreeConstructer { /* Switch the tokeniser's content model flag to the RCDATA state. */ return HTML5::RCDATA; - /* A start tag with the tag name "style" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'style') { + /* A start tag with the tag name "style" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'style') { /* Create an element for the token and append the new element to the node pointed to by the head element pointer, or, if that is null (innerHTML case), to the current node. */ - if($this->head_pointer !== null) { + if ($this->head_pointer !== null) { $element = $this->insertElement($token, false); $this->head_pointer->appendChild($element); @@ -1509,8 +2040,8 @@ class HTML5TreeConstructer { /* Switch the tokeniser's content model flag to the CDATA state. */ return HTML5::CDATA; - /* A start tag with the tag name "script" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'script') { + /* A start tag with the tag name "script" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'script') { /* Create an element for the token. */ $element = $this->insertElement($token, false); $this->head_pointer->appendChild($element); @@ -1518,13 +2049,16 @@ class HTML5TreeConstructer { /* Switch the tokeniser's content model flag to the CDATA state. */ return HTML5::CDATA; - /* A start tag with the tag name "base", "link", or "meta" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('base', 'link', 'meta'))) { + /* A start tag with the tag name "base", "link", or "meta" */ + } elseif ($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array('base', 'link', 'meta') + ) + ) { /* Create an element for the token and append the new element to the node pointed to by the head element pointer, or, if that is null (innerHTML case), to the current node. */ - if($this->head_pointer !== null) { + if ($this->head_pointer !== null) { $element = $this->insertElement($token, false); $this->head_pointer->appendChild($element); array_pop($this->stack); @@ -1533,14 +2067,14 @@ class HTML5TreeConstructer { $this->insertElement($token); } - /* An end tag with the tag name "head" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'head') { + /* An end tag with the tag name "head" */ + } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'head') { /* If the current node is a head element, pop the current node off the stack of open elements. */ - if($this->head_pointer->isSameNode(end($this->stack))) { + if ($this->head_pointer->isSameNode(end($this->stack))) { array_pop($this->stack); - /* Otherwise, this is a parse error. */ + /* Otherwise, this is a parse error. */ } else { // k } @@ -1548,22 +2082,25 @@ class HTML5TreeConstructer { /* Change the insertion mode to "after head". */ $this->mode = self::AFTER_HEAD; - /* A start tag with the tag name "head" or an end tag except "html". */ - } elseif(($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') || - ($token['type'] === HTML5::ENDTAG && $token['name'] !== 'html')) { + /* A start tag with the tag name "head" or an end tag except "html". */ + } elseif (($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') || + ($token['type'] === HTML5::ENDTAG && $token['name'] !== 'html') + ) { // Parse error. Ignore the token. - /* Anything else */ + /* Anything else */ } else { /* If the current node is a head element, act as if an end tag token with the tag name "head" had been seen. */ - if($this->head_pointer->isSameNode(end($this->stack))) { - $this->inHead(array( - 'name' => 'head', - 'type' => HTML5::ENDTAG - )); + if ($this->head_pointer->isSameNode(end($this->stack))) { + $this->inHead( + array( + 'name' => 'head', + 'type' => HTML5::ENDTAG + ) + ); - /* Otherwise, change the insertion mode to "after head". */ + /* Otherwise, change the insertion mode to "after head". */ } else { $this->mode = self::AFTER_HEAD; } @@ -1573,66 +2110,74 @@ class HTML5TreeConstructer { } } - private function afterHead($token) { + private function afterHead($token) + { /* Handle the token as follows: */ /* A character token that is one of one of U+0009 CHARACTER TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { /* Append the character to the current node. */ $this->insertText($token['data']); - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { /* Append a Comment node to the current node with the data attribute set to the data given in the comment token. */ $this->insertComment($token['data']); - /* A start tag token with the tag name "body" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'body') { + /* A start tag token with the tag name "body" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'body') { /* Insert a body element for the token. */ $this->insertElement($token); /* Change the insertion mode to "in body". */ $this->mode = self::IN_BODY; - /* A start tag token with the tag name "frameset" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'frameset') { + /* A start tag token with the tag name "frameset" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'frameset') { /* Insert a frameset element for the token. */ $this->insertElement($token); /* Change the insertion mode to "in frameset". */ $this->mode = self::IN_FRAME; - /* A start tag token whose tag name is one of: "base", "link", "meta", - "script", "style", "title" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('base', 'link', 'meta', 'script', 'style', 'title'))) { + /* A start tag token whose tag name is one of: "base", "link", "meta", + "script", "style", "title" */ + } elseif ($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array('base', 'link', 'meta', 'script', 'style', 'title') + ) + ) { /* Parse error. Switch the insertion mode back to "in head" and reprocess the token. */ $this->mode = self::IN_HEAD; return $this->inHead($token); - /* Anything else */ + /* Anything else */ } else { /* Act as if a start tag token with the tag name "body" and no attributes had been seen, and then reprocess the current token. */ - $this->afterHead(array( - 'name' => 'body', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); + $this->afterHead( + array( + 'name' => 'body', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); return $this->inBody($token); } } - private function inBody($token) { + private function inBody($token) + { /* Handle the token as follows: */ - switch($token['type']) { + switch ($token['type']) { /* A character token */ case HTML5::CHARACTR: /* Reconstruct the active formatting elements, if any. */ @@ -1640,1015 +2185,1159 @@ class HTML5TreeConstructer { /* Append the token's character to the current node. */ $this->insertText($token['data']); - break; + break; /* A comment token */ case HTML5::COMMENT: /* Append a Comment node to the current node with the data attribute set to the data given in the comment token. */ $this->insertComment($token['data']); - break; + break; case HTML5::STARTTAG: - switch($token['name']) { - /* A start tag token whose tag name is one of: "script", - "style" */ - case 'script': case 'style': - /* Process the token as if the insertion mode had been "in - head". */ - return $this->inHead($token); - break; + switch ($token['name']) { + /* A start tag token whose tag name is one of: "script", + "style" */ + case 'script': + case 'style': + /* Process the token as if the insertion mode had been "in + head". */ + return $this->inHead($token); + break; - /* A start tag token whose tag name is one of: "base", "link", - "meta", "title" */ - case 'base': case 'link': case 'meta': case 'title': - /* Parse error. Process the token as if the insertion mode - had been "in head". */ - return $this->inHead($token); - break; + /* A start tag token whose tag name is one of: "base", "link", + "meta", "title" */ + case 'base': + case 'link': + case 'meta': + case 'title': + /* Parse error. Process the token as if the insertion mode + had been "in head". */ + return $this->inHead($token); + break; - /* A start tag token with the tag name "body" */ - case 'body': - /* Parse error. If the second element on the stack of open - elements is not a body element, or, if the stack of open - elements has only one node on it, then ignore the token. - (innerHTML case) */ - if(count($this->stack) === 1 || $this->stack[1]->nodeName !== 'body') { - // Ignore - - /* Otherwise, for each attribute on the token, check to see - if the attribute is already present on the body element (the - second element) on the stack of open elements. If it is not, - add the attribute and its corresponding value to that - element. */ - } else { - foreach($token['attr'] as $attr) { - if(!$this->stack[1]->hasAttribute($attr['name'])) { - $this->stack[1]->setAttribute($attr['name'], $attr['value']); + /* A start tag token with the tag name "body" */ + case 'body': + /* Parse error. If the second element on the stack of open + elements is not a body element, or, if the stack of open + elements has only one node on it, then ignore the token. + (innerHTML case) */ + if (count($this->stack) === 1 || $this->stack[1]->nodeName !== 'body') { + // Ignore + + /* Otherwise, for each attribute on the token, check to see + if the attribute is already present on the body element (the + second element) on the stack of open elements. If it is not, + add the attribute and its corresponding value to that + element. */ + } else { + foreach ($token['attr'] as $attr) { + if (!$this->stack[1]->hasAttribute($attr['name'])) { + $this->stack[1]->setAttribute($attr['name'], $attr['value']); + } } } - } - break; - - /* A start tag whose tag name is one of: "address", - "blockquote", "center", "dir", "div", "dl", "fieldset", - "listing", "menu", "ol", "p", "ul" */ - case 'address': case 'blockquote': case 'center': case 'dir': - case 'div': case 'dl': case 'fieldset': case 'listing': - case 'menu': case 'ol': case 'p': case 'ul': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - break; + break; - /* A start tag whose tag name is "form" */ - case 'form': - /* If the form element pointer is not null, ignore the - token with a parse error. */ - if($this->form_pointer !== null) { - // Ignore. - - /* Otherwise: */ - } else { - /* If the stack of open elements has a p element in - scope, then act as if an end tag with the tag name p - had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); + /* A start tag whose tag name is one of: "address", + "blockquote", "center", "dir", "div", "dl", "fieldset", + "listing", "menu", "ol", "p", "ul" */ + case 'address': + case 'blockquote': + case 'center': + case 'dir': + case 'div': + case 'dl': + case 'fieldset': + case 'listing': + case 'menu': + case 'ol': + case 'p': + case 'ul': + /* If the stack of open elements has a p element in scope, + then act as if an end tag with the tag name p had been + seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); } - /* Insert an HTML element for the token, and set the - form element pointer to point to the element created. */ - $element = $this->insertElement($token); - $this->form_pointer = $element; - } - break; + /* Insert an HTML element for the token. */ + $this->insertElement($token); + break; - /* A start tag whose tag name is "li", "dd" or "dt" */ - case 'li': case 'dd': case 'dt': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } + /* A start tag whose tag name is "form" */ + case 'form': + /* If the form element pointer is not null, ignore the + token with a parse error. */ + if ($this->form_pointer !== null) { + // Ignore. - $stack_length = count($this->stack) - 1; - - for($n = $stack_length; 0 <= $n; $n--) { - /* 1. Initialise node to be the current node (the - bottommost node of the stack). */ - $stop = false; - $node = $this->stack[$n]; - $cat = $this->getElementCategory($node->tagName); - - /* 2. If node is an li, dd or dt element, then pop all - the nodes from the current node up to node, including - node, then stop this algorithm. */ - if($token['name'] === $node->tagName || ($token['name'] !== 'li' - && ($node->tagName === 'dd' || $node->tagName === 'dt'))) { - for($x = $stack_length; $x >= $n ; $x--) { - array_pop($this->stack); + /* Otherwise: */ + } else { + /* If the stack of open elements has a p element in + scope, then act as if an end tag with the tag name p + had been seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); } - break; + /* Insert an HTML element for the token, and set the + form element pointer to point to the element created. */ + $element = $this->insertElement($token); + $this->form_pointer = $element; } + break; - /* 3. If node is not in the formatting category, and is - not in the phrasing category, and is not an address or - div element, then stop this algorithm. */ - if($cat !== self::FORMATTING && $cat !== self::PHRASING && - $node->tagName !== 'address' && $node->tagName !== 'div') { - break; + /* A start tag whose tag name is "li", "dd" or "dt" */ + case 'li': + case 'dd': + case 'dt': + /* If the stack of open elements has a p element in scope, + then act as if an end tag with the tag name p had been + seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); } - } - /* Finally, insert an HTML element with the same tag - name as the token's. */ - $this->insertElement($token); - break; + $stack_length = count($this->stack) - 1; + + for ($n = $stack_length; 0 <= $n; $n--) { + /* 1. Initialise node to be the current node (the + bottommost node of the stack). */ + $stop = false; + $node = $this->stack[$n]; + $cat = $this->getElementCategory($node->tagName); + + /* 2. If node is an li, dd or dt element, then pop all + the nodes from the current node up to node, including + node, then stop this algorithm. */ + if ($token['name'] === $node->tagName || ($token['name'] !== 'li' + && ($node->tagName === 'dd' || $node->tagName === 'dt')) + ) { + for ($x = $stack_length; $x >= $n; $x--) { + array_pop($this->stack); + } - /* A start tag token whose tag name is "plaintext" */ - case 'plaintext': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } + break; + } - /* Insert an HTML element for the token. */ - $this->insertElement($token); + /* 3. If node is not in the formatting category, and is + not in the phrasing category, and is not an address or + div element, then stop this algorithm. */ + if ($cat !== self::FORMATTING && $cat !== self::PHRASING && + $node->tagName !== 'address' && $node->tagName !== 'div' + ) { + break; + } + } - return HTML5::PLAINTEXT; - break; + /* Finally, insert an HTML element with the same tag + name as the token's. */ + $this->insertElement($token); + break; - /* A start tag whose tag name is one of: "h1", "h2", "h3", "h4", - "h5", "h6" */ - case 'h1': case 'h2': case 'h3': case 'h4': case 'h5': case 'h6': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } + /* A start tag token whose tag name is "plaintext" */ + case 'plaintext': + /* If the stack of open elements has a p element in scope, + then act as if an end tag with the tag name p had been + seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + } - /* If the stack of open elements has in scope an element whose - tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then - this is a parse error; pop elements from the stack until an - element with one of those tag names has been popped from the - stack. */ - while($this->elementInScope(array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'))) { - array_pop($this->stack); - } + /* Insert an HTML element for the token. */ + $this->insertElement($token); - /* Insert an HTML element for the token. */ - $this->insertElement($token); - break; + return HTML5::PLAINTEXT; + break; - /* A start tag whose tag name is "a" */ - case 'a': - /* If the list of active formatting elements contains - an element whose tag name is "a" between the end of the - list and the last marker on the list (or the start of - the list if there is no marker on the list), then this - is a parse error; act as if an end tag with the tag name - "a" had been seen, then remove that element from the list - of active formatting elements and the stack of open - elements if the end tag didn't already remove it (it - might not have if the element is not in table scope). */ - $leng = count($this->a_formatting); - - for($n = $leng - 1; $n >= 0; $n--) { - if($this->a_formatting[$n] === self::MARKER) { - break; - - } elseif($this->a_formatting[$n]->nodeName === 'a') { - $this->emitToken(array( - 'name' => 'a', - 'type' => HTML5::ENDTAG - )); - break; + /* A start tag whose tag name is one of: "h1", "h2", "h3", "h4", + "h5", "h6" */ + case 'h1': + case 'h2': + case 'h3': + case 'h4': + case 'h5': + case 'h6': + /* If the stack of open elements has a p element in scope, + then act as if an end tag with the tag name p had been seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); } - } - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); + /* If the stack of open elements has in scope an element whose + tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then + this is a parse error; pop elements from the stack until an + element with one of those tag names has been popped from the + stack. */ + while ($this->elementInScope(array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'))) { + array_pop($this->stack); + } - /* Insert an HTML element for the token. */ - $el = $this->insertElement($token); + /* Insert an HTML element for the token. */ + $this->insertElement($token); + break; - /* Add that element to the list of active formatting - elements. */ - $this->a_formatting[] = $el; - break; + /* A start tag whose tag name is "a" */ + case 'a': + /* If the list of active formatting elements contains + an element whose tag name is "a" between the end of the + list and the last marker on the list (or the start of + the list if there is no marker on the list), then this + is a parse error; act as if an end tag with the tag name + "a" had been seen, then remove that element from the list + of active formatting elements and the stack of open + elements if the end tag didn't already remove it (it + might not have if the element is not in table scope). */ + $leng = count($this->a_formatting); + + for ($n = $leng - 1; $n >= 0; $n--) { + if ($this->a_formatting[$n] === self::MARKER) { + break; - /* A start tag whose tag name is one of: "b", "big", "em", "font", - "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ - case 'b': case 'big': case 'em': case 'font': case 'i': - case 'nobr': case 's': case 'small': case 'strike': - case 'strong': case 'tt': case 'u': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); + } elseif ($this->a_formatting[$n]->nodeName === 'a') { + $this->emitToken( + array( + 'name' => 'a', + 'type' => HTML5::ENDTAG + ) + ); + break; + } + } - /* Insert an HTML element for the token. */ - $el = $this->insertElement($token); + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); - /* Add that element to the list of active formatting - elements. */ - $this->a_formatting[] = $el; - break; + /* Insert an HTML element for the token. */ + $el = $this->insertElement($token); - /* A start tag token whose tag name is "button" */ - case 'button': - /* If the stack of open elements has a button element in scope, - then this is a parse error; act as if an end tag with the tag - name "button" had been seen, then reprocess the token. (We don't - do that. Unnecessary.) */ - if($this->elementInScope('button')) { - $this->inBody(array( - 'name' => 'button', - 'type' => HTML5::ENDTAG - )); - } + /* Add that element to the list of active formatting + elements. */ + $this->a_formatting[] = $el; + break; - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); + /* A start tag whose tag name is one of: "b", "big", "em", "font", + "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ + case 'b': + case 'big': + case 'em': + case 'font': + case 'i': + case 'nobr': + case 's': + case 'small': + case 'strike': + case 'strong': + case 'tt': + case 'u': + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Insert an HTML element for the token. */ + $el = $this->insertElement($token); + + /* Add that element to the list of active formatting + elements. */ + $this->a_formatting[] = $el; + break; - /* Insert an HTML element for the token. */ - $this->insertElement($token); + /* A start tag token whose tag name is "button" */ + case 'button': + /* If the stack of open elements has a button element in scope, + then this is a parse error; act as if an end tag with the tag + name "button" had been seen, then reprocess the token. (We don't + do that. Unnecessary.) */ + if ($this->elementInScope('button')) { + $this->inBody( + array( + 'name' => 'button', + 'type' => HTML5::ENDTAG + ) + ); + } - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - break; + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); - /* A start tag token whose tag name is one of: "marquee", "object" */ - case 'marquee': case 'object': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); + /* Insert an HTML element for the token. */ + $this->insertElement($token); - /* Insert an HTML element for the token. */ - $this->insertElement($token); + /* Insert a marker at the end of the list of active + formatting elements. */ + $this->a_formatting[] = self::MARKER; + break; - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - break; + /* A start tag token whose tag name is one of: "marquee", "object" */ + case 'marquee': + case 'object': + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); - /* A start tag token whose tag name is "xmp" */ - case 'xmp': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); + /* Insert an HTML element for the token. */ + $this->insertElement($token); - /* Insert an HTML element for the token. */ - $this->insertElement($token); + /* Insert a marker at the end of the list of active + formatting elements. */ + $this->a_formatting[] = self::MARKER; + break; - /* Switch the content model flag to the CDATA state. */ - return HTML5::CDATA; - break; + /* A start tag token whose tag name is "xmp" */ + case 'xmp': + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); - /* A start tag whose tag name is "table" */ - case 'table': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } + /* Insert an HTML element for the token. */ + $this->insertElement($token); - /* Insert an HTML element for the token. */ - $this->insertElement($token); + /* Switch the content model flag to the CDATA state. */ + return HTML5::CDATA; + break; - /* Change the insertion mode to "in table". */ - $this->mode = self::IN_TABLE; - break; + /* A start tag whose tag name is "table" */ + case 'table': + /* If the stack of open elements has a p element in scope, + then act as if an end tag with the tag name p had been seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + } - /* A start tag whose tag name is one of: "area", "basefont", - "bgsound", "br", "embed", "img", "param", "spacer", "wbr" */ - case 'area': case 'basefont': case 'bgsound': case 'br': - case 'embed': case 'img': case 'param': case 'spacer': - case 'wbr': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); + /* Insert an HTML element for the token. */ + $this->insertElement($token); - /* Insert an HTML element for the token. */ - $this->insertElement($token); + /* Change the insertion mode to "in table". */ + $this->mode = self::IN_TABLE; + break; - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - break; + /* A start tag whose tag name is one of: "area", "basefont", + "bgsound", "br", "embed", "img", "param", "spacer", "wbr" */ + case 'area': + case 'basefont': + case 'bgsound': + case 'br': + case 'embed': + case 'img': + case 'param': + case 'spacer': + case 'wbr': + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* Immediately pop the current node off the stack of open elements. */ + array_pop($this->stack); + break; - /* A start tag whose tag name is "hr" */ - case 'hr': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } + /* A start tag whose tag name is "hr" */ + case 'hr': + /* If the stack of open elements has a p element in scope, + then act as if an end tag with the tag name p had been seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + } - /* Insert an HTML element for the token. */ - $this->insertElement($token); + /* Insert an HTML element for the token. */ + $this->insertElement($token); - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - break; + /* Immediately pop the current node off the stack of open elements. */ + array_pop($this->stack); + break; - /* A start tag whose tag name is "image" */ - case 'image': - /* Parse error. Change the token's tag name to "img" and - reprocess it. (Don't ask.) */ - $token['name'] = 'img'; - return $this->inBody($token); - break; + /* A start tag whose tag name is "image" */ + case 'image': + /* Parse error. Change the token's tag name to "img" and + reprocess it. (Don't ask.) */ + $token['name'] = 'img'; + return $this->inBody($token); + break; - /* A start tag whose tag name is "input" */ - case 'input': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); + /* A start tag whose tag name is "input" */ + case 'input': + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); - /* Insert an input element for the token. */ - $element = $this->insertElement($token, false); + /* Insert an input element for the token. */ + $element = $this->insertElement($token, false); - /* If the form element pointer is not null, then associate the - input element with the form element pointed to by the form - element pointer. */ - $this->form_pointer !== null - ? $this->form_pointer->appendChild($element) - : end($this->stack)->appendChild($element); + /* If the form element pointer is not null, then associate the + input element with the form element pointed to by the form + element pointer. */ + $this->form_pointer !== null + ? $this->form_pointer->appendChild($element) + : end($this->stack)->appendChild($element); - /* Pop that input element off the stack of open elements. */ - array_pop($this->stack); - break; + /* Pop that input element off the stack of open elements. */ + array_pop($this->stack); + break; - /* A start tag whose tag name is "isindex" */ - case 'isindex': - /* Parse error. */ - // w/e - - /* If the form element pointer is not null, - then ignore the token. */ - if($this->form_pointer === null) { - /* Act as if a start tag token with the tag name "form" had - been seen. */ - $this->inBody(array( - 'name' => 'body', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a start tag token with the tag name "hr" had - been seen. */ - $this->inBody(array( - 'name' => 'hr', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a start tag token with the tag name "p" had - been seen. */ - $this->inBody(array( - 'name' => 'p', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a start tag token with the tag name "label" - had been seen. */ - $this->inBody(array( - 'name' => 'label', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a stream of character tokens had been seen. */ - $this->insertText('This is a searchable index. '. - 'Insert your search keywords here: '); - - /* Act as if a start tag token with the tag name "input" - had been seen, with all the attributes from the "isindex" - token, except with the "name" attribute set to the value - "isindex" (ignoring any explicit "name" attribute). */ - $attr = $token['attr']; - $attr[] = array('name' => 'name', 'value' => 'isindex'); - - $this->inBody(array( - 'name' => 'input', - 'type' => HTML5::STARTTAG, - 'attr' => $attr - )); - - /* Act as if a stream of character tokens had been seen - (see below for what they should say). */ - $this->insertText('This is a searchable index. '. - 'Insert your search keywords here: '); - - /* Act as if an end tag token with the tag name "label" - had been seen. */ - $this->inBody(array( - 'name' => 'label', - 'type' => HTML5::ENDTAG - )); - - /* Act as if an end tag token with the tag name "p" had - been seen. */ - $this->inBody(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - - /* Act as if a start tag token with the tag name "hr" had - been seen. */ - $this->inBody(array( - 'name' => 'hr', - 'type' => HTML5::ENDTAG - )); - - /* Act as if an end tag token with the tag name "form" had - been seen. */ - $this->inBody(array( - 'name' => 'form', - 'type' => HTML5::ENDTAG - )); - } - break; + /* A start tag whose tag name is "isindex" */ + case 'isindex': + /* Parse error. */ + // w/e - /* A start tag whose tag name is "textarea" */ - case 'textarea': - $this->insertElement($token); + /* If the form element pointer is not null, + then ignore the token. */ + if ($this->form_pointer === null) { + /* Act as if a start tag token with the tag name "form" had + been seen. */ + $this->inBody( + array( + 'name' => 'body', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + /* Act as if a start tag token with the tag name "hr" had + been seen. */ + $this->inBody( + array( + 'name' => 'hr', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + /* Act as if a start tag token with the tag name "p" had + been seen. */ + $this->inBody( + array( + 'name' => 'p', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + /* Act as if a start tag token with the tag name "label" + had been seen. */ + $this->inBody( + array( + 'name' => 'label', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + /* Act as if a stream of character tokens had been seen. */ + $this->insertText( + 'This is a searchable index. ' . + 'Insert your search keywords here: ' + ); + + /* Act as if a start tag token with the tag name "input" + had been seen, with all the attributes from the "isindex" + token, except with the "name" attribute set to the value + "isindex" (ignoring any explicit "name" attribute). */ + $attr = $token['attr']; + $attr[] = array('name' => 'name', 'value' => 'isindex'); + + $this->inBody( + array( + 'name' => 'input', + 'type' => HTML5::STARTTAG, + 'attr' => $attr + ) + ); + + /* Act as if a stream of character tokens had been seen + (see below for what they should say). */ + $this->insertText( + 'This is a searchable index. ' . + 'Insert your search keywords here: ' + ); + + /* Act as if an end tag token with the tag name "label" + had been seen. */ + $this->inBody( + array( + 'name' => 'label', + 'type' => HTML5::ENDTAG + ) + ); + + /* Act as if an end tag token with the tag name "p" had + been seen. */ + $this->inBody( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + + /* Act as if a start tag token with the tag name "hr" had + been seen. */ + $this->inBody( + array( + 'name' => 'hr', + 'type' => HTML5::ENDTAG + ) + ); + + /* Act as if an end tag token with the tag name "form" had + been seen. */ + $this->inBody( + array( + 'name' => 'form', + 'type' => HTML5::ENDTAG + ) + ); + } + break; - /* Switch the tokeniser's content model flag to the - RCDATA state. */ - return HTML5::RCDATA; - break; + /* A start tag whose tag name is "textarea" */ + case 'textarea': + $this->insertElement($token); - /* A start tag whose tag name is one of: "iframe", "noembed", - "noframes" */ - case 'iframe': case 'noembed': case 'noframes': - $this->insertElement($token); + /* Switch the tokeniser's content model flag to the + RCDATA state. */ + return HTML5::RCDATA; + break; - /* Switch the tokeniser's content model flag to the CDATA state. */ - return HTML5::CDATA; - break; + /* A start tag whose tag name is one of: "iframe", "noembed", + "noframes" */ + case 'iframe': + case 'noembed': + case 'noframes': + $this->insertElement($token); - /* A start tag whose tag name is "select" */ - case 'select': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); + /* Switch the tokeniser's content model flag to the CDATA state. */ + return HTML5::CDATA; + break; - /* Insert an HTML element for the token. */ - $this->insertElement($token); + /* A start tag whose tag name is "select" */ + case 'select': + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); - /* Change the insertion mode to "in select". */ - $this->mode = self::IN_SELECT; - break; + /* Insert an HTML element for the token. */ + $this->insertElement($token); - /* A start or end tag whose tag name is one of: "caption", "col", - "colgroup", "frame", "frameset", "head", "option", "optgroup", - "tbody", "td", "tfoot", "th", "thead", "tr". */ - case 'caption': case 'col': case 'colgroup': case 'frame': - case 'frameset': case 'head': case 'option': case 'optgroup': - case 'tbody': case 'td': case 'tfoot': case 'th': case 'thead': - case 'tr': - // Parse error. Ignore the token. - break; + /* Change the insertion mode to "in select". */ + $this->mode = self::IN_SELECT; + break; - /* A start or end tag whose tag name is one of: "event-source", - "section", "nav", "article", "aside", "header", "footer", - "datagrid", "command" */ - case 'event-source': case 'section': case 'nav': case 'article': - case 'aside': case 'header': case 'footer': case 'datagrid': - case 'command': - // Work in progress! - break; + /* A start or end tag whose tag name is one of: "caption", "col", + "colgroup", "frame", "frameset", "head", "option", "optgroup", + "tbody", "td", "tfoot", "th", "thead", "tr". */ + case 'caption': + case 'col': + case 'colgroup': + case 'frame': + case 'frameset': + case 'head': + case 'option': + case 'optgroup': + case 'tbody': + case 'td': + case 'tfoot': + case 'th': + case 'thead': + case 'tr': + // Parse error. Ignore the token. + break; - /* A start tag token not covered by the previous entries */ - default: - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); + /* A start or end tag whose tag name is one of: "event-source", + "section", "nav", "article", "aside", "header", "footer", + "datagrid", "command" */ + case 'event-source': + case 'section': + case 'nav': + case 'article': + case 'aside': + case 'header': + case 'footer': + case 'datagrid': + case 'command': + // Work in progress! + break; + + /* A start tag token not covered by the previous entries */ + default: + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); - $this->insertElement($token, true, true); + $this->insertElement($token, true, true); + break; + } break; - } - break; case HTML5::ENDTAG: - switch($token['name']) { - /* An end tag with the tag name "body" */ - case 'body': - /* If the second element in the stack of open elements is - not a body element, this is a parse error. Ignore the token. - (innerHTML case) */ - if(count($this->stack) < 2 || $this->stack[1]->nodeName !== 'body') { - // Ignore. - - /* If the current node is not the body element, then this - is a parse error. */ - } elseif(end($this->stack)->nodeName !== 'body') { - // Parse error. - } + switch ($token['name']) { + /* An end tag with the tag name "body" */ + case 'body': + /* If the second element in the stack of open elements is + not a body element, this is a parse error. Ignore the token. + (innerHTML case) */ + if (count($this->stack) < 2 || $this->stack[1]->nodeName !== 'body') { + // Ignore. + + /* If the current node is not the body element, then this + is a parse error. */ + } elseif (end($this->stack)->nodeName !== 'body') { + // Parse error. + } - /* Change the insertion mode to "after body". */ - $this->mode = self::AFTER_BODY; - break; + /* Change the insertion mode to "after body". */ + $this->mode = self::AFTER_BODY; + break; - /* An end tag with the tag name "html" */ - case 'html': - /* Act as if an end tag with tag name "body" had been seen, - then, if that token wasn't ignored, reprocess the current - token. */ - $this->inBody(array( - 'name' => 'body', - 'type' => HTML5::ENDTAG - )); + /* An end tag with the tag name "html" */ + case 'html': + /* Act as if an end tag with tag name "body" had been seen, + then, if that token wasn't ignored, reprocess the current + token. */ + $this->inBody( + array( + 'name' => 'body', + 'type' => HTML5::ENDTAG + ) + ); - return $this->afterBody($token); - break; + return $this->afterBody($token); + break; - /* An end tag whose tag name is one of: "address", "blockquote", - "center", "dir", "div", "dl", "fieldset", "listing", "menu", - "ol", "pre", "ul" */ - case 'address': case 'blockquote': case 'center': case 'dir': - case 'div': case 'dl': case 'fieldset': case 'listing': - case 'menu': case 'ol': case 'pre': case 'ul': - /* If the stack of open elements has an element in scope - with the same tag name as that of the token, then generate - implied end tags. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with - the same tag name as that of the token, then this - is a parse error. */ - // w/e + /* An end tag whose tag name is one of: "address", "blockquote", + "center", "dir", "div", "dl", "fieldset", "listing", "menu", + "ol", "pre", "ul" */ + case 'address': + case 'blockquote': + case 'center': + case 'dir': + case 'div': + case 'dl': + case 'fieldset': + case 'listing': + case 'menu': + case 'ol': + case 'pre': + case 'ul': + /* If the stack of open elements has an element in scope + with the same tag name as that of the token, then generate + implied end tags. */ + if ($this->elementInScope($token['name'])) { + $this->generateImpliedEndTags(); - /* If the stack of open elements has an element in - scope with the same tag name as that of the token, - then pop elements from this stack until an element - with that tag name has been popped from the stack. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === $token['name']) { - $n = -1; + /* Now, if the current node is not an element with + the same tag name as that of the token, then this + is a parse error. */ + // w/e + + /* If the stack of open elements has an element in + scope with the same tag name as that of the token, + then pop elements from this stack until an element + with that tag name has been popped from the stack. */ + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + if ($this->stack[$n]->nodeName === $token['name']) { + $n = -1; + } + + array_pop($this->stack); } + } + break; + + /* An end tag whose tag name is "form" */ + case 'form': + /* If the stack of open elements has an element in scope + with the same tag name as that of the token, then generate + implied end tags. */ + if ($this->elementInScope($token['name'])) { + $this->generateImpliedEndTags(); - array_pop($this->stack); } - } - break; - /* An end tag whose tag name is "form" */ - case 'form': - /* If the stack of open elements has an element in scope - with the same tag name as that of the token, then generate - implied end tags. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); + if (end($this->stack)->nodeName !== $token['name']) { + /* Now, if the current node is not an element with the + same tag name as that of the token, then this is a parse + error. */ + // w/e - } + } else { + /* Otherwise, if the current node is an element with + the same tag name as that of the token pop that element + from the stack. */ + array_pop($this->stack); + } - if(end($this->stack)->nodeName !== $token['name']) { - /* Now, if the current node is not an element with the - same tag name as that of the token, then this is a parse - error. */ - // w/e + /* In any case, set the form element pointer to null. */ + $this->form_pointer = null; + break; - } else { - /* Otherwise, if the current node is an element with - the same tag name as that of the token pop that element - from the stack. */ - array_pop($this->stack); - } + /* An end tag whose tag name is "p" */ + case 'p': + /* If the stack of open elements has a p element in scope, + then generate implied end tags, except for p elements. */ + if ($this->elementInScope('p')) { + $this->generateImpliedEndTags(array('p')); - /* In any case, set the form element pointer to null. */ - $this->form_pointer = null; - break; + /* If the current node is not a p element, then this is + a parse error. */ + // k - /* An end tag whose tag name is "p" */ - case 'p': - /* If the stack of open elements has a p element in scope, - then generate implied end tags, except for p elements. */ - if($this->elementInScope('p')) { - $this->generateImpliedEndTags(array('p')); - - /* If the current node is not a p element, then this is - a parse error. */ - // k - - /* If the stack of open elements has a p element in - scope, then pop elements from this stack until the stack - no longer has a p element in scope. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->elementInScope('p')) { - array_pop($this->stack); + /* If the stack of open elements has a p element in + scope, then pop elements from this stack until the stack + no longer has a p element in scope. */ + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + if ($this->elementInScope('p')) { + array_pop($this->stack); - } else { - break; + } else { + break; + } } } - } - break; - - /* An end tag whose tag name is "dd", "dt", or "li" */ - case 'dd': case 'dt': case 'li': - /* If the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then - generate implied end tags, except for elements with the - same tag name as the token. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(array($token['name'])); - - /* If the current node is not an element with the same - tag name as the token, then this is a parse error. */ - // w/e + break; + /* An end tag whose tag name is "dd", "dt", or "li" */ + case 'dd': + case 'dt': + case 'li': /* If the stack of open elements has an element in scope whose tag name matches the tag name of the token, then - pop elements from this stack until an element with that - tag name has been popped from the stack. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } + generate implied end tags, except for elements with the + same tag name as the token. */ + if ($this->elementInScope($token['name'])) { + $this->generateImpliedEndTags(array($token['name'])); + + /* If the current node is not an element with the same + tag name as the token, then this is a parse error. */ + // w/e + + /* If the stack of open elements has an element in scope + whose tag name matches the tag name of the token, then + pop elements from this stack until an element with that + tag name has been popped from the stack. */ + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + if ($this->stack[$n]->nodeName === $token['name']) { + $n = -1; + } - array_pop($this->stack); + array_pop($this->stack); + } } - } - break; - - /* An end tag whose tag name is one of: "h1", "h2", "h3", "h4", - "h5", "h6" */ - case 'h1': case 'h2': case 'h3': case 'h4': case 'h5': case 'h6': - $elements = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'); + break; - /* If the stack of open elements has in scope an element whose - tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then - generate implied end tags. */ - if($this->elementInScope($elements)) { - $this->generateImpliedEndTags(); + /* An end tag whose tag name is one of: "h1", "h2", "h3", "h4", + "h5", "h6" */ + case 'h1': + case 'h2': + case 'h3': + case 'h4': + case 'h5': + case 'h6': + $elements = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'); + + /* If the stack of open elements has in scope an element whose + tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then + generate implied end tags. */ + if ($this->elementInScope($elements)) { + $this->generateImpliedEndTags(); - /* Now, if the current node is not an element with the same - tag name as that of the token, then this is a parse error. */ - // w/e + /* Now, if the current node is not an element with the same + tag name as that of the token, then this is a parse error. */ + // w/e - /* If the stack of open elements has in scope an element - whose tag name is one of "h1", "h2", "h3", "h4", "h5", or - "h6", then pop elements from the stack until an element - with one of those tag names has been popped from the stack. */ - while($this->elementInScope($elements)) { - array_pop($this->stack); + /* If the stack of open elements has in scope an element + whose tag name is one of "h1", "h2", "h3", "h4", "h5", or + "h6", then pop elements from the stack until an element + with one of those tag names has been popped from the stack. */ + while ($this->elementInScope($elements)) { + array_pop($this->stack); + } } - } - break; + break; - /* An end tag whose tag name is one of: "a", "b", "big", "em", - "font", "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ - case 'a': case 'b': case 'big': case 'em': case 'font': - case 'i': case 'nobr': case 's': case 'small': case 'strike': - case 'strong': case 'tt': case 'u': - /* 1. Let the formatting element be the last element in - the list of active formatting elements that: - * is between the end of the list and the last scope - marker in the list, if any, or the start of the list - otherwise, and - * has the same tag name as the token. - */ - while(true) { - for($a = count($this->a_formatting) - 1; $a >= 0; $a--) { - if($this->a_formatting[$a] === self::MARKER) { + /* An end tag whose tag name is one of: "a", "b", "big", "em", + "font", "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ + case 'a': + case 'b': + case 'big': + case 'em': + case 'font': + case 'i': + case 'nobr': + case 's': + case 'small': + case 'strike': + case 'strong': + case 'tt': + case 'u': + /* 1. Let the formatting element be the last element in + the list of active formatting elements that: + * is between the end of the list and the last scope + marker in the list, if any, or the start of the list + otherwise, and + * has the same tag name as the token. + */ + while (true) { + for ($a = count($this->a_formatting) - 1; $a >= 0; $a--) { + if ($this->a_formatting[$a] === self::MARKER) { + break; + + } elseif ($this->a_formatting[$a]->tagName === $token['name']) { + $formatting_element = $this->a_formatting[$a]; + $in_stack = in_array($formatting_element, $this->stack, true); + $fe_af_pos = $a; + break; + } + } + + /* If there is no such node, or, if that node is + also in the stack of open elements but the element + is not in scope, then this is a parse error. Abort + these steps. The token is ignored. */ + if (!isset($formatting_element) || ($in_stack && + !$this->elementInScope($token['name'])) + ) { break; - } elseif($this->a_formatting[$a]->tagName === $token['name']) { - $formatting_element = $this->a_formatting[$a]; - $in_stack = in_array($formatting_element, $this->stack, true); - $fe_af_pos = $a; + /* Otherwise, if there is such a node, but that node + is not in the stack of open elements, then this is a + parse error; remove the element from the list, and + abort these steps. */ + } elseif (isset($formatting_element) && !$in_stack) { + unset($this->a_formatting[$fe_af_pos]); + $this->a_formatting = array_merge($this->a_formatting); break; } - } - - /* If there is no such node, or, if that node is - also in the stack of open elements but the element - is not in scope, then this is a parse error. Abort - these steps. The token is ignored. */ - if(!isset($formatting_element) || ($in_stack && - !$this->elementInScope($token['name']))) { - break; - - /* Otherwise, if there is such a node, but that node - is not in the stack of open elements, then this is a - parse error; remove the element from the list, and - abort these steps. */ - } elseif(isset($formatting_element) && !$in_stack) { - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - break; - } - /* 2. Let the furthest block be the topmost node in the - stack of open elements that is lower in the stack - than the formatting element, and is not an element in - the phrasing or formatting categories. There might - not be one. */ - $fe_s_pos = array_search($formatting_element, $this->stack, true); - $length = count($this->stack); + /* 2. Let the furthest block be the topmost node in the + stack of open elements that is lower in the stack + than the formatting element, and is not an element in + the phrasing or formatting categories. There might + not be one. */ + $fe_s_pos = array_search($formatting_element, $this->stack, true); + $length = count($this->stack); - for($s = $fe_s_pos + 1; $s < $length; $s++) { - $category = $this->getElementCategory($this->stack[$s]->nodeName); + for ($s = $fe_s_pos + 1; $s < $length; $s++) { + $category = $this->getElementCategory($this->stack[$s]->nodeName); - if($category !== self::PHRASING && $category !== self::FORMATTING) { - $furthest_block = $this->stack[$s]; + if ($category !== self::PHRASING && $category !== self::FORMATTING) { + $furthest_block = $this->stack[$s]; + } } - } - /* 3. If there is no furthest block, then the UA must - skip the subsequent steps and instead just pop all - the nodes from the bottom of the stack of open - elements, from the current node up to the formatting - element, and remove the formatting element from the - list of active formatting elements. */ - if(!isset($furthest_block)) { - for($n = $length - 1; $n >= $fe_s_pos; $n--) { - array_pop($this->stack); - } + /* 3. If there is no furthest block, then the UA must + skip the subsequent steps and instead just pop all + the nodes from the bottom of the stack of open + elements, from the current node up to the formatting + element, and remove the formatting element from the + list of active formatting elements. */ + if (!isset($furthest_block)) { + for ($n = $length - 1; $n >= $fe_s_pos; $n--) { + array_pop($this->stack); + } - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - break; - } + unset($this->a_formatting[$fe_af_pos]); + $this->a_formatting = array_merge($this->a_formatting); + break; + } - /* 4. Let the common ancestor be the element - immediately above the formatting element in the stack - of open elements. */ - $common_ancestor = $this->stack[$fe_s_pos - 1]; + /* 4. Let the common ancestor be the element + immediately above the formatting element in the stack + of open elements. */ + $common_ancestor = $this->stack[$fe_s_pos - 1]; - /* 5. If the furthest block has a parent node, then - remove the furthest block from its parent node. */ - if($furthest_block->parentNode !== null) { - $furthest_block->parentNode->removeChild($furthest_block); - } + /* 5. If the furthest block has a parent node, then + remove the furthest block from its parent node. */ + if ($furthest_block->parentNode !== null) { + $furthest_block->parentNode->removeChild($furthest_block); + } - /* 6. Let a bookmark note the position of the - formatting element in the list of active formatting - elements relative to the elements on either side - of it in the list. */ - $bookmark = $fe_af_pos; - - /* 7. Let node and last node be the furthest block. - Follow these steps: */ - $node = $furthest_block; - $last_node = $furthest_block; - - while(true) { - for($n = array_search($node, $this->stack, true) - 1; $n >= 0; $n--) { - /* 7.1 Let node be the element immediately - prior to node in the stack of open elements. */ - $node = $this->stack[$n]; - - /* 7.2 If node is not in the list of active - formatting elements, then remove node from - the stack of open elements and then go back - to step 1. */ - if(!in_array($node, $this->a_formatting, true)) { - unset($this->stack[$n]); - $this->stack = array_merge($this->stack); + /* 6. Let a bookmark note the position of the + formatting element in the list of active formatting + elements relative to the elements on either side + of it in the list. */ + $bookmark = $fe_af_pos; + + /* 7. Let node and last node be the furthest block. + Follow these steps: */ + $node = $furthest_block; + $last_node = $furthest_block; + + while (true) { + for ($n = array_search($node, $this->stack, true) - 1; $n >= 0; $n--) { + /* 7.1 Let node be the element immediately + prior to node in the stack of open elements. */ + $node = $this->stack[$n]; + + /* 7.2 If node is not in the list of active + formatting elements, then remove node from + the stack of open elements and then go back + to step 1. */ + if (!in_array($node, $this->a_formatting, true)) { + unset($this->stack[$n]); + $this->stack = array_merge($this->stack); + + } else { + break; + } + } - } else { + /* 7.3 Otherwise, if node is the formatting + element, then go to the next step in the overall + algorithm. */ + if ($node === $formatting_element) { break; + + /* 7.4 Otherwise, if last node is the furthest + block, then move the aforementioned bookmark to + be immediately after the node in the list of + active formatting elements. */ + } elseif ($last_node === $furthest_block) { + $bookmark = array_search($node, $this->a_formatting, true) + 1; } - } - /* 7.3 Otherwise, if node is the formatting - element, then go to the next step in the overall - algorithm. */ - if($node === $formatting_element) { - break; + /* 7.5 If node has any children, perform a + shallow clone of node, replace the entry for + node in the list of active formatting elements + with an entry for the clone, replace the entry + for node in the stack of open elements with an + entry for the clone, and let node be the clone. */ + if ($node->hasChildNodes()) { + $clone = $node->cloneNode(); + $s_pos = array_search($node, $this->stack, true); + $a_pos = array_search($node, $this->a_formatting, true); + + $this->stack[$s_pos] = $clone; + $this->a_formatting[$a_pos] = $clone; + $node = $clone; + } - /* 7.4 Otherwise, if last node is the furthest - block, then move the aforementioned bookmark to - be immediately after the node in the list of - active formatting elements. */ - } elseif($last_node === $furthest_block) { - $bookmark = array_search($node, $this->a_formatting, true) + 1; - } + /* 7.6 Insert last node into node, first removing + it from its previous parent node if any. */ + if ($last_node->parentNode !== null) { + $last_node->parentNode->removeChild($last_node); + } + + $node->appendChild($last_node); - /* 7.5 If node has any children, perform a - shallow clone of node, replace the entry for - node in the list of active formatting elements - with an entry for the clone, replace the entry - for node in the stack of open elements with an - entry for the clone, and let node be the clone. */ - if($node->hasChildNodes()) { - $clone = $node->cloneNode(); - $s_pos = array_search($node, $this->stack, true); - $a_pos = array_search($node, $this->a_formatting, true); - - $this->stack[$s_pos] = $clone; - $this->a_formatting[$a_pos] = $clone; - $node = $clone; + /* 7.7 Let last node be node. */ + $last_node = $node; } - /* 7.6 Insert last node into node, first removing - it from its previous parent node if any. */ - if($last_node->parentNode !== null) { + /* 8. Insert whatever last node ended up being in + the previous step into the common ancestor node, + first removing it from its previous parent node if + any. */ + if ($last_node->parentNode !== null) { $last_node->parentNode->removeChild($last_node); } - $node->appendChild($last_node); + $common_ancestor->appendChild($last_node); - /* 7.7 Let last node be node. */ - $last_node = $node; - } + /* 9. Perform a shallow clone of the formatting + element. */ + $clone = $formatting_element->cloneNode(); - /* 8. Insert whatever last node ended up being in - the previous step into the common ancestor node, - first removing it from its previous parent node if - any. */ - if($last_node->parentNode !== null) { - $last_node->parentNode->removeChild($last_node); - } + /* 10. Take all of the child nodes of the furthest + block and append them to the clone created in the + last step. */ + while ($furthest_block->hasChildNodes()) { + $child = $furthest_block->firstChild; + $furthest_block->removeChild($child); + $clone->appendChild($child); + } - $common_ancestor->appendChild($last_node); + /* 11. Append that clone to the furthest block. */ + $furthest_block->appendChild($clone); - /* 9. Perform a shallow clone of the formatting - element. */ - $clone = $formatting_element->cloneNode(); + /* 12. Remove the formatting element from the list + of active formatting elements, and insert the clone + into the list of active formatting elements at the + position of the aforementioned bookmark. */ + $fe_af_pos = array_search($formatting_element, $this->a_formatting, true); + unset($this->a_formatting[$fe_af_pos]); + $this->a_formatting = array_merge($this->a_formatting); - /* 10. Take all of the child nodes of the furthest - block and append them to the clone created in the - last step. */ - while($furthest_block->hasChildNodes()) { - $child = $furthest_block->firstChild; - $furthest_block->removeChild($child); - $clone->appendChild($child); + $af_part1 = array_slice($this->a_formatting, 0, $bookmark - 1); + $af_part2 = array_slice($this->a_formatting, $bookmark, count($this->a_formatting)); + $this->a_formatting = array_merge($af_part1, array($clone), $af_part2); + + /* 13. Remove the formatting element from the stack + of open elements, and insert the clone into the stack + of open elements immediately after (i.e. in a more + deeply nested position than) the position of the + furthest block in that stack. */ + $fe_s_pos = array_search($formatting_element, $this->stack, true); + $fb_s_pos = array_search($furthest_block, $this->stack, true); + unset($this->stack[$fe_s_pos]); + + $s_part1 = array_slice($this->stack, 0, $fb_s_pos); + $s_part2 = array_slice($this->stack, $fb_s_pos + 1, count($this->stack)); + $this->stack = array_merge($s_part1, array($clone), $s_part2); + + /* 14. Jump back to step 1 in this series of steps. */ + unset($formatting_element, $fe_af_pos, $fe_s_pos, $furthest_block); } + break; - /* 11. Append that clone to the furthest block. */ - $furthest_block->appendChild($clone); - - /* 12. Remove the formatting element from the list - of active formatting elements, and insert the clone - into the list of active formatting elements at the - position of the aforementioned bookmark. */ - $fe_af_pos = array_search($formatting_element, $this->a_formatting, true); - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - - $af_part1 = array_slice($this->a_formatting, 0, $bookmark - 1); - $af_part2 = array_slice($this->a_formatting, $bookmark, count($this->a_formatting)); - $this->a_formatting = array_merge($af_part1, array($clone), $af_part2); - - /* 13. Remove the formatting element from the stack - of open elements, and insert the clone into the stack - of open elements immediately after (i.e. in a more - deeply nested position than) the position of the - furthest block in that stack. */ - $fe_s_pos = array_search($formatting_element, $this->stack, true); - $fb_s_pos = array_search($furthest_block, $this->stack, true); - unset($this->stack[$fe_s_pos]); - - $s_part1 = array_slice($this->stack, 0, $fb_s_pos); - $s_part2 = array_slice($this->stack, $fb_s_pos + 1, count($this->stack)); - $this->stack = array_merge($s_part1, array($clone), $s_part2); - - /* 14. Jump back to step 1 in this series of steps. */ - unset($formatting_element, $fe_af_pos, $fe_s_pos, $furthest_block); - } - break; + /* An end tag token whose tag name is one of: "button", + "marquee", "object" */ + case 'button': + case 'marquee': + case 'object': + /* If the stack of open elements has an element in scope whose + tag name matches the tag name of the token, then generate implied + tags. */ + if ($this->elementInScope($token['name'])) { + $this->generateImpliedEndTags(); - /* An end tag token whose tag name is one of: "button", - "marquee", "object" */ - case 'button': case 'marquee': case 'object': - /* If the stack of open elements has an element in scope whose - tag name matches the tag name of the token, then generate implied - tags. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with the same - tag name as the token, then this is a parse error. */ - // k - - /* Now, if the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then pop - elements from the stack until that element has been popped from - the stack, and clear the list of active formatting elements up - to the last marker. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } + /* Now, if the current node is not an element with the same + tag name as the token, then this is a parse error. */ + // k - array_pop($this->stack); - } + /* Now, if the stack of open elements has an element in scope + whose tag name matches the tag name of the token, then pop + elements from the stack until that element has been popped from + the stack, and clear the list of active formatting elements up + to the last marker. */ + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + if ($this->stack[$n]->nodeName === $token['name']) { + $n = -1; + } - $marker = end(array_keys($this->a_formatting, self::MARKER, true)); + array_pop($this->stack); + } - for($n = count($this->a_formatting) - 1; $n > $marker; $n--) { - array_pop($this->a_formatting); - } - } - break; + $marker = end(array_keys($this->a_formatting, self::MARKER, true)); - /* Or an end tag whose tag name is one of: "area", "basefont", - "bgsound", "br", "embed", "hr", "iframe", "image", "img", - "input", "isindex", "noembed", "noframes", "param", "select", - "spacer", "table", "textarea", "wbr" */ - case 'area': case 'basefont': case 'bgsound': case 'br': - case 'embed': case 'hr': case 'iframe': case 'image': - case 'img': case 'input': case 'isindex': case 'noembed': - case 'noframes': case 'param': case 'select': case 'spacer': - case 'table': case 'textarea': case 'wbr': - // Parse error. Ignore the token. - break; + for ($n = count($this->a_formatting) - 1; $n > $marker; $n--) { + array_pop($this->a_formatting); + } + } + break; - /* An end tag token not covered by the previous entries */ - default: - for($n = count($this->stack) - 1; $n >= 0; $n--) { - /* Initialise node to be the current node (the bottommost - node of the stack). */ - $node = end($this->stack); - - /* If node has the same tag name as the end tag token, - then: */ - if($token['name'] === $node->nodeName) { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); + /* Or an end tag whose tag name is one of: "area", "basefont", + "bgsound", "br", "embed", "hr", "iframe", "image", "img", + "input", "isindex", "noembed", "noframes", "param", "select", + "spacer", "table", "textarea", "wbr" */ + case 'area': + case 'basefont': + case 'bgsound': + case 'br': + case 'embed': + case 'hr': + case 'iframe': + case 'image': + case 'img': + case 'input': + case 'isindex': + case 'noembed': + case 'noframes': + case 'param': + case 'select': + case 'spacer': + case 'table': + case 'textarea': + case 'wbr': + // Parse error. Ignore the token. + break; - /* If the tag name of the end tag token does not - match the tag name of the current node, this is a - parse error. */ - // k + /* An end tag token not covered by the previous entries */ + default: + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + /* Initialise node to be the current node (the bottommost + node of the stack). */ + $node = end($this->stack); + + /* If node has the same tag name as the end tag token, + then: */ + if ($token['name'] === $node->nodeName) { + /* Generate implied end tags. */ + $this->generateImpliedEndTags(); + + /* If the tag name of the end tag token does not + match the tag name of the current node, this is a + parse error. */ + // k + + /* Pop all the nodes from the current node up to + node, including node, then stop this algorithm. */ + for ($x = count($this->stack) - $n; $x >= $n; $x--) { + array_pop($this->stack); + } - /* Pop all the nodes from the current node up to - node, including node, then stop this algorithm. */ - for($x = count($this->stack) - $n; $x >= $n; $x--) { - array_pop($this->stack); - } - - } else { - $category = $this->getElementCategory($node); - - if($category !== self::SPECIAL && $category !== self::SCOPING) { - /* Otherwise, if node is in neither the formatting - category nor the phrasing category, then this is a - parse error. Stop this algorithm. The end tag token - is ignored. */ - return false; + } else { + $category = $this->getElementCategory($node); + + if ($category !== self::SPECIAL && $category !== self::SCOPING) { + /* Otherwise, if node is in neither the formatting + category nor the phrasing category, then this is a + parse error. Stop this algorithm. The end tag token + is ignored. */ + return false; + } } } - } + break; + } break; - } - break; } } - private function inTable($token) { + private function inTable($token) + { $clear = array('html', 'table'); /* A character token that is one of one of U+0009 CHARACTER TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { /* Append the character to the current node. */ $text = $this->dom->createTextNode($token['data']); end($this->stack)->appendChild($text); - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { /* Append a Comment node to the current node with the data attribute set to the data given in the comment token. */ $comment = $this->dom->createComment($token['data']); end($this->stack)->appendChild($comment); - /* A start tag whose tag name is "caption" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'caption') { + /* A start tag whose tag name is "caption" */ + } elseif ($token['type'] === HTML5::STARTTAG && + $token['name'] === 'caption' + ) { /* Clear the stack back to a table context. */ $this->clearStackToTableContext($clear); @@ -2661,9 +3350,10 @@ class HTML5TreeConstructer { $this->insertElement($token); $this->mode = self::IN_CAPTION; - /* A start tag whose tag name is "colgroup" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'colgroup') { + /* A start tag whose tag name is "colgroup" */ + } elseif ($token['type'] === HTML5::STARTTAG && + $token['name'] === 'colgroup' + ) { /* Clear the stack back to a table context. */ $this->clearStackToTableContext($clear); @@ -2672,20 +3362,26 @@ class HTML5TreeConstructer { $this->insertElement($token); $this->mode = self::IN_CGROUP; - /* A start tag whose tag name is "col" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'col') { - $this->inTable(array( - 'name' => 'colgroup', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); + /* A start tag whose tag name is "col" */ + } elseif ($token['type'] === HTML5::STARTTAG && + $token['name'] === 'col' + ) { + $this->inTable( + array( + 'name' => 'colgroup', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); $this->inColumnGroup($token); - /* A start tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('tbody', 'tfoot', 'thead'))) { + /* A start tag whose tag name is one of: "tbody", "tfoot", "thead" */ + } elseif ($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array('tbody', 'tfoot', 'thead') + ) + ) { /* Clear the stack back to a table context. */ $this->clearStackToTableContext($clear); @@ -2694,42 +3390,49 @@ class HTML5TreeConstructer { $this->insertElement($token); $this->mode = self::IN_TBODY; - /* A start tag whose tag name is one of: "td", "th", "tr" */ - } elseif($token['type'] === HTML5::STARTTAG && - in_array($token['name'], array('td', 'th', 'tr'))) { + /* A start tag whose tag name is one of: "td", "th", "tr" */ + } elseif ($token['type'] === HTML5::STARTTAG && + in_array($token['name'], array('td', 'th', 'tr')) + ) { /* Act as if a start tag token with the tag name "tbody" had been seen, then reprocess the current token. */ - $this->inTable(array( - 'name' => 'tbody', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); + $this->inTable( + array( + 'name' => 'tbody', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); return $this->inTableBody($token); - /* A start tag whose tag name is "table" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'table') { + /* A start tag whose tag name is "table" */ + } elseif ($token['type'] === HTML5::STARTTAG && + $token['name'] === 'table' + ) { /* Parse error. Act as if an end tag token with the tag name "table" had been seen, then, if that token wasn't ignored, reprocess the current token. */ - $this->inTable(array( - 'name' => 'table', - 'type' => HTML5::ENDTAG - )); + $this->inTable( + array( + 'name' => 'table', + 'type' => HTML5::ENDTAG + ) + ); return $this->mainPhase($token); - /* An end tag whose tag name is "table" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'table') { + /* An end tag whose tag name is "table" */ + } elseif ($token['type'] === HTML5::ENDTAG && + $token['name'] === 'table' + ) { /* If the stack of open elements does not have an element in table scope with the same tag name as the token, this is a parse error. Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { + if (!$this->elementInScope($token['name'], true)) { return false; - /* Otherwise: */ + /* Otherwise: */ } else { /* Generate implied end tags. */ $this->generateImpliedEndTags(); @@ -2740,11 +3443,11 @@ class HTML5TreeConstructer { /* Pop elements from this stack until a table element has been popped from the stack. */ - while(true) { + while (true) { $current = end($this->stack)->nodeName; array_pop($this->stack); - if($current === 'table') { + if ($current === 'table') { break; } } @@ -2753,14 +3456,28 @@ class HTML5TreeConstructer { $this->resetInsertionMode(); } - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html', 'tbody', 'td', - 'tfoot', 'th', 'thead', 'tr'))) { + /* An end tag whose tag name is one of: "body", "caption", "col", + "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ + } elseif ($token['type'] === HTML5::ENDTAG && in_array( + $token['name'], + array( + 'body', + 'caption', + 'col', + 'colgroup', + 'html', + 'tbody', + 'td', + 'tfoot', + 'th', + 'thead', + 'tr' + ) + ) + ) { // Parse error. Ignore the token. - /* Anything else */ + /* Anything else */ } else { /* Parse error. Process the token as if the insertion mode was "in body", with the following exception: */ @@ -2768,8 +3485,11 @@ class HTML5TreeConstructer { /* If the current node is a table, tbody, tfoot, thead, or tr element, then, whenever a node would be inserted into the current node, it must instead be inserted into the foster parent element. */ - if(in_array(end($this->stack)->nodeName, - array('table', 'tbody', 'tfoot', 'thead', 'tr'))) { + if (in_array( + end($this->stack)->nodeName, + array('table', 'tbody', 'tfoot', 'thead', 'tr') + ) + ) { /* The foster parent element is the parent element of the last table element in the stack of open elements, if there is a table element and it has such a parent element. If there is no @@ -2781,21 +3501,22 @@ class HTML5TreeConstructer { its parent node is not an element, then the foster parent element is the element before the last table element in the stack of open elements. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === 'table') { + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + if ($this->stack[$n]->nodeName === 'table') { $table = $this->stack[$n]; break; } } - if(isset($table) && $table->parentNode !== null) { + if (isset($table) && $table->parentNode !== null) { $this->foster_parent = $table->parentNode; - } elseif(!isset($table)) { + } elseif (!isset($table)) { $this->foster_parent = $this->stack[0]; - } elseif(isset($table) && ($table->parentNode === null || - $table->parentNode->nodeType !== XML_ELEMENT_NODE)) { + } elseif (isset($table) && ($table->parentNode === null || + $table->parentNode->nodeType !== XML_ELEMENT_NODE) + ) { $this->foster_parent = $this->stack[$n - 1]; } } @@ -2804,16 +3525,17 @@ class HTML5TreeConstructer { } } - private function inCaption($token) { + private function inCaption($token) + { /* An end tag whose tag name is "caption" */ - if($token['type'] === HTML5::ENDTAG && $token['name'] === 'caption') { + if ($token['type'] === HTML5::ENDTAG && $token['name'] === 'caption') { /* If the stack of open elements does not have an element in table scope with the same tag name as the token, this is a parse error. Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { + if (!$this->elementInScope($token['name'], true)) { // Ignore - /* Otherwise: */ + /* Otherwise: */ } else { /* Generate implied end tags. */ $this->generateImpliedEndTags(); @@ -2824,11 +3546,11 @@ class HTML5TreeConstructer { /* Pop elements from this stack until a caption element has been popped from the stack. */ - while(true) { + while (true) { $node = end($this->stack)->nodeName; array_pop($this->stack); - if($node === 'caption') { + if ($node === 'caption') { break; } } @@ -2841,99 +3563,131 @@ class HTML5TreeConstructer { $this->mode = self::IN_TABLE; } - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr", or an end tag whose tag - name is "table" */ - } elseif(($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'td', 'tfoot', 'th', - 'thead', 'tr'))) || ($token['type'] === HTML5::ENDTAG && - $token['name'] === 'table')) { + /* A start tag whose tag name is one of: "caption", "col", "colgroup", + "tbody", "td", "tfoot", "th", "thead", "tr", or an end tag whose tag + name is "table" */ + } elseif (($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array( + 'caption', + 'col', + 'colgroup', + 'tbody', + 'td', + 'tfoot', + 'th', + 'thead', + 'tr' + ) + )) || ($token['type'] === HTML5::ENDTAG && + $token['name'] === 'table') + ) { /* Parse error. Act as if an end tag with the tag name "caption" had been seen, then, if that token wasn't ignored, reprocess the current token. */ - $this->inCaption(array( - 'name' => 'caption', - 'type' => HTML5::ENDTAG - )); + $this->inCaption( + array( + 'name' => 'caption', + 'type' => HTML5::ENDTAG + ) + ); return $this->inTable($token); - /* An end tag whose tag name is one of: "body", "col", "colgroup", - "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'col', 'colgroup', 'html', 'tbody', 'tfoot', 'th', - 'thead', 'tr'))) { + /* An end tag whose tag name is one of: "body", "col", "colgroup", + "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ + } elseif ($token['type'] === HTML5::ENDTAG && in_array( + $token['name'], + array( + 'body', + 'col', + 'colgroup', + 'html', + 'tbody', + 'tfoot', + 'th', + 'thead', + 'tr' + ) + ) + ) { // Parse error. Ignore the token. - /* Anything else */ + /* Anything else */ } else { /* Process the token as if the insertion mode was "in body". */ $this->inBody($token); } } - private function inColumnGroup($token) { + private function inColumnGroup($token) + { /* A character token that is one of one of U+0009 CHARACTER TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { /* Append the character to the current node. */ $text = $this->dom->createTextNode($token['data']); end($this->stack)->appendChild($text); - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { /* Append a Comment node to the current node with the data attribute set to the data given in the comment token. */ $comment = $this->dom->createComment($token['data']); end($this->stack)->appendChild($comment); - /* A start tag whose tag name is "col" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'col') { + /* A start tag whose tag name is "col" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'col') { /* Insert a col element for the token. Immediately pop the current node off the stack of open elements. */ $this->insertElement($token); array_pop($this->stack); - /* An end tag whose tag name is "colgroup" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'colgroup') { + /* An end tag whose tag name is "colgroup" */ + } elseif ($token['type'] === HTML5::ENDTAG && + $token['name'] === 'colgroup' + ) { /* If the current node is the root html element, then this is a parse error, ignore the token. (innerHTML case) */ - if(end($this->stack)->nodeName === 'html') { + if (end($this->stack)->nodeName === 'html') { // Ignore - /* Otherwise, pop the current node (which will be a colgroup - element) from the stack of open elements. Switch the insertion - mode to "in table". */ + /* Otherwise, pop the current node (which will be a colgroup + element) from the stack of open elements. Switch the insertion + mode to "in table". */ } else { array_pop($this->stack); $this->mode = self::IN_TABLE; } - /* An end tag whose tag name is "col" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'col') { + /* An end tag whose tag name is "col" */ + } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'col') { /* Parse error. Ignore the token. */ - /* Anything else */ + /* Anything else */ } else { /* Act as if an end tag with the tag name "colgroup" had been seen, and then, if that token wasn't ignored, reprocess the current token. */ - $this->inColumnGroup(array( - 'name' => 'colgroup', - 'type' => HTML5::ENDTAG - )); + $this->inColumnGroup( + array( + 'name' => 'colgroup', + 'type' => HTML5::ENDTAG + ) + ); return $this->inTable($token); } } - private function inTableBody($token) { + private function inTableBody($token) + { $clear = array('tbody', 'tfoot', 'thead', 'html'); /* A start tag whose tag name is "tr" */ - if($token['type'] === HTML5::STARTTAG && $token['name'] === 'tr') { + if ($token['type'] === HTML5::STARTTAG && $token['name'] === 'tr') { /* Clear the stack back to a table body context. */ $this->clearStackToTableContext($clear); @@ -2942,29 +3696,33 @@ class HTML5TreeConstructer { $this->insertElement($token); $this->mode = self::IN_ROW; - /* A start tag whose tag name is one of: "th", "td" */ - } elseif($token['type'] === HTML5::STARTTAG && - ($token['name'] === 'th' || $token['name'] === 'td')) { + /* A start tag whose tag name is one of: "th", "td" */ + } elseif ($token['type'] === HTML5::STARTTAG && + ($token['name'] === 'th' || $token['name'] === 'td') + ) { /* Parse error. Act as if a start tag with the tag name "tr" had been seen, then reprocess the current token. */ - $this->inTableBody(array( - 'name' => 'tr', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); + $this->inTableBody( + array( + 'name' => 'tr', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); return $this->inRow($token); - /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('tbody', 'tfoot', 'thead'))) { + /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ + } elseif ($token['type'] === HTML5::ENDTAG && + in_array($token['name'], array('tbody', 'tfoot', 'thead')) + ) { /* If the stack of open elements does not have an element in table scope with the same tag name as the token, this is a parse error. Ignore the token. */ - if(!$this->elementInScope($token['name'], true)) { + if (!$this->elementInScope($token['name'], true)) { // Ignore - /* Otherwise: */ + /* Otherwise: */ } else { /* Clear the stack back to a table body context. */ $this->clearStackToTableContext($clear); @@ -2975,18 +3733,21 @@ class HTML5TreeConstructer { $this->mode = self::IN_TABLE; } - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "tfoot", "thead", or an end tag whose tag name is "table" */ - } elseif(($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'tfoor', 'thead'))) || - ($token['type'] === HTML5::STARTTAG && $token['name'] === 'table')) { + /* A start tag whose tag name is one of: "caption", "col", "colgroup", + "tbody", "tfoot", "thead", or an end tag whose tag name is "table" */ + } elseif (($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array('caption', 'col', 'colgroup', 'tbody', 'tfoor', 'thead') + )) || + ($token['type'] === HTML5::STARTTAG && $token['name'] === 'table') + ) { /* If the stack of open elements does not have a tbody, thead, or tfoot element in table scope, this is a parse error. Ignore the token. (innerHTML case) */ - if(!$this->elementInScope(array('tbody', 'thead', 'tfoot'), true)) { + if (!$this->elementInScope(array('tbody', 'thead', 'tfoot'), true)) { // Ignore. - /* Otherwise: */ + /* Otherwise: */ } else { /* Clear the stack back to a table body context. */ $this->clearStackToTableContext($clear); @@ -2994,33 +3755,40 @@ class HTML5TreeConstructer { /* Act as if an end tag with the same tag name as the current node ("tbody", "tfoot", or "thead") had been seen, then reprocess the current token. */ - $this->inTableBody(array( - 'name' => end($this->stack)->nodeName, - 'type' => HTML5::ENDTAG - )); + $this->inTableBody( + array( + 'name' => end($this->stack)->nodeName, + 'type' => HTML5::ENDTAG + ) + ); return $this->mainPhase($token); } - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "td", "th", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr'))) { + /* An end tag whose tag name is one of: "body", "caption", "col", + "colgroup", "html", "td", "th", "tr" */ + } elseif ($token['type'] === HTML5::ENDTAG && in_array( + $token['name'], + array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr') + ) + ) { /* Parse error. Ignore the token. */ - /* Anything else */ + /* Anything else */ } else { /* Process the token as if the insertion mode was "in table". */ $this->inTable($token); } } - private function inRow($token) { + private function inRow($token) + { $clear = array('tr', 'html'); /* A start tag whose tag name is one of: "th", "td" */ - if($token['type'] === HTML5::STARTTAG && - ($token['name'] === 'th' || $token['name'] === 'td')) { + if ($token['type'] === HTML5::STARTTAG && + ($token['name'] === 'th' || $token['name'] === 'td') + ) { /* Clear the stack back to a table row context. */ $this->clearStackToTableContext($clear); @@ -3033,15 +3801,15 @@ class HTML5TreeConstructer { elements. */ $this->a_formatting[] = self::MARKER; - /* An end tag whose tag name is "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'tr') { + /* An end tag whose tag name is "tr" */ + } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'tr') { /* If the stack of open elements does not have an element in table scope with the same tag name as the token, this is a parse error. Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { + if (!$this->elementInScope($token['name'], true)) { // Ignore. - /* Otherwise: */ + /* Otherwise: */ } else { /* Clear the stack back to a table row context. */ $this->clearStackToTableContext($clear); @@ -3053,64 +3821,77 @@ class HTML5TreeConstructer { $this->mode = self::IN_TBODY; } - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "tfoot", "thead", "tr" or an end tag whose tag name is "table" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'tfoot', 'thead', 'tr'))) { + /* A start tag whose tag name is one of: "caption", "col", "colgroup", + "tbody", "tfoot", "thead", "tr" or an end tag whose tag name is "table" */ + } elseif ($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array('caption', 'col', 'colgroup', 'tbody', 'tfoot', 'thead', 'tr') + ) + ) { /* Act as if an end tag with the tag name "tr" had been seen, then, if that token wasn't ignored, reprocess the current token. */ - $this->inRow(array( - 'name' => 'tr', - 'type' => HTML5::ENDTAG - )); + $this->inRow( + array( + 'name' => 'tr', + 'type' => HTML5::ENDTAG + ) + ); return $this->inCell($token); - /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('tbody', 'tfoot', 'thead'))) { + /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ + } elseif ($token['type'] === HTML5::ENDTAG && + in_array($token['name'], array('tbody', 'tfoot', 'thead')) + ) { /* If the stack of open elements does not have an element in table scope with the same tag name as the token, this is a parse error. Ignore the token. */ - if(!$this->elementInScope($token['name'], true)) { + if (!$this->elementInScope($token['name'], true)) { // Ignore. - /* Otherwise: */ + /* Otherwise: */ } else { /* Otherwise, act as if an end tag with the tag name "tr" had been seen, then reprocess the current token. */ - $this->inRow(array( - 'name' => 'tr', - 'type' => HTML5::ENDTAG - )); + $this->inRow( + array( + 'name' => 'tr', + 'type' => HTML5::ENDTAG + ) + ); return $this->inCell($token); } - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "td", "th" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr'))) { + /* An end tag whose tag name is one of: "body", "caption", "col", + "colgroup", "html", "td", "th" */ + } elseif ($token['type'] === HTML5::ENDTAG && in_array( + $token['name'], + array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr') + ) + ) { /* Parse error. Ignore the token. */ - /* Anything else */ + /* Anything else */ } else { /* Process the token as if the insertion mode was "in table". */ $this->inTable($token); } } - private function inCell($token) { + private function inCell($token) + { /* An end tag whose tag name is one of: "td", "th" */ - if($token['type'] === HTML5::ENDTAG && - ($token['name'] === 'td' || $token['name'] === 'th')) { + if ($token['type'] === HTML5::ENDTAG && + ($token['name'] === 'td' || $token['name'] === 'th') + ) { /* If the stack of open elements does not have an element in table scope with the same tag name as that of the token, then this is a parse error and the token must be ignored. */ - if(!$this->elementInScope($token['name'], true)) { + if (!$this->elementInScope($token['name'], true)) { // Ignore. - /* Otherwise: */ + /* Otherwise: */ } else { /* Generate implied end tags, except for elements with the same tag name as the token. */ @@ -3122,11 +3903,11 @@ class HTML5TreeConstructer { /* Pop elements from this stack until an element with the same tag name as the token has been popped from the stack. */ - while(true) { + while (true) { $node = end($this->stack)->nodeName; array_pop($this->stack); - if($node === $token['name']) { + if ($node === $token['name']) { break; } } @@ -3140,178 +3921,223 @@ class HTML5TreeConstructer { $this->mode = self::IN_ROW; } - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'td', 'tfoot', 'th', - 'thead', 'tr'))) { + /* A start tag whose tag name is one of: "caption", "col", "colgroup", + "tbody", "td", "tfoot", "th", "thead", "tr" */ + } elseif ($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array( + 'caption', + 'col', + 'colgroup', + 'tbody', + 'td', + 'tfoot', + 'th', + 'thead', + 'tr' + ) + ) + ) { /* If the stack of open elements does not have a td or th element in table scope, then this is a parse error; ignore the token. (innerHTML case) */ - if(!$this->elementInScope(array('td', 'th'), true)) { + if (!$this->elementInScope(array('td', 'th'), true)) { // Ignore. - /* Otherwise, close the cell (see below) and reprocess the current - token. */ + /* Otherwise, close the cell (see below) and reprocess the current + token. */ } else { $this->closeCell(); return $this->inRow($token); } - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'td', 'tfoot', 'th', - 'thead', 'tr'))) { + /* A start tag whose tag name is one of: "caption", "col", "colgroup", + "tbody", "td", "tfoot", "th", "thead", "tr" */ + } elseif ($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array( + 'caption', + 'col', + 'colgroup', + 'tbody', + 'td', + 'tfoot', + 'th', + 'thead', + 'tr' + ) + ) + ) { /* If the stack of open elements does not have a td or th element in table scope, then this is a parse error; ignore the token. (innerHTML case) */ - if(!$this->elementInScope(array('td', 'th'), true)) { + if (!$this->elementInScope(array('td', 'th'), true)) { // Ignore. - /* Otherwise, close the cell (see below) and reprocess the current - token. */ + /* Otherwise, close the cell (see below) and reprocess the current + token. */ } else { $this->closeCell(); return $this->inRow($token); } - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html'))) { + /* An end tag whose tag name is one of: "body", "caption", "col", + "colgroup", "html" */ + } elseif ($token['type'] === HTML5::ENDTAG && in_array( + $token['name'], + array('body', 'caption', 'col', 'colgroup', 'html') + ) + ) { /* Parse error. Ignore the token. */ - /* An end tag whose tag name is one of: "table", "tbody", "tfoot", - "thead", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('table', 'tbody', 'tfoot', 'thead', 'tr'))) { + /* An end tag whose tag name is one of: "table", "tbody", "tfoot", + "thead", "tr" */ + } elseif ($token['type'] === HTML5::ENDTAG && in_array( + $token['name'], + array('table', 'tbody', 'tfoot', 'thead', 'tr') + ) + ) { /* If the stack of open elements does not have an element in table scope with the same tag name as that of the token (which can only happen for "tbody", "tfoot" and "thead", or, in the innerHTML case), then this is a parse error and the token must be ignored. */ - if(!$this->elementInScope($token['name'], true)) { + if (!$this->elementInScope($token['name'], true)) { // Ignore. - /* Otherwise, close the cell (see below) and reprocess the current - token. */ + /* Otherwise, close the cell (see below) and reprocess the current + token. */ } else { $this->closeCell(); return $this->inRow($token); } - /* Anything else */ + /* Anything else */ } else { /* Process the token as if the insertion mode was "in body". */ $this->inBody($token); } } - private function inSelect($token) { + private function inSelect($token) + { /* Handle the token as follows: */ /* A character token */ - if($token['type'] === HTML5::CHARACTR) { + if ($token['type'] === HTML5::CHARACTR) { /* Append the token's character to the current node. */ $this->insertText($token['data']); - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { /* Append a Comment node to the current node with the data attribute set to the data given in the comment token. */ $this->insertComment($token['data']); - /* A start tag token whose tag name is "option" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'option') { + /* A start tag token whose tag name is "option" */ + } elseif ($token['type'] === HTML5::STARTTAG && + $token['name'] === 'option' + ) { /* If the current node is an option element, act as if an end tag with the tag name "option" had been seen. */ - if(end($this->stack)->nodeName === 'option') { - $this->inSelect(array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - )); + if (end($this->stack)->nodeName === 'option') { + $this->inSelect( + array( + 'name' => 'option', + 'type' => HTML5::ENDTAG + ) + ); } /* Insert an HTML element for the token. */ $this->insertElement($token); - /* A start tag token whose tag name is "optgroup" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'optgroup') { + /* A start tag token whose tag name is "optgroup" */ + } elseif ($token['type'] === HTML5::STARTTAG && + $token['name'] === 'optgroup' + ) { /* If the current node is an option element, act as if an end tag with the tag name "option" had been seen. */ - if(end($this->stack)->nodeName === 'option') { - $this->inSelect(array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - )); + if (end($this->stack)->nodeName === 'option') { + $this->inSelect( + array( + 'name' => 'option', + 'type' => HTML5::ENDTAG + ) + ); } /* If the current node is an optgroup element, act as if an end tag with the tag name "optgroup" had been seen. */ - if(end($this->stack)->nodeName === 'optgroup') { - $this->inSelect(array( - 'name' => 'optgroup', - 'type' => HTML5::ENDTAG - )); + if (end($this->stack)->nodeName === 'optgroup') { + $this->inSelect( + array( + 'name' => 'optgroup', + 'type' => HTML5::ENDTAG + ) + ); } /* Insert an HTML element for the token. */ $this->insertElement($token); - /* An end tag token whose tag name is "optgroup" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'optgroup') { + /* An end tag token whose tag name is "optgroup" */ + } elseif ($token['type'] === HTML5::ENDTAG && + $token['name'] === 'optgroup' + ) { /* First, if the current node is an option element, and the node immediately before it in the stack of open elements is an optgroup element, then act as if an end tag with the tag name "option" had been seen. */ $elements_in_stack = count($this->stack); - if($this->stack[$elements_in_stack - 1]->nodeName === 'option' && - $this->stack[$elements_in_stack - 2]->nodeName === 'optgroup') { - $this->inSelect(array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - )); + if ($this->stack[$elements_in_stack - 1]->nodeName === 'option' && + $this->stack[$elements_in_stack - 2]->nodeName === 'optgroup' + ) { + $this->inSelect( + array( + 'name' => 'option', + 'type' => HTML5::ENDTAG + ) + ); } /* If the current node is an optgroup element, then pop that node from the stack of open elements. Otherwise, this is a parse error, ignore the token. */ - if($this->stack[$elements_in_stack - 1] === 'optgroup') { + if ($this->stack[$elements_in_stack - 1] === 'optgroup') { array_pop($this->stack); } - /* An end tag token whose tag name is "option" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'option') { + /* An end tag token whose tag name is "option" */ + } elseif ($token['type'] === HTML5::ENDTAG && + $token['name'] === 'option' + ) { /* If the current node is an option element, then pop that node from the stack of open elements. Otherwise, this is a parse error, ignore the token. */ - if(end($this->stack)->nodeName === 'option') { + if (end($this->stack)->nodeName === 'option') { array_pop($this->stack); } - /* An end tag whose tag name is "select" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'select') { + /* An end tag whose tag name is "select" */ + } elseif ($token['type'] === HTML5::ENDTAG && + $token['name'] === 'select' + ) { /* If the stack of open elements does not have an element in table scope with the same tag name as the token, this is a parse error. Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { + if (!$this->elementInScope($token['name'], true)) { // w/e - /* Otherwise: */ + /* Otherwise: */ } else { /* Pop elements from the stack of open elements until a select element has been popped from the stack. */ - while(true) { + while (true) { $current = end($this->stack)->nodeName; array_pop($this->stack); - if($current === 'select') { + if ($current === 'select') { break; } } @@ -3320,20 +4146,35 @@ class HTML5TreeConstructer { $this->resetInsertionMode(); } - /* A start tag whose tag name is "select" */ - } elseif($token['name'] === 'select' && - $token['type'] === HTML5::STARTTAG) { + /* A start tag whose tag name is "select" */ + } elseif ($token['name'] === 'select' && + $token['type'] === HTML5::STARTTAG + ) { /* Parse error. Act as if the token had been an end tag with the tag name "select" instead. */ - $this->inSelect(array( - 'name' => 'select', - 'type' => HTML5::ENDTAG - )); - - /* An end tag whose tag name is one of: "caption", "table", "tbody", - "tfoot", "thead", "tr", "td", "th" */ - } elseif(in_array($token['name'], array('caption', 'table', 'tbody', - 'tfoot', 'thead', 'tr', 'td', 'th')) && $token['type'] === HTML5::ENDTAG) { + $this->inSelect( + array( + 'name' => 'select', + 'type' => HTML5::ENDTAG + ) + ); + + /* An end tag whose tag name is one of: "caption", "table", "tbody", + "tfoot", "thead", "tr", "td", "th" */ + } elseif (in_array( + $token['name'], + array( + 'caption', + 'table', + 'tbody', + 'tfoot', + 'thead', + 'tr', + 'td', + 'th' + ) + ) && $token['type'] === HTML5::ENDTAG + ) { /* Parse error. */ // w/e @@ -3341,43 +4182,47 @@ class HTML5TreeConstructer { the same tag name as that of the token, then act as if an end tag with the tag name "select" had been seen, and reprocess the token. Otherwise, ignore the token. */ - if($this->elementInScope($token['name'], true)) { - $this->inSelect(array( - 'name' => 'select', - 'type' => HTML5::ENDTAG - )); + if ($this->elementInScope($token['name'], true)) { + $this->inSelect( + array( + 'name' => 'select', + 'type' => HTML5::ENDTAG + ) + ); $this->mainPhase($token); } - /* Anything else */ + /* Anything else */ } else { /* Parse error. Ignore the token. */ } } - private function afterBody($token) { + private function afterBody($token) + { /* Handle the token as follows: */ /* A character token that is one of one of U+0009 CHARACTER TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { /* Process the token as it would be processed if the insertion mode was "in body". */ $this->inBody($token); - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { /* Append a Comment node to the first element in the stack of open elements (the html element), with the data attribute set to the data given in the comment token. */ $comment = $this->dom->createComment($token['data']); $this->stack[0]->appendChild($comment); - /* An end tag with the tag name "html" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') { + /* An end tag with the tag name "html" */ + } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') { /* If the parser was originally created in order to handle the setting of an element's innerHTML attribute, this is a parse error; ignore the token. (The element will be an html element in this @@ -3386,7 +4231,7 @@ class HTML5TreeConstructer { /* Otherwise, switch to the trailing end phase. */ $this->phase = self::END_PHASE; - /* Anything else */ + /* Anything else */ } else { /* Parse error. Set the insertion mode to "in body" and reprocess the token. */ @@ -3395,34 +4240,38 @@ class HTML5TreeConstructer { } } - private function inFrameset($token) { + private function inFrameset($token) + { /* Handle the token as follows: */ /* A character token that is one of one of U+0009 CHARACTER TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { /* Append the character to the current node. */ $this->insertText($token['data']); - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { /* Append a Comment node to the current node with the data attribute set to the data given in the comment token. */ $this->insertComment($token['data']); - /* A start tag with the tag name "frameset" */ - } elseif($token['name'] === 'frameset' && - $token['type'] === HTML5::STARTTAG) { + /* A start tag with the tag name "frameset" */ + } elseif ($token['name'] === 'frameset' && + $token['type'] === HTML5::STARTTAG + ) { $this->insertElement($token); - /* An end tag with the tag name "frameset" */ - } elseif($token['name'] === 'frameset' && - $token['type'] === HTML5::ENDTAG) { + /* An end tag with the tag name "frameset" */ + } elseif ($token['name'] === 'frameset' && + $token['type'] === HTML5::ENDTAG + ) { /* If the current node is the root html element, then this is a parse error; ignore the token. (innerHTML case) */ - if(end($this->stack)->nodeName === 'html') { + if (end($this->stack)->nodeName === 'html') { // Ignore } else { @@ -3437,103 +4286,113 @@ class HTML5TreeConstructer { $this->mode = self::AFTR_FRAME; } - /* A start tag with the tag name "frame" */ - } elseif($token['name'] === 'frame' && - $token['type'] === HTML5::STARTTAG) { + /* A start tag with the tag name "frame" */ + } elseif ($token['name'] === 'frame' && + $token['type'] === HTML5::STARTTAG + ) { /* Insert an HTML element for the token. */ $this->insertElement($token); /* Immediately pop the current node off the stack of open elements. */ array_pop($this->stack); - /* A start tag with the tag name "noframes" */ - } elseif($token['name'] === 'noframes' && - $token['type'] === HTML5::STARTTAG) { + /* A start tag with the tag name "noframes" */ + } elseif ($token['name'] === 'noframes' && + $token['type'] === HTML5::STARTTAG + ) { /* Process the token as if the insertion mode had been "in body". */ $this->inBody($token); - /* Anything else */ + /* Anything else */ } else { /* Parse error. Ignore the token. */ } } - private function afterFrameset($token) { + private function afterFrameset($token) + { /* Handle the token as follows: */ /* A character token that is one of one of U+0009 CHARACTER TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { /* Append the character to the current node. */ $this->insertText($token['data']); - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { /* Append a Comment node to the current node with the data attribute set to the data given in the comment token. */ $this->insertComment($token['data']); - /* An end tag with the tag name "html" */ - } elseif($token['name'] === 'html' && - $token['type'] === HTML5::ENDTAG) { + /* An end tag with the tag name "html" */ + } elseif ($token['name'] === 'html' && + $token['type'] === HTML5::ENDTAG + ) { /* Switch to the trailing end phase. */ $this->phase = self::END_PHASE; - /* A start tag with the tag name "noframes" */ - } elseif($token['name'] === 'noframes' && - $token['type'] === HTML5::STARTTAG) { + /* A start tag with the tag name "noframes" */ + } elseif ($token['name'] === 'noframes' && + $token['type'] === HTML5::STARTTAG + ) { /* Process the token as if the insertion mode had been "in body". */ $this->inBody($token); - /* Anything else */ + /* Anything else */ } else { /* Parse error. Ignore the token. */ } } - private function trailingEndPhase($token) { + private function trailingEndPhase($token) + { /* After the main phase, as each token is emitted from the tokenisation stage, it must be processed as described in this section. */ /* A DOCTYPE token */ - if($token['type'] === HTML5::DOCTYPE) { + if ($token['type'] === HTML5::DOCTYPE) { // Parse error. Ignore the token. - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { /* Append a Comment node to the Document object with the data attribute set to the data given in the comment token. */ $comment = $this->dom->createComment($token['data']); $this->dom->appendChild($comment); - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + } elseif ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { /* Process the token as it would be processed in the main phase. */ $this->mainPhase($token); - /* A character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. Or a start tag token. Or an end tag token. */ - } elseif(($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || - $token['type'] === HTML5::STARTTAG || $token['type'] === HTML5::ENDTAG) { + /* A character token that is not one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE. Or a start tag token. Or an end tag token. */ + } elseif (($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || + $token['type'] === HTML5::STARTTAG || $token['type'] === HTML5::ENDTAG + ) { /* Parse error. Switch back to the main phase and reprocess the token. */ $this->phase = self::MAIN_PHASE; return $this->mainPhase($token); - /* An end-of-file token */ - } elseif($token['type'] === HTML5::EOF) { + /* An end-of-file token */ + } elseif ($token['type'] === HTML5::EOF) { /* OMG DONE!! */ } } - private function insertElement($token, $append = true, $check = false) { + private function insertElement($token, $append = true, $check = false) + { // Proprietary workaround for libxml2's limitations with tag names if ($check) { // Slightly modified HTML5 tag-name modification, @@ -3542,13 +4401,15 @@ class HTML5TreeConstructer { // Remove leading hyphens and numbers $token['name'] = ltrim($token['name'], '-0..9'); // In theory, this should ever be needed, but just in case - if ($token['name'] === '') $token['name'] = 'span'; // arbitrary generic choice + if ($token['name'] === '') { + $token['name'] = 'span'; + } // arbitrary generic choice } - + $el = $this->dom->createElement($token['name']); - foreach($token['attr'] as $attr) { - if(!$el->hasAttribute($attr['name'])) { + foreach ($token['attr'] as $attr) { + if (!$el->hasAttribute($attr['name'])) { $el->setAttribute($attr['name'], $attr['value']); } } @@ -3559,48 +4420,54 @@ class HTML5TreeConstructer { return $el; } - private function insertText($data) { + private function insertText($data) + { $text = $this->dom->createTextNode($data); $this->appendToRealParent($text); } - private function insertComment($data) { + private function insertComment($data) + { $comment = $this->dom->createComment($data); $this->appendToRealParent($comment); } - private function appendToRealParent($node) { - if($this->foster_parent === null) { + private function appendToRealParent($node) + { + if ($this->foster_parent === null) { end($this->stack)->appendChild($node); - } elseif($this->foster_parent !== null) { + } elseif ($this->foster_parent !== null) { /* If the foster parent element is the parent element of the last table element in the stack of open elements, then the new node must be inserted immediately before the last table element in the stack of open elements in the foster parent element; otherwise, the new node must be appended to the foster parent element. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === 'table' && - $this->stack[$n]->parentNode !== null) { + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + if ($this->stack[$n]->nodeName === 'table' && + $this->stack[$n]->parentNode !== null + ) { $table = $this->stack[$n]; break; } } - if(isset($table) && $this->foster_parent->isSameNode($table->parentNode)) + if (isset($table) && $this->foster_parent->isSameNode($table->parentNode)) { $this->foster_parent->insertBefore($node, $table); - else + } else { $this->foster_parent->appendChild($node); + } $this->foster_parent = null; } } - private function elementInScope($el, $table = false) { - if(is_array($el)) { - foreach($el as $element) { - if($this->elementInScope($element, $table)) { + private function elementInScope($el, $table = false) + { + if (is_array($el)) { + foreach ($el as $element) { + if ($this->elementInScope($element, $table)) { return true; } } @@ -3610,28 +4477,38 @@ class HTML5TreeConstructer { $leng = count($this->stack); - for($n = 0; $n < $leng; $n++) { + for ($n = 0; $n < $leng; $n++) { /* 1. Initialise node to be the current node (the bottommost node of the stack). */ $node = $this->stack[$leng - 1 - $n]; - if($node->tagName === $el) { + if ($node->tagName === $el) { /* 2. If node is the target node, terminate in a match state. */ return true; - } elseif($node->tagName === 'table') { + } elseif ($node->tagName === 'table') { /* 3. Otherwise, if node is a table element, terminate in a failure state. */ return false; - } elseif($table === true && in_array($node->tagName, array('caption', 'td', - 'th', 'button', 'marquee', 'object'))) { + } elseif ($table === true && in_array( + $node->tagName, + array( + 'caption', + 'td', + 'th', + 'button', + 'marquee', + 'object' + ) + ) + ) { /* 4. Otherwise, if the algorithm is the "has an element in scope" variant (rather than the "has an element in table scope" variant), and node is one of the following, terminate in a failure state. */ return false; - } elseif($node === $node->ownerDocument->documentElement) { + } elseif ($node === $node->ownerDocument->documentElement) { /* 5. Otherwise, if node is an html element (root element), terminate in a failure state. (This can only happen if the node is the topmost node of the stack of open elements, and prevents the next step from @@ -3646,12 +4523,13 @@ class HTML5TreeConstructer { } } - private function reconstructActiveFormattingElements() { + private function reconstructActiveFormattingElements() + { /* 1. If there are no entries in the list of active formatting elements, then there is nothing to reconstruct; stop this algorithm. */ $formatting_elements = count($this->a_formatting); - if($formatting_elements === 0) { + if ($formatting_elements === 0) { return false; } @@ -3663,14 +4541,14 @@ class HTML5TreeConstructer { formatting elements is a marker, or if it is an element that is in the stack of open elements, then there is nothing to reconstruct; stop this algorithm. */ - if($entry === self::MARKER || in_array($entry, $this->stack, true)) { + if ($entry === self::MARKER || in_array($entry, $this->stack, true)) { return false; } - for($a = $formatting_elements - 1; $a >= 0; true) { + for ($a = $formatting_elements - 1; $a >= 0; true) { /* 4. If there are no entries before entry in the list of active formatting elements, then jump to step 8. */ - if($a === 0) { + if ($a === 0) { $step_seven = false; break; } @@ -3682,15 +4560,15 @@ class HTML5TreeConstructer { /* 6. If entry is neither a marker nor an element that is also in thetack of open elements, go to step 4. */ - if($entry === self::MARKER || in_array($entry, $this->stack, true)) { + if ($entry === self::MARKER || in_array($entry, $this->stack, true)) { break; } } - while(true) { + while (true) { /* 7. Let entry be the element one later than entry in the list of active formatting elements. */ - if(isset($step_seven) && $step_seven === true) { + if (isset($step_seven) && $step_seven === true) { $a++; $entry = $this->a_formatting[$a]; } @@ -3709,7 +4587,7 @@ class HTML5TreeConstructer { /* 11. If the entry for clone in the list of active formatting elements is not the last entry in the list, return to step 7. */ - if(end($this->a_formatting) !== $clone) { + if (end($this->a_formatting) !== $clone) { $step_seven = true; } else { break; @@ -3717,12 +4595,13 @@ class HTML5TreeConstructer { } } - private function clearTheActiveFormattingElementsUpToTheLastMarker() { + private function clearTheActiveFormattingElementsUpToTheLastMarker() + { /* When the steps below require the UA to clear the list of active formatting elements up to the last marker, the UA must perform the following steps: */ - while(true) { + while (true) { /* 1. Let entry be the last (most recently added) entry in the list of active formatting elements. */ $entry = end($this->a_formatting); @@ -3732,13 +4611,14 @@ class HTML5TreeConstructer { /* 3. If entry was a marker, then stop the algorithm at this point. The list has been cleared up to the last marker. */ - if($entry === self::MARKER) { + if ($entry === self::MARKER) { break; } } } - private function generateImpliedEndTags($exclude = array()) { + private function generateImpliedEndTags($exclude = array()) + { /* When the steps below require the UA to generate implied end tags, then, if the current node is a dd element, a dt element, an li element, a p element, a td element, a th element, or a tr element, the UA must @@ -3747,36 +4627,36 @@ class HTML5TreeConstructer { $node = end($this->stack); $elements = array_diff(array('dd', 'dt', 'li', 'p', 'td', 'th', 'tr'), $exclude); - while(in_array(end($this->stack)->nodeName, $elements)) { + while (in_array(end($this->stack)->nodeName, $elements)) { array_pop($this->stack); } } - private function getElementCategory($node) { + private function getElementCategory($node) + { $name = $node->tagName; - if(in_array($name, $this->special)) + if (in_array($name, $this->special)) { return self::SPECIAL; - - elseif(in_array($name, $this->scoping)) + } elseif (in_array($name, $this->scoping)) { return self::SCOPING; - - elseif(in_array($name, $this->formatting)) + } elseif (in_array($name, $this->formatting)) { return self::FORMATTING; - - else + } else { return self::PHRASING; + } } - private function clearStackToTableContext($elements) { + private function clearStackToTableContext($elements) + { /* When the steps above require the UA to clear the stack back to a table context, it means that the UA must, while the current node is not a table element or an html element, pop elements from the stack of open elements. If this causes any elements to be popped from the stack, then this is a parse error. */ - while(true) { + while (true) { $node = end($this->stack)->nodeName; - if(in_array($node, $elements)) { + if (in_array($node, $elements)) { break; } else { array_pop($this->stack); @@ -3784,12 +4664,13 @@ class HTML5TreeConstructer { } } - private function resetInsertionMode() { + private function resetInsertionMode() + { /* 1. Let last be false. */ $last = false; $leng = count($this->stack); - for($n = $leng - 1; $n >= 0; $n--) { + for ($n = $leng - 1; $n >= 0; $n--) { /* 2. Let node be the last node in the stack of open elements. */ $node = $this->stack[$n]; @@ -3797,108 +4678,111 @@ class HTML5TreeConstructer { set last to true. If the element whose innerHTML attribute is being set is neither a td element nor a th element, then set node to the element whose innerHTML attribute is being set. (innerHTML case) */ - if($this->stack[0]->isSameNode($node)) { + if ($this->stack[0]->isSameNode($node)) { $last = true; } /* 4. If node is a select element, then switch the insertion mode to "in select" and abort these steps. (innerHTML case) */ - if($node->nodeName === 'select') { + if ($node->nodeName === 'select') { $this->mode = self::IN_SELECT; break; - /* 5. If node is a td or th element, then switch the insertion mode - to "in cell" and abort these steps. */ - } elseif($node->nodeName === 'td' || $node->nodeName === 'th') { + /* 5. If node is a td or th element, then switch the insertion mode + to "in cell" and abort these steps. */ + } elseif ($node->nodeName === 'td' || $node->nodeName === 'th') { $this->mode = self::IN_CELL; break; - /* 6. If node is a tr element, then switch the insertion mode to - "in row" and abort these steps. */ - } elseif($node->nodeName === 'tr') { + /* 6. If node is a tr element, then switch the insertion mode to + "in row" and abort these steps. */ + } elseif ($node->nodeName === 'tr') { $this->mode = self::IN_ROW; break; - /* 7. If node is a tbody, thead, or tfoot element, then switch the - insertion mode to "in table body" and abort these steps. */ - } elseif(in_array($node->nodeName, array('tbody', 'thead', 'tfoot'))) { + /* 7. If node is a tbody, thead, or tfoot element, then switch the + insertion mode to "in table body" and abort these steps. */ + } elseif (in_array($node->nodeName, array('tbody', 'thead', 'tfoot'))) { $this->mode = self::IN_TBODY; break; - /* 8. If node is a caption element, then switch the insertion mode - to "in caption" and abort these steps. */ - } elseif($node->nodeName === 'caption') { + /* 8. If node is a caption element, then switch the insertion mode + to "in caption" and abort these steps. */ + } elseif ($node->nodeName === 'caption') { $this->mode = self::IN_CAPTION; break; - /* 9. If node is a colgroup element, then switch the insertion mode - to "in column group" and abort these steps. (innerHTML case) */ - } elseif($node->nodeName === 'colgroup') { + /* 9. If node is a colgroup element, then switch the insertion mode + to "in column group" and abort these steps. (innerHTML case) */ + } elseif ($node->nodeName === 'colgroup') { $this->mode = self::IN_CGROUP; break; - /* 10. If node is a table element, then switch the insertion mode - to "in table" and abort these steps. */ - } elseif($node->nodeName === 'table') { + /* 10. If node is a table element, then switch the insertion mode + to "in table" and abort these steps. */ + } elseif ($node->nodeName === 'table') { $this->mode = self::IN_TABLE; break; - /* 11. If node is a head element, then switch the insertion mode - to "in body" ("in body"! not "in head"!) and abort these steps. - (innerHTML case) */ - } elseif($node->nodeName === 'head') { + /* 11. If node is a head element, then switch the insertion mode + to "in body" ("in body"! not "in head"!) and abort these steps. + (innerHTML case) */ + } elseif ($node->nodeName === 'head') { $this->mode = self::IN_BODY; break; - /* 12. If node is a body element, then switch the insertion mode to - "in body" and abort these steps. */ - } elseif($node->nodeName === 'body') { + /* 12. If node is a body element, then switch the insertion mode to + "in body" and abort these steps. */ + } elseif ($node->nodeName === 'body') { $this->mode = self::IN_BODY; break; - /* 13. If node is a frameset element, then switch the insertion - mode to "in frameset" and abort these steps. (innerHTML case) */ - } elseif($node->nodeName === 'frameset') { + /* 13. If node is a frameset element, then switch the insertion + mode to "in frameset" and abort these steps. (innerHTML case) */ + } elseif ($node->nodeName === 'frameset') { $this->mode = self::IN_FRAME; break; - /* 14. If node is an html element, then: if the head element - pointer is null, switch the insertion mode to "before head", - otherwise, switch the insertion mode to "after head". In either - case, abort these steps. (innerHTML case) */ - } elseif($node->nodeName === 'html') { + /* 14. If node is an html element, then: if the head element + pointer is null, switch the insertion mode to "before head", + otherwise, switch the insertion mode to "after head". In either + case, abort these steps. (innerHTML case) */ + } elseif ($node->nodeName === 'html') { $this->mode = ($this->head_pointer === null) ? self::BEFOR_HEAD : self::AFTER_HEAD; break; - /* 15. If last is true, then set the insertion mode to "in body" - and abort these steps. (innerHTML case) */ - } elseif($last) { + /* 15. If last is true, then set the insertion mode to "in body" + and abort these steps. (innerHTML case) */ + } elseif ($last) { $this->mode = self::IN_BODY; break; } } } - private function closeCell() { + private function closeCell() + { /* If the stack of open elements has a td or th element in table scope, then act as if an end tag token with that tag name had been seen. */ - foreach(array('td', 'th') as $cell) { - if($this->elementInScope($cell, true)) { - $this->inCell(array( - 'name' => $cell, - 'type' => HTML5::ENDTAG - )); + foreach (array('td', 'th') as $cell) { + if ($this->elementInScope($cell, true)) { + $this->inCell( + array( + 'name' => $cell, + 'type' => HTML5::ENDTAG + ) + ); break; } } } - public function save() { + public function save() + { return $this->dom; } } -?> diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node.php new file mode 100644 index 0000000000..3995fec9fe --- /dev/null +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node.php @@ -0,0 +1,49 @@ +data = $data; + $this->line = $line; + $this->col = $col; + } + + public function toTokenPair() { + return array(new HTMLPurifier_Token_Comment($this->data, $this->line, $this->col), null); + } +} diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node/Element.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node/Element.php new file mode 100644 index 0000000000..6cbf56dada --- /dev/null +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node/Element.php @@ -0,0 +1,59 @@ + form or the form, i.e. + * is it a pair of start/end tokens or an empty token. + * @bool + */ + public $empty = false; + + public $endCol = null, $endLine = null, $endArmor = array(); + + public function __construct($name, $attr = array(), $line = null, $col = null, $armor = array()) { + $this->name = $name; + $this->attr = $attr; + $this->line = $line; + $this->col = $col; + $this->armor = $armor; + } + + public function toTokenPair() { + // XXX inefficiency here, normalization is not necessary + if ($this->empty) { + return array(new HTMLPurifier_Token_Empty($this->name, $this->attr, $this->line, $this->col, $this->armor), null); + } else { + $start = new HTMLPurifier_Token_Start($this->name, $this->attr, $this->line, $this->col, $this->armor); + $end = new HTMLPurifier_Token_End($this->name, array(), $this->endLine, $this->endCol, $this->endArmor); + //$end->start = $start; + return array($start, $end); + } + } +} + diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node/Text.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node/Text.php new file mode 100644 index 0000000000..aec9166473 --- /dev/null +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node/Text.php @@ -0,0 +1,54 @@ +data = $data; + $this->is_whitespace = $is_whitespace; + $this->line = $line; + $this->col = $col; + } + + public function toTokenPair() { + return array(new HTMLPurifier_Token_Text($this->data, $this->line, $this->col), null); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PercentEncoder.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PercentEncoder.php index a43c44f4c5..18c8bbb00a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PercentEncoder.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PercentEncoder.php @@ -13,17 +13,26 @@ class HTMLPurifier_PercentEncoder /** * Reserved characters to preserve when using encode(). + * @type array */ protected $preserve = array(); /** * String of characters that should be preserved while using encode(). + * @param bool $preserve */ - public function __construct($preserve = false) { + public function __construct($preserve = false) + { // unreserved letters, ought to const-ify - for ($i = 48; $i <= 57; $i++) $this->preserve[$i] = true; // digits - for ($i = 65; $i <= 90; $i++) $this->preserve[$i] = true; // upper-case - for ($i = 97; $i <= 122; $i++) $this->preserve[$i] = true; // lower-case + for ($i = 48; $i <= 57; $i++) { // digits + $this->preserve[$i] = true; + } + for ($i = 65; $i <= 90; $i++) { // upper-case + $this->preserve[$i] = true; + } + for ($i = 97; $i <= 122; $i++) { // lower-case + $this->preserve[$i] = true; + } $this->preserve[45] = true; // Dash - $this->preserve[46] = true; // Period . $this->preserve[95] = true; // Underscore _ @@ -44,13 +53,14 @@ class HTMLPurifier_PercentEncoder * Assumes that the string has already been normalized, making any * and all percent escape sequences valid. Percents will not be * re-escaped, regardless of their status in $preserve - * @param $string String to be encoded - * @return Encoded string. + * @param string $string String to be encoded + * @return string Encoded string. */ - public function encode($string) { + public function encode($string) + { $ret = ''; for ($i = 0, $c = strlen($string); $i < $c; $i++) { - if ($string[$i] !== '%' && !isset($this->preserve[$int = ord($string[$i])]) ) { + if ($string[$i] !== '%' && !isset($this->preserve[$int = ord($string[$i])])) { $ret .= '%' . sprintf('%02X', $int); } else { $ret .= $string[$i]; @@ -64,10 +74,14 @@ class HTMLPurifier_PercentEncoder * @warning This function is affected by $preserve, even though the * usual desired behavior is for this not to preserve those * characters. Be careful when reusing instances of PercentEncoder! - * @param $string String to normalize + * @param string $string String to normalize + * @return string */ - public function normalize($string) { - if ($string == '') return ''; + public function normalize($string) + { + if ($string == '') { + return ''; + } $parts = explode('%', $string); $ret = array_shift($parts); foreach ($parts as $part) { @@ -92,7 +106,6 @@ class HTMLPurifier_PercentEncoder } return $ret; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer.php index e7eb82e83e..549e4cea1e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer.php @@ -7,25 +7,30 @@ class HTMLPurifier_Printer { /** - * Instance of HTMLPurifier_Generator for HTML generation convenience funcs + * For HTML generation convenience funcs. + * @type HTMLPurifier_Generator */ protected $generator; /** - * Instance of HTMLPurifier_Config, for easy access + * For easy access. + * @type HTMLPurifier_Config */ protected $config; /** * Initialize $generator. */ - public function __construct() { + public function __construct() + { } /** * Give generator necessary configuration if possible + * @param HTMLPurifier_Config $config */ - public function prepareGenerator($config) { + public function prepareGenerator($config) + { $all = $config->getAll(); $context = new HTMLPurifier_Context(); $this->generator = new HTMLPurifier_Generator($config, $context); @@ -39,45 +44,62 @@ class HTMLPurifier_Printer /** * Returns a start tag - * @param $tag Tag name - * @param $attr Attribute array + * @param string $tag Tag name + * @param array $attr Attribute array + * @return string */ - protected function start($tag, $attr = array()) { + protected function start($tag, $attr = array()) + { return $this->generator->generateFromToken( - new HTMLPurifier_Token_Start($tag, $attr ? $attr : array()) - ); + new HTMLPurifier_Token_Start($tag, $attr ? $attr : array()) + ); } /** - * Returns an end teg - * @param $tag Tag name + * Returns an end tag + * @param string $tag Tag name + * @return string */ - protected function end($tag) { + protected function end($tag) + { return $this->generator->generateFromToken( - new HTMLPurifier_Token_End($tag) - ); + new HTMLPurifier_Token_End($tag) + ); } /** * Prints a complete element with content inside - * @param $tag Tag name - * @param $contents Element contents - * @param $attr Tag attributes - * @param $escape Bool whether or not to escape contents + * @param string $tag Tag name + * @param string $contents Element contents + * @param array $attr Tag attributes + * @param bool $escape whether or not to escape contents + * @return string */ - protected function element($tag, $contents, $attr = array(), $escape = true) { + protected function element($tag, $contents, $attr = array(), $escape = true) + { return $this->start($tag, $attr) . - ($escape ? $this->escape($contents) : $contents) . - $this->end($tag); + ($escape ? $this->escape($contents) : $contents) . + $this->end($tag); } - protected function elementEmpty($tag, $attr = array()) { + /** + * @param string $tag + * @param array $attr + * @return string + */ + protected function elementEmpty($tag, $attr = array()) + { return $this->generator->generateFromToken( new HTMLPurifier_Token_Empty($tag, $attr) ); } - protected function text($text) { + /** + * @param string $text + * @return string + */ + protected function text($text) + { return $this->generator->generateFromToken( new HTMLPurifier_Token_Text($text) ); @@ -85,24 +107,29 @@ class HTMLPurifier_Printer /** * Prints a simple key/value row in a table. - * @param $name Key - * @param $value Value + * @param string $name Key + * @param mixed $value Value + * @return string */ - protected function row($name, $value) { - if (is_bool($value)) $value = $value ? 'On' : 'Off'; + protected function row($name, $value) + { + if (is_bool($value)) { + $value = $value ? 'On' : 'Off'; + } return $this->start('tr') . "\n" . - $this->element('th', $name) . "\n" . - $this->element('td', $value) . "\n" . - $this->end('tr') - ; + $this->element('th', $name) . "\n" . + $this->element('td', $value) . "\n" . + $this->end('tr'); } /** * Escapes a string for HTML output. - * @param $string String to escape + * @param string $string String to escape + * @return string */ - protected function escape($string) { + protected function escape($string) + { $string = HTMLPurifier_Encoder::cleanUTF8($string); $string = htmlspecialchars($string, ENT_COMPAT, 'UTF-8'); return $string; @@ -110,32 +137,46 @@ class HTMLPurifier_Printer /** * Takes a list of strings and turns them into a single list - * @param $array List of strings - * @param $polite Bool whether or not to add an end before the last + * @param string[] $array List of strings + * @param bool $polite Bool whether or not to add an end before the last + * @return string */ - protected function listify($array, $polite = false) { - if (empty($array)) return 'None'; + protected function listify($array, $polite = false) + { + if (empty($array)) { + return 'None'; + } $ret = ''; $i = count($array); foreach ($array as $value) { $i--; $ret .= $value; - if ($i > 0 && !($polite && $i == 1)) $ret .= ', '; - if ($polite && $i == 1) $ret .= 'and '; + if ($i > 0 && !($polite && $i == 1)) { + $ret .= ', '; + } + if ($polite && $i == 1) { + $ret .= 'and '; + } } return $ret; } /** * Retrieves the class of an object without prefixes, as well as metadata - * @param $obj Object to determine class of - * @param $prefix Further prefix to remove + * @param object $obj Object to determine class of + * @param string $sec_prefix Further prefix to remove + * @return string */ - protected function getClass($obj, $sec_prefix = '') { + protected function getClass($obj, $sec_prefix = '') + { static $five = null; - if ($five === null) $five = version_compare(PHP_VERSION, '5', '>='); + if ($five === null) { + $five = version_compare(PHP_VERSION, '5', '>='); + } $prefix = 'HTMLPurifier_' . $sec_prefix; - if (!$five) $prefix = strtolower($prefix); + if (!$five) { + $prefix = strtolower($prefix); + } $class = str_replace($prefix, '', get_class($obj)); $lclass = strtolower($class); $class .= '('; @@ -164,13 +205,14 @@ class HTMLPurifier_Printer break; case 'css_importantdecorator': $class .= $this->getClass($obj->def, $sec_prefix); - if ($obj->allow) $class .= ', !important'; + if ($obj->allow) { + $class .= ', !important'; + } break; } $class .= ')'; return $class; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/CSSDefinition.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/CSSDefinition.php index 81f9865901..29505fe12d 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/CSSDefinition.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/CSSDefinition.php @@ -2,10 +2,17 @@ class HTMLPurifier_Printer_CSSDefinition extends HTMLPurifier_Printer { - + /** + * @type HTMLPurifier_CSSDefinition + */ protected $def; - public function render($config) { + /** + * @param HTMLPurifier_Config $config + * @return string + */ + public function render($config) + { $this->def = $config->getCSSDefinition(); $ret = ''; @@ -32,7 +39,6 @@ class HTMLPurifier_Printer_CSSDefinition extends HTMLPurifier_Printer return $ret; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php index 02aa656894..36100ce738 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php @@ -7,17 +7,20 @@ class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer { /** - * Printers for specific fields + * Printers for specific fields. + * @type HTMLPurifier_Printer[] */ protected $fields = array(); /** - * Documentation URL, can have fragment tagged on end + * Documentation URL, can have fragment tagged on end. + * @type string */ protected $docURL; /** - * Name of form element to stuff config in + * Name of form element to stuff config in. + * @type string */ protected $name; @@ -25,24 +28,27 @@ class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer * Whether or not to compress directive names, clipping them off * after a certain amount of letters. False to disable or integer letters * before clipping. + * @type bool */ protected $compress = false; /** - * @param $name Form element name for directives to be stuffed into - * @param $doc_url String documentation URL, will have fragment tagged on - * @param $compress Integer max length before compressing a directive name, set to false to turn off + * @param string $name Form element name for directives to be stuffed into + * @param string $doc_url String documentation URL, will have fragment tagged on + * @param bool $compress Integer max length before compressing a directive name, set to false to turn off */ public function __construct( - $name, $doc_url = null, $compress = false + $name, + $doc_url = null, + $compress = false ) { parent::__construct(); $this->docURL = $doc_url; - $this->name = $name; + $this->name = $name; $this->compress = $compress; // initialize sub-printers - $this->fields[0] = new HTMLPurifier_Printer_ConfigForm_default(); - $this->fields[HTMLPurifier_VarParser::BOOL] = new HTMLPurifier_Printer_ConfigForm_bool(); + $this->fields[0] = new HTMLPurifier_Printer_ConfigForm_default(); + $this->fields[HTMLPurifier_VarParser::BOOL] = new HTMLPurifier_Printer_ConfigForm_bool(); } /** @@ -50,32 +56,42 @@ class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer * @param $cols Integer columns of textarea, null to use default * @param $rows Integer rows of textarea, null to use default */ - public function setTextareaDimensions($cols = null, $rows = null) { - if ($cols) $this->fields['default']->cols = $cols; - if ($rows) $this->fields['default']->rows = $rows; + public function setTextareaDimensions($cols = null, $rows = null) + { + if ($cols) { + $this->fields['default']->cols = $cols; + } + if ($rows) { + $this->fields['default']->rows = $rows; + } } /** * Retrieves styling, in case it is not accessible by webserver */ - public static function getCSS() { + public static function getCSS() + { return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.css'); } /** * Retrieves JavaScript, in case it is not accessible by webserver */ - public static function getJavaScript() { + public static function getJavaScript() + { return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.js'); } /** * Returns HTML output for a configuration form - * @param $config Configuration object of current form state, or an array + * @param HTMLPurifier_Config|array $config Configuration object of current form state, or an array * where [0] has an HTML namespace and [1] is being rendered. - * @param $allowed Optional namespace(s) and directives to restrict form to. + * @param array|bool $allowed Optional namespace(s) and directives to restrict form to. + * @param bool $render_controls + * @return string */ - public function render($config, $allowed = true, $render_controls = true) { + public function render($config, $allowed = true, $render_controls = true) + { if (is_array($config) && isset($config[0])) { $gen_config = $config[0]; $config = $config[1]; @@ -91,29 +107,29 @@ class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer $all = array(); foreach ($allowed as $key) { list($ns, $directive) = $key; - $all[$ns][$directive] = $config->get($ns .'.'. $directive); + $all[$ns][$directive] = $config->get($ns . '.' . $directive); } $ret = ''; $ret .= $this->start('table', array('class' => 'hp-config')); $ret .= $this->start('thead'); $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Directive', array('class' => 'hp-directive')); - $ret .= $this->element('th', 'Value', array('class' => 'hp-value')); + $ret .= $this->element('th', 'Directive', array('class' => 'hp-directive')); + $ret .= $this->element('th', 'Value', array('class' => 'hp-value')); $ret .= $this->end('tr'); $ret .= $this->end('thead'); foreach ($all as $ns => $directives) { $ret .= $this->renderNamespace($ns, $directives); } if ($render_controls) { - $ret .= $this->start('tbody'); - $ret .= $this->start('tr'); - $ret .= $this->start('td', array('colspan' => 2, 'class' => 'controls')); - $ret .= $this->elementEmpty('input', array('type' => 'submit', 'value' => 'Submit')); - $ret .= '[Reset]'; - $ret .= $this->end('td'); - $ret .= $this->end('tr'); - $ret .= $this->end('tbody'); + $ret .= $this->start('tbody'); + $ret .= $this->start('tr'); + $ret .= $this->start('td', array('colspan' => 2, 'class' => 'controls')); + $ret .= $this->elementEmpty('input', array('type' => 'submit', 'value' => 'Submit')); + $ret .= '[Reset]'; + $ret .= $this->end('td'); + $ret .= $this->end('tr'); + $ret .= $this->end('tbody'); } $ret .= $this->end('table'); return $ret; @@ -122,13 +138,15 @@ class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer /** * Renders a single namespace * @param $ns String namespace name - * @param $directive Associative array of directives to values + * @param array $directives array of directives to values + * @return string */ - protected function renderNamespace($ns, $directives) { + protected function renderNamespace($ns, $directives) + { $ret = ''; $ret .= $this->start('tbody', array('class' => 'namespace')); $ret .= $this->start('tr'); - $ret .= $this->element('th', $ns, array('colspan' => 2)); + $ret .= $this->element('th', $ns, array('colspan' => 2)); $ret .= $this->end('tr'); $ret .= $this->end('tbody'); $ret .= $this->start('tbody'); @@ -139,40 +157,44 @@ class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer $url = str_replace('%s', urlencode("$ns.$directive"), $this->docURL); $ret .= $this->start('a', array('href' => $url)); } - $attr = array('for' => "{$this->name}:$ns.$directive"); - - // crop directive name if it's too long - if (!$this->compress || (strlen($directive) < $this->compress)) { - $directive_disp = $directive; - } else { - $directive_disp = substr($directive, 0, $this->compress - 2) . '...'; - $attr['title'] = $directive; - } + $attr = array('for' => "{$this->name}:$ns.$directive"); + + // crop directive name if it's too long + if (!$this->compress || (strlen($directive) < $this->compress)) { + $directive_disp = $directive; + } else { + $directive_disp = substr($directive, 0, $this->compress - 2) . '...'; + $attr['title'] = $directive; + } - $ret .= $this->element( - 'label', - $directive_disp, - // component printers must create an element with this id - $attr - ); - if ($this->docURL) $ret .= $this->end('a'); + $ret .= $this->element( + 'label', + $directive_disp, + // component printers must create an element with this id + $attr + ); + if ($this->docURL) { + $ret .= $this->end('a'); + } $ret .= $this->end('th'); $ret .= $this->start('td'); - $def = $this->config->def->info["$ns.$directive"]; - if (is_int($def)) { - $allow_null = $def < 0; - $type = abs($def); - } else { - $type = $def->type; - $allow_null = isset($def->allow_null); - } - if (!isset($this->fields[$type])) $type = 0; // default - $type_obj = $this->fields[$type]; - if ($allow_null) { - $type_obj = new HTMLPurifier_Printer_ConfigForm_NullDecorator($type_obj); - } - $ret .= $type_obj->render($ns, $directive, $value, $this->name, array($this->genConfig, $this->config)); + $def = $this->config->def->info["$ns.$directive"]; + if (is_int($def)) { + $allow_null = $def < 0; + $type = abs($def); + } else { + $type = $def->type; + $allow_null = isset($def->allow_null); + } + if (!isset($this->fields[$type])) { + $type = 0; + } // default + $type_obj = $this->fields[$type]; + if ($allow_null) { + $type_obj = new HTMLPurifier_Printer_ConfigForm_NullDecorator($type_obj); + } + $ret .= $type_obj->render($ns, $directive, $value, $this->name, array($this->genConfig, $this->config)); $ret .= $this->end('td'); $ret .= $this->end('tr'); } @@ -185,19 +207,33 @@ class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer /** * Printer decorator for directives that accept null */ -class HTMLPurifier_Printer_ConfigForm_NullDecorator extends HTMLPurifier_Printer { +class HTMLPurifier_Printer_ConfigForm_NullDecorator extends HTMLPurifier_Printer +{ /** * Printer being decorated + * @type HTMLPurifier_Printer */ protected $obj; + /** - * @param $obj Printer to decorate + * @param HTMLPurifier_Printer $obj Printer to decorate */ - public function __construct($obj) { + public function __construct($obj) + { parent::__construct(); $this->obj = $obj; } - public function render($ns, $directive, $value, $name, $config) { + + /** + * @param string $ns + * @param string $directive + * @param string $value + * @param string $name + * @param HTMLPurifier_Config|array $config + * @return string + */ + public function render($ns, $directive, $value, $name, $config) + { if (is_array($config) && isset($config[0])) { $gen_config = $config[0]; $config = $config[1]; @@ -215,15 +251,19 @@ class HTMLPurifier_Printer_ConfigForm_NullDecorator extends HTMLPurifier_Printer 'type' => 'checkbox', 'value' => '1', 'class' => 'null-toggle', - 'name' => "$name"."[Null_$ns.$directive]", + 'name' => "$name" . "[Null_$ns.$directive]", 'id' => "$name:Null_$ns.$directive", 'onclick' => "toggleWriteability('$name:$ns.$directive',checked)" // INLINE JAVASCRIPT!!!! ); if ($this->obj instanceof HTMLPurifier_Printer_ConfigForm_bool) { // modify inline javascript slightly - $attr['onclick'] = "toggleWriteability('$name:Yes_$ns.$directive',checked);toggleWriteability('$name:No_$ns.$directive',checked)"; + $attr['onclick'] = + "toggleWriteability('$name:Yes_$ns.$directive',checked);" . + "toggleWriteability('$name:No_$ns.$directive',checked)"; + } + if ($value === null) { + $attr['checked'] = 'checked'; } - if ($value === null) $attr['checked'] = 'checked'; $ret .= $this->elementEmpty('input', $attr); $ret .= $this->text(' or '); $ret .= $this->elementEmpty('br'); @@ -235,10 +275,28 @@ class HTMLPurifier_Printer_ConfigForm_NullDecorator extends HTMLPurifier_Printer /** * Swiss-army knife configuration form field printer */ -class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer { +class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer +{ + /** + * @type int + */ public $cols = 18; + + /** + * @type int + */ public $rows = 5; - public function render($ns, $directive, $value, $name, $config) { + + /** + * @param string $ns + * @param string $directive + * @param string $value + * @param string $name + * @param HTMLPurifier_Config|array $config + * @return string + */ + public function render($ns, $directive, $value, $name, $config) + { if (is_array($config) && isset($config[0])) { $gen_config = $config[0]; $config = $config[1]; @@ -262,6 +320,7 @@ class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer { foreach ($array as $val => $b) { $value[] = $val; } + //TODO does this need a break? case HTMLPurifier_VarParser::ALIST: $value = implode(PHP_EOL, $value); break; @@ -281,25 +340,27 @@ class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer { $value = serialize($value); } $attr = array( - 'name' => "$name"."[$ns.$directive]", + 'name' => "$name" . "[$ns.$directive]", 'id' => "$name:$ns.$directive" ); - if ($value === null) $attr['disabled'] = 'disabled'; + if ($value === null) { + $attr['disabled'] = 'disabled'; + } if (isset($def->allowed)) { $ret .= $this->start('select', $attr); foreach ($def->allowed as $val => $b) { $attr = array(); - if ($value == $val) $attr['selected'] = 'selected'; + if ($value == $val) { + $attr['selected'] = 'selected'; + } $ret .= $this->element('option', $val, $attr); } $ret .= $this->end('select'); - } elseif ( - $type === HTMLPurifier_VarParser::TEXT || - $type === HTMLPurifier_VarParser::ITEXT || - $type === HTMLPurifier_VarParser::ALIST || - $type === HTMLPurifier_VarParser::HASH || - $type === HTMLPurifier_VarParser::LOOKUP - ) { + } elseif ($type === HTMLPurifier_VarParser::TEXT || + $type === HTMLPurifier_VarParser::ITEXT || + $type === HTMLPurifier_VarParser::ALIST || + $type === HTMLPurifier_VarParser::HASH || + $type === HTMLPurifier_VarParser::LOOKUP) { $attr['cols'] = $this->cols; $attr['rows'] = $this->rows; $ret .= $this->start('textarea', $attr); @@ -317,8 +378,18 @@ class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer { /** * Bool form field printer */ -class HTMLPurifier_Printer_ConfigForm_bool extends HTMLPurifier_Printer { - public function render($ns, $directive, $value, $name, $config) { +class HTMLPurifier_Printer_ConfigForm_bool extends HTMLPurifier_Printer +{ + /** + * @param string $ns + * @param string $directive + * @param string $value + * @param string $name + * @param HTMLPurifier_Config|array $config + * @return string + */ + public function render($ns, $directive, $value, $name, $config) + { if (is_array($config) && isset($config[0])) { $gen_config = $config[0]; $config = $config[1]; @@ -336,12 +407,16 @@ class HTMLPurifier_Printer_ConfigForm_bool extends HTMLPurifier_Printer { $attr = array( 'type' => 'radio', - 'name' => "$name"."[$ns.$directive]", + 'name' => "$name" . "[$ns.$directive]", 'id' => "$name:Yes_$ns.$directive", 'value' => '1' ); - if ($value === true) $attr['checked'] = 'checked'; - if ($value === null) $attr['disabled'] = 'disabled'; + if ($value === true) { + $attr['checked'] = 'checked'; + } + if ($value === null) { + $attr['disabled'] = 'disabled'; + } $ret .= $this->elementEmpty('input', $attr); $ret .= $this->start('label', array('for' => "$name:No_$ns.$directive")); @@ -351,12 +426,16 @@ class HTMLPurifier_Printer_ConfigForm_bool extends HTMLPurifier_Printer { $attr = array( 'type' => 'radio', - 'name' => "$name"."[$ns.$directive]", + 'name' => "$name" . "[$ns.$directive]", 'id' => "$name:No_$ns.$directive", 'value' => '0' ); - if ($value === false) $attr['checked'] = 'checked'; - if ($value === null) $attr['disabled'] = 'disabled'; + if ($value === false) { + $attr['checked'] = 'checked'; + } + if ($value === null) { + $attr['disabled'] = 'disabled'; + } $ret .= $this->elementEmpty('input', $attr); $ret .= $this->end('div'); diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/HTMLDefinition.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/HTMLDefinition.php index 8a8f126b81..5f2f2f8a7c 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/HTMLDefinition.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/HTMLDefinition.php @@ -4,11 +4,16 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer { /** - * Instance of HTMLPurifier_HTMLDefinition, for easy access + * @type HTMLPurifier_HTMLDefinition, for easy access */ protected $def; - public function render($config) { + /** + * @param HTMLPurifier_Config $config + * @return string + */ + public function render($config) + { $ret = ''; $this->config =& $config; @@ -28,8 +33,10 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer /** * Renders the Doctype table + * @return string */ - protected function renderDoctype() { + protected function renderDoctype() + { $doctype = $this->def->doctype; $ret = ''; $ret .= $this->start('table'); @@ -45,8 +52,10 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer /** * Renders environment table, which is miscellaneous info + * @return string */ - protected function renderEnvironment() { + protected function renderEnvironment() + { $def = $this->def; $ret = ''; @@ -59,28 +68,28 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer $ret .= $this->row('Block wrap name', $def->info_block_wrapper); $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Global attributes'); - $ret .= $this->element('td', $this->listifyAttr($def->info_global_attr),0,0); + $ret .= $this->element('th', 'Global attributes'); + $ret .= $this->element('td', $this->listifyAttr($def->info_global_attr), null, 0); $ret .= $this->end('tr'); $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Tag transforms'); - $list = array(); - foreach ($def->info_tag_transform as $old => $new) { - $new = $this->getClass($new, 'TagTransform_'); - $list[] = "<$old> with $new"; - } - $ret .= $this->element('td', $this->listify($list)); + $ret .= $this->element('th', 'Tag transforms'); + $list = array(); + foreach ($def->info_tag_transform as $old => $new) { + $new = $this->getClass($new, 'TagTransform_'); + $list[] = "<$old> with $new"; + } + $ret .= $this->element('td', $this->listify($list)); $ret .= $this->end('tr'); $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Pre-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_pre)); + $ret .= $this->element('th', 'Pre-AttrTransform'); + $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_pre)); $ret .= $this->end('tr'); $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Post-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_post)); + $ret .= $this->element('th', 'Post-AttrTransform'); + $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_post)); $ret .= $this->end('tr'); $ret .= $this->end('table'); @@ -89,8 +98,10 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer /** * Renders the Content Sets table + * @return string */ - protected function renderContentSets() { + protected function renderContentSets() + { $ret = ''; $ret .= $this->start('table'); $ret .= $this->element('caption', 'Content Sets'); @@ -106,8 +117,10 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer /** * Renders the Elements ($info) table + * @return string */ - protected function renderInfo() { + protected function renderInfo() + { $ret = ''; $ret .= $this->start('table'); $ret .= $this->element('caption', 'Elements ($info)'); @@ -118,39 +131,39 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer $ret .= $this->end('tr'); foreach ($this->def->info as $name => $def) { $ret .= $this->start('tr'); - $ret .= $this->element('th', "<$name>", array('class'=>'heavy', 'colspan' => 2)); + $ret .= $this->element('th', "<$name>", array('class' => 'heavy', 'colspan' => 2)); $ret .= $this->end('tr'); $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Inline content'); - $ret .= $this->element('td', $def->descendants_are_inline ? 'Yes' : 'No'); + $ret .= $this->element('th', 'Inline content'); + $ret .= $this->element('td', $def->descendants_are_inline ? 'Yes' : 'No'); $ret .= $this->end('tr'); if (!empty($def->excludes)) { $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Excludes'); - $ret .= $this->element('td', $this->listifyTagLookup($def->excludes)); + $ret .= $this->element('th', 'Excludes'); + $ret .= $this->element('td', $this->listifyTagLookup($def->excludes)); $ret .= $this->end('tr'); } if (!empty($def->attr_transform_pre)) { $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Pre-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_pre)); + $ret .= $this->element('th', 'Pre-AttrTransform'); + $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_pre)); $ret .= $this->end('tr'); } if (!empty($def->attr_transform_post)) { $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Post-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_post)); + $ret .= $this->element('th', 'Post-AttrTransform'); + $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_post)); $ret .= $this->end('tr'); } if (!empty($def->auto_close)) { $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Auto closed by'); - $ret .= $this->element('td', $this->listifyTagLookup($def->auto_close)); + $ret .= $this->element('th', 'Auto closed by'); + $ret .= $this->element('td', $this->listifyTagLookup($def->auto_close)); $ret .= $this->end('tr'); } $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Allowed attributes'); - $ret .= $this->element('td',$this->listifyAttr($def->attr), array(), 0); + $ret .= $this->element('th', 'Allowed attributes'); + $ret .= $this->element('td', $this->listifyAttr($def->attr), array(), 0); $ret .= $this->end('tr'); if (!empty($def->required_attr)) { @@ -165,64 +178,94 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer /** * Renders a row describing the allowed children of an element - * @param $def HTMLPurifier_ChildDef of pertinent element + * @param HTMLPurifier_ChildDef $def HTMLPurifier_ChildDef of pertinent element + * @return string */ - protected function renderChildren($def) { + protected function renderChildren($def) + { $context = new HTMLPurifier_Context(); $ret = ''; $ret .= $this->start('tr'); - $elements = array(); - $attr = array(); - if (isset($def->elements)) { - if ($def->type == 'strictblockquote') { - $def->validateChildren(array(), $this->config, $context); - } - $elements = $def->elements; + $elements = array(); + $attr = array(); + if (isset($def->elements)) { + if ($def->type == 'strictblockquote') { + $def->validateChildren(array(), $this->config, $context); } - if ($def->type == 'chameleon') { - $attr['rowspan'] = 2; - } elseif ($def->type == 'empty') { - $elements = array(); - } elseif ($def->type == 'table') { - $elements = array_flip(array('col', 'caption', 'colgroup', 'thead', - 'tfoot', 'tbody', 'tr')); - } - $ret .= $this->element('th', 'Allowed children', $attr); - - if ($def->type == 'chameleon') { - - $ret .= $this->element('td', - 'Block: ' . - $this->escape($this->listifyTagLookup($def->block->elements)),0,0); - $ret .= $this->end('tr'); - $ret .= $this->start('tr'); - $ret .= $this->element('td', - 'Inline: ' . - $this->escape($this->listifyTagLookup($def->inline->elements)),0,0); - - } elseif ($def->type == 'custom') { + $elements = $def->elements; + } + if ($def->type == 'chameleon') { + $attr['rowspan'] = 2; + } elseif ($def->type == 'empty') { + $elements = array(); + } elseif ($def->type == 'table') { + $elements = array_flip( + array( + 'col', + 'caption', + 'colgroup', + 'thead', + 'tfoot', + 'tbody', + 'tr' + ) + ); + } + $ret .= $this->element('th', 'Allowed children', $attr); - $ret .= $this->element('td', ''.ucfirst($def->type).': ' . - $def->dtd_regex); + if ($def->type == 'chameleon') { - } else { - $ret .= $this->element('td', - ''.ucfirst($def->type).': ' . - $this->escape($this->listifyTagLookup($elements)),0,0); - } + $ret .= $this->element( + 'td', + 'Block: ' . + $this->escape($this->listifyTagLookup($def->block->elements)), + null, + 0 + ); + $ret .= $this->end('tr'); + $ret .= $this->start('tr'); + $ret .= $this->element( + 'td', + 'Inline: ' . + $this->escape($this->listifyTagLookup($def->inline->elements)), + null, + 0 + ); + + } elseif ($def->type == 'custom') { + + $ret .= $this->element( + 'td', + '' . ucfirst($def->type) . ': ' . + $def->dtd_regex + ); + + } else { + $ret .= $this->element( + 'td', + '' . ucfirst($def->type) . ': ' . + $this->escape($this->listifyTagLookup($elements)), + null, + 0 + ); + } $ret .= $this->end('tr'); return $ret; } /** * Listifies a tag lookup table. - * @param $array Tag lookup array in form of array('tagname' => true) + * @param array $array Tag lookup array in form of array('tagname' => true) + * @return string */ - protected function listifyTagLookup($array) { + protected function listifyTagLookup($array) + { ksort($array); $list = array(); foreach ($array as $name => $discard) { - if ($name !== '#PCDATA' && !isset($this->def->info[$name])) continue; + if ($name !== '#PCDATA' && !isset($this->def->info[$name])) { + continue; + } $list[] = $name; } return $this->listify($list); @@ -230,13 +273,15 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer /** * Listifies a list of objects by retrieving class names and internal state - * @param $array List of objects + * @param array $array List of objects + * @return string * @todo Also add information about internal state */ - protected function listifyObjectList($array) { + protected function listifyObjectList($array) + { ksort($array); $list = array(); - foreach ($array as $discard => $obj) { + foreach ($array as $obj) { $list[] = $this->getClass($obj, 'AttrTransform_'); } return $this->listify($list); @@ -244,13 +289,17 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer /** * Listifies a hash of attributes to AttrDef classes - * @param $array Array hash in form of array('attrname' => HTMLPurifier_AttrDef) + * @param array $array Array hash in form of array('attrname' => HTMLPurifier_AttrDef) + * @return string */ - protected function listifyAttr($array) { + protected function listifyAttr($array) + { ksort($array); $list = array(); foreach ($array as $name => $obj) { - if ($obj === false) continue; + if ($obj === false) { + continue; + } $list[] = "$name = " . $this->getClass($obj, 'AttrDef_') . ''; } return $this->listify($list); @@ -258,15 +307,18 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer /** * Creates a heavy header row + * @param string $text + * @param int $num + * @return string */ - protected function heavyHeader($text, $num = 1) { + protected function heavyHeader($text, $num = 1) + { $ret = ''; $ret .= $this->start('tr'); $ret .= $this->element('th', $text, array('colspan' => $num, 'class' => 'heavy')); $ret .= $this->end('tr'); return $ret; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyList.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyList.php index 2b99fb7bc3..189348fd9e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyList.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyList.php @@ -6,61 +6,93 @@ class HTMLPurifier_PropertyList { /** - * Internal data-structure for properties + * Internal data-structure for properties. + * @type array */ protected $data = array(); /** - * Parent plist + * Parent plist. + * @type HTMLPurifier_PropertyList */ protected $parent; + /** + * Cache. + * @type array + */ protected $cache; - public function __construct($parent = null) { + /** + * @param HTMLPurifier_PropertyList $parent Parent plist + */ + public function __construct($parent = null) + { $this->parent = $parent; } /** * Recursively retrieves the value for a key + * @param string $name + * @throws HTMLPurifier_Exception */ - public function get($name) { - if ($this->has($name)) return $this->data[$name]; + public function get($name) + { + if ($this->has($name)) { + return $this->data[$name]; + } // possible performance bottleneck, convert to iterative if necessary - if ($this->parent) return $this->parent->get($name); + if ($this->parent) { + return $this->parent->get($name); + } throw new HTMLPurifier_Exception("Key '$name' not found"); } /** * Sets the value of a key, for this plist + * @param string $name + * @param mixed $value */ - public function set($name, $value) { + public function set($name, $value) + { $this->data[$name] = $value; } /** * Returns true if a given key exists + * @param string $name + * @return bool */ - public function has($name) { + public function has($name) + { return array_key_exists($name, $this->data); } /** * Resets a value to the value of it's parent, usually the default. If * no value is specified, the entire plist is reset. + * @param string $name */ - public function reset($name = null) { - if ($name == null) $this->data = array(); - else unset($this->data[$name]); + public function reset($name = null) + { + if ($name == null) { + $this->data = array(); + } else { + unset($this->data[$name]); + } } /** * Squashes this property list and all of its property lists into a single * array, and returns the array. This value is cached by default. - * @param $force If true, ignores the cache and regenerates the array. + * @param bool $force If true, ignores the cache and regenerates the array. + * @return array */ - public function squash($force = false) { - if ($this->cache !== null && !$force) return $this->cache; + public function squash($force = false) + { + if ($this->cache !== null && !$force) { + return $this->cache; + } if ($this->parent) { return $this->cache = array_merge($this->parent->squash($force), $this->data); } else { @@ -70,15 +102,19 @@ class HTMLPurifier_PropertyList /** * Returns the parent plist. + * @return HTMLPurifier_PropertyList */ - public function getParent() { + public function getParent() + { return $this->parent; } /** * Sets the parent plist. + * @param HTMLPurifier_PropertyList $plist Parent plist */ - public function setParent($plist) { + public function setParent($plist) + { $this->parent = $plist; } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php index 8f250443e4..15b330ea30 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php @@ -6,27 +6,37 @@ class HTMLPurifier_PropertyListIterator extends FilterIterator { + /** + * @type int + */ protected $l; + /** + * @type string + */ protected $filter; /** - * @param $data Array of data to iterate over - * @param $filter Optional prefix to only allow values of + * @param Iterator $iterator Array of data to iterate over + * @param string $filter Optional prefix to only allow values of */ - public function __construct(Iterator $iterator, $filter = null) { + public function __construct(Iterator $iterator, $filter = null) + { parent::__construct($iterator); $this->l = strlen($filter); $this->filter = $filter; } - public function accept() { + /** + * @return bool + */ + public function accept() + { $key = $this->getInnerIterator()->key(); - if( strncmp($key, $this->filter, $this->l) !== 0 ) { + if (strncmp($key, $this->filter, $this->l) !== 0) { return false; } return true; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Queue.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Queue.php new file mode 100644 index 0000000000..f58db9042a --- /dev/null +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Queue.php @@ -0,0 +1,56 @@ +input = $input; + $this->output = array(); + } + + /** + * Shifts an element off the front of the queue. + */ + public function shift() { + if (empty($this->output)) { + $this->output = array_reverse($this->input); + $this->input = array(); + } + if (empty($this->output)) { + return NULL; + } + return array_pop($this->output); + } + + /** + * Pushes an element onto the front of the queue. + */ + public function push($x) { + array_push($this->input, $x); + } + + /** + * Checks if it's empty. + */ + public function isEmpty() { + return empty($this->input) && empty($this->output); + } +} diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy.php index 2462865210..e1ff3b72df 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy.php @@ -15,12 +15,12 @@ abstract class HTMLPurifier_Strategy /** * Executes the strategy on the tokens. * - * @param $tokens Array of HTMLPurifier_Token objects to be operated on. - * @param $config Configuration options - * @returns Processed array of token objects. + * @param HTMLPurifier_Token[] $tokens Array of HTMLPurifier_Token objects to be operated on. + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return HTMLPurifier_Token[] Processed array of token objects. */ abstract public function execute($tokens, $config, $context); - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/Composite.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/Composite.php index 92aefd33e2..d7d35ce7d1 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/Composite.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/Composite.php @@ -8,16 +8,23 @@ abstract class HTMLPurifier_Strategy_Composite extends HTMLPurifier_Strategy /** * List of strategies to run tokens through. + * @type HTMLPurifier_Strategy[] */ protected $strategies = array(); - public function execute($tokens, $config, $context) { + /** + * @param HTMLPurifier_Token[] $tokens + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return HTMLPurifier_Token[] + */ + public function execute($tokens, $config, $context) + { foreach ($this->strategies as $strategy) { $tokens = $strategy->execute($tokens, $config, $context); } return $tokens; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/Core.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/Core.php index d90e158606..4414c17d6e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/Core.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/Core.php @@ -5,14 +5,13 @@ */ class HTMLPurifier_Strategy_Core extends HTMLPurifier_Strategy_Composite { - - public function __construct() { + public function __construct() + { $this->strategies[] = new HTMLPurifier_Strategy_RemoveForeignElements(); $this->strategies[] = new HTMLPurifier_Strategy_MakeWellFormed(); $this->strategies[] = new HTMLPurifier_Strategy_FixNesting(); $this->strategies[] = new HTMLPurifier_Strategy_ValidateAttributes(); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/FixNesting.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/FixNesting.php index d1588b9382..6fa673db9a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/FixNesting.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/FixNesting.php @@ -10,12 +10,12 @@ * document type definitions, such as the chameleon nature of ins/del * tags and global child exclusions. * - * The first major objective of this strategy is to iterate through all the - * nodes (not tokens) of the list of tokens and determine whether or not - * their children conform to the element's definition. If they do not, the - * child definition may optionally supply an amended list of elements that - * is valid or require that the entire node be deleted (and the previous - * node rescanned). + * The first major objective of this strategy is to iterate through all + * the nodes and determine whether or not their children conform to the + * element's definition. If they do not, the child definition may + * optionally supply an amended list of elements that is valid or + * require that the entire node be deleted (and the previous node + * rescanned). * * The second objective is to ensure that explicitly excluded elements of * an element do not appear in its children. Code that accomplishes this @@ -25,43 +25,34 @@ * @note Whether or not unrecognized children are silently dropped or * translated into text depends on the child definitions. * - * @todo Enable nodes to be bubbled out of the structure. - * - * @warning This algorithm (though it may be hard to see) proceeds from - * a top-down fashion. Thus, parents are processed before - * children. This is easy to implement and has a nice effiency - * benefit, in that if a node is removed, we never waste any - * time processing it, but it also means that if a child - * changes in a non-encapsulated way (e.g. it is removed), we - * need to go back and reprocess the parent to see if those - * changes resulted in problems for the parent. See - * [BACKTRACK] for an example of this. In the current - * implementation, this backtracking can only be triggered when - * a node is removed and if that node was the sole node, the - * parent would need to be removed. As such, it is easy to see - * that backtracking only incurs constant overhead. If more - * sophisticated backtracking is implemented, care must be - * taken to avoid nontermination or exponential blowup. + * @todo Enable nodes to be bubbled out of the structure. This is + * easier with our new algorithm. */ class HTMLPurifier_Strategy_FixNesting extends HTMLPurifier_Strategy { - public function execute($tokens, $config, $context) { + /** + * @param HTMLPurifier_Token[] $tokens + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array|HTMLPurifier_Token[] + */ + public function execute($tokens, $config, $context) + { + //####################################################################// // Pre-processing + // O(n) pass to convert to a tree, so that we can efficiently + // refer to substrings + $top_node = HTMLPurifier_Arborize::arborize($tokens, $config, $context); + // get a copy of the HTML definition $definition = $config->getHTMLDefinition(); $excludes_enabled = !$config->get('Core.DisableExcludes'); - // insert implicit "parent" node, will be removed at end. - // DEFINITION CALL - $parent_name = $definition->info_parent; - array_unshift($tokens, new HTMLPurifier_Token_Start($parent_name)); - $tokens[] = new HTMLPurifier_Token_End($parent_name); - // setup the context variable 'IsInline', for chameleon processing // is 'false' when we are not inline, 'true' when it must always // be inline, and an integer when it is inline for a certain @@ -75,272 +66,116 @@ class HTMLPurifier_Strategy_FixNesting extends HTMLPurifier_Strategy //####################################################################// // Loop initialization - // stack that contains the indexes of all parents, - // $stack[count($stack)-1] being the current parent - $stack = array(); - // stack that contains all elements that are excluded // it is organized by parent elements, similar to $stack, // but it is only populated when an element with exclusions is // processed, i.e. there won't be empty exclusions. - $exclude_stack = array(); + $exclude_stack = array($definition->info_parent_def->excludes); // variable that contains the start token while we are processing // nodes. This enables error reporting to do its job - $start_token = false; - $context->register('CurrentToken', $start_token); + $node = $top_node; + // dummy token + list($token, $d) = $node->toTokenPair(); + $context->register('CurrentNode', $node); + $context->register('CurrentToken', $token); //####################################################################// // Loop - // iterate through all start nodes. Determining the start node - // is complicated so it has been omitted from the loop construct - for ($i = 0, $size = count($tokens) ; $i < $size; ) { - - //################################################################// - // Gather information on children - - // child token accumulator - $child_tokens = array(); - - // scroll to the end of this node, report number, and collect - // all children - for ($j = $i, $depth = 0; ; $j++) { - if ($tokens[$j] instanceof HTMLPurifier_Token_Start) { - $depth++; - // skip token assignment on first iteration, this is the - // token we currently are on - if ($depth == 1) continue; - } elseif ($tokens[$j] instanceof HTMLPurifier_Token_End) { - $depth--; - // skip token assignment on last iteration, this is the - // end token of the token we're currently on - if ($depth == 0) break; - } - $child_tokens[] = $tokens[$j]; - } - - // $i is index of start token - // $j is index of end token - - $start_token = $tokens[$i]; // to make token available via CurrentToken - - //################################################################// - // Gather information on parent - - // calculate parent information - if ($count = count($stack)) { - $parent_index = $stack[$count-1]; - $parent_name = $tokens[$parent_index]->name; - if ($parent_index == 0) { - $parent_def = $definition->info_parent_def; - } else { - $parent_def = $definition->info[$parent_name]; - } - } else { - // processing as if the parent were the "root" node - // unknown info, it won't be used anyway, in the future, - // we may want to enforce one element only (this is - // necessary for HTML Purifier to clean entire documents - $parent_index = $parent_name = $parent_def = null; - } - - // calculate context - if ($is_inline === false) { - // check if conditions make it inline - if (!empty($parent_def) && $parent_def->descendants_are_inline) { - $is_inline = $count - 1; + // We need to implement a post-order traversal iteratively, to + // avoid running into stack space limits. This is pretty tricky + // to reason about, so we just manually stack-ify the recursive + // variant: + // + // function f($node) { + // foreach ($node->children as $child) { + // f($child); + // } + // validate($node); + // } + // + // Thus, we will represent a stack frame as array($node, + // $is_inline, stack of children) + // e.g. array_reverse($node->children) - already processed + // children. + + $parent_def = $definition->info_parent_def; + $stack = array( + array($top_node, + $parent_def->descendants_are_inline, + $parent_def->excludes, // exclusions + 0) + ); + + while (!empty($stack)) { + list($node, $is_inline, $excludes, $ix) = array_pop($stack); + // recursive call + $go = false; + $def = empty($stack) ? $definition->info_parent_def : $definition->info[$node->name]; + while (isset($node->children[$ix])) { + $child = $node->children[$ix++]; + if ($child instanceof HTMLPurifier_Node_Element) { + $go = true; + $stack[] = array($node, $is_inline, $excludes, $ix); + $stack[] = array($child, + // ToDo: I don't think it matters if it's def or + // child_def, but double check this... + $is_inline || $def->descendants_are_inline, + empty($def->excludes) ? $excludes + : array_merge($excludes, $def->excludes), + 0); + break; } + }; + if ($go) continue; + list($token, $d) = $node->toTokenPair(); + // base case + if ($excludes_enabled && isset($excludes[$node->name])) { + $node->dead = true; + if ($e) $e->send(E_ERROR, 'Strategy_FixNesting: Node excluded'); } else { - // check if we're out of inline - if ($count === $is_inline) { - $is_inline = false; + // XXX I suppose it would be slightly more efficient to + // avoid the allocation here and have children + // strategies handle it + $children = array(); + foreach ($node->children as $child) { + if (!$child->dead) $children[] = $child; } - } - - //################################################################// - // Determine whether element is explicitly excluded SGML-style - - // determine whether or not element is excluded by checking all - // parent exclusions. The array should not be very large, two - // elements at most. - $excluded = false; - if (!empty($exclude_stack) && $excludes_enabled) { - foreach ($exclude_stack as $lookup) { - if (isset($lookup[$tokens[$i]->name])) { - $excluded = true; - // no need to continue processing - break; - } - } - } - - //################################################################// - // Perform child validation - - if ($excluded) { - // there is an exclusion, remove the entire node - $result = false; - $excludes = array(); // not used, but good to initialize anyway - } else { - // DEFINITION CALL - if ($i === 0) { - // special processing for the first node - $def = $definition->info_parent_def; + $result = $def->child->validateChildren($children, $config, $context); + if ($result === true) { + // nop + $node->children = $children; + } elseif ($result === false) { + $node->dead = true; + if ($e) $e->send(E_ERROR, 'Strategy_FixNesting: Node removed'); } else { - $def = $definition->info[$tokens[$i]->name]; - - } - - if (!empty($def->child)) { - // have DTD child def validate children - $result = $def->child->validateChildren( - $child_tokens, $config, $context); - } else { - // weird, no child definition, get rid of everything - $result = false; - } - - // determine whether or not this element has any exclusions - $excludes = $def->excludes; - } - - // $result is now a bool or array - - //################################################################// - // Process result by interpreting $result - - if ($result === true || $child_tokens === $result) { - // leave the node as is - - // register start token as a parental node start - $stack[] = $i; - - // register exclusions if there are any - if (!empty($excludes)) $exclude_stack[] = $excludes; - - // move cursor to next possible start node - $i++; - - } elseif($result === false) { - // remove entire node - - if ($e) { - if ($excluded) { - $e->send(E_ERROR, 'Strategy_FixNesting: Node excluded'); - } else { - $e->send(E_ERROR, 'Strategy_FixNesting: Node removed'); - } - } - - // calculate length of inner tokens and current tokens - $length = $j - $i + 1; - - // perform removal - array_splice($tokens, $i, $length); - - // update size - $size -= $length; - - // there is no start token to register, - // current node is now the next possible start node - // unless it turns out that we need to do a double-check - - // this is a rought heuristic that covers 100% of HTML's - // cases and 99% of all other cases. A child definition - // that would be tricked by this would be something like: - // ( | a b c) where it's all or nothing. Fortunately, - // our current implementation claims that that case would - // not allow empty, even if it did - if (!$parent_def->child->allow_empty) { - // we need to do a double-check [BACKTRACK] - $i = $parent_index; - array_pop($stack); - } - - // PROJECTED OPTIMIZATION: Process all children elements before - // reprocessing parent node. - - } else { - // replace node with $result - - // calculate length of inner tokens - $length = $j - $i - 1; - - if ($e) { - if (empty($result) && $length) { - $e->send(E_ERROR, 'Strategy_FixNesting: Node contents removed'); - } else { - $e->send(E_WARNING, 'Strategy_FixNesting: Node reorganized'); - } - } - - // perform replacement - array_splice($tokens, $i + 1, $length, $result); - - // update size - $size -= $length; - $size += count($result); - - // register start token as a parental node start - $stack[] = $i; - - // register exclusions if there are any - if (!empty($excludes)) $exclude_stack[] = $excludes; - - // move cursor to next possible start node - $i++; - - } - - //################################################################// - // Scroll to next start node - - // We assume, at this point, that $i is the index of the token - // that is the first possible new start point for a node. - - // Test if the token indeed is a start tag, if not, move forward - // and test again. - $size = count($tokens); - while ($i < $size and !$tokens[$i] instanceof HTMLPurifier_Token_Start) { - if ($tokens[$i] instanceof HTMLPurifier_Token_End) { - // pop a token index off the stack if we ended a node - array_pop($stack); - // pop an exclusion lookup off exclusion stack if - // we ended node and that node had exclusions - if ($i == 0 || $i == $size - 1) { - // use specialized var if it's the super-parent - $s_excludes = $definition->info_parent_def->excludes; - } else { - $s_excludes = $definition->info[$tokens[$i]->name]->excludes; - } - if ($s_excludes) { - array_pop($exclude_stack); + $node->children = $result; + if ($e) { + // XXX This will miss mutations of internal nodes. Perhaps defer to the child validators + if (empty($result) && !empty($children)) { + $e->send(E_ERROR, 'Strategy_FixNesting: Node contents removed'); + } else if ($result != $children) { + $e->send(E_WARNING, 'Strategy_FixNesting: Node reorganized'); + } } } - $i++; } - } //####################################################################// // Post-processing - // remove implicit parent tokens at the beginning and end - array_shift($tokens); - array_pop($tokens); - // remove context variables $context->destroy('IsInline'); + $context->destroy('CurrentNode'); $context->destroy('CurrentToken'); //####################################################################// // Return - return $tokens; - + return HTMLPurifier_Arborize::flatten($node, $config, $context); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/MakeWellFormed.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/MakeWellFormed.php index c7aa1bb86d..e389e00116 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/MakeWellFormed.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/MakeWellFormed.php @@ -16,66 +16,83 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy /** * Array stream of tokens being processed. + * @type HTMLPurifier_Token[] */ protected $tokens; /** - * Current index in $tokens. + * Current token. + * @type HTMLPurifier_Token */ - protected $t; + protected $token; + + /** + * Zipper managing the true state. + * @type HTMLPurifier_Zipper + */ + protected $zipper; /** * Current nesting of elements. + * @type array */ protected $stack; /** * Injectors active in this stream processing. + * @type HTMLPurifier_Injector[] */ protected $injectors; /** * Current instance of HTMLPurifier_Config. + * @type HTMLPurifier_Config */ protected $config; /** * Current instance of HTMLPurifier_Context. + * @type HTMLPurifier_Context */ protected $context; - public function execute($tokens, $config, $context) { - + /** + * @param HTMLPurifier_Token[] $tokens + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return HTMLPurifier_Token[] + * @throws HTMLPurifier_Exception + */ + public function execute($tokens, $config, $context) + { $definition = $config->getHTMLDefinition(); // local variables $generator = new HTMLPurifier_Generator($config, $context); $escape_invalid_tags = $config->get('Core.EscapeInvalidTags'); // used for autoclose early abortion - $global_parent_allowed_elements = array(); - if (isset($definition->info[$definition->info_parent])) { - // may be unset under testing circumstances - $global_parent_allowed_elements = $definition->info[$definition->info_parent]->child->getAllowedElements($config); - } + $global_parent_allowed_elements = $definition->info_parent_def->child->getAllowedElements($config); $e = $context->get('ErrorCollector', true); - $t = false; // token index $i = false; // injector index - $token = false; // the current token - $reprocess = false; // whether or not to reprocess the same token + list($zipper, $token) = HTMLPurifier_Zipper::fromArray($tokens); + if ($token === NULL) { + return array(); + } + $reprocess = false; // whether or not to reprocess the same token $stack = array(); // member variables - $this->stack =& $stack; - $this->t =& $t; - $this->tokens =& $tokens; - $this->config = $config; + $this->stack =& $stack; + $this->tokens =& $tokens; + $this->token =& $token; + $this->zipper =& $zipper; + $this->config = $config; $this->context = $context; // context variables $context->register('CurrentNesting', $stack); - $context->register('InputIndex', $t); - $context->register('InputTokens', $tokens); - $context->register('CurrentToken', $token); + $context->register('InputZipper', $zipper); + $context->register('CurrentToken', $token); // -- begin INJECTOR -- @@ -87,9 +104,13 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy unset($injectors['Custom']); // special case foreach ($injectors as $injector => $b) { // XXX: Fix with a legitimate lookup table of enabled filters - if (strpos($injector, '.') !== false) continue; + if (strpos($injector, '.') !== false) { + continue; + } $injector = "HTMLPurifier_Injector_$injector"; - if (!$b) continue; + if (!$b) { + continue; + } $this->injectors[] = new $injector; } foreach ($def_injectors as $injector) { @@ -97,7 +118,9 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy $this->injectors[] = $injector; } foreach ($custom_injectors as $injector) { - if (!$injector) continue; + if (!$injector) { + continue; + } if (is_string($injector)) { $injector = "HTMLPurifier_Injector_$injector"; $injector = new $injector; @@ -109,7 +132,9 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy // variables for performance reasons foreach ($this->injectors as $ix => $injector) { $error = $injector->prepare($config, $context); - if (!$error) continue; + if (!$error) { + continue; + } array_splice($this->injectors, $ix, 1); // rm the injector trigger_error("Cannot enable {$injector->name} injector because $error is not allowed", E_USER_WARNING); } @@ -125,39 +150,40 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy // punt ($reprocess = true; continue;) and it does that for us. // isset is in loop because $tokens size changes during loop exec - for ( - $t = 0; - $t == 0 || isset($tokens[$t - 1]); - // only increment if we don't need to reprocess - $reprocess ? $reprocess = false : $t++ - ) { + for (;; + // only increment if we don't need to reprocess + $reprocess ? $reprocess = false : $token = $zipper->next($token)) { // check for a rewind - if (is_int($i) && $i >= 0) { + if (is_int($i)) { // possibility: disable rewinding if the current token has a // rewind set on it already. This would offer protection from // infinite loop, but might hinder some advanced rewinding. - $rewind_to = $this->injectors[$i]->getRewind(); - if (is_int($rewind_to) && $rewind_to < $t) { - if ($rewind_to < 0) $rewind_to = 0; - while ($t > $rewind_to) { - $t--; - $prev = $tokens[$t]; + $rewind_offset = $this->injectors[$i]->getRewindOffset(); + if (is_int($rewind_offset)) { + for ($j = 0; $j < $rewind_offset; $j++) { + if (empty($zipper->front)) break; + $token = $zipper->prev($token); // indicate that other injectors should not process this token, // but we need to reprocess it - unset($prev->skip[$i]); - $prev->rewind = $i; - if ($prev instanceof HTMLPurifier_Token_Start) array_pop($this->stack); - elseif ($prev instanceof HTMLPurifier_Token_End) $this->stack[] = $prev->start; + unset($token->skip[$i]); + $token->rewind = $i; + if ($token instanceof HTMLPurifier_Token_Start) { + array_pop($this->stack); + } elseif ($token instanceof HTMLPurifier_Token_End) { + $this->stack[] = $token->start; + } } } $i = false; } // handle case of document end - if (!isset($tokens[$t])) { + if ($token === NULL) { // kill processing if stack is empty - if (empty($this->stack)) break; + if (empty($this->stack)) { + break; + } // peek $top_nesting = array_pop($this->stack); @@ -169,26 +195,30 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy } // append, don't splice, since this is the end - $tokens[] = new HTMLPurifier_Token_End($top_nesting->name); + $token = new HTMLPurifier_Token_End($top_nesting->name); // punt! $reprocess = true; continue; } - $token = $tokens[$t]; - - //echo '
'; printTokens($tokens, $t); printTokens($this->stack); + //echo '
'; printZipper($zipper, $token);//printTokens($this->stack); //flush(); // quick-check: if it's not a tag, no need to process if (empty($token->is_tag)) { if ($token instanceof HTMLPurifier_Token_Text) { foreach ($this->injectors as $i => $injector) { - if (isset($token->skip[$i])) continue; - if ($token->rewind !== null && $token->rewind !== $i) continue; - $injector->handleText($token); - $this->processToken($token, $i); + if (isset($token->skip[$i])) { + continue; + } + if ($token->rewind !== null && $token->rewind !== $i) { + continue; + } + // XXX fuckup + $r = $token; + $injector->handleText($r); + $token = $this->processToken($r, $i); $reprocess = true; break; } @@ -207,12 +237,22 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy $ok = false; if ($type === 'empty' && $token instanceof HTMLPurifier_Token_Start) { // claims to be a start tag but is empty - $token = new HTMLPurifier_Token_Empty($token->name, $token->attr, $token->line, $token->col, $token->armor); + $token = new HTMLPurifier_Token_Empty( + $token->name, + $token->attr, + $token->line, + $token->col, + $token->armor + ); $ok = true; } elseif ($type && $type !== 'empty' && $token instanceof HTMLPurifier_Token_Empty) { // claims to be empty but really is a start tag - $this->swap(new HTMLPurifier_Token_End($token->name)); - $this->insertBefore(new HTMLPurifier_Token_Start($token->name, $token->attr, $token->line, $token->col, $token->armor)); + // NB: this assignment is required + $old_token = $token; + $token = new HTMLPurifier_Token_End($token->name); + $token = $this->insertBefore( + new HTMLPurifier_Token_Start($old_token->name, $old_token->attr, $old_token->line, $old_token->col, $old_token->armor) + ); // punt (since we had to modify the input stream in a non-trivial way) $reprocess = true; continue; @@ -241,31 +281,32 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy $parent = array_pop($this->stack); $this->stack[] = $parent; + $parent_def = null; + $parent_elements = null; + $autoclose = false; if (isset($definition->info[$parent->name])) { - $elements = $definition->info[$parent->name]->child->getAllowedElements($config); - $autoclose = !isset($elements[$token->name]); - } else { - $autoclose = false; + $parent_def = $definition->info[$parent->name]; + $parent_elements = $parent_def->child->getAllowedElements($config); + $autoclose = !isset($parent_elements[$token->name]); } if ($autoclose && $definition->info[$token->name]->wrap) { - // Check if an element can be wrapped by another - // element to make it valid in a context (for + // Check if an element can be wrapped by another + // element to make it valid in a context (for // example,
      needs a
    • in between) $wrapname = $definition->info[$token->name]->wrap; $wrapdef = $definition->info[$wrapname]; $elements = $wrapdef->child->getAllowedElements($config); - $parent_elements = $definition->info[$parent->name]->child->getAllowedElements($config); if (isset($elements[$token->name]) && isset($parent_elements[$wrapname])) { $newtoken = new HTMLPurifier_Token_Start($wrapname); - $this->insertBefore($newtoken); + $token = $this->insertBefore($newtoken); $reprocess = true; continue; } } $carryover = false; - if ($autoclose && $definition->info[$parent->name]->formatting) { + if ($autoclose && $parent_def->formatting) { $carryover = true; } @@ -295,15 +336,6 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy // errors need to be updated $new_token = new HTMLPurifier_Token_End($parent->name); $new_token->start = $parent; - if ($carryover) { - $element = clone $parent; - // [TagClosedAuto] - $element->armor['MakeWellFormed_TagClosedError'] = true; - $element->carryover = true; - $this->processToken(array($new_token, $token, $element)); - } else { - $this->insertBefore($new_token); - } // [TagClosedSuppress] if ($e && !isset($parent->armor['MakeWellFormed_TagClosedError'])) { if (!$carryover) { @@ -312,8 +344,17 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy $e->send(E_NOTICE, 'Strategy_MakeWellFormed: Tag carryover', $parent); } } + if ($carryover) { + $element = clone $parent; + // [TagClosedAuto] + $element->armor['MakeWellFormed_TagClosedError'] = true; + $element->carryover = true; + $token = $this->processToken(array($new_token, $token, $element)); + } else { + $token = $this->insertBefore($new_token); + } } else { - $this->remove(); + $token = $this->remove(); } $reprocess = true; continue; @@ -325,20 +366,26 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy if ($ok) { foreach ($this->injectors as $i => $injector) { - if (isset($token->skip[$i])) continue; - if ($token->rewind !== null && $token->rewind !== $i) continue; - $injector->handleElement($token); - $this->processToken($token, $i); + if (isset($token->skip[$i])) { + continue; + } + if ($token->rewind !== null && $token->rewind !== $i) { + continue; + } + $r = $token; + $injector->handleElement($r); + $token = $this->processToken($r, $i); $reprocess = true; break; } if (!$reprocess) { // ah, nothing interesting happened; do normal processing - $this->swap($token); if ($token instanceof HTMLPurifier_Token_Start) { $this->stack[] = $token; } elseif ($token instanceof HTMLPurifier_Token_End) { - throw new HTMLPurifier_Exception('Improper handling of end tag in start code; possible error in MakeWellFormed'); + throw new HTMLPurifier_Exception( + 'Improper handling of end tag in start code; possible error in MakeWellFormed' + ); } } continue; @@ -352,13 +399,15 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy // make sure that we have something open if (empty($this->stack)) { if ($escape_invalid_tags) { - if ($e) $e->send(E_WARNING, 'Strategy_MakeWellFormed: Unnecessary end tag to text'); - $this->swap(new HTMLPurifier_Token_Text( - $generator->generateFromToken($token) - )); + if ($e) { + $e->send(E_WARNING, 'Strategy_MakeWellFormed: Unnecessary end tag to text'); + } + $token = new HTMLPurifier_Token_Text($generator->generateFromToken($token)); } else { - $this->remove(); - if ($e) $e->send(E_WARNING, 'Strategy_MakeWellFormed: Unnecessary end tag removed'); + if ($e) { + $e->send(E_WARNING, 'Strategy_MakeWellFormed: Unnecessary end tag removed'); + } + $token = $this->remove(); } $reprocess = true; continue; @@ -372,10 +421,15 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy if ($current_parent->name == $token->name) { $token->start = $current_parent; foreach ($this->injectors as $i => $injector) { - if (isset($token->skip[$i])) continue; - if ($token->rewind !== null && $token->rewind !== $i) continue; - $injector->handleEnd($token); - $this->processToken($token, $i); + if (isset($token->skip[$i])) { + continue; + } + if ($token->rewind !== null && $token->rewind !== $i) { + continue; + } + $r = $token; + $injector->handleEnd($r); + $token = $this->processToken($r, $i); $this->stack[] = $current_parent; $reprocess = true; break; @@ -403,13 +457,15 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy // we didn't find the tag, so remove if ($skipped_tags === false) { if ($escape_invalid_tags) { - $this->swap(new HTMLPurifier_Token_Text( - $generator->generateFromToken($token) - )); - if ($e) $e->send(E_WARNING, 'Strategy_MakeWellFormed: Stray end tag to text'); + if ($e) { + $e->send(E_WARNING, 'Strategy_MakeWellFormed: Stray end tag to text'); + } + $token = new HTMLPurifier_Token_Text($generator->generateFromToken($token)); } else { - $this->remove(); - if ($e) $e->send(E_WARNING, 'Strategy_MakeWellFormed: Stray end tag removed'); + if ($e) { + $e->send(E_WARNING, 'Strategy_MakeWellFormed: Stray end tag removed'); + } + $token = $this->remove(); } $reprocess = true; continue; @@ -442,18 +498,17 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy $replace[] = $element; } } - $this->processToken($replace); + $token = $this->processToken($replace); $reprocess = true; continue; } - $context->destroy('CurrentNesting'); - $context->destroy('InputTokens'); - $context->destroy('InputIndex'); $context->destroy('CurrentToken'); + $context->destroy('CurrentNesting'); + $context->destroy('InputZipper'); - unset($this->injectors, $this->stack, $this->tokens, $this->t); - return $tokens; + unset($this->injectors, $this->stack, $this->tokens); + return $zipper->toArray($token); } /** @@ -472,25 +527,38 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy * If $token is an integer, that number of tokens (with the first token * being the current one) will be deleted. * - * @param $token Token substitution value - * @param $injector Injector that performed the substitution; default is if + * @param HTMLPurifier_Token|array|int|bool $token Token substitution value + * @param HTMLPurifier_Injector|int $injector Injector that performed the substitution; default is if * this is not an injector related operation. + * @throws HTMLPurifier_Exception */ - protected function processToken($token, $injector = -1) { - + protected function processToken($token, $injector = -1) + { // normalize forms of token - if (is_object($token)) $token = array(1, $token); - if (is_int($token)) $token = array($token); - if ($token === false) $token = array(1); - if (!is_array($token)) throw new HTMLPurifier_Exception('Invalid token type from injector'); - if (!is_int($token[0])) array_unshift($token, 1); - if ($token[0] === 0) throw new HTMLPurifier_Exception('Deleting zero tokens is not valid'); + if (is_object($token)) { + $token = array(1, $token); + } + if (is_int($token)) { + $token = array($token); + } + if ($token === false) { + $token = array(1); + } + if (!is_array($token)) { + throw new HTMLPurifier_Exception('Invalid token type from injector'); + } + if (!is_int($token[0])) { + array_unshift($token, 1); + } + if ($token[0] === 0) { + throw new HTMLPurifier_Exception('Deleting zero tokens is not valid'); + } // $token is now an array with the following form: // array(number nodes to delete, new node 1, new node 2, ...) $delete = array_shift($token); - $old = array_splice($this->tokens, $this->t, $delete, $token); + list($old, $r) = $this->zipper->splice($this->token, $delete, $token); if ($injector > -1) { // determine appropriate skips @@ -501,32 +569,32 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy } } + return $r; + } /** * Inserts a token before the current token. Cursor now points to * this token. You must reprocess after this. + * @param HTMLPurifier_Token $token */ - private function insertBefore($token) { - array_splice($this->tokens, $this->t, 0, array($token)); + private function insertBefore($token) + { + // NB not $this->zipper->insertBefore(), due to positioning + // differences + $splice = $this->zipper->splice($this->token, 0, array($token)); + + return $splice[1]; } /** * Removes current token. Cursor now points to new token occupying previously * occupied space. You must reprocess after this. */ - private function remove() { - array_splice($this->tokens, $this->t, 1); - } - - /** - * Swap current token with new token. Cursor points to new token (no - * change). You must reprocess after this. - */ - private function swap($token) { - $this->tokens[$this->t] = $token; + private function remove() + { + return $this->zipper->delete(); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/RemoveForeignElements.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/RemoveForeignElements.php index bccaf14d3c..1a8149eccb 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/RemoveForeignElements.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/RemoveForeignElements.php @@ -11,13 +11,20 @@ class HTMLPurifier_Strategy_RemoveForeignElements extends HTMLPurifier_Strategy { - public function execute($tokens, $config, $context) { + /** + * @param HTMLPurifier_Token[] $tokens + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array|HTMLPurifier_Token[] + */ + public function execute($tokens, $config, $context) + { $definition = $config->getHTMLDefinition(); $generator = new HTMLPurifier_Generator($config, $context); $result = array(); $escape_invalid_tags = $config->get('Core.EscapeInvalidTags'); - $remove_invalid_img = $config->get('Core.RemoveInvalidImg'); + $remove_invalid_img = $config->get('Core.RemoveInvalidImg'); // currently only used to determine if comments should be kept $trusted = $config->get('HTML.Trusted'); @@ -26,7 +33,7 @@ class HTMLPurifier_Strategy_RemoveForeignElements extends HTMLPurifier_Strategy $check_comments = $comment_lookup !== array() || $comment_regexp !== null; $remove_script_contents = $config->get('Core.RemoveScriptContents'); - $hidden_elements = $config->get('Core.HiddenElements'); + $hidden_elements = $config->get('Core.HiddenElements'); // remove script contents compatibility if ($remove_script_contents === true) { @@ -51,34 +58,31 @@ class HTMLPurifier_Strategy_RemoveForeignElements extends HTMLPurifier_Strategy $e =& $context->get('ErrorCollector'); } - foreach($tokens as $token) { + foreach ($tokens as $token) { if ($remove_until) { if (empty($token->is_tag) || $token->name !== $remove_until) { continue; } } - if (!empty( $token->is_tag )) { + if (!empty($token->is_tag)) { // DEFINITION CALL // before any processing, try to transform the element - if ( - isset($definition->info_tag_transform[$token->name]) - ) { + if (isset($definition->info_tag_transform[$token->name])) { $original_name = $token->name; // there is a transformation for this tag // DEFINITION CALL $token = $definition-> - info_tag_transform[$token->name]-> - transform($token, $config, $context); - if ($e) $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Tag transform', $original_name); + info_tag_transform[$token->name]->transform($token, $config, $context); + if ($e) { + $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Tag transform', $original_name); + } } if (isset($definition->info[$token->name])) { - // mostly everything's good, but // we need to make sure required attributes are in order - if ( - ($token instanceof HTMLPurifier_Token_Start || $token instanceof HTMLPurifier_Token_Empty) && + if (($token instanceof HTMLPurifier_Token_Start || $token instanceof HTMLPurifier_Token_Empty) && $definition->info[$token->name]->required_attr && ($token->name != 'img' || $remove_invalid_img) // ensure config option still works ) { @@ -91,7 +95,13 @@ class HTMLPurifier_Strategy_RemoveForeignElements extends HTMLPurifier_Strategy } } if (!$ok) { - if ($e) $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Missing required attribute', $name); + if ($e) { + $e->send( + E_ERROR, + 'Strategy_RemoveForeignElements: Missing required attribute', + $name + ); + } continue; } $token->armor['ValidateAttributes'] = true; @@ -105,7 +115,9 @@ class HTMLPurifier_Strategy_RemoveForeignElements extends HTMLPurifier_Strategy } elseif ($escape_invalid_tags) { // invalid tag, generate HTML representation and insert in - if ($e) $e->send(E_WARNING, 'Strategy_RemoveForeignElements: Foreign element to text'); + if ($e) { + $e->send(E_WARNING, 'Strategy_RemoveForeignElements: Foreign element to text'); + } $token = new HTMLPurifier_Token_Text( $generator->generateFromToken($token) ); @@ -120,9 +132,13 @@ class HTMLPurifier_Strategy_RemoveForeignElements extends HTMLPurifier_Strategy } else { $remove_until = false; } - if ($e) $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Foreign meta element removed'); + if ($e) { + $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Foreign meta element removed'); + } } else { - if ($e) $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Foreign element removed'); + if ($e) { + $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Foreign element removed'); + } } continue; } @@ -146,11 +162,15 @@ class HTMLPurifier_Strategy_RemoveForeignElements extends HTMLPurifier_Strategy $found_double_hyphen = true; $token->data = str_replace('--', '-', $token->data); } - if ($trusted || !empty($comment_lookup[trim($token->data)]) || ($comment_regexp !== NULL && preg_match($comment_regexp, trim($token->data)))) { + if ($trusted || !empty($comment_lookup[trim($token->data)]) || + ($comment_regexp !== null && preg_match($comment_regexp, trim($token->data)))) { // OK good if ($e) { if ($trailing_hyphen) { - $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Trailing hyphen in comment removed'); + $e->send( + E_NOTICE, + 'Strategy_RemoveForeignElements: Trailing hyphen in comment removed' + ); } if ($found_double_hyphen) { $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Hyphens in comment collapsed'); @@ -164,7 +184,9 @@ class HTMLPurifier_Strategy_RemoveForeignElements extends HTMLPurifier_Strategy } } else { // strip comments - if ($e) $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Comment removed'); + if ($e) { + $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Comment removed'); + } continue; } } elseif ($token instanceof HTMLPurifier_Token_Text) { @@ -177,12 +199,9 @@ class HTMLPurifier_Strategy_RemoveForeignElements extends HTMLPurifier_Strategy // we removed tokens until the end, throw error $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Token removed to end', $remove_until); } - $context->destroy('CurrentToken'); - return $result; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/ValidateAttributes.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/ValidateAttributes.php index c3328a9d44..fbb3d27c81 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/ValidateAttributes.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/ValidateAttributes.php @@ -7,8 +7,14 @@ class HTMLPurifier_Strategy_ValidateAttributes extends HTMLPurifier_Strategy { - public function execute($tokens, $config, $context) { - + /** + * @param HTMLPurifier_Token[] $tokens + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return HTMLPurifier_Token[] + */ + public function execute($tokens, $config, $context) + { // setup validator $validator = new HTMLPurifier_AttrValidator(); @@ -19,21 +25,21 @@ class HTMLPurifier_Strategy_ValidateAttributes extends HTMLPurifier_Strategy // only process tokens that have attributes, // namely start and empty tags - if (!$token instanceof HTMLPurifier_Token_Start && !$token instanceof HTMLPurifier_Token_Empty) continue; + if (!$token instanceof HTMLPurifier_Token_Start && !$token instanceof HTMLPurifier_Token_Empty) { + continue; + } // skip tokens that are armored - if (!empty($token->armor['ValidateAttributes'])) continue; + if (!empty($token->armor['ValidateAttributes'])) { + continue; + } // note that we have no facilities here for removing tokens $validator->validateToken($token, $config, $context); - - $tokens[$key] = $token; // for PHP 4 } $context->destroy('CurrentToken'); - return $tokens; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHash.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHash.php index 62085c5c2f..c07370197a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHash.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHash.php @@ -10,28 +10,36 @@ */ class HTMLPurifier_StringHash extends ArrayObject { + /** + * @type array + */ protected $accessed = array(); /** * Retrieves a value, and logs the access. + * @param mixed $index + * @return mixed */ - public function offsetGet($index) { + public function offsetGet($index) + { $this->accessed[$index] = true; return parent::offsetGet($index); } /** * Returns a lookup array of all array indexes that have been accessed. - * @return Array in form array($index => true). + * @return array in form array($index => true). */ - public function getAccessed() { + public function getAccessed() + { return $this->accessed; } /** * Resets the access array. */ - public function resetAccessed() { + public function resetAccessed() + { $this->accessed = array(); } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHashParser.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHashParser.php index f3e70c712f..7c73f80835 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHashParser.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHashParser.php @@ -28,15 +28,25 @@ class HTMLPurifier_StringHashParser { + /** + * @type string + */ public $default = 'ID'; /** * Parses a file that contains a single string-hash. + * @param string $file + * @return array */ - public function parseFile($file) { - if (!file_exists($file)) return false; + public function parseFile($file) + { + if (!file_exists($file)) { + return false; + } $fh = fopen($file, 'r'); - if (!$fh) return false; + if (!$fh) { + return false; + } $ret = $this->parseHandle($fh); fclose($fh); return $ret; @@ -44,12 +54,19 @@ class HTMLPurifier_StringHashParser /** * Parses a file that contains multiple string-hashes delimited by '----' + * @param string $file + * @return array */ - public function parseMultiFile($file) { - if (!file_exists($file)) return false; + public function parseMultiFile($file) + { + if (!file_exists($file)) { + return false; + } $ret = array(); $fh = fopen($file, 'r'); - if (!$fh) return false; + if (!$fh) { + return false; + } while (!feof($fh)) { $ret[] = $this->parseHandle($fh); } @@ -62,26 +79,36 @@ class HTMLPurifier_StringHashParser * @note While it's possible to simulate in-memory parsing by using * custom stream wrappers, if such a use-case arises we should * factor out the file handle into its own class. - * @param $fh File handle with pointer at start of valid string-hash + * @param resource $fh File handle with pointer at start of valid string-hash * block. + * @return array */ - protected function parseHandle($fh) { + protected function parseHandle($fh) + { $state = false; $single = false; $ret = array(); do { $line = fgets($fh); - if ($line === false) break; + if ($line === false) { + break; + } $line = rtrim($line, "\n\r"); - if (!$state && $line === '') continue; - if ($line === '----') break; + if (!$state && $line === '') { + continue; + } + if ($line === '----') { + break; + } if (strncmp('--#', $line, 3) === 0) { // Comment continue; } elseif (strncmp('--', $line, 2) === 0) { // Multiline declaration $state = trim($line, '- '); - if (!isset($ret[$state])) $ret[$state] = ''; + if (!isset($ret[$state])) { + $ret[$state] = ''; + } continue; } elseif (!$state) { $single = true; @@ -104,7 +131,6 @@ class HTMLPurifier_StringHashParser } while (!feof($fh)); return $ret; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform.php index 210a447217..7b8d833433 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform.php @@ -8,14 +8,15 @@ abstract class HTMLPurifier_TagTransform /** * Tag name to transform the tag to. + * @type string */ public $transform_to; /** * Transforms the obsolete tag into the valid tag. - * @param $tag Tag to be transformed. - * @param $config Mandatory HTMLPurifier_Config object - * @param $context Mandatory HTMLPurifier_Context object + * @param HTMLPurifier_Token_Tag $tag Tag to be transformed. + * @param HTMLPurifier_Config $config Mandatory HTMLPurifier_Config object + * @param HTMLPurifier_Context $context Mandatory HTMLPurifier_Context object */ abstract public function transform($tag, $config, $context); @@ -23,14 +24,14 @@ abstract class HTMLPurifier_TagTransform * Prepends CSS properties to the style attribute, creating the * attribute if it doesn't exist. * @warning Copied over from AttrTransform, be sure to keep in sync - * @param $attr Attribute array to process (passed by reference) - * @param $css CSS to prepend + * @param array $attr Attribute array to process (passed by reference) + * @param string $css CSS to prepend */ - protected function prependCSS(&$attr, $css) { + protected function prependCSS(&$attr, $css) + { $attr['style'] = isset($attr['style']) ? $attr['style'] : ''; $attr['style'] = $css . $attr['style']; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform/Font.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform/Font.php index 9db2db7950..7853d90bc6 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform/Font.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform/Font.php @@ -17,9 +17,14 @@ */ class HTMLPurifier_TagTransform_Font extends HTMLPurifier_TagTransform { - + /** + * @type string + */ public $transform_to = 'span'; + /** + * @type array + */ protected $_size_lookup = array( '0' => 'xx-small', '1' => 'xx-small', @@ -37,8 +42,14 @@ class HTMLPurifier_TagTransform_Font extends HTMLPurifier_TagTransform '+4' => '300%' ); - public function transform($tag, $config, $context) { - + /** + * @param HTMLPurifier_Token_Tag $tag + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return HTMLPurifier_Token_End|string + */ + public function transform($tag, $config, $context) + { if ($tag instanceof HTMLPurifier_Token_End) { $new_tag = clone $tag; $new_tag->name = $this->transform_to; @@ -65,17 +76,23 @@ class HTMLPurifier_TagTransform_Font extends HTMLPurifier_TagTransform // normalize large numbers if ($attr['size'] !== '') { if ($attr['size']{0} == '+' || $attr['size']{0} == '-') { - $size = (int) $attr['size']; - if ($size < -2) $attr['size'] = '-2'; - if ($size > 4) $attr['size'] = '+4'; + $size = (int)$attr['size']; + if ($size < -2) { + $attr['size'] = '-2'; + } + if ($size > 4) { + $attr['size'] = '+4'; + } } else { - $size = (int) $attr['size']; - if ($size > 7) $attr['size'] = '7'; + $size = (int)$attr['size']; + if ($size > 7) { + $attr['size'] = '7'; + } } } if (isset($this->_size_lookup[$attr['size']])) { $prepend_style .= 'font-size:' . - $this->_size_lookup[$attr['size']] . ';'; + $this->_size_lookup[$attr['size']] . ';'; } unset($attr['size']); } @@ -91,7 +108,6 @@ class HTMLPurifier_TagTransform_Font extends HTMLPurifier_TagTransform $new_tag->attr = $attr; return $new_tag; - } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform/Simple.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform/Simple.php index 0e36130f25..71bf10b91f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform/Simple.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform/Simple.php @@ -7,19 +7,29 @@ */ class HTMLPurifier_TagTransform_Simple extends HTMLPurifier_TagTransform { - + /** + * @type string + */ protected $style; /** - * @param $transform_to Tag name to transform to. - * @param $style CSS style to add to the tag + * @param string $transform_to Tag name to transform to. + * @param string $style CSS style to add to the tag */ - public function __construct($transform_to, $style = null) { + public function __construct($transform_to, $style = null) + { $this->transform_to = $transform_to; $this->style = $style; } - public function transform($tag, $config, $context) { + /** + * @param HTMLPurifier_Token_Tag $tag + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string + */ + public function transform($tag, $config, $context) + { $new_tag = clone $tag; $new_tag->name = $this->transform_to; if (!is_null($this->style) && @@ -29,7 +39,6 @@ class HTMLPurifier_TagTransform_Simple extends HTMLPurifier_TagTransform } return $new_tag; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token.php index 7900e6cb10..85b85e072d 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token.php @@ -3,55 +3,98 @@ /** * Abstract base token class that all others inherit from. */ -class HTMLPurifier_Token { - public $line; /**< Line number node was on in source document. Null if unknown. */ - public $col; /**< Column of line node was on in source document. Null if unknown. */ +abstract class HTMLPurifier_Token +{ + /** + * Line number node was on in source document. Null if unknown. + * @type int + */ + public $line; + + /** + * Column of line node was on in source document. Null if unknown. + * @type int + */ + public $col; /** * Lookup array of processing that this token is exempt from. * Currently, valid values are "ValidateAttributes" and * "MakeWellFormed_TagClosedError" + * @type array */ public $armor = array(); /** * Used during MakeWellFormed. + * @type */ public $skip; + + /** + * @type + */ public $rewind; + + /** + * @type + */ public $carryover; - public function __get($n) { - if ($n === 'type') { - trigger_error('Deprecated type property called; use instanceof', E_USER_NOTICE); - switch (get_class($this)) { - case 'HTMLPurifier_Token_Start': return 'start'; - case 'HTMLPurifier_Token_Empty': return 'empty'; - case 'HTMLPurifier_Token_End': return 'end'; - case 'HTMLPurifier_Token_Text': return 'text'; - case 'HTMLPurifier_Token_Comment': return 'comment'; - default: return null; + /** + * @param string $n + * @return null|string + */ + public function __get($n) + { + if ($n === 'type') { + trigger_error('Deprecated type property called; use instanceof', E_USER_NOTICE); + switch (get_class($this)) { + case 'HTMLPurifier_Token_Start': + return 'start'; + case 'HTMLPurifier_Token_Empty': + return 'empty'; + case 'HTMLPurifier_Token_End': + return 'end'; + case 'HTMLPurifier_Token_Text': + return 'text'; + case 'HTMLPurifier_Token_Comment': + return 'comment'; + default: + return null; + } } - } } /** * Sets the position of the token in the source document. + * @param int $l + * @param int $c */ - public function position($l = null, $c = null) { + public function position($l = null, $c = null) + { $this->line = $l; - $this->col = $c; + $this->col = $c; } /** * Convenience function for DirectLex settings line/col position. + * @param int $l + * @param int $c */ - public function rawPosition($l, $c) { - if ($c === -1) $l++; + public function rawPosition($l, $c) + { + if ($c === -1) { + $l++; + } $this->line = $l; - $this->col = $c; + $this->col = $c; } + /** + * Converts a token into its corresponding node. + */ + abstract public function toNode(); } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Comment.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Comment.php index dc6bdcabb8..23453c7052 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Comment.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Comment.php @@ -5,17 +5,33 @@ */ class HTMLPurifier_Token_Comment extends HTMLPurifier_Token { - public $data; /**< Character data within comment. */ + /** + * Character data within comment. + * @type string + */ + public $data; + + /** + * @type bool + */ public $is_whitespace = true; + /** * Transparent constructor. * - * @param $data String comment data. + * @param string $data String comment data. + * @param int $line + * @param int $col */ - public function __construct($data, $line = null, $col = null) { + public function __construct($data, $line = null, $col = null) + { $this->data = $data; $this->line = $line; - $this->col = $col; + $this->col = $col; + } + + public function toNode() { + return new HTMLPurifier_Node_Comment($this->data, $this->line, $this->col); } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Empty.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Empty.php index 2a82b47ad1..78a95f5555 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Empty.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Empty.php @@ -5,7 +5,11 @@ */ class HTMLPurifier_Token_Empty extends HTMLPurifier_Token_Tag { - + public function toNode() { + $n = parent::toNode(); + $n->empty = true; + return $n; + } } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/End.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/End.php index 353e79daf7..59b38fdc57 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/End.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/End.php @@ -10,10 +10,15 @@ class HTMLPurifier_Token_End extends HTMLPurifier_Token_Tag { /** - * Token that started this node. Added by MakeWellFormed. Please - * do not edit this! + * Token that started this node. + * Added by MakeWellFormed. Please do not edit this! + * @type HTMLPurifier_Token */ public $start; + + public function toNode() { + throw new Exception("HTMLPurifier_Token_End->toNode not supported!"); + } } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Start.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Start.php index e0e14fc624..019f317ada 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Start.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Start.php @@ -5,7 +5,6 @@ */ class HTMLPurifier_Token_Start extends HTMLPurifier_Token_Tag { - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Tag.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Tag.php index f4d8f640e6..d643fa64e2 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Tag.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Tag.php @@ -3,13 +3,14 @@ /** * Abstract class of a tag token (start, end or empty), and its behavior. */ -class HTMLPurifier_Token_Tag extends HTMLPurifier_Token +abstract class HTMLPurifier_Token_Tag extends HTMLPurifier_Token { /** * Static bool marker that indicates the class is a tag. * * This allows us to check objects with !empty($obj->is_tag) * without having to use a function call is_a(). + * @type bool */ public $is_tag = true; @@ -19,21 +20,27 @@ class HTMLPurifier_Token_Tag extends HTMLPurifier_Token * @note Strictly speaking, XML tags are case sensitive, so we shouldn't * be lower-casing them, but these tokens cater to HTML tags, which are * insensitive. + * @type string */ public $name; /** * Associative array of the tag's attributes. + * @type array */ public $attr = array(); /** * Non-overloaded constructor, which lower-cases passed tag name. * - * @param $name String name. - * @param $attr Associative array of attributes. + * @param string $name String name. + * @param array $attr Associative array of attributes. + * @param int $line + * @param int $col + * @param array $armor */ - public function __construct($name, $attr = array(), $line = null, $col = null, $armor = array()) { + public function __construct($name, $attr = array(), $line = null, $col = null, $armor = array()) + { $this->name = ctype_lower($name) ? $name : strtolower($name); foreach ($attr as $key => $value) { // normalization only necessary when key is not lowercase @@ -49,9 +56,13 @@ class HTMLPurifier_Token_Tag extends HTMLPurifier_Token } $this->attr = $attr; $this->line = $line; - $this->col = $col; + $this->col = $col; $this->armor = $armor; } + + public function toNode() { + return new HTMLPurifier_Node_Element($this->name, $this->attr, $this->line, $this->col, $this->armor); + } } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Text.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Text.php index 82efd823d6..f26a1c211b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Text.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Text.php @@ -12,22 +12,42 @@ class HTMLPurifier_Token_Text extends HTMLPurifier_Token { - public $name = '#PCDATA'; /**< PCDATA tag name compatible with DTD. */ - public $data; /**< Parsed character data of text. */ - public $is_whitespace; /**< Bool indicating if node is whitespace. */ + /** + * @type string + */ + public $name = '#PCDATA'; + /**< PCDATA tag name compatible with DTD. */ + + /** + * @type string + */ + public $data; + /**< Parsed character data of text. */ + + /** + * @type bool + */ + public $is_whitespace; + + /**< Bool indicating if node is whitespace. */ /** * Constructor, accepts data and determines if it is whitespace. - * - * @param $data String parsed character data. + * @param string $data String parsed character data. + * @param int $line + * @param int $col */ - public function __construct($data, $line = null, $col = null) { + public function __construct($data, $line = null, $col = null) + { $this->data = $data; $this->is_whitespace = ctype_space($data); $this->line = $line; - $this->col = $col; + $this->col = $col; } + public function toNode() { + return new HTMLPurifier_Node_Text($this->data, $this->is_whitespace, $this->line, $this->col); + } } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TokenFactory.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TokenFactory.php index 7cf48fb41c..dea2446b93 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TokenFactory.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TokenFactory.php @@ -13,32 +13,53 @@ */ class HTMLPurifier_TokenFactory { + // p stands for prototype /** - * Prototypes that will be cloned. - * @private + * @type HTMLPurifier_Token_Start */ - // p stands for prototype - private $p_start, $p_end, $p_empty, $p_text, $p_comment; + private $p_start; + + /** + * @type HTMLPurifier_Token_End + */ + private $p_end; + + /** + * @type HTMLPurifier_Token_Empty + */ + private $p_empty; + + /** + * @type HTMLPurifier_Token_Text + */ + private $p_text; + + /** + * @type HTMLPurifier_Token_Comment + */ + private $p_comment; /** * Generates blank prototypes for cloning. */ - public function __construct() { - $this->p_start = new HTMLPurifier_Token_Start('', array()); - $this->p_end = new HTMLPurifier_Token_End(''); - $this->p_empty = new HTMLPurifier_Token_Empty('', array()); - $this->p_text = new HTMLPurifier_Token_Text(''); - $this->p_comment= new HTMLPurifier_Token_Comment(''); + public function __construct() + { + $this->p_start = new HTMLPurifier_Token_Start('', array()); + $this->p_end = new HTMLPurifier_Token_End(''); + $this->p_empty = new HTMLPurifier_Token_Empty('', array()); + $this->p_text = new HTMLPurifier_Token_Text(''); + $this->p_comment = new HTMLPurifier_Token_Comment(''); } /** * Creates a HTMLPurifier_Token_Start. - * @param $name Tag name - * @param $attr Associative array of attributes - * @return Generated HTMLPurifier_Token_Start + * @param string $name Tag name + * @param array $attr Associative array of attributes + * @return HTMLPurifier_Token_Start Generated HTMLPurifier_Token_Start */ - public function createStart($name, $attr = array()) { + public function createStart($name, $attr = array()) + { $p = clone $this->p_start; $p->__construct($name, $attr); return $p; @@ -46,10 +67,11 @@ class HTMLPurifier_TokenFactory /** * Creates a HTMLPurifier_Token_End. - * @param $name Tag name - * @return Generated HTMLPurifier_Token_End + * @param string $name Tag name + * @return HTMLPurifier_Token_End Generated HTMLPurifier_Token_End */ - public function createEnd($name) { + public function createEnd($name) + { $p = clone $this->p_end; $p->__construct($name); return $p; @@ -57,11 +79,12 @@ class HTMLPurifier_TokenFactory /** * Creates a HTMLPurifier_Token_Empty. - * @param $name Tag name - * @param $attr Associative array of attributes - * @return Generated HTMLPurifier_Token_Empty + * @param string $name Tag name + * @param array $attr Associative array of attributes + * @return HTMLPurifier_Token_Empty Generated HTMLPurifier_Token_Empty */ - public function createEmpty($name, $attr = array()) { + public function createEmpty($name, $attr = array()) + { $p = clone $this->p_empty; $p->__construct($name, $attr); return $p; @@ -69,10 +92,11 @@ class HTMLPurifier_TokenFactory /** * Creates a HTMLPurifier_Token_Text. - * @param $data Data of text token - * @return Generated HTMLPurifier_Token_Text + * @param string $data Data of text token + * @return HTMLPurifier_Token_Text Generated HTMLPurifier_Token_Text */ - public function createText($data) { + public function createText($data) + { $p = clone $this->p_text; $p->__construct($data); return $p; @@ -80,15 +104,15 @@ class HTMLPurifier_TokenFactory /** * Creates a HTMLPurifier_Token_Comment. - * @param $data Data of comment token - * @return Generated HTMLPurifier_Token_Comment + * @param string $data Data of comment token + * @return HTMLPurifier_Token_Comment Generated HTMLPurifier_Token_Comment */ - public function createComment($data) { + public function createComment($data) + { $p = clone $this->p_comment; $p->__construct($data); return $p; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URI.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URI.php index f158ef5e30..a5e7ae2984 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URI.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URI.php @@ -10,17 +10,57 @@ */ class HTMLPurifier_URI { + /** + * @type string + */ + public $scheme; + + /** + * @type string + */ + public $userinfo; - public $scheme, $userinfo, $host, $port, $path, $query, $fragment; + /** + * @type string + */ + public $host; + + /** + * @type int + */ + public $port; + + /** + * @type string + */ + public $path; + + /** + * @type string + */ + public $query; + + /** + * @type string + */ + public $fragment; /** + * @param string $scheme + * @param string $userinfo + * @param string $host + * @param int $port + * @param string $path + * @param string $query + * @param string $fragment * @note Automatically normalizes scheme and port */ - public function __construct($scheme, $userinfo, $host, $port, $path, $query, $fragment) { + public function __construct($scheme, $userinfo, $host, $port, $path, $query, $fragment) + { $this->scheme = is_null($scheme) || ctype_lower($scheme) ? $scheme : strtolower($scheme); $this->userinfo = $userinfo; $this->host = $host; - $this->port = is_null($port) ? $port : (int) $port; + $this->port = is_null($port) ? $port : (int)$port; $this->path = $path; $this->query = $query; $this->fragment = $fragment; @@ -28,15 +68,18 @@ class HTMLPurifier_URI /** * Retrieves a scheme object corresponding to the URI's scheme/default - * @param $config Instance of HTMLPurifier_Config - * @param $context Instance of HTMLPurifier_Context - * @return Scheme object appropriate for validating this URI + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return HTMLPurifier_URIScheme Scheme object appropriate for validating this URI */ - public function getSchemeObj($config, $context) { + public function getSchemeObj($config, $context) + { $registry = HTMLPurifier_URISchemeRegistry::instance(); if ($this->scheme !== null) { $scheme_obj = $registry->getScheme($this->scheme, $config, $context); - if (!$scheme_obj) return false; // invalid scheme, clean it out + if (!$scheme_obj) { + return false; + } // invalid scheme, clean it out } else { // no scheme: retrieve the default one $def = $config->getDefinition('URI'); @@ -56,12 +99,12 @@ class HTMLPurifier_URI /** * Generic validation method applicable for all schemes. May modify * this URI in order to get it into a compliant form. - * @param $config Instance of HTMLPurifier_Config - * @param $context Instance of HTMLPurifier_Context - * @return True if validation/filtering succeeds, false if failure + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool True if validation/filtering succeeds, false if failure */ - public function validate($config, $context) { - + public function validate($config, $context) + { // ABNF definitions from RFC 3986 $chars_sub_delims = '!$&\'()*+,;='; $chars_gen_delims = ':/?#[]@'; @@ -71,7 +114,9 @@ class HTMLPurifier_URI if (!is_null($this->host)) { $host_def = new HTMLPurifier_AttrDef_URI_Host(); $this->host = $host_def->validate($this->host, $config, $context); - if ($this->host === false) $this->host = null; + if ($this->host === false) { + $this->host = null; + } } // validate scheme @@ -97,11 +142,12 @@ class HTMLPurifier_URI // validate port if (!is_null($this->port)) { - if ($this->port < 1 || $this->port > 65535) $this->port = null; + if ($this->port < 1 || $this->port > 65535) { + $this->port = null; + } } // validate path - $path_parts = array(); $segments_encoder = new HTMLPurifier_PercentEncoder($chars_pchar . '/'); if (!is_null($this->host)) { // this catches $this->host === '' // path-abempty (hier and relative) @@ -161,16 +207,15 @@ class HTMLPurifier_URI if (!is_null($this->fragment)) { $this->fragment = $qf_encoder->encode($this->fragment); } - return true; - } /** * Convert URI back to string - * @return String URI appropriate for output + * @return string URI appropriate for output */ - public function toString() { + public function toString() + { // reconstruct authority $authority = null; // there is a rendering difference between a null authority @@ -178,9 +223,13 @@ class HTMLPurifier_URI // (http:///foo-bar). if (!is_null($this->host)) { $authority = ''; - if(!is_null($this->userinfo)) $authority .= $this->userinfo . '@'; + if (!is_null($this->userinfo)) { + $authority .= $this->userinfo . '@'; + } $authority .= $this->host; - if(!is_null($this->port)) $authority .= ':' . $this->port; + if (!is_null($this->port)) { + $authority .= ':' . $this->port; + } } // Reconstruct the result @@ -190,11 +239,19 @@ class HTMLPurifier_URI // differently than http:///foo), so unfortunately we have to // defer to the schemes to do the right thing. $result = ''; - if (!is_null($this->scheme)) $result .= $this->scheme . ':'; - if (!is_null($authority)) $result .= '//' . $authority; + if (!is_null($this->scheme)) { + $result .= $this->scheme . ':'; + } + if (!is_null($authority)) { + $result .= '//' . $authority; + } $result .= $this->path; - if (!is_null($this->query)) $result .= '?' . $this->query; - if (!is_null($this->fragment)) $result .= '#' . $this->fragment; + if (!is_null($this->query)) { + $result .= '?' . $this->query; + } + if (!is_null($this->fragment)) { + $result .= '#' . $this->fragment; + } return $result; } @@ -207,11 +264,19 @@ class HTMLPurifier_URI * Note that this does not do any scheme checking, so it is mostly * only appropriate for metadata that doesn't care about protocol * security. isBenign is probably what you actually want. + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool */ - public function isLocal($config, $context) { - if ($this->host === null) return true; + public function isLocal($config, $context) + { + if ($this->host === null) { + return true; + } $uri_def = $config->getDefinition('URI'); - if ($uri_def->host === $this->host) return true; + if ($uri_def->host === $this->host) { + return true; + } return false; } @@ -221,12 +286,20 @@ class HTMLPurifier_URI * * - It is a local URL (isLocal), and * - It has a equal or better level of security + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool */ - public function isBenign($config, $context) { - if (!$this->isLocal($config, $context)) return false; + public function isBenign($config, $context) + { + if (!$this->isLocal($config, $context)) { + return false; + } $scheme_obj = $this->getSchemeObj($config, $context); - if (!$scheme_obj) return false; // conservative approach + if (!$scheme_obj) { + return false; + } // conservative approach $current_scheme_obj = $config->getDefinition('URI')->getDefaultScheme($config, $context); if ($current_scheme_obj->secure) { @@ -236,7 +309,6 @@ class HTMLPurifier_URI } return true; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIDefinition.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIDefinition.php index 4dbde8062e..e0bd8bcca8 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIDefinition.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIDefinition.php @@ -23,7 +23,8 @@ class HTMLPurifier_URIDefinition extends HTMLPurifier_Definition */ public $defaultScheme; - public function __construct() { + public function __construct() + { $this->registerFilter(new HTMLPurifier_URIFilter_DisableExternal()); $this->registerFilter(new HTMLPurifier_URIFilter_DisableExternalResources()); $this->registerFilter(new HTMLPurifier_URIFilter_DisableResources()); @@ -33,11 +34,13 @@ class HTMLPurifier_URIDefinition extends HTMLPurifier_Definition $this->registerFilter(new HTMLPurifier_URIFilter_Munge()); } - public function registerFilter($filter) { + public function registerFilter($filter) + { $this->registeredFilters[$filter->name] = $filter; } - public function addFilter($filter, $config) { + public function addFilter($filter, $config) + { $r = $filter->prepare($config); if ($r === false) return; // null is ok, for backwards compat if ($filter->post) { @@ -47,12 +50,14 @@ class HTMLPurifier_URIDefinition extends HTMLPurifier_Definition } } - protected function doSetup($config) { + protected function doSetup($config) + { $this->setupMemberVariables($config); $this->setupFilters($config); } - protected function setupFilters($config) { + protected function setupFilters($config) + { foreach ($this->registeredFilters as $name => $filter) { if ($filter->always_load) { $this->addFilter($filter, $config); @@ -66,7 +71,8 @@ class HTMLPurifier_URIDefinition extends HTMLPurifier_Definition unset($this->registeredFilters); } - protected function setupMemberVariables($config) { + protected function setupMemberVariables($config) + { $this->host = $config->get('URI.Host'); $base_uri = $config->get('URI.Base'); if (!is_null($base_uri)) { @@ -78,11 +84,13 @@ class HTMLPurifier_URIDefinition extends HTMLPurifier_Definition if (is_null($this->defaultScheme)) $this->defaultScheme = $config->get('URI.DefaultScheme'); } - public function getDefaultScheme($config, $context) { + public function getDefaultScheme($config, $context) + { return HTMLPurifier_URISchemeRegistry::instance()->getScheme($this->defaultScheme, $config, $context); } - public function filter(&$uri, $config, $context) { + public function filter(&$uri, $config, $context) + { foreach ($this->filters as $name => $f) { $result = $f->filter($uri, $config, $context); if (!$result) return false; @@ -90,7 +98,8 @@ class HTMLPurifier_URIDefinition extends HTMLPurifier_Definition return true; } - public function postFilter(&$uri, $config, $context) { + public function postFilter(&$uri, $config, $context) + { foreach ($this->postFilters as $name => $f) { $result = $f->filter($uri, $config, $context); if (!$result) return false; diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter.php index 6a1b0b08e4..09724e9f41 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter.php @@ -29,39 +29,46 @@ abstract class HTMLPurifier_URIFilter { /** - * Unique identifier of filter + * Unique identifier of filter. + * @type string */ public $name; /** * True if this filter should be run after scheme validation. + * @type bool */ public $post = false; /** - * True if this filter should always be loaded (this permits - * a filter to be named Foo without the corresponding %URI.Foo - * directive existing.) + * True if this filter should always be loaded. + * This permits a filter to be named Foo without the corresponding + * %URI.Foo directive existing. + * @type bool */ public $always_load = false; /** * Performs initialization for the filter. If the filter returns * false, this means that it shouldn't be considered active. + * @param HTMLPurifier_Config $config + * @return bool */ - public function prepare($config) {return true;} + public function prepare($config) + { + return true; + } /** * Filter a URI object - * @param $uri Reference to URI object variable - * @param $config Instance of HTMLPurifier_Config - * @param $context Instance of HTMLPurifier_Context + * @param HTMLPurifier_URI $uri Reference to URI object variable + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context * @return bool Whether or not to continue processing: false indicates * URL is no good, true indicates continue processing. Note that * all changes are committed directly on the URI object */ abstract public function filter(&$uri, $config, $context); - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternal.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternal.php index d8a39a5011..ced1b13763 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternal.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternal.php @@ -2,19 +2,50 @@ class HTMLPurifier_URIFilter_DisableExternal extends HTMLPurifier_URIFilter { + /** + * @type string + */ public $name = 'DisableExternal'; + + /** + * @type array + */ protected $ourHostParts = false; - public function prepare($config) { + + /** + * @param HTMLPurifier_Config $config + * @return void + */ + public function prepare($config) + { $our_host = $config->getDefinition('URI')->host; - if ($our_host !== null) $this->ourHostParts = array_reverse(explode('.', $our_host)); + if ($our_host !== null) { + $this->ourHostParts = array_reverse(explode('.', $our_host)); + } } - public function filter(&$uri, $config, $context) { - if (is_null($uri->host)) return true; - if ($this->ourHostParts === false) return false; + + /** + * @param HTMLPurifier_URI $uri Reference + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function filter(&$uri, $config, $context) + { + if (is_null($uri->host)) { + return true; + } + if ($this->ourHostParts === false) { + return false; + } $host_parts = array_reverse(explode('.', $uri->host)); foreach ($this->ourHostParts as $i => $x) { - if (!isset($host_parts[$i])) return false; - if ($host_parts[$i] != $this->ourHostParts[$i]) return false; + if (!isset($host_parts[$i])) { + return false; + } + if ($host_parts[$i] != $this->ourHostParts[$i]) { + return false; + } } return true; } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternalResources.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternalResources.php index 881abc43cf..c6562169e0 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternalResources.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternalResources.php @@ -2,9 +2,22 @@ class HTMLPurifier_URIFilter_DisableExternalResources extends HTMLPurifier_URIFilter_DisableExternal { + /** + * @type string + */ public $name = 'DisableExternalResources'; - public function filter(&$uri, $config, $context) { - if (!$context->get('EmbeddedURI', true)) return true; + + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function filter(&$uri, $config, $context) + { + if (!$context->get('EmbeddedURI', true)) { + return true; + } return parent::filter($uri, $config, $context); } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableResources.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableResources.php index 67538c7bb2..d5c412c444 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableResources.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableResources.php @@ -2,8 +2,19 @@ class HTMLPurifier_URIFilter_DisableResources extends HTMLPurifier_URIFilter { + /** + * @type string + */ public $name = 'DisableResources'; - public function filter(&$uri, $config, $context) { + + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function filter(&$uri, $config, $context) + { return !$context->get('EmbeddedURI', true); } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/HostBlacklist.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/HostBlacklist.php index 55fde3bf4d..a6645c17ee 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/HostBlacklist.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/HostBlacklist.php @@ -6,14 +6,35 @@ // points are involved), but I'm not 100% sure class HTMLPurifier_URIFilter_HostBlacklist extends HTMLPurifier_URIFilter { + /** + * @type string + */ public $name = 'HostBlacklist'; + + /** + * @type array + */ protected $blacklist = array(); - public function prepare($config) { + + /** + * @param HTMLPurifier_Config $config + * @return bool + */ + public function prepare($config) + { $this->blacklist = $config->get('URI.HostBlacklist'); return true; } - public function filter(&$uri, $config, $context) { - foreach($this->blacklist as $blacklisted_host_fragment) { + + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function filter(&$uri, $config, $context) + { + foreach ($this->blacklist as $blacklisted_host_fragment) { if (strpos($uri->host, $blacklisted_host_fragment) !== false) { return false; } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/MakeAbsolute.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/MakeAbsolute.php index f46ab2630d..c507bbff8e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/MakeAbsolute.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/MakeAbsolute.php @@ -4,14 +4,35 @@ class HTMLPurifier_URIFilter_MakeAbsolute extends HTMLPurifier_URIFilter { + /** + * @type string + */ public $name = 'MakeAbsolute'; + + /** + * @type + */ protected $base; + + /** + * @type array + */ protected $basePathStack = array(); - public function prepare($config) { + + /** + * @param HTMLPurifier_Config $config + * @return bool + */ + public function prepare($config) + { $def = $config->getDefinition('URI'); $this->base = $def->base; if (is_null($this->base)) { - trigger_error('URI.MakeAbsolute is being ignored due to lack of value for URI.Base configuration', E_USER_WARNING); + trigger_error( + 'URI.MakeAbsolute is being ignored due to lack of ' . + 'value for URI.Base configuration', + E_USER_WARNING + ); return false; } $this->base->fragment = null; // fragment is invalid for base URI @@ -21,19 +42,29 @@ class HTMLPurifier_URIFilter_MakeAbsolute extends HTMLPurifier_URIFilter $this->basePathStack = $stack; return true; } - public function filter(&$uri, $config, $context) { - if (is_null($this->base)) return true; // abort early - if ( - $uri->path === '' && is_null($uri->scheme) && - is_null($uri->host) && is_null($uri->query) && is_null($uri->fragment) - ) { + + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function filter(&$uri, $config, $context) + { + if (is_null($this->base)) { + return true; + } // abort early + if ($uri->path === '' && is_null($uri->scheme) && + is_null($uri->host) && is_null($uri->query) && is_null($uri->fragment)) { // reference to current document $uri = clone $this->base; return true; } if (!is_null($uri->scheme)) { // absolute URI already: don't change - if (!is_null($uri->host)) return true; + if (!is_null($uri->host)) { + return true; + } $scheme_obj = $uri->getSchemeObj($config, $context); if (!$scheme_obj) { // scheme not recognized @@ -66,22 +97,33 @@ class HTMLPurifier_URIFilter_MakeAbsolute extends HTMLPurifier_URIFilter } // re-combine $uri->scheme = $this->base->scheme; - if (is_null($uri->userinfo)) $uri->userinfo = $this->base->userinfo; - if (is_null($uri->host)) $uri->host = $this->base->host; - if (is_null($uri->port)) $uri->port = $this->base->port; + if (is_null($uri->userinfo)) { + $uri->userinfo = $this->base->userinfo; + } + if (is_null($uri->host)) { + $uri->host = $this->base->host; + } + if (is_null($uri->port)) { + $uri->port = $this->base->port; + } return true; } /** * Resolve dots and double-dots in a path stack + * @param array $stack + * @return array */ - private function _collapseStack($stack) { + private function _collapseStack($stack) + { $result = array(); $is_folder = false; for ($i = 0; isset($stack[$i]); $i++) { $is_folder = false; // absorb an internally duplicated slash - if ($stack[$i] == '' && $i && isset($stack[$i+1])) continue; + if ($stack[$i] == '' && $i && isset($stack[$i + 1])) { + continue; + } if ($stack[$i] == '..') { if (!empty($result)) { $segment = array_pop($result); @@ -106,7 +148,9 @@ class HTMLPurifier_URIFilter_MakeAbsolute extends HTMLPurifier_URIFilter } $result[] = $stack[$i]; } - if ($is_folder) $result[] = ''; + if ($is_folder) { + $result[] = ''; + } return $result; } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php index de695df14b..6e03315a17 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php @@ -2,26 +2,79 @@ class HTMLPurifier_URIFilter_Munge extends HTMLPurifier_URIFilter { + /** + * @type string + */ public $name = 'Munge'; + + /** + * @type bool + */ public $post = true; - private $target, $parser, $doEmbed, $secretKey; + /** + * @type string + */ + private $target; + + /** + * @type HTMLPurifier_URIParser + */ + private $parser; + + /** + * @type bool + */ + private $doEmbed; + + /** + * @type string + */ + private $secretKey; + + /** + * @type array + */ protected $replace = array(); - public function prepare($config) { - $this->target = $config->get('URI.' . $this->name); - $this->parser = new HTMLPurifier_URIParser(); - $this->doEmbed = $config->get('URI.MungeResources'); + /** + * @param HTMLPurifier_Config $config + * @return bool + */ + public function prepare($config) + { + $this->target = $config->get('URI.' . $this->name); + $this->parser = new HTMLPurifier_URIParser(); + $this->doEmbed = $config->get('URI.MungeResources'); $this->secretKey = $config->get('URI.MungeSecretKey'); + if ($this->secretKey && !function_exists('hash_hmac')) { + throw new Exception("Cannot use %URI.MungeSecretKey without hash_hmac support."); + } return true; } - public function filter(&$uri, $config, $context) { - if ($context->get('EmbeddedURI', true) && !$this->doEmbed) return true; + + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function filter(&$uri, $config, $context) + { + if ($context->get('EmbeddedURI', true) && !$this->doEmbed) { + return true; + } $scheme_obj = $uri->getSchemeObj($config, $context); - if (!$scheme_obj) return true; // ignore unknown schemes, maybe another postfilter did it - if (!$scheme_obj->browsable) return true; // ignore non-browseable schemes, since we can't munge those in a reasonable way - if ($uri->isBenign($config, $context)) return true; // don't redirect if a benign URL + if (!$scheme_obj) { + return true; + } // ignore unknown schemes, maybe another postfilter did it + if (!$scheme_obj->browsable) { + return true; + } // ignore non-browseable schemes, since we can't munge those in a reasonable way + if ($uri->isBenign($config, $context)) { + return true; + } // don't redirect if a benign URL $this->makeReplace($uri, $config, $context); $this->replace = array_map('rawurlencode', $this->replace); @@ -30,12 +83,20 @@ class HTMLPurifier_URIFilter_Munge extends HTMLPurifier_URIFilter $new_uri = $this->parser->parse($new_uri); // don't redirect if the target host is the same as the // starting host - if ($uri->host === $new_uri->host) return true; + if ($uri->host === $new_uri->host) { + return true; + } $uri = $new_uri; // overwrite return true; } - protected function makeReplace($uri, $config, $context) { + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + */ + protected function makeReplace($uri, $config, $context) + { $string = $uri->toString(); // always available $this->replace['%s'] = $string; @@ -45,9 +106,10 @@ class HTMLPurifier_URIFilter_Munge extends HTMLPurifier_URIFilter $this->replace['%m'] = $context->get('CurrentAttr', true); $this->replace['%p'] = $context->get('CurrentCSSProperty', true); // not always available - if ($this->secretKey) $this->replace['%t'] = sha1($this->secretKey . ':' . $string); + if ($this->secretKey) { + $this->replace['%t'] = hash_hmac("sha256", $string, $this->secretKey); + } } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/SafeIframe.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/SafeIframe.php index 284bb13de2..f609c47a34 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/SafeIframe.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/SafeIframe.php @@ -8,25 +8,58 @@ */ class HTMLPurifier_URIFilter_SafeIframe extends HTMLPurifier_URIFilter { + /** + * @type string + */ public $name = 'SafeIframe'; + + /** + * @type bool + */ public $always_load = true; - protected $regexp = NULL; - // XXX: The not so good bit about how this is all setup now is we + + /** + * @type string + */ + protected $regexp = null; + + // XXX: The not so good bit about how this is all set up now is we // can't check HTML.SafeIframe in the 'prepare' step: we have to // defer till the actual filtering. - public function prepare($config) { + /** + * @param HTMLPurifier_Config $config + * @return bool + */ + public function prepare($config) + { $this->regexp = $config->get('URI.SafeIframeRegexp'); return true; } - public function filter(&$uri, $config, $context) { + + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function filter(&$uri, $config, $context) + { // check if filter not applicable - if (!$config->get('HTML.SafeIframe')) return true; + if (!$config->get('HTML.SafeIframe')) { + return true; + } // check if the filter should actually trigger - if (!$context->get('EmbeddedURI', true)) return true; + if (!$context->get('EmbeddedURI', true)) { + return true; + } $token = $context->get('CurrentToken', true); - if (!($token && $token->name == 'iframe')) return true; + if (!($token && $token->name == 'iframe')) { + return true; + } // check if we actually have some whitelists enabled - if ($this->regexp === null) return false; + if ($this->regexp === null) { + return false; + } // actually check the whitelists return preg_match($this->regexp, $uri->toString()); } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIParser.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIParser.php index 7179e4ab89..0e7381a07b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIParser.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIParser.php @@ -12,7 +12,8 @@ class HTMLPurifier_URIParser */ protected $percentEncoder; - public function __construct() { + public function __construct() + { $this->percentEncoder = new HTMLPurifier_PercentEncoder(); } @@ -22,15 +23,15 @@ class HTMLPurifier_URIParser * @return HTMLPurifier_URI representation of URI. This representation has * not been validated yet and may not conform to RFC. */ - public function parse($uri) { - + public function parse($uri) + { $uri = $this->percentEncoder->normalize($uri); // Regexp is as per Appendix B. // Note that ["<>] are an addition to the RFC's recommended // characters, because they represent external delimeters. $r_URI = '!'. - '(([^:/?#"<>]+):)?'. // 2. Scheme + '(([a-zA-Z0-9\.\+\-]+):)?'. // 2. Scheme '(//([^/?#"<>]*))?'. // 4. Authority '([^?#"<>]*)'. // 5. Path '(\?([^#"<>]*))?'. // 7. Query diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme.php index 7be958143a..fe9e82cf26 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme.php @@ -7,27 +7,31 @@ abstract class HTMLPurifier_URIScheme { /** - * Scheme's default port (integer). If an explicit port number is + * Scheme's default port (integer). If an explicit port number is * specified that coincides with the default port, it will be * elided. + * @type int */ public $default_port = null; /** - * Whether or not URIs of this schem are locatable by a browser + * Whether or not URIs of this scheme are locatable by a browser * http and ftp are accessible, while mailto and news are not. + * @type bool */ public $browsable = false; /** * Whether or not data transmitted over this scheme is encrypted. * https is secure, http is not. + * @type bool */ public $secure = false; /** * Whether or not the URI always uses , resolves edge cases * with making relative URIs absolute + * @type bool */ public $hierarchical = false; @@ -35,28 +39,32 @@ abstract class HTMLPurifier_URIScheme * Whether or not the URI may omit a hostname when the scheme is * explicitly specified, ala file:///path/to/file. As of writing, * 'file' is the only scheme that browsers support his properly. + * @type bool */ public $may_omit_host = false; /** * Validates the components of a URI for a specific scheme. - * @param $uri Reference to a HTMLPurifier_URI object - * @param $config HTMLPurifier_Config object - * @param $context HTMLPurifier_Context object - * @return Bool success or failure + * @param HTMLPurifier_URI $uri Reference to a HTMLPurifier_URI object + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool success or failure */ - public abstract function doValidate(&$uri, $config, $context); + abstract public function doValidate(&$uri, $config, $context); /** * Public interface for validating components of a URI. Performs a * bunch of default actions. Don't overload this method. - * @param $uri Reference to a HTMLPurifier_URI object - * @param $config HTMLPurifier_Config object - * @param $context HTMLPurifier_Context object - * @return Bool success or failure + * @param HTMLPurifier_URI $uri Reference to a HTMLPurifier_URI object + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool success or failure */ - public function validate(&$uri, $config, $context) { - if ($this->default_port == $uri->port) $uri->port = null; + public function validate(&$uri, $config, $context) + { + if ($this->default_port == $uri->port) { + $uri->port = null; + } // kludge: browsers do funny things when the scheme but not the // authority is set if (!$this->may_omit_host && @@ -65,7 +73,7 @@ abstract class HTMLPurifier_URIScheme // if the scheme is not present, a *blank* host is in error, // since this translates into '///path' which most browsers // interpret as being 'http://path'. - (is_null($uri->scheme) && $uri->host === '') + (is_null($uri->scheme) && $uri->host === '') ) { do { if (is_null($uri->scheme)) { @@ -89,7 +97,6 @@ abstract class HTMLPurifier_URIScheme } return $this->doValidate($uri, $config, $context); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/data.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/data.php index ab56a3e96d..6ebca49848 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/data.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/data.php @@ -3,21 +3,38 @@ /** * Implements data: URI for base64 encoded images supported by GD. */ -class HTMLPurifier_URIScheme_data extends HTMLPurifier_URIScheme { - +class HTMLPurifier_URIScheme_data extends HTMLPurifier_URIScheme +{ + /** + * @type bool + */ public $browsable = true; + + /** + * @type array + */ public $allowed_types = array( // you better write validation code for other types if you // decide to allow them 'image/jpeg' => true, 'image/gif' => true, 'image/png' => true, - ); + ); // this is actually irrelevant since we only write out the path // component + /** + * @type bool + */ public $may_omit_host = true; - public function doValidate(&$uri, $config, $context) { + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function doValidate(&$uri, $config, $context) + { $result = explode(',', $uri->path, 2); $is_base64 = false; $charset = null; @@ -26,7 +43,7 @@ class HTMLPurifier_URIScheme_data extends HTMLPurifier_URIScheme { list($metadata, $data) = $result; // do some legwork on the metadata $metas = explode(';', $metadata); - while(!empty($metas)) { + while (!empty($metas)) { $cur = array_shift($metas); if ($cur == 'base64') { $is_base64 = true; @@ -35,10 +52,14 @@ class HTMLPurifier_URIScheme_data extends HTMLPurifier_URIScheme { if (substr($cur, 0, 8) == 'charset=') { // doesn't match if there are arbitrary spaces, but // whatever dude - if ($charset !== null) continue; // garbage + if ($charset !== null) { + continue; + } // garbage $charset = substr($cur, 8); // not used } else { - if ($content_type !== null) continue; // garbage + if ($content_type !== null) { + continue; + } // garbage $content_type = $cur; } } @@ -70,7 +91,9 @@ class HTMLPurifier_URIScheme_data extends HTMLPurifier_URIScheme { $info = getimagesize($file); restore_error_handler(); unlink($file); - if ($info == false) return false; + if ($info == false) { + return false; + } $image_code = $info[2]; } else { trigger_error("could not find exif_imagetype or getimagesize functions", E_USER_ERROR); @@ -79,7 +102,9 @@ class HTMLPurifier_URIScheme_data extends HTMLPurifier_URIScheme { if ($real_content_type != $content_type) { // we're nice guys; if the content type is something else we // support, change it over - if (empty($this->allowed_types[$real_content_type])) return false; + if (empty($this->allowed_types[$real_content_type])) { + return false; + } $content_type = $real_content_type; } // ok, it's kosher, rewrite what we need @@ -92,7 +117,11 @@ class HTMLPurifier_URIScheme_data extends HTMLPurifier_URIScheme { return true; } - public function muteErrorHandler($errno, $errstr) {} - + /** + * @param int $errno + * @param string $errstr + */ + public function muteErrorHandler($errno, $errstr) + { + } } - diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/file.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/file.php index d74a3f1980..215be4ba80 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/file.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/file.php @@ -3,30 +3,42 @@ /** * Validates file as defined by RFC 1630 and RFC 1738. */ -class HTMLPurifier_URIScheme_file extends HTMLPurifier_URIScheme { - - // Generally file:// URLs are not accessible from most - // machines, so placing them as an img src is incorrect. +class HTMLPurifier_URIScheme_file extends HTMLPurifier_URIScheme +{ + /** + * Generally file:// URLs are not accessible from most + * machines, so placing them as an img src is incorrect. + * @type bool + */ public $browsable = false; - // Basically the *only* URI scheme for which this is true, since - // accessing files on the local machine is very common. In fact, - // browsers on some operating systems don't understand the - // authority, though I hear it is used on Windows to refer to - // network shares. + /** + * Basically the *only* URI scheme for which this is true, since + * accessing files on the local machine is very common. In fact, + * browsers on some operating systems don't understand the + * authority, though I hear it is used on Windows to refer to + * network shares. + * @type bool + */ public $may_omit_host = true; - public function doValidate(&$uri, $config, $context) { + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function doValidate(&$uri, $config, $context) + { // Authentication method is not supported $uri->userinfo = null; // file:// makes no provisions for accessing the resource - $uri->port = null; + $uri->port = null; // While it seems to work on Firefox, the querystring has // no possible effect and is thus stripped. - $uri->query = null; + $uri->query = null; return true; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/ftp.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/ftp.php index 0fb2abf64c..1eb43ee5c4 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/ftp.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/ftp.php @@ -3,14 +3,32 @@ /** * Validates ftp (File Transfer Protocol) URIs as defined by generic RFC 1738. */ -class HTMLPurifier_URIScheme_ftp extends HTMLPurifier_URIScheme { - +class HTMLPurifier_URIScheme_ftp extends HTMLPurifier_URIScheme +{ + /** + * @type int + */ public $default_port = 21; + + /** + * @type bool + */ public $browsable = true; // usually + + /** + * @type bool + */ public $hierarchical = true; - public function doValidate(&$uri, $config, $context) { - $uri->query = null; + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function doValidate(&$uri, $config, $context) + { + $uri->query = null; // typecode check $semicolon_pos = strrpos($uri->path, ';'); // reverse @@ -33,10 +51,8 @@ class HTMLPurifier_URIScheme_ftp extends HTMLPurifier_URIScheme { $uri->path = str_replace(';', '%3B', $uri->path); $uri->path .= $type_ret; } - return true; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/http.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/http.php index 959b8daff2..ce69ec438a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/http.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/http.php @@ -3,17 +3,34 @@ /** * Validates http (HyperText Transfer Protocol) as defined by RFC 2616 */ -class HTMLPurifier_URIScheme_http extends HTMLPurifier_URIScheme { - +class HTMLPurifier_URIScheme_http extends HTMLPurifier_URIScheme +{ + /** + * @type int + */ public $default_port = 80; + + /** + * @type bool + */ public $browsable = true; + + /** + * @type bool + */ public $hierarchical = true; - public function doValidate(&$uri, $config, $context) { + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function doValidate(&$uri, $config, $context) + { $uri->userinfo = null; return true; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/https.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/https.php index 159c2874ea..0e96882db9 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/https.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/https.php @@ -3,11 +3,16 @@ /** * Validates https (Secure HTTP) according to http scheme. */ -class HTMLPurifier_URIScheme_https extends HTMLPurifier_URIScheme_http { - +class HTMLPurifier_URIScheme_https extends HTMLPurifier_URIScheme_http +{ + /** + * @type int + */ public $default_port = 443; + /** + * @type bool + */ public $secure = true; - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/mailto.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/mailto.php index 9db4cb23f4..c3a6b602a7 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/mailto.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/mailto.php @@ -9,19 +9,32 @@ * @todo Filter allowed query parameters */ -class HTMLPurifier_URIScheme_mailto extends HTMLPurifier_URIScheme { - +class HTMLPurifier_URIScheme_mailto extends HTMLPurifier_URIScheme +{ + /** + * @type bool + */ public $browsable = false; + + /** + * @type bool + */ public $may_omit_host = true; - public function doValidate(&$uri, $config, $context) { + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function doValidate(&$uri, $config, $context) + { $uri->userinfo = null; $uri->host = null; $uri->port = null; // we need to validate path against RFC 2368's addr-spec return true; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/news.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/news.php index 84a6748d8d..7490927d63 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/news.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/news.php @@ -3,20 +3,33 @@ /** * Validates news (Usenet) as defined by generic RFC 1738 */ -class HTMLPurifier_URIScheme_news extends HTMLPurifier_URIScheme { - +class HTMLPurifier_URIScheme_news extends HTMLPurifier_URIScheme +{ + /** + * @type bool + */ public $browsable = false; + + /** + * @type bool + */ public $may_omit_host = true; - public function doValidate(&$uri, $config, $context) { + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function doValidate(&$uri, $config, $context) + { $uri->userinfo = null; - $uri->host = null; - $uri->port = null; - $uri->query = null; + $uri->host = null; + $uri->port = null; + $uri->query = null; // typecode check needed on path return true; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/nntp.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/nntp.php index 4ccea0dfcf..f211d715e9 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/nntp.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/nntp.php @@ -3,17 +3,30 @@ /** * Validates nntp (Network News Transfer Protocol) as defined by generic RFC 1738 */ -class HTMLPurifier_URIScheme_nntp extends HTMLPurifier_URIScheme { - +class HTMLPurifier_URIScheme_nntp extends HTMLPurifier_URIScheme +{ + /** + * @type int + */ public $default_port = 119; + + /** + * @type bool + */ public $browsable = false; - public function doValidate(&$uri, $config, $context) { + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function doValidate(&$uri, $config, $context) + { $uri->userinfo = null; - $uri->query = null; + $uri->query = null; return true; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php index 576bf7b6d1..4ac8a0b76e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php @@ -8,12 +8,14 @@ class HTMLPurifier_URISchemeRegistry /** * Retrieve sole instance of the registry. - * @param $prototype Optional prototype to overload sole instance with, + * @param HTMLPurifier_URISchemeRegistry $prototype Optional prototype to overload sole instance with, * or bool true to reset to default registry. + * @return HTMLPurifier_URISchemeRegistry * @note Pass a registry object $prototype with a compatible interface and * the function will copy it and return it all further times. */ - public static function instance($prototype = null) { + public static function instance($prototype = null) + { static $instance = null; if ($prototype !== null) { $instance = $prototype; @@ -25,17 +27,22 @@ class HTMLPurifier_URISchemeRegistry /** * Cache of retrieved schemes. + * @type HTMLPurifier_URIScheme[] */ protected $schemes = array(); /** * Retrieves a scheme validator object - * @param $scheme String scheme name like http or mailto - * @param $config HTMLPurifier_Config object - * @param $config HTMLPurifier_Context object + * @param string $scheme String scheme name like http or mailto + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return HTMLPurifier_URIScheme */ - public function getScheme($scheme, $config, $context) { - if (!$config) $config = HTMLPurifier_Config::createDefault(); + public function getScheme($scheme, $config, $context) + { + if (!$config) { + $config = HTMLPurifier_Config::createDefault(); + } // important, otherwise attacker could include arbitrary file $allowed_schemes = $config->get('URI.AllowedSchemes'); @@ -45,24 +52,30 @@ class HTMLPurifier_URISchemeRegistry return; } - if (isset($this->schemes[$scheme])) return $this->schemes[$scheme]; - if (!isset($allowed_schemes[$scheme])) return; + if (isset($this->schemes[$scheme])) { + return $this->schemes[$scheme]; + } + if (!isset($allowed_schemes[$scheme])) { + return; + } $class = 'HTMLPurifier_URIScheme_' . $scheme; - if (!class_exists($class)) return; + if (!class_exists($class)) { + return; + } $this->schemes[$scheme] = new $class(); return $this->schemes[$scheme]; } /** * Registers a custom scheme to the cache, bypassing reflection. - * @param $scheme Scheme name - * @param $scheme_obj HTMLPurifier_URIScheme object + * @param string $scheme Scheme name + * @param HTMLPurifier_URIScheme $scheme_obj */ - public function register($scheme, $scheme_obj) { + public function register($scheme, $scheme_obj) + { $this->schemes[$scheme] = $scheme_obj; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/UnitConverter.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/UnitConverter.php index 545d426220..166f3bf306 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/UnitConverter.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/UnitConverter.php @@ -37,20 +37,24 @@ class HTMLPurifier_UnitConverter /** * Minimum bcmath precision for output. + * @type int */ protected $outputPrecision; /** * Bcmath precision for internal calculations. + * @type int */ protected $internalPrecision; /** - * Whether or not BCMath is available + * Whether or not BCMath is available. + * @type bool */ private $bcmath; - public function __construct($output_precision = 4, $internal_precision = 10, $force_no_bcmath = false) { + public function __construct($output_precision = 4, $internal_precision = 10, $force_no_bcmath = false) + { $this->outputPrecision = $output_precision; $this->internalPrecision = $internal_precision; $this->bcmath = !$force_no_bcmath && function_exists('bcmul'); @@ -63,6 +67,7 @@ class HTMLPurifier_UnitConverter * it before passing it here! * @param string $to_unit * Unit to convert to. + * @return HTMLPurifier_Length|bool * @note * About precision: This conversion function pays very special * attention to the incoming precision of values and attempts @@ -74,11 +79,13 @@ class HTMLPurifier_UnitConverter * and this causes some decimals to be excluded, those * decimals will be added on. */ - public function convert($length, $to_unit) { - - if (!$length->isValid()) return false; + public function convert($length, $to_unit) + { + if (!$length->isValid()) { + return false; + } - $n = $length->getN(); + $n = $length->getN(); $unit = $length->getUnit(); if ($n === '0' || $unit === false) { @@ -87,21 +94,29 @@ class HTMLPurifier_UnitConverter $state = $dest_state = false; foreach (self::$units as $k => $x) { - if (isset($x[$unit])) $state = $k; - if (isset($x[$to_unit])) $dest_state = $k; + if (isset($x[$unit])) { + $state = $k; + } + if (isset($x[$to_unit])) { + $dest_state = $k; + } + } + if (!$state || !$dest_state) { + return false; } - if (!$state || !$dest_state) return false; // Some calculations about the initial precision of the number; // this will be useful when we need to do final rounding. $sigfigs = $this->getSigFigs($n); - if ($sigfigs < $this->outputPrecision) $sigfigs = $this->outputPrecision; + if ($sigfigs < $this->outputPrecision) { + $sigfigs = $this->outputPrecision; + } // BCMath's internal precision deals only with decimals. Use // our default if the initial number has no decimals, or increase // it by how ever many decimals, thus, the number of guard digits // will always be greater than or equal to internalPrecision. - $log = (int) floor(log(abs($n), 10)); + $log = (int)floor(log(abs($n), 10)); $cp = ($log < 0) ? $this->internalPrecision - $log : $this->internalPrecision; // internal precision for ($i = 0; $i < 2; $i++) { @@ -152,14 +167,18 @@ class HTMLPurifier_UnitConverter } // Post-condition: $unit == $to_unit - if ($unit !== $to_unit) return false; + if ($unit !== $to_unit) { + return false; + } // Useful for debugging: //echo "
      n";
               //echo "$n\nsigfigs = $sigfigs\nnew_log = $new_log\nlog = $log\nrp = $rp\n
      \n"; $n = $this->round($n, $sigfigs); - if (strpos($n, '.') !== false) $n = rtrim($n, '0'); + if (strpos($n, '.') !== false) { + $n = rtrim($n, '0'); + } $n = rtrim($n, '.'); return new HTMLPurifier_Length($n, $unit); @@ -170,53 +189,84 @@ class HTMLPurifier_UnitConverter * @param string $n Decimal number * @return int number of sigfigs */ - public function getSigFigs($n) { + public function getSigFigs($n) + { $n = ltrim($n, '0+-'); $dp = strpos($n, '.'); // decimal position if ($dp === false) { $sigfigs = strlen(rtrim($n, '0')); } else { $sigfigs = strlen(ltrim($n, '0.')); // eliminate extra decimal character - if ($dp !== 0) $sigfigs--; + if ($dp !== 0) { + $sigfigs--; + } } return $sigfigs; } /** * Adds two numbers, using arbitrary precision when available. + * @param string $s1 + * @param string $s2 + * @param int $scale + * @return string */ - private function add($s1, $s2, $scale) { - if ($this->bcmath) return bcadd($s1, $s2, $scale); - else return $this->scale($s1 + $s2, $scale); + private function add($s1, $s2, $scale) + { + if ($this->bcmath) { + return bcadd($s1, $s2, $scale); + } else { + return $this->scale((float)$s1 + (float)$s2, $scale); + } } /** * Multiples two numbers, using arbitrary precision when available. + * @param string $s1 + * @param string $s2 + * @param int $scale + * @return string */ - private function mul($s1, $s2, $scale) { - if ($this->bcmath) return bcmul($s1, $s2, $scale); - else return $this->scale($s1 * $s2, $scale); + private function mul($s1, $s2, $scale) + { + if ($this->bcmath) { + return bcmul($s1, $s2, $scale); + } else { + return $this->scale((float)$s1 * (float)$s2, $scale); + } } /** * Divides two numbers, using arbitrary precision when available. + * @param string $s1 + * @param string $s2 + * @param int $scale + * @return string */ - private function div($s1, $s2, $scale) { - if ($this->bcmath) return bcdiv($s1, $s2, $scale); - else return $this->scale($s1 / $s2, $scale); + private function div($s1, $s2, $scale) + { + if ($this->bcmath) { + return bcdiv($s1, $s2, $scale); + } else { + return $this->scale((float)$s1 / (float)$s2, $scale); + } } /** * Rounds a number according to the number of sigfigs it should have, * using arbitrary precision when available. + * @param float $n + * @param int $sigfigs + * @return string */ - private function round($n, $sigfigs) { - $new_log = (int) floor(log(abs($n), 10)); // Number of digits left of decimal - 1 + private function round($n, $sigfigs) + { + $new_log = (int)floor(log(abs($n), 10)); // Number of digits left of decimal - 1 $rp = $sigfigs - $new_log - 1; // Number of decimal places needed $neg = $n < 0 ? '-' : ''; // Negative sign if ($this->bcmath) { if ($rp >= 0) { - $n = bcadd($n, $neg . '0.' . str_repeat('0', $rp) . '5', $rp + 1); + $n = bcadd($n, $neg . '0.' . str_repeat('0', $rp) . '5', $rp + 1); $n = bcdiv($n, '1', $rp); } else { // This algorithm partially depends on the standardized @@ -232,23 +282,26 @@ class HTMLPurifier_UnitConverter /** * Scales a float to $scale digits right of decimal point, like BCMath. + * @param float $r + * @param int $scale + * @return string */ - private function scale($r, $scale) { + private function scale($r, $scale) + { if ($scale < 0) { // The f sprintf type doesn't support negative numbers, so we // need to cludge things manually. First get the string. - $r = sprintf('%.0f', (float) $r); + $r = sprintf('%.0f', (float)$r); // Due to floating point precision loss, $r will more than likely // look something like 4652999999999.9234. We grab one more digit // than we need to precise from $r and then use that to round // appropriately. - $precise = (string) round(substr($r, 0, strlen($r) + $scale), -1); + $precise = (string)round(substr($r, 0, strlen($r) + $scale), -1); // Now we return it, truncating the zero that was rounded off. return substr($precise, 0, -1) . str_repeat('0', -$scale + 1); } - return sprintf('%.' . $scale . 'f', (float) $r); + return sprintf('%.' . $scale . 'f', (float)$r); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser.php index 68e72ae869..50cba6910d 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser.php @@ -7,58 +7,59 @@ class HTMLPurifier_VarParser { - const STRING = 1; - const ISTRING = 2; - const TEXT = 3; - const ITEXT = 4; - const INT = 5; - const FLOAT = 6; - const BOOL = 7; - const LOOKUP = 8; - const ALIST = 9; - const HASH = 10; - const MIXED = 11; + const STRING = 1; + const ISTRING = 2; + const TEXT = 3; + const ITEXT = 4; + const INT = 5; + const FLOAT = 6; + const BOOL = 7; + const LOOKUP = 8; + const ALIST = 9; + const HASH = 10; + const MIXED = 11; /** * Lookup table of allowed types. Mainly for backwards compatibility, but * also convenient for transforming string type names to the integer constants. */ - static public $types = array( - 'string' => self::STRING, - 'istring' => self::ISTRING, - 'text' => self::TEXT, - 'itext' => self::ITEXT, - 'int' => self::INT, - 'float' => self::FLOAT, - 'bool' => self::BOOL, - 'lookup' => self::LOOKUP, - 'list' => self::ALIST, - 'hash' => self::HASH, - 'mixed' => self::MIXED + public static $types = array( + 'string' => self::STRING, + 'istring' => self::ISTRING, + 'text' => self::TEXT, + 'itext' => self::ITEXT, + 'int' => self::INT, + 'float' => self::FLOAT, + 'bool' => self::BOOL, + 'lookup' => self::LOOKUP, + 'list' => self::ALIST, + 'hash' => self::HASH, + 'mixed' => self::MIXED ); /** * Lookup table of types that are string, and can have aliases or * allowed value lists. */ - static public $stringTypes = array( - self::STRING => true, - self::ISTRING => true, - self::TEXT => true, - self::ITEXT => true, + public static $stringTypes = array( + self::STRING => true, + self::ISTRING => true, + self::TEXT => true, + self::ITEXT => true, ); /** - * Validate a variable according to type. Throws - * HTMLPurifier_VarParserException if invalid. + * Validate a variable according to type. * It may return NULL as a valid type if $allow_null is true. * - * @param $var Variable to validate - * @param $type Type of variable, see HTMLPurifier_VarParser->types - * @param $allow_null Whether or not to permit null as a value - * @return Validated and type-coerced variable + * @param mixed $var Variable to validate + * @param int $type Type of variable, see HTMLPurifier_VarParser->types + * @param bool $allow_null Whether or not to permit null as a value + * @return string Validated and type-coerced variable + * @throws HTMLPurifier_VarParserException */ - final public function parse($var, $type, $allow_null = false) { + final public function parse($var, $type, $allow_null = false) + { if (is_string($type)) { if (!isset(HTMLPurifier_VarParser::$types[$type])) { throw new HTMLPurifier_VarParserException("Invalid type '$type'"); @@ -67,7 +68,9 @@ class HTMLPurifier_VarParser } } $var = $this->parseImplementation($var, $type, $allow_null); - if ($allow_null && $var === null) return null; + if ($allow_null && $var === null) { + return null; + } // These are basic checks, to make sure nothing horribly wrong // happened in our implementations. switch ($type) { @@ -75,27 +78,45 @@ class HTMLPurifier_VarParser case (self::ISTRING): case (self::TEXT): case (self::ITEXT): - if (!is_string($var)) break; - if ($type == self::ISTRING || $type == self::ITEXT) $var = strtolower($var); + if (!is_string($var)) { + break; + } + if ($type == self::ISTRING || $type == self::ITEXT) { + $var = strtolower($var); + } return $var; case (self::INT): - if (!is_int($var)) break; + if (!is_int($var)) { + break; + } return $var; case (self::FLOAT): - if (!is_float($var)) break; + if (!is_float($var)) { + break; + } return $var; case (self::BOOL): - if (!is_bool($var)) break; + if (!is_bool($var)) { + break; + } return $var; case (self::LOOKUP): case (self::ALIST): case (self::HASH): - if (!is_array($var)) break; + if (!is_array($var)) { + break; + } if ($type === self::LOOKUP) { - foreach ($var as $k) if ($k !== true) $this->error('Lookup table contains value other than true'); + foreach ($var as $k) { + if ($k !== true) { + $this->error('Lookup table contains value other than true'); + } + } } elseif ($type === self::ALIST) { $keys = array_keys($var); - if (array_keys($keys) !== $keys) $this->error('Indices for list are not uniform'); + if (array_keys($keys) !== $keys) { + $this->error('Indices for list are not uniform'); + } } return $var; case (self::MIXED): @@ -107,17 +128,24 @@ class HTMLPurifier_VarParser } /** - * Actually implements the parsing. Base implementation is to not + * Actually implements the parsing. Base implementation does not * do anything to $var. Subclasses should overload this! + * @param mixed $var + * @param int $type + * @param bool $allow_null + * @return string */ - protected function parseImplementation($var, $type, $allow_null) { + protected function parseImplementation($var, $type, $allow_null) + { return $var; } /** * Throws an exception. + * @throws HTMLPurifier_VarParserException */ - protected function error($msg) { + protected function error($msg) + { throw new HTMLPurifier_VarParserException($msg); } @@ -126,29 +154,45 @@ class HTMLPurifier_VarParser * @note This should not ever be called. It would be called if we * extend the allowed values of HTMLPurifier_VarParser without * updating subclasses. + * @param string $class + * @param int $type + * @throws HTMLPurifier_Exception */ - protected function errorInconsistent($class, $type) { - throw new HTMLPurifier_Exception("Inconsistency in $class: ".HTMLPurifier_VarParser::getTypeName($type)." not implemented"); + protected function errorInconsistent($class, $type) + { + throw new HTMLPurifier_Exception( + "Inconsistency in $class: " . HTMLPurifier_VarParser::getTypeName($type) . + " not implemented" + ); } /** * Generic error for if a type didn't work. + * @param mixed $var + * @param int $type */ - protected function errorGeneric($var, $type) { + protected function errorGeneric($var, $type) + { $vtype = gettype($var); - $this->error("Expected type ".HTMLPurifier_VarParser::getTypeName($type).", got $vtype"); + $this->error("Expected type " . HTMLPurifier_VarParser::getTypeName($type) . ", got $vtype"); } - static public function getTypeName($type) { + /** + * @param int $type + * @return string + */ + public static function getTypeName($type) + { static $lookup; if (!$lookup) { // Lazy load the alternative lookup table $lookup = array_flip(HTMLPurifier_VarParser::$types); } - if (!isset($lookup[$type])) return 'unknown'; + if (!isset($lookup[$type])) { + return 'unknown'; + } return $lookup[$type]; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser/Flexible.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser/Flexible.php index 21b87675a3..b15016c5b2 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser/Flexible.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser/Flexible.php @@ -7,28 +7,41 @@ */ class HTMLPurifier_VarParser_Flexible extends HTMLPurifier_VarParser { - - protected function parseImplementation($var, $type, $allow_null) { - if ($allow_null && $var === null) return null; + /** + * @param mixed $var + * @param int $type + * @param bool $allow_null + * @return array|bool|float|int|mixed|null|string + * @throws HTMLPurifier_VarParserException + */ + protected function parseImplementation($var, $type, $allow_null) + { + if ($allow_null && $var === null) { + return null; + } switch ($type) { // Note: if code "breaks" from the switch, it triggers a generic // exception to be thrown. Specific errors can be specifically // done here. - case self::MIXED : - case self::ISTRING : - case self::STRING : - case self::TEXT : - case self::ITEXT : + case self::MIXED: + case self::ISTRING: + case self::STRING: + case self::TEXT: + case self::ITEXT: return $var; - case self::INT : - if (is_string($var) && ctype_digit($var)) $var = (int) $var; + case self::INT: + if (is_string($var) && ctype_digit($var)) { + $var = (int)$var; + } return $var; - case self::FLOAT : - if ((is_string($var) && is_numeric($var)) || is_int($var)) $var = (float) $var; + case self::FLOAT: + if ((is_string($var) && is_numeric($var)) || is_int($var)) { + $var = (float)$var; + } return $var; - case self::BOOL : + case self::BOOL: if (is_int($var) && ($var === 0 || $var === 1)) { - $var = (bool) $var; + $var = (bool)$var; } elseif (is_string($var)) { if ($var == 'on' || $var == 'true' || $var == '1') { $var = true; @@ -39,45 +52,56 @@ class HTMLPurifier_VarParser_Flexible extends HTMLPurifier_VarParser } } return $var; - case self::ALIST : - case self::HASH : - case self::LOOKUP : + case self::ALIST: + case self::HASH: + case self::LOOKUP: if (is_string($var)) { // special case: technically, this is an array with // a single empty string item, but having an empty // array is more intuitive - if ($var == '') return array(); + if ($var == '') { + return array(); + } if (strpos($var, "\n") === false && strpos($var, "\r") === false) { // simplistic string to array method that only works // for simple lists of tag names or alphanumeric characters - $var = explode(',',$var); + $var = explode(',', $var); } else { $var = preg_split('/(,|[\n\r]+)/', $var); } // remove spaces - foreach ($var as $i => $j) $var[$i] = trim($j); + foreach ($var as $i => $j) { + $var[$i] = trim($j); + } if ($type === self::HASH) { // key:value,key2:value2 $nvar = array(); foreach ($var as $keypair) { $c = explode(':', $keypair, 2); - if (!isset($c[1])) continue; + if (!isset($c[1])) { + continue; + } $nvar[trim($c[0])] = trim($c[1]); } $var = $nvar; } } - if (!is_array($var)) break; + if (!is_array($var)) { + break; + } $keys = array_keys($var); if ($keys === array_keys($keys)) { - if ($type == self::ALIST) return $var; - elseif ($type == self::LOOKUP) { + if ($type == self::ALIST) { + return $var; + } elseif ($type == self::LOOKUP) { $new = array(); foreach ($var as $key) { $new[$key] = true; } return $new; - } else break; + } else { + break; + } } if ($type === self::ALIST) { trigger_error("Array list did not have consecutive integer indexes", E_USER_WARNING); @@ -86,7 +110,11 @@ class HTMLPurifier_VarParser_Flexible extends HTMLPurifier_VarParser if ($type === self::LOOKUP) { foreach ($var as $key => $value) { if ($value !== true) { - trigger_error("Lookup array has non-true value at key '$key'; maybe your input array was not indexed numerically", E_USER_WARNING); + trigger_error( + "Lookup array has non-true value at key '$key'; " . + "maybe your input array was not indexed numerically", + E_USER_WARNING + ); } $var[$key] = true; } @@ -97,7 +125,6 @@ class HTMLPurifier_VarParser_Flexible extends HTMLPurifier_VarParser } $this->errorGeneric($var, $type); } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser/Native.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser/Native.php index b02a6de54c..f11c318efb 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser/Native.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser/Native.php @@ -8,11 +8,24 @@ class HTMLPurifier_VarParser_Native extends HTMLPurifier_VarParser { - protected function parseImplementation($var, $type, $allow_null) { + /** + * @param mixed $var + * @param int $type + * @param bool $allow_null + * @return null|string + */ + protected function parseImplementation($var, $type, $allow_null) + { return $this->evalExpression($var); } - protected function evalExpression($expr) { + /** + * @param string $expr + * @return mixed + * @throws HTMLPurifier_VarParserException + */ + protected function evalExpression($expr) + { $var = null; $result = eval("\$var = $expr;"); if ($result === false) { @@ -20,7 +33,6 @@ class HTMLPurifier_VarParser_Native extends HTMLPurifier_VarParser } return $var; } - } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Zipper.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Zipper.php new file mode 100644 index 0000000000..6e21ea0703 --- /dev/null +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Zipper.php @@ -0,0 +1,157 @@ +front = $front; + $this->back = $back; + } + + /** + * Creates a zipper from an array, with a hole in the + * 0-index position. + * @param Array to zipper-ify. + * @return Tuple of zipper and element of first position. + */ + static public function fromArray($array) { + $z = new self(array(), array_reverse($array)); + $t = $z->delete(); // delete the "dummy hole" + return array($z, $t); + } + + /** + * Convert zipper back into a normal array, optionally filling in + * the hole with a value. (Usually you should supply a $t, unless you + * are at the end of the array.) + */ + public function toArray($t = NULL) { + $a = $this->front; + if ($t !== NULL) $a[] = $t; + for ($i = count($this->back)-1; $i >= 0; $i--) { + $a[] = $this->back[$i]; + } + return $a; + } + + /** + * Move hole to the next element. + * @param $t Element to fill hole with + * @return Original contents of new hole. + */ + public function next($t) { + if ($t !== NULL) array_push($this->front, $t); + return empty($this->back) ? NULL : array_pop($this->back); + } + + /** + * Iterated hole advancement. + * @param $t Element to fill hole with + * @param $i How many forward to advance hole + * @return Original contents of new hole, i away + */ + public function advance($t, $n) { + for ($i = 0; $i < $n; $i++) { + $t = $this->next($t); + } + return $t; + } + + /** + * Move hole to the previous element + * @param $t Element to fill hole with + * @return Original contents of new hole. + */ + public function prev($t) { + if ($t !== NULL) array_push($this->back, $t); + return empty($this->front) ? NULL : array_pop($this->front); + } + + /** + * Delete contents of current hole, shifting hole to + * next element. + * @return Original contents of new hole. + */ + public function delete() { + return empty($this->back) ? NULL : array_pop($this->back); + } + + /** + * Returns true if we are at the end of the list. + * @return bool + */ + public function done() { + return empty($this->back); + } + + /** + * Insert element before hole. + * @param Element to insert + */ + public function insertBefore($t) { + if ($t !== NULL) array_push($this->front, $t); + } + + /** + * Insert element after hole. + * @param Element to insert + */ + public function insertAfter($t) { + if ($t !== NULL) array_push($this->back, $t); + } + + /** + * Splice in multiple elements at hole. Functional specification + * in terms of array_splice: + * + * $arr1 = $arr; + * $old1 = array_splice($arr1, $i, $delete, $replacement); + * + * list($z, $t) = HTMLPurifier_Zipper::fromArray($arr); + * $t = $z->advance($t, $i); + * list($old2, $t) = $z->splice($t, $delete, $replacement); + * $arr2 = $z->toArray($t); + * + * assert($old1 === $old2); + * assert($arr1 === $arr2); + * + * NB: the absolute index location after this operation is + * *unchanged!* + * + * @param Current contents of hole. + */ + public function splice($t, $delete, $replacement) { + // delete + $old = array(); + $r = $t; + for ($i = $delete; $i > 0; $i--) { + $old[] = $r; + $r = $this->delete(); + } + // insert + for ($i = count($replacement)-1; $i >= 0; $i--) { + $this->insertAfter($r); + $r = $replacement[$i]; + } + return array($old, $r); + } +} diff --git a/vendor/ezyang/htmlpurifier/maintenance/PH5P.php b/vendor/ezyang/htmlpurifier/maintenance/PH5P.php index 96d0d13f92..9d83dcbf55 100644 --- a/vendor/ezyang/htmlpurifier/maintenance/PH5P.php +++ b/vendor/ezyang/htmlpurifier/maintenance/PH5P.php @@ -1,5 +1,6 @@ tree->save(); } - private function char() { + private function char() + { return ($this->char < $this->EOF) ? $this->data[$this->char] : false; } - private function character($s, $l = 0) { + private function character($s, $l = 0) + { if($s + $l < $this->EOF) { if($l === 0) { return $this->data[$s]; @@ -100,11 +105,13 @@ class HTML5 { } } - private function characters($char_class, $start) { + private function characters($char_class, $start) + { return preg_replace('#^(['.$char_class.']+).*#s', '\\1', substr($this->data, $start)); } - private function dataState() { + private function dataState() + { // Consume the next input character $this->char++; $char = $this->char(); @@ -204,7 +211,8 @@ class HTML5 { } } - private function entityDataState() { + private function entityDataState() + { // Attempt to consume an entity. $entity = $this->entity(); @@ -217,7 +225,8 @@ class HTML5 { $this->state = 'data'; } - private function tagOpenState() { + private function tagOpenState() + { switch($this->content_model) { case self::RCDATA: case self::CDATA: @@ -302,7 +311,8 @@ class HTML5 { } } - private function closeTagOpenState() { + private function closeTagOpenState() + { $next_node = strtolower($this->characters('A-Za-z', $this->char + 1)); $the_same = count($this->tree->stack) > 0 && $next_node === end($this->tree->stack)->nodeName; @@ -375,7 +385,8 @@ class HTML5 { } } - private function tagNameState() { + private function tagNameState() + { // Consume the next input character: $this->char++; $char = $this->character($this->char); @@ -419,7 +430,8 @@ class HTML5 { } } - private function beforeAttributeNameState() { + private function beforeAttributeNameState() + { // Consume the next input character: $this->char++; $char = $this->character($this->char); @@ -468,7 +480,8 @@ class HTML5 { } } - private function attributeNameState() { + private function attributeNameState() + { // Consume the next input character: $this->char++; $char = $this->character($this->char); @@ -519,7 +532,8 @@ class HTML5 { } } - private function afterAttributeNameState() { + private function afterAttributeNameState() + { // Consume the next input character: $this->char++; $char = $this->character($this->char); @@ -573,7 +587,8 @@ class HTML5 { } } - private function beforeAttributeValueState() { + private function beforeAttributeValueState() + { // Consume the next input character: $this->char++; $char = $this->character($this->char); @@ -621,7 +636,8 @@ class HTML5 { } } - private function attributeValueDoubleQuotedState() { + private function attributeValueDoubleQuotedState() + { // Consume the next input character: $this->char++; $char = $this->character($this->char); @@ -656,7 +672,8 @@ class HTML5 { } } - private function attributeValueSingleQuotedState() { + private function attributeValueSingleQuotedState() + { // Consume the next input character: $this->char++; $char = $this->character($this->char); @@ -691,7 +708,8 @@ class HTML5 { } } - private function attributeValueUnquotedState() { + private function attributeValueUnquotedState() + { // Consume the next input character: $this->char++; $char = $this->character($this->char); @@ -727,7 +745,8 @@ class HTML5 { } } - private function entityInAttributeValueState() { + private function entityInAttributeValueState() + { // Attempt to consume an entity. $entity = $this->entity(); @@ -741,7 +760,8 @@ class HTML5 { $this->emitToken($char); } - private function bogusCommentState() { + private function bogusCommentState() + { /* Consume every character up to the first U+003E GREATER-THAN SIGN character (>) or the end of the file (EOF), whichever comes first. Emit a comment token whose data is the concatenation of all the characters @@ -767,7 +787,8 @@ class HTML5 { } } - private function markupDeclarationOpenState() { + private function markupDeclarationOpenState() + { /* If the next two characters are both U+002D HYPHEN-MINUS (-) characters, consume those two characters, create a comment token whose data is the empty string, and switch to the comment state. */ @@ -795,7 +816,8 @@ class HTML5 { } } - private function commentState() { + private function commentState() + { /* Consume the next input character: */ $this->char++; $char = $this->char(); @@ -821,7 +843,8 @@ class HTML5 { } } - private function commentDashState() { + private function commentDashState() + { /* Consume the next input character: */ $this->char++; $char = $this->char(); @@ -848,7 +871,8 @@ class HTML5 { } } - private function commentEndState() { + private function commentEndState() + { /* Consume the next input character: */ $this->char++; $char = $this->char(); @@ -871,7 +895,8 @@ class HTML5 { } } - private function doctypeState() { + private function doctypeState() + { /* Consume the next input character: */ $this->char++; $char = $this->char(); @@ -885,7 +910,8 @@ class HTML5 { } } - private function beforeDoctypeNameState() { + private function beforeDoctypeNameState() + { /* Consume the next input character: */ $this->char++; $char = $this->char(); @@ -932,7 +958,8 @@ class HTML5 { } } - private function doctypeNameState() { + private function doctypeNameState() + { /* Consume the next input character: */ $this->char++; $char = $this->char(); @@ -961,7 +988,8 @@ class HTML5 { : true; } - private function afterDoctypeNameState() { + private function afterDoctypeNameState() + { /* Consume the next input character: */ $this->char++; $char = $this->char(); @@ -984,7 +1012,8 @@ class HTML5 { } } - private function bogusDoctypeState() { + private function bogusDoctypeState() + { /* Consume the next input character: */ $this->char++; $char = $this->char(); @@ -1003,14 +1032,15 @@ class HTML5 { } } - private function entity() { + private function entity() + { $start = $this->char; // This section defines how to consume an entity. This definition is // used when parsing entities in text and in attributes. // The behaviour depends on the identity of the next character (the - // one immediately after the U+0026 AMPERSAND character): + // one immediately after the U+0026 AMPERSAND character): switch($this->character($this->char + 1)) { // U+0023 NUMBER SIGN (#) @@ -1088,7 +1118,8 @@ class HTML5 { return html_entity_decode('&'.$entity.';', ENT_QUOTES, 'UTF-8'); } - private function emitToken($token) { + private function emitToken($token) + { $emit = $this->tree->emitToken($token); if(is_int($emit)) { @@ -1099,7 +1130,8 @@ class HTML5 { } } - private function EOF() { + private function EOF() + { $this->state = null; $this->tree->emitToken(array( 'type' => self::EOF @@ -1107,7 +1139,8 @@ class HTML5 { } } -class HTML5TreeConstructer { +class HTML5TreeConstructer +{ public $stack = array(); private $phase; @@ -1159,7 +1192,8 @@ class HTML5TreeConstructer { const MARKER = 0; - public function __construct() { + public function __construct() + { $this->phase = self::INIT_PHASE; $this->mode = self::BEFOR_HEAD; $this->dom = new DOMDocument; @@ -1171,7 +1205,8 @@ class HTML5TreeConstructer { } // Process tag tokens - public function emitToken($token) { + public function emitToken($token) + { switch($this->phase) { case self::INIT_PHASE: return $this->initPhase($token); break; case self::ROOT_PHASE: return $this->rootElementPhase($token); break; @@ -1180,7 +1215,8 @@ class HTML5TreeConstructer { } } - private function initPhase($token) { + private function initPhase($token) + { /* Initially, the tree construction stage must handle each token emitted from the tokenisation stage as follows: */ @@ -1230,7 +1266,8 @@ class HTML5TreeConstructer { } } - private function rootElementPhase($token) { + private function rootElementPhase($token) + { /* After the initial phase, as each token is emitted from the tokenisation stage, it must be processed as described in this section. */ @@ -1277,7 +1314,8 @@ class HTML5TreeConstructer { } } - private function mainPhase($token) { + private function mainPhase($token) + { /* Tokens in the main phase must be handled as follows: */ /* A DOCTYPE token */ @@ -1327,7 +1365,8 @@ class HTML5TreeConstructer { } } - private function beforeHead($token) { + private function beforeHead($token) + { /* Handle the token as follows: */ /* A character token that is one of one of U+0009 CHARACTER TABULATION, @@ -1381,7 +1420,8 @@ class HTML5TreeConstructer { } } - private function inHead($token) { + private function inHead($token) + { /* Handle the token as follows: */ /* A character token that is one of one of U+0009 CHARACTER TABULATION, @@ -1505,7 +1545,8 @@ class HTML5TreeConstructer { } } - private function afterHead($token) { + private function afterHead($token) + { /* Handle the token as follows: */ /* A character token that is one of one of U+0009 CHARACTER TABULATION, @@ -1561,7 +1602,8 @@ class HTML5TreeConstructer { } } - private function inBody($token) { + private function inBody($token) + { /* Handle the token as follows: */ switch($token['type']) { @@ -2161,7 +2203,7 @@ class HTML5TreeConstructer { if($this->elementInScope($token['name'])) { $this->generateImpliedEndTags(); - } + } if(end($this->stack)->nodeName !== $token['name']) { /* Now, if the current node is not an element with the @@ -2540,7 +2582,7 @@ class HTML5TreeConstructer { for($x = count($this->stack) - $n; $x >= $n; $x--) { array_pop($this->stack); } - + } else { $category = $this->getElementCategory($node); @@ -2559,7 +2601,8 @@ class HTML5TreeConstructer { } } - private function inTable($token) { + private function inTable($token) + { $clear = array('html', 'table'); /* A character token that is one of one of U+0009 CHARACTER TABULATION, @@ -2736,7 +2779,8 @@ class HTML5TreeConstructer { } } - private function inCaption($token) { + private function inCaption($token) + { /* An end tag whose tag name is "caption" */ if($token['type'] === HTML5::ENDTAG && $token['name'] === 'caption') { /* If the stack of open elements does not have an element in table @@ -2804,7 +2848,8 @@ class HTML5TreeConstructer { } } - private function inColumnGroup($token) { + private function inColumnGroup($token) + { /* A character token that is one of one of U+0009 CHARACTER TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), or U+0020 SPACE */ @@ -2861,7 +2906,8 @@ class HTML5TreeConstructer { } } - private function inTableBody($token) { + private function inTableBody($token) + { $clear = array('tbody', 'tfoot', 'thead', 'html'); /* A start tag whose tag name is "tr" */ @@ -2947,7 +2993,8 @@ class HTML5TreeConstructer { } } - private function inRow($token) { + private function inRow($token) + { $clear = array('tr', 'html'); /* A start tag whose tag name is one of: "th", "td" */ @@ -3032,7 +3079,8 @@ class HTML5TreeConstructer { } } - private function inCell($token) { + private function inCell($token) + { /* An end tag whose tag name is one of: "td", "th" */ if($token['type'] === HTML5::ENDTAG && ($token['name'] === 'td' || $token['name'] === 'th')) { @@ -3139,7 +3187,8 @@ class HTML5TreeConstructer { } } - private function inSelect($token) { + private function inSelect($token) + { /* Handle the token as follows: */ /* A character token */ @@ -3288,7 +3337,8 @@ class HTML5TreeConstructer { } } - private function afterBody($token) { + private function afterBody($token) + { /* Handle the token as follows: */ /* A character token that is one of one of U+0009 CHARACTER TABULATION, @@ -3327,7 +3377,8 @@ class HTML5TreeConstructer { } } - private function inFrameset($token) { + private function inFrameset($token) + { /* Handle the token as follows: */ /* A character token that is one of one of U+0009 CHARACTER TABULATION, @@ -3390,7 +3441,8 @@ class HTML5TreeConstructer { } } - private function afterFrameset($token) { + private function afterFrameset($token) + { /* Handle the token as follows: */ /* A character token that is one of one of U+0009 CHARACTER TABULATION, @@ -3425,7 +3477,8 @@ class HTML5TreeConstructer { } } - private function trailingEndPhase($token) { + private function trailingEndPhase($token) + { /* After the main phase, as each token is emitted from the tokenisation stage, it must be processed as described in this section. */ @@ -3465,7 +3518,8 @@ class HTML5TreeConstructer { } } - private function insertElement($token, $append = true) { + private function insertElement($token, $append = true) + { $el = $this->dom->createElement($token['name']); foreach($token['attr'] as $attr) { @@ -3480,17 +3534,20 @@ class HTML5TreeConstructer { return $el; } - private function insertText($data) { + private function insertText($data) + { $text = $this->dom->createTextNode($data); $this->appendToRealParent($text); } - private function insertComment($data) { + private function insertComment($data) + { $comment = $this->dom->createComment($data); $this->appendToRealParent($comment); } - private function appendToRealParent($node) { + private function appendToRealParent($node) + { if($this->foster_parent === null) { end($this->stack)->appendChild($node); @@ -3518,7 +3575,8 @@ class HTML5TreeConstructer { } } - private function elementInScope($el, $table = false) { + private function elementInScope($el, $table = false) + { if(is_array($el)) { foreach($el as $element) { if($this->elementInScope($element, $table)) { @@ -3567,7 +3625,8 @@ class HTML5TreeConstructer { } } - private function reconstructActiveFormattingElements() { + private function reconstructActiveFormattingElements() + { /* 1. If there are no entries in the list of active formatting elements, then there is nothing to reconstruct; stop this algorithm. */ $formatting_elements = count($this->a_formatting); @@ -3638,7 +3697,8 @@ class HTML5TreeConstructer { } } - private function clearTheActiveFormattingElementsUpToTheLastMarker() { + private function clearTheActiveFormattingElementsUpToTheLastMarker() + { /* When the steps below require the UA to clear the list of active formatting elements up to the last marker, the UA must perform the following steps: */ @@ -3659,7 +3719,8 @@ class HTML5TreeConstructer { } } - private function generateImpliedEndTags(array $exclude = array()) { + private function generateImpliedEndTags(array $exclude = array()) + { /* When the steps below require the UA to generate implied end tags, then, if the current node is a dd element, a dt element, an li element, a p element, a td element, a th element, or a tr element, the UA must @@ -3673,7 +3734,8 @@ class HTML5TreeConstructer { } } - private function getElementCategory($name) { + private function getElementCategory($name) + { if(in_array($name, $this->special)) return self::SPECIAL; @@ -3687,7 +3749,8 @@ class HTML5TreeConstructer { return self::PHRASING; } - private function clearStackToTableContext($elements) { + private function clearStackToTableContext($elements) + { /* When the steps above require the UA to clear the stack back to a table context, it means that the UA must, while the current node is not a table element or an html element, pop elements from the stack of open @@ -3704,7 +3767,8 @@ class HTML5TreeConstructer { } } - private function resetInsertionMode() { + private function resetInsertionMode() + { /* 1. Let last be false. */ $last = false; $leng = count($this->stack); @@ -3802,7 +3866,8 @@ class HTML5TreeConstructer { } } - private function closeCell() { + private function closeCell() + { /* If the stack of open elements has a td or th element in table scope, then act as if an end tag token with that tag name had been seen. */ foreach(array('td', 'th') as $cell) { @@ -3817,8 +3882,8 @@ class HTML5TreeConstructer { } } - public function save() { + public function save() + { return $this->dom; } } -?> diff --git a/vendor/ezyang/htmlpurifier/maintenance/common.php b/vendor/ezyang/htmlpurifier/maintenance/common.php index 888c7daf94..342bc205ab 100644 --- a/vendor/ezyang/htmlpurifier/maintenance/common.php +++ b/vendor/ezyang/htmlpurifier/maintenance/common.php @@ -1,6 +1,7 @@ copyr($dir, 'standalone/' . $dir); } @@ -75,7 +80,8 @@ function make_dir_standalone($dir) { * Copies the contents of a file to the standalone directory * @param string $file File to copy */ -function make_file_standalone($file) { +function make_file_standalone($file) +{ global $FS; $FS->mkdirr('standalone/' . dirname($file)); copy_and_remove_includes($file, 'standalone/' . $file); @@ -88,7 +94,8 @@ function make_file_standalone($file) { * @param string $file Original file * @param string $sfile New location of file */ -function copy_and_remove_includes($file, $sfile) { +function copy_and_remove_includes($file, $sfile) +{ $contents = file_get_contents($file); if (strrchr($file, '.') === '.php') $contents = replace_includes($contents); return file_put_contents($sfile, $contents); @@ -98,7 +105,8 @@ function copy_and_remove_includes($file, $sfile) { * @param $matches preg_replace_callback matches array, where index 1 * is the filename to include */ -function replace_includes_callback($matches) { +function replace_includes_callback($matches) +{ $file = $matches[1]; $preserve = array( // PEAR (external) diff --git a/vendor/ezyang/htmlpurifier/maintenance/old-extract-schema.php b/vendor/ezyang/htmlpurifier/maintenance/old-extract-schema.php index bd55feaa6f..514a08dd93 100644 --- a/vendor/ezyang/htmlpurifier/maintenance/old-extract-schema.php +++ b/vendor/ezyang/htmlpurifier/maintenance/old-extract-schema.php @@ -29,7 +29,8 @@ require_once 'HTMLPurifier/Filter/ExtractStyleBlocks.php'; /** * Takes a hash and saves its contents to library/HTMLPurifier/ConfigSchema/ */ -function saveHash($hash) { +function saveHash($hash) +{ if ($hash === false) return; $dir = realpath(dirname(__FILE__) . '/../library/HTMLPurifier/ConfigSchema'); $name = $hash['ID'] . '.txt'; diff --git a/vendor/ezyang/htmlpurifier/maintenance/update-freshmeat.php b/vendor/ezyang/htmlpurifier/maintenance/update-freshmeat.php index 5295c04300..4d73c76ae1 100644 --- a/vendor/ezyang/htmlpurifier/maintenance/update-freshmeat.php +++ b/vendor/ezyang/htmlpurifier/maintenance/update-freshmeat.php @@ -39,7 +39,8 @@ class XmlRpc_Freshmeat * @param $username Username to login with * @param $password Password to login with */ - public function __construct($username = null, $password = null) { + public function __construct($username = null, $password = null) + { if ($username && $password) { $this->login($username, $password); } @@ -48,7 +49,8 @@ class XmlRpc_Freshmeat /** * Performs a raw XML RPC call to self::URL */ - protected function call($method, $params) { + protected function call($method, $params) + { $request = xmlrpc_encode_request($method, $params, $this->encodeOptions); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, self::URL); @@ -73,7 +75,8 @@ class XmlRpc_Freshmeat * @param $name Name of method to call, can be methodName or method_name * @param $args Arguments of call, in form array('key1', 'val1', 'key2' ...) */ - public function __call($name, $args) { + public function __call($name, $args) + { $method = $this->camelToUnderscore($name); $params = array(); if ($this->sid) $params['SID'] = $this->sid; @@ -102,7 +105,8 @@ class XmlRpc_Freshmeat /** * Munge methodName to method_name */ - private function camelToUnderscore($name) { + private function camelToUnderscore($name) + { $method = ''; for ($i = 0, $c = strlen($name); $i < $c; $i++) { $v = $name[$i]; @@ -115,7 +119,8 @@ class XmlRpc_Freshmeat /** * Automatically logout at end of scope */ - public function __destruct() { + public function __destruct() + { if ($this->sid) $this->logout(); } diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/htmlpurifier.php b/vendor/ezyang/htmlpurifier/plugins/phorum/htmlpurifier.php index 6f74fc8c98..f66d8c36cd 100644 --- a/vendor/ezyang/htmlpurifier/plugins/phorum/htmlpurifier.php +++ b/vendor/ezyang/htmlpurifier/plugins/phorum/htmlpurifier.php @@ -126,7 +126,8 @@ function phorum_htmlpurifier_format($data) /** * Generates a signature based on a message array */ -function phorum_htmlpurifier_generate_sig($row) { +function phorum_htmlpurifier_generate_sig($row) +{ $phorum_sig = ''; if(isset($row["user"]["signature"]) && isset($row['meta']['show_signature']) && $row['meta']['show_signature']==1){ @@ -141,7 +142,8 @@ function phorum_htmlpurifier_generate_sig($row) { /** * Generates an edit message based on a message array */ -function phorum_htmlpurifier_generate_editmessage($row) { +function phorum_htmlpurifier_generate_editmessage($row) +{ $PHORUM = $GLOBALS['PHORUM']; $editmessage = ''; if(isset($row['meta']['edit_count']) && $row['meta']['edit_count'] > 0) { @@ -160,7 +162,8 @@ function phorum_htmlpurifier_generate_editmessage($row) { * Removes the signature and edit message from a message * @param $row Message passed by reference */ -function phorum_htmlpurifier_remove_sig_and_editmessage(&$row) { +function phorum_htmlpurifier_remove_sig_and_editmessage(&$row) +{ $signature = phorum_htmlpurifier_generate_sig($row); $editmessage = phorum_htmlpurifier_generate_editmessage($row); $replacements = array(); @@ -178,7 +181,8 @@ function phorum_htmlpurifier_remove_sig_and_editmessage(&$row) { * @note This function could generate the actual cache entries, but * since there's data missing that must be deferred to the first read */ -function phorum_htmlpurifier_posting($message) { +function phorum_htmlpurifier_posting($message) +{ $PHORUM = $GLOBALS["PHORUM"]; unset($message['meta']['body_cache']); // invalidate the cache $message['meta']['body_cache_serial'] = $PHORUM['mod_htmlpurifier']['body_cache_serial']; @@ -188,7 +192,8 @@ function phorum_htmlpurifier_posting($message) { /** * Overload quoting mechanism to prevent default, mail-style quote from happening */ -function phorum_htmlpurifier_quote($array) { +function phorum_htmlpurifier_quote($array) +{ $PHORUM = $GLOBALS["PHORUM"]; $purifier =& HTMLPurifier::getInstance(); $text = $purifier->purify($array[1]); @@ -200,8 +205,8 @@ function phorum_htmlpurifier_quote($array) { * Ensure that our format hook is processed last. Also, loads the library. * @credits */ -function phorum_htmlpurifier_common() { - +function phorum_htmlpurifier_common() +{ require_once(dirname(__FILE__).'/htmlpurifier/HTMLPurifier.auto.php'); require(dirname(__FILE__).'/init-config.php'); @@ -232,7 +237,8 @@ function phorum_htmlpurifier_common() { * Pre-emptively performs purification if it looks like a WYSIWYG editor * is being used */ -function phorum_htmlpurifier_before_editor($message) { +function phorum_htmlpurifier_before_editor($message) +{ if (!empty($GLOBALS['PHORUM']['mod_htmlpurifier']['wysiwyg'])) { if (!empty($message['body'])) { $body = $message['body']; @@ -248,7 +254,8 @@ function phorum_htmlpurifier_before_editor($message) { return $message; } -function phorum_htmlpurifier_editor_after_subject() { +function phorum_htmlpurifier_editor_after_subject() +{ // don't show this message if it's a WYSIWYG editor, since it will // then be handled automatically if (!empty($GLOBALS['PHORUM']['mod_htmlpurifier']['wysiwyg'])) { diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/init-config.php b/vendor/ezyang/htmlpurifier/plugins/phorum/init-config.php index aa7b15599a..e19787b4bc 100644 --- a/vendor/ezyang/htmlpurifier/plugins/phorum/init-config.php +++ b/vendor/ezyang/htmlpurifier/plugins/phorum/init-config.php @@ -5,7 +5,8 @@ * or a module configuration value * @return Instance of HTMLPurifier_Config */ -function phorum_htmlpurifier_get_config($default = false) { +function phorum_htmlpurifier_get_config($default = false) +{ global $PHORUM; $config_exists = phorum_htmlpurifier_config_file_exists(); if ($default || $config_exists || !isset($PHORUM['mod_htmlpurifier']['config'])) { @@ -21,7 +22,8 @@ function phorum_htmlpurifier_get_config($default = false) { return $config; } -function phorum_htmlpurifier_config_file_exists() { +function phorum_htmlpurifier_config_file_exists() +{ return file_exists(dirname(__FILE__) . '/config.php'); } diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/migrate.bbcode.php b/vendor/ezyang/htmlpurifier/plugins/phorum/migrate.bbcode.php index 24f0ec4a9e..0d09194556 100644 --- a/vendor/ezyang/htmlpurifier/plugins/phorum/migrate.bbcode.php +++ b/vendor/ezyang/htmlpurifier/plugins/phorum/migrate.bbcode.php @@ -23,7 +23,8 @@ require_once(dirname(__FILE__) . "/../bbcode/bbcode.php"); * 'format' hook style function that will be called to convert * legacy markup into HTML. */ -function phorum_htmlpurifier_migrate($data) { +function phorum_htmlpurifier_migrate($data) +{ return phorum_mod_bbcode_format($data); // bbcode's 'format' hook } diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/settings/form.php b/vendor/ezyang/htmlpurifier/plugins/phorum/settings/form.php index a47a5fae7d..9b6ad5f39e 100644 --- a/vendor/ezyang/htmlpurifier/plugins/phorum/settings/form.php +++ b/vendor/ezyang/htmlpurifier/plugins/phorum/settings/form.php @@ -1,6 +1,7 @@ show(); } -function phorum_htmlpurifier_show_config_info() { +function phorum_htmlpurifier_show_config_info() +{ global $PHORUM; // update mod_htmlpurifier for housekeeping diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/settings/migrate-sigs-form.php b/vendor/ezyang/htmlpurifier/plugins/phorum/settings/migrate-sigs-form.php index 2d63ebe483..abea3b51d7 100644 --- a/vendor/ezyang/htmlpurifier/plugins/phorum/settings/migrate-sigs-form.php +++ b/vendor/ezyang/htmlpurifier/plugins/phorum/settings/migrate-sigs-form.php @@ -1,7 +1,7 @@ hidden("module", "modsettings"); $frm->hidden("mod", "htmlpurifier"); diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/settings/migrate-sigs.php b/vendor/ezyang/htmlpurifier/plugins/phorum/settings/migrate-sigs.php index 81c1f0ba91..5ea9cd0b81 100644 --- a/vendor/ezyang/htmlpurifier/plugins/phorum/settings/migrate-sigs.php +++ b/vendor/ezyang/htmlpurifier/plugins/phorum/settings/migrate-sigs.php @@ -1,6 +1,7 @@ mods/htmlpurifier/config.php already exists. To change @@ -19,7 +20,8 @@ function phorum_htmlpurifier_save_settings() { } } -function phorum_htmlpurifier_commit_settings() { +function phorum_htmlpurifier_commit_settings() +{ global $PHORUM; return phorum_db_update_settings(array("mod_htmlpurifier"=>$PHORUM["mod_htmlpurifier"])); } diff --git a/vendor/ezyang/htmlpurifier/tests/CliTestCase.php b/vendor/ezyang/htmlpurifier/tests/CliTestCase.php index 36b728e161..0fc20ef05b 100644 --- a/vendor/ezyang/htmlpurifier/tests/CliTestCase.php +++ b/vendor/ezyang/htmlpurifier/tests/CliTestCase.php @@ -15,19 +15,23 @@ class CliTestCase * @param $command Command to execute to retrieve XML * @param $xml Whether or not to suppress error messages */ - public function __construct($command, $quiet = false, $size = false) { + public function __construct($command, $quiet = false, $size = false) + { $this->_command = $command; $this->_quiet = $quiet; $this->_size = $size; } - public function getLabel() { + public function getLabel() + { return $this->_command; } - public function run($reporter) { + public function run($reporter) + { if (!$this->_quiet) $reporter->paintFormattedMessage('Running ['.$this->_command.']'); return $this->_invokeCommand($this->_command, $reporter); } - public function _invokeCommand($command, $reporter) { + public function _invokeCommand($command, $reporter) + { $xml = shell_exec($command); if (! $xml) { if (!$this->_quiet) { @@ -59,11 +63,13 @@ class CliTestCase } return true; } - public function _createParser($reporter) { + public function _createParser($reporter) + { $parser = new SimpleTestXmlParser($reporter); return $parser; } - public function getSize() { + public function getSize() + { // This code properly does the dry run and allows for proper test // case reporting but it's REALLY slow, so I don't recommend it. if ($this->_size === false) { @@ -73,7 +79,8 @@ class CliTestCase } return $this->_size; } - public function _errorHandler($a, $b, $c, $d) { + public function _errorHandler($a, $b, $c, $d) + { $this->_errors[] = array($a, $b, $c, $d); // see set_error_handler() } } diff --git a/vendor/ezyang/htmlpurifier/tests/Debugger.php b/vendor/ezyang/htmlpurifier/tests/Debugger.php index 45e107f448..918320a440 100644 --- a/vendor/ezyang/htmlpurifier/tests/Debugger.php +++ b/vendor/ezyang/htmlpurifier/tests/Debugger.php @@ -21,35 +21,43 @@ TODO /**#@+ * Convenience global functions. Corresponds to method on Debugger. */ -function paint($mixed) { +function paint($mixed) +{ $Debugger =& Debugger::instance(); return $Debugger->paint($mixed); } -function paintIf($mixed, $conditional) { +function paintIf($mixed, $conditional) +{ $Debugger =& Debugger::instance(); return $Debugger->paintIf($mixed, $conditional); } -function paintWhen($mixed, $scopes = array()) { +function paintWhen($mixed, $scopes = array()) +{ $Debugger =& Debugger::instance(); return $Debugger->paintWhen($mixed, $scopes); } -function paintIfWhen($mixed, $conditional, $scopes = array()) { +function paintIfWhen($mixed, $conditional, $scopes = array()) +{ $Debugger =& Debugger::instance(); return $Debugger->paintIfWhen($mixed, $conditional, $scopes); } -function addScope($id = false) { +function addScope($id = false) +{ $Debugger =& Debugger::instance(); return $Debugger->addScope($id); } -function removeScope($id) { +function removeScope($id) +{ $Debugger =& Debugger::instance(); return $Debugger->removeScope($id); } -function resetScopes() { +function resetScopes() +{ $Debugger =& Debugger::instance(); return $Debugger->resetScopes(); } -function isInScopes($array = array()) { +function isInScopes($array = array()) +{ $Debugger =& Debugger::instance(); return $Debugger->isInScopes($array); } @@ -68,7 +76,8 @@ class Debugger public $scope_nextID = 1; public $add_pre = true; - public function Debugger() { + public function Debugger() + { $this->add_pre = !extension_loaded('xdebug'); } @@ -78,46 +87,54 @@ class Debugger return $soleInstance; } - public function paintIf($mixed, $conditional) { + public function paintIf($mixed, $conditional) + { if (!$conditional) return; $this->paint($mixed); } - public function paintWhen($mixed, $scopes = array()) { + public function paintWhen($mixed, $scopes = array()) + { if (!$this->isInScopes($scopes)) return; $this->paint($mixed); } - public function paintIfWhen($mixed, $conditional, $scopes = array()) { + public function paintIfWhen($mixed, $conditional, $scopes = array()) + { if (!$conditional) return; if (!$this->isInScopes($scopes)) return; $this->paint($mixed); } - public function paint($mixed) { + public function paint($mixed) + { $this->paints++; if($this->add_pre) echo '
      ';
               var_dump($mixed);
               if($this->add_pre) echo '
      '; } - public function addScope($id = false) { + public function addScope($id = false) + { if ($id == false) { $id = $this->scope_nextID++; } $this->current_scopes[$id] = true; } - public function removeScope($id) { + public function removeScope($id) + { if (isset($this->current_scopes[$id])) unset($this->current_scopes[$id]); } - public function resetScopes() { + public function resetScopes() + { $this->current_scopes = array(); $this->scope_nextID = 1; } - public function isInScopes($scopes = array()) { + public function isInScopes($scopes = array()) + { if (empty($this->current_scopes)) { return false; } diff --git a/vendor/ezyang/htmlpurifier/tests/FSTools/FileSystemHarness.php b/vendor/ezyang/htmlpurifier/tests/FSTools/FileSystemHarness.php index 710196e4f1..8e2e21910d 100644 --- a/vendor/ezyang/htmlpurifier/tests/FSTools/FileSystemHarness.php +++ b/vendor/ezyang/htmlpurifier/tests/FSTools/FileSystemHarness.php @@ -11,7 +11,8 @@ class FSTools_FileSystemHarness extends UnitTestCase protected $dir, $oldDir; - function __construct() { + public function __construct() + { parent::__construct(); $this->dir = 'tmp/' . md5(uniqid(rand(), true)) . '/'; mkdir($this->dir); @@ -19,15 +20,18 @@ class FSTools_FileSystemHarness extends UnitTestCase } - function __destruct() { + public function __destruct() + { FSTools::singleton()->rmdirr($this->dir); } - function setup() { + public function setup() + { chdir($this->dir); } - function tearDown() { + public function tearDown() + { chdir($this->oldDir); } diff --git a/vendor/ezyang/htmlpurifier/tests/FSTools/FileTest.php b/vendor/ezyang/htmlpurifier/tests/FSTools/FileTest.php index e9b703a2db..5952dcd57f 100644 --- a/vendor/ezyang/htmlpurifier/tests/FSTools/FileTest.php +++ b/vendor/ezyang/htmlpurifier/tests/FSTools/FileTest.php @@ -8,7 +8,8 @@ require_once 'FSTools/FileSystemHarness.php'; class FSTools_FileTest extends FSTools_FileSystemHarness { - function test() { + public function test() + { $name = 'test.txt'; $file = new FSTools_File($name); $this->assertFalse($file->exists()); @@ -19,14 +20,16 @@ class FSTools_FileTest extends FSTools_FileSystemHarness $this->assertFalse($file->exists()); } - function testGetNonExistent() { + public function testGetNonExistent() + { $name = 'notfound.txt'; $file = new FSTools_File($name); $this->expectError(); $this->assertFalse($file->get()); } - function testHandle() { + public function testHandle() + { $file = new FSTools_File('foo.txt'); $this->assertFalse($file->exists()); $file->open('w'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrCollectionsTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrCollectionsTest.php index 227bc95359..d18c036c3d 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrCollectionsTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrCollectionsTest.php @@ -9,8 +9,8 @@ Mock::generatePartial( class HTMLPurifier_AttrCollectionsTest extends HTMLPurifier_Harness { - function testConstruction() { - + public function testConstruction() + { generate_mock_once('HTMLPurifier_AttrTypes'); $collections = new HTMLPurifier_AttrCollections_TestForConstruct(); @@ -61,8 +61,8 @@ class HTMLPurifier_AttrCollectionsTest extends HTMLPurifier_Harness } - function test_performInclusions() { - + public function test_performInclusions() + { generate_mock_once('HTMLPurifier_AttrTypes'); $types = new HTMLPurifier_AttrTypesMock(); @@ -99,8 +99,8 @@ class HTMLPurifier_AttrCollectionsTest extends HTMLPurifier_Harness } - function test_expandIdentifiers() { - + public function test_expandIdentifiers() + { generate_mock_once('HTMLPurifier_AttrTypes'); $types = new HTMLPurifier_AttrTypesMock(); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/AlphaValueTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/AlphaValueTest.php index 56efa306f5..b360f84493 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/AlphaValueTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/AlphaValueTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_AttrDef_CSS_AlphaValueTest extends HTMLPurifier_AttrDefHarness { - function test() { - + public function test() + { $this->def = new HTMLPurifier_AttrDef_CSS_AlphaValue(); $this->assertDef('0'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundPositionTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundPositionTest.php index a216b26776..61952d6604 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundPositionTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundPositionTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_AttrDef_CSS_BackgroundPositionTest extends HTMLPurifier_AttrDefHarness { - function test() { - + public function test() + { $this->def = new HTMLPurifier_AttrDef_CSS_BackgroundPosition(); // explicitly cited in spec diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundTest.php index 83461c365d..aa18d096b1 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_AttrDef_CSS_BackgroundTest extends HTMLPurifier_AttrDefHarness { - function test() { - + public function test() + { $config = HTMLPurifier_Config::createDefault(); $this->def = new HTMLPurifier_AttrDef_CSS_Background($config); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BorderTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BorderTest.php index 6cd77fd7ad..9159e8dc45 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BorderTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BorderTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_AttrDef_CSS_BorderTest extends HTMLPurifier_AttrDefHarness { - function test() { - + public function test() + { $config = HTMLPurifier_Config::createDefault(); $this->def = new HTMLPurifier_AttrDef_CSS_Border($config); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ColorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ColorTest.php index f3a74e897d..980bd9092a 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ColorTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ColorTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_AttrDef_CSS_ColorTest extends HTMLPurifier_AttrDefHarness { - function test() { - + public function test() + { $this->def = new HTMLPurifier_AttrDef_CSS_Color(); $this->assertDef('#F00'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/CompositeTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/CompositeTest.php index 44bef55517..ab683e3693 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/CompositeTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/CompositeTest.php @@ -5,7 +5,8 @@ class HTMLPurifier_AttrDef_CSS_Composite_Testable extends { // we need to pass by ref to get the mocks in - function HTMLPurifier_AttrDef_CSS_Composite_Testable(&$defs) { + public function HTMLPurifier_AttrDef_CSS_Composite_Testable(&$defs) + { $this->defs =& $defs; } @@ -16,8 +17,8 @@ class HTMLPurifier_AttrDef_CSS_CompositeTest extends HTMLPurifier_AttrDefHarness protected $def1, $def2; - function test() { - + public function test() + { generate_mock_once('HTMLPurifier_AttrDef'); $config = HTMLPurifier_Config::createDefault(); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FilterTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FilterTest.php index 7795643f1b..19b2d8d700 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FilterTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FilterTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_AttrDef_CSS_FilterTest extends HTMLPurifier_AttrDefHarness { - function test() { - + public function test() + { $this->def = new HTMLPurifier_AttrDef_CSS_Filter(); $this->assertDef('none'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FontFamilyTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FontFamilyTest.php index fda8e01ff3..7f2fe0d0b8 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FontFamilyTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FontFamilyTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_AttrDef_CSS_FontFamilyTest extends HTMLPurifier_AttrDefHarness { - function test() { - + public function test() + { $this->def = new HTMLPurifier_AttrDef_CSS_FontFamily(); $this->assertDef('Gill, Helvetica, sans-serif'); @@ -36,7 +36,8 @@ class HTMLPurifier_AttrDef_CSS_FontFamilyTest extends HTMLPurifier_AttrDefHarnes //$this->assertDef('"\'"', "\"'\""); } - function testAllowed() { + public function testAllowed() + { $this->config->set('CSS.AllowedFonts', array('serif', 'Times New Roman')); $this->assertDef('serif'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FontTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FontTest.php index 91870d13e1..c52d164faa 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FontTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FontTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_AttrDef_CSS_FontTest extends HTMLPurifier_AttrDefHarness { - function test() { - + public function test() + { $config = HTMLPurifier_Config::createDefault(); $this->def = new HTMLPurifier_AttrDef_CSS_Font($config); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ImportantDecoratorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ImportantDecoratorTest.php index c7fa8a0fab..0aa9da4e1f 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ImportantDecoratorTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ImportantDecoratorTest.php @@ -6,39 +6,46 @@ class HTMLPurifier_AttrDef_CSS_ImportantDecoratorTest extends HTMLPurifier_AttrD /** Mock AttrDef decorator is wrapping */ protected $mock; - function setUp() { + public function setUp() + { generate_mock_once('HTMLPurifier_AttrDef'); $this->mock = new HTMLPurifier_AttrDefMock(); $this->def = new HTMLPurifier_AttrDef_CSS_ImportantDecorator($this->mock, true); } - protected function setMock($input, $output = null) { + protected function setMock($input, $output = null) + { if ($output === null) $output = $input; $this->mock->expectOnce('validate', array($input, $this->config, $this->context)); $this->mock->setReturnValue('validate', $output); } - function testImportant() { + public function testImportant() + { $this->setMock('23'); $this->assertDef('23 !important'); } - function testImportantInternalDefChanged() { + public function testImportantInternalDefChanged() + { $this->setMock('23', '24'); $this->assertDef('23 !important', '24 !important'); } - function testImportantWithSpace() { + public function testImportantWithSpace() + { $this->setMock('23'); $this->assertDef('23 ! important ', '23 !important'); } - function testFakeImportant() { + public function testFakeImportant() + { $this->setMock('! foo important'); $this->assertDef('! foo important'); } - function testStrip() { + public function testStrip() + { $this->def = new HTMLPurifier_AttrDef_CSS_ImportantDecorator($this->mock, false); $this->setMock('23'); $this->assertDef('23 ! important ', '23'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/LengthTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/LengthTest.php index 9d9fc41f2f..dd79f90600 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/LengthTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/LengthTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_AttrDef_CSS_LengthTest extends HTMLPurifier_AttrDefHarness { - function test() { - + public function test() + { $this->def = new HTMLPurifier_AttrDef_CSS_Length(); $this->assertDef('0'); @@ -26,8 +26,8 @@ class HTMLPurifier_AttrDef_CSS_LengthTest extends HTMLPurifier_AttrDefHarness } - function testNonNegative() { - + public function testNonNegative() + { $this->def = new HTMLPurifier_AttrDef_CSS_Length('0'); $this->assertDef('3cm'); @@ -35,7 +35,8 @@ class HTMLPurifier_AttrDef_CSS_LengthTest extends HTMLPurifier_AttrDefHarness } - function testBounding() { + public function testBounding() + { $this->def = new HTMLPurifier_AttrDef_CSS_Length('-1in', '1in'); $this->assertDef('1cm'); $this->assertDef('-1cm'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ListStyleTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ListStyleTest.php index 070066705e..7cd834647d 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ListStyleTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ListStyleTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_AttrDef_CSS_ListStyleTest extends HTMLPurifier_AttrDefHarness { - function test() { - + public function test() + { $config = HTMLPurifier_Config::createDefault(); $this->def = new HTMLPurifier_AttrDef_CSS_ListStyle($config); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/MultipleTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/MultipleTest.php index 4461cb5089..e2725f74ea 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/MultipleTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/MultipleTest.php @@ -4,7 +4,8 @@ class HTMLPurifier_AttrDef_CSS_MultipleTest extends HTMLPurifier_AttrDefHarness { - function test() { + public function test() + { $this->def = new HTMLPurifier_AttrDef_CSS_Multiple( new HTMLPurifier_AttrDef_Integer() ); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/NumberTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/NumberTest.php index 94e6ea8cf8..943bf5c0bf 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/NumberTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/NumberTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_AttrDef_CSS_NumberTest extends HTMLPurifier_AttrDefHarness { - function test() { - + public function test() + { $this->def = new HTMLPurifier_AttrDef_CSS_Number(); $this->assertDef('0'); @@ -38,8 +38,8 @@ class HTMLPurifier_AttrDef_CSS_NumberTest extends HTMLPurifier_AttrDefHarness } - function testNonNegative() { - + public function testNonNegative() + { $this->def = new HTMLPurifier_AttrDef_CSS_Number(true); $this->assertDef('23'); $this->assertDef('-12', false); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/PercentageTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/PercentageTest.php index f712af1d2a..5aa0090f09 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/PercentageTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/PercentageTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_AttrDef_CSS_PercentageTest extends HTMLPurifier_AttrDefHarness { - function test() { - + public function test() + { $this->def = new HTMLPurifier_AttrDef_CSS_Percentage(); $this->assertDef('10%'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/TextDecorationTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/TextDecorationTest.php index dd714d206a..fbefc6af66 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/TextDecorationTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/TextDecorationTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_AttrDef_CSS_TextDecorationTest extends HTMLPurifier_AttrDefHarness { - function testCaseInsensitive() { - + public function testCaseInsensitive() + { $this->def = new HTMLPurifier_AttrDef_CSS_TextDecoration(); $this->assertDef('none'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/URITest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/URITest.php index 3d6f5791ef..a29f6e9092 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/URITest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/URITest.php @@ -3,8 +3,8 @@ class HTMLPurifier_AttrDef_CSS_URITest extends HTMLPurifier_AttrDefHarness { - function test() { - + public function test() + { $this->def = new HTMLPurifier_AttrDef_CSS_URI(); $this->assertDef('', false); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSSTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSSTest.php index 56917aecef..cff811bc9f 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSSTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSSTest.php @@ -3,13 +3,14 @@ class HTMLPurifier_AttrDef_CSSTest extends HTMLPurifier_AttrDefHarness { - function setup() { + public function setup() + { parent::setup(); $this->def = new HTMLPurifier_AttrDef_CSS(); } - function test() { - + public function test() + { // regular cases, singular $this->assertDef('text-align:right;'); $this->assertDef('border-left-style:solid;'); @@ -115,7 +116,8 @@ class HTMLPurifier_AttrDef_CSSTest extends HTMLPurifier_AttrDefHarness } - function testProprietary() { + public function testProprietary() + { $this->config->set('CSS.Proprietary', true); $this->assertDef('scrollbar-arrow-color:#ff0;'); @@ -132,25 +134,29 @@ class HTMLPurifier_AttrDef_CSSTest extends HTMLPurifier_AttrDefHarness } - function testImportant() { + public function testImportant() + { $this->config->set('CSS.AllowImportant', true); $this->assertDef('float:left !important;'); } - function testTricky() { + public function testTricky() + { $this->config->set('CSS.AllowTricky', true); $this->assertDef('display:none;'); $this->assertDef('visibility:visible;'); $this->assertDef('overflow:scroll;'); } - function testForbidden() { + public function testForbidden() + { $this->config->set('CSS.ForbiddenProperties', 'float'); $this->assertDef('float:left;', false); $this->assertDef('text-align:right;'); } - function testTrusted() { + public function testTrusted() + { $this->config->set('CSS.Trusted', true); $this->assertDef('position:relative;'); $this->assertDef('left:2px;'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/EnumTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/EnumTest.php index 7722c1bc2d..dda4dae13a 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/EnumTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/EnumTest.php @@ -3,24 +3,28 @@ class HTMLPurifier_AttrDef_EnumTest extends HTMLPurifier_AttrDefHarness { - function testCaseInsensitive() { + public function testCaseInsensitive() + { $this->def = new HTMLPurifier_AttrDef_Enum(array('one', 'two')); $this->assertDef('one'); $this->assertDef('ONE', 'one'); } - function testCaseSensitive() { + public function testCaseSensitive() + { $this->def = new HTMLPurifier_AttrDef_Enum(array('one', 'two'), true); $this->assertDef('one'); $this->assertDef('ONE', false); } - function testFixing() { + public function testFixing() + { $this->def = new HTMLPurifier_AttrDef_Enum(array('one')); $this->assertDef(' one ', 'one'); } - function test_make() { + public function test_make() + { $factory = new HTMLPurifier_AttrDef_Enum(); $def = $factory->make('foo,bar'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/BoolTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/BoolTest.php index 060d0fc8f0..ca7903270a 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/BoolTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/BoolTest.php @@ -3,14 +3,16 @@ class HTMLPurifier_AttrDef_HTML_BoolTest extends HTMLPurifier_AttrDefHarness { - function test() { + public function test() + { $this->def = new HTMLPurifier_AttrDef_HTML_Bool('foo'); $this->assertDef('foo'); $this->assertDef('', false); $this->assertDef('bar', 'foo'); } - function test_make() { + public function test_make() + { $factory = new HTMLPurifier_AttrDef_HTML_Bool(); $def = $factory->make('foo'); $def2 = new HTMLPurifier_AttrDef_HTML_Bool('foo'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/ClassTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/ClassTest.php index 6effd3cdee..8961f46412 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/ClassTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/ClassTest.php @@ -2,23 +2,27 @@ class HTMLPurifier_AttrDef_HTML_ClassTest extends HTMLPurifier_AttrDef_HTML_NmtokensTest { - function setUp() { + public function setUp() + { parent::setUp(); $this->def = new HTMLPurifier_AttrDef_HTML_Class(); } - function testAllowedClasses() { + public function testAllowedClasses() + { $this->config->set('Attr.AllowedClasses', array('foo')); $this->assertDef('foo'); $this->assertDef('bar', false); $this->assertDef('foo bar', 'foo'); } - function testForbiddenClasses() { + public function testForbiddenClasses() + { $this->config->set('Attr.ForbiddenClasses', array('bar')); $this->assertDef('foo'); $this->assertDef('bar', false); $this->assertDef('foo bar', 'foo'); } - function testDefault() { + public function testDefault() + { $this->assertDef('valid'); $this->assertDef('a0-_'); $this->assertDef('-valid'); @@ -40,7 +44,8 @@ class HTMLPurifier_AttrDef_HTML_ClassTest extends HTMLPurifier_AttrDef_HTML_Nmto // test duplicate removal $this->assertDef('valid valid', 'valid'); } - function testXHTML11Behavior() { + public function testXHTML11Behavior() + { $this->config->set('HTML.Doctype', 'XHTML 1.1'); $this->assertDef('0invalid', false); $this->assertDef('valid valid', 'valid'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/ColorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/ColorTest.php index f2b2181111..01c279a52c 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/ColorTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/ColorTest.php @@ -3,7 +3,8 @@ class HTMLPurifier_AttrDef_HTML_ColorTest extends HTMLPurifier_AttrDefHarness { - function test() { + public function test() + { $this->def = new HTMLPurifier_AttrDef_HTML_Color(); $this->assertDef('', false); $this->assertDef('foo', false); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/FrameTargetTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/FrameTargetTest.php index 7d3e24c752..4f9f9292f9 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/FrameTargetTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/FrameTargetTest.php @@ -3,19 +3,22 @@ class HTMLPurifier_AttrDef_HTML_FrameTargetTest extends HTMLPurifier_AttrDefHarness { - function setup() { + public function setup() + { parent::setup(); $this->def = new HTMLPurifier_AttrDef_HTML_FrameTarget(); } - function testNoneAllowed() { + public function testNoneAllowed() + { $this->assertDef('', false); $this->assertDef('foo', false); $this->assertDef('_blank', false); $this->assertDef('baz', false); } - function test() { + public function test() + { $this->config->set('Attr.AllowedFrameTargets', 'foo,_blank'); $this->assertDef('', false); $this->assertDef('foo'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/IDTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/IDTest.php index 245db16daf..31870d2283 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/IDTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/IDTest.php @@ -3,7 +3,8 @@ class HTMLPurifier_AttrDef_HTML_IDTest extends HTMLPurifier_AttrDefHarness { - function setUp() { + public function setUp() + { parent::setUp(); $id_accumulator = new HTMLPurifier_IDAccumulator(); @@ -13,8 +14,8 @@ class HTMLPurifier_AttrDef_HTML_IDTest extends HTMLPurifier_AttrDefHarness } - function test() { - + public function test() + { // valid ID names $this->assertDef('alpha'); $this->assertDef('al_ha'); @@ -35,8 +36,8 @@ class HTMLPurifier_AttrDef_HTML_IDTest extends HTMLPurifier_AttrDefHarness } - function testPrefix() { - + public function testPrefix() + { $this->config->set('Attr.IDPrefix', 'user_'); $this->assertDef('alpha', 'user_alpha'); @@ -50,8 +51,8 @@ class HTMLPurifier_AttrDef_HTML_IDTest extends HTMLPurifier_AttrDefHarness } - function testTwoPrefixes() { - + public function testTwoPrefixes() + { $this->config->set('Attr.IDPrefix', 'user_'); $this->config->set('Attr.IDPrefixLocal', 'story95_'); @@ -64,7 +65,8 @@ class HTMLPurifier_AttrDef_HTML_IDTest extends HTMLPurifier_AttrDefHarness $this->assertDef('user_alas', 'user_story95_user_alas'); // ! } - function testLocalPrefixWithoutMainPrefix() { + public function testLocalPrefixWithoutMainPrefix() + { // no effect when IDPrefix isn't set $this->config->set('Attr.IDPrefix', ''); $this->config->set('Attr.IDPrefixLocal', 'story95_'); @@ -75,8 +77,8 @@ class HTMLPurifier_AttrDef_HTML_IDTest extends HTMLPurifier_AttrDefHarness } // reference functionality is disabled for now - function disabled_testIDReference() { - + public function disabled_testIDReference() + { $this->def = new HTMLPurifier_AttrDef_HTML_ID(true); $this->assertDef('good_id'); @@ -94,8 +96,8 @@ class HTMLPurifier_AttrDef_HTML_IDTest extends HTMLPurifier_AttrDefHarness } - function testRegexp() { - + public function testRegexp() + { $this->config->set('Attr.IDBlacklistRegexp', '/^g_/'); $this->assertDef('good_id'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/LengthTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/LengthTest.php index d165e30b55..91f3de7e55 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/LengthTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/LengthTest.php @@ -3,12 +3,13 @@ class HTMLPurifier_AttrDef_HTML_LengthTest extends HTMLPurifier_AttrDef_HTML_PixelsTest { - function setup() { + public function setup() + { $this->def = new HTMLPurifier_AttrDef_HTML_Length(); } - function test() { - + public function test() + { // pixel check parent::test(); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/LinkTypesTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/LinkTypesTest.php index d90b65b1f3..ad30aa7823 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/LinkTypesTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/LinkTypesTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_AttrDef_HTML_LinkTypesTest extends HTMLPurifier_AttrDefHarness { - function testNull() { - + public function testNull() + { $this->def = new HTMLPurifier_AttrDef_HTML_LinkTypes('rel'); $this->config->set('Attr.AllowedRel', array('nofollow', 'foo')); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/MultiLengthTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/MultiLengthTest.php index eb6f340112..d1b3f13f34 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/MultiLengthTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/MultiLengthTest.php @@ -3,12 +3,13 @@ class HTMLPurifier_AttrDef_HTML_MultiLengthTest extends HTMLPurifier_AttrDef_HTML_LengthTest { - function setup() { + public function setup() + { $this->def = new HTMLPurifier_AttrDef_HTML_MultiLength(); } - function test() { - + public function test() + { // length check parent::test(); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/NmtokensTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/NmtokensTest.php index bb64ff6e2b..d466146e46 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/NmtokensTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/NmtokensTest.php @@ -3,13 +3,14 @@ class HTMLPurifier_AttrDef_HTML_NmtokensTest extends HTMLPurifier_AttrDefHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->def = new HTMLPurifier_AttrDef_HTML_Nmtokens(); } - function testDefault() { - + public function testDefault() + { $this->assertDef('valid'); $this->assertDef('a0-_'); $this->assertDef('-valid'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/PixelsTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/PixelsTest.php index 08f25be640..c7f36772dd 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/PixelsTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/PixelsTest.php @@ -3,12 +3,13 @@ class HTMLPurifier_AttrDef_HTML_PixelsTest extends HTMLPurifier_AttrDefHarness { - function setup() { + public function setup() + { $this->def = new HTMLPurifier_AttrDef_HTML_Pixels(); } - function test() { - + public function test() + { $this->assertDef('1'); $this->assertDef('0'); @@ -33,7 +34,8 @@ class HTMLPurifier_AttrDef_HTML_PixelsTest extends HTMLPurifier_AttrDefHarness } - function test_make() { + public function test_make() + { $factory = new HTMLPurifier_AttrDef_HTML_Pixels(); $this->def = $factory->make('30'); $this->assertDef('25'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/IntegerTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/IntegerTest.php index a941e31abd..2061a3660e 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/IntegerTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/IntegerTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_AttrDef_IntegerTest extends HTMLPurifier_AttrDefHarness { - function test() { - + public function test() + { $this->def = new HTMLPurifier_AttrDef_Integer(); $this->assertDef('0'); @@ -23,7 +23,8 @@ class HTMLPurifier_AttrDef_IntegerTest extends HTMLPurifier_AttrDefHarness } - function assertRange($negative, $zero, $positive) { + public function assertRange($negative, $zero, $positive) + { $this->assertDef('-100', $negative); $this->assertDef('-1', $negative); $this->assertDef('0', $zero); @@ -31,8 +32,8 @@ class HTMLPurifier_AttrDef_IntegerTest extends HTMLPurifier_AttrDefHarness $this->assertDef('42', $positive); } - function testRange() { - + public function testRange() + { $this->def = new HTMLPurifier_AttrDef_Integer(false); $this->assertRange(false, true, true); // non-negative diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/LangTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/LangTest.php index c59175556a..06b9e6b879 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/LangTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/LangTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_AttrDef_LangTest extends HTMLPurifier_AttrDefHarness { - function test() { - + public function test() + { $this->def = new HTMLPurifier_AttrDef_Lang(); // basic good uses diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/SwitchTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/SwitchTest.php index 21bafe697f..4faed99c6a 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/SwitchTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/SwitchTest.php @@ -5,7 +5,8 @@ class HTMLPurifier_AttrDef_SwitchTest extends HTMLPurifier_AttrDefHarness protected $with, $without; - function setUp() { + public function setUp() + { parent::setUp(); generate_mock_once('HTMLPurifier_AttrDef'); $this->with = new HTMLPurifier_AttrDefMock(); @@ -13,7 +14,8 @@ class HTMLPurifier_AttrDef_SwitchTest extends HTMLPurifier_AttrDefHarness $this->def = new HTMLPurifier_AttrDef_Switch('tag', $this->with, $this->without); } - function testWith() { + public function testWith() + { $token = new HTMLPurifier_Token_Start('tag'); $this->context->register('CurrentToken', $token); $this->with->expectOnce('validate'); @@ -21,7 +23,8 @@ class HTMLPurifier_AttrDef_SwitchTest extends HTMLPurifier_AttrDefHarness $this->assertDef('bar', 'foo'); } - function testWithout() { + public function testWithout() + { $token = new HTMLPurifier_Token_Start('other-tag'); $this->context->register('CurrentToken', $token); $this->without->expectOnce('validate'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/TextTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/TextTest.php index 458008aa87..de1ae554db 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/TextTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/TextTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_AttrDef_TextTest extends HTMLPurifier_AttrDefHarness { - function test() { - + public function test() + { $this->def = new HTMLPurifier_AttrDef_Text(); $this->assertDef('This is spiffy text!'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/Email/SimpleCheckTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/Email/SimpleCheckTest.php index c310347e9a..919b7691af 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/Email/SimpleCheckTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/Email/SimpleCheckTest.php @@ -4,7 +4,8 @@ class HTMLPurifier_AttrDef_URI_Email_SimpleCheckTest extends HTMLPurifier_AttrDef_URI_EmailHarness { - function setUp() { + public function setUp() + { $this->def = new HTMLPurifier_AttrDef_URI_Email_SimpleCheck(); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/EmailHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/EmailHarness.php index 594e2ce292..35c3f207f3 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/EmailHarness.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/EmailHarness.php @@ -6,7 +6,8 @@ class HTMLPurifier_AttrDef_URI_EmailHarness extends HTMLPurifier_AttrDefHarness /** * Tests common email strings that are obviously pass/fail */ - function testCore() { + public function testCore() + { $this->assertDef('bob@example.com'); $this->assertDef(' bob@example.com ', 'bob@example.com'); $this->assertDef('bob.thebuilder@example.net'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/HostTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/HostTest.php index b5827718b0..00e56ed4c4 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/HostTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/HostTest.php @@ -6,8 +6,8 @@ class HTMLPurifier_AttrDef_URI_HostTest extends HTMLPurifier_AttrDefHarness { - function test() { - + public function test() + { $this->def = new HTMLPurifier_AttrDef_URI_Host(); $this->assertDef('[2001:DB8:0:0:8:800:200C:417A]'); // IPv6 @@ -33,13 +33,15 @@ class HTMLPurifier_AttrDef_URI_HostTest extends HTMLPurifier_AttrDefHarness $this->assertDef('-f.top', false); $this->assertDef('ff.top'); $this->assertDef('f1.top'); + $this->assertDef('f1_f2.ex.top', false); $this->assertDef('f-.top', false); $this->assertDef("\xE4\xB8\xAD\xE6\x96\x87.com.cn", false); } - function testIDNA() { + public function testIDNA() + { if (!$GLOBALS['HTMLPurifierTest']['Net_IDNA2']) { return false; } @@ -48,6 +50,12 @@ class HTMLPurifier_AttrDef_URI_HostTest extends HTMLPurifier_AttrDefHarness $this->assertDef("\xe2\x80\x85.com", false); // rejected } + function testAllowUnderscore() { + $this->config->set('Core.AllowHostnameUnderscore', true); + $this->assertDef("foo_bar.example.com"); + $this->assertDef("foo_.example.com", false); + } + } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv4Test.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv4Test.php index 0a4eb17ba3..4cb5128ba6 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv4Test.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv4Test.php @@ -6,8 +6,8 @@ class HTMLPurifier_AttrDef_URI_IPv4Test extends HTMLPurifier_AttrDefHarness { - function test() { - + public function test() + { $this->def = new HTMLPurifier_AttrDef_URI_IPv4(); $this->assertDef('127.0.0.1'); // standard IPv4, loopback, non-routable diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv6Test.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv6Test.php index 083e818aa0..f46785c1ad 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv6Test.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv6Test.php @@ -6,8 +6,8 @@ class HTMLPurifier_AttrDef_URI_IPv6Test extends HTMLPurifier_AttrDefHarness { - function test() { - + public function test() + { $this->def = new HTMLPurifier_AttrDef_URI_IPv6(); $this->assertDef('2001:DB8:0:0:8:800:200C:417A'); // unicast, full diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URITest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URITest.php index 3044367a2f..a5ae9c56bf 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URITest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URITest.php @@ -6,12 +6,14 @@ class HTMLPurifier_AttrDef_URITest extends HTMLPurifier_AttrDefHarness { - function setUp() { + public function setUp() + { $this->def = new HTMLPurifier_AttrDef_URI(); parent::setUp(); } - function testIntegration() { + public function testIntegration() + { $this->assertDef('http://www.google.com/'); $this->assertDef('http:', ''); $this->assertDef('http:/foo', '/foo'); @@ -22,33 +24,38 @@ class HTMLPurifier_AttrDef_URITest extends HTMLPurifier_AttrDefHarness $this->assertDef('mailto:bob@example.com'); } - function testIntegrationWithPercentEncoder() { + public function testIntegrationWithPercentEncoder() + { $this->assertDef( 'http://www.example.com/%56%fc%GJ%5%FC', 'http://www.example.com/V%FC%25GJ%255%FC' ); } - function testPercentEncoding() { + public function testPercentEncoding() + { $this->assertDef( 'http:colon:mercenary', 'colon%3Amercenary' ); } - function testPercentEncodingPreserve() { + public function testPercentEncodingPreserve() + { $this->assertDef( 'http://www.example.com/abcABC123-_.!~*()\'' ); } - function testEmbeds() { + public function testEmbeds() + { $this->def = new HTMLPurifier_AttrDef_URI(true); $this->assertDef('http://sub.example.com/alas?foo=asd'); $this->assertDef('mailto:foo@example.com', false); } - function testConfigMunge() { + public function testConfigMunge() + { $this->config->set('URI.Munge', 'http://www.google.com/url?q=%s'); $this->assertDef( 'http://www.example.com/', @@ -58,32 +65,39 @@ class HTMLPurifier_AttrDef_URITest extends HTMLPurifier_AttrDefHarness $this->assertDef('javascript:foobar();', false); } - function testDefaultSchemeRemovedInBlank() { + public function testDefaultSchemeRemovedInBlank() + { $this->assertDef('http:', ''); } - function testDefaultSchemeRemovedInRelativeURI() { + public function testDefaultSchemeRemovedInRelativeURI() + { $this->assertDef('http:/foo/bar', '/foo/bar'); } - function testDefaultSchemeNotRemovedInAbsoluteURI() { + public function testDefaultSchemeNotRemovedInAbsoluteURI() + { $this->assertDef('http://example.com/foo/bar'); } - function testAltSchemeNotRemoved() { + public function testAltSchemeNotRemoved() + { $this->assertDef('mailto:this-looks-like-a-path@example.com'); } - function testResolveNullSchemeAmbiguity() { + public function testResolveNullSchemeAmbiguity() + { $this->assertDef('///foo', '/foo'); } - function testResolveNullSchemeDoubleAmbiguity() { + public function testResolveNullSchemeDoubleAmbiguity() + { $this->config->set('URI.Host', 'example.com'); $this->assertDef('////foo', '//example.com//foo'); } - function testURIDefinitionValidation() { + public function testURIDefinitionValidation() + { $parser = new HTMLPurifier_URIParser(); $uri = $parser->parse('http://example.com'); $this->config->set('URI.DefinitionID', 'HTMLPurifier_AttrDef_URITest->testURIDefinitionValidation'); @@ -116,7 +130,8 @@ class HTMLPurifier_AttrDef_URITest extends HTMLPurifier_AttrDefHarness HTMLPurifier_DefinitionCacheFactory::instance($old); } - function test_make() { + public function test_make() + { $factory = new HTMLPurifier_AttrDef_URI(); $def = $factory->make(''); $def2 = new HTMLPurifier_AttrDef_URI(); @@ -128,8 +143,8 @@ class HTMLPurifier_AttrDef_URITest extends HTMLPurifier_AttrDefHarness } /* - function test_validate_configWhitelist() { - + public function test_validate_configWhitelist() + { $this->config->set('URI.HostPolicy', 'DenyAll'); $this->config->set('URI.HostWhitelist', array(null, 'google.com')); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDefHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDefHarness.php index b45b0ca534..e2029c048d 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDefHarness.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDefHarness.php @@ -6,13 +6,15 @@ class HTMLPurifier_AttrDefHarness extends HTMLPurifier_Harness protected $def; protected $context, $config; - public function setUp() { + public function setUp() + { $this->config = HTMLPurifier_Config::createDefault(); $this->context = new HTMLPurifier_Context(); } // cannot be used for accumulator - function assertDef($string, $expect = true) { + public function assertDef($string, $expect = true) + { // $expect can be a string or bool $result = $this->def->validate($string, $this->config, $this->context); if ($expect === true) { diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDefTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDefTest.php index d7466e37df..ed4f2492ae 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDefTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDefTest.php @@ -8,8 +8,8 @@ Mock::generatePartial( class HTMLPurifier_AttrDefTest extends HTMLPurifier_Harness { - function test_parseCDATA() { - + public function test_parseCDATA() + { $def = new HTMLPurifier_AttrDefTestable(); $this->assertIdentical('', $def->parseCDATA('')); @@ -19,8 +19,8 @@ class HTMLPurifier_AttrDefTest extends HTMLPurifier_Harness } - function test_make() { - + public function test_make() + { $def = new HTMLPurifier_AttrDefTestable(); $def2 = $def->make(''); $this->assertIdentical($def, $def2); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BackgroundTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BackgroundTest.php index 0730ab4bc3..bc397fcd0c 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BackgroundTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BackgroundTest.php @@ -3,30 +3,35 @@ class HTMLPurifier_AttrTransform_BackgroundTest extends HTMLPurifier_AttrTransformHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_AttrTransform_Background(); } - function testEmptyInput() { + public function testEmptyInput() + { $this->assertResult( array() ); } - function testBasicTransform() { + public function testBasicTransform() + { $this->assertResult( array('background' => 'logo.png'), array('style' => 'background-image:url(logo.png);') ); } - function testPrependNewCSS() { + public function testPrependNewCSS() + { $this->assertResult( array('background' => 'logo.png', 'style' => 'font-weight:bold'), array('style' => 'background-image:url(logo.png);font-weight:bold') ); } - function testLenientTreatmentOfInvalidInput() { + public function testLenientTreatmentOfInvalidInput() + { // notice that we rely on the CSS validator later to fix this invalid // stuff $this->assertResult( diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BdoDirTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BdoDirTest.php index cdf6f8a9b2..f3fdd2f1e4 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BdoDirTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BdoDirTest.php @@ -3,20 +3,24 @@ class HTMLPurifier_AttrTransform_BdoDirTest extends HTMLPurifier_AttrTransformHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_AttrTransform_BdoDir(); } - function testAddDefaultDir() { + public function testAddDefaultDir() + { $this->assertResult( array(), array('dir' => 'ltr') ); } - function testPreserveExistingDir() { + public function testPreserveExistingDir() + { $this->assertResult( array('dir' => 'rtl') ); } - function testAlternateDefault() { + public function testAlternateDefault() + { $this->config->set('Attr.DefaultTextDir', 'rtl'); $this->assertResult( array(), diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BgColorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BgColorTest.php index 13567b74e9..6c2b358a2f 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BgColorTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BgColorTest.php @@ -7,30 +7,35 @@ class HTMLPurifier_AttrTransform_BgColorTest extends HTMLPurifier_AttrTransformHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_AttrTransform_BgColor(); } - function testEmptyInput() { + public function testEmptyInput() + { $this->assertResult( array() ); } - function testBasicTransform() { + public function testBasicTransform() + { $this->assertResult( array('bgcolor' => '#000000'), array('style' => 'background-color:#000000;') ); } - function testPrependNewCSS() { + public function testPrependNewCSS() + { $this->assertResult( array('bgcolor' => '#000000', 'style' => 'font-weight:bold'), array('style' => 'background-color:#000000;font-weight:bold') ); } - function testLenientTreatmentOfInvalidInput() { + public function testLenientTreatmentOfInvalidInput() + { // this may change when we natively support the datatype and // validate its contents before forwarding it on $this->assertResult( diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BoolToCSSTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BoolToCSSTest.php index 73f9d6b86a..a9830bbe21 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BoolToCSSTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BoolToCSSTest.php @@ -3,30 +3,35 @@ class HTMLPurifier_AttrTransform_BoolToCSSTest extends HTMLPurifier_AttrTransformHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_AttrTransform_BoolToCSS('foo', 'bar:3in;'); } - function testEmptyInput() { + public function testEmptyInput() + { $this->assertResult( array() ); } - function testBasicTransform() { + public function testBasicTransform() + { $this->assertResult( array('foo' => 'foo'), array('style' => 'bar:3in;') ); } - function testIgnoreValueOfBooleanAttribute() { + public function testIgnoreValueOfBooleanAttribute() + { $this->assertResult( array('foo' => 'no'), array('style' => 'bar:3in;') ); } - function testPrependCSS() { + public function testPrependCSS() + { $this->assertResult( array('foo' => 'foo', 'style' => 'background-color:#F00;'), array('style' => 'bar:3in;background-color:#F00;') diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BorderTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BorderTest.php index d10aa28e64..d59674d583 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BorderTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BorderTest.php @@ -3,30 +3,35 @@ class HTMLPurifier_AttrTransform_BorderTest extends HTMLPurifier_AttrTransformHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_AttrTransform_Border(); } - function testEmptyInput() { + public function testEmptyInput() + { $this->assertResult( array() ); } - function testBasicTransform() { + public function testBasicTransform() + { $this->assertResult( array('border' => '1'), array('style' => 'border:1px solid;') ); } - function testLenientTreatmentOfInvalidInput() { + public function testLenientTreatmentOfInvalidInput() + { $this->assertResult( array('border' => '10%'), array('style' => 'border:10%px solid;') ); } - function testPrependNewCSS() { + public function testPrependNewCSS() + { $this->assertResult( array('border' => '23', 'style' => 'font-weight:bold;'), array('style' => 'border:23px solid;font-weight:bold;') diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/EnumToCSSTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/EnumToCSSTest.php index f0381fe889..e895e129e6 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/EnumToCSSTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/EnumToCSSTest.php @@ -3,7 +3,8 @@ class HTMLPurifier_AttrTransform_EnumToCSSTest extends HTMLPurifier_AttrTransformHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_AttrTransform_EnumToCSS('align', array( 'left' => 'text-align:left;', @@ -11,36 +12,42 @@ class HTMLPurifier_AttrTransform_EnumToCSSTest extends HTMLPurifier_AttrTransfor )); } - function testEmptyInput() { + public function testEmptyInput() + { $this->assertResult( array() ); } - function testPreserveArraysWithoutInterestingAttributes() { + public function testPreserveArraysWithoutInterestingAttributes() + { $this->assertResult( array('style' => 'font-weight:bold;') ); } - function testConvertAlignLeft() { + public function testConvertAlignLeft() + { $this->assertResult( array('align' => 'left'), array('style' => 'text-align:left;') ); } - function testConvertAlignRight() { + public function testConvertAlignRight() + { $this->assertResult( array('align' => 'right'), array('style' => 'text-align:right;') ); } - function testRemoveInvalidAlign() { + public function testRemoveInvalidAlign() + { $this->assertResult( array('align' => 'invalid'), array() ); } - function testPrependNewCSS() { + public function testPrependNewCSS() + { $this->assertResult( array('align' => 'left', 'style' => 'font-weight:bold;'), array('style' => 'text-align:left;font-weight:bold;') @@ -48,7 +55,8 @@ class HTMLPurifier_AttrTransform_EnumToCSSTest extends HTMLPurifier_AttrTransfor } - function testCaseInsensitive() { + public function testCaseInsensitive() + { $this->obj = new HTMLPurifier_AttrTransform_EnumToCSS('align', array( 'right' => 'text-align:right;' )); @@ -58,7 +66,8 @@ class HTMLPurifier_AttrTransform_EnumToCSSTest extends HTMLPurifier_AttrTransfor ); } - function testCaseSensitive() { + public function testCaseSensitive() + { $this->obj = new HTMLPurifier_AttrTransform_EnumToCSS('align', array( 'right' => 'text-align:right;' ), true); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/ImgRequiredTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/ImgRequiredTest.php index 99f0a03e98..e1d25269f0 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/ImgRequiredTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/ImgRequiredTest.php @@ -3,12 +3,14 @@ class HTMLPurifier_AttrTransform_ImgRequiredTest extends HTMLPurifier_AttrTransformHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_AttrTransform_ImgRequired(); } - function testAddMissingAttr() { + public function testAddMissingAttr() + { $this->config->set('Core.RemoveInvalidImg', false); $this->assertResult( array(), @@ -16,7 +18,8 @@ class HTMLPurifier_AttrTransform_ImgRequiredTest extends HTMLPurifier_AttrTransf ); } - function testAlternateDefaults() { + public function testAlternateDefaults() + { $this->config->set('Attr.DefaultInvalidImage', 'blank.png'); $this->config->set('Attr.DefaultInvalidImageAlt', 'Pawned!'); $this->config->set('Attr.DefaultImageAlt', 'not pawned'); @@ -27,14 +30,16 @@ class HTMLPurifier_AttrTransform_ImgRequiredTest extends HTMLPurifier_AttrTransf ); } - function testGenerateAlt() { + public function testGenerateAlt() + { $this->assertResult( array('src' => '/path/to/foobar.png'), array('src' => '/path/to/foobar.png', 'alt' => 'foobar.png') ); } - function testAddDefaultSrc() { + public function testAddDefaultSrc() + { $this->config->set('Core.RemoveInvalidImg', false); $this->assertResult( array('alt' => 'intrigue'), @@ -42,7 +47,8 @@ class HTMLPurifier_AttrTransform_ImgRequiredTest extends HTMLPurifier_AttrTransf ); } - function testAddDefaultAlt() { + public function testAddDefaultAlt() + { $this->config->set('Attr.DefaultImageAlt', 'default'); $this->assertResult( array('src' => ''), diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/ImgSpaceTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/ImgSpaceTest.php index 42e8738e4c..9240f09a6d 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/ImgSpaceTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/ImgSpaceTest.php @@ -3,37 +3,43 @@ class HTMLPurifier_AttrTransform_ImgSpaceTest extends HTMLPurifier_AttrTransformHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_AttrTransform_ImgSpace('vspace'); } - function testEmptyInput() { + public function testEmptyInput() + { $this->assertResult( array() ); } - function testVerticalBasicUsage() { + public function testVerticalBasicUsage() + { $this->assertResult( array('vspace' => '1'), array('style' => 'margin-top:1px;margin-bottom:1px;') ); } - function testLenientHandlingOfInvalidInput() { + public function testLenientHandlingOfInvalidInput() + { $this->assertResult( array('vspace' => '10%'), array('style' => 'margin-top:10%px;margin-bottom:10%px;') ); } - function testPrependNewCSS() { + public function testPrependNewCSS() + { $this->assertResult( array('vspace' => '23', 'style' => 'font-weight:bold;'), array('style' => 'margin-top:23px;margin-bottom:23px;font-weight:bold;') ); } - function testHorizontalBasicUsage() { + public function testHorizontalBasicUsage() + { $this->obj = new HTMLPurifier_AttrTransform_ImgSpace('hspace'); $this->assertResult( array('hspace' => '1'), @@ -41,7 +47,8 @@ class HTMLPurifier_AttrTransform_ImgSpaceTest extends HTMLPurifier_AttrTransform ); } - function testInvalidConstructionParameter() { + public function testInvalidConstructionParameter() + { $this->expectError('ispace is not valid space attribute'); $this->obj = new HTMLPurifier_AttrTransform_ImgSpace('ispace'); $this->assertResult( diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/InputTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/InputTest.php index 2603ff1bea..0a87d0b92d 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/InputTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/InputTest.php @@ -3,20 +3,24 @@ class HTMLPurifier_AttrTransform_InputTest extends HTMLPurifier_AttrTransformHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_AttrTransform_Input(); } - function testEmptyInput() { + public function testEmptyInput() + { $this->assertResult(array()); } - function testInvalidCheckedWithEmpty() { + public function testInvalidCheckedWithEmpty() + { $this->assertResult(array('checked' => 'checked'), array()); } - function testInvalidCheckedWithPassword() { + public function testInvalidCheckedWithPassword() + { $this->assertResult(array( 'checked' => 'checked', 'type' => 'password' @@ -25,7 +29,8 @@ class HTMLPurifier_AttrTransform_InputTest extends HTMLPurifier_AttrTransformHar )); } - function testValidCheckedWithUcCheckbox() { + public function testValidCheckedWithUcCheckbox() + { $this->assertResult(array( 'checked' => 'checked', 'type' => 'CHECKBOX', @@ -33,7 +38,8 @@ class HTMLPurifier_AttrTransform_InputTest extends HTMLPurifier_AttrTransformHar )); } - function testInvalidMaxlength() { + public function testInvalidMaxlength() + { $this->assertResult(array( 'maxlength' => '10', 'type' => 'checkbox', @@ -44,7 +50,8 @@ class HTMLPurifier_AttrTransform_InputTest extends HTMLPurifier_AttrTransformHar )); } - function testValidMaxLength() { + public function testValidMaxLength() + { $this->assertResult(array( 'maxlength' => '10', )); @@ -52,7 +59,8 @@ class HTMLPurifier_AttrTransform_InputTest extends HTMLPurifier_AttrTransformHar // these two are really bad test-cases - function testSizeWithCheckbox() { + public function testSizeWithCheckbox() + { $this->assertResult(array( 'type' => 'checkbox', 'value' => 'foo', @@ -64,7 +72,8 @@ class HTMLPurifier_AttrTransform_InputTest extends HTMLPurifier_AttrTransformHar )); } - function testSizeWithText() { + public function testSizeWithText() + { $this->assertResult(array( 'type' => 'password', 'size' => '100px', // spurious value, to indicate no validation takes place @@ -74,13 +83,15 @@ class HTMLPurifier_AttrTransform_InputTest extends HTMLPurifier_AttrTransformHar )); } - function testInvalidSrc() { + public function testInvalidSrc() + { $this->assertResult(array( 'src' => 'img.png', ), array()); } - function testMissingValue() { + public function testMissingValue() + { $this->assertResult(array( 'type' => 'checkbox', ), array( diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/LangTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/LangTest.php index 960ad20a09..23f3bfac6d 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/LangTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/LangTest.php @@ -4,37 +4,43 @@ class HTMLPurifier_AttrTransform_LangTest extends HTMLPurifier_AttrTransformHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_AttrTransform_Lang(); } - function testEmptyInput() { + public function testEmptyInput() + { $this->assertResult(array()); } - function testCopyLangToXMLLang() { + public function testCopyLangToXMLLang() + { $this->assertResult( array('lang' => 'en'), array('lang' => 'en', 'xml:lang' => 'en') ); } - function testPreserveAttributes() { + public function testPreserveAttributes() + { $this->assertResult( array('src' => 'vert.png', 'lang' => 'fr'), array('src' => 'vert.png', 'lang' => 'fr', 'xml:lang' => 'fr') ); } - function testCopyXMLLangToLang() { + public function testCopyXMLLangToLang() + { $this->assertResult( array('xml:lang' => 'en'), array('xml:lang' => 'en', 'lang' => 'en') ); } - function testXMLLangOverridesLang() { + public function testXMLLangOverridesLang() + { $this->assertResult( array('lang' => 'fr', 'xml:lang' => 'de'), array('lang' => 'de', 'xml:lang' => 'de') diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/LengthTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/LengthTest.php index 3fbaa0ccf0..36bb72eafc 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/LengthTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/LengthTest.php @@ -3,37 +3,43 @@ class HTMLPurifier_AttrTransform_LengthTest extends HTMLPurifier_AttrTransformHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_AttrTransform_Length('width'); } - function testEmptyInput() { + public function testEmptyInput() + { $this->assertResult( array() ); } - function testTransformPixel() { + public function testTransformPixel() + { $this->assertResult( array('width' => '10'), array('style' => 'width:10px;') ); } - function testTransformPercentage() { + public function testTransformPercentage() + { $this->assertResult( array('width' => '10%'), array('style' => 'width:10%;') ); } - function testPrependNewCSS() { + public function testPrependNewCSS() + { $this->assertResult( array('width' => '10%', 'style' => 'font-weight:bold'), array('style' => 'width:10%;font-weight:bold') ); } - function testLenientTreatmentOfInvalidInput() { + public function testLenientTreatmentOfInvalidInput() + { $this->assertResult( array('width' => 'asdf'), array('style' => 'width:asdf;') diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/NameSyncTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/NameSyncTest.php index bae4a8d03b..989b0ee84f 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/NameSyncTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/NameSyncTest.php @@ -3,7 +3,8 @@ class HTMLPurifier_AttrTransform_NameSyncTest extends HTMLPurifier_AttrTransformHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_AttrTransform_NameSync(); $this->accumulator = new HTMLPurifier_IDAccumulator(); @@ -11,23 +12,27 @@ class HTMLPurifier_AttrTransform_NameSyncTest extends HTMLPurifier_AttrTransform $this->config->set('Attr.EnableID', true); } - function testEmpty() { + public function testEmpty() + { $this->assertResult( array() ); } - function testAllowSame() { + public function testAllowSame() + { $this->assertResult( array('name' => 'free', 'id' => 'free') ); } - function testAllowDifferent() { + public function testAllowDifferent() + { $this->assertResult( array('name' => 'tryit', 'id' => 'thisgood') ); } - function testCheckName() { + public function testCheckName() + { $this->accumulator->add('notok'); $this->assertResult( array('name' => 'notok', 'id' => 'ok'), diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/NameTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/NameTest.php index 10e1212386..714f4e50c2 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/NameTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/NameTest.php @@ -3,23 +3,27 @@ class HTMLPurifier_AttrTransform_NameTest extends HTMLPurifier_AttrTransformHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_AttrTransform_Name(); } - function testEmpty() { + public function testEmpty() + { $this->assertResult( array() ); } - function testTransformNameToID() { + public function testTransformNameToID() + { $this->assertResult( array('name' => 'free'), array('id' => 'free') ); } - function testExistingIDOverridesName() { + public function testExistingIDOverridesName() + { $this->assertResult( array('name' => 'tryit', 'id' => 'tobad'), array('id' => 'tobad') diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransformHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransformHarness.php index d43c0108fb..178d49c28b 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransformHarness.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransformHarness.php @@ -3,7 +3,8 @@ class HTMLPurifier_AttrTransformHarness extends HTMLPurifier_ComplexHarness { - public function setUp() { + public function setUp() + { parent::setUp(); $this->func = 'transform'; } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransformTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransformTest.php index 71a788580d..e2aeac765b 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransformTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransformTest.php @@ -8,8 +8,8 @@ Mock::generatePartial( class HTMLPurifier_AttrTransformTest extends HTMLPurifier_Harness { - function test_prependCSS() { - + public function test_prependCSS() + { $t = new HTMLPurifier_AttrTransformTestable(); $attr = array(); @@ -26,8 +26,8 @@ class HTMLPurifier_AttrTransformTest extends HTMLPurifier_Harness } - function test_confiscateAttr() { - + public function test_confiscateAttr() + { $t = new HTMLPurifier_AttrTransformTestable(); $attr = array('flavor' => 'sweet'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTypesTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTypesTest.php index d1ae43709e..4881ac7b61 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTypesTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTypesTest.php @@ -3,7 +3,8 @@ class HTMLPurifier_AttrTypesTest extends HTMLPurifier_Harness { - function test_get() { + public function test_get() + { $types = new HTMLPurifier_AttrTypes(); $this->assertIdentical( diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrValidator_ErrorsTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrValidator_ErrorsTest.php index 307d3292bc..b3c21b6eac 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrValidator_ErrorsTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrValidator_ErrorsTest.php @@ -3,7 +3,8 @@ class HTMLPurifier_AttrValidator_ErrorsTest extends HTMLPurifier_ErrorsHarness { - public function setup() { + public function setup() + { parent::setup(); $config = HTMLPurifier_Config::createDefault(); $this->language = HTMLPurifier_LanguageFactory::instance()->create($config, $this->context); @@ -12,12 +13,14 @@ class HTMLPurifier_AttrValidator_ErrorsTest extends HTMLPurifier_ErrorsHarness $this->context->register('Generator', new HTMLPurifier_Generator($config, $this->context)); } - protected function invoke($input) { + protected function invoke($input) + { $validator = new HTMLPurifier_AttrValidator(); $validator->validateToken($input, $this->config, $this->context); } - function testAttributesTransformedGlobalPre() { + public function testAttributesTransformedGlobalPre() + { $def = $this->config->getHTMLDefinition(true); generate_mock_once('HTMLPurifier_AttrTransform'); $transform = new HTMLPurifier_AttrTransformMock(); @@ -36,7 +39,8 @@ class HTMLPurifier_AttrValidator_ErrorsTest extends HTMLPurifier_ErrorsHarness $this->assertIdentical($result, $expect); } - function testAttributesTransformedLocalPre() { + public function testAttributesTransformedLocalPre() + { $this->config->set('HTML.TidyLevel', 'heavy'); $input = array('align' => 'right'); $output = array('style' => 'text-align:right;'); @@ -51,7 +55,8 @@ class HTMLPurifier_AttrValidator_ErrorsTest extends HTMLPurifier_ErrorsHarness // too lazy to check for global post and global pre - function testAttributeRemoved() { + public function testAttributeRemoved() + { $token = new HTMLPurifier_Token_Start('p', array('foobar' => 'right'), 1); $this->invoke($token); $result = $this->collector->getRaw(); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/ChameleonTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/ChameleonTest.php index 82493f40eb..1a751395c0 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/ChameleonTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/ChameleonTest.php @@ -5,7 +5,8 @@ class HTMLPurifier_ChildDef_ChameleonTest extends HTMLPurifier_ChildDefHarness protected $isInline; - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_ChildDef_Chameleon( 'b | i', // allowed only when in inline context @@ -14,21 +15,24 @@ class HTMLPurifier_ChildDef_ChameleonTest extends HTMLPurifier_ChildDefHarness $this->context->register('IsInline', $this->isInline); } - function testInlineAlwaysAllowed() { + public function testInlineAlwaysAllowed() + { $this->isInline = true; $this->assertResult( 'Allowed.' ); } - function testBlockNotAllowedInInline() { + public function testBlockNotAllowedInInline() + { $this->isInline = true; $this->assertResult( '
      Not allowed.
      ', '' ); } - function testBlockAllowedInNonInline() { + public function testBlockAllowedInNonInline() + { $this->isInline = false; $this->assertResult( '
      Allowed.
      ' diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/CustomTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/CustomTest.php index 5b138a3c17..0094323d57 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/CustomTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/CustomTest.php @@ -3,8 +3,13 @@ class HTMLPurifier_ChildDef_CustomTest extends HTMLPurifier_ChildDefHarness { - function test() { + public function setUp() + { + parent::setUp(); + } + public function test() + { $this->obj = new HTMLPurifier_ChildDef_Custom('(a,b?,c*,d+,(a,b)*)'); $this->assertEqual($this->obj->elements, array('a' => true, @@ -19,7 +24,8 @@ class HTMLPurifier_ChildDef_CustomTest extends HTMLPurifier_ChildDefHarness } - function testNesting() { + public function testNesting() + { $this->obj = new HTMLPurifier_ChildDef_Custom('(a,b,(c|d))+'); $this->assertEqual($this->obj->elements, array('a' => true, 'b' => true, 'c' => true, 'd' => true)); @@ -28,7 +34,8 @@ class HTMLPurifier_ChildDef_CustomTest extends HTMLPurifier_ChildDefHarness $this->assertResult('', false); } - function testNestedEitherOr() { + public function testNestedEitherOr() + { $this->obj = new HTMLPurifier_ChildDef_Custom('b,(a|(c|d))+'); $this->assertEqual($this->obj->elements, array('a' => true, 'b' => true, 'c' => true, 'd' => true)); @@ -39,7 +46,8 @@ class HTMLPurifier_ChildDef_CustomTest extends HTMLPurifier_ChildDefHarness $this->assertResult('', false); } - function testNestedQuantifier() { + public function testNestedQuantifier() + { $this->obj = new HTMLPurifier_ChildDef_Custom('(b,c+)*'); $this->assertEqual($this->obj->elements, array('b' => true, 'c' => true)); $this->assertResult(''); @@ -49,8 +57,8 @@ class HTMLPurifier_ChildDef_CustomTest extends HTMLPurifier_ChildDefHarness $this->assertResult('', false); } - function testEitherOr() { - + public function testEitherOr() + { $this->obj = new HTMLPurifier_ChildDef_Custom('a|b'); $this->assertEqual($this->obj->elements, array('a' => true, 'b' => true)); $this->assertResult('', false); @@ -60,8 +68,8 @@ class HTMLPurifier_ChildDef_CustomTest extends HTMLPurifier_ChildDefHarness } - function testCommafication() { - + public function testCommafication() + { $this->obj = new HTMLPurifier_ChildDef_Custom('a,b'); $this->assertEqual($this->obj->elements, array('a' => true, 'b' => true)); $this->assertResult(''); @@ -69,14 +77,16 @@ class HTMLPurifier_ChildDef_CustomTest extends HTMLPurifier_ChildDefHarness } - function testPcdata() { + public function testPcdata() + { $this->obj = new HTMLPurifier_ChildDef_Custom('#PCDATA,a'); $this->assertEqual($this->obj->elements, array('#PCDATA' => true, 'a' => true)); $this->assertResult('foo'); $this->assertResult('', false); } - function testWhitespace() { + public function testWhitespace() + { $this->obj = new HTMLPurifier_ChildDef_Custom('a'); $this->assertEqual($this->obj->elements, array('a' => true)); $this->assertResult('foo', false); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/ListTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/ListTest.php index 02dcab0fb2..0e3d5c72fc 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/ListTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/ListTest.php @@ -3,45 +3,49 @@ class HTMLPurifier_ChildDef_ListTest extends HTMLPurifier_ChildDefHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_ChildDef_List(); } - function testEmptyInput() { + public function testEmptyInput() + { $this->assertResult('', false); } - function testSingleLi() { + public function testSingleLi() + { $this->assertResult('
    • '); } - function testSomeLi() { + public function testSomeLi() + { $this->assertResult('
    • asdf
    • '); } - function testIllegal() { - // XXX actually this never gets triggered in practice - $this->assertResult('
    • ', '
    • '); - } - - function testOlAtBeginning() { + public function testOlAtBeginning() + { $this->assertResult('
        ', '
        1. '); } - function testOlAtBeginningWithOtherJunk() { + public function testOlAtBeginningWithOtherJunk() + { $this->assertResult('
          1. ', '
            1. '); } - function testOlInMiddle() { + public function testOlInMiddle() + { $this->assertResult('
            2. Foo
              1. Bar
              ', '
            3. Foo
              1. Bar
            4. '); } - function testMultipleOl() { + public function testMultipleOl() + { $this->assertResult('
                1. ', '
                    1. '); } - function testUlAtBeginning() { + public function testUlAtBeginning() + { $this->assertResult('
                        ', '
                        • '); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/OptionalTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/OptionalTest.php index a5f34f7b1e..dd035e4c84 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/OptionalTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/OptionalTest.php @@ -3,28 +3,34 @@ class HTMLPurifier_ChildDef_OptionalTest extends HTMLPurifier_ChildDefHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_ChildDef_Optional('b | i'); } - function testBasicUsage() { + public function testBasicUsage() + { $this->assertResult('Bold text', 'Bold text'); } - function testRemoveForbiddenText() { + public function testRemoveForbiddenText() + { $this->assertResult('Not allowed text', ''); } - function testEmpty() { + public function testEmpty() + { $this->assertResult(''); } - function testWhitespace() { + public function testWhitespace() + { $this->assertResult(' '); } - function testMultipleWhitespace() { + public function testMultipleWhitespace() + { $this->assertResult(' '); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/RequiredTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/RequiredTest.php index 8bb4f45ee2..d4f7c98824 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/RequiredTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/RequiredTest.php @@ -3,7 +3,8 @@ class HTMLPurifier_ChildDef_RequiredTest extends HTMLPurifier_ChildDefHarness { - function testPrepareString() { + public function testPrepareString() + { $def = new HTMLPurifier_ChildDef_Required('foobar | bang |gizmo'); $this->assertIdentical($def->elements, array( @@ -13,7 +14,8 @@ class HTMLPurifier_ChildDef_RequiredTest extends HTMLPurifier_ChildDefHarness )); } - function testPrepareArray() { + public function testPrepareArray() + { $def = new HTMLPurifier_ChildDef_Required(array('href', 'src')); $this->assertIdentical($def->elements, array( @@ -22,16 +24,19 @@ class HTMLPurifier_ChildDef_RequiredTest extends HTMLPurifier_ChildDefHarness )); } - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_ChildDef_Required('dt | dd'); } - function testEmptyInput() { + public function testEmptyInput() + { $this->assertResult('', false); } - function testRemoveIllegalTagsAndElements() { + public function testRemoveIllegalTagsAndElements() + { $this->assertResult( '
                          Term
                          Text in an illegal location'. '
                          Definition
                          Illegal tag', @@ -39,34 +44,34 @@ class HTMLPurifier_ChildDef_RequiredTest extends HTMLPurifier_ChildDefHarness $this->assertResult('How do you do!', false); } - function testIgnoreWhitespace() { + public function testIgnoreWhitespace() + { // whitespace shouldn't trigger it $this->assertResult("\n
                          Definition
                          "); } - function testPreserveWhitespaceAfterRemoval() { + public function testPreserveWhitespaceAfterRemoval() + { $this->assertResult( '
                          Definition
                          ', '
                          Definition
                          ' ); } - function testDeleteNodeIfOnlyWhitespace() { + public function testDeleteNodeIfOnlyWhitespace() + { $this->assertResult("\t ", false); } - function testPCDATAAllowed() { + public function testPCDATAAllowed() + { $this->obj = new HTMLPurifier_ChildDef_Required('#PCDATA | b'); $this->assertResult('Out Bold text', 'Out Bold text'); } - - function testPCDATAAllowedWithEscaping() { + public function testPCDATAAllowedJump() + { $this->obj = new HTMLPurifier_ChildDef_Required('#PCDATA | b'); - $this->config->set('Core.EscapeInvalidChildren', true); - $this->assertResult( - 'Out Bold text', - 'Out Bold text<img />' - ); + $this->assertResult('A foo', 'A foo'); } } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/StrictBlockquoteTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/StrictBlockquoteTest.php index 52594b1a05..82861ee7e6 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/StrictBlockquoteTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/StrictBlockquoteTest.php @@ -4,73 +4,86 @@ class HTMLPurifier_ChildDef_StrictBlockquoteTest extends HTMLPurifier_ChildDefHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_ChildDef_StrictBlockquote('div | p'); } - function testEmptyInput() { + public function testEmptyInput() + { $this->assertResult(''); } - function testPreserveValidP() { + public function testPreserveValidP() + { $this->assertResult('

                          Valid

                          '); } - function testPreserveValidDiv() { + public function testPreserveValidDiv() + { $this->assertResult('
                          Still valid
                          '); } - function testWrapTextWithP() { + public function testWrapTextWithP() + { $this->assertResult('Needs wrap', '

                          Needs wrap

                          '); } - function testNoWrapForWhitespaceOrValidElements() { + public function testNoWrapForWhitespaceOrValidElements() + { $this->assertResult('

                          Do not wrap

                          Whitespace

                          '); } - function testWrapTextNextToValidElements() { + public function testWrapTextNextToValidElements() + { $this->assertResult( 'Wrap'. '

                          Do not wrap

                          ', '

                          Wrap

                          Do not wrap

                          ' ); } - function testWrapInlineElements() { + public function testWrapInlineElements() + { $this->assertResult( '

                          Do not

                          '.'Wrap', '

                          Do not

                          Wrap

                          ' ); } - function testWrapAndRemoveInvalidTags() { + public function testWrapAndRemoveInvalidTags() + { $this->assertResult( '
                        • Not allowed
                        • Paragraph.

                          Hmm.

                          ', '

                          Not allowedParagraph.

                          Hmm.

                          ' ); } - function testWrapComplicatedSring() { + public function testWrapComplicatedSring() + { $this->assertResult( $var = 'He said
                          perhaps
                          we should nuke them.', "

                          $var

                          " ); } - function testWrapAndRemoveInvalidTagsComplex() { + public function testWrapAndRemoveInvalidTagsComplex() + { $this->assertResult( 'BarPeopleConniving.'. '

                          Fools!

                          ', '

                          Bar'. 'PeopleConniving.

                          Fools!

                          ' ); } - function testAlternateWrapper() { + public function testAlternateWrapper() + { $this->config->set('HTML.BlockWrapper', 'div'); $this->assertResult('Needs wrap', '
                          Needs wrap
                          '); } - function testError() { + public function testError() + { $this->expectError('Cannot use non-block element as block wrapper'); $this->obj = new HTMLPurifier_ChildDef_StrictBlockquote('div | p'); $this->config->set('HTML.BlockWrapper', 'dav'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/TableTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/TableTest.php index 2f72d187a4..49e96b6526 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/TableTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/TableTest.php @@ -6,66 +6,77 @@ class HTMLPurifier_ChildDef_TableTest extends HTMLPurifier_ChildDefHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_ChildDef_Table(); } - function testEmptyInput() { + public function testEmptyInput() + { $this->assertResult('', false); } - function testSingleRow() { + public function testSingleRow() + { $this->assertResult(''); } - function testComplexContents() { + public function testComplexContents() + { $this->assertResult(''. 'asdf'); $this->assertResult(''); } - function testReorderContents() { + public function testReorderContents() + { $this->assertResult( '1', '1'); } - function testXhtml11Illegal() { + public function testXhtml11Illegal() + { $this->assertResult( 'aa', 'aa' ); } - function testTrOverflowAndClose() { + public function testTrOverflowAndClose() + { $this->assertResult( 'abcd', 'abcd' ); } - function testDuplicateProcessing() { + public function testDuplicateProcessing() + { $this->assertResult( '11', '11' ); } - function testRemoveText() { + public function testRemoveText() + { $this->assertResult('foo', false); } - function testStickyWhitespaceOnTr() { + public function testStickyWhitespaceOnTr() + { $this->config->set('Output.Newline', "\n"); $this->assertResult("\n \n \n "); } - function testStickyWhitespaceOnTSection() { + public function testStickyWhitespaceOnTSection() + { $this->config->set('Output.Newline', "\n"); $this->assertResult( "\n\t\n\t\t\n\t\t\t", - "\n\t\t\n\t\n\t\t\t" + "\n\t\n\t\t\t\n\t\t" ); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDefHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDefHarness.php index 4b4d2f5b68..d21070c9aa 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDefHarness.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDefHarness.php @@ -3,12 +3,13 @@ class HTMLPurifier_ChildDefHarness extends HTMLPurifier_ComplexHarness { - public function setUp() { + public function setUp() + { parent::setUp(); $this->obj = null; $this->func = 'validateChildren'; - $this->to_tokens = true; $this->to_html = true; + $this->to_node_list = true; } } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ComplexHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ComplexHarness.php index 8e806c63c0..55c10ca9df 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ComplexHarness.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ComplexHarness.php @@ -9,51 +9,65 @@ class HTMLPurifier_ComplexHarness extends HTMLPurifier_Harness { /** - * Instance of the object that will execute the method + * Instance of the object that will execute the method. + * @type object */ protected $obj; /** - * Name of the function to be executed + * Name of the function to be executed. + * @type string */ protected $func; /** - * Whether or not the method deals in tokens. If set to true, assertResult() + * Whether or not the method deals in tokens. + * If set to true, assertResult() * will transparently convert HTML to and back from tokens. + * @type bool */ protected $to_tokens = false; + /** + * Whether or not the method deals in a node list. + * If set to true, assertResult() will transparently convert HTML + * to and back from node. + * @type bool + */ + protected $to_node_list = false; + /** * Whether or not to convert tokens back into HTML before performing * equality check, has no effect on bools. + * @type bool */ protected $to_html = false; /** * Instance of an HTMLPurifier_Lexer implementation. + * @type HTMLPurifier_Lexer */ protected $lexer; - public function __construct() { + public function __construct() + { $this->lexer = new HTMLPurifier_Lexer_DirectLex(); parent::__construct(); } /** * Asserts a specific result from a one parameter + config/context function - * @param $input Input parameter - * @param $expect Expectation - * @param $config Configuration array in form of Ns.Directive => Value. - * Has no effect if $this->config is set. - * @param $context_array Context array in form of Key => Value or an actual - * context object. + * @param string $input Input parameter + * @param bool|string $expect Expectation */ - protected function assertResult($input, $expect = true) { - - if ($this->to_tokens && is_string($input)) { - // $func may cause $input to change, so "clone" another copy - // to sacrifice + protected function assertResult($input, $expect = true) + { + // $func may cause $input to change, so "clone" another copy + // to sacrifice + if ($this->to_node_list && is_string($input)) { + $input = HTMLPurifier_Arborize::arborize($this->tokenize($temp = $input), $this->config, $this->context)->children; + $input_c = HTMLPurifier_Arborize::arborize($this->tokenize($temp), $this->config, $this->context)->children; + } elseif ($this->to_tokens && is_string($input)) { $input = $this->tokenize($temp = $input); $input_c = $this->tokenize($temp); } else { @@ -73,6 +87,12 @@ class HTMLPurifier_ComplexHarness extends HTMLPurifier_Harness } if ($this->to_html) { + if ($this->to_node_list) { + $result = $this->generateTokens($result); + if (is_array($expect) && !empty($expect) && $expect[0] instanceof HTMLPurifier_Node) { + $expect = $this->generateTokens($expect); + } + } $result = $this->generate($result); if (is_array($expect)) { $expect = $this->generate($expect); @@ -89,18 +109,30 @@ class HTMLPurifier_ComplexHarness extends HTMLPurifier_Harness /** * Tokenize HTML into tokens, uses member variables for common variables */ - protected function tokenize($html) { + protected function tokenize($html) + { return $this->lexer->tokenizeHTML($html, $this->config, $this->context); } /** * Generate textual HTML from tokens */ - protected function generate($tokens) { + protected function generate($tokens) + { $generator = new HTMLPurifier_Generator($this->config, $this->context); return $generator->generateFromTokens($tokens); } + /** + * Generate tokens from node list + */ + protected function generateTokens($children) + { + $dummy = new HTMLPurifier_Node_Element("dummy"); + $dummy->children = $children; + return HTMLPurifier_Arborize::flatten($dummy, $this->context, $this->config); + } + } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/InterchangeTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/InterchangeTest.php index 0d539ea2c0..93ad1e7b71 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/InterchangeTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/InterchangeTest.php @@ -5,11 +5,13 @@ class HTMLPurifier_ConfigSchema_InterchangeTest extends UnitTestCase protected $interchange; - public function setup() { + public function setup() + { $this->interchange = new HTMLPurifier_ConfigSchema_Interchange(); } - function testAddDirective() { + public function testAddDirective() + { $v = new HTMLPurifier_ConfigSchema_Interchange_Directive(); $v->id = new HTMLPurifier_ConfigSchema_Interchange_Id('Namespace.Directive'); $this->interchange->addDirective($v); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorAtomTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorAtomTest.php index 38625136e1..68b4d86060 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorAtomTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorAtomTest.php @@ -3,87 +3,105 @@ class HTMLPurifier_ConfigSchema_ValidatorAtomTest extends UnitTestCase { - protected function expectValidationException($msg) { + protected function expectValidationException($msg) + { $this->expectException(new HTMLPurifier_ConfigSchema_Exception($msg)); } - protected function makeAtom($value) { + protected function makeAtom($value) + { $obj = new stdClass(); $obj->property = $value; // Note that 'property' and 'context' are magic wildcard values return new HTMLPurifier_ConfigSchema_ValidatorAtom('context', $obj, 'property'); } - function testAssertIsString() { + public function testAssertIsString() + { $this->makeAtom('foo')->assertIsString(); } - function testAssertIsStringFail() { + public function testAssertIsStringFail() + { $this->expectValidationException("Property in context must be a string"); $this->makeAtom(3)->assertIsString(); } - function testAssertNotNull() { + public function testAssertNotNull() + { $this->makeAtom('foo')->assertNotNull(); } - function testAssertNotNullFail() { + public function testAssertNotNullFail() + { $this->expectValidationException("Property in context must not be null"); $this->makeAtom(null)->assertNotNull(); } - function testAssertAlnum() { + public function testAssertAlnum() + { $this->makeAtom('foo2')->assertAlnum(); } - function testAssertAlnumFail() { + public function testAssertAlnumFail() + { $this->expectValidationException("Property in context must be alphanumeric"); $this->makeAtom('%a')->assertAlnum(); } - function testAssertAlnumFailIsString() { + public function testAssertAlnumFailIsString() + { $this->expectValidationException("Property in context must be a string"); $this->makeAtom(3)->assertAlnum(); } - function testAssertNotEmpty() { + public function testAssertNotEmpty() + { $this->makeAtom('foo')->assertNotEmpty(); } - function testAssertNotEmptyFail() { + public function testAssertNotEmptyFail() + { $this->expectValidationException("Property in context must not be empty"); $this->makeAtom('')->assertNotEmpty(); } - function testAssertIsBool() { + public function testAssertIsBool() + { $this->makeAtom(false)->assertIsBool(); } - function testAssertIsBoolFail() { + public function testAssertIsBoolFail() + { $this->expectValidationException("Property in context must be a boolean"); $this->makeAtom('0')->assertIsBool(); } - function testAssertIsArray() { + public function testAssertIsArray() + { $this->makeAtom(array())->assertIsArray(); } - function testAssertIsArrayFail() { + public function testAssertIsArrayFail() + { $this->expectValidationException("Property in context must be an array"); $this->makeAtom('asdf')->assertIsArray(); } - function testAssertIsLookup() { + public function testAssertIsLookup() + { $this->makeAtom(array('foo' => true))->assertIsLookup(); } - function testAssertIsLookupFail() { + public function testAssertIsLookupFail() + { $this->expectValidationException("Property in context must be a lookup array"); $this->makeAtom(array('foo' => 4))->assertIsLookup(); } - function testAssertIsLookupFailIsArray() { + public function testAssertIsLookupFailIsArray() + { $this->expectValidationException("Property in context must be an array"); $this->makeAtom('asdf')->assertIsLookup(); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorTest.php index 9cbf36e2da..18affc36b2 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorTest.php @@ -8,19 +8,22 @@ class HTMLPurifier_ConfigSchema_ValidatorTest extends UnitTestCase { public $validator, $interchange; - public function setup() { + public function setup() + { $this->validator = new HTMLPurifier_ConfigSchema_Validator(); $this->interchange = new HTMLPurifier_ConfigSchema_Interchange(); } - function testDirectiveIntegrityViolation() { + public function testDirectiveIntegrityViolation() + { $d = $this->makeDirective('Ns.Dir'); $d->id = new HTMLPurifier_ConfigSchema_Interchange_Id('Ns.Dir2'); $this->expectValidationException("Integrity violation: key 'Ns.Dir' does not match internal id 'Ns.Dir2'"); $this->validator->validate($this->interchange); } - function testDirectiveTypeNotEmpty() { + public function testDirectiveTypeNotEmpty() + { $d = $this->makeDirective('Ns.Dir'); $d->default = 0; $d->description = 'Description'; @@ -29,7 +32,8 @@ class HTMLPurifier_ConfigSchema_ValidatorTest extends UnitTestCase $this->validator->validate($this->interchange); } - function testDirectiveDefaultInvalid() { + public function testDirectiveDefaultInvalid() + { $d = $this->makeDirective('Ns.Dir'); $d->default = 'asdf'; $d->type = 'int'; @@ -39,7 +43,8 @@ class HTMLPurifier_ConfigSchema_ValidatorTest extends UnitTestCase $this->validator->validate($this->interchange); } - function testDirectiveIdIsString() { + public function testDirectiveIdIsString() + { $d = $this->makeDirective(3); $d->default = 0; $d->type = 'int'; @@ -49,7 +54,8 @@ class HTMLPurifier_ConfigSchema_ValidatorTest extends UnitTestCase $this->validator->validate($this->interchange); } - function testDirectiveTypeAllowsNullIsBool() { + public function testDirectiveTypeAllowsNullIsBool() + { $d = $this->makeDirective('Ns.Dir'); $d->default = 0; $d->type = 'int'; @@ -60,7 +66,8 @@ class HTMLPurifier_ConfigSchema_ValidatorTest extends UnitTestCase $this->validator->validate($this->interchange); } - function testDirectiveValueAliasesIsArray() { + public function testDirectiveValueAliasesIsArray() + { $d = $this->makeDirective('Ns.Dir'); $d->default = 'a'; $d->type = 'string'; @@ -71,7 +78,8 @@ class HTMLPurifier_ConfigSchema_ValidatorTest extends UnitTestCase $this->validator->validate($this->interchange); } - function testDirectiveAllowedIsLookup() { + public function testDirectiveAllowedIsLookup() + { $d = $this->makeDirective('Ns.Dir'); $d->default = 'foo'; $d->type = 'string'; @@ -85,14 +93,16 @@ class HTMLPurifier_ConfigSchema_ValidatorTest extends UnitTestCase // helper functions - protected function makeDirective($key) { + protected function makeDirective($key) + { $directive = new HTMLPurifier_ConfigSchema_Interchange_Directive(); $directive->id = new HTMLPurifier_ConfigSchema_Interchange_Id($key); $this->interchange->addDirective($directive); return $directive; } - protected function expectValidationException($msg) { + protected function expectValidationException($msg) + { $this->expectException(new HTMLPurifier_ConfigSchema_Exception($msg)); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorTestCase.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorTestCase.php index 87fa14d0dd..29a9111616 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorTestCase.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorTestCase.php @@ -9,18 +9,21 @@ class HTMLPurifier_ConfigSchema_ValidatorTestCase extends UnitTestCase protected $_path, $_parser, $_builder; public $validator; - public function __construct($path) { + public function __construct($path) + { $this->_path = $path; $this->_parser = new HTMLPurifier_StringHashParser(); $this->_builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder(); parent::__construct($path); } - public function setup() { + public function setup() + { $this->validator = new HTMLPurifier_ConfigSchema_Validator(); } - function testValidator() { + public function testValidator() + { $hashes = $this->_parser->parseMultiFile($this->_path); $interchange = new HTMLPurifier_ConfigSchema_Interchange(); $error = null; diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchemaTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchemaTest.php index dc3bf99ebb..6b228babab 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchemaTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchemaTest.php @@ -5,11 +5,13 @@ class HTMLPurifier_ConfigSchemaTest extends HTMLPurifier_Harness protected $schema; - public function setup() { + public function setup() + { $this->schema = new HTMLPurifier_ConfigSchema(); } - function test_define() { + public function test_define() + { $this->schema->add('Car.Seats', 5, 'int', false); $this->assertIdentical($this->schema->defaults['Car.Seats'], 5); @@ -22,7 +24,8 @@ class HTMLPurifier_ConfigSchemaTest extends HTMLPurifier_Harness } - function test_defineAllowedValues() { + public function test_defineAllowedValues() + { $this->schema->add('QuantumNumber.Spin', 0.5, 'float', false); $this->schema->add('QuantumNumber.Current', 's', 'string', false); $this->schema->add('QuantumNumber.Difficulty', null, 'string', true); @@ -44,7 +47,8 @@ class HTMLPurifier_ConfigSchemaTest extends HTMLPurifier_Harness } - function test_defineValueAliases() { + public function test_defineValueAliases() + { $this->schema->add('Abbrev.HTH', 'Happy to Help', 'string', false); $this->schema->addAllowedValues( 'Abbrev.HTH', array( @@ -84,7 +88,8 @@ class HTMLPurifier_ConfigSchemaTest extends HTMLPurifier_Harness } - function testAlias() { + public function testAlias() + { $this->schema->add('Home.Rug', 3, 'int', false); $this->schema->addAlias('Home.Carpet', 'Home.Rug'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigTest.php index 3d36fc0570..69b22eb6c2 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigTest.php @@ -6,14 +6,16 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness protected $schema; protected $oldFactory; - public function setUp() { + public function setUp() + { // set up a dummy schema object for testing $this->schema = new HTMLPurifier_ConfigSchema(); } // test functionality based on ConfigSchema - function testNormal() { + public function testNormal() + { $this->schema->add('Element.Abbr', 'H', 'string', false); $this->schema->add('Element.Name', 'hydrogen', 'istring', false); $this->schema->add('Element.Number', 1, 'int', false); @@ -72,8 +74,8 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness } - function testEnumerated() { - + public function testEnumerated() + { // case sensitive $this->schema->add('Instrument.Manufacturer', 'Yamaha', 'string', false); $this->schema->addAllowedValues('Instrument.Manufacturer', array( @@ -121,8 +123,8 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness } - function testNull() { - + public function testNull() + { $this->schema->add('ReportCard.English', null, 'string', true); $this->schema->add('ReportCard.Absences', 0, 'int', false); @@ -142,8 +144,8 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness } - function testAliases() { - + public function testAliases() + { $this->schema->add('Home.Rug', 3, 'int', false); $this->schema->addAlias('Home.Carpet', 'Home.Rug'); @@ -164,8 +166,8 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness // test functionality based on method - function test_getBatch() { - + public function test_getBatch() + { $this->schema->add('Variables.TangentialAcceleration', 'a_tan', 'string', false); $this->schema->add('Variables.AngularAcceleration', 'alpha', 'string', false); @@ -188,8 +190,8 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness } - function test_loadIni() { - + public function test_loadIni() + { $this->schema->add('Shortcut.Copy', 'c', 'istring', false); $this->schema->add('Shortcut.Paste', 'v', 'istring', false); $this->schema->add('Shortcut.Cut', 'x', 'istring', false); @@ -205,8 +207,8 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness } - function test_getHTMLDefinition() { - + public function test_getHTMLDefinition() + { // we actually want to use the old copy, because the definition // generation routines have dependencies on configuration values @@ -233,7 +235,8 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness } - function test_getHTMLDefinition_deprecatedRawError() { + public function test_getHTMLDefinition_deprecatedRawError() + { $config = HTMLPurifier_Config::createDefault(); $config->chatty = false; // test deprecated retrieval of raw definition @@ -248,13 +251,15 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness $this->assertTrue($def->setup); } - function test_getHTMLDefinition_optimizedRawError() { + public function test_getHTMLDefinition_optimizedRawError() + { $this->expectException(new HTMLPurifier_Exception("Cannot set optimized = true when raw = false")); $config = HTMLPurifier_Config::createDefault(); $config->getHTMLDefinition(false, true); } - function test_getHTMLDefinition_rawAfterSetupError() { + public function test_getHTMLDefinition_rawAfterSetupError() + { $this->expectException(new HTMLPurifier_Exception("Cannot retrieve raw definition after it has already been setup")); $config = HTMLPurifier_Config::createDefault(); $config->chatty = false; @@ -262,7 +267,8 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness $config->getHTMLDefinition(true); } - function test_getHTMLDefinition_inconsistentOptimizedError() { + public function test_getHTMLDefinition_inconsistentOptimizedError() + { $this->expectError("Useless DefinitionID declaration"); $this->expectException(new HTMLPurifier_Exception("Inconsistent use of optimized and unoptimized raw definition retrievals")); $config = HTMLPurifier_Config::create(array('HTML.DefinitionID' => 'HTMLPurifier_ConfigTest->test_getHTMLDefinition_inconsistentOptimizedError')); @@ -271,7 +277,8 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness $config->getHTMLDefinition(true, true); } - function test_getHTMLDefinition_inconsistentOptimizedError2() { + public function test_getHTMLDefinition_inconsistentOptimizedError2() + { $this->expectException(new HTMLPurifier_Exception("Inconsistent use of optimized and unoptimized raw definition retrievals")); $config = HTMLPurifier_Config::create(array('HTML.DefinitionID' => 'HTMLPurifier_ConfigTest->test_getHTMLDefinition_inconsistentOptimizedError2')); $config->chatty = false; @@ -279,26 +286,30 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness $config->getHTMLDefinition(true, false); } - function test_getHTMLDefinition_rawError() { + public function test_getHTMLDefinition_rawError() + { $config = HTMLPurifier_Config::createDefault(); $this->expectException(new HTMLPurifier_Exception('Cannot retrieve raw version without specifying %HTML.DefinitionID')); $def = $config->getHTMLDefinition(true, true); } - function test_getCSSDefinition() { + public function test_getCSSDefinition() + { $config = HTMLPurifier_Config::createDefault(); $def = $config->getCSSDefinition(); $this->assertIsA($def, 'HTMLPurifier_CSSDefinition'); } - function test_getDefinition() { + public function test_getDefinition() + { $this->schema->add('Cache.DefinitionImpl', null, 'string', true); $config = new HTMLPurifier_Config($this->schema); $this->expectException(new HTMLPurifier_Exception("Definition of Crust type not supported")); $config->getDefinition('Crust'); } - function test_loadArray() { + public function test_loadArray() + { // setup a few dummy namespaces/directives for our testing $this->schema->add('Zoo.Aadvark', 0, 'int', false); $this->schema->add('Zoo.Boar', 0, 'int', false); @@ -337,8 +348,8 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness } - function test_create() { - + public function test_create() + { $this->schema->add('Cake.Sprinkles', 666, 'int', false); $this->schema->add('Cake.Flavor', 'vanilla', 'string', false); @@ -359,8 +370,8 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness } - function test_finalize() { - + public function test_finalize() + { // test finalization $this->schema->add('Poem.Meter', 'iambic', 'string', false); @@ -384,8 +395,8 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness } - function test_loadArrayFromForm() { - + public function test_loadArrayFromForm() + { $this->schema->add('Pancake.Mix', 'buttermilk', 'string', false); $this->schema->add('Pancake.Served', true, 'bool', false); $this->schema->add('Toppings.Syrup', true, 'bool', false); @@ -444,7 +455,8 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness */ } - function test_getAllowedDirectivesForForm() { + public function test_getAllowedDirectivesForForm() + { $this->schema->add('Unused.Unused', 'Foobar', 'string', false); $this->schema->add('Partial.Allowed', true, 'bool', false); $this->schema->add('Partial.Unused', 'Foobar', 'string', false); @@ -464,7 +476,8 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness } - function testDeprecatedAPI() { + public function testDeprecatedAPI() + { $this->schema->add('Foo.Bar', 2, 'int', false); $config = new HTMLPurifier_Config($this->schema); $config->chatty = false; @@ -474,7 +487,8 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness $this->assertIdentical($config->get('Foo', 'Bar'), 4); } - function testInherit() { + public function testInherit() + { $this->schema->add('Phantom.Masked', 25, 'int', false); $this->schema->add('Phantom.Unmasked', 89, 'int', false); $this->schema->add('Phantom.Latemasked', 11, 'int', false); @@ -487,14 +501,16 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness $this->assertIdentical($subconfig->get('Phantom.Latemasked'), 100); } - function testSerialize() { + public function testSerialize() + { $config = HTMLPurifier_Config::createDefault(); $config->set('HTML.Allowed', 'a'); $config2 = unserialize($config->serialize()); $this->assertIdentical($config->get('HTML.Allowed'), $config2->get('HTML.Allowed')); } - function testDefinitionCachingNothing() { + public function testDefinitionCachingNothing() + { list($mock, $config) = $this->setupCacheMock('HTML'); // should not touch the cache $mock->expectNever('get'); @@ -506,7 +522,8 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness $this->teardownCacheMock(); } - function testDefinitionCachingOptimized() { + public function testDefinitionCachingOptimized() + { list($mock, $config) = $this->setupCacheMock('HTML'); $mock->expectNever('set'); $config->set('HTML.DefinitionID', 'HTMLPurifier_ConfigTest->testDefinitionCachingOptimized'); @@ -519,7 +536,8 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness $this->teardownCacheMock(); } - function testDefinitionCachingOptimizedHit() { + public function testDefinitionCachingOptimizedHit() + { $fake_config = HTMLPurifier_Config::createDefault(); $fake_def = $fake_config->getHTMLDefinition(); list($mock, $config) = $this->setupCacheMock('HTML'); @@ -535,7 +553,8 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness $this->teardownCacheMock(); } - protected function setupCacheMock($type) { + protected function setupCacheMock($type) + { // inject our definition cache mock globally (borrowed from // DefinitionFactoryTest) generate_mock_once("HTMLPurifier_DefinitionCacheFactory"); @@ -548,7 +567,8 @@ class HTMLPurifier_ConfigTest extends HTMLPurifier_Harness $factory->setReturnValue('create', $mock, array($type, $config)); return array($mock, $config); } - protected function teardownCacheMock() { + protected function teardownCacheMock() + { HTMLPurifier_DefinitionCacheFactory::instance($this->oldFactory); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ContextTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ContextTest.php index c5cef16517..8baaf27ee1 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ContextTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ContextTest.php @@ -6,12 +6,13 @@ class HTMLPurifier_ContextTest extends HTMLPurifier_Harness protected $context; - public function setUp() { + public function setUp() + { $this->context = new HTMLPurifier_Context(); } - function testStandardUsage() { - + public function testStandardUsage() + { generate_mock_once('HTMLPurifier_IDAccumulator'); $this->assertFalse($this->context->exists('IDAccumulator')); @@ -35,8 +36,8 @@ class HTMLPurifier_ContextTest extends HTMLPurifier_Harness } - function testReRegister() { - + public function testReRegister() + { $var = true; $this->context->register('OnceOnly', $var); @@ -49,8 +50,8 @@ class HTMLPurifier_ContextTest extends HTMLPurifier_Harness } - function test_loadArray() { - + public function test_loadArray() + { // references can be *really* wonky! $context_manual = new HTMLPurifier_Context(); @@ -79,6 +80,14 @@ class HTMLPurifier_ContextTest extends HTMLPurifier_Harness } + public function testNull() { + $context = new HTMLPurifier_Context(); + $var = NULL; + $context->register('var', $var); + $this->assertNull($context->get('var')); + $context->destroy('var'); + } + } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/Decorator/CleanupTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/Decorator/CleanupTest.php index afcb0e39f9..1cd967344b 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/Decorator/CleanupTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/Decorator/CleanupTest.php @@ -5,48 +5,56 @@ generate_mock_once('HTMLPurifier_DefinitionCache'); class HTMLPurifier_DefinitionCache_Decorator_CleanupTest extends HTMLPurifier_DefinitionCache_DecoratorHarness { - function setup() { + public function setup() + { $this->cache = new HTMLPurifier_DefinitionCache_Decorator_Cleanup(); parent::setup(); } - function setupMockForSuccess($op) { + public function setupMockForSuccess($op) + { $this->mock->expectOnce($op, array($this->def, $this->config)); $this->mock->setReturnValue($op, true, array($this->def, $this->config)); $this->mock->expectNever('cleanup'); } - function setupMockForFailure($op) { + public function setupMockForFailure($op) + { $this->mock->expectOnce($op, array($this->def, $this->config)); $this->mock->setReturnValue($op, false, array($this->def, $this->config)); $this->mock->expectOnce('cleanup', array($this->config)); } - function test_get() { + public function test_get() + { $this->mock->expectOnce('get', array($this->config)); $this->mock->setReturnValue('get', true, array($this->config)); $this->mock->expectNever('cleanup'); $this->assertEqual($this->cache->get($this->config), $this->def); } - function test_get_failure() { + public function test_get_failure() + { $this->mock->expectOnce('get', array($this->config)); $this->mock->setReturnValue('get', false, array($this->config)); $this->mock->expectOnce('cleanup', array($this->config)); $this->assertEqual($this->cache->get($this->config), false); } - function test_set() { + public function test_set() + { $this->setupMockForSuccess('set'); $this->assertEqual($this->cache->set($this->def, $this->config), true); } - function test_replace() { + public function test_replace() + { $this->setupMockForSuccess('replace'); $this->assertEqual($this->cache->replace($this->def, $this->config), true); } - function test_add() { + public function test_add() + { $this->setupMockForSuccess('add'); $this->assertEqual($this->cache->add($this->def, $this->config), true); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/Decorator/MemoryTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/Decorator/MemoryTest.php index 55f2f249c1..bcb0fb04d9 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/Decorator/MemoryTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/Decorator/MemoryTest.php @@ -5,61 +5,71 @@ generate_mock_once('HTMLPurifier_DefinitionCache'); class HTMLPurifier_DefinitionCache_Decorator_MemoryTest extends HTMLPurifier_DefinitionCache_DecoratorHarness { - function setup() { + public function setup() + { $this->cache = new HTMLPurifier_DefinitionCache_Decorator_Memory(); parent::setup(); } - function setupMockForSuccess($op) { + public function setupMockForSuccess($op) + { $this->mock->expectOnce($op, array($this->def, $this->config)); $this->mock->setReturnValue($op, true, array($this->def, $this->config)); $this->mock->expectNever('get'); } - function setupMockForFailure($op) { + public function setupMockForFailure($op) + { $this->mock->expectOnce($op, array($this->def, $this->config)); $this->mock->setReturnValue($op, false, array($this->def, $this->config)); $this->mock->expectOnce('get', array($this->config)); } - function test_get() { + public function test_get() + { $this->mock->expectOnce('get', array($this->config)); // only ONE call! $this->mock->setReturnValue('get', $this->def, array($this->config)); $this->assertEqual($this->cache->get($this->config), $this->def); $this->assertEqual($this->cache->get($this->config), $this->def); } - function test_set() { + public function test_set() + { $this->setupMockForSuccess('set', 'get'); $this->assertEqual($this->cache->set($this->def, $this->config), true); $this->assertEqual($this->cache->get($this->config), $this->def); } - function test_set_failure() { + public function test_set_failure() + { $this->setupMockForFailure('set', 'get'); $this->assertEqual($this->cache->set($this->def, $this->config), false); $this->cache->get($this->config); } - function test_replace() { + public function test_replace() + { $this->setupMockForSuccess('replace', 'get'); $this->assertEqual($this->cache->replace($this->def, $this->config), true); $this->assertEqual($this->cache->get($this->config), $this->def); } - function test_replace_failure() { + public function test_replace_failure() + { $this->setupMockForFailure('replace', 'get'); $this->assertEqual($this->cache->replace($this->def, $this->config), false); $this->cache->get($this->config); } - function test_add() { + public function test_add() + { $this->setupMockForSuccess('add', 'get'); $this->assertEqual($this->cache->add($this->def, $this->config), true); $this->assertEqual($this->cache->get($this->config), $this->def); } - function test_add_failure() { + public function test_add_failure() + { $this->setupMockForFailure('add', 'get'); $this->assertEqual($this->cache->add($this->def, $this->config), false); $this->cache->get($this->config); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/DecoratorHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/DecoratorHarness.php index 64951a3edc..43db45afba 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/DecoratorHarness.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/DecoratorHarness.php @@ -5,7 +5,8 @@ generate_mock_once('HTMLPurifier_DefinitionCache'); class HTMLPurifier_DefinitionCache_DecoratorHarness extends HTMLPurifier_DefinitionCacheHarness { - function setup() { + public function setup() + { $this->mock = new HTMLPurifier_DefinitionCacheMock(); $this->mock->type = 'Test'; $this->cache = $this->cache->decorate($this->mock); @@ -13,7 +14,8 @@ class HTMLPurifier_DefinitionCache_DecoratorHarness extends HTMLPurifier_Definit $this->config = $this->generateConfigMock(); } - function teardown() { + public function teardown() + { unset($this->mock); unset($this->cache); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/DecoratorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/DecoratorTest.php index f649679707..ed560687db 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/DecoratorTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/DecoratorTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_DefinitionCache_DecoratorTest extends HTMLPurifier_DefinitionCacheHarness { - function test() { - + public function test() + { generate_mock_once('HTMLPurifier_DefinitionCache'); $mock = new HTMLPurifier_DefinitionCacheMock(); $mock->type = 'Test'; diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/SerializerTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/SerializerTest.php index f6fec51ef4..badf9d9827 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/SerializerTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/SerializerTest.php @@ -3,7 +3,8 @@ class HTMLPurifier_DefinitionCache_SerializerTest extends HTMLPurifier_DefinitionCacheHarness { - function test() { + public function test() + { // XXX SimpleTest does some really crazy stuff in the background // to do equality checks. Unfortunately, this makes some // versions of PHP segfault. So we need to define a better, @@ -66,7 +67,8 @@ class HTMLPurifier_DefinitionCache_SerializerTest extends HTMLPurifier_Definitio } - function test_errors() { + public function test_errors() + { $cache = new HTMLPurifier_DefinitionCache_Serializer('Test'); $def = $this->generateDefinition(); $def->setup = true; @@ -83,8 +85,8 @@ class HTMLPurifier_DefinitionCache_SerializerTest extends HTMLPurifier_Definitio $cache->replace($def, $config); } - function test_flush() { - + public function test_flush() + { $cache = new HTMLPurifier_DefinitionCache_Serializer('Test'); $config1 = $this->generateConfigMock('test1'); @@ -111,8 +113,8 @@ class HTMLPurifier_DefinitionCache_SerializerTest extends HTMLPurifier_Definitio } - function testCleanup() { - + public function testCleanup() + { $cache = new HTMLPurifier_DefinitionCache_Serializer('Test'); // in order of age, oldest first @@ -139,8 +141,8 @@ class HTMLPurifier_DefinitionCache_SerializerTest extends HTMLPurifier_Definitio } - function testCleanupOnlySameID() { - + public function testCleanupOnlySameID() + { $cache = new HTMLPurifier_DefinitionCache_Serializer('Test'); $config1 = $this->generateConfigMock('serial1'); @@ -168,7 +170,8 @@ class HTMLPurifier_DefinitionCache_SerializerTest extends HTMLPurifier_Definitio /** * Asserts that a file exists, ignoring the stat cache */ - function assertFileExist($file) { + public function assertFileExist($file) + { clearstatcache(); $this->assertTrue(file_exists($file), 'Expected ' . $file . ' exists'); } @@ -176,13 +179,14 @@ class HTMLPurifier_DefinitionCache_SerializerTest extends HTMLPurifier_Definitio /** * Asserts that a file does not exist, ignoring the stat cache */ - function assertFileNotExist($file) { + public function assertFileNotExist($file) + { clearstatcache(); $this->assertFalse(file_exists($file), 'Expected ' . $file . ' does not exist'); } - function testAlternatePath() { - + public function testAlternatePath() + { $cache = new HTMLPurifier_DefinitionCache_Serializer('Test'); $config = $this->generateConfigMock('serial'); $config->version = '1.0.0'; @@ -199,8 +203,8 @@ class HTMLPurifier_DefinitionCache_SerializerTest extends HTMLPurifier_Definitio } - function testAlternatePermissions() { - + public function testAlternatePermissions() + { $cache = new HTMLPurifier_DefinitionCache_Serializer('Test'); $config = $this->generateConfigMock('serial'); $config->version = '1.0.0'; diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheFactoryTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheFactoryTest.php index d50ef8be12..fe27e0d51a 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheFactoryTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheFactoryTest.php @@ -6,23 +6,27 @@ class HTMLPurifier_DefinitionCacheFactoryTest extends HTMLPurifier_Harness protected $factory; protected $oldFactory; - public function setUp() { + public function setUp() + { parent::setup(); $this->factory = new HTMLPurifier_DefinitionCacheFactory(); $this->oldFactory = HTMLPurifier_DefinitionCacheFactory::instance(); HTMLPurifier_DefinitionCacheFactory::instance($this->factory); } - public function tearDown() { + public function tearDown() + { HTMLPurifier_DefinitionCacheFactory::instance($this->oldFactory); } - function test_create() { + public function test_create() + { $cache = $this->factory->create('Test', $this->config); $this->assertEqual($cache, new HTMLPurifier_DefinitionCache_Serializer('Test')); } - function test_create_withDecorator() { + public function test_create_withDecorator() + { $this->factory->addDecorator('Memory'); $cache = $this->factory->create('Test', $this->config); $cache_real = new HTMLPurifier_DefinitionCache_Decorator_Memory(); @@ -30,7 +34,8 @@ class HTMLPurifier_DefinitionCacheFactoryTest extends HTMLPurifier_Harness $this->assertEqual($cache, $cache_real); } - function test_create_withDecoratorObject() { + public function test_create_withDecoratorObject() + { $this->factory->addDecorator(new HTMLPurifier_DefinitionCache_Decorator_Memory()); $cache = $this->factory->create('Test', $this->config); $cache_real = new HTMLPurifier_DefinitionCache_Decorator_Memory(); @@ -38,26 +43,30 @@ class HTMLPurifier_DefinitionCacheFactoryTest extends HTMLPurifier_Harness $this->assertEqual($cache, $cache_real); } - function test_create_recycling() { + public function test_create_recycling() + { $cache = $this->factory->create('Test', $this->config); $cache2 = $this->factory->create('Test', $this->config); $this->assertReference($cache, $cache2); } - function test_create_invalid() { + public function test_create_invalid() + { $this->config->set('Cache.DefinitionImpl', 'Invalid'); $this->expectError('Unrecognized DefinitionCache Invalid, using Serializer instead'); $cache = $this->factory->create('Test', $this->config); $this->assertIsA($cache, 'HTMLPurifier_DefinitionCache_Serializer'); } - function test_null() { + public function test_null() + { $this->config->set('Cache.DefinitionImpl', null); $cache = $this->factory->create('Test', $this->config); $this->assertEqual($cache, new HTMLPurifier_DefinitionCache_Null('Test')); } - function test_register() { + public function test_register() + { generate_mock_once('HTMLPurifier_DefinitionCache'); $this->config->set('Cache.DefinitionImpl', 'TestCache'); $this->factory->register('TestCache', $class = 'HTMLPurifier_DefinitionCacheMock'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheHarness.php index ab3cef451f..646e8bdb3d 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheHarness.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheHarness.php @@ -8,7 +8,8 @@ class HTMLPurifier_DefinitionCacheHarness extends HTMLPurifier_Harness * to a getBatch() call * @param $values Values to return when getBatch is invoked */ - protected function generateConfigMock($serial = 'defaultserial') { + protected function generateConfigMock($serial = 'defaultserial') + { generate_mock_once('HTMLPurifier_Config'); $config = new HTMLPurifier_ConfigMock(); $config->setReturnValue('getBatchSerial', $serial, array('Test')); @@ -19,7 +20,8 @@ class HTMLPurifier_DefinitionCacheHarness extends HTMLPurifier_Harness /** * Returns an anonymous def that has been setup and named Test */ - protected function generateDefinition($member_vars = array()) { + protected function generateDefinition($member_vars = array()) + { $def = new HTMLPurifier_DefinitionTestable(); $def->setup = true; $def->type = 'Test'; diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheTest.php index 5ad2ff9cb9..d6c06759cb 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheTest.php @@ -3,7 +3,8 @@ class HTMLPurifier_DefinitionCacheTest extends HTMLPurifier_Harness { - function test_isOld() { + public function test_isOld() + { // using null subclass because parent is abstract $cache = new HTMLPurifier_DefinitionCache_Null('Test'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionTest.php index 38676ad7a8..826e2b6c40 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionTest.php @@ -2,13 +2,15 @@ class HTMLPurifier_DefinitionTest extends HTMLPurifier_Harness { - function test_setup() { + public function test_setup() + { $def = new HTMLPurifier_DefinitionTestable(); $config = HTMLPurifier_Config::createDefault(); $def->expectOnce('doSetup', array($config)); $def->setup($config); } - function test_setup_redundant() { + public function test_setup_redundant() + { $def = new HTMLPurifier_DefinitionTestable(); $config = HTMLPurifier_Config::createDefault(); $def->expectNever('doSetup'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DoctypeRegistryTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DoctypeRegistryTest.php index 189003ace5..b1012b1b49 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DoctypeRegistryTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DoctypeRegistryTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_DoctypeRegistryTest extends HTMLPurifier_Harness { - function test_register() { - + public function test_register() + { $registry = new HTMLPurifier_DoctypeRegistry(); $d = $registry->register( @@ -30,8 +30,8 @@ class HTMLPurifier_DoctypeRegistryTest extends HTMLPurifier_Harness } - function test_get() { - + public function test_get() + { // see also alias and register tests $registry = new HTMLPurifier_DoctypeRegistry(); @@ -45,8 +45,8 @@ class HTMLPurifier_DoctypeRegistryTest extends HTMLPurifier_Harness } - function testAliases() { - + public function testAliases() + { $registry = new HTMLPurifier_DoctypeRegistry(); $d1 = $registry->register('Doc1', true, array(), array(), array('1')); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ElementDefTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ElementDefTest.php index 8f93ea3a93..31ef8cf68d 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ElementDefTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ElementDefTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_ElementDefTest extends HTMLPurifier_Harness { - function test_mergeIn() { - + public function test_mergeIn() + { $def1 = new HTMLPurifier_ElementDef(); $def2 = new HTMLPurifier_ElementDef(); $def3 = new HTMLPurifier_ElementDef(); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EncoderTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EncoderTest.php index e9593e2c47..819d4b1177 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EncoderTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EncoderTest.php @@ -5,18 +5,21 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness protected $_entity_lookup; - function setUp() { + public function setUp() + { $this->_entity_lookup = HTMLPurifier_EntityLookup::instance(); parent::setUp(); } - function assertCleanUTF8($string, $expect = null) { + public function assertCleanUTF8($string, $expect = null) + { if ($expect === null) $expect = $string; $this->assertIdentical(HTMLPurifier_Encoder::cleanUTF8($string), $expect, 'iconv: %s'); $this->assertIdentical(HTMLPurifier_Encoder::cleanUTF8($string, true), $expect, 'PHP: %s'); } - function test_cleanUTF8() { + public function test_cleanUTF8() + { $this->assertCleanUTF8('Normal string.'); $this->assertCleanUTF8("Test\tAllowed\nControl\rCharacters"); $this->assertCleanUTF8("null byte: \0", 'null byte: '); @@ -29,7 +32,8 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness $this->assertCleanUTF8("\xED\xB0\x80", ''); } - function test_convertToUTF8_noConvert() { + public function test_convertToUTF8_noConvert() + { // UTF-8 means that we don't touch it $this->assertIdentical( HTMLPurifier_Encoder::convertToUTF8("\xF6", $this->config, $this->context), @@ -38,7 +42,8 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness ); } - function test_convertToUTF8_spuriousEncoding() { + public function test_convertToUTF8_spuriousEncoding() + { if (!HTMLPurifier_Encoder::iconvAvailable()) return; $this->config->set('Core.Encoding', 'utf99'); $this->expectError('Invalid encoding utf99'); @@ -48,7 +53,8 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness ); } - function test_convertToUTF8_iso8859_1() { + public function test_convertToUTF8_iso8859_1() + { $this->config->set('Core.Encoding', 'ISO-8859-1'); $this->assertIdentical( HTMLPurifier_Encoder::convertToUTF8("\xF6", $this->config, $this->context), @@ -56,7 +62,8 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness ); } - function test_convertToUTF8_withoutIconv() { + public function test_convertToUTF8_withoutIconv() + { $this->config->set('Core.Encoding', 'ISO-8859-1'); $this->config->set('Test.ForceNoIconv', true); $this->assertIdentical( @@ -66,11 +73,13 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness } - function getZhongWen() { + public function getZhongWen() + { return "\xE4\xB8\xAD\xE6\x96\x87 (Chinese)"; } - function test_convertFromUTF8_utf8() { + public function test_convertFromUTF8_utf8() + { // UTF-8 means that we don't touch it $this->assertIdentical( HTMLPurifier_Encoder::convertFromUTF8("\xC3\xB6", $this->config, $this->context), @@ -78,7 +87,8 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness ); } - function test_convertFromUTF8_iso8859_1() { + public function test_convertFromUTF8_iso8859_1() + { $this->config->set('Core.Encoding', 'ISO-8859-1'); $this->assertIdentical( HTMLPurifier_Encoder::convertFromUTF8("\xC3\xB6", $this->config, $this->context), @@ -87,7 +97,8 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness ); } - function test_convertFromUTF8_iconvNoChars() { + public function test_convertFromUTF8_iconvNoChars() + { if (!HTMLPurifier_Encoder::iconvAvailable()) return; $this->config->set('Core.Encoding', 'ISO-8859-1'); $this->assertIdentical( @@ -96,7 +107,8 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness ); } - function test_convertFromUTF8_phpNormal() { + public function test_convertFromUTF8_phpNormal() + { // Plain PHP implementation has slightly different behavior $this->config->set('Core.Encoding', 'ISO-8859-1'); $this->config->set('Test.ForceNoIconv', true); @@ -107,7 +119,8 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness ); } - function test_convertFromUTF8_phpNoChars() { + public function test_convertFromUTF8_phpNoChars() + { $this->config->set('Core.Encoding', 'ISO-8859-1'); $this->config->set('Test.ForceNoIconv', true); $this->assertIdentical( @@ -116,7 +129,8 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness ); } - function test_convertFromUTF8_withProtection() { + public function test_convertFromUTF8_withProtection() + { // Preserve the characters! $this->config->set('Core.Encoding', 'ISO-8859-1'); $this->config->set('Core.EscapeNonASCIICharacters', true); @@ -126,7 +140,8 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness ); } - function test_convertFromUTF8_withProtectionButUtf8() { + public function test_convertFromUTF8_withProtectionButUtf8() + { // Preserve the characters! $this->config->set('Core.EscapeNonASCIICharacters', true); $this->assertIdentical( @@ -135,8 +150,8 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness ); } - function test_convertToASCIIDumbLossless() { - + public function test_convertToASCIIDumbLossless() + { // Uppercase thorn letter $this->assertIdentical( HTMLPurifier_Encoder::convertToASCIIDumbLossless("\xC3\x9Eorn"), @@ -156,7 +171,8 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness } - function assertASCIISupportCheck($enc, $ret) { + public function assertASCIISupportCheck($enc, $ret) + { $test = HTMLPurifier_Encoder::testEncodingSupportsASCII($enc, true); if ($test === false) return; $this->assertIdentical( @@ -169,7 +185,8 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness ); } - function test_testEncodingSupportsASCII() { + public function test_testEncodingSupportsASCII() + { if (HTMLPurifier_Encoder::iconvAvailable()) { $this->assertASCIISupportCheck('Shift_JIS', array("\xC2\xA5" => '\\', "\xE2\x80\xBE" => '~')); $this->assertASCIISupportCheck('JOHAB', array("\xE2\x82\xA9" => '\\')); @@ -178,7 +195,8 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness $this->assertASCIISupportCheck('dontexist', array()); // canary } - function testShiftJIS() { + public function testShiftJIS() + { if (!HTMLPurifier_Encoder::iconvAvailable()) return; $this->config->set('Core.Encoding', 'Shift_JIS'); // This actually looks like a Yen, but we're going to treat it differently @@ -192,7 +210,8 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness ); } - function testIconvTruncateBug() { + public function testIconvTruncateBug() + { if (!HTMLPurifier_Encoder::iconvAvailable()) return; if (HTMLPurifier_Encoder::testIconvTruncateBug() !== HTMLPurifier_Encoder::ICONV_TRUNCATES) return; $this->config->set('Core.Encoding', 'ISO-8859-1'); @@ -202,7 +221,8 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness ); } - function testIconvChunking() { + public function testIconvChunking() + { if (!HTMLPurifier_Encoder::iconvAvailable()) return; if (HTMLPurifier_Encoder::testIconvTruncateBug() !== HTMLPurifier_Encoder::ICONV_TRUNCATES) return; $this->assertIdentical(HTMLPurifier_Encoder::iconv('utf-8', 'iso-8859-1//IGNORE', "a\xF3\xA0\x80\xA0b", 4), 'ab'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EntityLookupTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EntityLookupTest.php index e715f64a24..e8c3d35ed7 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EntityLookupTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EntityLookupTest.php @@ -5,8 +5,8 @@ class HTMLPurifier_EntityLookupTest extends HTMLPurifier_Harness { - function test() { - + public function test() + { $lookup = HTMLPurifier_EntityLookup::instance(); // latin char diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EntityParserTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EntityParserTest.php index 17ef62a18f..dddb4d4951 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EntityParserTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EntityParserTest.php @@ -5,12 +5,14 @@ class HTMLPurifier_EntityParserTest extends HTMLPurifier_Harness protected $EntityParser; - public function setUp() { + public function setUp() + { $this->EntityParser = new HTMLPurifier_EntityParser(); $this->_entity_lookup = HTMLPurifier_EntityLookup::instance(); } - function test_substituteNonSpecialEntities() { + public function test_substituteNonSpecialEntities() + { $char_theta = $this->_entity_lookup->table['theta']; $this->assertIdentical($char_theta, $this->EntityParser->substituteNonSpecialEntities('θ') ); @@ -73,7 +75,8 @@ class HTMLPurifier_EntityParserTest extends HTMLPurifier_Harness } - function test_substituteSpecialEntities() { + public function test_substituteSpecialEntities() + { $this->assertIdentical( "'", $this->EntityParser->substituteSpecialEntities(''') diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorCollectorEMock.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorCollectorEMock.php index bbd0965694..675a71dda6 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorCollectorEMock.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorCollectorEMock.php @@ -12,18 +12,22 @@ class HTMLPurifier_ErrorCollectorEMock extends HTMLPurifier_ErrorCollectorMock private $_expected_context = array(); private $_expected_context_at = array(); - public function prepare($context) { + public function prepare($context) + { $this->_context = $context; } - public function expectContext($key, $value) { + public function expectContext($key, $value) + { $this->_expected_context[$key] = $value; } - public function expectContextAt($step, $key, $value) { + public function expectContextAt($step, $key, $value) + { $this->_expected_context_at[$step][$key] = $value; } - public function send($v1, $v2) { + public function send($v1, $v2) + { // test for context $context = SimpleTest::getContext(); $test = $context->getTest(); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorCollectorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorCollectorTest.php index 09becba53d..20cec81f59 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorCollectorTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorCollectorTest.php @@ -9,7 +9,8 @@ class HTMLPurifier_ErrorCollectorTest extends HTMLPurifier_Harness protected $language, $generator, $line; protected $collector; - public function setup() { + public function setup() + { generate_mock_once('HTMLPurifier_Language'); generate_mock_once('HTMLPurifier_Generator'); parent::setup(); @@ -26,8 +27,8 @@ class HTMLPurifier_ErrorCollectorTest extends HTMLPurifier_Harness $this->collector = new HTMLPurifier_ErrorCollector($this->context); } - function test() { - + public function test() + { $language = $this->language; $language->setReturnValue('getMessage', 'Message 1', array('message-1')); $language->setReturnValue('formatMessage', 'Message 2', array('message-2', array(1 => 'param'))); @@ -57,7 +58,8 @@ class HTMLPurifier_ErrorCollectorTest extends HTMLPurifier_Harness } - function testNoErrors() { + public function testNoErrors() + { $this->language->setReturnValue('getMessage', 'No errors', array('ErrorCollector: No errors')); $formatted_result = '

                          No errors

                          '; @@ -67,7 +69,8 @@ class HTMLPurifier_ErrorCollectorTest extends HTMLPurifier_Harness ); } - function testNoLineNumbers() { + public function testNoLineNumbers() + { $this->language->setReturnValue('getMessage', 'Message 1', array('message-1')); $this->language->setReturnValue('getMessage', 'Message 2', array('message-2')); @@ -88,8 +91,8 @@ class HTMLPurifier_ErrorCollectorTest extends HTMLPurifier_Harness */ } - function testContextSubstitutions() { - + public function testContextSubstitutions() + { $current_token = false; $this->context->register('CurrentToken', $current_token); @@ -120,7 +123,8 @@ class HTMLPurifier_ErrorCollectorTest extends HTMLPurifier_Harness } /* - function testNestedErrors() { + public function testNestedErrors() + { $this->language->setReturnValue('getMessage', 'Message 1', array('message-1')); $this->language->setReturnValue('getMessage', 'Message 2', array('message-2')); $this->language->setReturnValue('formatMessage', 'End Message', array('end-message', array(1 => 'param'))); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorsHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorsHarness.php index f7c673ca53..4e38fed028 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorsHarness.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorsHarness.php @@ -10,7 +10,8 @@ class HTMLPurifier_ErrorsHarness extends HTMLPurifier_Harness protected $config, $context; protected $collector, $generator, $callCount; - public function setup() { + public function setup() + { $this->config = HTMLPurifier_Config::create(array('Core.CollectErrors' => true)); $this->context = new HTMLPurifier_Context(); generate_mock_once('HTMLPurifier_ErrorCollector'); @@ -20,16 +21,19 @@ class HTMLPurifier_ErrorsHarness extends HTMLPurifier_Harness $this->callCount = 0; } - protected function expectNoErrorCollection() { + protected function expectNoErrorCollection() + { $this->collector->expectNever('send'); } - protected function expectErrorCollection() { + protected function expectErrorCollection() + { $args = func_get_args(); $this->collector->expectOnce('send', $args); } - protected function expectContext($key, $value) { + protected function expectContext($key, $value) + { $this->collector->expectContext($key, $value); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Filter/ExtractStyleBlocksTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Filter/ExtractStyleBlocksTest.php index a166022a08..695e995fb9 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Filter/ExtractStyleBlocksTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Filter/ExtractStyleBlocksTest.php @@ -7,7 +7,8 @@ class HTMLPurifier_Filter_ExtractStyleBlocksTest extends HTMLPurifier_Harness { // usual use case: - function test_tokenizeHTML_extractStyleBlocks() { + public function test_tokenizeHTML_extractStyleBlocks() + { $this->config->set('Filter.ExtractStyleBlocks', true); $purifier = new HTMLPurifier($this->config); $result = $purifier->purify('Test'); @@ -20,7 +21,8 @@ class HTMLPurifier_Filter_ExtractStyleBlocksTest extends HTMLPurifier_Harness ); } - function assertExtractStyleBlocks($html, $expect = true, $styles = array()) { + public function assertExtractStyleBlocks($html, $expect = true, $styles = array()) + { $filter = new HTMLPurifier_Filter_ExtractStyleBlocks(); // disable cleaning if ($expect === true) $expect = $html; $this->config->set('Filter.ExtractStyleBlocks.TidyImpl', false); @@ -29,15 +31,18 @@ class HTMLPurifier_Filter_ExtractStyleBlocksTest extends HTMLPurifier_Harness $this->assertIdentical($this->context->get('StyleBlocks'), $styles); } - function test_extractStyleBlocks_preserve() { + public function test_extractStyleBlocks_preserve() + { $this->assertExtractStyleBlocks('Foobar'); } - function test_extractStyleBlocks_allStyle() { + public function test_extractStyleBlocks_allStyle() + { $this->assertExtractStyleBlocks('', '', array('foo')); } - function test_extractStyleBlocks_multipleBlocks() { + public function test_extractStyleBlocks_multipleBlocks() + { $this->assertExtractStyleBlocks( "NOP", "NOP", @@ -45,7 +50,8 @@ class HTMLPurifier_Filter_ExtractStyleBlocksTest extends HTMLPurifier_Harness ); } - function test_extractStyleBlocks_blockWithAttributes() { + public function test_extractStyleBlocks_blockWithAttributes() + { $this->assertExtractStyleBlocks( '', '', @@ -53,7 +59,8 @@ class HTMLPurifier_Filter_ExtractStyleBlocksTest extends HTMLPurifier_Harness ); } - function test_extractStyleBlocks_styleWithPadding() { + public function test_extractStyleBlocks_styleWithPadding() + { $this->assertExtractStyleBlocks( "AlasAwesome\n Trendy!", "AlasAwesome\n Trendy!", @@ -61,7 +68,8 @@ class HTMLPurifier_Filter_ExtractStyleBlocksTest extends HTMLPurifier_Harness ); } - function assertCleanCSS($input, $expect = true) { + public function assertCleanCSS($input, $expect = true) + { $filter = new HTMLPurifier_Filter_ExtractStyleBlocks(); if ($expect === true) $expect = $input; $this->normalize($input); @@ -70,15 +78,18 @@ class HTMLPurifier_Filter_ExtractStyleBlocksTest extends HTMLPurifier_Harness $this->assertIdentical($result, $expect); } - function test_cleanCSS_malformed() { + public function test_cleanCSS_malformed() + { $this->assertCleanCSS('', ''); } - function test_cleanCSS_selector() { + public function test_cleanCSS_selector() + { $this->assertCleanCSS("a .foo #id div.cl#foo {\nfont-weight:700;\n}"); } - function test_cleanCSS_angledBrackets() { + public function test_cleanCSS_angledBrackets() + { // [Content] No longer can smuggle in angled brackets using // font-family; when we add support for 'content', reinstate // this test. @@ -88,7 +99,8 @@ class HTMLPurifier_Filter_ExtractStyleBlocksTest extends HTMLPurifier_Harness //); } - function test_cleanCSS_angledBrackets2() { + public function test_cleanCSS_angledBrackets2() + { // CSSTidy's behavior in this case is wrong, and should be fixed //$this->assertCleanCSS( // "span[title=\"\"] {\nfont-size:12pt;\n}", @@ -96,18 +108,21 @@ class HTMLPurifier_Filter_ExtractStyleBlocksTest extends HTMLPurifier_Harness //); } - function test_cleanCSS_bogus() { + public function test_cleanCSS_bogus() + { $this->assertCleanCSS("div {bogus:tree;}", "div {\n}"); } /* [CONTENT] - function test_cleanCSS_escapeCodes() { + public function test_cleanCSS_escapeCodes() + { $this->assertCleanCSS( ".class {\nfont-family:\"\\3C /style\\3E \";\n}" ); } - function test_cleanCSS_noEscapeCodes() { + public function test_cleanCSS_noEscapeCodes() + { $this->config->set('Filter.ExtractStyleBlocks.Escaping', false); $this->assertCleanCSS( ".class {\nfont-family:\"\";\n}" @@ -115,7 +130,8 @@ class HTMLPurifier_Filter_ExtractStyleBlocksTest extends HTMLPurifier_Harness } */ - function test_cleanCSS_scope() { + public function test_cleanCSS_scope() + { $this->config->set('Filter.ExtractStyleBlocks.Scope', '#foo'); $this->assertCleanCSS( "p {\ntext-indent:1em;\n}", @@ -123,7 +139,8 @@ class HTMLPurifier_Filter_ExtractStyleBlocksTest extends HTMLPurifier_Harness ); } - function test_cleanCSS_scopeWithSelectorCommas() { + public function test_cleanCSS_scopeWithSelectorCommas() + { $this->config->set('Filter.ExtractStyleBlocks.Scope', '#foo'); $this->assertCleanCSS( "b, i {\ntext-decoration:underline;\n}", @@ -131,17 +148,20 @@ class HTMLPurifier_Filter_ExtractStyleBlocksTest extends HTMLPurifier_Harness ); } - function test_cleanCSS_scopeWithNaughtySelector() { + public function test_cleanCSS_scopeWithNaughtySelector() + { $this->config->set('Filter.ExtractStyleBlocks.Scope', '#foo'); $this->assertCleanCSS(" + p {\ntext-indent:1em;\n}", ''); } - function test_cleanCSS_scopeWithMultipleNaughtySelectors() { + public function test_cleanCSS_scopeWithMultipleNaughtySelectors() + { $this->config->set('Filter.ExtractStyleBlocks.Scope', '#foo'); $this->assertCleanCSS(" ++ ++ p {\ntext-indent:1em;\n}", ''); } - function test_cleanCSS_scopeWithCommas() { + public function test_cleanCSS_scopeWithCommas() + { $this->config->set('Filter.ExtractStyleBlocks.Scope', '#foo, .bar'); $this->assertCleanCSS( "p {\ntext-indent:1em;\n}", @@ -149,7 +169,8 @@ class HTMLPurifier_Filter_ExtractStyleBlocksTest extends HTMLPurifier_Harness ); } - function test_cleanCSS_scopeAllWithCommas() { + public function test_cleanCSS_scopeAllWithCommas() + { $this->config->set('Filter.ExtractStyleBlocks.Scope', '#foo, .bar'); $this->assertCleanCSS( "p, div {\ntext-indent:1em;\n}", @@ -157,7 +178,8 @@ class HTMLPurifier_Filter_ExtractStyleBlocksTest extends HTMLPurifier_Harness ); } - function test_cleanCSS_scopeWithConflicts() { + public function test_cleanCSS_scopeWithConflicts() + { $this->config->set('Filter.ExtractStyleBlocks.Scope', 'p'); $this->assertCleanCSS( "div { @@ -178,7 +200,8 @@ text-align:left; ); } - function test_removeComments() { + public function test_removeComments() + { $this->assertCleanCSS( "', array( new HTMLPurifier_Token_Comment(' Comment ') ) ); } - function test_tokenizeHTML_malformedComment() { + public function test_tokenizeHTML_malformedComment() + { $this->assertTokenization( '', array( new HTMLPurifier_Token_Comment(' not so well formed -') ) ); } - function test_tokenizeHTML_unterminatedTag() { + public function test_tokenizeHTML_unterminatedTag() + { $this->assertTokenization( 'assertTokenization( '<b>', array( @@ -313,7 +349,8 @@ class HTMLPurifier_LexerTest extends HTMLPurifier_Harness ); } - function test_tokenizeHTML_earlyQuote() { + public function test_tokenizeHTML_earlyQuote() + { $this->assertTokenization( '', array( new HTMLPurifier_Token_Empty('a') ), @@ -327,7 +364,8 @@ class HTMLPurifier_LexerTest extends HTMLPurifier_Harness ); } - function test_tokenizeHTML_earlyQuote_PH5P() { + public function test_tokenizeHTML_earlyQuote_PH5P() + { if (!class_exists('DOMDocument')) return; $lexer = new HTMLPurifier_Lexer_PH5P(); $result = $lexer->tokenizeHTML('', $this->config, $this->context); @@ -342,21 +380,24 @@ class HTMLPurifier_LexerTest extends HTMLPurifier_Harness } } - function test_tokenizeHTML_unescapedQuote() { + public function test_tokenizeHTML_unescapedQuote() + { $this->assertTokenization( '"', array( new HTMLPurifier_Token_Text('"') ) ); } - function test_tokenizeHTML_escapedQuote() { + public function test_tokenizeHTML_escapedQuote() + { $this->assertTokenization( '"', array( new HTMLPurifier_Token_Text('"') ) ); } - function test_tokenizeHTML_cdata() { + public function test_tokenizeHTML_cdata() + { $this->assertTokenization( 'can't get me!]]>', array( new HTMLPurifier_Token_Text('You can't get me!') ), @@ -378,14 +419,16 @@ class HTMLPurifier_LexerTest extends HTMLPurifier_Harness ); } - function test_tokenizeHTML_characterEntity() { + public function test_tokenizeHTML_characterEntity() + { $this->assertTokenization( 'θ', array( new HTMLPurifier_Token_Text("\xCE\xB8") ) ); } - function test_tokenizeHTML_characterEntityInCDATA() { + public function test_tokenizeHTML_characterEntityInCDATA() + { $this->assertTokenization( '', array( new HTMLPurifier_Token_Text("→") ), @@ -398,7 +441,8 @@ class HTMLPurifier_LexerTest extends HTMLPurifier_Harness ); } - function test_tokenizeHTML_entityInAttribute() { + public function test_tokenizeHTML_entityInAttribute() + { $this->assertTokenization( 'Link', array( @@ -409,21 +453,24 @@ class HTMLPurifier_LexerTest extends HTMLPurifier_Harness ); } - function test_tokenizeHTML_preserveUTF8() { + public function test_tokenizeHTML_preserveUTF8() + { $this->assertTokenization( "\xCE\xB8", array( new HTMLPurifier_Token_Text("\xCE\xB8") ) ); } - function test_tokenizeHTML_specialEntityInAttribute() { + public function test_tokenizeHTML_specialEntityInAttribute() + { $this->assertTokenization( '
                          ', array( new HTMLPurifier_Token_Empty('br', array('test' => 'x < 6')) ) ); } - function test_tokenizeHTML_emoticonProtection() { + public function test_tokenizeHTML_emoticonProtection() + { $this->assertTokenization( 'Whoa! <3 That\'s not good >.>', array( @@ -451,7 +498,8 @@ class HTMLPurifier_LexerTest extends HTMLPurifier_Harness ); } - function test_tokenizeHTML_commentWithFunkyChars() { + public function test_tokenizeHTML_commentWithFunkyChars() + { $this->assertTokenization( '
                          ', array( @@ -461,7 +509,8 @@ class HTMLPurifier_LexerTest extends HTMLPurifier_Harness ); } - function test_tokenizeHTML_unterminatedComment() { + public function test_tokenizeHTML_unterminatedComment() + { $this->assertTokenization( '', array( new HTMLPurifier_Token_Comment(' This comment < < & ') ) ); } - function test_tokenizeHTML_attributeWithSpecialCharacters() { + public function test_tokenizeHTML_attributeWithSpecialCharacters() + { $this->assertTokenization( '
                          ', array( new HTMLPurifier_Token_Empty('a', array('href' => '><>')) ), @@ -510,14 +562,16 @@ class HTMLPurifier_LexerTest extends HTMLPurifier_Harness ); } - function test_tokenizeHTML_emptyTagWithSlashInAttribute() { + public function test_tokenizeHTML_emptyTagWithSlashInAttribute() + { $this->assertTokenization( '', array( new HTMLPurifier_Token_Empty('param', array('name' => 'src', 'value' => 'http://example.com/video.wmv')) ) ); } - function test_tokenizeHTML_style() { + public function test_tokenizeHTML_style() + { $extra = array( // PH5P doesn't seem to like style tags 'PH5P' => false, @@ -551,7 +605,8 @@ div {} ); } - function test_tokenizeHTML_tagWithAtSignAndExtraGt() { + public function test_tokenizeHTML_tagWithAtSignAndExtraGt() + { $alt_expect = array( // Technically this is invalid, but it won't be a // problem with invalid element removal; also, this @@ -572,7 +627,8 @@ div {} ); } - function test_tokenizeHTML_emoticonHeart() { + public function test_tokenizeHTML_emoticonHeart() + { $this->assertTokenization( '
                          <3
                          ', array( @@ -591,7 +647,8 @@ div {} ); } - function test_tokenizeHTML_emoticonShiftyEyes() { + public function test_tokenizeHTML_emoticonShiftyEyes() + { $this->assertTokenization( '<<', array( @@ -610,7 +667,8 @@ div {} ); } - function test_tokenizeHTML_eon1996() { + public function test_tokenizeHTML_eon1996() + { $this->assertTokenization( '< test', array( @@ -631,7 +689,8 @@ div {} ); } - function test_tokenizeHTML_bodyInCDATA() { + public function test_tokenizeHTML_bodyInCDATA() + { $alt_tokens = array( new HTMLPurifier_Token_Text('<'), new HTMLPurifier_Token_Text('body'), @@ -652,7 +711,8 @@ div {} ); } - function test_tokenizeHTML_() { + public function test_tokenizeHTML_() + { $this->assertTokenization( '
                          ', array( @@ -663,14 +723,16 @@ div {} ); } - function test_tokenizeHTML_ignoreIECondComment() { + public function test_tokenizeHTML_ignoreIECondComment() + { $this->assertTokenization( '', array() ); } - function test_tokenizeHTML_removeProcessingInstruction() { + public function test_tokenizeHTML_removeProcessingInstruction() + { $this->config->set('Core.RemoveProcessingInstructions', true); $this->assertTokenization( '', @@ -678,7 +740,8 @@ div {} ); } - function test_tokenizeHTML_removeNewline() { + public function test_tokenizeHTML_removeNewline() + { $this->config->set('Core.NormalizeNewlines', true); $this->assertTokenization( "plain\rtext\r\n", @@ -688,7 +751,8 @@ div {} ); } - function test_tokenizeHTML_noRemoveNewline() { + public function test_tokenizeHTML_noRemoveNewline() + { $this->config->set('Core.NormalizeNewlines', false); $this->assertTokenization( "plain\rtext\r\n", @@ -698,7 +762,8 @@ div {} ); } - function test_tokenizeHTML_conditionalCommentUngreedy() { + public function test_tokenizeHTML_conditionalCommentUngreedy() + { $this->assertTokenization( 'b', array( @@ -707,7 +772,8 @@ div {} ); } - function test_tokenizeHTML_imgTag() { + public function test_tokenizeHTML_imgTag() + { $start = array( new HTMLPurifier_Token_Start('img', array( @@ -737,7 +803,8 @@ div {} /* - function test_tokenizeHTML_() { + public function test_tokenizeHTML_() + { $this->assertTokenization( , array( diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/.gitignore b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/.gitignore new file mode 100644 index 0000000000..cde8069e12 --- /dev/null +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/.gitignore @@ -0,0 +1 @@ +*.php diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PercentEncoderTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PercentEncoderTest.php index fa969de136..666e6a3d6a 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PercentEncoderTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PercentEncoderTest.php @@ -6,17 +6,20 @@ class HTMLPurifier_PercentEncoderTest extends HTMLPurifier_Harness protected $PercentEncoder; protected $func; - function setUp() { + public function setUp() + { $this->PercentEncoder = new HTMLPurifier_PercentEncoder(); $this->func = ''; } - function assertDecode($string, $expect = true) { + public function assertDecode($string, $expect = true) + { if ($expect === true) $expect = $string; $this->assertIdentical($this->PercentEncoder->{$this->func}($string), $expect); } - function test_normalize() { + public function test_normalize() + { $this->func = 'normalize'; $this->assertDecode('Aw.../-$^8'); // no change @@ -35,26 +38,31 @@ class HTMLPurifier_PercentEncoderTest extends HTMLPurifier_Harness } - function assertEncode($string, $expect = true, $preserve = false) { + public function assertEncode($string, $expect = true, $preserve = false) + { if ($expect === true) $expect = $string; $encoder = new HTMLPurifier_PercentEncoder($preserve); $result = $encoder->encode($string); $this->assertIdentical($result, $expect); } - function test_encode_noChange() { + public function test_encode_noChange() + { $this->assertEncode('abc012-_~.'); } - function test_encode_encode() { + public function test_encode_encode() + { $this->assertEncode('>', '%3E'); } - function test_encode_preserve() { + public function test_encode_preserve() + { $this->assertEncode('<>', '<%3E', '<'); } - function test_encode_low() { + public function test_encode_low() + { $this->assertEncode("\1", '%01'); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PropertyListTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PropertyListTest.php index a2d4811ef2..d0961959e3 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PropertyListTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PropertyListTest.php @@ -3,19 +3,22 @@ class HTMLPurifier_PropertyListTest extends UnitTestCase { - function testBasic() { + public function testBasic() + { $plist = new HTMLPurifier_PropertyList(); $plist->set('key', 'value'); $this->assertIdentical($plist->get('key'), 'value'); } - function testNotFound() { + public function testNotFound() + { $this->expectException(new HTMLPurifier_Exception("Key 'key' not found")); $plist = new HTMLPurifier_PropertyList(); $plist->get('key'); } - function testRecursion() { + public function testRecursion() + { $parent_plist = new HTMLPurifier_PropertyList(); $parent_plist->set('key', 'value'); $plist = new HTMLPurifier_PropertyList(); @@ -23,7 +26,8 @@ class HTMLPurifier_PropertyListTest extends UnitTestCase $this->assertIdentical($plist->get('key'), 'value'); } - function testOverride() { + public function testOverride() + { $parent_plist = new HTMLPurifier_PropertyList(); $parent_plist->set('key', 'value'); $plist = new HTMLPurifier_PropertyList(); @@ -32,7 +36,8 @@ class HTMLPurifier_PropertyListTest extends UnitTestCase $this->assertIdentical($plist->get('key'), 'value2'); } - function testRecursionNotFound() { + public function testRecursionNotFound() + { $this->expectException(new HTMLPurifier_Exception("Key 'key' not found")); $parent_plist = new HTMLPurifier_PropertyList(); $plist = new HTMLPurifier_PropertyList(); @@ -40,14 +45,16 @@ class HTMLPurifier_PropertyListTest extends UnitTestCase $this->assertIdentical($plist->get('key'), 'value'); } - function testHas() { + public function testHas() + { $plist = new HTMLPurifier_PropertyList(); $this->assertIdentical($plist->has('key'), false); $plist->set('key', 'value'); $this->assertIdentical($plist->has('key'), true); } - function testReset() { + public function testReset() + { $plist = new HTMLPurifier_PropertyList(); $plist->set('key1', 'value'); $plist->set('key2', 'value'); @@ -65,7 +72,8 @@ class HTMLPurifier_PropertyListTest extends UnitTestCase $this->assertIdentical($plist->has('key3'), false); } - function testSquash() { + public function testSquash() + { $parent = new HTMLPurifier_PropertyList(); $parent->set('key1', 'hidden'); $parent->set('key2', 2); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/SimpleTest/Reporter.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/SimpleTest/Reporter.php index b9da9ab0bf..85be1b77c0 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/SimpleTest/Reporter.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/SimpleTest/Reporter.php @@ -5,12 +5,14 @@ class HTMLPurifier_SimpleTest_Reporter extends HTMLReporter protected $ac; - public function __construct($encoding, $ac) { + public function __construct($encoding, $ac) + { $this->ac = $ac; parent::__construct($encoding); } - public function paintHeader($test_name) { + public function paintHeader($test_name) + { parent::paintHeader($test_name); ?>
                          @@ -29,7 +31,8 @@ class HTMLPurifier_SimpleTest_Reporter extends HTMLReporter flush(); } - public function paintFooter($test_name) { + public function paintFooter($test_name) + { if (function_exists('xdebug_peak_memory_usage')) { $max_mem = number_format(xdebug_peak_memory_usage()); echo "
                          Max memory usage: $max_mem bytes
                          "; @@ -37,7 +40,8 @@ class HTMLPurifier_SimpleTest_Reporter extends HTMLReporter parent::paintFooter($test_name); } - protected function getCss() { + protected function getCss() + { $css = parent::getCss(); $css .= ' #select {position:absolute;top:0.2em;right:0.2em;} @@ -45,7 +49,8 @@ class HTMLPurifier_SimpleTest_Reporter extends HTMLReporter return $css; } - function getTestList() { + public function getTestList() + { // hacky; depends on a specific implementation of paintPass, etc. $list = parent::getTestList(); $testcase = $list[1]; diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/SimpleTest/TextReporter.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/SimpleTest/TextReporter.php index 56204e7a38..583ed40796 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/SimpleTest/TextReporter.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/SimpleTest/TextReporter.php @@ -1,12 +1,15 @@ verbose = $AC['verbose']; } - function paintPass($message) { + public function paintPass($message) + { parent::paintPass($message); if ($this->verbose) { print 'Pass ' . $this->getPassCount() . ") $message\n"; diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/CompositeTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/CompositeTest.php index 8be422cc97..db460cd62b 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/CompositeTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/CompositeTest.php @@ -4,7 +4,8 @@ class HTMLPurifier_Strategy_Composite_Test extends HTMLPurifier_Strategy_Composite { - public function __construct(&$strategies) { + public function __construct(&$strategies) + { $this->strategies =& $strategies; } @@ -14,8 +15,8 @@ class HTMLPurifier_Strategy_Composite_Test class HTMLPurifier_Strategy_CompositeTest extends HTMLPurifier_Harness { - function test() { - + public function test() + { generate_mock_once('HTMLPurifier_Strategy'); generate_mock_once('HTMLPurifier_Config'); generate_mock_once('HTMLPurifier_Context'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/CoreTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/CoreTest.php index 9bca5f60a0..89a13f49ae 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/CoreTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/CoreTest.php @@ -3,37 +3,43 @@ class HTMLPurifier_Strategy_CoreTest extends HTMLPurifier_StrategyHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_Strategy_Core(); } - function testBlankInput() { + public function testBlankInput() + { $this->assertResult(''); } - function testMakeWellFormed() { + public function testMakeWellFormed() + { $this->assertResult( 'Make well formed.', 'Make well formed.' ); } - function testFixNesting() { + public function testFixNesting() + { $this->assertResult( '
                          Fix nesting.
                          ', '
                          Fix nesting.
                          ' ); } - function testRemoveForeignElements() { + public function testRemoveForeignElements() + { $this->assertResult( 'Foreign element removal.', 'Foreign element removal.' ); } - function testFirstThree() { + public function testFirstThree() + { $this->assertResult( '
                          All three.
                          ', '
                          All three.
                          ' diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/ErrorsHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/ErrorsHarness.php index 0e1bca681c..3efc836f98 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/ErrorsHarness.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/ErrorsHarness.php @@ -6,7 +6,8 @@ class HTMLPurifier_Strategy_ErrorsHarness extends HTMLPurifier_ErrorsHarness // needs to be defined protected function getStrategy() {} - protected function invoke($input) { + protected function invoke($input) + { $strategy = $this->getStrategy(); $lexer = new HTMLPurifier_Lexer_DirectLex(); $tokens = $lexer->tokenizeHTML($input, $this->config, $this->context); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/FixNestingTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/FixNestingTest.php index 965ae2a8b4..ace642d0dc 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/FixNestingTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/FixNestingTest.php @@ -3,96 +3,94 @@ class HTMLPurifier_Strategy_FixNestingTest extends HTMLPurifier_StrategyHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_Strategy_FixNesting(); } - function testPreserveInlineInRoot() { + public function testPreserveInlineInRoot() + { $this->assertResult('Bold text'); } - function testPreserveInlineAndBlockInRoot() { + public function testPreserveInlineAndBlockInRoot() + { $this->assertResult('Blank
                          Block
                          '); } - function testRemoveBlockInInline() { + public function testRemoveBlockInInline() + { $this->assertResult( '
                          Illegal div.
                          ', 'Illegal div.' ); } - function testEscapeBlockInInline() { - $this->config->set('Core.EscapeInvalidChildren', true); - $this->assertResult( - '
                          Illegal div.
                          ', - '<div>Illegal div.</div>' - ); - } - - function testRemoveNodeWithMissingRequiredElements() { + public function testRemoveNodeWithMissingRequiredElements() + { $this->assertResult('
                            ', ''); } - function testListHandleIllegalPCDATA() { + public function testListHandleIllegalPCDATA() + { $this->assertResult( '
                              Illegal text
                            • Legal item
                            ', '
                            • Illegal text
                            • Legal item
                            ' ); } - function testRemoveIllegalPCDATA() { + public function testRemoveIllegalPCDATA() + { $this->assertResult( 'Illegal text
                            ', '
                            ' ); } - function testCustomTableDefinition() { + public function testCustomTableDefinition() + { $this->assertResult('
                            Cell 1
                            '); } - function testRemoveEmptyTable() { + public function testRemoveEmptyTable() + { $this->assertResult('
                            ', ''); } - function testChameleonRemoveBlockInNodeInInline() { + public function testChameleonRemoveBlockInNodeInInline() + { $this->assertResult( '
                            Not allowed!
                            ', 'Not allowed!' ); } - function testChameleonRemoveBlockInBlockNodeWithInlineContent() { + public function testChameleonRemoveBlockInBlockNodeWithInlineContent() + { $this->assertResult( '

                            Not allowed!

                            ', '

                            Not allowed!

                            ' ); } - function testNestedChameleonRemoveBlockInNodeWithInlineContent() { + public function testNestedChameleonRemoveBlockInNodeWithInlineContent() + { $this->assertResult( '

                            Not allowed!

                            ', '

                            Not allowed!

                            ' ); } - function testNestedChameleonPreserveBlockInBlock() { + public function testNestedChameleonPreserveBlockInBlock() + { $this->assertResult( '
                            Allowed!
                            ' ); } - function testChameleonEscapeInvalidBlockInInline() { - $this->config->set('Core.EscapeInvalidChildren', true); - $this->assertResult( // alt config - '
                            Not allowed!
                            ', - '<div>Not allowed!</div>' - ); - } - - function testExclusionsIntegration() { + public function testExclusionsIntegration() + { // test exclusions $this->assertResult( 'Not allowed', @@ -100,17 +98,20 @@ class HTMLPurifier_Strategy_FixNestingTest extends HTMLPurifier_StrategyHarness ); } - function testPreserveInlineNodeInInlineRootNode() { + public function testPreserveInlineNodeInInlineRootNode() + { $this->config->set('HTML.Parent', 'span'); $this->assertResult('Bold'); } - function testRemoveBlockNodeInInlineRootNode() { + public function testRemoveBlockNodeInInlineRootNode() + { $this->config->set('HTML.Parent', 'span'); $this->assertResult('
                            Reject
                            ', 'Reject'); } - function testInvalidParentError() { + public function testInvalidParentError() + { // test fallback to div $this->config->set('HTML.Parent', 'obviously-impossible'); $this->config->set('Cache.DefinitionImpl', null); @@ -118,28 +119,34 @@ class HTMLPurifier_Strategy_FixNestingTest extends HTMLPurifier_StrategyHarness $this->assertResult('
                            Accept
                            '); } - function testCascadingRemovalOfNodesMissingRequiredChildren() { + public function testCascadingRemovalOfNodesMissingRequiredChildren() + { $this->assertResult('
                            ', ''); } - function testCascadingRemovalSpecialCaseCannotScrollOneBack() { + public function testCascadingRemovalSpecialCaseCannotScrollOneBack() + { $this->assertResult('
                            ', ''); } - function testLotsOfCascadingRemovalOfNodes() { + public function testLotsOfCascadingRemovalOfNodes() + { $this->assertResult('
                            ', ''); } - function testAdjacentRemovalOfNodeMissingRequiredChildren() { + public function testAdjacentRemovalOfNodeMissingRequiredChildren() + { $this->assertResult('
                            ', ''); } - function testStrictBlockquoteInHTML401() { + public function testStrictBlockquoteInHTML401() + { $this->config->set('HTML.Doctype', 'HTML 4.01 Strict'); $this->assertResult('
                            text
                            ', '

                            text

                            '); } - function testDisabledExcludes() { + public function testDisabledExcludes() + { $this->config->set('Core.DisableExcludes', true); $this->assertResult('
                            '); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/FixNesting_ErrorsTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/FixNesting_ErrorsTest.php index 468480774d..9c0db31d5c 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/FixNesting_ErrorsTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/FixNesting_ErrorsTest.php @@ -3,34 +3,40 @@ class HTMLPurifier_Strategy_FixNesting_ErrorsTest extends HTMLPurifier_Strategy_ErrorsHarness { - protected function getStrategy() { + protected function getStrategy() + { return new HTMLPurifier_Strategy_FixNesting(); } - function testNodeRemoved() { + public function testNodeRemoved() + { $this->expectErrorCollection(E_ERROR, 'Strategy_FixNesting: Node removed'); $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('ul', array(), 1)); $this->invoke('
                              '); } - function testNodeExcluded() { + public function testNodeExcluded() + { $this->expectErrorCollection(E_ERROR, 'Strategy_FixNesting: Node excluded'); $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('a', array(), 2)); $this->invoke("\n"); } - function testNodeReorganized() { + public function testNodeReorganized() + { $this->expectErrorCollection(E_WARNING, 'Strategy_FixNesting: Node reorganized'); $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('span', array(), 1)); $this->invoke("Valid
                              Invalid
                              "); } - function testNoNodeReorganizedForEmptyNode() { + public function testNoNodeReorganizedForEmptyNode() + { $this->expectNoErrorCollection(); $this->invoke(""); } - function testNodeContentsRemoved() { + public function testNodeContentsRemoved() + { $this->expectErrorCollection(E_ERROR, 'Strategy_FixNesting: Node contents removed'); $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('span', array(), 1)); $this->invoke("
                              "); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndInsertInjector.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndInsertInjector.php index d1724bcb37..9e213bad22 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndInsertInjector.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndInsertInjector.php @@ -4,7 +4,8 @@ class HTMLPurifier_Strategy_MakeWellFormed_EndInsertInjector extends HTMLPurifie { public $name = 'EndInsertInjector'; public $needed = array('span'); - public function handleEnd(&$token) { + public function handleEnd(&$token) + { if ($token->name == 'div') return; $token = array( new HTMLPurifier_Token_Start('b'), diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndInsertInjectorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndInsertInjectorTest.php index 72e833b712..ef0ca0455f 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndInsertInjectorTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndInsertInjectorTest.php @@ -2,35 +2,44 @@ class HTMLPurifier_Strategy_MakeWellFormed_EndInsertInjectorTest extends HTMLPurifier_StrategyHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_Strategy_MakeWellFormed(); $this->config->set('AutoFormat.Custom', array( new HTMLPurifier_Strategy_MakeWellFormed_EndInsertInjector() )); } - function testEmpty() { + public function testEmpty() + { $this->assertResult(''); } - function testNormal() { + public function testNormal() + { $this->assertResult('Foo', 'FooComment'); } - function testEndOfDocumentProcessing() { + public function testEndOfDocumentProcessing() + { $this->assertResult('Foo', 'FooComment'); } - function testDoubleEndOfDocumentProcessing() { + public function testDoubleEndOfDocumentProcessing() + { $this->assertResult('Foo', 'FooCommentComment'); } - function testEndOfNodeProcessing() { + public function testEndOfNodeProcessing() + { $this->assertResult('
                              Foo
                              asdf', '
                              FooComment
                              asdfComment'); } - function testEmptyToStartEndProcessing() { + public function testEmptyToStartEndProcessing() + { $this->assertResult('', 'Comment'); } - function testSpuriousEndTag() { + public function testSpuriousEndTag() + { $this->assertResult('', ''); } - function testLessButStillSpuriousEndTag() { + public function testLessButStillSpuriousEndTag() + { $this->assertResult('
                              ', '
                              '); } } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndRewindInjector.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndRewindInjector.php index 21c491436f..0e5a8e2002 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndRewindInjector.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndRewindInjector.php @@ -4,15 +4,18 @@ class HTMLPurifier_Strategy_MakeWellFormed_EndRewindInjector extends HTMLPurifie { public $name = 'EndRewindInjector'; public $needed = array('span'); - public function handleElement(&$token) { + public function handleElement(&$token) + { if (isset($token->_InjectorTest_EndRewindInjector_delete)) { $token = false; } } - public function handleText(&$token) { + public function handleText(&$token) + { $token = false; } - public function handleEnd(&$token) { + public function handleEnd(&$token) + { $i = null; if ( $this->backward($i, $prev) && @@ -21,7 +24,7 @@ class HTMLPurifier_Strategy_MakeWellFormed_EndRewindInjector extends HTMLPurifie ) { $token = false; $prev->_InjectorTest_EndRewindInjector_delete = true; - $this->rewind($i); + $this->rewindOffset(1); } } } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndRewindInjectorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndRewindInjectorTest.php index 96c88748d2..7fe7790faf 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndRewindInjectorTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndRewindInjectorTest.php @@ -2,26 +2,32 @@ class HTMLPurifier_Strategy_MakeWellFormed_EndRewindInjectorTest extends HTMLPurifier_StrategyHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_Strategy_MakeWellFormed(); $this->config->set('AutoFormat.Custom', array( new HTMLPurifier_Strategy_MakeWellFormed_EndRewindInjector() )); } - function testBasic() { + public function testBasic() + { $this->assertResult(''); } - function testFunction() { + public function testFunction() + { $this->assertResult('asdf',''); } - function testFailedFunction() { + public function testFailedFunction() + { $this->assertResult('asdasdfasdf',''); } - function testPadded() { + public function testPadded() + { $this->assertResult('asdf',''); } - function testDoubled() { + public function testDoubled() + { $this->config->set('AutoFormat.Custom', array( new HTMLPurifier_Strategy_MakeWellFormed_EndRewindInjector(), new HTMLPurifier_Strategy_MakeWellFormed_EndRewindInjector(), diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/SkipInjector.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/SkipInjector.php index 258346b8d2..65e068ec02 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/SkipInjector.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/SkipInjector.php @@ -4,7 +4,8 @@ class HTMLPurifier_Strategy_MakeWellFormed_SkipInjector extends HTMLPurifier_Inj { public $name = 'EndRewindInjector'; public $needed = array('span'); - public function handleElement(&$token) { + public function handleElement(&$token) + { $token = array(clone $token, clone $token); } } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/SkipInjectorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/SkipInjectorTest.php index 770b3d84e2..1407a26347 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/SkipInjectorTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/SkipInjectorTest.php @@ -2,20 +2,24 @@ class HTMLPurifier_Strategy_MakeWellFormed_SkipInjectorTest extends HTMLPurifier_StrategyHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_Strategy_MakeWellFormed(); $this->config->set('AutoFormat.Custom', array( new HTMLPurifier_Strategy_MakeWellFormed_SkipInjector() )); } - function testEmpty() { + public function testEmpty() + { $this->assertResult(''); } - function testMultiply() { + public function testMultiply() + { $this->assertResult('
                              ', '

                              '); } - function testMultiplyMultiply() { + public function testMultiplyMultiply() + { $this->config->set('AutoFormat.Custom', array( new HTMLPurifier_Strategy_MakeWellFormed_SkipInjector(), new HTMLPurifier_Strategy_MakeWellFormed_SkipInjector() diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormedTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormedTest.php index c6d775c5a0..20b65d3efc 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormedTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormedTest.php @@ -3,97 +3,112 @@ class HTMLPurifier_Strategy_MakeWellFormedTest extends HTMLPurifier_StrategyHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_Strategy_MakeWellFormed(); } - function testEmptyInput() { + public function testEmptyInput() + { $this->assertResult(''); } - function testWellFormedInput() { + public function testWellFormedInput() + { $this->assertResult('This is bold text.'); } - function testUnclosedTagTerminatedByDocumentEnd() { + public function testUnclosedTagTerminatedByDocumentEnd() + { $this->assertResult( 'Unclosed tag, gasp!', 'Unclosed tag, gasp!' ); } - function testUnclosedTagTerminatedByParentNodeEnd() { + public function testUnclosedTagTerminatedByParentNodeEnd() + { $this->assertResult( 'Bold and italic?', 'Bold and italic?' ); } - function testRemoveStrayClosingTag() { + public function testRemoveStrayClosingTag() + { $this->assertResult( 'Unused end tags... recycle!', 'Unused end tags... recycle!' ); } - function testConvertStartToEmpty() { + public function testConvertStartToEmpty() + { $this->assertResult( '
                              ', '
                              ' ); } - function testConvertEmptyToStart() { + public function testConvertEmptyToStart() + { $this->assertResult( '
                              ', '
                              ' ); } - function testAutoCloseParagraph() { + public function testAutoCloseParagraph() + { $this->assertResult( '

                              Paragraph 1

                              Paragraph 2', '

                              Paragraph 1

                              Paragraph 2

                              ' ); } - function testAutoCloseParagraphInsideDiv() { + public function testAutoCloseParagraphInsideDiv() + { $this->assertResult( '

                              Paragraphs

                              In

                              A

                              Div

                              ', '

                              Paragraphs

                              In

                              A

                              Div

                              ' ); } - function testAutoCloseListItem() { + public function testAutoCloseListItem() + { $this->assertResult( '
                              1. Item 1
                              2. Item 2
                              ', '
                              1. Item 1
                              2. Item 2
                              ' ); } - function testAutoCloseColgroup() { + public function testAutoCloseColgroup() + { $this->assertResult( '
                              ', '
                              ' ); } - function testAutoCloseMultiple() { + public function testAutoCloseMultiple() + { $this->assertResult( '
                              asdf', '
                              asdf' ); } - function testUnrecognized() { + public function testUnrecognized() + { $this->assertResult( 'foo', 'foo' ); } - function testBlockquoteWithInline() { + public function testBlockquoteWithInline() + { $this->config->set('HTML.Doctype', 'XHTML 1.0 Strict'); $this->assertResult( // This is actually invalid, but will be fixed by @@ -102,42 +117,48 @@ class HTMLPurifier_Strategy_MakeWellFormedTest extends HTMLPurifier_StrategyHarn ); } - function testLongCarryOver() { + public function testLongCarryOver() + { $this->assertResult( 'asdf
                              asdfdf
                              asdf
                              ', 'asdf
                              asdfdf
                              asdf' ); } - function testInterleaved() { + public function testInterleaved() + { $this->assertResult( 'foobarbaz', 'foobarbaz' ); } - function testNestedOl() { + public function testNestedOl() + { $this->assertResult( '
                                1. foo
                              ', '
                                1. foo
                              ' ); } - function testNestedUl() { + public function testNestedUl() + { $this->assertResult( '
                                • foo
                              ', '
                                • foo
                              ' ); } - function testNestedOlWithStrangeEnding() { + public function testNestedOlWithStrangeEnding() + { $this->assertResult( '
                                  1. foo
                                1. foo
                                ', '
                                    1. foo
                                1. foo
                                ' ); } - function testNoAutocloseIfNoParentsCanAccomodateTag() { + public function testNoAutocloseIfNoParentsCanAccomodateTag() + { $this->assertResult( '
                              1. foo
                              2. ', '
                                foo
                                ' diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed_ErrorsTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed_ErrorsTest.php index e825e2e2aa..1265db7aa0 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed_ErrorsTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed_ErrorsTest.php @@ -3,56 +3,65 @@ class HTMLPurifier_Strategy_MakeWellFormed_ErrorsTest extends HTMLPurifier_Strategy_ErrorsHarness { - protected function getStrategy() { + protected function getStrategy() + { return new HTMLPurifier_Strategy_MakeWellFormed(); } - function testUnnecessaryEndTagRemoved() { + public function testUnnecessaryEndTagRemoved() + { $this->expectErrorCollection(E_WARNING, 'Strategy_MakeWellFormed: Unnecessary end tag removed'); $this->expectContext('CurrentToken', new HTMLPurifier_Token_End('b', array(), 1, 0)); $this->invoke('
                                '); } - function testUnnecessaryEndTagToText() { + public function testUnnecessaryEndTagToText() + { $this->config->set('Core.EscapeInvalidTags', true); $this->expectErrorCollection(E_WARNING, 'Strategy_MakeWellFormed: Unnecessary end tag to text'); $this->expectContext('CurrentToken', new HTMLPurifier_Token_End('b', array(), 1, 0)); $this->invoke('
                                '); } - function testTagAutoclose() { + public function testTagAutoclose() + { $this->expectErrorCollection(E_NOTICE, 'Strategy_MakeWellFormed: Tag auto closed', new HTMLPurifier_Token_Start('p', array(), 1, 0)); $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('div', array(), 1, 6)); $this->invoke('

                                Foo

                                Bar
                                '); } - function testTagCarryOver() { + public function testTagCarryOver() + { $b = new HTMLPurifier_Token_Start('b', array(), 1, 0); $this->expectErrorCollection(E_NOTICE, 'Strategy_MakeWellFormed: Tag carryover', $b); $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('div', array(), 1, 6)); $this->invoke('Foo
                                Bar
                                '); } - function testStrayEndTagRemoved() { + public function testStrayEndTagRemoved() + { $this->expectErrorCollection(E_WARNING, 'Strategy_MakeWellFormed: Stray end tag removed'); $this->expectContext('CurrentToken', new HTMLPurifier_Token_End('b', array(), 1, 3)); $this->invoke('
                                '); } - function testStrayEndTagToText() { + public function testStrayEndTagToText() + { $this->config->set('Core.EscapeInvalidTags', true); $this->expectErrorCollection(E_WARNING, 'Strategy_MakeWellFormed: Stray end tag to text'); $this->expectContext('CurrentToken', new HTMLPurifier_Token_End('b', array(), 1, 3)); $this->invoke(''); } - function testTagClosedByElementEnd() { + public function testTagClosedByElementEnd() + { $this->expectErrorCollection(E_NOTICE, 'Strategy_MakeWellFormed: Tag closed by element end', new HTMLPurifier_Token_Start('b', array(), 1, 3)); $this->expectContext('CurrentToken', new HTMLPurifier_Token_End('i', array(), 1, 12)); $this->invoke('Foobar'); } - function testTagClosedByDocumentEnd() { + public function testTagClosedByDocumentEnd() + { $this->expectErrorCollection(E_NOTICE, 'Strategy_MakeWellFormed: Tag closed by document end', new HTMLPurifier_Token_Start('b', array(), 1, 0)); $this->invoke('Foobar'); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed_InjectorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed_InjectorTest.php index f0e01340ae..da9af1ab8d 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed_InjectorTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed_InjectorTest.php @@ -3,7 +3,8 @@ class HTMLPurifier_Strategy_MakeWellFormed_InjectorTest extends HTMLPurifier_StrategyHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_Strategy_MakeWellFormed(); $this->config->set('AutoFormat.AutoParagraph', true); @@ -12,7 +13,8 @@ class HTMLPurifier_Strategy_MakeWellFormed_InjectorTest extends HTMLPurifier_Str generate_mock_once('HTMLPurifier_Injector'); } - function testEndHandler() { + public function testEndHandler() + { $mock = new HTMLPurifier_InjectorMock(); $b = new HTMLPurifier_Token_End('b'); $b->skip = array(0 => true); @@ -25,55 +27,62 @@ class HTMLPurifier_Strategy_MakeWellFormed_InjectorTest extends HTMLPurifier_Str $i->start->skip = array(0 => true, 1 => true); $mock->expectAt(1, 'handleEnd', array($i)); $mock->expectCallCount('handleEnd', 2); - $mock->setReturnValue('getRewind', false); + $mock->setReturnValue('getRewindOffset', false); $this->config->set('AutoFormat.AutoParagraph', false); $this->config->set('AutoFormat.Linkify', false); $this->config->set('AutoFormat.Custom', array($mock)); $this->assertResult('asdf', 'asdf'); } - function testErrorRequiredElementNotAllowed() { + public function testErrorRequiredElementNotAllowed() + { $this->config->set('HTML.Allowed', ''); $this->expectError('Cannot enable AutoParagraph injector because p is not allowed'); $this->expectError('Cannot enable Linkify injector because a is not allowed'); $this->assertResult('Foobar'); } - function testErrorRequiredAttributeNotAllowed() { + public function testErrorRequiredAttributeNotAllowed() + { $this->config->set('HTML.Allowed', 'a,p'); $this->expectError('Cannot enable Linkify injector because a.href is not allowed'); $this->assertResult('

                                http://example.com

                                '); } - function testOnlyAutoParagraph() { + public function testOnlyAutoParagraph() + { $this->assertResult( 'Foobar', '

                                Foobar

                                ' ); } - function testParagraphWrappingOnlyLink() { + public function testParagraphWrappingOnlyLink() + { $this->assertResult( 'http://example.com', '

                                http://example.com

                                ' ); } - function testParagraphWrappingNodeContainingLink() { + public function testParagraphWrappingNodeContainingLink() + { $this->assertResult( 'http://example.com', '

                                http://example.com

                                ' ); } - function testParagraphWrappingPoorlyFormedNodeContainingLink() { + public function testParagraphWrappingPoorlyFormedNodeContainingLink() + { $this->assertResult( 'http://example.com', '

                                http://example.com

                                ' ); } - function testTwoParagraphsContainingOnlyOneLink() { + public function testTwoParagraphsContainingOnlyOneLink() + { $this->assertResult( "http://example.com\n\nhttp://dev.example.com", '

                                http://example.com

                                @@ -82,7 +91,8 @@ class HTMLPurifier_Strategy_MakeWellFormed_InjectorTest extends HTMLPurifier_Str ); } - function testParagraphNextToDivWithLinks() { + public function testParagraphNextToDivWithLinks() + { $this->assertResult( 'http://example.com
                                http://example.com
                                ', '

                                http://example.com

                                @@ -91,14 +101,16 @@ class HTMLPurifier_Strategy_MakeWellFormed_InjectorTest extends HTMLPurifier_Str ); } - function testRealisticLinkInSentence() { + public function testRealisticLinkInSentence() + { $this->assertResult( 'This URL http://example.com is what you need', '

                                This URL http://example.com is what you need

                                ' ); } - function testParagraphAfterLinkifiedURL() { + public function testParagraphAfterLinkifiedURL() + { $this->assertResult( "http://google.com @@ -109,7 +121,8 @@ class HTMLPurifier_Strategy_MakeWellFormed_InjectorTest extends HTMLPurifier_Str ); } - function testEmptyAndParagraph() { + public function testEmptyAndParagraph() + { // This is a fairly degenerate case, but it demonstrates that // the two don't error out together, at least. // Change this behavior! @@ -127,7 +140,8 @@ asdf

                                ); } - function testRewindAndParagraph() { + public function testRewindAndParagraph() + { $this->assertResult( "bar diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/RemoveForeignElementsTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/RemoveForeignElementsTest.php index b3ca1646ab..aea87062eb 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/RemoveForeignElementsTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/RemoveForeignElementsTest.php @@ -3,41 +3,48 @@ class HTMLPurifier_Strategy_RemoveForeignElementsTest extends HTMLPurifier_StrategyHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_Strategy_RemoveForeignElements(); } - function testBlankInput() { + public function testBlankInput() + { $this->assertResult(''); } - function testPreserveRecognizedElements() { + public function testPreserveRecognizedElements() + { $this->assertResult('This is bold text.'); } - function testRemoveForeignElements() { + public function testRemoveForeignElements() + { $this->assertResult( 'BlingBong', 'BlingBong' ); } - function testRemoveScriptAndContents() { + public function testRemoveScriptAndContents() + { $this->assertResult( '', '' ); } - function testRemoveStyleAndContents() { + public function testRemoveStyleAndContents() + { $this->assertResult( '', '' ); } - function testRemoveOnlyScriptTagsLegacy() { + public function testRemoveOnlyScriptTagsLegacy() + { $this->config->set('Core.RemoveScriptContents', false); $this->assertResult( '', @@ -45,7 +52,8 @@ class HTMLPurifier_Strategy_RemoveForeignElementsTest extends HTMLPurifier_Strat ); } - function testRemoveOnlyScriptTags() { + public function testRemoveOnlyScriptTags() + { $this->config->set('Core.HiddenElements', array()); $this->assertResult( '', @@ -53,20 +61,24 @@ class HTMLPurifier_Strategy_RemoveForeignElementsTest extends HTMLPurifier_Strat ); } - function testRemoveInvalidImg() { + public function testRemoveInvalidImg() + { $this->assertResult('', ''); } - function testPreserveValidImg() { + public function testPreserveValidImg() + { $this->assertResult('foobar.gif'); } - function testPreserveInvalidImgWhenRemovalIsDisabled() { + public function testPreserveInvalidImgWhenRemovalIsDisabled() + { $this->config->set('Core.RemoveInvalidImg', false); $this->assertResult(''); } - function testTextifyCommentedScriptContents() { + public function testTextifyCommentedScriptContents() + { $this->config->set('HTML.Trusted', true); $this->config->set('Output.CommentScriptContents', false); // simplify output $this->assertResult( @@ -79,33 +91,39 @@ alert(<b>bold</b>); ); } - function testRequiredAttributesTestNotPerformedOnEndTag() { + public function testRequiredAttributesTestNotPerformedOnEndTag() + { $def = $this->config->getHTMLDefinition(true); $def->addElement('f', 'Block', 'Optional: #PCDATA', false, array('req*' => 'Text')); $this->assertResult('Foo Bar'); } - function testPreserveCommentsWithHTMLTrusted() { + public function testPreserveCommentsWithHTMLTrusted() + { $this->config->set('HTML.Trusted', true); $this->assertResult(''); } - function testRemoveTrailingHyphensInComment() { + public function testRemoveTrailingHyphensInComment() + { $this->config->set('HTML.Trusted', true); $this->assertResult('', ''); } - function testCollapseDoubleHyphensInComment() { + public function testCollapseDoubleHyphensInComment() + { $this->config->set('HTML.Trusted', true); $this->assertResult('', ''); } - function testPreserveCommentsWithLookup() { + public function testPreserveCommentsWithLookup() + { $this->config->set('HTML.AllowedComments', array('allowed')); $this->assertResult('', ''); } - function testPreserveCommentsWithRegexp() { + public function testPreserveCommentsWithRegexp() + { $this->config->set('HTML.AllowedCommentsRegexp', '/^allowed[1-9]$/'); $this->assertResult('', ''); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/RemoveForeignElements_ErrorsTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/RemoveForeignElements_ErrorsTest.php index 4b4e31074b..fcc7c7c88e 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/RemoveForeignElements_ErrorsTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/RemoveForeignElements_ErrorsTest.php @@ -3,63 +3,73 @@ class HTMLPurifier_Strategy_RemoveForeignElements_ErrorsTest extends HTMLPurifier_Strategy_ErrorsHarness { - public function setup() { + public function setup() + { parent::setup(); $this->config->set('HTML.TidyLevel', 'heavy'); } - protected function getStrategy() { + protected function getStrategy() + { return new HTMLPurifier_Strategy_RemoveForeignElements(); } - function testTagTransform() { + public function testTagTransform() + { $this->expectErrorCollection(E_NOTICE, 'Strategy_RemoveForeignElements: Tag transform', 'center'); $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('div', array('style' => 'text-align:center;'), 1)); $this->invoke('
                                '); } - function testMissingRequiredAttr() { + public function testMissingRequiredAttr() + { // a little fragile, since img has two required attributes $this->expectErrorCollection(E_ERROR, 'Strategy_RemoveForeignElements: Missing required attribute', 'alt'); $this->expectContext('CurrentToken', new HTMLPurifier_Token_Empty('img', array(), 1)); $this->invoke(''); } - function testForeignElementToText() { + public function testForeignElementToText() + { $this->config->set('Core.EscapeInvalidTags', true); $this->expectErrorCollection(E_WARNING, 'Strategy_RemoveForeignElements: Foreign element to text'); $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('invalid', array(), 1)); $this->invoke(''); } - function testForeignElementRemoved() { + public function testForeignElementRemoved() + { // uses $CurrentToken.Serialized $this->expectErrorCollection(E_ERROR, 'Strategy_RemoveForeignElements: Foreign element removed'); $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('invalid', array(), 1)); $this->invoke(''); } - function testCommentRemoved() { + public function testCommentRemoved() + { $this->expectErrorCollection(E_NOTICE, 'Strategy_RemoveForeignElements: Comment removed'); $this->expectContext('CurrentToken', new HTMLPurifier_Token_Comment(' test ', 1)); $this->invoke(''); } - function testTrailingHyphenInCommentRemoved() { + public function testTrailingHyphenInCommentRemoved() + { $this->config->set('HTML.Trusted', true); $this->expectErrorCollection(E_NOTICE, 'Strategy_RemoveForeignElements: Trailing hyphen in comment removed'); $this->expectContext('CurrentToken', new HTMLPurifier_Token_Comment(' test ', 1)); $this->invoke(''); } - function testDoubleHyphenInCommentRemoved() { + public function testDoubleHyphenInCommentRemoved() + { $this->config->set('HTML.Trusted', true); $this->expectErrorCollection(E_NOTICE, 'Strategy_RemoveForeignElements: Hyphens in comment collapsed'); $this->expectContext('CurrentToken', new HTMLPurifier_Token_Comment(' test - test - test ', 1)); $this->invoke(''); } - function testForeignMetaElementRemoved() { + public function testForeignMetaElementRemoved() + { $this->collector->expectAt(0, 'send', array(E_ERROR, 'Strategy_RemoveForeignElements: Foreign meta element removed')); $this->collector->expectContextAt(0, 'CurrentToken', new HTMLPurifier_Token_Start('script', array(), 1)); $this->collector->expectAt(1, 'send', array(E_ERROR, 'Strategy_RemoveForeignElements: Token removed to end', 'script')); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/RemoveForeignElements_TidyTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/RemoveForeignElements_TidyTest.php index 22fc456a72..3f55665d80 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/RemoveForeignElements_TidyTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/RemoveForeignElements_TidyTest.php @@ -4,20 +4,23 @@ class HTMLPurifier_Strategy_RemoveForeignElements_TidyTest extends HTMLPurifier_StrategyHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_Strategy_RemoveForeignElements(); $this->config->set('HTML.TidyLevel', 'heavy'); } - function testCenterTransform() { + public function testCenterTransform() + { $this->assertResult( '
                                Look I am Centered!
                                ', '
                                Look I am Centered!
                                ' ); } - function testFontTransform() { + public function testFontTransform() + { $this->assertResult( 'Big Warning!', 'Big'. @@ -25,7 +28,8 @@ class HTMLPurifier_Strategy_RemoveForeignElements_TidyTest ); } - function testTransformToForbiddenElement() { + public function testTransformToForbiddenElement() + { $this->config->set('HTML.Allowed', 'div'); $this->assertResult( 'Big Warning!', @@ -33,7 +37,8 @@ class HTMLPurifier_Strategy_RemoveForeignElements_TidyTest ); } - function testMenuTransform() { + public function testMenuTransform() + { $this->assertResult( '
                              3. Item 1
                              4. ', '
                                • Item 1
                                ' diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/ValidateAttributesTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/ValidateAttributesTest.php index 5fc86cbdab..2bf717937c 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/ValidateAttributesTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/ValidateAttributesTest.php @@ -4,34 +4,40 @@ class HTMLPurifier_Strategy_ValidateAttributesTest extends HTMLPurifier_StrategyHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_Strategy_ValidateAttributes(); } - function testEmptyInput() { + public function testEmptyInput() + { $this->assertResult(''); } - function testRemoveIDByDefault() { + public function testRemoveIDByDefault() + { $this->assertResult( '
                                Kill the ID.
                                ', '
                                Kill the ID.
                                ' ); } - function testRemoveInvalidDir() { + public function testRemoveInvalidDir() + { $this->assertResult( 'Bad dir.', 'Bad dir.' ); } - function testPreserveValidClass() { + public function testPreserveValidClass() + { $this->assertResult('
                                Valid
                                '); } - function testSelectivelyRemoveInvalidClasses() { + public function testSelectivelyRemoveInvalidClasses() + { $this->config->set('HTML.Doctype', 'XHTML 1.1'); $this->assertResult( '
                                Keep valid.
                                ', @@ -39,20 +45,23 @@ class HTMLPurifier_Strategy_ValidateAttributesTest extends ); } - function testPreserveTitle() { + public function testPreserveTitle() + { $this->assertResult( 'PHP' ); } - function testAddXMLLang() { + public function testAddXMLLang() + { $this->assertResult( 'La soupe.', 'La soupe.' ); } - function testOnlyXMLLangInXHTML11() { + public function testOnlyXMLLangInXHTML11() + { $this->config->set('HTML.Doctype', 'XHTML 1.1'); $this->assertResult( 'asdf', @@ -60,32 +69,37 @@ class HTMLPurifier_Strategy_ValidateAttributesTest extends ); } - function testBasicURI() { + public function testBasicURI() + { $this->assertResult('Google'); } - function testInvalidURI() { + public function testInvalidURI() + { $this->assertResult( 'Google', 'Google' ); } - function testBdoAddMissingDir() { + public function testBdoAddMissingDir() + { $this->assertResult( 'Go left.', 'Go left.' ); } - function testBdoReplaceInvalidDirWithDefault() { + public function testBdoReplaceInvalidDirWithDefault() + { $this->assertResult( 'Invalid value!', 'Invalid value!' ); } - function testBdoAlternateDefaultDir() { + public function testBdoAlternateDefaultDir() + { $this->config->set('Attr.DefaultTextDir', 'rtl'); $this->assertResult( 'Go right.', @@ -93,14 +107,16 @@ class HTMLPurifier_Strategy_ValidateAttributesTest extends ); } - function testRemoveDirWhenNotRequired() { + public function testRemoveDirWhenNotRequired() + { $this->assertResult( 'Invalid value!', 'Invalid value!' ); } - function testTableAttributes() { + public function testTableAttributes() + { $this->assertResult( '@@ -120,14 +136,16 @@ class HTMLPurifier_Strategy_ValidateAttributesTest extends ); } - function testColSpanIsNonZero() { + public function testColSpanIsNonZero() + { $this->assertResult( '', '' ); } - function testImgAddDefaults() { + public function testImgAddDefaults() + { $this->config->set('Core.RemoveInvalidImg', false); $this->assertResult( '', @@ -135,14 +153,16 @@ class HTMLPurifier_Strategy_ValidateAttributesTest extends ); } - function testImgGenerateAlt() { + public function testImgGenerateAlt() + { $this->assertResult( '', 'foobar.jpg' ); } - function testImgAddDefaultSrc() { + public function testImgAddDefaultSrc() + { $this->config->set('Core.RemoveInvalidImg', false); $this->assertResult( 'pretty picture', @@ -150,7 +170,8 @@ class HTMLPurifier_Strategy_ValidateAttributesTest extends ); } - function testImgRemoveNonRetrievableProtocol() { + public function testImgRemoveNonRetrievableProtocol() + { $this->config->set('Core.RemoveInvalidImg', false); $this->assertResult( '', @@ -158,18 +179,21 @@ class HTMLPurifier_Strategy_ValidateAttributesTest extends ); } - function testPreserveRel() { + public function testPreserveRel() + { $this->config->set('Attr.AllowedRel', 'nofollow'); $this->assertResult(''); } - function testPreserveTarget() { + public function testPreserveTarget() + { $this->config->set('Attr.AllowedFrameTargets', '_top'); $this->config->set('HTML.Doctype', 'XHTML 1.0 Transitional'); $this->assertResult(''); } - function testRemoveTargetWhenNotSupported() { + public function testRemoveTargetWhenNotSupported() + { $this->config->set('HTML.Doctype', 'XHTML 1.0 Strict'); $this->config->set('Attr.AllowedFrameTargets', '_top'); $this->assertResult( @@ -178,20 +202,23 @@ class HTMLPurifier_Strategy_ValidateAttributesTest extends ); } - function testKeepAbsoluteCSSWidthAndHeightOnImg() { + public function testKeepAbsoluteCSSWidthAndHeightOnImg() + { $this->assertResult( '' ); } - function testRemoveLargeCSSWidthAndHeightOnImg() { + public function testRemoveLargeCSSWidthAndHeightOnImg() + { $this->assertResult( '', '' ); } - function testRemoveLargeCSSWidthAndHeightOnImgWithUserConf() { + public function testRemoveLargeCSSWidthAndHeightOnImgWithUserConf() + { $this->config->set('CSS.MaxImgLength', '1px'); $this->assertResult( '', @@ -199,28 +226,32 @@ class HTMLPurifier_Strategy_ValidateAttributesTest extends ); } - function testKeepLargeCSSWidthAndHeightOnImgWhenToldTo() { + public function testKeepLargeCSSWidthAndHeightOnImgWhenToldTo() + { $this->config->set('CSS.MaxImgLength', null); $this->assertResult( '' ); } - function testKeepPercentCSSWidthAndHeightOnImgWhenToldTo() { + public function testKeepPercentCSSWidthAndHeightOnImgWhenToldTo() + { $this->config->set('CSS.MaxImgLength', null); $this->assertResult( '' ); } - function testRemoveRelativeCSSWidthAndHeightOnImg() { + public function testRemoveRelativeCSSWidthAndHeightOnImg() + { $this->assertResult( '', '' ); } - function testRemovePercentCSSWidthAndHeightOnImg() { + public function testRemovePercentCSSWidthAndHeightOnImg() + { $this->assertResult( '', '' diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/ValidateAttributes_IDTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/ValidateAttributes_IDTest.php index c8c7507234..a65152ee5d 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/ValidateAttributes_IDTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/ValidateAttributes_IDTest.php @@ -3,46 +3,53 @@ class HTMLPurifier_Strategy_ValidateAttributes_IDTest extends HTMLPurifier_StrategyHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_Strategy_ValidateAttributes(); $this->config->set('Attr.EnableID', true); } - function testPreserveIDWhenEnabled() { + public function testPreserveIDWhenEnabled() + { $this->assertResult('
                                Preserve the ID.
                                '); } - function testRemoveInvalidID() { + public function testRemoveInvalidID() + { $this->assertResult( '
                                Kill the ID.
                                ', '
                                Kill the ID.
                                ' ); } - function testRemoveDuplicateID() { + public function testRemoveDuplicateID() + { $this->assertResult( '
                                Valid
                                Invalid
                                ', '
                                Valid
                                Invalid
                                ' ); } - function testAttributeKeyCaseInsensitivity() { + public function testAttributeKeyCaseInsensitivity() + { $this->assertResult( '
                                Convert ID to lowercase.
                                ', '
                                Convert ID to lowercase.
                                ' ); } - function testTrimWhitespace() { + public function testTrimWhitespace() + { $this->assertResult( '
                                Trim whitespace.
                                ', '
                                Trim whitespace.
                                ' ); } - function testIDBlacklist() { + public function testIDBlacklist() + { $this->config->set('Attr.IDBlacklist', array('invalid')); $this->assertResult( '
                                Invalid
                                ', @@ -50,7 +57,8 @@ class HTMLPurifier_Strategy_ValidateAttributes_IDTest extends HTMLPurifier_Strat ); } - function testNameConvertedToID() { + public function testNameConvertedToID() + { $this->config->set('HTML.TidyLevel', 'heavy'); $this->assertResult( '
                                ', diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/ValidateAttributes_TidyTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/ValidateAttributes_TidyTest.php index d4eeeebfc2..3830a401e0 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/ValidateAttributes_TidyTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/ValidateAttributes_TidyTest.php @@ -3,342 +3,391 @@ class HTMLPurifier_Strategy_ValidateAttributes_TidyTest extends HTMLPurifier_StrategyHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->obj = new HTMLPurifier_Strategy_ValidateAttributes(); $this->config->set('HTML.TidyLevel', 'heavy'); } - function testConvertCenterAlign() { + public function testConvertCenterAlign() + { $this->assertResult( '

                                Centered Headline

                                ', '

                                Centered Headline

                                ' ); } - function testConvertRightAlign() { + public function testConvertRightAlign() + { $this->assertResult( '

                                Right-aligned Headline

                                ', '

                                Right-aligned Headline

                                ' ); } - function testConvertLeftAlign() { + public function testConvertLeftAlign() + { $this->assertResult( '

                                Left-aligned Headline

                                ', '

                                Left-aligned Headline

                                ' ); } - function testConvertJustifyAlign() { + public function testConvertJustifyAlign() + { $this->assertResult( '

                                Justified Paragraph

                                ', '

                                Justified Paragraph

                                ' ); } - function testRemoveInvalidAlign() { + public function testRemoveInvalidAlign() + { $this->assertResult( '

                                Invalid Headline

                                ', '

                                Invalid Headline

                                ' ); } - function testConvertTableLengths() { + public function testConvertTableLengths() + { $this->assertResult( '

                                ', '

                                ' ); } - function testTdConvertNowrap() { + public function testTdConvertNowrap() + { $this->assertResult( '
                                ', '' ); } - function testCaptionConvertAlignLeft() { + public function testCaptionConvertAlignLeft() + { $this->assertResult( '
                                ', '' ); } - function testCaptionConvertAlignRight() { + public function testCaptionConvertAlignRight() + { $this->assertResult( '', '' ); } - function testCaptionConvertAlignTop() { + public function testCaptionConvertAlignTop() + { $this->assertResult( '', '' ); } - function testCaptionConvertAlignBottom() { + public function testCaptionConvertAlignBottom() + { $this->assertResult( '', '' ); } - function testCaptionRemoveInvalidAlign() { + public function testCaptionRemoveInvalidAlign() + { $this->assertResult( '', '' ); } - function testTableConvertAlignLeft() { + public function testTableConvertAlignLeft() + { $this->assertResult( '', '
                                ' ); } - function testTableConvertAlignCenter() { + public function testTableConvertAlignCenter() + { $this->assertResult( '
                                ', '
                                ' ); } - function testTableConvertAlignRight() { + public function testTableConvertAlignRight() + { $this->assertResult( '
                                ', '
                                ' ); } - function testTableRemoveInvalidAlign() { + public function testTableRemoveInvalidAlign() + { $this->assertResult( '
                                ', '
                                ' ); } - function testImgConvertAlignLeft() { + public function testImgConvertAlignLeft() + { $this->assertResult( 'foobar', 'foobar' ); } - function testImgConvertAlignRight() { + public function testImgConvertAlignRight() + { $this->assertResult( 'foobar', 'foobar' ); } - function testImgConvertAlignBottom() { + public function testImgConvertAlignBottom() + { $this->assertResult( 'foobar', 'foobar' ); } - function testImgConvertAlignMiddle() { + public function testImgConvertAlignMiddle() + { $this->assertResult( 'foobar', 'foobar' ); } - function testImgConvertAlignTop() { + public function testImgConvertAlignTop() + { $this->assertResult( 'foobar', 'foobar' ); } - function testImgRemoveInvalidAlign() { + public function testImgRemoveInvalidAlign() + { $this->assertResult( 'foobar', 'foobar' ); } - function testBorderConvertHVSpace() { + public function testBorderConvertHVSpace() + { $this->assertResult( 'foo', 'foo' ); } - function testHrConvertSize() { + public function testHrConvertSize() + { $this->assertResult( '
                                ', '
                                ' ); } - function testHrConvertNoshade() { + public function testHrConvertNoshade() + { $this->assertResult( '
                                ', '
                                ' ); } - function testHrConvertAlignLeft() { + public function testHrConvertAlignLeft() + { $this->assertResult( '
                                ', '
                                ' ); } - function testHrConvertAlignCenter() { + public function testHrConvertAlignCenter() + { $this->assertResult( '
                                ', '
                                ' ); } - function testHrConvertAlignRight() { + public function testHrConvertAlignRight() + { $this->assertResult( '
                                ', '
                                ' ); } - function testHrRemoveInvalidAlign() { + public function testHrRemoveInvalidAlign() + { $this->assertResult( '
                                ', '
                                ' ); } - function testBrConvertClearLeft() { + public function testBrConvertClearLeft() + { $this->assertResult( '
                                ', '
                                ' ); } - function testBrConvertClearRight() { + public function testBrConvertClearRight() + { $this->assertResult( '
                                ', '
                                ' ); } - function testBrConvertClearAll() { + public function testBrConvertClearAll() + { $this->assertResult( '
                                ', '
                                ' ); } - function testBrConvertClearNone() { + public function testBrConvertClearNone() + { $this->assertResult( '
                                ', '
                                ' ); } - function testBrRemoveInvalidClear() { + public function testBrRemoveInvalidClear() + { $this->assertResult( '
                                ', '
                                ' ); } - function testUlConvertTypeDisc() { + public function testUlConvertTypeDisc() + { $this->assertResult( '
                                  ', '
                                    ' ); } - function testUlConvertTypeSquare() { + public function testUlConvertTypeSquare() + { $this->assertResult( '
                                      ', '
                                        ' ); } - function testUlConvertTypeCircle() { + public function testUlConvertTypeCircle() + { $this->assertResult( '
                                          ', '
                                            ' ); } - function testUlConvertTypeCaseInsensitive() { + public function testUlConvertTypeCaseInsensitive() + { $this->assertResult( '
                                              ', '
                                                ' ); } - function testUlRemoveInvalidType() { + public function testUlRemoveInvalidType() + { $this->assertResult( '
                                                  ', '
                                                    ' ); } - function testOlConvertType1() { + public function testOlConvertType1() + { $this->assertResult( '
                                                      ', '
                                                        ' ); } - function testOlConvertTypeLowerI() { + public function testOlConvertTypeLowerI() + { $this->assertResult( '
                                                          ', '
                                                            ' ); } - function testOlConvertTypeUpperI() { + public function testOlConvertTypeUpperI() + { $this->assertResult( '
                                                              ', '
                                                                ' ); } - function testOlConvertTypeLowerA() { + public function testOlConvertTypeLowerA() + { $this->assertResult( '
                                                                  ', '
                                                                    ' ); } - function testOlConvertTypeUpperA() { + public function testOlConvertTypeUpperA() + { $this->assertResult( '
                                                                      ', '
                                                                        ' ); } - function testOlRemoveInvalidType() { + public function testOlRemoveInvalidType() + { $this->assertResult( '
                                                                          ', '
                                                                            ' ); } - function testLiConvertTypeCircle() { + public function testLiConvertTypeCircle() + { $this->assertResult( '
                                                                          1. ', '
                                                                          2. ' ); } - function testLiConvertTypeA() { + public function testLiConvertTypeA() + { $this->assertResult( '
                                                                          3. ', '
                                                                          4. ' ); } - function testLiConvertTypeCaseSensitive() { + public function testLiConvertTypeCaseSensitive() + { $this->assertResult( '
                                                                          5. ', '
                                                                          6. ' diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/StrategyHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/StrategyHarness.php index 15f22f6bd8..794c042339 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/StrategyHarness.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/StrategyHarness.php @@ -3,7 +3,8 @@ class HTMLPurifier_StrategyHarness extends HTMLPurifier_ComplexHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->func = 'execute'; $this->to_tokens = true; diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/StringHashParserTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/StringHashParserTest.php index 6d357f86ca..2ccaec22a4 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/StringHashParserTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/StringHashParserTest.php @@ -11,19 +11,22 @@ class HTMLPurifier_StringHashParserTest extends UnitTestCase */ protected $parser; - public function setup() { + public function setup() + { $this->parser = new HTMLPurifier_StringHashParser(); } /** * Assert that $file gets parsed into the form of $expect */ - protected function assertParse($file, $expect) { + protected function assertParse($file, $expect) + { $result = $this->parser->parseFile(dirname(__FILE__) . '/StringHashParser/' . $file); $this->assertIdentical($result, $expect); } - function testSimple() { + public function testSimple() + { $this->assertParse('Simple.txt', array( 'ID' => 'Namespace.Directive', 'TYPE' => 'string', @@ -34,26 +37,30 @@ class HTMLPurifier_StringHashParserTest extends UnitTestCase )); } - function testOverrideSingle() { + public function testOverrideSingle() + { $this->assertParse('OverrideSingle.txt', array( 'KEY' => 'New', )); } - function testAppendMultiline() { + public function testAppendMultiline() + { $this->assertParse('AppendMultiline.txt', array( 'KEY' => "Line1\nLine2\n", )); } - function testDefault() { + public function testDefault() + { $this->parser->default = 'NEW-ID'; $this->assertParse('Default.txt', array( 'NEW-ID' => 'DefaultValue', )); } - function testError() { + public function testError() + { try { $this->parser->parseFile('NoExist.txt'); } catch (HTMLPurifier_ConfigSchema_Exception $e) { @@ -61,7 +68,8 @@ class HTMLPurifier_StringHashParserTest extends UnitTestCase } } - function testParseMultiple() { + public function testParseMultiple() + { $result = $this->parser->parseMultiFile(dirname(__FILE__) . '/StringHashParser/Multi.txt'); $this->assertIdentical( $result, diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/StringHashTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/StringHashTest.php index 653e5bf709..226d1a4148 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/StringHashTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/StringHashTest.php @@ -3,7 +3,8 @@ class HTMLPurifier_StringHashTest extends UnitTestCase { - function testUsed() { + public function testUsed() + { $hash = new HTMLPurifier_StringHash(array( 'key' => 'value', 'key2' => 'value2' diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/TagTransformTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/TagTransformTest.php index 8669d5b917..e6d2d5b95e 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/TagTransformTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/TagTransformTest.php @@ -86,8 +86,8 @@ class HTMLPurifier_TagTransformTest extends HTMLPurifier_Harness } - function testSimple() { - + public function testSimple() + { $transformer = new HTMLPurifier_TagTransform_Simple('ul'); $this->assertTransformation( @@ -98,8 +98,8 @@ class HTMLPurifier_TagTransformTest extends HTMLPurifier_Harness } - function testSimpleWithCSS() { - + public function testSimpleWithCSS() + { $transformer = new HTMLPurifier_TagTransform_Simple('div', 'text-align:center;'); $this->assertTransformation( @@ -119,7 +119,8 @@ class HTMLPurifier_TagTransformTest extends HTMLPurifier_Harness } - protected function assertSizeToStyle($transformer, $size, $style) { + protected function assertSizeToStyle($transformer, $size, $style) + { $this->assertTransformation( $transformer, 'font', array('size' => $size), @@ -127,8 +128,8 @@ class HTMLPurifier_TagTransformTest extends HTMLPurifier_Harness ); } - function testFont() { - + public function testFont() + { $transformer = new HTMLPurifier_TagTransform_Font(); // test a font-face transformation diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/TokenFactoryTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/TokenFactoryTest.php index 3eb731f834..8454b5a2df 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/TokenFactoryTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/TokenFactoryTest.php @@ -2,8 +2,8 @@ class HTMLPurifier_TokenFactoryTest extends HTMLPurifier_Harness { - public function test() { - + public function test() + { $factory = new HTMLPurifier_TokenFactory(); $regular = new HTMLPurifier_Token_Start('a', array('href' => 'about:blank')); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/TokenTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/TokenTest.php index 099b986038..089ff859d6 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/TokenTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/TokenTest.php @@ -14,8 +14,8 @@ class HTMLPurifier_TokenTest extends HTMLPurifier_Harness $this->assertIdentical($expect_attr, $token->attr); } - function testConstruct() { - + public function testConstruct() + { // standard case $this->assertTokenConstruction('a', array('href' => 'about:blank')); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIDefinitionTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIDefinitionTest.php index 6ab0c2a6b4..4261807d46 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIDefinitionTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIDefinitionTest.php @@ -3,7 +3,8 @@ class HTMLPurifier_URIDefinitionTest extends HTMLPurifier_URIHarness { - protected function createFilterMock($expect = true, $result = true, $post = false, $setup = true) { + protected function createFilterMock($expect = true, $result = true, $post = false, $setup = true) + { static $i = 0; generate_mock_once('HTMLPurifier_URIFilter'); $mock = new HTMLPurifier_URIFilterMock(); @@ -16,7 +17,8 @@ class HTMLPurifier_URIDefinitionTest extends HTMLPurifier_URIHarness return $mock; } - function test_filter() { + public function test_filter() + { $def = new HTMLPurifier_URIDefinition(); $def->addFilter($this->createFilterMock(), $this->config); $def->addFilter($this->createFilterMock(), $this->config); @@ -24,7 +26,8 @@ class HTMLPurifier_URIDefinitionTest extends HTMLPurifier_URIHarness $this->assertTrue($def->filter($uri, $this->config, $this->context)); } - function test_filter_earlyAbortIfFail() { + public function test_filter_earlyAbortIfFail() + { $def = new HTMLPurifier_URIDefinition(); $def->addFilter($this->createFilterMock(true, false), $this->config); $def->addFilter($this->createFilterMock(false), $this->config); // never called @@ -32,7 +35,8 @@ class HTMLPurifier_URIDefinitionTest extends HTMLPurifier_URIHarness $this->assertFalse($def->filter($uri, $this->config, $this->context)); } - function test_setupMemberVariables_collisionPrecedenceIsHostBaseScheme() { + public function test_setupMemberVariables_collisionPrecedenceIsHostBaseScheme() + { $this->config->set('URI.Host', $host = 'example.com'); $this->config->set('URI.Base', $base = 'http://sub.example.com/foo/bar.html'); $this->config->set('URI.DefaultScheme', 'ftp'); @@ -43,14 +47,16 @@ class HTMLPurifier_URIDefinitionTest extends HTMLPurifier_URIHarness $this->assertIdentical($def->defaultScheme, 'http'); // not ftp! } - function test_setupMemberVariables_onlyScheme() { + public function test_setupMemberVariables_onlyScheme() + { $this->config->set('URI.DefaultScheme', 'ftp'); $def = new HTMLPurifier_URIDefinition(); $def->setup($this->config); $this->assertIdentical($def->defaultScheme, 'ftp'); } - function test_setupMemberVariables_onlyBase() { + public function test_setupMemberVariables_onlyBase() + { $this->config->set('URI.Base', 'http://sub.example.com/foo/bar.html'); $def = new HTMLPurifier_URIDefinition(); $def->setup($this->config); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/DisableExternalResourcesTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/DisableExternalResourcesTest.php index 21c70c1454..fc0e6fcfeb 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/DisableExternalResourcesTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/DisableExternalResourcesTest.php @@ -4,14 +4,16 @@ class HTMLPurifier_URIFilter_DisableExternalResourcesTest extends HTMLPurifier_URIFilter_DisableExternalTest { - function setUp() { + public function setUp() + { parent::setUp(); $this->filter = new HTMLPurifier_URIFilter_DisableExternalResources(); $var = true; $this->context->register('EmbeddedURI', $var); } - function testPreserveWhenNotEmbedded() { + public function testPreserveWhenNotEmbedded() + { $this->context->destroy('EmbeddedURI'); // undo setUp $this->assertFiltering( 'http://example.com' diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/DisableExternalTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/DisableExternalTest.php index 3176246a13..da6fe37ae1 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/DisableExternalTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/DisableExternalTest.php @@ -3,45 +3,52 @@ class HTMLPurifier_URIFilter_DisableExternalTest extends HTMLPurifier_URIFilterHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->filter = new HTMLPurifier_URIFilter_DisableExternal(); } - function testRemoveExternal() { + public function testRemoveExternal() + { $this->assertFiltering( 'http://example.com', false ); } - function testPreserveInternal() { + public function testPreserveInternal() + { $this->assertFiltering( '/foo/bar' ); } - function testPreserveOurHost() { + public function testPreserveOurHost() + { $this->config->set('URI.Host', 'example.com'); $this->assertFiltering( 'http://example.com' ); } - function testPreserveOurSubdomain() { + public function testPreserveOurSubdomain() + { $this->config->set('URI.Host', 'example.com'); $this->assertFiltering( 'http://www.example.com' ); } - function testRemoveSuperdomain() { + public function testRemoveSuperdomain() + { $this->config->set('URI.Host', 'www.example.com'); $this->assertFiltering( 'http://example.com', false ); } - function testBaseAsHost() { + public function testBaseAsHost() + { $this->config->set('URI.Base', 'http://www.example.com/foo/bar'); $this->assertFiltering( 'http://www.example.com/baz' diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/DisableResourcesTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/DisableResourcesTest.php index c2cea8fe6f..e8779dc702 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/DisableResourcesTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/DisableResourcesTest.php @@ -3,18 +3,21 @@ class HTMLPurifier_URIFilter_DisableResourcesTest extends HTMLPurifier_URIFilterHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->filter = new HTMLPurifier_URIFilter_DisableResources(); $var = true; $this->context->register('EmbeddedURI', $var); } - function testRemoveResource() { + public function testRemoveResource() + { $this->assertFiltering('/foo/bar', false); } - function testPreserveRegular() { + public function testPreserveRegular() + { $this->context->destroy('EmbeddedURI'); // undo setUp $this->assertFiltering('/foo/bar'); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/HostBlacklistTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/HostBlacklistTest.php index 4af5a6009d..ffbff0c5d6 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/HostBlacklistTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/HostBlacklistTest.php @@ -3,23 +3,27 @@ class HTMLPurifier_URIFilter_HostBlacklistTest extends HTMLPurifier_URIFilterHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->filter = new HTMLPurifier_URIFilter_HostBlacklist(); } - function testRejectBlacklistedHost() { + public function testRejectBlacklistedHost() + { $this->config->set('URI.HostBlacklist', 'example.com'); $this->assertFiltering('http://example.com', false); } - function testRejectBlacklistedHostThoughNotTrue() { + public function testRejectBlacklistedHostThoughNotTrue() + { // maybe this behavior should change $this->config->set('URI.HostBlacklist', 'example.com'); $this->assertFiltering('http://example.comcast.com', false); } - function testPreserveNonBlacklistedHost() { + public function testPreserveNonBlacklistedHost() + { $this->config->set('URI.HostBlacklist', 'example.com'); $this->assertFiltering('http://google.com'); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/MakeAbsoluteTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/MakeAbsoluteTest.php index 9002f1ff81..f357ce05cd 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/MakeAbsoluteTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/MakeAbsoluteTest.php @@ -3,124 +3,151 @@ class HTMLPurifier_URIFilter_MakeAbsoluteTest extends HTMLPurifier_URIFilterHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->filter = new HTMLPurifier_URIFilter_MakeAbsolute(); $this->setBase(); } - function setBase($base = 'http://example.com/foo/bar.html?q=s#frag') { + public function setBase($base = 'http://example.com/foo/bar.html?q=s#frag') + { $this->config->set('URI.Base', $base); } // corresponding to RFC 2396 - function testPreserveAbsolute() { + public function testPreserveAbsolute() + { $this->assertFiltering('http://example.com/foo.html'); } - function testFilterBlank() { + public function testFilterBlank() + { $this->assertFiltering('', 'http://example.com/foo/bar.html?q=s'); } - function testFilterEmptyPath() { + public function testFilterEmptyPath() + { $this->assertFiltering('?q=s#frag', 'http://example.com/foo/bar.html?q=s#frag'); } - function testPreserveAltScheme() { + public function testPreserveAltScheme() + { $this->assertFiltering('mailto:bob@example.com'); } - function testFilterIgnoreHTTPSpecialCase() { + public function testFilterIgnoreHTTPSpecialCase() + { $this->assertFiltering('http:/', 'http://example.com/'); } - function testFilterAbsolutePath() { + public function testFilterAbsolutePath() + { $this->assertFiltering('/foo.txt', 'http://example.com/foo.txt'); } - function testFilterRelativePath() { + public function testFilterRelativePath() + { $this->assertFiltering('baz.txt', 'http://example.com/foo/baz.txt'); } - function testFilterRelativePathWithInternalDot() { + public function testFilterRelativePathWithInternalDot() + { $this->assertFiltering('./baz.txt', 'http://example.com/foo/baz.txt'); } - function testFilterRelativePathWithEndingDot() { + public function testFilterRelativePathWithEndingDot() + { $this->assertFiltering('baz/.', 'http://example.com/foo/baz/'); } - function testFilterRelativePathDot() { + public function testFilterRelativePathDot() + { $this->assertFiltering('.', 'http://example.com/foo/'); } - function testFilterRelativePathMultiDot() { + public function testFilterRelativePathMultiDot() + { $this->assertFiltering('././foo/./bar/.././baz', 'http://example.com/foo/foo/baz'); } - function testFilterAbsolutePathWithDot() { + public function testFilterAbsolutePathWithDot() + { $this->assertFiltering('/./foo', 'http://example.com/foo'); } - function testFilterAbsolutePathWithMultiDot() { + public function testFilterAbsolutePathWithMultiDot() + { $this->assertFiltering('/./foo/../bar/.', 'http://example.com/bar/'); } - function testFilterRelativePathWithInternalDotDot() { + public function testFilterRelativePathWithInternalDotDot() + { $this->assertFiltering('../baz.txt', 'http://example.com/baz.txt'); } - function testFilterRelativePathWithEndingDotDot() { + public function testFilterRelativePathWithEndingDotDot() + { $this->assertFiltering('..', 'http://example.com/'); } - function testFilterRelativePathTooManyDotDots() { + public function testFilterRelativePathTooManyDotDots() + { $this->assertFiltering('../../', 'http://example.com/'); } - function testFilterAppendingQueryAndFragment() { + public function testFilterAppendingQueryAndFragment() + { $this->assertFiltering('/foo.php?q=s#frag', 'http://example.com/foo.php?q=s#frag'); } // edge cases below - function testFilterAbsolutePathBase() { + public function testFilterAbsolutePathBase() + { $this->setBase('/foo/baz.txt'); $this->assertFiltering('test.php', '/foo/test.php'); } - function testFilterAbsolutePathBaseDirectory() { + public function testFilterAbsolutePathBaseDirectory() + { $this->setBase('/foo/'); $this->assertFiltering('test.php', '/foo/test.php'); } - function testFilterAbsolutePathBaseBelow() { + public function testFilterAbsolutePathBaseBelow() + { $this->setBase('/foo/baz.txt'); $this->assertFiltering('../../test.php', '/test.php'); } - function testFilterRelativePathBase() { + public function testFilterRelativePathBase() + { $this->setBase('foo/baz.html'); $this->assertFiltering('foo.php', 'foo/foo.php'); } - function testFilterRelativePathBaseBelow() { + public function testFilterRelativePathBaseBelow() + { $this->setBase('../baz.html'); $this->assertFiltering('test/strike.html', '../test/strike.html'); } - function testFilterRelativePathBaseWithAbsoluteURI() { + public function testFilterRelativePathBaseWithAbsoluteURI() + { $this->setBase('../baz.html'); $this->assertFiltering('/test/strike.html'); } - function testFilterRelativePathBaseWithDot() { + public function testFilterRelativePathBaseWithDot() + { $this->setBase('../baz.html'); $this->assertFiltering('.', '../'); } - function testRemoveJavaScriptWithEmbeddedLink() { + public function testRemoveJavaScriptWithEmbeddedLink() + { // credits: NykO18 $this->setBase('http://www.example.com/'); $this->assertFiltering('javascript: window.location = \'http://www.example.com\';', false); @@ -128,14 +155,16 @@ class HTMLPurifier_URIFilter_MakeAbsoluteTest extends HTMLPurifier_URIFilterHarn // miscellaneous - function testFilterDomainWithNoSlash() { + public function testFilterDomainWithNoSlash() + { $this->setBase('http://example.com'); $this->assertFiltering('foo', 'http://example.com/foo'); } // error case - function testErrorNoBase() { + public function testErrorNoBase() + { $this->setBase(null); $this->expectError('URI.MakeAbsolute is being ignored due to lack of value for URI.Base configuration'); $this->assertFiltering('foo/bar.txt'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/MungeTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/MungeTest.php index 1acf11ea7a..addaaf9176 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/MungeTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilter/MungeTest.php @@ -3,21 +3,27 @@ class HTMLPurifier_URIFilter_MungeTest extends HTMLPurifier_URIFilterHarness { - function setUp() { + public function setUp() + { parent::setUp(); $this->filter = new HTMLPurifier_URIFilter_Munge(); } - protected function setMunge($uri = 'http://www.google.com/url?q=%s') { + protected function setMunge($uri = 'http://www.google.com/url?q=%s') + { $this->config->set('URI.Munge', $uri); } - protected function setSecureMunge($key = 'secret') { + protected function setSecureMunge($key = 'secret') + { + if (!function_exists('hash_hmac')) return false; $this->setMunge('/redirect.php?url=%s&checksum=%t'); $this->config->set('URI.MungeSecretKey', $key); + return true; } - function testMunge() { + public function testMunge() + { $this->setMunge(); $this->assertFiltering( 'http://www.example.com/', @@ -25,42 +31,48 @@ class HTMLPurifier_URIFilter_MungeTest extends HTMLPurifier_URIFilterHarness ); } - function testMungeReplaceTagName() { + public function testMungeReplaceTagName() + { $this->setMunge('/r?tagname=%n&url=%s'); $token = new HTMLPurifier_Token_Start('a'); $this->context->register('CurrentToken', $token); $this->assertFiltering('http://google.com', '/r?tagname=a&url=http%3A%2F%2Fgoogle.com'); } - function testMungeReplaceAttribute() { + public function testMungeReplaceAttribute() + { $this->setMunge('/r?attr=%m&url=%s'); $attr = 'href'; $this->context->register('CurrentAttr', $attr); $this->assertFiltering('http://google.com', '/r?attr=href&url=http%3A%2F%2Fgoogle.com'); } - function testMungeReplaceResource() { + public function testMungeReplaceResource() + { $this->setMunge('/r?embeds=%r&url=%s'); $embeds = false; $this->context->register('EmbeddedURI', $embeds); $this->assertFiltering('http://google.com', '/r?embeds=&url=http%3A%2F%2Fgoogle.com'); } - function testMungeReplaceCSSProperty() { + public function testMungeReplaceCSSProperty() + { $this->setMunge('/r?property=%p&url=%s'); $property = 'background'; $this->context->register('CurrentCSSProperty', $property); $this->assertFiltering('http://google.com', '/r?property=background&url=http%3A%2F%2Fgoogle.com'); } - function testIgnoreEmbedded() { + public function testIgnoreEmbedded() + { $this->setMunge(); $embeds = true; $this->context->register('EmbeddedURI', $embeds); $this->assertFiltering('http://example.com'); } - function testProcessEmbedded() { + public function testProcessEmbedded() + { $this->setMunge(); $this->config->set('URI.MungeResources', true); $embeds = true; @@ -68,73 +80,86 @@ class HTMLPurifier_URIFilter_MungeTest extends HTMLPurifier_URIFilterHarness $this->assertFiltering('http://www.example.com/', 'http://www.google.com/url?q=http%3A%2F%2Fwww.example.com%2F'); } - function testPreserveRelative() { + public function testPreserveRelative() + { $this->setMunge(); $this->assertFiltering('index.html'); } - function testMungeIgnoreUnknownSchemes() { + public function testMungeIgnoreUnknownSchemes() + { $this->setMunge(); $this->assertFiltering('javascript:foobar();', true); } - function testSecureMungePreserve() { - $this->setSecureMunge(); + public function testSecureMungePreserve() + { + if (!$this->setSecureMunge()) return; $this->assertFiltering('/local'); } - function testSecureMungePreserveEmbedded() { - $this->setSecureMunge(); + public function testSecureMungePreserveEmbedded() + { + if (!$this->setSecureMunge()) return; $embedded = true; $this->context->register('EmbeddedURI', $embedded); $this->assertFiltering('http://google.com'); } - function testSecureMungeStandard() { - $this->setSecureMunge(); - $this->assertFiltering('http://google.com', '/redirect.php?url=http%3A%2F%2Fgoogle.com&checksum=0072e2f817fd2844825def74e54443debecf0892'); + public function testSecureMungeStandard() + { + if (!$this->setSecureMunge()) return; + $this->assertFiltering('http://google.com', '/redirect.php?url=http%3A%2F%2Fgoogle.com&checksum=46267a796aca0ea5839f24c4c97ad2648373a4eca31b1c0d1fa7c7ff26798f79'); } - function testSecureMungeIgnoreUnknownSchemes() { + public function testSecureMungeIgnoreUnknownSchemes() + { // This should be integration tested as well to be false - $this->setSecureMunge(); + if (!$this->setSecureMunge()) return; $this->assertFiltering('javascript:', true); } - function testSecureMungeIgnoreUnbrowsableSchemes() { - $this->setSecureMunge(); + public function testSecureMungeIgnoreUnbrowsableSchemes() + { + if (!$this->setSecureMunge()) return; $this->assertFiltering('news:', true); } - function testSecureMungeToDirectory() { - $this->setSecureMunge(); + public function testSecureMungeToDirectory() + { + if (!$this->setSecureMunge()) return; $this->setMunge('/links/%s/%t'); - $this->assertFiltering('http://google.com', '/links/http%3A%2F%2Fgoogle.com/0072e2f817fd2844825def74e54443debecf0892'); + $this->assertFiltering('http://google.com', '/links/http%3A%2F%2Fgoogle.com/46267a796aca0ea5839f24c4c97ad2648373a4eca31b1c0d1fa7c7ff26798f79'); } - function testMungeIgnoreSameDomain() { + public function testMungeIgnoreSameDomain() + { $this->setMunge('http://example.com/%s'); $this->assertFiltering('http://example.com/foobar'); } - function testMungeIgnoreSameDomainInsecureToSecure() { + public function testMungeIgnoreSameDomainInsecureToSecure() + { $this->setMunge('http://example.com/%s'); $this->assertFiltering('https://example.com/foobar'); } - function testMungeIgnoreSameDomainSecureToSecure() { + public function testMungeIgnoreSameDomainSecureToSecure() + { $this->config->set('URI.Base', 'https://example.com'); $this->setMunge('http://example.com/%s'); $this->assertFiltering('https://example.com/foobar'); } - function testMungeSameDomainSecureToInsecure() { + public function testMungeSameDomainSecureToInsecure() + { $this->config->set('URI.Base', 'https://example.com'); $this->setMunge('/%s'); $this->assertFiltering('http://example.com/foobar', '/http%3A%2F%2Fexample.com%2Ffoobar'); } - function testMungeIgnoresSourceHost() { + public function testMungeIgnoresSourceHost() + { $this->config->set('URI.Host', 'foo.example.com'); $this->setMunge('http://example.com/%s'); $this->assertFiltering('http://foo.example.com/bar'); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilterHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilterHarness.php index 165ae67884..4c8ad42e5b 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilterHarness.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIFilterHarness.php @@ -3,7 +3,8 @@ class HTMLPurifier_URIFilterHarness extends HTMLPurifier_URIHarness { - protected function assertFiltering($uri, $expect_uri = true) { + protected function assertFiltering($uri, $expect_uri = true) + { $this->prepareURI($uri, $expect_uri); $this->filter->prepare($this->config, $this->context); $result = $this->filter->filter($uri, $this->config, $this->context); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIHarness.php index 852460a85a..4577469c63 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIHarness.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIHarness.php @@ -9,7 +9,8 @@ class HTMLPurifier_URIHarness extends HTMLPurifier_Harness * @param &$expect_uri Reference to string expectation URI * @note If $expect_uri is false, it will stay false */ - protected function prepareURI(&$uri, &$expect_uri) { + protected function prepareURI(&$uri, &$expect_uri) + { $parser = new HTMLPurifier_URIParser(); if ($expect_uri === true) $expect_uri = $uri; $uri = $parser->parse($uri); @@ -21,7 +22,8 @@ class HTMLPurifier_URIHarness extends HTMLPurifier_Harness /** * Generates a URI object from the corresponding string */ - protected function createURI($uri) { + protected function createURI($uri) + { $parser = new HTMLPurifier_URIParser(); return $parser->parse($uri); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIParserTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIParserTest.php index 5cb5850f75..a188862c9a 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIParserTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URIParserTest.php @@ -13,98 +13,112 @@ class HTMLPurifier_URIParserTest extends HTMLPurifier_Harness $this->assertEqual($result, $expect); } - function testPercentNormalization() { + public function testPercentNormalization() + { $this->assertParsing( '%G', null, null, null, null, '%25G', null, null ); } - function testRegular() { + public function testRegular() + { $this->assertParsing( 'http://www.example.com/webhp?q=foo#result2', 'http', null, 'www.example.com', null, '/webhp', 'q=foo', 'result2' ); } - function testPortAndUsername() { + public function testPortAndUsername() + { $this->assertParsing( 'http://user@authority.part:80/now/the/path?query#fragment', 'http', 'user', 'authority.part', 80, '/now/the/path', 'query', 'fragment' ); } - function testPercentEncoding() { + public function testPercentEncoding() + { $this->assertParsing( 'http://en.wikipedia.org/wiki/Clich%C3%A9', 'http', null, 'en.wikipedia.org', null, '/wiki/Clich%C3%A9', null, null ); } - function testEmptyQuery() { + public function testEmptyQuery() + { $this->assertParsing( 'http://www.example.com/?#', 'http', null, 'www.example.com', null, '/', '', null ); } - function testEmptyPath() { + public function testEmptyPath() + { $this->assertParsing( 'http://www.example.com', 'http', null, 'www.example.com', null, '', null, null ); } - function testOpaqueURI() { + public function testOpaqueURI() + { $this->assertParsing( 'mailto:bob@example.com', 'mailto', null, null, null, 'bob@example.com', null, null ); } - function testIPv4Address() { + public function testIPv4Address() + { $this->assertParsing( 'http://192.0.34.166/', 'http', null, '192.0.34.166', null, '/', null, null ); } - function testFakeIPv4Address() { + public function testFakeIPv4Address() + { $this->assertParsing( 'http://333.123.32.123/', 'http', null, '333.123.32.123', null, '/', null, null ); } - function testIPv6Address() { + public function testIPv6Address() + { $this->assertParsing( 'http://[2001:db8::7]/c=GB?objectClass?one', 'http', null, '[2001:db8::7]', null, '/c=GB', 'objectClass?one', null ); } - function testInternationalizedDomainName() { + public function testInternationalizedDomainName() + { $this->assertParsing( "http://t\xC5\xABdali\xC5\x86.lv", 'http', null, "t\xC5\xABdali\xC5\x86.lv", null, '', null, null ); } - function testInvalidPort() { + public function testInvalidPort() + { $this->assertParsing( 'http://example.com:foobar', 'http', null, 'example.com', null, '', null, null ); } - function testPathAbsolute() { + public function testPathAbsolute() + { $this->assertParsing( 'http:/this/is/path', 'http', null, null, null, '/this/is/path', null, null ); } - function testPathRootless() { + public function testPathRootless() + { // this should not be used but is allowed $this->assertParsing( 'http:this/is/path', @@ -112,34 +126,46 @@ class HTMLPurifier_URIParserTest extends HTMLPurifier_Harness ); } - function testPathEmpty() { + public function testPathEmpty() + { $this->assertParsing( 'http:', 'http', null, null, null, '', null, null ); } - function testRelativeURI() { + public function testRelativeURI() + { $this->assertParsing( '/a/b', null, null, null, null, '/a/b', null, null ); } - function testMalformedTag() { + public function testMalformedTag() + { $this->assertParsing( 'http://www.example.com/>', 'http', null, 'www.example.com', null, '/', null, null ); } - function testEmpty() { + public function testEmpty() + { $this->assertParsing( '', null, null, null, null, '', null, null ); } + public function testEmbeddedColon() + { + $this->assertParsing( + '{:test:}', + null, null, null, null, '{:test:}', null, null + ); + } + } // vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URISchemeRegistryTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URISchemeRegistryTest.php index e124aa18d2..5988d4655c 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URISchemeRegistryTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URISchemeRegistryTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_URISchemeRegistryTest extends HTMLPurifier_Harness { - function test() { - + public function test() + { generate_mock_once('HTMLPurifier_URIScheme'); $config = HTMLPurifier_Config::create(array( diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URISchemeTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URISchemeTest.php index cbd4fc58b8..99a46548a9 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URISchemeTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URISchemeTest.php @@ -8,7 +8,8 @@ class HTMLPurifier_URISchemeTest extends HTMLPurifier_URIHarness private $pngBase64; - public function __construct() { + public function __construct() + { $this->pngBase64 = 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGP'. 'C/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IA'. @@ -18,7 +19,8 @@ class HTMLPurifier_URISchemeTest extends HTMLPurifier_URIHarness 'vr4MkhoXe0rZigAAAABJRU5ErkJggg=='; } - protected function assertValidation($uri, $expect_uri = true) { + protected function assertValidation($uri, $expect_uri = true) + { $this->prepareURI($uri, $expect_uri); $this->config->set('URI.AllowedSchemes', array($uri->scheme)); // convenience hack: the scheme should be explicitly specified @@ -27,165 +29,190 @@ class HTMLPurifier_URISchemeTest extends HTMLPurifier_URIHarness $this->assertEitherFailOrIdentical($result, $uri, $expect_uri); } - function test_http_regular() { + public function test_http_regular() + { $this->assertValidation( 'http://example.com/?s=q#fragment' ); } - function test_http_uppercase() { + public function test_http_uppercase() + { $this->assertValidation( 'http://example.com/FOO' ); } - function test_http_removeDefaultPort() { + public function test_http_removeDefaultPort() + { $this->assertValidation( 'http://example.com:80', 'http://example.com' ); } - function test_http_removeUserInfo() { + public function test_http_removeUserInfo() + { $this->assertValidation( 'http://bob@example.com', 'http://example.com' ); } - function test_http_preserveNonDefaultPort() { + public function test_http_preserveNonDefaultPort() + { $this->assertValidation( 'http://example.com:8080' ); } - function test_https_regular() { + public function test_https_regular() + { $this->assertValidation( 'https://user@example.com:443/?s=q#frag', 'https://example.com/?s=q#frag' ); } - function test_ftp_regular() { + public function test_ftp_regular() + { $this->assertValidation( 'ftp://user@example.com/path' ); } - function test_ftp_removeDefaultPort() { + public function test_ftp_removeDefaultPort() + { $this->assertValidation( 'ftp://example.com:21', 'ftp://example.com' ); } - function test_ftp_removeQueryString() { + public function test_ftp_removeQueryString() + { $this->assertValidation( 'ftp://example.com?s=q', 'ftp://example.com' ); } - function test_ftp_preserveValidTypecode() { + public function test_ftp_preserveValidTypecode() + { $this->assertValidation( 'ftp://example.com/file.txt;type=a' ); } - function test_ftp_removeInvalidTypecode() { + public function test_ftp_removeInvalidTypecode() + { $this->assertValidation( 'ftp://example.com/file.txt;type=z', 'ftp://example.com/file.txt' ); } - function test_ftp_encodeExtraSemicolons() { + public function test_ftp_encodeExtraSemicolons() + { $this->assertValidation( 'ftp://example.com/too;many;semicolons=1', 'ftp://example.com/too%3Bmany%3Bsemicolons=1' ); } - function test_news_regular() { + public function test_news_regular() + { $this->assertValidation( 'news:gmane.science.linguistics' ); } - function test_news_explicit() { + public function test_news_explicit() + { $this->assertValidation( 'news:642@eagle.ATT.COM' ); } - function test_news_removeNonPathComponents() { + public function test_news_removeNonPathComponents() + { $this->assertValidation( 'news://user@example.com:80/rec.music?path=foo#frag', 'news:/rec.music#frag' ); } - function test_nntp_regular() { + public function test_nntp_regular() + { $this->assertValidation( 'nntp://news.example.com/alt.misc/42#frag' ); } - function test_nntp_removalOfRedundantOrUselessComponents() { + public function test_nntp_removalOfRedundantOrUselessComponents() + { $this->assertValidation( 'nntp://user@news.example.com:119/alt.misc/42?s=q#frag', 'nntp://news.example.com/alt.misc/42#frag' ); } - function test_mailto_regular() { + public function test_mailto_regular() + { $this->assertValidation( 'mailto:bob@example.com' ); } - function test_mailto_removalOfRedundantOrUselessComponents() { + public function test_mailto_removalOfRedundantOrUselessComponents() + { $this->assertValidation( 'mailto://user@example.com:80/bob@example.com?subject=Foo#frag', 'mailto:/bob@example.com?subject=Foo#frag' ); } - function test_data_png() { + public function test_data_png() + { $this->assertValidation( 'data:image/png;base64,'.$this->pngBase64 ); } - function test_data_malformed() { + public function test_data_malformed() + { $this->assertValidation( 'data:image/png;base64,vr4MkhoXJRU5ErkJggg==', false ); } - function test_data_implicit() { + public function test_data_implicit() + { $this->assertValidation( 'data:base64,'.$this->pngBase64, 'data:image/png;base64,'.$this->pngBase64 ); } - function test_file_basic() { + public function test_file_basic() + { $this->assertValidation( 'file://user@MYCOMPUTER:12/foo/bar?baz#frag', 'file://MYCOMPUTER/foo/bar#frag' ); } - function test_file_local() { + public function test_file_local() + { $this->assertValidation( 'file:///foo/bar?baz#frag', 'file:///foo/bar#frag' ); } - function test_ftp_empty_host() { + public function test_ftp_empty_host() + { $this->assertValidation('ftp:///example.com', false); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URITest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URITest.php index 02b9501338..5ed2e5b2c5 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URITest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/URITest.php @@ -3,12 +3,14 @@ class HTMLPurifier_URITest extends HTMLPurifier_URIHarness { - protected function createURI($uri) { + protected function createURI($uri) + { $parser = new HTMLPurifier_URIParser(); return $parser->parse($uri); } - function test_construct() { + public function test_construct() + { $uri1 = new HTMLPurifier_URI('HTTP', 'bob', 'example.com', '23', '/foo', 'bar=2', 'slash'); $uri2 = new HTMLPurifier_URI('http', 'bob', 'example.com', 23, '/foo', 'bar=2', 'slash'); $this->assertIdentical($uri1, $uri2); @@ -26,23 +28,27 @@ class HTMLPurifier_URITest extends HTMLPurifier_URIHarness return $registry; } - protected function setUpSchemeMock($name) { + protected function setUpSchemeMock($name) + { $registry = $this->setUpSchemeRegistryMock(); $scheme_mock = new HTMLPurifier_URISchemeMock(); $registry->setReturnValue('getScheme', $scheme_mock, array($name, '*', '*')); return $scheme_mock; } - protected function setUpNoValidSchemes() { + protected function setUpNoValidSchemes() + { $registry = $this->setUpSchemeRegistryMock(); $registry->setReturnValue('getScheme', false, array('*', '*', '*')); } - protected function tearDownSchemeRegistryMock() { + protected function tearDownSchemeRegistryMock() + { HTMLPurifier_URISchemeRegistry::instance($this->oldRegistry); } - function test_getSchemeObj() { + public function test_getSchemeObj() + { $scheme_mock = $this->setUpSchemeMock('http'); $uri = $this->createURI('http:'); @@ -52,7 +58,8 @@ class HTMLPurifier_URITest extends HTMLPurifier_URIHarness $this->tearDownSchemeRegistryMock(); } - function test_getSchemeObj_invalidScheme() { + public function test_getSchemeObj_invalidScheme() + { $this->setUpNoValidSchemes(); $uri = $this->createURI('http:'); @@ -62,7 +69,8 @@ class HTMLPurifier_URITest extends HTMLPurifier_URIHarness $this->tearDownSchemeRegistryMock(); } - function test_getSchemaObj_defaultScheme() { + public function test_getSchemaObj_defaultScheme() + { $scheme = 'foobar'; $scheme_mock = $this->setUpSchemeMock($scheme); @@ -75,7 +83,8 @@ class HTMLPurifier_URITest extends HTMLPurifier_URIHarness $this->tearDownSchemeRegistryMock(); } - function test_getSchemaObj_invalidDefaultScheme() { + public function test_getSchemaObj_invalidDefaultScheme() + { $this->setUpNoValidSchemes(); $this->config->set('URI.DefaultScheme', 'foobar'); @@ -88,55 +97,63 @@ class HTMLPurifier_URITest extends HTMLPurifier_URIHarness $this->tearDownSchemeRegistryMock(); } - protected function assertToString($expect_uri, $scheme, $userinfo, $host, $port, $path, $query, $fragment) { + protected function assertToString($expect_uri, $scheme, $userinfo, $host, $port, $path, $query, $fragment) + { $uri = new HTMLPurifier_URI($scheme, $userinfo, $host, $port, $path, $query, $fragment); $string = $uri->toString(); $this->assertIdentical($string, $expect_uri); } - function test_toString_full() { + public function test_toString_full() + { $this->assertToString( 'http://bob@example.com:300/foo?bar=baz#fragment', 'http', 'bob', 'example.com', 300, '/foo', 'bar=baz', 'fragment' ); } - function test_toString_scheme() { + public function test_toString_scheme() + { $this->assertToString( 'http:', 'http', null, null, null, '', null, null ); } - function test_toString_authority() { + public function test_toString_authority() + { $this->assertToString( '//bob@example.com:8080', null, 'bob', 'example.com', 8080, '', null, null ); } - function test_toString_path() { + public function test_toString_path() + { $this->assertToString( '/path/to', null, null, null, null, '/path/to', null, null ); } - function test_toString_query() { + public function test_toString_query() + { $this->assertToString( '?q=string', null, null, null, null, '', 'q=string', null ); } - function test_toString_fragment() { + public function test_toString_fragment() + { $this->assertToString( '#fragment', null, null, null, null, '', null, 'fragment' ); } - protected function assertValidation($uri, $expect_uri = true) { + protected function assertValidation($uri, $expect_uri = true) + { if ($expect_uri === true) $expect_uri = $uri; $uri = $this->createURI($uri); $result = $uri->validate($this->config, $this->context); @@ -148,51 +165,63 @@ class HTMLPurifier_URITest extends HTMLPurifier_URIHarness } } - function test_validate_overlongPort() { + public function test_validate_overlongPort() + { $this->assertValidation('http://example.com:65536', 'http://example.com'); } - function test_validate_zeroPort() { + public function test_validate_zeroPort() + { $this->assertValidation('http://example.com:00', 'http://example.com'); } - function test_validate_invalidHostThatLooksLikeIPv6() { + public function test_validate_invalidHostThatLooksLikeIPv6() + { $this->assertValidation('http://[2001:0db8:85z3:08d3:1319:8a2e:0370:7334]', ''); } - function test_validate_removeRedundantScheme() { + public function test_validate_removeRedundantScheme() + { $this->assertValidation('http:foo:/:', 'foo%3A/:'); } - function test_validate_username() { + public function test_validate_username() + { $this->assertValidation("http://user\xE3\x91\x94:@foo.com", 'http://user%E3%91%94:@foo.com'); } - function test_validate_path_abempty() { + public function test_validate_path_abempty() + { $this->assertValidation("http://host/\xE3\x91\x94:", 'http://host/%E3%91%94:'); } - function test_validate_path_absolute() { + public function test_validate_path_absolute() + { $this->assertValidation("/\xE3\x91\x94:", '/%E3%91%94:'); } - function test_validate_path_rootless() { + public function test_validate_path_rootless() + { $this->assertValidation("mailto:\xE3\x91\x94:", 'mailto:%E3%91%94:'); } - function test_validate_path_noscheme() { + public function test_validate_path_noscheme() + { $this->assertValidation("\xE3\x91\x94", '%E3%91%94'); } - function test_validate_query() { + public function test_validate_query() + { $this->assertValidation("?/\xE3\x91\x94", '?/%E3%91%94'); } - function test_validate_fragment() { + public function test_validate_fragment() + { $this->assertValidation("#/\xE3\x91\x94", '#/%E3%91%94'); } - function test_validate_path_empty() { + public function test_validate_path_empty() + { $this->assertValidation('http://google.com'); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/UnitConverterTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/UnitConverterTest.php index 3dc1e2afa8..53543f0239 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/UnitConverterTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/UnitConverterTest.php @@ -3,7 +3,8 @@ class HTMLPurifier_UnitConverterTest extends HTMLPurifier_Harness { - protected function assertConversion($input, $expect, $unit = null, $test_negative = true) { + protected function assertConversion($input, $expect, $unit = null, $test_negative = true) + { $length = HTMLPurifier_Length::make($input); if ($expect !== false) $expectl = HTMLPurifier_Length::make($expect); else $expectl = false; @@ -29,12 +30,14 @@ class HTMLPurifier_UnitConverterTest extends HTMLPurifier_Harness } } - function testFail() { + public function testFail() + { $this->assertConversion('1in', false, 'foo'); $this->assertConversion('1foo', false, 'in'); } - function testZero() { + public function testZero() + { $this->assertConversion('0', '0', 'in', false); $this->assertConversion('-0', '0', 'in', false); $this->assertConversion('0in', '0', 'in', false); @@ -43,7 +46,8 @@ class HTMLPurifier_UnitConverterTest extends HTMLPurifier_Harness $this->assertConversion('-0in', '0', 'pt', false); } - function testEnglish() { + public function testEnglish() + { $this->assertConversion('1in', '6pc'); $this->assertConversion('6pc', '1in'); @@ -61,20 +65,23 @@ class HTMLPurifier_UnitConverterTest extends HTMLPurifier_Harness $this->assertConversion('96px', '1in'); } - function testMetric() { + public function testMetric() + { $this->assertConversion('1cm', '10mm'); $this->assertConversion('10mm', '1cm'); $this->assertConversion('1mm', '0.1cm'); $this->assertConversion('100mm', '10cm'); } - function testEnglishMetric() { + public function testEnglishMetric() + { $this->assertConversion('2.835pt', '1mm'); $this->assertConversion('1mm', '2.835pt'); $this->assertConversion('0.3937in', '1cm'); } - function testRoundingMinPrecision() { + public function testRoundingMinPrecision() + { // One sig-fig, modified to be four, conversion rounds up $this->assertConversion('100pt', '1.389in'); $this->assertConversion('1000pt', '13.89in'); @@ -83,7 +90,8 @@ class HTMLPurifier_UnitConverterTest extends HTMLPurifier_Harness $this->assertConversion('1000000pt', '13890in'); } - function testRoundingUserPrecision() { + public function testRoundingUserPrecision() + { // Five sig-figs, conversion rounds down $this->assertConversion('11112000pt', '154330in'); $this->assertConversion('1111200pt', '15433in'); @@ -94,17 +102,20 @@ class HTMLPurifier_UnitConverterTest extends HTMLPurifier_Harness $this->assertConversion('11.112pt', '0.15433in'); } - function testRoundingBigNumber() { + public function testRoundingBigNumber() + { $this->assertConversion('444400000000000000000000in', '42660000000000000000000000px'); } - protected function assertSigFig($n, $sigfigs) { + protected function assertSigFig($n, $sigfigs) + { $converter = new HTMLPurifier_UnitConverter(); $result = $converter->getSigFigs($n); $this->assertIdentical($result, $sigfigs); } - function test_getSigFigs() { + public function test_getSigFigs() + { $this->assertSigFig('0', 0); $this->assertSigFig('1', 1); $this->assertSigFig('-1', 1); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/VarParser/FlexibleTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/VarParser/FlexibleTest.php index c6149b6b4f..ea4469c722 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/VarParser/FlexibleTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/VarParser/FlexibleTest.php @@ -3,8 +3,8 @@ class HTMLPurifier_VarParser_FlexibleTest extends HTMLPurifier_VarParserHarness { - function testValidate() { - + public function testValidate() + { $this->assertValid('foobar', 'string'); $this->assertValid('foobar', 'text'); $this->assertValid('FOOBAR', 'istring', 'foobar'); @@ -51,11 +51,13 @@ class HTMLPurifier_VarParser_FlexibleTest extends HTMLPurifier_VarParserHarness } - function testValidate_withMagicNumbers() { + public function testValidate_withMagicNumbers() + { $this->assertValid('foobar', HTMLPurifier_VarParser::STRING); } - function testValidate_null() { + public function testValidate_null() + { $this->assertIdentical($this->parser->parse(null, 'string', true), null); $this->expectException('HTMLPurifier_VarParserException'); $this->parser->parse(null, 'string', false); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/VarParser/NativeTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/VarParser/NativeTest.php index 424dceb751..266a09f821 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/VarParser/NativeTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/VarParser/NativeTest.php @@ -3,7 +3,8 @@ class HTMLPurifier_VarParser_NativeTest extends HTMLPurifier_VarParserHarness { - public function testValidateSimple() { + public function testValidateSimple() + { $this->assertValid('"foo\\\\"', 'string', 'foo\\'); } diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/VarParserHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/VarParserHarness.php index 0ef23189c3..68708dbf80 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/VarParserHarness.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/VarParserHarness.php @@ -5,17 +5,20 @@ class HTMLPurifier_VarParserHarness extends UnitTestCase protected $parser; - public function setup() { + public function setup() + { $class = substr(get_class($this), 0, -4); $this->parser = new $class(); } - function assertValid($var, $type, $ret = null) { + public function assertValid($var, $type, $ret = null) + { $ret = ($ret === null) ? $var : $ret; $this->assertIdentical($this->parser->parse($var, $type), $ret); } - function assertInvalid($var, $type, $msg = null) { + public function assertInvalid($var, $type, $msg = null) + { $caught = false; try { $this->parser->parse($var, $type); diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ZipperTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ZipperTest.php new file mode 100644 index 0000000000..50c3f04cd8 --- /dev/null +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ZipperTest.php @@ -0,0 +1,26 @@ +assertIdentical($t, 0); + $t = $z->next($t); + $this->assertIdentical($t, 1); + $t = $z->prev($t); + $this->assertIdentical($t, 0); + $t = $z->advance($t, 2); + $this->assertIdentical($t, 2); + $t = $z->delete(); + $this->assertIdentical($t, 3); + $z->insertBefore(4); + $z->insertAfter(5); + $this->assertIdentical($z->toArray($t), array(0,1,4,3,5)); + list($old, $t) = $z->splice($t, 2, array(6,7)); + $this->assertIdentical($old, array(3,5)); + $this->assertIdentical($t, 6); + $this->assertIdentical($z->toArray($t), array(0,1,4,6,7)); + } + + // ToDo: QuickCheck style test comparing with array_splice +} diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifierTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifierTest.php index 5d61c1aaec..1fbcddf868 100644 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifierTest.php +++ b/vendor/ezyang/htmlpurifier/tests/HTMLPurifierTest.php @@ -4,12 +4,13 @@ class HTMLPurifierTest extends HTMLPurifier_Harness { protected $purifier; - function testNull() { + public function testNull() + { $this->assertPurification("Null byte\0", "Null byte"); } - function test_purifyArray() { - + public function test_purifyArray() + { $this->assertIdentical( $this->purifier->purifyArray( array('Good', 'Sketchy', 'foo' => '') @@ -21,13 +22,15 @@ class HTMLPurifierTest extends HTMLPurifier_Harness } - function testGetInstance() { + public function testGetInstance() + { $purifier = HTMLPurifier::getInstance(); $purifier2 = HTMLPurifier::getInstance(); $this->assertReference($purifier, $purifier2); } - function testMakeAbsolute() { + public function testMakeAbsolute() + { $this->config->set('URI.Base', 'http://example.com/bar/baz.php'); $this->config->set('URI.MakeAbsolute', true); $this->assertPurification( @@ -36,12 +39,14 @@ class HTMLPurifierTest extends HTMLPurifier_Harness ); } - function testDisableResources() { + public function testDisableResources() + { $this->config->set('URI.DisableResources', true); $this->assertPurification('', ''); } - function test_addFilter_deprecated() { + public function test_addFilter_deprecated() + { $this->expectError('HTMLPurifier->addFilter() is deprecated, use configuration directives in the Filter namespace or Filter.Custom'); generate_mock_once('HTMLPurifier_Filter'); $this->purifier->addFilter($mock = new HTMLPurifier_FilterMock()); diff --git a/vendor/ezyang/htmlpurifier/tests/PHPT/Controller/SimpleTest.php b/vendor/ezyang/htmlpurifier/tests/PHPT/Controller/SimpleTest.php index 62fe6a4051..ac4512f564 100644 --- a/vendor/ezyang/htmlpurifier/tests/PHPT/Controller/SimpleTest.php +++ b/vendor/ezyang/htmlpurifier/tests/PHPT/Controller/SimpleTest.php @@ -8,12 +8,14 @@ class PHPT_Controller_SimpleTest extends SimpleTestCase protected $_path; - public function __construct($path) { + public function __construct($path) + { $this->_path = $path; parent::__construct($path); } - public function testPhpt() { + public function testPhpt() + { $suite = new PHPT_Suite(array($this->_path)); $phpt_reporter = new PHPT_Reporter_SimpleTest($this->reporter); $suite->run($phpt_reporter); diff --git a/vendor/ezyang/htmlpurifier/tests/PHPT/Reporter/SimpleTest.php b/vendor/ezyang/htmlpurifier/tests/PHPT/Reporter/SimpleTest.php index 25ffe7b4c0..34b47cd492 100644 --- a/vendor/ezyang/htmlpurifier/tests/PHPT/Reporter/SimpleTest.php +++ b/vendor/ezyang/htmlpurifier/tests/PHPT/Reporter/SimpleTest.php @@ -10,7 +10,8 @@ class PHPT_Reporter_SimpleTest implements PHPT_Reporter protected $reporter; /** @param SimpleTest reporter */ - public function __construct($reporter) { + public function __construct($reporter) + { $this->reporter = $reporter; } @@ -21,42 +22,48 @@ class PHPT_Reporter_SimpleTest implements PHPT_Reporter * Called when the Reporter is started from a PHPT_Suite * @todo Figure out if Suites can be named */ - public function onSuiteStart(PHPT_Suite $suite) { + public function onSuiteStart(PHPT_Suite $suite) + { //$this->reporter->paintGroupStart('PHPT Suite', $suite->count()); } /** * Called when the Reporter is finished in a PHPT_Suite */ - public function onSuiteEnd(PHPT_Suite $suite) { + public function onSuiteEnd(PHPT_Suite $suite) + { //$this->reporter->paintGroupEnd('PHPT Suite'); } /** * Called when a Case is started */ - public function onCaseStart(PHPT_Case $case) { + public function onCaseStart(PHPT_Case $case) + { //$this->reporter->paintCaseStart($case->name); } /** * Called when a Case ends */ - public function onCaseEnd(PHPT_Case $case) { + public function onCaseEnd(PHPT_Case $case) + { //$this->reporter->paintCaseEnd($case->name); } /** * Called when a Case runs without Exception */ - public function onCasePass(PHPT_Case $case) { + public function onCasePass(PHPT_Case $case) + { $this->reporter->paintPass("{$case->name} in {$case->filename}"); } /** * Called when a PHPT_Case_VetoException is thrown during a Case's run() */ - public function onCaseSkip(PHPT_Case $case, PHPT_Case_VetoException $veto) { + public function onCaseSkip(PHPT_Case $case, PHPT_Case_VetoException $veto) + { $this->reporter->paintSkip($veto->getMessage() . ' [' . $case->filename .']'); } @@ -64,11 +71,13 @@ class PHPT_Reporter_SimpleTest implements PHPT_Reporter * Called when any Exception other than a PHPT_Case_VetoException is encountered * during a Case's run() */ - public function onCaseFail(PHPT_Case $case, PHPT_Case_FailureException $failure) { + public function onCaseFail(PHPT_Case $case, PHPT_Case_FailureException $failure) + { $this->reporter->paintFail($failure->getReason()); } - public function onParserError(Exception $exception) { + public function onParserError(Exception $exception) + { $this->reporter->paintException($exception); } diff --git a/vendor/ezyang/htmlpurifier/tests/PHPT/Section/PRESKIPIF.php b/vendor/ezyang/htmlpurifier/tests/PHPT/Section/PRESKIPIF.php index 4691c76daf..5d25ea4edf 100644 --- a/vendor/ezyang/htmlpurifier/tests/PHPT/Section/PRESKIPIF.php +++ b/vendor/ezyang/htmlpurifier/tests/PHPT/Section/PRESKIPIF.php @@ -4,31 +4,31 @@ class PHPT_Section_PRESKIPIF implements PHPT_Section_RunnableBefore { private $_data = null; private $_runner_factory = null; - + public function __construct($data) { $this->_data = $data; $this->_runner_factory = new PHPT_CodeRunner_Factory(); } - + public function run(PHPT_Case $case) { // @todo refactor this code into PHPT_Util class as its used in multiple places $filename = dirname($case->filename) . '/' . basename($case->filename, '.php') . '.skip.php'; - + // @todo refactor to PHPT_CodeRunner file_put_contents($filename, $this->_data); $runner = $this->_runner_factory->factory($case); $runner->ini = ""; $response = $runner->run($filename)->output; unlink($filename); - + if (preg_match('/^skip( - (.*))?/', $response, $matches)) { $message = !empty($matches[2]) ? $matches[2] : ''; throw new PHPT_Case_VetoException($message); } } - + public function getPriority() { return -2; diff --git a/vendor/ezyang/htmlpurifier/tests/common.php b/vendor/ezyang/htmlpurifier/tests/common.php index 223a5bf1fc..8f35a410cb 100644 --- a/vendor/ezyang/htmlpurifier/tests/common.php +++ b/vendor/ezyang/htmlpurifier/tests/common.php @@ -7,7 +7,8 @@ if (!defined('HTMLPurifierTest')) { // setup our own autoload, checking for HTMLPurifier library if spl_autoload_register // is not allowed -function __autoload($class) { +function __autoload($class) +{ if (!function_exists('spl_autoload_register')) { if (HTMLPurifier_Bootstrap::autoload($class)) return true; if (HTMLPurifierExtras::autoload($class)) return true; @@ -85,7 +86,8 @@ require 'path2class.func.php'; * @param $aliases * */ -function htmlpurifier_parse_args(&$AC, $aliases) { +function htmlpurifier_parse_args(&$AC, $aliases) +{ if (empty($_GET) && !empty($_SERVER['argv'])) { array_shift($_SERVER['argv']); $o = false; @@ -143,7 +145,8 @@ function htmlpurifier_parse_args(&$AC, $aliases) { * @param $o Argument name * @param $v Argument value */ -function htmlpurifier_args(&$AC, $aliases, $o, $v) { +function htmlpurifier_args(&$AC, $aliases, $o, $v) +{ if (isset($aliases[$o])) $o = $aliases[$o]; if (!isset($AC[$o])) return; if (is_string($AC[$o])) $AC[$o] = $v; @@ -154,7 +157,8 @@ function htmlpurifier_args(&$AC, $aliases, $o, $v) { /** * Adds a test-class; we use file extension to determine which class to use. */ -function htmlpurifier_add_test($test, $test_file, $only_phpt = false) { +function htmlpurifier_add_test($test, $test_file, $only_phpt = false) +{ switch (strrchr($test_file, ".")) { case '.phpt': return $test->add(new PHPT_Controller_SimpleTest($test_file)); @@ -173,14 +177,39 @@ function htmlpurifier_add_test($test, $test_file, $only_phpt = false) { /** * Debugging function that prints tokens in a user-friendly manner. */ -function printTokens($tokens, $index = null) { +function printTokens($tokens, $index = null) +{ $string = '
                                                                            ';
                                                                                 $generator = new HTMLPurifier_Generator(HTMLPurifier_Config::createDefault(), new HTMLPurifier_Context);
                                                                                 foreach ($tokens as $i => $token) {
                                                                            -        if ($index === $i) $string .= '[';
                                                                            -        $string .= "$i";
                                                                            -        $string .= $generator->escape($generator->generateFromToken($token));
                                                                            -        if ($index === $i) $string .= ']';
                                                                            +        $string .= printToken($generator, $token, $i, $index == $i);
                                                                            +    }
                                                                            +    $string .= '
                                                                            '; + echo $string; +} + +function printToken($generator, $token, $i, $isCursor) +{ + $string = ""; + if ($isCursor) $string .= '['; + $string .= "$i"; + $string .= $generator->escape($generator->generateFromToken($token)); + if ($isCursor) $string .= ']'; + return $string; +} + +function printZipper($zipper, $token) +{ + $string = '
                                                                            ';
                                                                            +    $generator = new HTMLPurifier_Generator(HTMLPurifier_Config::createDefault(), new HTMLPurifier_Context);
                                                                            +    foreach ($zipper->front as $i => $t) {
                                                                            +        $string .= printToken($generator, $t, $i, false);
                                                                            +    }
                                                                            +    if ($token !== NULL) {
                                                                            +        $string .= printToken($generator, $token, "", true);
                                                                            +    }
                                                                            +    for ($i = count($zipper->back)-1; $i >= 0; $i--) {
                                                                            +        $string .= printToken($generator, $zipper->back[$i], $i, false);
                                                                                 }
                                                                                 $string .= '
                                                                            '; echo $string; @@ -189,13 +218,16 @@ function printTokens($tokens, $index = null) { /** * Convenient "insta-fail" test-case to add if any outside things fail */ -class FailedTest extends UnitTestCase { +class FailedTest extends UnitTestCase +{ protected $msg, $details; - public function __construct($msg, $details = null) { + public function __construct($msg, $details = null) + { $this->msg = $msg; $this->details = $details; } - public function test() { + public function test() + { $this->fail($this->msg); if ($this->details) $this->reporter->paintFormattedMessage($this->details); } @@ -204,7 +236,8 @@ class FailedTest extends UnitTestCase { /** * Flushes all caches, and fatally errors out if there's a problem. */ -function htmlpurifier_flush($php, $reporter) { +function htmlpurifier_flush($php, $reporter) +{ exec($php . ' ../maintenance/flush.php ' . $php . ' 2>&1', $out, $status); if ($status) { $test = new FailedTest( @@ -219,7 +252,8 @@ function htmlpurifier_flush($php, $reporter) { /** * Dumps error queue, useful if there has been a fatal error. */ -function htmlpurifier_dump_error_queue() { +function htmlpurifier_dump_error_queue() +{ $context = SimpleTest::getContext(); $queue = $context->get('SimpleErrorQueue'); while (($error = $queue->extract()) !== false) { diff --git a/vendor/ezyang/htmlpurifier/tests/generate_mock_once.func.php b/vendor/ezyang/htmlpurifier/tests/generate_mock_once.func.php index 3d87101824..98b40a63b9 100644 --- a/vendor/ezyang/htmlpurifier/tests/generate_mock_once.func.php +++ b/vendor/ezyang/htmlpurifier/tests/generate_mock_once.func.php @@ -2,7 +2,8 @@ // since Mocks can't be called from within test files, we need to do // a little jumping through hoops to generate them -function generate_mock_once($name) { +function generate_mock_once($name) +{ $mock_name = $name . 'Mock'; if (class_exists($mock_name, false)) return false; Mock::generate($name, $mock_name); diff --git a/vendor/ezyang/htmlpurifier/tests/index.php b/vendor/ezyang/htmlpurifier/tests/index.php index 808b2ce18b..5a0db18c05 100644 --- a/vendor/ezyang/htmlpurifier/tests/index.php +++ b/vendor/ezyang/htmlpurifier/tests/index.php @@ -29,7 +29,7 @@ error_reporting(E_ALL | E_STRICT); // Because we always want to know about errors, and because SimpleTest // will notify us about them, logging the errors to stderr is -// counterproductive and in fact the wrong thing when a test case +// counterproductive and in fact the wrong thing when a test case // exercises an error condition to detect for it. ini_set('log_errors', false); diff --git a/vendor/ezyang/htmlpurifier/tests/path2class.func.php b/vendor/ezyang/htmlpurifier/tests/path2class.func.php index 95a3a95ae9..bf3aa735ab 100644 --- a/vendor/ezyang/htmlpurifier/tests/path2class.func.php +++ b/vendor/ezyang/htmlpurifier/tests/path2class.func.php @@ -1,6 +1,7 @@ register(new Whoops\Provider\Silex\WhoopsServiceProvider); -} - -// ... - -$app->run(); -``` - -And that's about it. By default, you'll get the pretty error pages if something goes awry in your development -environment, but you also have full access to the **whoops** library, obviously. For example, adding a new handler -into your app is as simple as extending `whoops`: - -```php -$app['whoops'] = $app->extend('whoops', function($whoops) { - $whoops->pushHandler(new DeleteWholeProjectHandler); - return $whoops; -}); -``` -### Integrating with Phalcon - -**whoops** comes packaged with a Phalcon Service Provider: `Whoops\Provider\Phalcon\WhoopsServiceProvider`. Using it -in your existing Phalcon project is easy. The provider uses the default Phalcon DI unless you pass a DI instance into the constructor. - -```php -new Whoops\Provider\Phalcon\WhoopsServiceProvider; - -// --- or --- - -$di = Phalcon\DI\FactoryDefault; -new Whoops\Provider\Phalcon\WhoopsServiceProvider($di); -``` - -### Integrating with Laravel 4/Illuminate - -If you're using Laravel 4, as of [this commit to laravel/framework](https://github.com/laravel/framework/commit/64f3a79aae254b71550a8097880f0b0e09062d24), you're already using Whoops! Yay! - -### Integrating with Laravel 3 +If you are not using any of these frameworks, here's a very simple way to install: -User [@hugomrdias](https://github.com/hugomrdias) contributed a simple guide/example to help you integrate **whoops** with Laravel 3's IoC container, available at: +1. Use [Composer](http://getcomposer.org) to install Whoops into your project: -https://gist.github.com/hugomrdias/5169713#file-start-php + ```bash + composer require filp/whoops:1 + ``` -### Integrating with CakePHP +1. Register the pretty handler in your code: -User [@oldskool](https://github.com/oldskool) maintains a [super convenient package](https://github.com/oldskool/WhoopsCakephp) to integrate Whoops with CakePHP, -that requires only a single command. + ```php + $whoops = new \Whoops\Run; + $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler); + $whoops->register(); + ``` -### Integrating with Zend Framework 2 - -User [@zsilbi](https://github.com/zsilbi) contributed a provider for ZF2 integration, -available in the following location: - -https://github.com/filp/whoops/tree/master/src/Whoops/Provider/Zend - -**Instructions:** - -- Add Whoops as a module to you app (/vendor/Whoops) -- Whoops must be the first module: - -```php -'modules' => array( - 'Whoops', - 'Application' - ) -``` - -- Move Module.php from /Whoops/Provider/Zend/Module.php to /Whoops/Module.php -- Use optional configurations in your controller config: - -```php -return array( - 'view_manager' => array( - 'display_not_found_reason' => true, - 'display_exceptions' => true, - 'json_exceptions' => array( - 'display' => true, - 'ajax_only' => true, - 'show_trace' => true - ) - ), -); -``` - -- NOTE: ob_clean(); is used to remove previous output, so you may use ob_start(); at the beginning of your app (index.php) - -### Opening referenced files with your favorite editor or IDE - -When using the pretty error page feature, whoops comes with the ability to -open referenced files directly in your IDE or editor. - -```php -setEditor('sublime'); -``` - -The following editors are currently supported by default. - -- `sublime` - Sublime Text 2 -- `emacs` - Emacs -- `textmate` - Textmate -- `macvim` - MacVim -- `xdebug` - xdebug (uses [xdebug.file_link_format](http://xdebug.org/docs/all_settings#file_link_format)) - -Adding your own editor is simple: - -```php - -$handler->setEditor(function($file, $line) { - return "whatever://open?file=$file&line=$line"; -}); - -``` - -You can add PhpStorm support with [PhpStormOpener](https://github.com/pinepain/PhpStormOpener#phpstormopener) (Mac OS X only): -```php - -$handler->setEditor( - function ($file, $line) { - // if your development server is not local it's good to map remote files to local - $translations = array('^' . __DIR__ => '~/Development/PhpStormOpener'); // change to your path - - foreach ($translations as $from => $to) { - $file = preg_replace('#' . $from . '#', $to, $file, 1); - } - - return "pstorm://$file:$line"; - } -); - -``` +For more options, have a look at the **example files** in `examples/` to get a feel for how things work. Also take a look at the [API Documentation](docs/Framework%20Integration.md#API%20Documentation) and the list of available handers below. ### Available Handlers @@ -219,10 +67,7 @@ $handler->setEditor( ## Authors -This library was primarily developed by [Filipe Dobreira](https://github.com/filp). - -A lot of awesome fixes and enhancements were also sent in by contributors, which you can find **[in this page right here](https://github.com/filp/whoops/contributors)**. +This library was primarily developed by [Filipe Dobreira](https://github.com/filp), and is currently maintained by [Denis Sokolov](https://github.com/denis-sokolov). A lot of awesome fixes and enhancements were also sent in by [various contributors](https://github.com/filp/whoops/contributors). [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/filp/whoops/trend.png)](https://bitdeli.com/free "Bitdeli Badge") - diff --git a/vendor/filp/whoops/composer.json b/vendor/filp/whoops/composer.json index ee040c1d6d..7eb1e65e26 100644 --- a/vendor/filp/whoops/composer.json +++ b/vendor/filp/whoops/composer.json @@ -16,8 +16,7 @@ }, "require-dev": { "php": ">=5.3.3", - "mockery/mockery": "0.9.*", - "silex/silex": "1.1.*" + "mockery/mockery": "0.9.*" }, "autoload": { "psr-0": { diff --git a/vendor/filp/whoops/docs/API Documentation.md b/vendor/filp/whoops/docs/API Documentation.md new file mode 100644 index 0000000000..93307c7f06 --- /dev/null +++ b/vendor/filp/whoops/docs/API Documentation.md @@ -0,0 +1,393 @@ +# API Documentation + +### Core Classes: +- [`Whoops\Run`](#whoops-run) - The main `Whoops` class - represents the stack and current execution +- [`Whoops\Handler\Handler` and `Whoops\Handler\HandlerInterface`](#handler-abstract) - Abstract representation of a Handler, and utility methods +- [`Whoops\Exception\Inspector`](#inspector) - Exposes methods to inspect an exception +- [`Whoops\Exception\FrameCollection`](#frame-collection) - Exposes methods to work with a list of frames +- [`Whoops\Exception\Frame`](#frame) - Exposes methods to inspect a single stack trace frame from an exception + +### Core Handlers: +- [`Whoops\Handler\CallbackHandler`](#handler-callback) - Wraps regular closures as handlers +- [`Whoops\Handler\JsonResponseHandler`](#handler-json) - Formats errors and exceptions as a JSON payload +- [`Whoops\Handler\PrettyPageHandler`](#handler-pretty) - Outputs a detailed, fancy error page + +# Core Classes: + +## `Whoops\Run` + +The `Run` class models an instance of an execution, and integrates the methods to control whoops' execution in that context, and control the handlers stack. + +### Constants + +```php +string Run::EXCEPTION_HANDLER // (name for exception handler method) +string Run::ERROR_HANDLER // (name for error handler method) +string Run::SHUTDOWN_HANDLER // (name for shutdown handler method) +``` + +### Methods + +```php +// Pushes a new handler to the stack of handlers +Run::pushHandler( Whoops\HandlerInterface $handler ) + #=> Whoops\Run + +// Pops and returns the last handler from the stack +Run::popHandler() + #=> Whoops\HandlerInterface + +// Returns all handlers in the stack +Run::getHandlers() + #=> Whoops\HandlerInterface[] + +// Returns a Whoops\Inspector instance for a given Exception +Run::getInspector( Exception $exception ) + #=> Whoops\Exception\Inspector + +// Registers this Whoops\Run instance as an error/exception/shutdown +// handler with PHP +Run::register() + #=> Whoops\Run + +// I'll let you guess this one +Run::unregister() + #=> Whoops\Run + +// If true, allows Whoops to terminate script execution (default: true) +Run::allowQuit( $allowQuit = null ) + #=> bool + +// If true, allows Whoops to send output produced by handlers directly +// to the client. You'll want to set this to false if you want to +// package the handlers' response into your HTTP response abstraction +// or something (default: true) +Run::writeToOutput( $send = null) + #=> bool + +// ** HANDLERS ** +// These are semi-internal methods that receive input from +// PHP directly. If you know what you're doing, you can +// also call them directly + +// Handles an exception with the current stack. Returns the +// output produced by handlers. +Run::handleException( Exception $exception ) + #=> string + +// Handles an error with the current stack. Errors are +// converted into SPL ErrorException instances +Run::handleError( int $level, string $message, string $file = null, int $line = null) + #=> null + +// Hooked as a shutdown handler, captures fatal errors and handles them +// through the current stack: +Run::handleShutdown() + #=> null +``` + +## `Whoops\Handler\Handler` & `Whoops\Handler\HandlerInterface` + +This abstract class contains the base methods for concrete handler implementations. Custom handlers can extend it, or implement the `Whoops\Handler\HandlerInterface` interface. + +### Constants +```php +int Handler::DONE // If returned from HandlerInterface::handle, does absolutely nothing. +int Handler::LAST_HANDLER // ...tells whoops to not execute any more handlers after this one. +int Handler::QUIT // ...tells whoops to quit script execution immediately. +``` + +### Methods + +```php +// Custom handlers should expose this method, which will be called once an +// exception needs to be handled. The Handler::* constants can be used to +// signal the underlying logic as to what to do next. +HandlerInterface::handle() + #=> null | int + +// Sets the Run instance for this handler +HandlerInterface::setRun( Whoops\Run $run) + #=> null + +// Sets the Inspector instance for this handler +HandlerInterface::setInspector( Whoops\Exception\Inspector $inspector) + #=> null + +// Sets the Exception for this handler to handle +HandlerInterface::setException( Exception $exception ) + #=> null +``` + +## `Whoops\Exception\Inspector` + +The `Inspector` class provides methods to inspect an exception instance, with particular focus on its frames/stack-trace. + +### Methods + +```php +Inspector::__construct( Exception $exception ) + #=> null + +// Returns the Exception instance being inspected +Inspector::getException() + #=> Exception + +// Returns the string name of the Exception being inspected +// A faster way of doing get_class($inspector->getException()) +Inspector::getExceptionName() + #=> string + +// Returns the string message for the Exception being inspected +// A faster way of doing $inspector->getException()->getMessage() +Inspector::getExceptionMessage() + #=> string + +// Returns an iterator instance for all the frames in the stack +// trace for the Exception being inspected. +Inspector::getFrames() + #=> Whoops\Exception\FrameIterator +``` + +## `Whoops\Exception\FrameCollection` + +The `FrameCollection` class exposes a fluent interface to manipulate and examine a +collection of `Frame` instances. + +`FrameCollection` objects are **serializable**. + +### Methods + +```php +// Returns the number of frames in the collection +// May also be called as count($frameCollection) +FrameCollection::count() + #=> int + +// Filter the Frames in the collection with a callable. +// The callable must accept a Frame object, and return +// true to keep it in the collection, or false not to. +FrameCollection::filter( callable $callable ) + #=> FrameCollection + +// See: array_map +// The callable must accept a Frame object, and return +// a Frame object, doesn't matter if it's the same or not +// - will throw an UnexpectedValueException if something +// else is returned. +FrameCollection::map( callable $callable) + #=> FrameCollection +``` + +## `Whoops\Exception\Frame` + +The `Frame` class models a single frame in an exception's stack trace. You can use it to retrieve info about things such as frame context, file, line number. Additionally, you have available functionality to add comments to a frame, which is made available to other handlers. + +`Frame` objects are **serializable**. + +### Methods + +```php +// Returns the file path for the file where this frame occured. +// The optional $shortened argument allows you to retrieve a +// shorter, human-readable file path for display. +Frame::getFile( bool $shortened = false ) + #=> string | null (Some frames do not have a file path) + +// Returns the line number for this frame +Frame::getLine() + #=> int | null + +// Returns the class name for this frame, if it occured +// within a class/instance. +Frame::getClass() + #=> string | null + +// Returns the function name for this frame, if it occured +// within a function/method +Frame::getFunction() + #=> string | null + +// Returns an array of arguments for this frame. Empty if no +// arguments were provided. +Frame::getArgs() + #=> array + +// Returns the full file contents for the file where this frame +// occured. +Frame::getFileContents() + #=> string | null + +// Returns an array of lines for a file, optionally scoped to a +// given range of line numbers. i.e: Frame::getFileLines(0, 3) +// returns the first 3 lines after line 0 (1) +Frame::getFileLines( int $start = 0, int $length = null) + #=> array | null + +// Adds a comment to this Frame instance. Comments are shared +// with everything that can access the frame instance, obviously, +// so they can be used for a variety of inter-operability purposes. +// The context option can be used to improve comment filtering. +// Additionally, if frames contain URIs, the PrettyPageHandler +// will automagically convert them to clickable anchor elements. +Frame::addComment( string $comment, string $context = 'global' ) + #=> null + +// Returns all comments for this instance optionally filtered by +// a string context identifier. +Frame::getComments( string $filter = null ) + #=> array +``` + +# Core Handlers + +## `Whoops\Handler\CallbackHandler` + +The `CallbackHandler` handler wraps regular PHP closures as valid handlers. Useful for quick prototypes or simple handlers. When you pass a closure to `Run::pushHandler`, it's automatically converted to a `CallbackHandler` instance. + +```php +pushHandler(function($exception, $inspector, $run) { + var_dump($exception->getMessage()); + return Handler::DONE; +}); + +$run->popHandler() // #=> Whoops\Handler\CallbackHandler +``` + +### Methods + +```php +// Accepts any valid callable +// For example, a closure, a string function name, an array +// in the format array($class, $method) +CallbackHandler::__construct( $callable ) + #=> null + +CallbackHandler::handle() + #=> int | null +``` + +## `Whoops\Handler\JsonResponseHandler` + +The `JsonResponseHandler`, upon receiving an exception to handle, simply constructs a `JSON` payload, and outputs it. Methods are available to control the detail of the output, and if it should only execute for AJAX requests - paired with another handler under it, such as the `PrettyPageHandler`, it allows you to have meaningful output for both regular and AJAX requests. Neat! + +The `JSON` body has the following format: + +```json +{ + "error": { + "type": "RuntimeException", + "message": "Something broke!", + "file": "/var/project/foo/bar.php", + "line": 22, + + # if JsonResponseHandler::addTraceToOutput(true): + "trace": [ + { "file": "/var/project/foo/index.php", + "line": 157, + "function": "handleStuffs", + "class": "MyApplication\DoerOfThings", + "args": [ true, 10, "yay method arguments" ] }, + # ... more frames here ... + ] + } +} +``` + +### Methods + +```php + +// Should detailed stack trace output also be added to the +// JSON payload body? +JsonResponseHandler::addTraceToOutput( bool $yes = null ) + #=> bool + +// Should output only be sent if the current request is an +// AJAX request? +JsonResponseHandler::onlyForAjaxRequests( bool $yes = null ) + #=> bool + +JsonResponseHandler::handle() + #=> int | null +``` + +## `Whoops\Handler\PrettyPageHandler` + +The `PrettyPageHandler` generates a fancy, detailed error page which includes code views for all frames in the stack trace, environment details, etc. Super neat. It produces a bundled response string that does not require any further HTTP requests, so it's fit to work on pretty much any environment and framework that speaks back to a browser, without you having to explicitly hook it up to your framework/project's routing mechanisms. + +### Methods + +```php +// Adds a key=>value table of arbitrary data, labeled by $label, to +// the output. Useful where you want to display contextual data along +// with the error, about your application or project. +PrettyPageHandler::addDataTable( string $label, array $data ) + #=> null + +// Similar to PrettyPageHandler::addDataTable, but accepts a callable +// that will be called only when rendering an exception. This allows +// you to gather additional data that may not be available very early +// in the process. +PrettyPageHandler::addDataTableCallback( string $label, callable $callback ) + #=> null + +// Returns all data tables registered with this handler. Optionally +// accepts a string label, and will only return the data under that +// label. +PrettyPageHandler::getDataTables( string $label = null ) + #=> array | array[] + +// Sets the title for the error page +PrettyPageHandler::setPageTitle( string $title ) + #=> null + +// Returns the title for the error page +PrettyPageHandler::getPageTitle() + #=> string + +// Returns a string path to the location where resources +// used by this handler are stored - the template and CSS +// files. +PrettyPageHandler::getResourcesPath() + #=> string + +// Sets a string path to the location of resources for the +// handler. Useful if you want to roll your own template +// file (pretty-template.php and pretty-page.css) while +// still using the logic this handler provides +PrettyPageHandler::setResourcesPath( string $resourcesPath ) + #=> null + +// Sets an editor to use to open referenced files, either by +// a string identifier, or as an arbitrary callable that returns +// a string that can be used as an href attribute. +// Available built-in editors are: +// - sublime +// - emacs +// - textmate +// - macvim +PrettyPageHandler::setEditor( string $editor ) +PrettyPageHandler::setEditor( function($file, $line) { return string } ) + #=> null + +// Similar to PrettyPageHandler::setEditor, but allows you +// to name your custom editor, thus sharing it with the +// rest of the application. Useful if, for example, you integrate +// Whoops into your framework or library, and want to share +// support for extra editors with the end-user. +// +// $resolver may be a callable, like with ::setEditor, or a string +// with placeholders %file and %line. +// For example: +// $handler->addEditor('whatevs', 'whatevs://open?file=file://%file&line=%line') +PrettyPageHandler::addEditor( string $editor, $resolver ) + #=> null + +PrettyPageHandler::handle() + #=> int | null +``` diff --git a/vendor/filp/whoops/docs/Framework Integration.md b/vendor/filp/whoops/docs/Framework Integration.md new file mode 100644 index 0000000000..adf9963d7c --- /dev/null +++ b/vendor/filp/whoops/docs/Framework Integration.md @@ -0,0 +1,81 @@ +# Integrating with Silex + +**whoops** comes packaged with a Silex Service Provider: `Whoops\Provider\Silex\WhoopsServiceProvider`. Using it +in your existing Silex project is easy: + +```php + +require 'vendor/autoload.php'; + +use Silex\Application; + +// ... some awesome code here ... + +if($app['debug']) { + $app->register(new Whoops\Provider\Silex\WhoopsServiceProvider); +} + +// ... + +$app->run(); +``` + +And that's about it. By default, you'll get the pretty error pages if something goes awry in your development +environment, but you also have full access to the **whoops** library, obviously. For example, adding a new handler +into your app is as simple as extending `whoops`: + +```php +$app['whoops'] = $app->extend('whoops', function($whoops) { + $whoops->pushHandler(new DeleteWholeProjectHandler); + return $whoops; +}); +``` + + +# Integrating with Phalcon + +**whoops** comes packaged with a Phalcon Service Provider: `Whoops\Provider\Phalcon\WhoopsServiceProvider`. Using it +in your existing Phalcon project is easy. The provider uses the default Phalcon DI unless you pass a DI instance into the constructor. + +```php +new Whoops\Provider\Phalcon\WhoopsServiceProvider; + +// --- or --- + +$di = Phalcon\DI\FactoryDefault; +new Whoops\Provider\Phalcon\WhoopsServiceProvider($di); +``` + + +# Contributing an integration with a framework + +Lately we're prefering to keep integration libraries out of the Whoops core. +If possible, consider managing an official Whoops-SomeFramework integration. + +The procedure is not hard at all. + +1. Keep your integration classes and instructions in a repository of your own; +2. Create a `composer.json` file in your repository with contents similar to the following: + + ``` + { + "name": "username/whoops-someframework", + "description": "Integrates the Whoops library into SomeFramework", + "version": "1.0.0", + "require": { + "filp/whoops": "1.*" + } + } + ``` + +3. [Register it with Packagist](https://packagist.org/packages/submit). + +Once that is done, please create an issue and we will add a link to it in our README. + +SomeFramework users then would write this in their `composer.json`: + + "require": { + "username/whoops-someframework": "*" + } + +This would also install Whoops and you'd be able to release updates to your package as quickly as you wish them to. diff --git a/vendor/filp/whoops/docs/Open Files In An Editor.md b/vendor/filp/whoops/docs/Open Files In An Editor.md new file mode 100644 index 0000000000..c789aca3e9 --- /dev/null +++ b/vendor/filp/whoops/docs/Open Files In An Editor.md @@ -0,0 +1,49 @@ +# Open Files In An Editor + +When using the pretty error page feature, whoops comes with the ability to +open referenced files directly in your IDE or editor. + +```php +setEditor('sublime'); +``` + +The following editors are currently supported by default. + +- `sublime` - Sublime Text 2 +- `emacs` - Emacs +- `textmate` - Textmate +- `macvim` - MacVim +- `xdebug` - xdebug (uses [xdebug.file_link_format](http://xdebug.org/docs/all_settings#file_link_format)) + +Adding your own editor is simple: + +```php + +$handler->setEditor(function($file, $line) { + return "whatever://open?file=$file&line=$line"; +}); + +``` + +You can add PhpStorm support with [PhpStormOpener](https://github.com/pinepain/PhpStormOpener#phpstormopener) (Mac OS X only): +```php + +$handler->setEditor( + function ($file, $line) { + // if your development server is not local it's good to map remote files to local + $translations = array('^' . __DIR__ => '~/Development/PhpStormOpener'); // change to your path + + foreach ($translations as $from => $to) { + $file = preg_replace('#' . $from . '#', $to, $file, 1); + } + + return "pstorm://$file:$line"; + } +); + +``` diff --git a/vendor/filp/whoops/examples/example-silex.php b/vendor/filp/whoops/examples/example-silex.php index 86530a4cf0..ce9ac5d351 100644 --- a/vendor/filp/whoops/examples/example-silex.php +++ b/vendor/filp/whoops/examples/example-silex.php @@ -3,10 +3,9 @@ * Whoops - php errors for cool kids * @author Filipe Dobreira * - * NOTE: Requires silex/silex, can be installed with composer - * within this project using the --dev flag: + * NOTE: Requires silex/silex, can be installed with composer: * - * $ composer install --dev + * $ composer require silex/silex:* * * Run this example file with the PHP 5.4 web server with: * diff --git a/vendor/filp/whoops/phpunit.xml.dist b/vendor/filp/whoops/phpunit.xml.dist index a5abf9a5bc..df20f210b0 100644 --- a/vendor/filp/whoops/phpunit.xml.dist +++ b/vendor/filp/whoops/phpunit.xml.dist @@ -8,8 +8,14 @@ - + src/Whoops/ + + ./docs + ./examples + ./tests + ./vendor + diff --git a/vendor/filp/whoops/src/Whoops/Exception/Formatter.php b/vendor/filp/whoops/src/Whoops/Exception/Formatter.php new file mode 100644 index 0000000000..f95cfa146d --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Exception/Formatter.php @@ -0,0 +1,48 @@ + + */ + +namespace Whoops\Exception; + +class Formatter +{ + /** + * Returns all basic information about the exception in a simple array + * for further convertion to other languages + * @param Inspector $inspector + * @param bool $shouldAddTrace + * @return array + */ + public static function formatExceptionAsDataArray(Inspector $inspector, $shouldAddTrace) + { + $exception = $inspector->getException(); + $response = array( + 'type' => get_class($exception), + 'message' => $exception->getMessage(), + 'file' => $exception->getFile(), + 'line' => $exception->getLine() + ); + + if($shouldAddTrace) { + $frames = $inspector->getFrames(); + $frameData = array(); + + foreach($frames as $frame) { + /** @var Frame $frame */ + $frameData[] = array( + 'file' => $frame->getFile(), + 'line' => $frame->getLine(), + 'function' => $frame->getFunction(), + 'class' => $frame->getClass(), + 'args' => $frame->getArgs() + ); + } + + $response['trace'] = $frameData; + } + + return $response; + } +} diff --git a/vendor/filp/whoops/src/Whoops/Exception/Frame.php b/vendor/filp/whoops/src/Whoops/Exception/Frame.php index b7baa4cdeb..bb99798911 100644 --- a/vendor/filp/whoops/src/Whoops/Exception/Frame.php +++ b/vendor/filp/whoops/src/Whoops/Exception/Frame.php @@ -49,7 +49,7 @@ class Frame implements Serializable // @todo: This can be made more reliable by checking if we've entered // eval() in a previous trace, but will need some more work on the upper // trace collector(s). - if(preg_match('/^(.*)\((\d+)\) : eval\(\)\'d code$/', $file, $matches)) { + if(preg_match('/^(.*)\((\d+)\) : (?:eval\(\)\'d|assert) code$/', $file, $matches)) { $file = $this->frame['file'] = $matches[1]; $this->frame['line'] = (int) $matches[2]; } diff --git a/vendor/filp/whoops/src/Whoops/Exception/FrameCollection.php b/vendor/filp/whoops/src/Whoops/Exception/FrameCollection.php index c0fade5866..b3af9df275 100644 --- a/vendor/filp/whoops/src/Whoops/Exception/FrameCollection.php +++ b/vendor/filp/whoops/src/Whoops/Exception/FrameCollection.php @@ -9,6 +9,7 @@ use Whoops\Exception\Frame; use UnexpectedValueException; use IteratorAggregate; use ArrayIterator; +use ArrayAccess; use Serializable; use Countable; @@ -16,7 +17,7 @@ use Countable; * Exposes a fluent interface for dealing with an ordered list * of stack-trace frames. */ -class FrameCollection implements IteratorAggregate, Serializable, Countable +class FrameCollection implements ArrayAccess, IteratorAggregate, Serializable, Countable { /** * @var array[] @@ -93,6 +94,42 @@ class FrameCollection implements IteratorAggregate, Serializable, Countable return new ArrayIterator($this->frames); } + /** + * @see ArrayAccess::offsetExists + * @param int $offset + */ + public function offsetExists($offset) + { + return isset($this->frames[$offset]); + } + + /** + * @see ArrayAccess::offsetGet + * @param int $offset + */ + public function offsetGet($offset) + { + return $this->frames[$offset]; + } + + /** + * @see ArrayAccess::offsetSet + * @param int $offset + */ + public function offsetSet($offset, $value) + { + throw new \Exception(__CLASS__ . ' is read only'); + } + + /** + * @see ArrayAccess::offsetUnset + * @param int $offset + */ + public function offsetUnset($offset) + { + throw new \Exception(__CLASS__ . ' is read only'); + } + /** * @see Countable::count * @return int diff --git a/vendor/filp/whoops/src/Whoops/Exception/Inspector.php b/vendor/filp/whoops/src/Whoops/Exception/Inspector.php index 9e063ef915..ec7f4cc4e0 100644 --- a/vendor/filp/whoops/src/Whoops/Exception/Inspector.php +++ b/vendor/filp/whoops/src/Whoops/Exception/Inspector.php @@ -68,7 +68,7 @@ class Inspector /** * Returns an Inspector for a previous Exception, if any. * @todo Clean this up a bit, cache stuff a bit better. - * @return \Whoops\Exception\Inspector|null + * @return Inspector */ public function getPreviousExceptionInspector() { @@ -106,7 +106,18 @@ class Inspector $this->frames = new FrameCollection($frames); if ($previousInspector = $this->getPreviousExceptionInspector()) { - $this->frames->prependFrames($previousInspector->getFrames()->topDiff($this->frames)); + // Keep outer frame on top of the inner one + $outerFrames = $this->frames; + $newFrames = clone $previousInspector->getFrames(); + // I assume it will always be set, but let's be safe + if (isset($newFrames[0])) { + $newFrames[0]->addComment( + $previousInspector->getExceptionMessage(), + 'Exception message:' + ); + } + $newFrames->prependFrames($outerFrames->topDiff($newFrames)); + $this->frames = $newFrames; } } diff --git a/vendor/filp/whoops/src/Whoops/Handler/HandlerInterface.php b/vendor/filp/whoops/src/Whoops/Handler/HandlerInterface.php index abb4078745..abf33507c6 100644 --- a/vendor/filp/whoops/src/Whoops/Handler/HandlerInterface.php +++ b/vendor/filp/whoops/src/Whoops/Handler/HandlerInterface.php @@ -18,16 +18,19 @@ interface HandlerInterface /** * @param Run $run + * @return void */ public function setRun(Run $run); /** * @param Exception $exception + * @return void */ public function setException(Exception $exception); /** * @param Inspector $inspector + * @return void */ public function setInspector(Inspector $inspector); } diff --git a/vendor/filp/whoops/src/Whoops/Handler/JsonResponseHandler.php b/vendor/filp/whoops/src/Whoops/Handler/JsonResponseHandler.php index ed865e8f66..611dd6e297 100644 --- a/vendor/filp/whoops/src/Whoops/Handler/JsonResponseHandler.php +++ b/vendor/filp/whoops/src/Whoops/Handler/JsonResponseHandler.php @@ -6,7 +6,7 @@ namespace Whoops\Handler; use Whoops\Handler\Handler; -use Whoops\Exception\Frame; +use Whoops\Exception\Formatter; /** * Catches an exception and converts it to a JSON @@ -27,7 +27,7 @@ class JsonResponseHandler extends Handler /** * @param bool|null $returnFrames - * @return null|bool + * @return bool|$this */ public function addTraceToOutput($returnFrames = null) { @@ -36,6 +36,7 @@ class JsonResponseHandler extends Handler } $this->returnFrames = (bool) $returnFrames; + return $this; } /** @@ -73,36 +74,13 @@ class JsonResponseHandler extends Handler return Handler::DONE; } - $exception = $this->getException(); - $response = array( - 'error' => array( - 'type' => get_class($exception), - 'message' => $exception->getMessage(), - 'file' => $exception->getFile(), - 'line' => $exception->getLine() - ) + 'error' => Formatter::formatExceptionAsDataArray( + $this->getInspector(), + $this->addTraceToOutput() + ), ); - if($this->addTraceToOutput()) { - $inspector = $this->getInspector(); - $frames = $inspector->getFrames(); - $frameData = array(); - - foreach($frames as $frame) { - /** @var Frame $frame */ - $frameData[] = array( - 'file' => $frame->getFile(), - 'line' => $frame->getLine(), - 'function' => $frame->getFunction(), - 'class' => $frame->getClass(), - 'args' => $frame->getArgs() - ); - } - - $response['error']['trace'] = $frameData; - } - if (\Whoops\Util\Misc::canSendHeaders()) { header('Content-Type: application/json'); } diff --git a/vendor/filp/whoops/src/Whoops/Handler/PlainTextHandler.php b/vendor/filp/whoops/src/Whoops/Handler/PlainTextHandler.php new file mode 100644 index 0000000000..0dda9befc6 --- /dev/null +++ b/vendor/filp/whoops/src/Whoops/Handler/PlainTextHandler.php @@ -0,0 +1,332 @@ + +* Plaintext handler for command line and logs. +* @author Pierre-Yves Landuré +*/ + +namespace Whoops\Handler; +use Whoops\Handler\Handler; +use InvalidArgumentException; +use Whoops\Exception\Frame; +use Psr\Log\LoggerInterface; + +/** +* Handler outputing plaintext error messages. Can be used +* directly, or will be instantiated automagically by Whoops\Run +* if passed to Run::pushHandler +*/ +class PlainTextHandler extends Handler +{ + const VAR_DUMP_PREFIX = ' | '; + + /** + * @var Psr\Log\LoggerInterface + */ + protected $logger; + + /** + * @var bool + */ + private $addTraceToOutput = true; + + /** + * @var bool|integer + */ + private $addTraceFunctionArgsToOutput = false; + + /** + * @var integer + */ + private $traceFunctionArgsOutputLimit = 1024; + + /** + * @var bool + */ + private $onlyForCommandLine = false; + + /** + * @var bool + */ + private $outputOnlyIfCommandLine = true; + + /** + * @var bool + */ + private $loggerOnly = false; + + /** + * Constructor. + * @throws InvalidArgumentException If argument is not null or a LoggerInterface + * @param Psr\Log\LoggerInterface|null $logger + */ + public function __construct($logger = null) + { + $this->setLogger($logger); + } + + /** + * Set the output logger interface. + * @throws InvalidArgumentException If argument is not null or a LoggerInterface + * @param Psr\Log\LoggerInterface|null $logger + */ + public function setLogger($logger = null) + { + if(! (is_null($logger) + || $logger InstanceOf LoggerInterface)) { + throw new InvalidArgumentException( + 'Argument to ' . __METHOD__ . + " must be a valid Logger Interface (aka. Monolog), " . + get_class($logger) . ' given.' + ); + } + + $this->logger = $logger; + } + + /** + * @return Psr\Log\LoggerInterface|null + */ + public function getLogger() + { + return $this->logger; + } + + /** + * Add error trace to output. + * @param bool|null $addTraceToOutput + * @return bool|$this + */ + public function addTraceToOutput($addTraceToOutput = null) + { + if(func_num_args() == 0) { + return $this->addTraceToOutput; + } + + $this->addTraceToOutput = (bool) $addTraceToOutput; + return $this; + } + + /** + * Add error trace function arguments to output. + * Set to True for all frame args, or integer for the n first frame args. + * @param bool|integer|null $addTraceFunctionArgsToOutput + * @return null|bool|integer + */ + public function addTraceFunctionArgsToOutput($addTraceFunctionArgsToOutput = null) + { + if(func_num_args() == 0) { + return $this->addTraceFunctionArgsToOutput; + } + + if(! is_integer($addTraceFunctionArgsToOutput)) { + $this->addTraceFunctionArgsToOutput = (bool) $addTraceFunctionArgsToOutput; + } + else { + $this->addTraceFunctionArgsToOutput = $addTraceFunctionArgsToOutput; + } + } + + /** + * Set the size limit in bytes of frame arguments var_dump output. + * If the limit is reached, the var_dump output is discarded. + * Prevent memory limit errors. + * @var integer + */ + public function setTraceFunctionArgsOutputLimit($traceFunctionArgsOutputLimit) + { + $this->traceFunctionArgsOutputLimit = (integer) $traceFunctionArgsOutputLimit; + } + + /** + * Get the size limit in bytes of frame arguments var_dump output. + * If the limit is reached, the var_dump output is discarded. + * Prevent memory limit errors. + * @return integer + */ + public function getTraceFunctionArgsOutputLimit() + { + return $this->traceFunctionArgsOutputLimit; + } + + /** + * Restrict error handling to command line calls. + * @param bool|null $onlyForCommandLine + * @return null|bool + */ + public function onlyForCommandLine($onlyForCommandLine = null) + { + if(func_num_args() == 0) { + return $this->onlyForCommandLine; + } + $this->onlyForCommandLine = (bool) $onlyForCommandLine; + } + + /** + * Output the error message only if using command line. + * else, output to logger if available. + * Allow to safely add this handler to web pages. + * @param bool|null $outputOnlyIfCommandLine + * @return null|bool + */ + public function outputOnlyIfCommandLine($outputOnlyIfCommandLine = null) + { + if(func_num_args() == 0) { + return $this->outputOnlyIfCommandLine; + } + $this->outputOnlyIfCommandLine = (bool) $outputOnlyIfCommandLine; + } + + /** + * Only output to logger. + * @param bool|null $loggerOnly + * @return null|bool + */ + public function loggerOnly($loggerOnly = null) + { + if(func_num_args() == 0) { + return $this->loggerOnly; + } + + $this->loggerOnly = (bool) $loggerOnly; + } + + /** + * Check, if possible, that this execution was triggered by a command line. + * @return bool + */ + private function isCommandLine() + { + return PHP_SAPI == 'cli'; + } + + /** + * Test if handler can process the exception.. + * @return bool + */ + private function canProcess() + { + return $this->isCommandLine() || !$this->onlyForCommandLine(); + } + + /** + * Test if handler can output to stdout. + * @return bool + */ + private function canOutput() + { + return ($this->isCommandLine() || ! $this->outputOnlyIfCommandLine()) + && ! $this->loggerOnly(); + } + + /** + * Get the frame args var_dump. + * @param \Whoops\Exception\Frame $frame [description] + * @param integer $line [description] + * @return string + */ + private function getFrameArgsOutput(Frame $frame, $line) + { + if($this->addTraceFunctionArgsToOutput() === false + || $this->addTraceFunctionArgsToOutput() < $line) { + return ''; + } + + // Dump the arguments: + ob_start(); + var_dump($frame->getArgs()); + if(ob_get_length() > $this->getTraceFunctionArgsOutputLimit()) { + // The argument var_dump is to big. + // Discarded to limit memory usage. + ob_clean(); + return sprintf( + "\n%sArguments dump length greater than %d Bytes. Discarded.", + self::VAR_DUMP_PREFIX, + $this->getTraceFunctionArgsOutputLimit() + ); + } + + return sprintf("\n%s", + preg_replace('/^/m', self::VAR_DUMP_PREFIX, ob_get_clean()) + ); + } + + /** + * Get the exception trace as plain text. + * @return string + */ + private function getTraceOutput() + { + if(! $this->addTraceToOutput()) { + return ''; + } + $inspector = $this->getInspector(); + $frames = $inspector->getFrames(); + + $response = "\nStack trace:"; + + $line = 1; + foreach($frames as $frame) { + /** @var Frame $frame */ + $class = $frame->getClass(); + + $template = "\n%3d. %s->%s() %s:%d%s"; + if(! $class) { + // Remove method arrow (->) from output. + $template = "\n%3d. %s%s() %s:%d%s"; + } + + $response .= sprintf( + $template, + $line, + $class, + $frame->getFunction(), + $frame->getFile(), + $frame->getLine(), + $this->getFrameArgsOutput($frame, $line) + ); + + $line++; + } + + return $response; + } + + /** + * @return int + */ + public function handle() + { + if(! $this->canProcess()) { + return Handler::DONE; + } + + $exception = $this->getException(); + + $response = sprintf("%s: %s in file %s on line %d%s\n", + get_class($exception), + $exception->getMessage(), + $exception->getFile(), + $exception->getLine(), + $this->getTraceOutput() + ); + + if($this->getLogger()) { + $this->getLogger()->addError($response); + } + + if(! $this->canOutput()) { + return Handler::DONE; + } + + if(class_exists('\Whoops\Util\Misc') + && \Whoops\Util\Misc::canSendHeaders()) { + header('Content-Type: text/plain'); + } + + echo $response; + + return Handler::QUIT; + } +} diff --git a/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php b/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php index 5457099bb8..98805df6da 100644 --- a/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php +++ b/vendor/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php @@ -33,14 +33,14 @@ class PrettyPageHandler extends Handler private $extraTables = array(); /** - * @var boolean + * @var bool */ private $handleUnconditionally = false; /** * @var string */ - private $pageTitle = "Whoops! There was an error"; + private $pageTitle = "Whoops! There was an error."; /** * A string identifier for a known IDE/text editor, or a closure @@ -88,7 +88,7 @@ class PrettyPageHandler extends Handler { if (!$this->handleUnconditionally()) { // Check conditions for outputting HTML: - // @todo: make this more robust + // @todo: Make this more robust if(php_sapi_name() === 'cli') { // Help users who have been relying on an internal test value @@ -104,12 +104,13 @@ class PrettyPageHandler extends Handler } } - // @todo Make this more dynamic ~~ * + // @todo: Make this more dynamic $helper = new TemplateHelper; - // @todo Allow specifying these: $templateFile = $this->getResource("views/layout.html.php"); $cssFile = $this->getResource("css/whoops.base.css"); + $zeptoFile = $this->getResource("js/zepto.min.js"); + $jsFile = $this->getResource("js/whoops.base.js"); $inspector = $this->getInspector(); $frames = $inspector->getFrames(); @@ -118,10 +119,10 @@ class PrettyPageHandler extends Handler $vars = array( "page_title" => $this->getPageTitle(), - // @todo: asset compiler - "stylesheet" => file_get_contents($this->getResource("css/whoops.base.css")), - "jquery" => file_get_contents($this->getResource("js/zepto.min.js")), - "javascript" => file_get_contents($this->getResource("js/whoops.base.js")), + // @todo: Asset compiler + "stylesheet" => file_get_contents($cssFile), + "zepto" => file_get_contents($zeptoFile), + "javascript" => file_get_contents($jsFile), // Template paths: "header" => $this->getResource("views/header.html.php"), @@ -149,7 +150,7 @@ class PrettyPageHandler extends Handler ); // Add extra entries list of data tables: - // @todo consolidate addDataTable and addDataTableCallback + // @todo: Consolidate addDataTable and addDataTableCallback $extraTables = array_map(function($table) { return $table instanceof \Closure ? $table() : $table; }, $this->getDataTables()); @@ -292,7 +293,7 @@ class PrettyPageHandler extends Handler * @throws InvalidArgumentException If editor resolver does not return a string * @param string $filePath * @param int $line - * @return string|bool + * @return false|string */ public function getEditorHref($filePath, $line) { @@ -324,7 +325,8 @@ class PrettyPageHandler extends Handler } /** - * @var string + * @param string $title + * @return void */ public function setPageTitle($title) { @@ -345,7 +347,8 @@ class PrettyPageHandler extends Handler * * @throws InvalidArgumnetException If $path is not a valid directory * - * @param string $path + * @param string $path + * @return void */ public function addResourcePath($path) { @@ -420,7 +423,8 @@ class PrettyPageHandler extends Handler /** * @deprecated * - * @param string $resourcesPath + * @param string $resourcesPath + * @return void */ public function setResourcesPath($resourcesPath) { diff --git a/vendor/filp/whoops/src/Whoops/Handler/XmlResponseHandler.php b/vendor/filp/whoops/src/Whoops/Handler/XmlResponseHandler.php index d79331ea89..8bb04698ad 100644 --- a/vendor/filp/whoops/src/Whoops/Handler/XmlResponseHandler.php +++ b/vendor/filp/whoops/src/Whoops/Handler/XmlResponseHandler.php @@ -7,8 +7,8 @@ namespace Whoops\Handler; use SimpleXMLElement; -use Whoops\Exception\Frame; use Whoops\Handler\Handler; +use Whoops\Exception\Formatter; /** * Catches an exception and converts it to an XML @@ -24,7 +24,7 @@ class XmlResponseHandler extends Handler /** * @param bool|null $returnFrames - * @return null|bool + * @return bool|$this */ public function addTraceToOutput($returnFrames = null) { @@ -33,6 +33,7 @@ class XmlResponseHandler extends Handler } $this->returnFrames = (bool) $returnFrames; + return $this; } /** @@ -40,36 +41,13 @@ class XmlResponseHandler extends Handler */ public function handle() { - $exception = $this->getException(); - $response = array( - 'error' => array( - 'type' => get_class($exception), - 'message' => $exception->getMessage(), - 'file' => $exception->getFile(), - 'line' => $exception->getLine() - ) + 'error' => Formatter::formatExceptionAsDataArray( + $this->getInspector(), + $this->addTraceToOutput() + ), ); - if($this->addTraceToOutput()) { - $inspector = $this->getInspector(); - $frames = $inspector->getFrames(); - $frameData = array(); - - foreach($frames as $frame) { - /** @var Frame $frame */ - $frameData[] = array( - 'file' => $frame->getFile(), - 'line' => $frame->getLine(), - 'function' => $frame->getFunction(), - 'class' => $frame->getClass(), - 'args' => $frame->getArgs() - ); - } - - $response['error']['trace'] = array_flip($frameData); - } - echo $this->toXml($response); return Handler::QUIT; diff --git a/vendor/filp/whoops/src/Whoops/Provider/Zend/ExceptionStrategy.php b/vendor/filp/whoops/src/Whoops/Provider/Zend/ExceptionStrategy.php index e0731deb26..d8403666ac 100644 --- a/vendor/filp/whoops/src/Whoops/Provider/Zend/ExceptionStrategy.php +++ b/vendor/filp/whoops/src/Whoops/Provider/Zend/ExceptionStrategy.php @@ -7,10 +7,10 @@ namespace Whoops\Provider\Zend; use Whoops\Run; - use Zend\Mvc\View\Http\ExceptionStrategy as BaseExceptionStrategy; use Zend\Mvc\MvcEvent; use Zend\Mvc\Application; +use Zend\Http\Response; class ExceptionStrategy extends BaseExceptionStrategy { diff --git a/vendor/filp/whoops/src/Whoops/Provider/Zend/RouteNotFoundStrategy.php b/vendor/filp/whoops/src/Whoops/Provider/Zend/RouteNotFoundStrategy.php index 935f8626b5..c4ab3e0512 100644 --- a/vendor/filp/whoops/src/Whoops/Provider/Zend/RouteNotFoundStrategy.php +++ b/vendor/filp/whoops/src/Whoops/Provider/Zend/RouteNotFoundStrategy.php @@ -7,7 +7,6 @@ namespace Whoops\Provider\Zend; use Whoops\Run; - use Zend\Mvc\View\Http\RouteNotFoundStrategy as BaseRouteNotFoundStrategy; use Zend\Mvc\MvcEvent; use Zend\Stdlib\ResponseInterface as Response; diff --git a/vendor/filp/whoops/src/Whoops/Resources/views/layout.html.php b/vendor/filp/whoops/src/Whoops/Resources/views/layout.html.php index aa399d22fa..c2a4aebb76 100644 --- a/vendor/filp/whoops/src/Whoops/Resources/views/layout.html.php +++ b/vendor/filp/whoops/src/Whoops/Resources/views/layout.html.php @@ -30,7 +30,7 @@ - + diff --git a/vendor/filp/whoops/src/Whoops/Run.php b/vendor/filp/whoops/src/Whoops/Run.php index b5ec006d33..8a658c042b 100644 --- a/vendor/filp/whoops/src/Whoops/Run.php +++ b/vendor/filp/whoops/src/Whoops/Run.php @@ -152,7 +152,7 @@ class Run /** * Silence particular errors in particular files * @param array|string $patterns List or a single regex pattern to match - * @param integer $levels Defaults to E_STRICT | E_DEPRECATED + * @param int $levels Defaults to E_STRICT | E_DEPRECATED * @return \Whoops\Run */ public function silenceErrorsInPaths($patterns, $levels = 10240) @@ -178,7 +178,7 @@ class Run * use 502, 503, or another 5xx family code. * * @param bool|int $code - * @return bool + * @return int|false */ public function sendHttpCode($code = null) { @@ -239,9 +239,7 @@ class Run // Just in case there are no handlers: $handlerResponse = null; - for($i = count($this->handlerStack) - 1; $i >= 0; $i--) { - $handler = $this->handlerStack[$i]; - + foreach (array_reverse($this->handlerStack) as $handler) { $handler->setRun($this); $handler->setInspector($inspector); $handler->setException($exception); @@ -257,8 +255,11 @@ class Run } } + $willQuit = $handlerResponse == Handler::QUIT && $this->allowQuit(); + $output = ob_get_clean(); + // If we're allowed to, send output generated by handlers directly // to the output, otherwise, and if the script doesn't quit, return // it so that it may be used by the caller @@ -266,36 +267,14 @@ class Run // @todo Might be able to clean this up a bit better // If we're going to quit execution, cleanup all other output // buffers before sending our own output: - if($handlerResponse == Handler::QUIT && $this->allowQuit()) { + if($willQuit) { while (ob_get_level() > 0) ob_end_clean(); } - if($this->sendHttpCode() && \Whoops\Util\Misc::canSendHeaders()) { - $httpCode = $this->sendHttpCode(); - - if (function_exists('http_response_code')) { - http_response_code($httpCode); - } else { - // http_response_code is added in 5.4. - // For compatibility with 5.3 we use the third argument in header call - // First argument must be a real header. - // If it is empty, PHP will ignore the third argument. - // If it is invalid, such as a single space, Apache will handle it well, - // but the PHP development server will hang. - // Setting a full status line would require us to hardcode - // string values for all different status code, and detect the protocol. - // which is an extra error-prone complexity. - header('X-Ignore-This: 1', true, $httpCode); - } - } - - echo $output; + $this->writeToOutputNow($output); } - // Handlers are done! Check if we got here because of Handler::QUIT - // ($handlerResponse will be the response from the last queried handler) - // and if so, try to quit execution. - if($handlerResponse == Handler::QUIT && $this->allowQuit()) { + if($willQuit) { exit; } @@ -313,7 +292,7 @@ class Run * @param string $file * @param int $line * - * @return bool + * @return bool|null */ public function handleError($level, $message, $file = null, $line = null) { @@ -361,10 +340,41 @@ class Run /** * In certain scenarios, like in shutdown handler, we can not throw exceptions - * @var boolean + * @var bool */ private $canThrowExceptions = true; + /** + * Echo something to the browser + * @param string $output + * @return $this + */ + private function writeToOutputNow($output) + { + if($this->sendHttpCode() && \Whoops\Util\Misc::canSendHeaders()) { + $httpCode = $this->sendHttpCode(); + + if (function_exists('http_response_code')) { + http_response_code($httpCode); + } else { + // http_response_code is added in 5.4. + // For compatibility with 5.3 we use the third argument in header call + // First argument must be a real header. + // If it is empty, PHP will ignore the third argument. + // If it is invalid, such as a single space, Apache will handle it well, + // but the PHP development server will hang. + // Setting a full status line would require us to hardcode + // string values for all different status code, and detect the protocol. + // which is an extra error-prone complexity. + header('X-Ignore-This: 1', true, $httpCode); + } + } + + echo $output; + + return $this; + } + private static function isLevelFatal($level) { return in_array( diff --git a/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php b/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php index fb189fe77e..6b09d034f2 100644 --- a/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php +++ b/vendor/filp/whoops/src/Whoops/Util/TemplateHelper.php @@ -62,7 +62,7 @@ class TemplateHelper * method also accepts an array of additional variables to be * passed to the template. * - * @param string $__template + * @param string $template * @param array $additionalVariables */ public function render($template, array $additionalVariables = null) diff --git a/vendor/filp/whoops/tests/Whoops/Exception/FrameCollectionTest.php b/vendor/filp/whoops/tests/Whoops/Exception/FrameCollectionTest.php index 211f31b05a..04f4bd3364 100644 --- a/vendor/filp/whoops/tests/Whoops/Exception/FrameCollectionTest.php +++ b/vendor/filp/whoops/tests/Whoops/Exception/FrameCollectionTest.php @@ -61,6 +61,44 @@ class FrameCollectionTest extends TestCase return new FrameCollection($frames); } + /** + * @covers Whoops\Exception\FrameCollection::offsetExists + */ + public function testArrayAccessExists() + { + $collection = $this->getFrameCollectionInstance(); + $this->assertTrue(isset($collection[0])); + } + + /** + * @covers Whoops\Exception\FrameCollection::offsetGet + */ + public function testArrayAccessGet() + { + $collection = $this->getFrameCollectionInstance(); + $this->assertInstanceOf('Whoops\\Exception\\Frame', $collection[0]); + } + + /** + * @covers Whoops\Exception\FrameCollection::offsetSet + * @expectedException Exception + */ + public function testArrayAccessSet() + { + $collection = $this->getFrameCollectionInstance(); + $collection[0] = 'foo'; + } + + /** + * @covers Whoops\Exception\FrameCollection::offsetUnset + * @expectedException Exception + */ + public function testArrayAccessUnset() + { + $collection = $this->getFrameCollectionInstance(); + unset($collection[0]); + } + /** * @covers Whoops\Exception\FrameCollection::filter * @covers Whoops\Exception\FrameCollection::count @@ -122,6 +160,18 @@ class FrameCollectionTest extends TestCase } } + /** + * @covers Whoops\Exception\FrameCollection::getArray + */ + public function testGetArrayImmutable() + { + $frames = $this->getFrameCollectionInstance(); + $arr = $frames->getArray(); + $arr[0] = 'foobar'; + $newCopy = $frames->getArray(); + $this->assertFalse($arr[0] === $newCopy); + } + /** * @covers Whoops\Exception\FrameCollection::getIterator */ diff --git a/vendor/filp/whoops/tests/Whoops/Exception/InspectorTest.php b/vendor/filp/whoops/tests/Whoops/Exception/InspectorTest.php index ad7061d209..9302a9734d 100644 --- a/vendor/filp/whoops/tests/Whoops/Exception/InspectorTest.php +++ b/vendor/filp/whoops/tests/Whoops/Exception/InspectorTest.php @@ -31,6 +31,19 @@ class InspectorTest extends TestCase return new Inspector($exception); } + /** + * @covers Whoops\Exception\Inspector::getFrames + */ + public function testCorrectNestedFrames($value='') + { + // Create manually to have a different line number from the outer + $inner = new Exception('inner'); + $outer = $this->getException('outer', 0, $inner); + $inspector = $this->getInspectorInstance($outer); + $frames = $inspector->getFrames(); + $this->assertSame($outer->getLine(), $frames[0]->getLine()); + } + /** * @covers Whoops\Exception\Inspector::getExceptionName */ diff --git a/vendor/filp/whoops/tests/Whoops/Handler/PlainTextHandlerTest.php b/vendor/filp/whoops/tests/Whoops/Handler/PlainTextHandlerTest.php new file mode 100644 index 0000000000..869cb50835 --- /dev/null +++ b/vendor/filp/whoops/tests/Whoops/Handler/PlainTextHandlerTest.php @@ -0,0 +1,443 @@ + + */ + +namespace Whoops\Handler; +use Whoops\TestCase; +use Whoops\Handler\PlainTextHandler; +use RuntimeException; +use StdClass; + +class PlainTextHandlerTest extends TestCase +{ + /** + * @throws InvalidArgumentException If argument is not null or a LoggerInterface + * @param Psr\Log\LoggerInterface|null $logger + * @return Whoops\Handler\PlainTextHandler + */ + private function getHandler($logger = null) + { + return new PlainTextHandler($logger); + } + + /** + * @return RuntimeException + */ + public function getException($message = 'test message') + { + return new RuntimeException($message); + } + + /** + * @param bool $withTrace + * @param bool $withTraceArgs + * @param bool $loggerOnly + * @param bool $onlyForCommandLine + * @param bool $outputOnlyIfCommandLine + * @return array + */ + private function getPlainTextFromHandler( + $withTrace = false, + $withTraceArgs = false, + $traceFunctionArgsOutputLimit = 1024, + $loggerOnly = false, + $onlyForCommandLine = false, + $outputOnlyIfCommandLine = true + ) + { + $handler = $this->getHandler(); + $handler->addTraceToOutput($withTrace); + $handler->addTraceFunctionArgsToOutput($withTraceArgs); + $handler->setTraceFunctionArgsOutputLimit($traceFunctionArgsOutputLimit); + $handler->loggerOnly($loggerOnly); + $handler->onlyForCommandLine($onlyForCommandLine); + $handler->outputOnlyIfCommandLine($outputOnlyIfCommandLine); + + $run = $this->getRunInstance(); + $run->pushHandler($handler); + $run->register(); + + $exception = $this->getException(); + ob_start(); + $run->handleException($exception); + + return ob_get_clean(); + } + + /** + * @covers Whoops\Handler\PlainTextHandler::__construct + * @covers Whoops\Handler\PlainTextHandler::setLogger + * @expectedException InvalidArgumentException + */ + public function testConstructor() + { + $logger = new StdClass(); // guaranteed to be invalid! + $this->getHandler($logger); + } + + /** + * @covers Whoops\Handler\PlainTextHandler::setLogger + * @expectedException InvalidArgumentException + */ + public function testSetLogger() + { + $logger = new StdClass(); // guaranteed to be invalid! + $this->getHandler()->setLogger($logger); + } + + /** + * @covers Whoops\Handler\PlainTextHandler::addTraceToOutput + */ + public function testAddTraceToOutput() + { + $handler = $this->getHandler(); + + $handler->addTraceToOutput(true); + $this->assertEquals(true, $handler->addTraceToOutput()); + + $handler->addTraceToOutput(false); + $this->assertEquals(false, $handler->addTraceToOutput()); + + $handler->addTraceToOutput(null); + $this->assertEquals(null, $handler->addTraceToOutput()); + + $handler->addTraceToOutput(1); + $this->assertEquals(true, $handler->addTraceToOutput()); + + $handler->addTraceToOutput(0); + $this->assertEquals(false, $handler->addTraceToOutput()); + + $handler->addTraceToOutput(''); + $this->assertEquals(false, $handler->addTraceToOutput()); + + $handler->addTraceToOutput('false'); + $this->assertEquals(true, $handler->addTraceToOutput()); + } + + /** + * @covers Whoops\Handler\PlainTextHandler::addTraceFunctionArgsToOutput + */ + public function testAddTraceFunctionArgsToOutput() + { + $handler = $this->getHandler(); + + $handler->addTraceFunctionArgsToOutput(true); + $this->assertEquals(true, $handler->addTraceFunctionArgsToOutput()); + + $handler->addTraceFunctionArgsToOutput(false); + $this->assertEquals(false, $handler->addTraceFunctionArgsToOutput()); + + $handler->addTraceFunctionArgsToOutput(null); + $this->assertEquals(null, $handler->addTraceFunctionArgsToOutput()); + + $handler->addTraceFunctionArgsToOutput(1); + $this->assertEquals(1, $handler->addTraceFunctionArgsToOutput()); + + $handler->addTraceFunctionArgsToOutput(0); + $this->assertEquals(0, $handler->addTraceFunctionArgsToOutput()); + + $handler->addTraceFunctionArgsToOutput(''); + $this->assertEquals(false, $handler->addTraceFunctionArgsToOutput()); + + $handler->addTraceFunctionArgsToOutput('false'); + $this->assertEquals(true, $handler->addTraceFunctionArgsToOutput()); + } + + /** + * @covers Whoops\Handler\PlainTextHandler::setTraceFunctionArgsOutputLimit + * @covers Whoops\Handler\PlainTextHandler::getTraceFunctionArgsOutputLimit + */ + public function testGetSetTraceFunctionArgsOutputLimit() + { + $addTraceFunctionArgsToOutput = 10240; + + $handler = $this->getHandler(); + + $handler->setTraceFunctionArgsOutputLimit($addTraceFunctionArgsToOutput); + $this->assertEquals($addTraceFunctionArgsToOutput, $handler->getTraceFunctionArgsOutputLimit()); + + $handler->setTraceFunctionArgsOutputLimit('1024kB'); + $this->assertEquals(1024, $handler->getTraceFunctionArgsOutputLimit()); + + $handler->setTraceFunctionArgsOutputLimit('true'); + $this->assertEquals(0, $handler->getTraceFunctionArgsOutputLimit()); + } + + /** + * @covers Whoops\Handler\PlainTextHandler::onlyForCommandLine + */ + public function testOnlyForCommandLine() + { + $handler = $this->getHandler(); + + $handler->onlyForCommandLine(true); + $this->assertEquals(true, $handler->onlyForCommandLine()); + + $handler->onlyForCommandLine(false); + $this->assertEquals(false, $handler->onlyForCommandLine()); + + $handler->onlyForCommandLine(null); + $this->assertEquals(null, $handler->onlyForCommandLine()); + + $handler->onlyForCommandLine(1); + $this->assertEquals(true, $handler->onlyForCommandLine()); + + $handler->onlyForCommandLine(0); + $this->assertEquals(false, $handler->onlyForCommandLine()); + + $handler->onlyForCommandLine(''); + $this->assertEquals(false, $handler->onlyForCommandLine()); + + $handler->onlyForCommandLine('false'); + $this->assertEquals(true, $handler->onlyForCommandLine()); + } + + /** + * @covers Whoops\Handler\PlainTextHandler::outputOnlyIfCommandLine + */ + public function testOutputOnlyIfCommandLine() + { + $handler = $this->getHandler(); + + $handler->outputOnlyIfCommandLine(true); + $this->assertEquals(true, $handler->outputOnlyIfCommandLine()); + + $handler->outputOnlyIfCommandLine(false); + $this->assertEquals(false, $handler->outputOnlyIfCommandLine()); + + $handler->outputOnlyIfCommandLine(null); + $this->assertEquals(null, $handler->outputOnlyIfCommandLine()); + + $handler->outputOnlyIfCommandLine(1); + $this->assertEquals(true, $handler->outputOnlyIfCommandLine()); + + $handler->outputOnlyIfCommandLine(0); + $this->assertEquals(false, $handler->outputOnlyIfCommandLine()); + + $handler->outputOnlyIfCommandLine(''); + $this->assertEquals(false, $handler->outputOnlyIfCommandLine()); + + $handler->outputOnlyIfCommandLine('false'); + $this->assertEquals(true, $handler->outputOnlyIfCommandLine()); + } + + /** + * @covers Whoops\Handler\PlainTextHandler::loggerOnly + */ + public function testLoggerOnly() + { + $handler = $this->getHandler(); + + $handler->loggerOnly(true); + $this->assertEquals(true, $handler->loggerOnly()); + + $handler->loggerOnly(false); + $this->assertEquals(false, $handler->loggerOnly()); + + $handler->loggerOnly(null); + $this->assertEquals(null, $handler->loggerOnly()); + + $handler->loggerOnly(1); + $this->assertEquals(true, $handler->loggerOnly()); + + $handler->loggerOnly(0); + $this->assertEquals(false, $handler->loggerOnly()); + + $handler->loggerOnly(''); + $this->assertEquals(false, $handler->loggerOnly()); + + $handler->loggerOnly('false'); + $this->assertEquals(true, $handler->loggerOnly()); + } + + /** + * @covers Whoops\Handler\PlainTextHandler::addTraceToOutput + * @covers Whoops\Handler\PlainTextHandler::handle + */ + public function testReturnsWithoutFramesOutput() + { + $text = $this->getPlainTextFromHandler( + $withTrace = false, + $withTraceArgs = true, + $traceFunctionArgsOutputLimit = 1024, + $loggerOnly = false, + $onlyForCommandLine = false, + $outputOnlyIfCommandLine = true + ); + + // Check that the response has the correct value: + // Check that the trace is NOT returned: + $this->assertEquals( + sprintf( + "%s: %s in file %s on line %d\n", + get_class($this->getException()), + 'test message', + __FILE__, + 30 + ), + $text + ); + } + + /** + * @covers Whoops\Handler\PlainTextHandler::addTraceToOutput + * @covers Whoops\Handler\PlainTextHandler::getTraceOutput + * @covers Whoops\Handler\PlainTextHandler::canProcess + * @covers Whoops\Handler\PlainTextHandler::canOutput + * @covers Whoops\Handler\PlainTextHandler::handle + */ + public function testReturnsWithFramesOutput() + { + $text = $this->getPlainTextFromHandler( + $withTrace = true, + $withTraceArgs = false, + $traceFunctionArgsOutputLimit = 1024, + $loggerOnly = false, + $onlyForCommandLine = false, + $outputOnlyIfCommandLine = true + ); + + $lines = explode("\n", $text); + + // Check that the trace is returned without arguments: + $this->assertCount(18, $lines); + + // Check that the response has the correct value: + $this->assertEquals('Stack trace:', $lines[1]); + + // Check that the trace is returned: + $this->assertEquals( + sprintf( + '%3d. %s->%s() %s:%d', + 2, + 'Whoops\Handler\PlainTextHandlerTest', + 'getException', + __FILE__, + 62 + ), + $lines[3] + ); + } + + /** + * @covers Whoops\Handler\PlainTextHandler::addTraceToOutput + * @covers Whoops\Handler\PlainTextHandler::addTraceFunctionArgsToOutput + * @covers Whoops\Handler\PlainTextHandler::getTraceOutput + * @covers Whoops\Handler\PlainTextHandler::getFrameArgsOutput + * @covers Whoops\Handler\PlainTextHandler::canProcess + * @covers Whoops\Handler\PlainTextHandler::canOutput + * @covers Whoops\Handler\PlainTextHandler::handle + */ + public function testReturnsWithFramesAndArgsOutput() + { + $text = $this->getPlainTextFromHandler( + $withTrace = true, + $withTraceArgs = true, + $traceFunctionArgsOutputLimit = 2048, + $loggerOnly = false, + $onlyForCommandLine = false, + $outputOnlyIfCommandLine = true + ); + + $lines = explode("\n", $text); + + // Check that the trace is returned with all arguments: + $this->assertGreaterThan(60, count($lines)); + + // Check that the response has the correct value: + $this->assertEquals('Stack trace:', $lines[1]); + + // Check that the trace is returned: + $this->assertEquals( + sprintf( + '%3d. %s->%s() %s:%d', + 2, + 'Whoops\Handler\PlainTextHandlerTest', + 'getException', + __FILE__, + 62 + ), + $lines[8] + ); + // Check that the trace arguments are returned: + $this->assertEquals(sprintf( + '%s string(%d) "%s"', + PlainTextHandler::VAR_DUMP_PREFIX, + strlen('test message'), + 'test message' + ), $lines[5] + ); + } + + /** + * @covers Whoops\Handler\PlainTextHandler::addTraceToOutput + * @covers Whoops\Handler\PlainTextHandler::addTraceFunctionArgsToOutput + * @covers Whoops\Handler\PlainTextHandler::getTraceOutput + * @covers Whoops\Handler\PlainTextHandler::getFrameArgsOutput + * @covers Whoops\Handler\PlainTextHandler::canProcess + * @covers Whoops\Handler\PlainTextHandler::canOutput + * @covers Whoops\Handler\PlainTextHandler::handle + */ + public function testReturnsWithFramesAndLimitedArgsOutput() + { + $text = $this->getPlainTextFromHandler( + $withTrace = true, + $withTraceArgs = 3, + $traceFunctionArgsOutputLimit = 1024, + $loggerOnly = false, + $onlyForCommandLine = false, + $outputOnlyIfCommandLine = true + ); + + $lines = explode("\n", $text); + + // Check that the trace is returned with limited level of arguments: + $this->assertCount(41, $lines); + + // Check that the response has the correct value: + $this->assertEquals('Stack trace:', $lines[1]); + + // Check that the trace is returned: + $this->assertEquals( + sprintf( + '%3d. %s->%s() %s:%d', + 2, + 'Whoops\Handler\PlainTextHandlerTest', + 'getException', + __FILE__, + 62 + ), + $lines[8] + ); + + // Check that the trace arguments are returned: + $this->assertEquals(sprintf( + '%s string(%d) "%s"', + PlainTextHandler::VAR_DUMP_PREFIX, + strlen('test message'), + 'test message' + ), $lines[5] + ); + } + + /** + * @covers Whoops\Handler\PlainTextHandler::loggerOnly + * @covers Whoops\Handler\PlainTextHandler::canProcess + * @covers Whoops\Handler\PlainTextHandler::handle + */ + public function testReturnsWithLoggerOnlyOutput() + { + $text = $this->getPlainTextFromHandler( + $withTrace = true, + $withTraceArgs = true, + $traceFunctionArgsOutputLimit = 1024, + $loggerOnly = true, + $onlyForCommandLine = false, + $outputOnlyIfCommandLine = true + ); + // Check that the response has the correct value: + $this->assertEquals('', $text); + } +} diff --git a/vendor/filp/whoops/tests/Whoops/Handler/SoapResponseHandlerTest.php b/vendor/filp/whoops/tests/Whoops/Handler/SoapResponseHandlerTest.php index 45dfba0581..9264d7a277 100644 --- a/vendor/filp/whoops/tests/Whoops/Handler/SoapResponseHandlerTest.php +++ b/vendor/filp/whoops/tests/Whoops/Handler/SoapResponseHandlerTest.php @@ -62,7 +62,7 @@ class SoapResponseHandlerTest extends TestCase /** * See if passed string is a valid XML document * @param string $data - * @return boolean + * @return bool */ private function isValidXml($data) { diff --git a/vendor/filp/whoops/tests/Whoops/Handler/XmlResponseHandlerTest.php b/vendor/filp/whoops/tests/Whoops/Handler/XmlResponseHandlerTest.php index 91dec35a5f..8fc5cdc0d6 100644 --- a/vendor/filp/whoops/tests/Whoops/Handler/XmlResponseHandlerTest.php +++ b/vendor/filp/whoops/tests/Whoops/Handler/XmlResponseHandlerTest.php @@ -70,7 +70,7 @@ class XmlResponseHandlerTest extends TestCase /** * See if passed string is a valid XML document * @param string $data - * @return boolean + * @return bool */ private function isValidXml($data) { diff --git a/vendor/gedmo/doctrine-extensions/composer.json b/vendor/gedmo/doctrine-extensions/composer.json index 4a93a80f0f..e38c0d751f 100644 --- a/vendor/gedmo/doctrine-extensions/composer.json +++ b/vendor/gedmo/doctrine-extensions/composer.json @@ -41,7 +41,7 @@ }, "require": { "php": ">=5.3.2", - "doctrine/common": "~2.2" + "doctrine/common": ">=2.2,<2.5-dev" }, "require-dev": { "doctrine/mongodb": ">=1.0.3", diff --git a/vendor/gedmo/doctrine-extensions/doc/sluggable.md b/vendor/gedmo/doctrine-extensions/doc/sluggable.md index 5aa323dd83..2503c2fc2d 100644 --- a/vendor/gedmo/doctrine-extensions/doc/sluggable.md +++ b/vendor/gedmo/doctrine-extensions/doc/sluggable.md @@ -12,6 +12,9 @@ Features: - Annotation, Yaml and Xml mapping support for extensions - Multiple slugs, different slugs can link to same fields +[blog_reference]: http://gediminasm.org/article/sluggable-behavior-extension-for-doctrine-2 "Sluggable extension for Doctrine 2 makes automatic record field transformations into url friendly names" +[blog_test]: http://gediminasm.org/test "Test extensions on this blog" + Update **2013-10-26** - Datetime support with default dateFormat Y-m-d-H:i @@ -58,11 +61,9 @@ no more exceptions during concurrent flushes. - There is a reported [issue](https://github.com/l3pp4rd/DoctrineExtensions/issues/254) that sluggable transliterator does not work on OSX 10.6 its ok starting again from 10.7 version. To overcome the problem you can use your [custom transliterator](#transliterator) +- You can [test live][blog_test] on this blog - Public [Sluggable repository](http://github.com/l3pp4rd/DoctrineExtensions "Sluggable extension on Github") is available on github - Last update date: **2012-02-26** -- For usage together with **SoftDeleteable** in order to take into account softdeleted entities while generating unique -slug, you must explicitly call **addManagedFilter** with a name of softdeleteable filter, so it can be disabled during -slug updates. The best place to do it, is when initializing sluggable listener. That will be automated in the future. **Portability:** diff --git a/vendor/gedmo/doctrine-extensions/doc/softdeleteable.md b/vendor/gedmo/doctrine-extensions/doc/softdeleteable.md index 5faad37194..f07485c0c4 100644 --- a/vendor/gedmo/doctrine-extensions/doc/softdeleteable.md +++ b/vendor/gedmo/doctrine-extensions/doc/softdeleteable.md @@ -12,6 +12,9 @@ Features: - Annotation, Yaml and Xml mapping support for extensions - Support for 'timeAware' option: When creating an entity set a date of deletion in the future and never worry about cleaning up at expiration time. +[blog_reference]: http://gediminasm.org/article/tree-nestedset-behavior-extension-for-doctrine-2 "Softdeleteable - does not explicitly remove record entries from the database, instead it marks those as deleted and skips in selection queries" +[blog_test]: http://gediminasm.org/test "Test extensions on this blog" + Content: - [Including](#including-extension) the extension @@ -51,9 +54,6 @@ $em->getFilters()->enable('soft-deleteable'); $em->getFilters()->disable('soft-deleteable'); ``` -**NOTE:** by default all filters are disabled, so you must explicitly enable **soft-deleteable** filter in your setup -or whenever you need it. - ## SoftDeleteable Entity example: @@ -67,9 +67,9 @@ Available configuration options: - **fieldName** - The name of the field that will be used to determine if the object is removed or not (NULL means it's not removed. A date value means it was removed). NOTE: The field MUST be nullable. -**Note:** that SoftDeleteable interface is not necessary, except in cases where +**Note:** that SoftDeleteable interface is not necessary, except in cases there you need to identify entity as being SoftDeleteable. The metadata is loaded only once then -cache is activated. +cache is activated ``` php =5.3.2", - "symfony/symfony": ">=2.0.9,<2.1.0-dev", - "doctrine/orm": ">=2.1.0,<2.2.0-dev", - "twig/extensions": "*", - - "symfony/assetic-bundle": "*", - "sensio/generator-bundle": "2.0.*", - "sensio/framework-extra-bundle": "2.0.*", - "sensio/distribution-bundle": "2.0.*", - "jms/security-extra-bundle": "1.0.*", - "gedmo/doctrine-extensions": "dev-master" - }, - - "autoload": { - "psr-0": { - "Acme": "src/" + { + "require": { + "php": ">=5.3.2", + "symfony/symfony": ">=2.0.9,<2.1.0-dev", + "doctrine/orm": ">=2.1.0,<2.2.0-dev", + "twig/extensions": "*", + + "symfony/assetic-bundle": "*", + "sensio/generator-bundle": "2.0.*", + "sensio/framework-extra-bundle": "2.0.*", + "sensio/distribution-bundle": "2.0.*", + "jms/security-extra-bundle": "1.0.*", + "gedmo/doctrine-extensions": "dev-master" + }, + + "autoload": { + "psr-0": { + "Acme": "src/" + } } } -} -``` Update vendors, run: **php composer.phar update gedmo/doctrine-extensions** Initially in this package you have **doctrine2 orm** included, so we will base our setup @@ -71,32 +69,29 @@ Lets start from the mapping, in case if you use **translatable**, **tree** or ** extension you will need to map those abstract mappedsuperclasses for you ORM to be aware of. To do so, add some mapping info to your **doctrine.orm** configuration, edit **app/config/config.yml**: -```yaml -doctrine: - dbal: -# your dbal config here - - orm: - auto_generate_proxy_classes: %kernel.debug% - auto_mapping: true -# only these lines are added additionally - mappings: - translatable: - type: annotation - alias: Gedmo - prefix: Gedmo\Translatable\Entity - # make sure vendor library location is correct - dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity" -``` + doctrine: + dbal: + # your dbal config here + + orm: + auto_generate_proxy_classes: %kernel.debug% + auto_mapping: true + # only these lines are added additionally + mappings: + translatable: + type: annotation + alias: Gedmo + prefix: Gedmo\Translatable\Entity + # make sure vendor library location is correct + dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity" After that, running **php app/console doctrine:mapping:info** you should see the output: -``` -Found 3 entities mapped in entity manager default: -[OK] Gedmo\Translatable\Entity\MappedSuperclass\AbstractPersonalTranslation -[OK] Gedmo\Translatable\Entity\MappedSuperclass\AbstractTranslation -[OK] Gedmo\Translatable\Entity\Translation -``` + Found 3 entities mapped in entity manager default: + [OK] Gedmo\Translatable\Entity\MappedSuperclass\AbstractPersonalTranslation + [OK] Gedmo\Translatable\Entity\MappedSuperclass\AbstractTranslation + [OK] Gedmo\Translatable\Entity\Translation + Well we mapped only **translatable** for now, it really depends on your needs, which extensions your application uses. @@ -104,52 +99,46 @@ your application uses. if you create doctrine schema, it will add **ext_translations** table, which might not be useful to you also. To skip mapping of these entities, you can map **only superclasses** -```yaml -mappings: - translatable: - type: annotation - alias: Gedmo - prefix: Gedmo\Translatable\Entity - # make sure vendor library location is correct - dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity/MappedSuperclass" -``` + mappings: + translatable: + type: annotation + alias: Gedmo + prefix: Gedmo\Translatable\Entity + # make sure vendor library location is correct + dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity/MappedSuperclass" The configuration above, adds a **/MappedSuperclass** into directory depth, after running **php app/console doctrine:mapping:info** you should only see now: -``` -Found 2 entities mapped in entity manager default: -[OK] Gedmo\Translatable\Entity\MappedSuperclass\AbstractPersonalTranslation -[OK] Gedmo\Translatable\Entity\MappedSuperclass\AbstractTranslation -``` + Found 2 entities mapped in entity manager default: + [OK] Gedmo\Translatable\Entity\MappedSuperclass\AbstractPersonalTranslation + [OK] Gedmo\Translatable\Entity\MappedSuperclass\AbstractTranslation This is very useful for advanced requirements and quite simple to understand. So lets map now everything extensions provide: -```yaml -# only orm config branch of doctrine -orm: - auto_generate_proxy_classes: %kernel.debug% - auto_mapping: true -# only these lines are added additionally - mappings: - translatable: - type: annotation - alias: Gedmo - prefix: Gedmo\Translatable\Entity - # make sure vendor library location is correct - dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity" - loggable: - type: annotation - alias: Gedmo - prefix: Gedmo\Loggable\Entity - dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/Entity" - tree: - type: annotation - alias: Gedmo - prefix: Gedmo\Tree\Entity - dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity" -``` + # only orm config branch of doctrine + orm: + auto_generate_proxy_classes: %kernel.debug% + auto_mapping: true + # only these lines are added additionally + mappings: + translatable: + type: annotation + alias: Gedmo + prefix: Gedmo\Translatable\Entity + # make sure vendor library location is correct + dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity" + loggable: + type: annotation + alias: Gedmo + prefix: Gedmo\Loggable\Entity + dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/Entity" + tree: + type: annotation + alias: Gedmo + prefix: Gedmo\Tree\Entity + dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity" @@ -159,67 +148,65 @@ Next, the heart of extensions are behavioral listeners which pours all the sugar create a **yml** service file in our config directory. The setup can be different and located in the bundle, it depends what you prefer, edit **app/config/doctrine_extensions.yml** -```yaml -# services to handle doctrine extensions -# import it in config.yml -services: - # KernelRequest listener - extension.listener: - class: Acme\DemoBundle\Listener\DoctrineExtensionListener - calls: - - [ setContainer, [ @service_container ] ] - tags: - # translatable sets locale after router processing - - { name: kernel.event_listener, event: kernel.request, method: onLateKernelRequest, priority: -10 } - # loggable hooks user username if one is in security context - - { name: kernel.event_listener, event: kernel.request, method: onKernelRequest } - - - # Doctrine Extension listeners to handle behaviors - gedmo.listener.tree: - class: Gedmo\Tree\TreeListener - tags: - - { name: doctrine.event_subscriber, connection: default } - calls: - - [ setAnnotationReader, [ @annotation_reader ] ] - - gedmo.listener.translatable: - class: Gedmo\Translatable\TranslatableListener - tags: - - { name: doctrine.event_subscriber, connection: default } - calls: - - [ setAnnotationReader, [ @annotation_reader ] ] - - [ setDefaultLocale, [ %locale% ] ] - - [ setTranslationFallback, [ false ] ] - - gedmo.listener.timestampable: - class: Gedmo\Timestampable\TimestampableListener - tags: - - { name: doctrine.event_subscriber, connection: default } - calls: - - [ setAnnotationReader, [ @annotation_reader ] ] + # services to handle doctrine extensions + # import it in config.yml + services: + # KernelRequest listener + extension.listener: + class: Acme\DemoBundle\Listener\DoctrineExtensionListener + calls: + - [ setContainer, [ @service_container ] ] + tags: + # translatable sets locale after router processing + - { name: kernel.event_listener, event: kernel.request, method: onLateKernelRequest, priority: -10 } + # loggable hooks user username if one is in security context + - { name: kernel.event_listener, event: kernel.request, method: onKernelRequest } - gedmo.listener.sluggable: - class: Gedmo\Sluggable\SluggableListener - tags: - - { name: doctrine.event_subscriber, connection: default } - calls: - - [ setAnnotationReader, [ @annotation_reader ] ] - gedmo.listener.sortable: - class: Gedmo\Sortable\SortableListener - tags: - - { name: doctrine.event_subscriber, connection: default } - calls: - - [ setAnnotationReader, [ @annotation_reader ] ] - - gedmo.listener.loggable: - class: Gedmo\Loggable\LoggableListener - tags: - - { name: doctrine.event_subscriber, connection: default } - calls: - - [ setAnnotationReader, [ @annotation_reader ] ] -``` + # Doctrine Extension listeners to handle behaviors + gedmo.listener.tree: + class: Gedmo\Tree\TreeListener + tags: + - { name: doctrine.event_subscriber, connection: default } + calls: + - [ setAnnotationReader, [ @annotation_reader ] ] + + gedmo.listener.translatable: + class: Gedmo\Translatable\TranslatableListener + tags: + - { name: doctrine.event_subscriber, connection: default } + calls: + - [ setAnnotationReader, [ @annotation_reader ] ] + - [ setDefaultLocale, [ %locale% ] ] + - [ setTranslationFallback, [ false ] ] + + gedmo.listener.timestampable: + class: Gedmo\Timestampable\TimestampableListener + tags: + - { name: doctrine.event_subscriber, connection: default } + calls: + - [ setAnnotationReader, [ @annotation_reader ] ] + + gedmo.listener.sluggable: + class: Gedmo\Sluggable\SluggableListener + tags: + - { name: doctrine.event_subscriber, connection: default } + calls: + - [ setAnnotationReader, [ @annotation_reader ] ] + + gedmo.listener.sortable: + class: Gedmo\Sortable\SortableListener + tags: + - { name: doctrine.event_subscriber, connection: default } + calls: + - [ setAnnotationReader, [ @annotation_reader ] ] + + gedmo.listener.loggable: + class: Gedmo\Loggable\LoggableListener + tags: + - { name: doctrine.event_subscriber, connection: default } + calls: + - [ setAnnotationReader, [ @annotation_reader ] ] So what it includes in general? Well it creates services for all extension listeners. You can remove some which you do not use or change at will. **Translatable** for instance, @@ -230,56 +217,53 @@ you will need to create this listener class if you use **loggable** or **transla behaviors. This listener will set the **locale used** from request and **username** to loggable. So, to finish the setup create **Acme\DemoBundle\Listener\DoctrineExtensionListener** -```php -container = $container; - } - - public function onLateKernelRequest(GetResponseEvent $event) - { - $translatable = $this->container->get('gedmo.listener.translatable'); - $translatable->setTranslatableLocale($event->getRequest()->getLocale()); - } - - public function onKernelRequest(GetResponseEvent $event) + container->get('security.context', ContainerInterface::NULL_ON_INVALID_REFERENCE); - if (null !== $securityContext && null !== $securityContext->getToken() && $securityContext->isGranted('IS_AUTHENTICATED_REMEMBERED')) { - $loggable = $this->container->get('gedmo.listener.loggable'); - $loggable->setUsername($securityContext->getToken()->getUsername()); + /** + * @var ContainerInterface + */ + protected $container; + + public function setContainer(ContainerInterface $container = null) + { + $this->container = $container; + } + + public function onLateKernelRequest(GetResponseEvent $event) + { + $translatable = $this->container->get('gedmo.listener.translatable'); + $translatable->setTranslatableLocale($event->getRequest()->getLocale()); + } + + public function onKernelRequest(GetResponseEvent $event) + { + $securityContext = $this->container->get('security.context', ContainerInterface::NULL_ON_INVALID_REFERENCE); + if (null !== $securityContext && null !== $securityContext->getToken() && $securityContext->isGranted('IS_AUTHENTICATED_REMEMBERED')) { + $loggable = $this->container->get('gedmo.listener.loggable'); + $loggable->setUsername($securityContext->getToken()->getUsername()); + } } } -} -``` -Do not forget to import **doctrine_extensions.yml** in your **app/config/config.yml** etc.: -```yaml -# file: app/config/config.yml -imports: - - { resource: parameters.yml } - - { resource: security.yml } - - { resource: doctrine_extensions.yml } +Do not forget to import **doctrine_extensions.yml** in your **app/config/config.yml** etc.: -# ... configuration follows -``` + # file: app/config/config.yml + imports: + - { resource: parameters.yml } + - { resource: security.yml } + - { resource: doctrine_extensions.yml } + + # ... configuration follows @@ -288,72 +272,70 @@ imports: Well after that, you have your extensions setup and ready to be used! Too easy right? Well if you do not believe me, lets create a simple entity in our **Acme** project: -```php -id; - } - - public function setTitle($title) + class BlogPost { - $this->title = $title; - } - - public function getTitle() - { - return $this->title; - } - - public function getCreated() - { - return $this->created; - } - - public function getUpdated() - { - return $this->updated; + /** + * @Gedmo\Slug(fields={"title"}, updatable=false, separator="_") + * @ORM\Id + * @ORM\Column(length=32, unique=true) + */ + private $id; + + /** + * @Gedmo\Translatable + * @ORM\Column(length=64) + */ + private $title; + + /** + * @Gedmo\Timestampable(on="create") + * @ORM\Column(name="created", type="datetime") + */ + private $created; + + /** + * @ORM\Column(name="updated", type="datetime") + * @Gedmo\Timestampable(on="update") + */ + private $updated; + + public function getId() + { + return $this->id; + } + + public function setTitle($title) + { + $this->title = $title; + } + + public function getTitle() + { + return $this->title; + } + + public function getCreated() + { + return $this->created; + } + + public function getUpdated() + { + return $this->updated; + } } -} -``` Now, lets have some fun: @@ -363,36 +345,34 @@ Now, lets have some fun: Well, everything will work just fine, you can modify the **Acme\DemoBundle\Controller\DemoController** and add an action to test how it works: -```php -// file: src/Acme/DemoBundle/Controller/DemoController.php -// include this code portion - -/** - * @Route("/posts", name="_demo_posts") - */ -public function postsAction() -{ - $em = $this->getDoctrine()->getEntityManager(); - $repository = $em->getRepository('AcmeDemoBundle:BlogPost'); - // create some posts in case if there aren't any - if (!$repository->findOneById('hello_world')) { - $post = new \Acme\DemoBundle\Entity\BlogPost(); - $post->setTitle('Hello world'); - - $next = new \Acme\DemoBundle\Entity\BlogPost(); - $next->setTitle('Doctrine extensions'); - - $em->persist($post); - $em->persist($next); - $em->flush(); + // file: src/Acme/DemoBundle/Controller/DemoController.php + // include this code portion + + /** + * @Route("/posts", name="_demo_posts") + */ + public function postsAction() + { + $em = $this->getDoctrine()->getEntityManager(); + $repository = $em->getRepository('AcmeDemoBundle:BlogPost'); + // create some posts in case if there aren't any + if (!$repository->findOneById('hello_world')) { + $post = new \Acme\DemoBundle\Entity\BlogPost(); + $post->setTitle('Hello world'); + + $next = new \Acme\DemoBundle\Entity\BlogPost(); + $next->setTitle('Doctrine extensions'); + + $em->persist($post); + $em->persist($next); + $em->flush(); + } + $posts = $em + ->createQuery('SELECT p FROM AcmeDemoBundle:BlogPost p') + ->getArrayResult() + ; + die(var_dump($posts)); } - $posts = $em - ->createQuery('SELECT p FROM AcmeDemoBundle:BlogPost p') - ->getArrayResult() - ; - die(var_dump($posts)); -} -``` Now if you follow the url: **http://your_virtual_host/app_dev.php/demo/posts** you should see a print of posts, this is only an extension demo, we will not create template. @@ -411,42 +391,38 @@ curtains and allows you to modify the configuration as you require. If you use more than one entity manager, you can simply tag the listener with other manager name: -```yaml -services: - # tree behavior - gedmo.listener.tree: - class: Gedmo\Tree\TreeListener - tags: - - { name: doctrine.event_subscriber, connection: default } - # additional ORM subscriber - - { name: doctrine.event_subscriber, connection: other_connection } - # ODM MongoDb subscriber, where **default** is manager name - - { name: doctrine_mongodb.odm.event_subscriber } - calls: - - [ setAnnotationReader, [ @annotation_reader ] ] -``` + services: + # tree behavior + gedmo.listener.tree: + class: Gedmo\Tree\TreeListener + tags: + - { name: doctrine.event_subscriber, connection: default } + # additional ORM subscriber + - { name: doctrine.event_subscriber, connection: other_connection } + # ODM MongoDb subscriber, where **default** is manager name + - { name: doctrine_mongodb.odm.event_subscriber } + calls: + - [ setAnnotationReader, [ @annotation_reader ] ] Well regarding, mapping of ODM mongodb, its basically the same: -```yaml -doctrine_mongodb: - default_database: 'my_database' - default_connection: 'default' - default_document_manager: 'default' - connections: - default: ~ - document_managers: - default: - connection: 'default' - auto_mapping: true - mappings: - translatable: - type: annotation - alias: GedmoDocument - prefix: Gedmo\Translatable\Document - # make sure vendor library location is correct - dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Document" -``` + doctrine_mongodb: + default_database: 'my_database' + default_connection: 'default' + default_document_manager: 'default' + connections: + default: ~ + document_managers: + default: + connection: 'default' + auto_mapping: true + mappings: + translatable: + type: annotation + alias: GedmoDocument + prefix: Gedmo\Translatable\Document + # make sure vendor library location is correct + dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Document" This also shows, how to make mappings based on single manager. All what differs is **Document** instead of **Entity** used. Haven't tested it with mongo though. diff --git a/vendor/gedmo/doctrine-extensions/doc/timestampable.md b/vendor/gedmo/doctrine-extensions/doc/timestampable.md index 1a32244894..7890932710 100644 --- a/vendor/gedmo/doctrine-extensions/doc/timestampable.md +++ b/vendor/gedmo/doctrine-extensions/doc/timestampable.md @@ -76,7 +76,7 @@ should be updated - **field** - only valid if **on="change"** is specified, tracks property or a list of properties for changes - **value** - only valid if **on="change"** is specified and the tracked field is a single field (not an array), if the tracked field has this **value** -**Note:** that Timestampable interface is not necessary, except in cases where +**Note:** that Timestampable interface is not necessary, except in cases there you need to identify entity as being Timestampable. The metadata is loaded only once then cache is activated diff --git a/vendor/gedmo/doctrine-extensions/doc/transaction-safety.md b/vendor/gedmo/doctrine-extensions/doc/transaction-safety.md index 864c58d07c..42889b4739 100644 --- a/vendor/gedmo/doctrine-extensions/doc/transaction-safety.md +++ b/vendor/gedmo/doctrine-extensions/doc/transaction-safety.md @@ -23,7 +23,7 @@ begin the second one which in turn would lock the third one if there would be an **NOTE:** it is not enough to simply have a transaction. -So how we can achieve this? The simplest solution is [pessimistic locking](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/transactions-and-concurrency.html#pessimistic-locking) which is supported by ORM. +So how we can achieve this? The simplest solution is [pesimistic locking](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/transactions-and-concurrency.html#pessimistic-locking) which is supported by ORM. So how we can use it correctly to maintain our transactions safe from one another. Lets say we have two entity types in our application: @@ -222,7 +222,7 @@ class CategoryController extends Controller You may separate locking transaction to run callback function and make it as a service to abstract and prevent code duplication. Anyway, my advice would be to use only one transaction per request and best inside controller -directly, where you would ensure that all operations performed during the action can be safely rolled back. +dirrectly, where you would ensure that all operations performed during the action can be safelly rolled back. Also to use this kind of locking, you need an entity which is necessary to read on concurrent request which attempts to update the same tree. In this example, **Shop** entity fits the bill perfectly. Otherwise you need to find a way to diff --git a/vendor/gedmo/doctrine-extensions/doc/tree.md b/vendor/gedmo/doctrine-extensions/doc/tree.md index 6b53891d8d..1f211bba6f 100644 --- a/vendor/gedmo/doctrine-extensions/doc/tree.md +++ b/vendor/gedmo/doctrine-extensions/doc/tree.md @@ -282,7 +282,7 @@ Entity\Category: - + diff --git a/vendor/gedmo/doctrine-extensions/doc/uploadable.md b/vendor/gedmo/doctrine-extensions/doc/uploadable.md index 7893e9e13a..8083f6342c 100644 --- a/vendor/gedmo/doctrine-extensions/doc/uploadable.md +++ b/vendor/gedmo/doctrine-extensions/doc/uploadable.md @@ -1,6 +1,6 @@ # Uploadable behavior extension for Doctrine 2 -**Uploadable** behavior provides the tools to manage the persistence of files with +**Uploadable** behavior provides the tools to manage the persistance of files with Doctrine 2, including automatic handling of moving, renaming and removal of files and other features. Features: diff --git a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/Document/Repository/LogEntryRepository.php b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/Document/Repository/LogEntryRepository.php index 3c94e7258b..2802048739 100644 --- a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/Document/Repository/LogEntryRepository.php +++ b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/Document/Repository/LogEntryRepository.php @@ -97,10 +97,10 @@ class LogEntryRepository extends DocumentRepository $filled = count($fields) === 0; } /*if (count($fields)) { - throw new \Gedmo\Exception\UnexpectedValueException('Could not fully revert the document to version: '.$version); + throw new \Gedmo\Exception\UnexpectedValueException('Cound not fully revert the document to version: '.$version); }*/ } else { - throw new \Gedmo\Exception\UnexpectedValueException('Could not find any log entries under version: '.$version); + throw new \Gedmo\Exception\UnexpectedValueException('Count not find any log entries under version: '.$version); } } diff --git a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/LoggableListener.php b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/LoggableListener.php index bfe14f5bb3..2baa209921 100644 --- a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/LoggableListener.php +++ b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/LoggableListener.php @@ -101,7 +101,7 @@ class LoggableListener extends MappedEventSubscriber } /** - * Maps additional metadata + * Mapps additional metadata * * @param EventArgs $eventArgs * @return void @@ -209,7 +209,7 @@ class LoggableListener extends MappedEventSubscriber * @param string $action * @param object $object * @param LoggableAdapter $ea - * @return \Gedmo\Loggable\Entity\MappedSuperclass\AbstractLogEntry|null + * @return void */ protected function createLogEntry($action, $object, LoggableAdapter $ea) { @@ -257,8 +257,8 @@ class LoggableListener extends MappedEventSubscriber $logEntry->setData($newValues); } - if ($action === self::ACTION_UPDATE && 0 === count($newValues)) { - return null; + if($action === self::ACTION_UPDATE && 0 === count($newValues)) { + return; } $version = 1; @@ -275,9 +275,6 @@ class LoggableListener extends MappedEventSubscriber $om->persist($logEntry); $uow->computeChangeSet($logEntryMeta, $logEntry); - - return $logEntry; } - return null; } } diff --git a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Mapping/MappedEventSubscriber.php b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Mapping/MappedEventSubscriber.php index 74d572c469..dfa50dc16c 100644 --- a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Mapping/MappedEventSubscriber.php +++ b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Mapping/MappedEventSubscriber.php @@ -16,7 +16,7 @@ use Doctrine\Common\EventArgs; * mapping for extensions. * * It dries up some reusable code which is common for - * all extensions who maps additional metadata through + * all extensions who mapps additional metadata through * extended drivers * * @author Gediminas Morkevicius diff --git a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/Mapping/Driver/Yaml.php b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/Mapping/Driver/Yaml.php index a28385e4a2..bcd2e65700 100644 --- a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/Mapping/Driver/Yaml.php +++ b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/Mapping/Driver/Yaml.php @@ -82,7 +82,7 @@ class Yaml extends File implements Driver (string)$slug['style'] : 'default'; $config['slugs'][$field]['dateFormat'] = isset($slug['dateFormat']) ? - (string)$slug['dateFormat'] : 'Y-m-d-H:i'; + (bool)$slug['dateFormat'] : 'Y-m-d-H:i'; $config['slugs'][$field]['updatable'] = isset($slug['updatable']) ? (bool)$slug['updatable'] : true; diff --git a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/Mapping/Event/Adapter/ODM.php b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/Mapping/Event/Adapter/ODM.php index e517880169..e75679d4d1 100644 --- a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/Mapping/Event/Adapter/ODM.php +++ b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/Mapping/Event/Adapter/ODM.php @@ -87,8 +87,8 @@ final class ODM extends BaseAdapterODM implements SluggableAdapter } /** - * This query can cause some data integrity failures since it does not - * execute atomically + * This query can couse some data integrity failures since it does not + * execute atomicaly * * {@inheritDoc} */ diff --git a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/Mapping/Event/Adapter/ORM.php b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/Mapping/Event/Adapter/ORM.php index d1af9f56f4..9d6d8a6496 100644 --- a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/Mapping/Event/Adapter/ORM.php +++ b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/Mapping/Event/Adapter/ORM.php @@ -28,10 +28,9 @@ class ORM extends BaseAdapterORM implements SluggableAdapter ->from($config['useObjectClass'], 'rec') ->where($qb->expr()->like( 'rec.' . $config['slug'], - ':slug') + $qb->expr()->literal($slug . '%')) ) ; - $qb->setParameter('slug',$slug . '%'); // use the unique_base to restrict the uniqueness check if ($config['unique'] && isset($config['unique_base'])) { diff --git a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/SluggableListener.php b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/SluggableListener.php index f496f28f9a..5ee368c81b 100644 --- a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/SluggableListener.php +++ b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Sluggable/SluggableListener.php @@ -204,7 +204,7 @@ class SluggableListener extends MappedEventSubscriber // process all objects being inserted, using scheduled insertions instead // of prePersist in case if record will be changed before flushing this will - // ensure correct result. No additional overhead is encountered + // ensure correct result. No additional overhead is encoutered foreach ($ea->getScheduledObjectInsertions($uow) as $object) { $meta = $om->getClassMetadata(get_class($object)); if ($config = $this->getConfiguration($om, $meta->name)) { diff --git a/vendor/gedmo/doctrine-extensions/lib/Gedmo/SoftDeleteable/SoftDeleteableListener.php b/vendor/gedmo/doctrine-extensions/lib/Gedmo/SoftDeleteable/SoftDeleteableListener.php index 720c24063e..6161857bc1 100755 --- a/vendor/gedmo/doctrine-extensions/lib/Gedmo/SoftDeleteable/SoftDeleteableListener.php +++ b/vendor/gedmo/doctrine-extensions/lib/Gedmo/SoftDeleteable/SoftDeleteableListener.php @@ -93,7 +93,7 @@ class SoftDeleteableListener extends MappedEventSubscriber } /** - * Maps additional metadata + * Mapps additional metadata * * @param EventArgs $eventArgs * @return void diff --git a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Timestampable/Traits/TimestampableDocument.php b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Timestampable/Traits/TimestampableDocument.php index 60da33ab16..625a8b19eb 100644 --- a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Timestampable/Traits/TimestampableDocument.php +++ b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Timestampable/Traits/TimestampableDocument.php @@ -25,7 +25,7 @@ trait TimestampableDocument /** * Sets createdAt. * - * @param \Datetime $createdAt + * @param Datetime $createdAt * @return $this */ public function setCreatedAt(\DateTime $createdAt) @@ -38,7 +38,7 @@ trait TimestampableDocument /** * Returns createdAt. * - * @return \DateTime + * @return DateTime */ public function getCreatedAt() { @@ -48,7 +48,7 @@ trait TimestampableDocument /** * Sets updatedAt. * - * @param \DateTime $updatedAt + * @param DateTime $updatedAt * @return $this */ public function setUpdatedAt(\DateTime $updatedAt) @@ -61,7 +61,7 @@ trait TimestampableDocument /** * Returns updatedAt. * - * @return \Datetime + * @return Datetime */ public function getUpdatedAt() { diff --git a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Document/Repository/TranslationRepository.php b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Document/Repository/TranslationRepository.php index 65759471a1..6e546498d2 100644 --- a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Document/Repository/TranslationRepository.php +++ b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Document/Repository/TranslationRepository.php @@ -132,7 +132,7 @@ class TranslationRepository extends DocumentRepository /** * Find the object $class by the translated field. - * Result is the first occurrence of translated field. + * Result is the first occurence of translated field. * Query can be slow, since there are no indexes on such * columns * diff --git a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity/Repository/TranslationRepository.php b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity/Repository/TranslationRepository.php index 459cd1d45c..16c41968ff 100644 --- a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity/Repository/TranslationRepository.php +++ b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity/Repository/TranslationRepository.php @@ -138,7 +138,7 @@ class TranslationRepository extends EntityRepository /** * Find the entity $class by the translated field. - * Result is the first occurrence of translated field. + * Result is the first occurence of translated field. * Query can be slow, since there are no indexes on such * columns * diff --git a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/TranslatableListener.php b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/TranslatableListener.php index 4495516f5f..4fa0ae40de 100644 --- a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/TranslatableListener.php +++ b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/TranslatableListener.php @@ -447,7 +447,7 @@ class TranslatableListener extends MappedEventSubscriber return; } - if (isset($config['fields']) && ($locale !== $this->defaultLocale || $this->persistDefaultLocaleTranslation)) { + if (isset($config['fields']) && $locale !== $this->defaultLocale) { // fetch translations $translationClass = $this->getTranslationClass($ea, $config['useObjectClass']); $result = $ea->loadTranslations( @@ -566,7 +566,7 @@ class TranslatableListener extends MappedEventSubscriber } } } - // check if translation already is created + // check if translation allready is created if (!$isInsert && !$translation) { $translation = $ea->findTranslation( $wrapped, diff --git a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity/Repository/NestedTreeRepository.php b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity/Repository/NestedTreeRepository.php index bc840ed5d4..4d28c58f3f 100644 --- a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity/Repository/NestedTreeRepository.php +++ b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity/Repository/NestedTreeRepository.php @@ -581,7 +581,7 @@ class NestedTreeRepository extends AbstractTreeRepository } /** - * UNSAFE: be sure to backup before running this method when necessary + * UNSAFE: be sure to backup before runing this method when necessary * * Removes given $node from the tree and reparents its descendants * diff --git a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Strategy/ORM/Closure.php b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Strategy/ORM/Closure.php index 478d30b16f..3d216678c5 100644 --- a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Strategy/ORM/Closure.php +++ b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Strategy/ORM/Closure.php @@ -149,7 +149,7 @@ class Closure implements Strategy $this->getJoinColumnFieldName($em->getClassMetadata($config['closure'])->getAssociationMapping('descendant')) ) ); - // this one may not be very useful + // this one may not be very usefull $indexName = substr(strtoupper("IDX_" . md5($meta->name . 'depth')), 0, 20); $closureMetadata->table['indexes'][$indexName] = array( 'columns' => array('depth') diff --git a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Strategy/ORM/Nested.php b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Strategy/ORM/Nested.php index 9fb9ddceb7..18fc73980a 100644 --- a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Strategy/ORM/Nested.php +++ b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Strategy/ORM/Nested.php @@ -140,7 +140,7 @@ class Nested implements Strategy $changeSet = $uow->getEntityChangeSet($node); if (isset($config['root']) && isset($changeSet[$config['root']])) { - throw new \Gedmo\Exception\UnexpectedValueException("Root cannot be changed manually, change parent instead"); + throw new \Gedmo\Exception\UnexpectedValueException("Root cannot be changed manualy, change parent instead"); } $oid = spl_object_hash($node); @@ -551,7 +551,7 @@ class Nested implements Strategy /** * Shift range of right and left values on tree - * depending on tree level difference also + * depending on tree level diference also * * @param EntityManager $em * @param string $class diff --git a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Traits/NestedSetEntity.php b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Traits/NestedSetEntity.php deleted file mode 100644 index 19eaec1c51..0000000000 --- a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Traits/NestedSetEntity.php +++ /dev/null @@ -1,38 +0,0 @@ -= 5.4 - * - * @author Renaat De Muynck - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) - */ -trait NestedSetEntity -{ - - /** - * @Gedmo\TreeRoot - * @ORM\Column(name="root", type="integer", nullable=true) - */ - private $root; - - /** - * @Gedmo\TreeLevel - * @ORM\Column(name="lvl", type="integer") - */ - private $level; - - /** - * @Gedmo\TreeLeft - * @ORM\Column(name="lft", type="integer") - */ - private $left; - - /** - * @Gedmo\TreeRight - * @ORM\Column(name="rgt", type="integer") - */ - private $right; - -} diff --git a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Uploadable/Mapping/Validator.php b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Uploadable/Mapping/Validator.php index 67ba2805ba..0d30edbc29 100644 --- a/vendor/gedmo/doctrine-extensions/lib/Gedmo/Uploadable/Mapping/Validator.php +++ b/vendor/gedmo/doctrine-extensions/lib/Gedmo/Uploadable/Mapping/Validator.php @@ -2,10 +2,11 @@ namespace Gedmo\Uploadable\Mapping; +use Doctrine\ORM\Mapping\ClassMetadataInfo; use Gedmo\Exception\InvalidMappingException; use Gedmo\Exception\UploadableCantWriteException; use Gedmo\Exception\UploadableInvalidPathException; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; +use Doctrine\ORM\Mapping\ClassMetadata; /** * This class is used to validate mapping information @@ -61,22 +62,13 @@ class Validator ); /** - * List of types which are valid for UploadableFileSize field for ORM + * List of types which are valid for UploadableFileSize field * * @var array */ public static $validFileSizeTypes = array( 'decimal' ); - - /** - * List of types which are valid for UploadableFileSize field for ODM - * - * @var array - */ - public static $validFileSizeTypesODM = array( - 'float' - ); /** * Whether to validate if the directory of the file exists and is writable, useful to disable it when using @@ -87,28 +79,24 @@ class Validator public static $validateWritableDirectory = true; - public static function validateFileNameField(ClassMetadata $meta, $field) + public static function validateFileNameField(ClassMetadataInfo $meta, $field) { self::validateField($meta, $field, self::UPLOADABLE_FILE_NAME, self::$validFileNameTypes); } - public static function validateFileMimeTypeField(ClassMetadata $meta, $field) + public static function validateFileMimeTypeField(ClassMetadataInfo $meta, $field) { self::validateField($meta, $field, self::UPLOADABLE_FILE_MIME_TYPE, self::$validFileMimeTypeTypes); } - public static function validateFilePathField(ClassMetadata $meta, $field) + public static function validateFilePathField(ClassMetadataInfo $meta, $field) { self::validateField($meta, $field, self::UPLOADABLE_FILE_PATH, self::$validFilePathTypes); } - public static function validateFileSizeField(ClassMetadata $meta, $field) + public static function validateFileSizeField(ClassMetadataInfo $meta, $field) { - if($meta instanceof \Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo) { - self::validateField($meta, $field, self::UPLOADABLE_FILE_SIZE, self::$validFileSizeTypesODM); - } else { - self::validateField($meta, $field, self::UPLOADABLE_FILE_SIZE, self::$validFileSizeTypes); - } + self::validateField($meta, $field, self::UPLOADABLE_FILE_SIZE, self::$validFileSizeTypes); } public static function validateField($meta, $field, $uploadableField, $validFieldTypes) diff --git a/vendor/gedmo/doctrine-extensions/tests/Gedmo/IpTraceable/TraitUsageTest.php b/vendor/gedmo/doctrine-extensions/tests/Gedmo/IpTraceable/TraitUsageTest.php index c43e5a1b7a..233cab31ca 100644 --- a/vendor/gedmo/doctrine-extensions/tests/Gedmo/IpTraceable/TraitUsageTest.php +++ b/vendor/gedmo/doctrine-extensions/tests/Gedmo/IpTraceable/TraitUsageTest.php @@ -52,7 +52,7 @@ class TraitUsageTest extends BaseTestCaseORM /** * @test */ - function traitMethodShouldReturnObject() + function traitMethodthShouldReturnObject() { $sport = new UsingTrait; $this->assertInstanceOf('IpTraceable\Fixture\UsingTrait', $sport->setCreatedFromIp('<192 class="158 3 43">')); diff --git a/vendor/gedmo/doctrine-extensions/tests/Gedmo/SoftDeleteable/SoftDeleteableEntityTest.php b/vendor/gedmo/doctrine-extensions/tests/Gedmo/SoftDeleteable/SoftDeleteableEntityTest.php index ac561f4492..b6f5958789 100644 --- a/vendor/gedmo/doctrine-extensions/tests/Gedmo/SoftDeleteable/SoftDeleteableEntityTest.php +++ b/vendor/gedmo/doctrine-extensions/tests/Gedmo/SoftDeleteable/SoftDeleteableEntityTest.php @@ -100,7 +100,7 @@ class SoftDeleteableEntityTest extends BaseTestCaseORM $user = $repo->findOneBy(array('username' => $username)); $this->assertNull($user, "User should be filtered out"); - // now deactivate filter and attempt to hard delete + // now deatcivate filter and attempt to hard delete $this->em->getFilters()->disable(self::SOFT_DELETEABLE_FILTER_NAME); $user = $repo->findOneBy(array('username' => $username)); $this->assertNotNull($user, "User should be fetched when filter is disabled"); diff --git a/vendor/gedmo/doctrine-extensions/tests/Gedmo/Translatable/Fixture/Issue75/Article.php b/vendor/gedmo/doctrine-extensions/tests/Gedmo/Translatable/Fixture/Issue75/Article.php index 4d3610ed20..a0ff9e4e66 100644 --- a/vendor/gedmo/doctrine-extensions/tests/Gedmo/Translatable/Fixture/Issue75/Article.php +++ b/vendor/gedmo/doctrine-extensions/tests/Gedmo/Translatable/Fixture/Issue75/Article.php @@ -40,7 +40,7 @@ class Article public function __construct() { // $images is not an array, its a collection - // if you want to do such operations you have to construct it + // if you want to do such operations you have to cunstruct it $this->images = new \Doctrine\Common\Collections\ArrayCollection(); } diff --git a/vendor/gedmo/doctrine-extensions/tests/Gedmo/Translatable/Issue/Issue173Test.php b/vendor/gedmo/doctrine-extensions/tests/Gedmo/Translatable/Issue/Issue173Test.php index 7691b2c259..af91a51b4f 100644 --- a/vendor/gedmo/doctrine-extensions/tests/Gedmo/Translatable/Issue/Issue173Test.php +++ b/vendor/gedmo/doctrine-extensions/tests/Gedmo/Translatable/Issue/Issue173Test.php @@ -52,7 +52,7 @@ class Issue173Test extends BaseTestCaseORM ; $categories = $this->getCategoriesThatHasNoAssociations(); - $this->assertEquals(count($categories), 1, '$category3 has no associations'); + $this->assertEquals(count($categories), 1, '$categoriy3 has no associations'); } diff --git a/vendor/gedmo/doctrine-extensions/tests/Gedmo/Translatable/Issue/Issue75Test.php b/vendor/gedmo/doctrine-extensions/tests/Gedmo/Translatable/Issue/Issue75Test.php index a403f6aeff..ecb4e734ab 100644 --- a/vendor/gedmo/doctrine-extensions/tests/Gedmo/Translatable/Issue/Issue75Test.php +++ b/vendor/gedmo/doctrine-extensions/tests/Gedmo/Translatable/Issue/Issue75Test.php @@ -82,7 +82,7 @@ class Issue75Test extends BaseTestCaseORM $image2 = $this->em->find(self::IMAGE, $image2->getId()); $article->setTitle('en updated'); /** - * here you duplicate the objects in collection, it already + * here you duplicate the objects in collection, it allready * contains them. Read more about doctrine collections */ $article->setImages(array($image1, $image2)); diff --git a/vendor/imagine/imagine/docs/usage/introduction.rst b/vendor/imagine/imagine/docs/usage/introduction.rst index 8f8e4f5426..cbf17445e9 100644 --- a/vendor/imagine/imagine/docs/usage/introduction.rst +++ b/vendor/imagine/imagine/docs/usage/introduction.rst @@ -250,7 +250,7 @@ Here is a simple way to add a watermark to an image : $size = $image->getSize(); $wSize = $watermark->getSize(); - $bottomRight = new Imagine\Image\Point($size->getX() - $wSize->getX(), $size->getY() - $wSize->getY()); + $bottomRight = new Imagine\Image\Point($size->getWidth() - $wSize->getWidth(), $size->getHeight() - $wSize->getHeight()); $image->paste($watermark, $bottomRight); diff --git a/vendor/imagine/imagine/lib/Imagine/Gd/Image.php b/vendor/imagine/imagine/lib/Imagine/Gd/Image.php index 1a7d136872..3cbd7d4cdb 100644 --- a/vendor/imagine/imagine/lib/Imagine/Gd/Image.php +++ b/vendor/imagine/imagine/lib/Imagine/Gd/Image.php @@ -554,11 +554,12 @@ final class Image extends AbstractImage */ private function saveOrOutput($format, array $options, $filename = null) { + $format = $this->normalizeFormat($format); if (!$this->supported($format)) { throw new InvalidArgumentException(sprintf( 'Saving image in "%s" format is not supported, please use one '. - 'of the following extension: "%s"', $format, + 'of the following extensions: "%s"', $format, implode('", "', $this->supported()) )); } @@ -667,6 +668,26 @@ final class Image extends AbstractImage return $index; } + /** + * Internal + * + * Normalizes a given format name + * + * @param string $format + * + * @return string + */ + private function normalizeFormat($format) + { + $format = strtolower($format); + + if ('jpg' === $format || 'pjpeg' === $format) { + $format = 'jpeg'; + } + + return $format; + } + /** * Internal * @@ -676,7 +697,7 @@ final class Image extends AbstractImage * * @return Boolean */ - private function supported(&$format = null) + private function supported($format = null) { $formats = array('gif', 'jpeg', 'png', 'wbmp', 'xbm'); @@ -684,12 +705,6 @@ final class Image extends AbstractImage return $formats; } - $format = strtolower($format); - - if ('jpg' === $format || 'pjpeg' === $format) { - $format = 'jpeg'; - } - return in_array($format, $formats); } @@ -726,13 +741,14 @@ final class Image extends AbstractImage */ private function getMimeType($format) { + $format = $this->normalizeFormat($format); + if (!$this->supported($format)) { throw new RuntimeException('Invalid format'); } static $mimeTypes = array( 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', 'wbmp' => 'image/vnd.wap.wbmp', diff --git a/vendor/knplabs/gaufrette/.travis.yml b/vendor/knplabs/gaufrette/.travis.yml index 9f39514418..9648013c00 100644 --- a/vendor/knplabs/gaufrette/.travis.yml +++ b/vendor/knplabs/gaufrette/.travis.yml @@ -3,6 +3,8 @@ language: php php: - 5.3 - 5.4 + - 5.5 + - 5.6 before_script: - ./bin/configure_test_env.sh diff --git a/vendor/knplabs/gaufrette/composer.json b/vendor/knplabs/gaufrette/composer.json index d0d09a7379..c4ffca6758 100644 --- a/vendor/knplabs/gaufrette/composer.json +++ b/vendor/knplabs/gaufrette/composer.json @@ -47,7 +47,7 @@ "require-dev": { "aws/aws-sdk-php": "~2", "amazonwebservices/aws-sdk-for-php": "1.5.*", - "rackspace/php-opencloud" : "1.6.*", + "rackspace/php-opencloud" : "1.9.*", "phpspec/phpspec": "2.0.*", "phpseclib/phpseclib": "dev-master", "rackspace/php-cloudfiles": "*", diff --git a/vendor/knplabs/gaufrette/composer.lock b/vendor/knplabs/gaufrette/composer.lock index 33e840ac17..ea1314d33b 100644 --- a/vendor/knplabs/gaufrette/composer.lock +++ b/vendor/knplabs/gaufrette/composer.lock @@ -3,7 +3,7 @@ "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": "18ce61df78a3b95768776edf14952f62", + "hash": "25a293184541f0f60c2bce5160b4eefb", "packages": [ ], @@ -64,16 +64,16 @@ "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "b494eb871d0aa3ba3b0a47a895fb18c6226edb88" + "reference": "74896cc3dab67035052b5c5e4d7e80c7a58889fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/b494eb871d0aa3ba3b0a47a895fb18c6226edb88", - "reference": "b494eb871d0aa3ba3b0a47a895fb18c6226edb88", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/74896cc3dab67035052b5c5e4d7e80c7a58889fe", + "reference": "74896cc3dab67035052b5c5e4d7e80c7a58889fe", "shasum": "" }, "require": { - "guzzle/guzzle": "~3.7.0", + "guzzle/guzzle": ">=3.7.0,<3.9.0", "php": ">=5.3.3" }, "require-dev": { @@ -94,7 +94,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4.x-dev" + "dev-master": "2.5.x-dev" } }, "autoload": { @@ -112,30 +112,32 @@ "homepage": "http://aws.amazon.com" } ], - "description": "AWS SDK for PHP", - "homepage": "http://aws.amazon.com/sdkforphp2", + "description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project", + "homepage": "http://aws.amazon.com/sdkforphp", "keywords": [ "amazon", "aws", + "cloud", "dynamodb", "ec2", + "glacier", "s3", "sdk" ], - "time": "2013-11-14 17:24:28" + "time": "2014-02-19 17:59:07" }, { "name": "doctrine/annotations", - "version": "v1.1.2", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "40db0c96985aab2822edbc4848b3bd2429e02670" + "reference": "088ea3b5dfbe52adf7b12623caa897e9ee1d795e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/40db0c96985aab2822edbc4848b3bd2429e02670", - "reference": "40db0c96985aab2822edbc4848b3bd2429e02670", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/088ea3b5dfbe52adf7b12623caa897e9ee1d795e", + "reference": "088ea3b5dfbe52adf7b12623caa897e9ee1d795e", "shasum": "" }, "require": { @@ -148,7 +150,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -194,20 +196,20 @@ "docblock", "parser" ], - "time": "2013-06-16 21:33:03" + "time": "2014-02-23 21:16:16" }, { "name": "doctrine/cache", - "version": "v1.3.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "e16d7adf45664a50fa86f515b6d5e7f670130449" + "reference": "36c4eee5051629524389da376ba270f15765e49f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/e16d7adf45664a50fa86f515b6d5e7f670130449", - "reference": "e16d7adf45664a50fa86f515b6d5e7f670130449", + "url": "https://api.github.com/repos/doctrine/cache/zipball/36c4eee5051629524389da376ba270f15765e49f", + "reference": "36c4eee5051629524389da376ba270f15765e49f", "shasum": "" }, "require": { @@ -223,7 +225,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { @@ -237,7 +239,7 @@ ], "authors": [ { - "name": "Jonathan H. Wage", + "name": "Jonathan Wage", "email": "jonwage@gmail.com", "homepage": "http://www.jwage.com/", "role": "Creator" @@ -268,7 +270,7 @@ "cache", "caching" ], - "time": "2013-10-25 19:04:14" + "time": "2013-12-18 17:21:03" }, { "name": "doctrine/collections", @@ -276,12 +278,12 @@ "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "bcb53776a096a0c64579cc8d8ec0db62f1109fbc" + "reference": "b99c5c46c87126201899afe88ec490a25eedd6a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/bcb53776a096a0c64579cc8d8ec0db62f1109fbc", - "reference": "bcb53776a096a0c64579cc8d8ec0db62f1109fbc", + "url": "https://api.github.com/repos/doctrine/collections/zipball/b99c5c46c87126201899afe88ec490a25eedd6a2", + "reference": "b99c5c46c87126201899afe88ec490a25eedd6a2", "shasum": "" }, "require": { @@ -304,7 +306,7 @@ ], "authors": [ { - "name": "Jonathan H. Wage", + "name": "Jonathan Wage", "email": "jonwage@gmail.com", "homepage": "http://www.jwage.com/", "role": "Creator" @@ -336,7 +338,7 @@ "collections", "iterator" ], - "time": "2013-08-29 16:56:45" + "time": "2014-02-03 23:07:43" }, { "name": "doctrine/common", @@ -344,12 +346,12 @@ "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "c94d6ff79e25418b1225e187c782bf4742f23a8b" + "reference": "9a7e20e779360f3b8a02c27a89d47d5a6fdce8d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/c94d6ff79e25418b1225e187c782bf4742f23a8b", - "reference": "c94d6ff79e25418b1225e187c782bf4742f23a8b", + "url": "https://api.github.com/repos/doctrine/common/zipball/9a7e20e779360f3b8a02c27a89d47d5a6fdce8d1", + "reference": "9a7e20e779360f3b8a02c27a89d47d5a6fdce8d1", "shasum": "" }, "require": { @@ -411,7 +413,7 @@ "persistence", "spl" ], - "time": "2013-09-07 10:20:35" + "time": "2014-02-03 23:31:47" }, { "name": "doctrine/dbal", @@ -419,12 +421,12 @@ "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "5fdedc4f8f304e8035580807bd36d59e97a87265" + "reference": "646edacd87d5b9d201bf19aaf55ee0e4d5e470c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/5fdedc4f8f304e8035580807bd36d59e97a87265", - "reference": "5fdedc4f8f304e8035580807bd36d59e97a87265", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/646edacd87d5b9d201bf19aaf55ee0e4d5e470c2", + "reference": "646edacd87d5b9d201bf19aaf55ee0e4d5e470c2", "shasum": "" }, "require": { @@ -482,7 +484,7 @@ "persistence", "queryobject" ], - "time": "2013-11-15 14:43:05" + "time": "2014-02-23 12:02:55" }, { "name": "doctrine/inflector", @@ -490,12 +492,12 @@ "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "8b4b3ccec7aafc596e2fc1e593c9f2e78f939c8c" + "reference": "a81c334f2764b09e2f13a55cfd8fe3233946f728" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/8b4b3ccec7aafc596e2fc1e593c9f2e78f939c8c", - "reference": "8b4b3ccec7aafc596e2fc1e593c9f2e78f939c8c", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/a81c334f2764b09e2f13a55cfd8fe3233946f728", + "reference": "a81c334f2764b09e2f13a55cfd8fe3233946f728", "shasum": "" }, "require": { @@ -551,7 +553,7 @@ "singularize", "string" ], - "time": "2013-04-10 16:14:30" + "time": "2013-12-21 19:19:50" }, { "name": "doctrine/lexer", @@ -559,12 +561,12 @@ "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "bc0e1f0cc285127a38c6c8ea88bc5dba2fd53e94" + "reference": "f12a5f74e5f4a9e3f558f3288504e121edfad891" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/bc0e1f0cc285127a38c6c8ea88bc5dba2fd53e94", - "reference": "bc0e1f0cc285127a38c6c8ea88bc5dba2fd53e94", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/f12a5f74e5f4a9e3f558f3288504e121edfad891", + "reference": "f12a5f74e5f4a9e3f558f3288504e121edfad891", "shasum": "" }, "require": { @@ -608,7 +610,7 @@ "lexer", "parser" ], - "time": "2013-03-07 12:15:25" + "time": "2013-12-20 21:39:00" }, { "name": "dropbox-php/dropbox-php", @@ -676,12 +678,12 @@ "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "d2e8ac50742672ca0947e3f5459a4163eb5f9cbc" + "reference": "8d39ffa70ac1aecd297e93d4185092f51877edb4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d2e8ac50742672ca0947e3f5459a4163eb5f9cbc", - "reference": "d2e8ac50742672ca0947e3f5459a4163eb5f9cbc", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/8d39ffa70ac1aecd297e93d4185092f51877edb4", + "reference": "8d39ffa70ac1aecd297e93d4185092f51877edb4", "shasum": "" }, "require": { @@ -719,19 +721,19 @@ "phpunit/phpunit": "3.7.*", "psr/log": "1.0.*", "symfony/class-loader": "*", - "zendframework/zend-cache": "2.0.*", - "zendframework/zend-log": "2.0.*" + "zendframework/zend-cache": "<2.3", + "zendframework/zend-log": "<2.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.7-dev" + "dev-master": "3.8-dev" } }, "autoload": { "psr-0": { - "Guzzle\\Tests": "tests/", - "Guzzle": "src/" + "Guzzle": "src/", + "Guzzle\\Tests": "tests/" } }, "notification-url": "https://packagist.org/downloads/", @@ -760,7 +762,7 @@ "rest", "web service" ], - "time": "2013-11-14 20:23:30" + "time": "2014-02-20 17:01:46" }, { "name": "herzult/php-ssh", @@ -768,12 +770,12 @@ "source": { "type": "git", "url": "https://github.com/Herzult/php-ssh.git", - "reference": "772b7ae229b22112bf0b80e2e18229673c446f81" + "reference": "bea40b828ef2de2f9161255ce42256f26cd8a5b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Herzult/php-ssh/zipball/772b7ae229b22112bf0b80e2e18229673c446f81", - "reference": "772b7ae229b22112bf0b80e2e18229673c446f81", + "url": "https://api.github.com/repos/Herzult/php-ssh/zipball/bea40b828ef2de2f9161255ce42256f26cd8a5b8", + "reference": "bea40b828ef2de2f9161255ce42256f26cd8a5b8", "shasum": "" }, "require": { @@ -809,7 +811,7 @@ "ssh", "ssh2" ], - "time": "2013-05-24 20:02:36" + "time": "2013-11-21 17:54:47" }, { "name": "microsoft/windowsazure", @@ -817,12 +819,12 @@ "source": { "type": "git", "url": "https://github.com/WindowsAzure/azure-sdk-for-php.git", - "reference": "74a0475b4fe28fbe9f73660bd9ae2248148912f9" + "reference": "61d4e12495358491f62cc5bd8716335b0b313488" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WindowsAzure/azure-sdk-for-php/zipball/74a0475b4fe28fbe9f73660bd9ae2248148912f9", - "reference": "74a0475b4fe28fbe9f73660bd9ae2248148912f9", + "url": "https://api.github.com/repos/WindowsAzure/azure-sdk-for-php/zipball/61d4e12495358491f62cc5bd8716335b0b313488", + "reference": "61d4e12495358491f62cc5bd8716335b0b313488", "shasum": "" }, "require": { @@ -852,7 +854,7 @@ "php", "sdk" ], - "time": "2013-10-17 08:08:49" + "time": "2014-01-23 05:45:10" }, { "name": "mikey179/vfsStream", @@ -938,10 +940,10 @@ }, { "name": "pear-pear.php.net/HTTP_Request2", - "version": "2.1.1", + "version": "2.2.1", "dist": { "type": "file", - "url": "http://pear.php.net/get/HTTP_Request2-2.1.1.tgz", + "url": "http://pear.php.net/get/HTTP_Request2-2.2.1.tgz", "reference": null, "shasum": null }, @@ -951,7 +953,7 @@ "php": ">=5.2.0.0" }, "replace": { - "pear-pear/http_request2": "== 2.1.1.0" + "pear-pear/http_request2": "== 2.2.1.0" }, "type": "pear-library", "autoload": { @@ -1019,18 +1021,18 @@ }, { "name": "pear-pear.php.net/Net_URL2", - "version": "2.0.0", + "version": "2.0.5", "dist": { "type": "file", - "url": "http://pear.php.net/get/Net_URL2-2.0.0.tgz", + "url": "http://pear.php.net/get/Net_URL2-2.0.5.tgz", "reference": null, "shasum": null }, "require": { - "php": ">=5.0.0.0" + "php": ">=5.1.4.0" }, "replace": { - "pear-pear/net_url2": "== 2.0.0.0" + "pear-pear/net_url2": "== 2.0.5.0" }, "type": "pear-library", "autoload": { @@ -1041,7 +1043,7 @@ "include-path": [ "/" ], - "description": "Provides parsing of URLs into their constituent parts (scheme, host, path etc.), URL generation, and resolving of relative URLs." + "description": "Provides parsing of URLs into their constituent parts (scheme, host, path etc.), URL generation, and resolving of\n relative URLs." }, { "name": "pear-pear.php.net/PEAR", @@ -1132,27 +1134,79 @@ ], "description": "Selection of methods that are often needed when working with XML documents. Functionality includes creating of attribute lists from arrays, creation of tags, validation of XML names and more." }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "cfb3ebea556b24df8f8f3745d61478293cb5a166" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cfb3ebea556b24df8f8f3745d61478293cb5a166", + "reference": "cfb3ebea556b24df8f8f3745d61478293cb5a166", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*@stable" + }, + "suggest": { + "dflydev/markdown": "1.0.*", + "erusev/parsedown": "~0.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2013-12-05 08:16:55" + }, { "name": "phpseclib/phpseclib", "version": "dev-master", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "f9aa658309d5fb6af6ef032f4072f588f011216b" + "reference": "76c9692908a6c25601df2db373043fcbb335332e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/f9aa658309d5fb6af6ef032f4072f588f011216b", - "reference": "f9aa658309d5fb6af6ef032f4072f588f011216b", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/76c9692908a6c25601df2db373043fcbb335332e", + "reference": "76c9692908a6c25601df2db373043fcbb335332e", "shasum": "" }, "require": { "php": ">=5.0.0" }, + "require-dev": { + "squizlabs/php_codesniffer": "1.*" + }, "suggest": { "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", "ext-mcrypt": "Install the Mcrypt extension in order to speed up a wide variety of cryptographic operations.", - "pear-pear/PHP_Compat": "Install PHP_Compat to get phpseclib working on PHP >= 4.3.3." + "pear-pear/PHP_Compat": "Install PHP_Compat to get phpseclib working on PHP < 4.3.3." }, "type": "library", "extra": { @@ -1182,6 +1236,21 @@ { "name": "Jim Wigginton", "email": "terrafrost@php.net", + "role": "Lead Developer" + }, + { + "name": "Patrick Monnerat", + "email": "pm@datasphere.ch", + "role": "Developer" + }, + { + "name": "Andreas Fischer", + "email": "bantu@phpbb.com", + "role": "Developer" + }, + { + "name": "Hans-Jürgen Petrich", + "email": "petrich@tronic-media.com", "role": "Developer" } ], @@ -1192,6 +1261,7 @@ "aes", "asn.1", "asn1", + "blowfish", "crypto", "cryptography", "encryption", @@ -1201,10 +1271,11 @@ "signature", "signing", "ssh", + "twofish", "x.509", "x509" ], - "time": "2013-11-15 21:07:14" + "time": "2014-02-23 01:03:22" }, { "name": "phpspec/php-diff", @@ -1245,25 +1316,29 @@ "source": { "type": "git", "url": "https://github.com/phpspec/phpspec.git", - "reference": "c631a7c980d5be303ba513c1598a663393a59028" + "reference": "c41c96dcadf2bcaacaa342a84e794254c5bb763a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/phpspec/zipball/c631a7c980d5be303ba513c1598a663393a59028", - "reference": "c631a7c980d5be303ba513c1598a663393a59028", + "url": "https://api.github.com/repos/phpspec/phpspec/zipball/c41c96dcadf2bcaacaa342a84e794254c5bb763a", + "reference": "c41c96dcadf2bcaacaa342a84e794254c5bb763a", "shasum": "" }, "require": { "php": ">=5.3.3", "phpspec/php-diff": "~1.0.0", - "phpspec/prophecy": "~1.0.2", + "phpspec/prophecy": "~1.1", "symfony/console": "~2.1", "symfony/event-dispatcher": "~2.1", "symfony/finder": "~2.1", "symfony/yaml": "~2.1" }, + "require-dev": { + "behat/behat": "~2.5", + "bossa/phpspec2-expect": "dev-master" + }, "suggest": { - "whatthejeff/nyancat-scoreboard": "~1.1 – Enables the Nyan Cat formatter" + "phpspec/nyan-formatters": "~1.0 – Adds Nyan formatters" }, "bin": [ "bin/phpspec" @@ -1305,7 +1380,7 @@ "testing", "tests" ], - "time": "2013-11-13 10:07:05" + "time": "2014-02-23 20:29:41" }, { "name": "phpspec/prophecy", @@ -1313,21 +1388,24 @@ "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "8177460b13b087a7e52faffa9492f2d3e91d19fc" + "reference": "6bd3659919ae6472454aea07482200077293e75f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/8177460b13b087a7e52faffa9492f2d3e91d19fc", - "reference": "8177460b13b087a7e52faffa9492f2d3e91d19fc", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/6bd3659919ae6472454aea07482200077293e75f", + "reference": "6bd3659919ae6472454aea07482200077293e75f", "shasum": "" }, + "require": { + "phpdocumentor/reflection-docblock": "~2.0" + }, "require-dev": { "phpspec/phpspec": "2.0.*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -1360,7 +1438,7 @@ "spy", "stub" ], - "time": "2013-11-06 13:00:43" + "time": "2014-02-18 21:47:37" }, { "name": "phpunit/php-code-coverage", @@ -1368,18 +1446,18 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "10c5b2c8b72a801eaad0031cd6a6a3686909c5a9" + "reference": "e8ffe3fd66479fe502c4a566e9828075f3fffaec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/10c5b2c8b72a801eaad0031cd6a6a3686909c5a9", - "reference": "10c5b2c8b72a801eaad0031cd6a6a3686909c5a9", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e8ffe3fd66479fe502c4a566e9828075f3fffaec", + "reference": "e8ffe3fd66479fe502c4a566e9828075f3fffaec", "shasum": "" }, "require": { "php": ">=5.3.3", "phpunit/php-file-iterator": ">=1.3.0@stable", - "phpunit/php-text-template": ">=1.1.1@stable", + "phpunit/php-text-template": ">=1.2.0@stable", "phpunit/php-token-stream": ">=1.1.3@stable" }, "require-dev": { @@ -1421,7 +1499,7 @@ "testing", "xunit" ], - "time": "2013-11-01 09:17:11" + "time": "2014-02-24 18:18:21" }, { "name": "phpunit/php-file-iterator", @@ -1474,12 +1552,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "1eeef106193d2f8c539728e566bb4793071a9e18" + "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/1eeef106193d2f8c539728e566bb4793071a9e18", - "reference": "1eeef106193d2f8c539728e566bb4793071a9e18", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", "shasum": "" }, "require": { @@ -1510,7 +1588,7 @@ "keywords": [ "template" ], - "time": "2013-01-07 10:56:17" + "time": "2014-01-30 17:20:04" }, { "name": "phpunit/php-timer", @@ -1612,12 +1690,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "236f65cc97d6beaa8fcb8a27b19bd278f3912677" + "reference": "5728eadfb7859241d7aafd26592cee0ad1876d2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/236f65cc97d6beaa8fcb8a27b19bd278f3912677", - "reference": "236f65cc97d6beaa8fcb8a27b19bd278f3912677", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5728eadfb7859241d7aafd26592cee0ad1876d2d", + "reference": "5728eadfb7859241d7aafd26592cee0ad1876d2d", "shasum": "" }, "require": { @@ -1678,7 +1756,7 @@ "testing", "xunit" ], - "time": "2013-11-06 01:58:51" + "time": "2014-02-15 22:46:11" }, { "name": "phpunit/phpunit-mock-objects", @@ -1686,12 +1764,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "3e40f3b3f18c044a24688fe406440d7fd537744a" + "reference": "c39c4511c3b007539eb170c32cbc2af49a07351a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3e40f3b3f18c044a24688fe406440d7fd537744a", - "reference": "3e40f3b3f18c044a24688fe406440d7fd537744a", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/c39c4511c3b007539eb170c32cbc2af49a07351a", + "reference": "c39c4511c3b007539eb170c32cbc2af49a07351a", "shasum": "" }, "require": { @@ -1699,7 +1777,6 @@ "phpunit/php-text-template": ">=1.1.1@stable" }, "require-dev": { - "pear-pear/pear": "1.9.4", "phpunit/phpunit": "3.7.*@dev" }, "suggest": { @@ -1736,7 +1813,7 @@ "mock", "xunit" ], - "time": "2013-07-23 04:42:59" + "time": "2014-02-16 12:43:56" }, { "name": "rackspace/php-cloudfiles", @@ -1758,31 +1835,39 @@ "cloudfiles.php" ] }, - "time": "2013-02-20 21:04:46" + "time": "2014-01-07 21:27:14" }, { "name": "rackspace/php-opencloud", - "version": "V1.6.0", + "version": "v1.9.2", "source": { "type": "git", "url": "https://github.com/rackspace/php-opencloud.git", - "reference": "7be280fde422651d0966c70b07f6477b37dd4270" + "reference": "6551de7aebcebb369d025662f99ab27c9b4527ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rackspace/php-opencloud/zipball/7be280fde422651d0966c70b07f6477b37dd4270", - "reference": "7be280fde422651d0966c70b07f6477b37dd4270", + "url": "https://api.github.com/repos/rackspace/php-opencloud/zipball/6551de7aebcebb369d025662f99ab27c9b4527ac", + "reference": "6551de7aebcebb369d025662f99ab27c9b4527ac", "shasum": "" }, "require": { - "ext-curl": "*", - "php": ">=5.3.0" + "guzzle/http": "3.8.*@dev", + "php": ">=5.3.3" + }, + "require-dev": { + "guzzle/guzzle": "dev-master", + "psr/log": "1.0.*", + "satooshi/php-coveralls": "0.6.*@dev" }, "type": "library", "autoload": { - "classmap": [ - "lib/" - ] + "psr-0": { + "OpenCloud": [ + "lib/", + "tests/" + ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1799,12 +1884,15 @@ "homepage": "https://github.com/jamiehannaford" } ], - "description": "Rackspace open cloud php library", + "description": "PHP SDK for Rackspace/OpenStack APIs", "keywords": [ - "cloudfiles", - "opencloud" + "Openstack", + "nova", + "opencloud", + "rackspace", + "swift" ], - "time": "2013-09-03 15:49:02" + "time": "2014-02-06 20:53:21" }, { "name": "symfony/console", @@ -1813,12 +1901,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "846e8fa8fdb5fab85cdb053b26687dd073c33051" + "reference": "ceb261293b65e9df55b98a9665ef29d56de0c48f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/846e8fa8fdb5fab85cdb053b26687dd073c33051", - "reference": "846e8fa8fdb5fab85cdb053b26687dd073c33051", + "url": "https://api.github.com/repos/symfony/Console/zipball/ceb261293b65e9df55b98a9665ef29d56de0c48f", + "reference": "ceb261293b65e9df55b98a9665ef29d56de0c48f", "shasum": "" }, "require": { @@ -1833,7 +1921,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.5-dev" } }, "autoload": { @@ -1848,7 +1936,9 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" }, { "name": "Symfony Community", @@ -1857,7 +1947,7 @@ ], "description": "Symfony Console Component", "homepage": "http://symfony.com", - "time": "2013-11-13 21:30:16" + "time": "2014-02-11 13:52:21" }, { "name": "symfony/event-dispatcher", @@ -1866,19 +1956,21 @@ "source": { "type": "git", "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "d51d78b34c1d9dcc384ba48155105fe99284dd67" + "reference": "8b345992d9e850798f46a6c68804ac9e4965e91a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/d51d78b34c1d9dcc384ba48155105fe99284dd67", - "reference": "d51d78b34c1d9dcc384ba48155105fe99284dd67", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/8b345992d9e850798f46a6c68804ac9e4965e91a", + "reference": "8b345992d9e850798f46a6c68804ac9e4965e91a", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "symfony/dependency-injection": "~2.0" + "psr/log": "~1.0", + "symfony/dependency-injection": "~2.0", + "symfony/stopwatch": "~2.2" }, "suggest": { "symfony/dependency-injection": "", @@ -1887,7 +1979,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.5-dev" } }, "autoload": { @@ -1902,7 +1994,9 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" }, { "name": "Symfony Community", @@ -1911,7 +2005,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "http://symfony.com", - "time": "2013-10-17 11:48:11" + "time": "2014-02-11 13:52:21" }, { "name": "symfony/finder", @@ -1920,12 +2014,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/Finder.git", - "reference": "e2ce3164ab58b4d54612e630571f158035ee8603" + "reference": "a708807d3a54b258abb5bda6832ced8b9bbf8ffb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Finder/zipball/e2ce3164ab58b4d54612e630571f158035ee8603", - "reference": "e2ce3164ab58b4d54612e630571f158035ee8603", + "url": "https://api.github.com/repos/symfony/Finder/zipball/a708807d3a54b258abb5bda6832ced8b9bbf8ffb", + "reference": "a708807d3a54b258abb5bda6832ced8b9bbf8ffb", "shasum": "" }, "require": { @@ -1934,7 +2028,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.5-dev" } }, "autoload": { @@ -1949,7 +2043,9 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" }, { "name": "Symfony Community", @@ -1958,7 +2054,7 @@ ], "description": "Symfony Finder Component", "homepage": "http://symfony.com", - "time": "2013-09-19 09:47:34" + "time": "2014-02-24 16:21:51" }, { "name": "symfony/yaml", @@ -1967,12 +2063,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "1f7cabb841e62ec49615bd965ac780fd994b3f64" + "reference": "e49a47d60348665261f6e279ba383241deb73cab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/1f7cabb841e62ec49615bd965ac780fd994b3f64", - "reference": "1f7cabb841e62ec49615bd965ac780fd994b3f64", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/e49a47d60348665261f6e279ba383241deb73cab", + "reference": "e49a47d60348665261f6e279ba383241deb73cab", "shasum": "" }, "require": { @@ -1981,7 +2077,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.5-dev" } }, "autoload": { @@ -1996,7 +2092,9 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" }, { "name": "Symfony Community", @@ -2005,7 +2103,7 @@ ], "description": "Symfony Yaml Component", "homepage": "http://symfony.com", - "time": "2013-10-17 11:48:11" + "time": "2014-02-24 16:21:51" } ], "aliases": [ diff --git a/vendor/knplabs/gaufrette/spec/Gaufrette/Adapter/LazyOpenCloudSpec.php b/vendor/knplabs/gaufrette/spec/Gaufrette/Adapter/LazyOpenCloudSpec.php new file mode 100644 index 0000000000..b2543f22c0 --- /dev/null +++ b/vendor/knplabs/gaufrette/spec/Gaufrette/Adapter/LazyOpenCloudSpec.php @@ -0,0 +1,42 @@ + + */ +class LazyOpenCloudSpec extends ObjectBehavior +{ + /** + * @param \Gaufrette\Adapter\OpenStackCloudFiles\ObjectStoreFactoryInterface $objectStoreFactory + */ + function let($objectStoreFactory) + { + $this->beConstructedWith($objectStoreFactory, 'test-container-name'); + } + + function it_is_adapter() + { + $this->shouldHaveType('Gaufrette\Adapter'); + } + + /** + * @param \Gaufrette\Adapter\OpenStackCloudFiles\ObjectStoreFactoryInterface $objectStoreFactory + * @param \OpenCloud\ObjectStore\Service $objectStore + * @param \OpenCloud\ObjectStore\Resource\Container $container + */ + function it_initializes_object_store($objectStoreFactory, $objectStore, $container) + { + $objectStoreFactory->getObjectStore()->shouldBeCalled()->willReturn($objectStore); + $objectStore->getContainer("test-container-name")->shouldBeCalled()->willReturn($container); + $container->getObject("test-file-name")->willThrow(new ObjectNotFoundException()); + + $this->exists("test-file-name"); + } +} diff --git a/vendor/knplabs/gaufrette/spec/Gaufrette/Adapter/LazyOpenStackCloudFilesSpec.php b/vendor/knplabs/gaufrette/spec/Gaufrette/Adapter/LazyOpenStackCloudFilesSpec.php index 8968a2d766..b41b18a478 100644 --- a/vendor/knplabs/gaufrette/spec/Gaufrette/Adapter/LazyOpenStackCloudFilesSpec.php +++ b/vendor/knplabs/gaufrette/spec/Gaufrette/Adapter/LazyOpenStackCloudFilesSpec.php @@ -2,10 +2,12 @@ namespace spec\Gaufrette\Adapter; +use OpenCloud\ObjectStore\Exception\ObjectNotFoundException; use PhpSpec\ObjectBehavior; use OpenCloud\Common\Exceptions\ObjFetchError; use OpenCloud\Common\Exceptions\CreateUpdateError; use OpenCloud\Common\Exceptions\DeleteError; +use Prophecy\Argument; /** * Class LazyOpenStackCloudFilesSpec @@ -22,9 +24,8 @@ class LazyOpenStackCloudFilesSpec extends ObjectBehavior { $containerName = 'test'; $createContainer = false; - $detectContentType = false; - $this->beConstructedWith($connectionFactory, $containerName, $createContainer, $detectContentType); + $this->beConstructedWith($connectionFactory, $containerName, $createContainer); } function it_is_adapter() @@ -33,253 +34,18 @@ class LazyOpenStackCloudFilesSpec extends ObjectBehavior } /** - * @param Gaufrette\Adapter\OpenStackCloudFiles\ConnectionFactoryInterface $connectionFactory - * @param OpenCloud\OpenStack $connection - * @param OpenCloud\ObjectStore\Service $objectStore - * @param OpenCloud\ObjectStore\Resource\Container $container - * @param OpenCloud\ObjectStore\Resource\DataObject $object - */ - function it_reads_file($connectionFactory, $connection, $objectStore, $container, $object) - { - $object->saveToString()->willReturn("Hello World"); - $container->dataObject("test")->willReturn($object); - $objectStore->container("test")->willReturn($container); - $connection->objectStore()->willReturn($objectStore)->shouldBeCalledTimes(1); - $connectionFactory->create()->willReturn($connection)->shouldBeCalledTimes(1); - $this->read('test')->shouldReturn('Hello World'); - } - - /** - * @param Gaufrette\Adapter\OpenStackCloudFiles\ConnectionFactoryInterface $connectionFactory - * @param OpenCloud\OpenStack $connection - * @param OpenCloud\ObjectStore\Service $objectStore - * @param OpenCloud\ObjectStore\Resource\Container $container - */ - function it_reads_file_on_error_returns_false($connectionFactory, $connection, $objectStore, $container) - { - $connection->objectStore()->willReturn($objectStore)->shouldBeCalledTimes(1); - $connectionFactory->create()->willReturn($connection)->shouldBeCalledTimes(1); - $container->dataObject("test")->willThrow(new ObjFetchError()); - $objectStore->container("test")->willReturn($container); - - $this->read('test')->shouldReturn(false); - } - - /** - * @param Gaufrette\Adapter\OpenStackCloudFiles\ConnectionFactoryInterface $connectionFactory - * @param OpenCloud\OpenStack $connection - * @param OpenCloud\ObjectStore\Service $objectStore - * @param OpenCloud\ObjectStore\Resource\Container $container - * @param OpenCloud\ObjectStore\Resource\DataObject $object - */ - function it_writes_file_key_doesnot_exist($connectionFactory, $connection, $objectStore, $container, $object) - { - $testData = "Hello World!"; - $testDataSize = sizeof($testData); - $object->create(array ('name' => 'test'))->willReturn(null); - $object->setData($testData)->willReturn(null); - $object->bytes = $testDataSize; - $container->dataObject('test')->willReturn(false); - $container->dataObject()->willReturn($object); - $objectStore->container("test")->willReturn($container); - $connection->objectStore()->willReturn($objectStore)->shouldBeCalledTimes(1); - $connectionFactory->create()->willReturn($connection)->shouldBeCalledTimes(1); - - $this->write('test', $testData)->shouldReturn($testDataSize); - } - - /** - * @param Gaufrette\Adapter\OpenStackCloudFiles\ConnectionFactoryInterface $connectionFactory - * @param OpenCloud\OpenStack $connection - * @param OpenCloud\ObjectStore\Service $objectStore - * @param OpenCloud\ObjectStore\Resource\Container $container - * @param OpenCloud\ObjectStore\Resource\DataObject $object - */ - function it_writes_file_key_exists($connectionFactory, $connection, $objectStore, $container, $object) - { - $testData = "Hello World!"; - $testDataSize = sizeof($testData); - $object->bytes = $testDataSize; - $container->dataObject('test')->willReturn($object); - $objectStore->container("test")->willReturn($container); - $connection->objectStore()->willReturn($objectStore)->shouldBeCalledTimes(1); - $connectionFactory->create()->willReturn($connection)->shouldBeCalledTimes(1); - - $this->write('test', $testData)->shouldReturn($testDataSize); - } - - /** - * @param Gaufrette\Adapter\OpenStackCloudFiles\ConnectionFactoryInterface $connectionFactory - * @param OpenCloud\OpenStack $connection - * @param OpenCloud\ObjectStore\Service $objectStore - * @param OpenCloud\ObjectStore\Resource\Container $container - * @param OpenCloud\ObjectStore\Resource\DataObject $object - */ - function it_writes_file_write_fails($connectionFactory, $connection, $objectStore, $container, $object) - { - $testData = "Hello World!"; - $object->create(array ('name' => 'test'))->willThrow(new CreateUpdateError()); - $object->setData($testData)->willReturn(null); - $container->dataObject('test')->willReturn(false); - $container->dataObject()->willReturn($object); - $objectStore->container("test")->willReturn($container); - $connection->objectStore()->willReturn($objectStore)->shouldBeCalledTimes(1); - $connectionFactory->create()->willReturn($connection)->shouldBeCalledTimes(1); - - $this->write('test', $testData)->shouldReturn(false); - } - - /** - * @param Gaufrette\Adapter\OpenStackCloudFiles\ConnectionFactoryInterface $connectionFactory - * @param OpenCloud\OpenStack $connection - * @param OpenCloud\ObjectStore\Service $objectStore - * @param OpenCloud\ObjectStore\Resource\Container $container - * @param OpenCloud\ObjectStore\Resource\DataObject $object + * @param \Gaufrette\Adapter\OpenStackCloudFiles\ConnectionFactoryInterface $connectionFactory + * @param \OpenCloud\OpenStack $openStack + * @param \OpenCloud\ObjectStore\Service $objectStore + * @param \OpenCloud\ObjectStore\Resource\Container $container */ - function it_key_exists_true($connectionFactory, $connection, $objectStore, $container, $object) + function it_initializes_object_store($connectionFactory, $openStack, $objectStore, $container) { - $container->dataObject('test')->willReturn($object); - $objectStore->container("test")->willReturn($container); - $connection->objectStore()->willReturn($objectStore)->shouldBeCalledTimes(1); - $connectionFactory->create()->willReturn($connection)->shouldBeCalledTimes(1); - - $this->exists('test')->shouldReturn(true); - } - - /** - * @param Gaufrette\Adapter\OpenStackCloudFiles\ConnectionFactoryInterface $connectionFactory - * @param OpenCloud\OpenStack $connection - * @param OpenCloud\ObjectStore\Service $objectStore - * @param OpenCloud\ObjectStore\Resource\Container $container - * @param OpenCloud\ObjectStore\Resource\DataObject $object - */ - function it_key_does_not_exist_false($connectionFactory, $connection, $objectStore, $container, $object) - { - $container->dataObject('test')->willReturn($object)->willThrow(new ObjFetchError()); - $objectStore->container("test")->willReturn($container); - $connection->objectStore()->willReturn($objectStore)->shouldBeCalledTimes(1); - $connectionFactory->create()->willReturn($connection)->shouldBeCalledTimes(1); - - $this->exists('test')->shouldReturn(false); - } - - /** - * @param Gaufrette\Adapter\OpenStackCloudFiles\ConnectionFactoryInterface $connectionFactory - * @param OpenCloud\OpenStack $connection - * @param OpenCloud\ObjectStore\Service $objectStore - * @param OpenCloud\ObjectStore\Resource\Container $container - * @param OpenCloud\ObjectStore\Resource\DataObject $object - */ - function it_deletes_file($connectionFactory, $connection, $objectStore, $container, $object) - { - $object->delete()->willReturn(null); - $container->dataObject("test")->willReturn($object); - $objectStore->container("test")->willReturn($container); - $connection->objectStore()->willReturn($objectStore)->shouldBeCalledTimes(1); - $connectionFactory->create()->willReturn($connection)->shouldBeCalledTimes(1); - - $this->delete('test')->shouldReturn(true); - } - - /** - * @param Gaufrette\Adapter\OpenStackCloudFiles\ConnectionFactoryInterface $connectionFactory - * @param OpenCloud\OpenStack $connection - * @param OpenCloud\ObjectStore\Service $objectStore - * @param OpenCloud\ObjectStore\Resource\Container $container - * @param OpenCloud\ObjectStore\Resource\DataObject $object - */ - function it_deletes_file_fails($connectionFactory, $connection, $objectStore, $container, $object) - { - $object->delete()->willThrow(new DeleteError()); - $container->dataObject("test")->willReturn($object); - $objectStore->container("test")->willReturn($container); - $connection->objectStore()->willReturn($objectStore)->shouldBeCalledTimes(1); - $connectionFactory->create()->willReturn($connection)->shouldBeCalledTimes(1); - - $this->delete('test')->shouldReturn(false); - } - - /** - * @param Gaufrette\Adapter\OpenStackCloudFiles\ConnectionFactoryInterface $connectionFactory - * @param OpenCloud\OpenStack $connection - * @param OpenCloud\ObjectStore\Service $objectStore - * @param OpenCloud\ObjectStore\Resource\Container $container - */ - function it_deletes_file_does_not_exist_returns_false($connectionFactory, $connection, $objectStore, $container) - { - $container->dataObject("test")->willThrow(new ObjFetchError()); - $objectStore->container("test")->willReturn($container); - $connection->objectStore()->willReturn($objectStore)->shouldBeCalledTimes(1); - $connectionFactory->create()->willReturn($connection)->shouldBeCalledTimes(1); - - $this->delete('test')->shouldReturn(false); - } - - /** - * @param Gaufrette\Adapter\OpenStackCloudFiles\ConnectionFactoryInterface $connectionFactory - * @param OpenCloud\OpenStack $connection - * @param OpenCloud\ObjectStore\Service $objectStore - * @param OpenCloud\ObjectStore\Resource\Container $container - * @param OpenCloud\ObjectStore\Resource\DataObject $object - */ - function it_checksum_returns_string($connectionFactory, $connection, $objectStore, $container, $object) - { - $object->getETag()->willReturn("test String"); - $container->dataObject("test")->willReturn($object); - $objectStore->container("test")->willReturn($container); - $connection->objectStore()->willReturn($objectStore)->shouldBeCalledTimes(1); - $connectionFactory->create()->willReturn($connection)->shouldBeCalledTimes(1); - - $this->checksum('test')->shouldReturn("test String"); - } - - /** - * @param Gaufrette\Adapter\OpenStackCloudFiles\ConnectionFactoryInterface $connectionFactory - * @param OpenCloud\OpenStack $connection - * @param OpenCloud\ObjectStore\Service $objectStore - * @param OpenCloud\ObjectStore\Resource\Container $container - */ - function it_checksum_file_does_not_exist_returns_false($connectionFactory, $connection, $objectStore, $container) - { - $container->dataObject("test")->willThrow(new ObjFetchError()); - $objectStore->container("test")->willReturn($container); - $connection->objectStore()->willReturn($objectStore)->shouldBeCalledTimes(1); - $connectionFactory->create()->willReturn($connection)->shouldBeCalledTimes(1); - - $this->checksum('test')->shouldReturn(false); - } - - /** - * @param Gaufrette\Adapter\OpenStackCloudFiles\ConnectionFactoryInterface $connectionFactory - * @param OpenCloud\OpenStack $connection - * @param OpenCloud\ObjectStore\Service $objectStore - * @param OpenCloud\ObjectStore\Resource\Container $container - * @param OpenCloud\Common\Collection $objectList - */ - function it_keys_returns_sorted_array($connectionFactory, $connection, $objectStore, $container, $objectList) - { - $inputArray = array ('key5', 'key2', 'key1'); - $outputArray = $inputArray; - sort($outputArray); - $index = 0; - - $objectList->next()->will( - function () use ($inputArray, &$index) { - if ($index < count($inputArray)) { - $objectItem = new \stdClass(); - $objectItem->name = $inputArray[$index]; - $index++; - - return $objectItem; - } - } - ) ->shouldBeCalledTimes(count($inputArray) + 1); - - $container->objectList()->willReturn($objectList); - $objectStore->container("test")->willReturn($container); - $connection->objectStore()->willReturn($objectStore)->shouldBeCalledTimes(1); - $connectionFactory->create()->willReturn($connection)->shouldBeCalledTimes(1); + $connectionFactory->create()->shouldBeCalled()->willReturn($openStack); + $openStack->objectStoreService(Argument::cetera())->willReturn($objectStore); + $objectStore->getContainer(Argument::any())->shouldBeCalled()->willReturn($container); + $container->getObject(Argument::any())->willThrow(new ObjectNotFoundException()); - $this->keys()->shouldReturn($outputArray); + $this->exists("test-file-name"); } } diff --git a/vendor/knplabs/gaufrette/spec/Gaufrette/Adapter/OpenCloudSpec.php b/vendor/knplabs/gaufrette/spec/Gaufrette/Adapter/OpenCloudSpec.php index a42c52f579..9c4c1744c8 100644 --- a/vendor/knplabs/gaufrette/spec/Gaufrette/Adapter/OpenCloudSpec.php +++ b/vendor/knplabs/gaufrette/spec/Gaufrette/Adapter/OpenCloudSpec.php @@ -1,24 +1,30 @@ + * @author Daniel Richter */ class OpenCloudSpec extends ObjectBehavior { /** * @param OpenCloud\ObjectStore\Service $objectStore + * @param OpenCloud\ObjectStore\Resource\Container $container */ - function let($objectStore) + function let($objectStore, $container) { - $this->beConstructedWith($objectStore, 'test', false, false); + $objectStore->getContainer("test")->willReturn($container); + $this->beConstructedWith($objectStore, 'test', false); } function it_is_adapter() @@ -27,202 +33,207 @@ class OpenCloudSpec extends ObjectBehavior } /** - * @param OpenCloud\ObjectStore\Service $objectStore * @param OpenCloud\ObjectStore\Resource\Container $container * @param OpenCloud\ObjectStore\Resource\DataObject $object */ - function it_reads_file($objectStore, $container, $object) + function it_reads_file($container, $object) { - $object->saveToString()->willReturn("Hello World"); - $container->dataObject("test")->willReturn($object); - $objectStore->container("test")->willReturn($container); + $object->getContent()->willReturn("Hello World"); + $container->getObject("test")->willReturn($object); $this->read('test')->shouldReturn('Hello World'); } /** - * @param OpenCloud\ObjectStore\Service $objectStore * @param OpenCloud\ObjectStore\Resource\Container $container */ - function it_reads_file_on_error_returns_false($objectStore, $container) + function it_reads_file_on_error_returns_false($container) { - $container->dataObject("test")->willThrow(new ObjFetchError()); - $objectStore->container("test")->willReturn($container); + $container->getObject("test")->willThrow(new ObjectNotFoundException()); $this->read('test')->shouldReturn(false); } /** - * @param OpenCloud\ObjectStore\Service $objectStore * @param OpenCloud\ObjectStore\Resource\Container $container * @param OpenCloud\ObjectStore\Resource\DataObject $object */ - function it_writes_file_if_key_does_not_exist_returns_size($objectStore, $container, $object) + function it_writes_file_returns_size($container, $object) { $testData = "Hello World!"; - $testDataSize = sizeof($testData); - $object->create(array ('name' => 'test'))->willReturn(null); - $object->setData($testData)->willReturn(null); - $object->bytes = $testDataSize; - $container->dataObject('test')->willReturn(false); - $container->dataObject()->willReturn($object); - $objectStore->container("test")->willReturn($container); + $testDataSize = strlen($testData); - $this->write('test', $testData)->shouldReturn($testDataSize); - } - - /** - * @param OpenCloud\ObjectStore\Service $objectStore - * @param OpenCloud\ObjectStore\Resource\Container $container - * @param OpenCloud\ObjectStore\Resource\DataObject $object - */ - function it_writes_file_if_key_exists_returns_size($objectStore, $container, $object) - { - $testData = "Hello World!"; - $testDataSize = sizeof($testData); - $object->bytes = $testDataSize; - $container->dataObject('test')->willReturn($object); - $objectStore->container("test")->willReturn($container); + $object->getContentLength()->willReturn($testDataSize); + $container->uploadObject('test', $testData)->willReturn($object); $this->write('test', $testData)->shouldReturn($testDataSize); } /** - * @param OpenCloud\ObjectStore\Service $objectStore * @param OpenCloud\ObjectStore\Resource\Container $container - * @param OpenCloud\ObjectStore\Resource\DataObject $object */ - function it_writes_file_and_write_fails_returns_false($objectStore, $container, $object) + function it_writes_file_and_write_fails_returns_false($container) { $testData = "Hello World!"; - $object->create(array ('name' => 'test'))->willThrow(new CreateUpdateError()); - $object->setData($testData)->willReturn(null); - $container->dataObject('test')->willReturn(false); - $container->dataObject()->willReturn($object); - $objectStore->container("test")->willReturn($container); + + $container->uploadObject('test', $testData)->willThrow(new CreateUpdateError()); $this->write('test', $testData)->shouldReturn(false); } /** - * @param OpenCloud\ObjectStore\Service $objectStore * @param OpenCloud\ObjectStore\Resource\Container $container * @param OpenCloud\ObjectStore\Resource\DataObject $object */ - function if_key_exists_return_true($objectStore, $container, $object) + function it_returns_true_if_key_exists($container, $object) { - $container->dataObject('test')->willReturn($object); - $objectStore->container("test")->willReturn($container); + $container->getObject('test')->willReturn($object); $this->exists('test')->shouldReturn(true); } /** - * @param OpenCloud\ObjectStore\Service $objectStore * @param OpenCloud\ObjectStore\Resource\Container $container - * @param OpenCloud\ObjectStore\Resource\DataObject $object */ - function if_key_does_not_exist_return_false($objectStore, $container, $object) + function it_returns_false_if_key_does_not_exist($container) { - $container->dataObject('test')->willReturn($object)->willThrow(new ObjFetchError()); - $objectStore->container("test")->willReturn($container); + $container->getObject('test')->willThrow(new ObjectNotFoundException()); $this->exists('test')->shouldReturn(false); } /** - * @param OpenCloud\ObjectStore\Service $objectStore * @param OpenCloud\ObjectStore\Resource\Container $container * @param OpenCloud\ObjectStore\Resource\DataObject $object */ - function it_deletes_file_on_success_returns_true($objectStore, $container, $object) + function it_deletes_file_on_success_returns_true($container, $object) { $object->delete()->willReturn(null); - $container->dataObject("test")->willReturn($object); - $objectStore->container("test")->willReturn($container); + $container->getObject("test")->willReturn($object); $this->delete('test')->shouldReturn(true); } /** - * @param OpenCloud\ObjectStore\Service $objectStore * @param OpenCloud\ObjectStore\Resource\Container $container * @param OpenCloud\ObjectStore\Resource\DataObject $object */ - function it_deletes_file_returns_false_on_failure($objectStore, $container, $object) + function it_deletes_file_returns_false_on_failure($container, $object) { $object->delete()->willThrow(new DeleteError()); - $container->dataObject("test")->willReturn($object); - $objectStore->container("test")->willReturn($container); + $container->getObject("test")->willReturn($object); $this->delete('test')->shouldReturn(false); } /** - * @param OpenCloud\ObjectStore\Service $objectStore * @param OpenCloud\ObjectStore\Resource\Container $container */ - function it_deletes_file_if_file_does_not_exist_returns_false($objectStore, $container) + function it_deletes_file_if_file_does_not_exist_returns_false($container) { - $container->dataObject("test")->willThrow(new ObjFetchError()); - $objectStore->container("test")->willReturn($container); + $container->getObject("test")->willThrow(new ObjectNotFoundException()); $this->delete('test')->shouldReturn(false); } /** - * @param OpenCloud\ObjectStore\Service $objectStore * @param OpenCloud\ObjectStore\Resource\Container $container * @param OpenCloud\ObjectStore\Resource\DataObject $object */ - function it_returns_checksum_if_file_exists($objectStore, $container, $object) + function it_returns_checksum_if_file_exists($container, $object) { - $object->getETag()->willReturn("test String"); - $container->dataObject("test")->willReturn($object); - $objectStore->container("test")->willReturn($container); + $object->getEtag()->willReturn("test String"); + $container->getObject("test")->willReturn($object); $this->checksum('test')->shouldReturn("test String"); } /** - * @param OpenCloud\ObjectStore\Service $objectStore * @param OpenCloud\ObjectStore\Resource\Container $container */ - function it_returns_false_when_file_does_not_exist($objectStore, $container) + function it_returns_false_when_file_does_not_exist($container) { - $container->dataObject("test")->willThrow(new ObjFetchError()); - $objectStore->container("test")->willReturn($container); + $container->getObject("test")->willThrow(new ObjectNotFoundException()); $this->checksum('test')->shouldReturn(false); } /** - * @param OpenCloud\ObjectStore\Service $objectStore * @param OpenCloud\ObjectStore\Resource\Container $container * @param OpenCloud\Common\Collection $objectList + * @param OpenCloud\ObjectStore\Resource\DataObject $object1 + * @param OpenCloud\ObjectStore\Resource\DataObject $object2 + * @param OpenCloud\ObjectStore\Resource\DataObject $object3 */ - function it_returns_files_as_sorted_array($objectStore, $container, $objectList) + function it_returns_files_as_sorted_array($container, $objectList, $object1, $object2, $object3) { - $inputArray = array ('key5', 'key2', 'key1'); - $outputArray = $inputArray; - sort($outputArray); + $outputArray = array('key1', 'key2', 'key5'); $index = 0; + $object1->getName()->willReturn('key5'); + $object2->getName()->willReturn('key2'); + $object3->getName()->willReturn('key1'); + + $objects = array($object1, $object2, $object3); + $objectList->next()->will( - function () use ($inputArray, &$index) { - if ($index < count($inputArray)) { - $objectItem = new \stdClass(); - $objectItem->name = $inputArray[$index]; + function () use ($objects, &$index) { + if ($index < count($objects)) { $index++; - return $objectItem; + return $objects[$index - 1]; } } - ) ->shouldBeCalledTimes(count($inputArray) + 1); + ) ->shouldBeCalledTimes(count($objects) + 1); $container->objectList()->willReturn($objectList); - $objectStore->container("test")->willReturn($container); $this->keys()->shouldReturn($outputArray); } + + /** + * @param OpenCloud\ObjectStore\Service $objectStore + */ + function it_throws_exception_if_container_does_not_exist($objectStore) + { + $containerName = 'container-does-not-exist'; + + $objectStore->getContainer($containerName)->willThrow(new BadResponseException()); + $this->beConstructedWith($objectStore, $containerName); + + $this->shouldThrow('\RuntimeException')->duringExists('test'); + } + + /** + * @param OpenCloud\ObjectStore\Service $objectStore + * @param OpenCloud\ObjectStore\Resource\Container $container + */ + function it_creates_container($objectStore, $container) + { + $containerName = 'container-does-not-yet-exist'; + $filename = 'test'; + + $objectStore->getContainer($containerName)->willThrow(new BadResponseException()); + $objectStore->createContainer($containerName)->willReturn($container); + $container->getObject($filename)->willThrow(new ObjectNotFoundException()); + + $this->beConstructedWith($objectStore, $containerName, true); + + $this->exists($filename)->shouldReturn(false); + } + + /** + * @param OpenCloud\ObjectStore\Service $objectStore + */ + function it_throws_exeption_if_container_creation_fails($objectStore) + { + $containerName = 'container-does-not-yet-exist'; + + $objectStore->getContainer($containerName)->willThrow(new BadResponseException()); + $objectStore->createContainer($containerName)->willReturn(false); + + $this->beConstructedWith($objectStore, $containerName, true); + + $this->shouldThrow('\RuntimeException')->duringExists('test'); + } } diff --git a/vendor/knplabs/gaufrette/spec/Gaufrette/Stream/LocalSpec.php b/vendor/knplabs/gaufrette/spec/Gaufrette/Stream/LocalSpec.php new file mode 100644 index 0000000000..872045193e --- /dev/null +++ b/vendor/knplabs/gaufrette/spec/Gaufrette/Stream/LocalSpec.php @@ -0,0 +1,29 @@ +beConstructedWith(vfsStream::url('other')); + $this->shouldThrow('\RuntimeException')->duringOpen(new StreamMode('r')); + } + + function it_throws_runtime_exception_when_file_doesnt_exists_and_custom_error_handler_specified() + { + $custom_error_handler = function ($errno, $errstr, $errfile, $errline) { + throw new \ErrorException($errstr, 0, $errno, $errfile, $errline); + }; + set_error_handler($custom_error_handler); + + $this->beConstructedWith(vfsStream::url('other')); + $this->shouldThrow('\RuntimeException')->duringOpen(new StreamMode('r')); + + restore_error_handler(); + } +} diff --git a/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/LazyOpenCloud.php b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/LazyOpenCloud.php new file mode 100644 index 0000000000..d68bb733a1 --- /dev/null +++ b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/LazyOpenCloud.php @@ -0,0 +1,44 @@ + + */ +class LazyOpenCloud extends OpenCloud +{ + /** + * @var ObjectStoreFactoryInterface + */ + protected $objectStoreFactory; + + /** + * @param ObjectStoreFactoryInterface $objectStoreFactory + * @param string $containerName + * @param bool $createContainer + */ + public function __construct(ObjectStoreFactoryInterface $objectStoreFactory, $containerName, $createContainer = false) + { + $this->objectStoreFactory = $objectStoreFactory; + $this->containerName = $containerName; + $this->createContainer = $createContainer; + } + + /** + * Override parent to lazy-load object store + * + * {@inheritdoc} + */ + protected function getContainer() + { + if (!$this->objectStore) { + $this->objectStore = $this->objectStoreFactory->getObjectStore(); + } + + return parent::getContainer(); + } +} diff --git a/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/LazyOpenStackCloudFiles.php b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/LazyOpenStackCloudFiles.php index e31fa0bd6b..72e502cd78 100644 --- a/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/LazyOpenStackCloudFiles.php +++ b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/LazyOpenStackCloudFiles.php @@ -8,131 +8,38 @@ use OpenCloud\OpenStack; * Class LazyOpenStackCloudFiles * @package Gaufrette\Adapter * @author Chris Warner + * @deprecated in favor of LazyOpenCloud */ class LazyOpenStackCloudFiles extends OpenCloud { - /** * @var ConnectionFactoryInterface */ protected $connectionFactory; - /** - * @var bool - */ - protected $connected = false; - /** * @param ConnectionFactoryInterface $connectionFactory * @param string $containerName * @param bool $createContainer - * @param bool $detectContentType */ - public function __construct($connectionFactory, $containerName, $createContainer = false, $detectContentType = true) + public function __construct($connectionFactory, $containerName, $createContainer = false) { $this->connectionFactory = $connectionFactory; $this->containerName = $containerName; $this->createContainer = $createContainer; - $this->detectContentType = $detectContentType; - } - - /** - * @inheritdoc - */ - public function read($key) - { - $this->connect(); - - return parent::read($key); - } - - /** - * @@inheritdoc - */ - public function write($key, $content) - { - $this->connect(); - - return parent::write($key, $content); - } - - /** - * @inheritdoc - */ - public function exists($key) - { - $this->connect(); - - return parent::exists($key); - } - - /** - * @inheritdoc - */ - public function keys() - { - $this->connect(); - - return parent::keys(); - } - - /** - * @inheritdoc - */ - public function delete($key) - { - $this->connect(); - - return parent::delete($key); } /** - * @inheritdoc + * Override parent to lazy-load object store + * + * {@inheritdoc} */ - public function rename($sourceKey, $targetKey) + protected function getContainer() { - $this->connect(); - - parent::rename($sourceKey, $targetKey); - } - - /** - * @inheritdoc - */ - public function isDirectory($key) - { - $this->connect(); - - return parent::isDirectory($key); - } - - /** - * @inheritdoc - */ - public function checksum($key) - { - $this->connect(); - - return parent::checksum($key); - } - - /** - * @inheritdoc - */ - public function mtime($key) - { - $this->connect(); - - return parent::mtime($key); - } - - protected function connect() - { - if (!$this->connected) { - /** @var OpenStack $connection */ - $connection = $this->connectionFactory->create(); - - $this->objectStore = $connection->objectStore(); + if (!$this->objectStore) { + $this->objectStore = $this->connectionFactory->create()->objectStoreService('cloudFiles', null, 'publicURL'); } + + return parent::getContainer(); } } diff --git a/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenCloud.php b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenCloud.php index 955fe22fe4..8f24c53ba8 100644 --- a/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenCloud.php +++ b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenCloud.php @@ -3,64 +3,82 @@ namespace Gaufrette\Adapter; use Gaufrette\Adapter; +use Guzzle\Http\Exception\BadResponseException; use OpenCloud\Common\Exceptions\DeleteError; use OpenCloud\ObjectStore\Resource\Container; use OpenCloud\ObjectStore\Service; use OpenCloud\Common\Exceptions\CreateUpdateError; -use OpenCloud\Common\Exceptions\ObjFetchError; +use OpenCloud\ObjectStore\Exception\ObjectNotFoundException; /** * OpenCloud adapter * * @package Gaufrette * @author James Watson + * @author Daniel Richter */ class OpenCloud implements Adapter, ChecksumCalculator { /** - * @var ObjectStore + * @var Service */ protected $objectStore; + /** * @var string */ protected $containerName; + /** * @var bool */ protected $createContainer; - /** - * @var bool - */ - protected $detectContentType; + /** * @var Container */ protected $container; - public function __construct( - Service $objectStore, $containerName, $createContainer = false, $detectContentType = true - ) { - $this->objectStore = $objectStore; - $this->containerName = $containerName; - $this->createContainer = $createContainer; - $this->detectContentType = $detectContentType; + /** + * Constructor + * + * @param Service $objectStore + * @param string $containerName The name of the container + * @param bool $createContainer Whether to create the container if it does not exist + */ + public function __construct(Service $objectStore, $containerName, $createContainer = false) + { + $this->objectStore = $objectStore; + $this->containerName = $containerName; + $this->createContainer = $createContainer; } - private function initialize() + /** + * Returns an initialized container + * + * @throws \RuntimeException + * @return Container + */ + protected function getContainer() { - if (!$this->container instanceof Container) { - - if ($this->createContainer) { - $container = $this->objectStore->Container(); - $container->name = $this->containerName; - $container->Create(); - } else { - $container = $this->objectStore->Container($this->containerName); + if ($this->container) { + return $this->container; + } + + try { + return $this->container = $this->objectStore->getContainer($this->containerName); + } catch (BadResponseException $e) { //OpenCloud lib does not wrap this exception + if (!$this->createContainer) { + throw new \RuntimeException(sprintf('Container "%s" does not exist.', $this->containerName)); } - $this->container = $container; } + + if (!$container = $this->objectStore->createContainer($this->containerName)) { + throw new \RuntimeException(sprintf('Container "%s" could not be created.', $this->containerName)); + } + + return $this->container = $container; } /** @@ -72,17 +90,11 @@ class OpenCloud implements Adapter, */ public function read($key) { - $this->initialize(); - - // This method can return boolean or the object - // if there is a fetch error, tryGetObject returns false - // If it returns false, php throws a fatal error because boolean is a non-object. - $object = $this->tryGetObject($key); - if ($object) { - return $object->SaveToString(); + if ($object = $this->tryGetObject($key)) { + return $object->getContent(); } - return $object; + return false; } /** @@ -95,30 +107,14 @@ class OpenCloud implements Adapter, */ public function write($key, $content) { - $this->initialize(); - $object = $this->tryGetObject($key); - try { - if ($object === false) { - $object = $this->container->DataObject(); - $object->SetData($content); - - $data = array ('name' => $key); - - if ($this->detectContentType) { - $fileInfo = new \finfo(FILEINFO_MIME_TYPE); - $contentType = $fileInfo->buffer($content); - $data['content_type'] = $contentType; - } - - $object->Create($data); - } - - return $object->bytes; + $object = $this->getContainer()->uploadObject($key, $content); } catch (CreateUpdateError $updateError) { return false; } + + return $object->getContentLength(); } /** @@ -130,9 +126,7 @@ class OpenCloud implements Adapter, */ public function exists($key) { - $this->initialize(); - - return ($this->tryGetObject($key) !== false); + return $this->tryGetObject($key) !== false; } /** @@ -142,12 +136,13 @@ class OpenCloud implements Adapter, */ public function keys() { - $this->initialize(); - $objectList = $this->container->ObjectList(); - $keys = array (); - while ($object = $objectList->Next()) { - $keys[] = $object->name; + $objectList = $this->getContainer()->objectList(); + $keys = array (); + + while ($object = $objectList->next()) { + $keys[] = $object->getName(); } + sort($keys); return $keys; @@ -162,12 +157,8 @@ class OpenCloud implements Adapter, */ public function mtime($key) { - $this->initialize(); - - $object = $this->tryGetObject($key); - - if ($object) { - return $object->last_modified; + if ($object = $this->tryGetObject($key)) { + return $object->getLastModified(); } return false; @@ -182,16 +173,14 @@ class OpenCloud implements Adapter, */ public function delete($key) { - $this->initialize(); + if (!$object = $this->tryGetObject($key)) { + return false; + } + try { - $object = $this->tryGetObject($key); - if (!$object) { - return false; - } - $object->Delete(); + $object->delete(); } catch (DeleteError $deleteError) { - return false; } @@ -208,9 +197,13 @@ class OpenCloud implements Adapter, */ public function rename($sourceKey, $targetKey) { - $this->initialize(); - $this->write($targetKey, $this->read($sourceKey)); - $this->delete($sourceKey); + if (false !== $this->write($targetKey, $this->read($sourceKey))) { + $this->delete($sourceKey); + + return true; + } + + return false; } /** @@ -234,9 +227,7 @@ class OpenCloud implements Adapter, */ public function checksum($key) { - $this->initialize(); - $object = $this->tryGetObject($key); - if ($object) { + if ($object = $this->tryGetObject($key)) { return $object->getETag(); } @@ -244,15 +235,16 @@ class OpenCloud implements Adapter, } /** - * @param $key - * @return \OpenCloud\ObjectStore\Resource\DataObject + * @param string $key + * + * @return \OpenCloud\ObjectStore\Resource\DataObject|false */ protected function tryGetObject($key) { try { - return $this->container->DataObject($key); + return $this->getContainer()->getObject($key); } - catch (ObjFetchError $objFetchError) { + catch (ObjectNotFoundException $objFetchError) { return false; } } diff --git a/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/BaseOpenStackAuthenticationFactory.php b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/BaseOpenStackAuthenticationFactory.php index ad0734e0a5..846db776e1 100644 --- a/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/BaseOpenStackAuthenticationFactory.php +++ b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/BaseOpenStackAuthenticationFactory.php @@ -10,6 +10,7 @@ use OpenCloud\Rackspace; * Class BaseOpenStackAuthenticationFactory * @package Gaufrette\Adapter\OpenStackCloudFiles * @author Chris Warner + * @deprecated in favor of ObjectStoreFactory */ abstract class BaseOpenStackAuthenticationFactory implements ConnectionFactoryInterface { diff --git a/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/ConnectionFactoryInterface.php b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/ConnectionFactoryInterface.php index b401b854cd..f1b5d6f3b6 100644 --- a/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/ConnectionFactoryInterface.php +++ b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/ConnectionFactoryInterface.php @@ -7,6 +7,7 @@ namespace Gaufrette\Adapter\OpenStackCloudFiles; * Interface ConnectionFactoryInterface * @package Gaufrette\Adapter\OpenStackCloudFiles * @author Chris Warner + * @deprecated in favor of ObjectStoreFactory */ interface ConnectionFactoryInterface { diff --git a/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/ObjectStoreFactory.php b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/ObjectStoreFactory.php new file mode 100644 index 0000000000..6f802c9083 --- /dev/null +++ b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/ObjectStoreFactory.php @@ -0,0 +1,50 @@ + + */ +class ObjectStoreFactory implements ObjectStoreFactoryInterface +{ + /** + * @var OpenStack + */ + protected $connection; + + /** + * @var string + */ + protected $region; + + /** + * @var string + */ + protected $urlType; + + /** + * Constructor + * + * @param OpenStack $connection + * @param string $region + * @param string $urlType + */ + public function __construct(OpenStack $connection, $region, $urlType) + { + $this->connection = $connection; + $this->region = $region; + $this->urlType = $urlType; + } + + /** + * {@inheritdoc} + */ + public function getObjectStore() + { + return $this->connection->objectStoreService('cloudFiles', $this->region, $this->urlType); + } +} diff --git a/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/ObjectStoreFactoryInterface.php b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/ObjectStoreFactoryInterface.php new file mode 100644 index 0000000000..e679189f88 --- /dev/null +++ b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/ObjectStoreFactoryInterface.php @@ -0,0 +1,18 @@ + + */ +interface ObjectStoreFactoryInterface +{ + /** + * @return Service + */ + public function getObjectStore(); +} diff --git a/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/OpenStackAuthenticationFactory.php b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/OpenStackAuthenticationFactory.php index 21a10d152b..04745cbf53 100644 --- a/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/OpenStackAuthenticationFactory.php +++ b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/OpenStackAuthenticationFactory.php @@ -9,6 +9,7 @@ use OpenCloud\OpenStack; * Class OpenStackAuthenticationFactory * @package Gaufrette\Adapter\OpenStackCloudFiles * @author Chris Warner + * @deprecated in favor of ObjectStoreFactory */ class OpenStackAuthenticationFactory extends BaseOpenStackAuthenticationFactory implements ConnectionFactoryInterface { @@ -17,13 +18,9 @@ class OpenStackAuthenticationFactory extends BaseOpenStackAuthenticationFactory */ public function create() { - if (null === $this->authenciationService) { + if (!$this->authenciationService) { $this->authenciationService = new OpenStack($this->url, array ($this->username, $this->apikey)); - $this->authenciationService->authenticate(); - $this->authenciationService->setDefaults('cloudFiles', null, $this->region); - } elseif ($this->authenciationService->hasExpired()) { - $this->authenciationService->authenticate(); - $this->authenciationService->setDefaults('cloudFiles', null, $this->region); + $this->authenciationService->getUser()->setDefaultRegion($this->region); } return $this->authenciationService; diff --git a/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/RackspaceAuthenticationFactory.php b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/RackspaceAuthenticationFactory.php index d7a6d5e88a..3328c9d817 100644 --- a/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/RackspaceAuthenticationFactory.php +++ b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/OpenStackCloudFiles/RackspaceAuthenticationFactory.php @@ -10,6 +10,7 @@ use OpenCloud\Rackspace; * Class RackspaceAuthenticationConnectionFactory * @package Gaufrette\Adapter\OpenStackCloudFiles * @author Chris Warner + * @deprecated in favor of OpenStackObjectStoreFactory */ class RackspaceAuthenticationFactory extends BaseOpenStackAuthenticationFactory implements ConnectionFactoryInterface { @@ -19,11 +20,9 @@ class RackspaceAuthenticationFactory extends BaseOpenStackAuthenticationFactory */ public function create() { - if (null === $this->authenciationService) { + if (!$this->authenciationService) { $this->authenciationService = new Rackspace($this->url, array ($this->username, $this->apikey)); - $this->authenciationService->authenticate(); - } elseif ($this->authenciationService->expired()) { - $this->authenciationService->authenticate(); + $this->authenciationService->getUser()->setDefaultRegion($this->region); } return $this->authenciationService; diff --git a/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/PhpseclibSftp.php b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/PhpseclibSftp.php index ddeef25489..95c67b0808 100644 --- a/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/PhpseclibSftp.php +++ b/vendor/knplabs/gaufrette/src/Gaufrette/Adapter/PhpseclibSftp.php @@ -185,12 +185,12 @@ class PhpseclibSftp implements Adapter, $this->initialized = true; } - protected function ensureDirectoryExists($directory, $create = false) + protected function ensureDirectoryExists($directory, $create) { $pwd = $this->sftp->pwd(); if ($this->sftp->chdir($directory)) { $this->sftp->chdir($pwd); - } elseif ($this->create) { + } elseif ($create) { if (!$this->sftp->mkdir($directory, 0777, true)) { throw new \RuntimeException(sprintf('The directory \'%s\' does not exist and could not be created (%s).', $this->directory, $this->sftp->getLastSFTPError())); } diff --git a/vendor/knplabs/gaufrette/src/Gaufrette/Stream/Local.php b/vendor/knplabs/gaufrette/src/Gaufrette/Stream/Local.php index c9bfe5af6e..6ed17833b3 100644 --- a/vendor/knplabs/gaufrette/src/Gaufrette/Stream/Local.php +++ b/vendor/knplabs/gaufrette/src/Gaufrette/Stream/Local.php @@ -31,7 +31,15 @@ class Local implements Stream */ public function open(StreamMode $mode) { - $fileHandle = @fopen($this->path, $mode->getMode()); + $baseDirPath = dirname($this->path); + if ($mode->allowsWrite() && !is_dir($baseDirPath)) { + @mkdir($baseDirPath, 0755, true); + } + try { + $fileHandle = @fopen($this->path, $mode->getMode()); + } catch (\Exception $e) { + $fileHandle = false; + } if (false === $fileHandle) { throw new \RuntimeException(sprintf('File "%s" cannot be opened', $this->path)); diff --git a/vendor/knplabs/gaufrette/tests/Gaufrette/Functional/FileStream/FunctionalTestCase.php b/vendor/knplabs/gaufrette/tests/Gaufrette/Functional/FileStream/FunctionalTestCase.php index 4c1fc5e20f..8c8005ade7 100644 --- a/vendor/knplabs/gaufrette/tests/Gaufrette/Functional/FileStream/FunctionalTestCase.php +++ b/vendor/knplabs/gaufrette/tests/Gaufrette/Functional/FileStream/FunctionalTestCase.php @@ -150,6 +150,19 @@ class FunctionalTestCase extends \PHPUnit_Framework_TestCase $this->assertEquals(-1, fseek($fileHandler, 1, 666)); } + /** + * @test + */ + public function shouldHandlesSubDir() + { + file_put_contents('gaufrette://filestream/subdir/test.txt', 'test content'); + + $this->assertTrue(is_file('gaufrette://filestream/subdir/test.txt')); + + $this->filesystem->delete('subdir/test.txt'); + $this->assertFalse(is_file('gaufrette://filestream/subdir/test.txt')); + } + /** * @test */ diff --git a/vendor/knplabs/knp-menu/.travis.yml b/vendor/knplabs/knp-menu/.travis.yml index f2df31e4b9..b51e84936e 100644 --- a/vendor/knplabs/knp-menu/.travis.yml +++ b/vendor/knplabs/knp-menu/.travis.yml @@ -3,5 +3,12 @@ language: php php: - 5.3 - 5.4 + - 5.5 + - 5.6 + - hhvm + +matrix: + allow_failures: + - php: hhvm before_script: composer install --dev diff --git a/vendor/knplabs/knp-menu/README.markdown b/vendor/knplabs/knp-menu/README.markdown index 4deaf29e2c..9ca0e39407 100644 --- a/vendor/knplabs/knp-menu/README.markdown +++ b/vendor/knplabs/knp-menu/README.markdown @@ -8,10 +8,29 @@ but can now be used stand-alone. [![Build Status](https://secure.travis-ci.org/KnpLabs/KnpMenu.png)](http://travis-ci.org/KnpLabs/KnpMenu) [![Latest Stable Version](https://poser.pugx.org/knplabs/knp-menu/v/stable.png)](https://packagist.org/packages/knplabs/knp-menu) [![Latest Unstable Version](https://poser.pugx.org/knplabs/knp-menu/v/unstable.png)](https://packagist.org/packages/knplabs/knp-menu) +[![Gitter chat](https://badges.gitter.im/KnpLabs/KnpMenu.png)](https://gitter.im/KnpLabs/KnpMenu) + +## Installation + +KnpMenu uses Composer, please checkout the [composer website](http://getcomposer.org) for more information. + +The simple following command will install `knp-menu` into your project. It also add a new +entry in your `composer.json` and update the `composer.lock` as well. + +```bash +$ composer require 'knplabs/knp-menu:2.0.*@dev' +``` + +> KnpMenu follows the PSR-0 convention names for its classes, which means you can easily integrate `knp-menu` classes loading in your own autoloader. + +## Getting Started ```php addChild('Comments', array('uri' => '#comments')); $menu->addChild('Symfony2', array('uri' => 'http://symfony-reloaded.org/')); $menu->addChild('Coming soon'); -$renderer = new ListRenderer(); +$renderer = new ListRenderer(new \Knp\Menu\Matcher\Matcher()); echo $renderer->render($menu); ``` @@ -50,26 +69,10 @@ the first and last items, submenus, ... > The bulk of the documentation can be found in the `doc` directory. -## Installation - -KnpMenu does not provide an autoloader but follow the PSR-0 convention. You -can use any compliant autoloader for the library, for instance the Symfony2 -[ClassLoader component](https://github.com/symfony/ClassLoader). -Assuming you cloned the library in `vendor/KnpMenu`, it will be configured -this way: - -```php -registerNamespaces(array( - 'Knp\Menu' => __DIR__.'/vendor/KnpMenu/src' - // ... -)); -``` - ## What now? Follow the tutorial in `doc/01-Basics-Menus.markdown` and `doc/02-Twig-Integration.markdown` -to discover how `KnpMenu` will rock your world! +to discover how KnpMenu will rock your world! ## Credits diff --git a/vendor/knplabs/knp-menu/src/Knp/Menu/MenuItem.php b/vendor/knplabs/knp-menu/src/Knp/Menu/MenuItem.php index 684130c0b2..e4e16dee3e 100644 --- a/vendor/knplabs/knp-menu/src/Knp/Menu/MenuItem.php +++ b/vendor/knplabs/knp-menu/src/Knp/Menu/MenuItem.php @@ -442,7 +442,7 @@ class MenuItem implements ItemInterface $newChildren[$name] = $child; } - $this->children = $newChildren; + $this->setChildren($newChildren); return $this; } @@ -450,7 +450,7 @@ class MenuItem implements ItemInterface public function copy() { $newMenu = clone $this; - $newMenu->children = array(); + $newMenu->setChildren(array()); $newMenu->setParent(null); foreach ($this->getChildren() as $child) { $newMenu->addChild($child->copy()); diff --git a/vendor/knplabs/knp-snappy/README.markdown b/vendor/knplabs/knp-snappy/README.markdown index 5040570320..e45bd10cc4 100644 --- a/vendor/knplabs/knp-snappy/README.markdown +++ b/vendor/knplabs/knp-snappy/README.markdown @@ -42,6 +42,13 @@ header('Content-Type: application/pdf'); header('Content-Disposition: attachment; filename="file.pdf"'); echo $snappy->getOutput('http://www.github.com'); +// Merge multiple urls into one pdf +// by sending an array of urls to getOutput() +$snappy = new Pdf('/usr/local/bin/wkhtmltopdf'); +header('Content-Type: application/pdf'); +header('Content-Disposition: attachment; filename="file.pdf"'); +echo $snappy->getOutput(array('http://www.github.com','http://www.knplabs.com','http://www.php.net')); + // .. or simply save the PDF to a file $snappy = new Pdf('/usr/local/bin/wkhtmltopdf'); $snappy->generateFromHtml('

                                                                            Bill

                                                                            You owe me money, dude.

                                                                            ', '/tmp/bill-123.pdf'); @@ -88,11 +95,11 @@ use Knp\Snappy\Pdf; $myProjetDirectory = '/path/to/my/project'; -$snappy = new Pdf($myProjetDirectory . '/vendor/h4cc/wkhtmltopdf-i386/bin/wkhtmltopdf-i386'); +$snappy = new Pdf($myProjectDirectory . '/vendor/h4cc/wkhtmltopdf-i386/bin/wkhtmltopdf-i386'); // or -$snappy = new Pdf($myProjetDirectory . '/vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64'); +$snappy = new Pdf($myProjectDirectory . '/vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64'); ``` diff --git a/vendor/knplabs/knp-snappy/src/Knp/Snappy/AbstractGenerator.php b/vendor/knplabs/knp-snappy/src/Knp/Snappy/AbstractGenerator.php index b7fe781d28..bc91a86bb7 100644 --- a/vendor/knplabs/knp-snappy/src/Knp/Snappy/AbstractGenerator.php +++ b/vendor/knplabs/knp-snappy/src/Knp/Snappy/AbstractGenerator.php @@ -2,6 +2,8 @@ namespace Knp\Snappy; +use Knp\Snappy\Exception as Exceptions; + /** * Base generator class for medias * @@ -337,7 +339,7 @@ abstract class AbstractGenerator implements GeneratorInterface * Builds the command string * * @param string $binary The binary path/name - * @param string $input Url or file location of the page to process + * @param string/array $input Url(s) or file location(s) of the page(s) to process * @param string $output File location to the image-to-be * @param array $options An array of options * @@ -374,7 +376,14 @@ abstract class AbstractGenerator implements GeneratorInterface } } - $command .= ' '.escapeshellarg($input).' '.escapeshellarg($output);; + if (is_array($input)) { + foreach ($input as $i) { + $command .= ' '.escapeshellarg($i).' '; + } + $command .= escapeshellarg($output); + } else { + $command .= ' '.escapeshellarg($input).' '.escapeshellarg($output); + } return $command; } @@ -438,7 +447,7 @@ abstract class AbstractGenerator implements GeneratorInterface $filename, $this->isDir($filename) ? 'directory' : 'link' )); } elseif (false === $overwrite) { - throw new \InvalidArgumentException(sprintf( + throw new Exceptions\FileAlreadyExistsException(sprintf( 'The output file \'%s\' already exists.', $filename )); diff --git a/vendor/knplabs/knp-snappy/src/Knp/Snappy/Exception/FileAlreadyExistsException.php b/vendor/knplabs/knp-snappy/src/Knp/Snappy/Exception/FileAlreadyExistsException.php new file mode 100644 index 0000000000..d20f3c97fd --- /dev/null +++ b/vendor/knplabs/knp-snappy/src/Knp/Snappy/Exception/FileAlreadyExistsException.php @@ -0,0 +1,5 @@ +assertEquals($isAssociativeArray, $r->invokeArgs($generator, array($array))); } + /** + * @expectedException Knp\Snappy\Exception\FileAlreadyExistsException + */ + public function testItThrowsTheProperExceptionWhenFileExistsAndNotOverwritting() + { + $media = $this->getMock( + 'Knp\Snappy\AbstractGenerator', + array( + 'configure', + 'fileExists', + 'isFile' + ), + array(), + '', + false + ); + $media + ->expects($this->any()) + ->method('fileExists') + ->will($this->returnValue(true)) + ; + $media + ->expects($this->any()) + ->method('isFile') + ->will($this->returnValue(true)) + ; + $r = new \ReflectionMethod($media, 'prepareOutput'); + $r->setAccessible(true); + + $r->invokeArgs($media, array('', false)); + } + public function dataForIsAssociativeArray() { return array( diff --git a/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Adapter/DoctrineODMPhpcrAdapter.php b/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Adapter/DoctrineODMPhpcrAdapter.php index 3af2c31dd4..022f87ca7c 100644 --- a/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Adapter/DoctrineODMPhpcrAdapter.php +++ b/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Adapter/DoctrineODMPhpcrAdapter.php @@ -12,6 +12,7 @@ namespace Pagerfanta\Adapter; use Doctrine\ODM\PHPCR\Query\Builder\QueryBuilder; +use Doctrine\ODM\PHPCR\Query\Query; /** * Pagerfanta adapter for Doctrine PHPCR-ODM. @@ -47,7 +48,7 @@ class DoctrineODMPhpcrAdapter implements AdapterInterface */ public function getNbResults() { - return count($this->queryBuilder->getQuery()->execute()); + return $this->queryBuilder->getQuery()->execute(null, Query::HYDRATE_PHPCR)->getRows()->count(); } /** diff --git a/vendor/php-ffmpeg/php-ffmpeg/CHANGELOG.md b/vendor/php-ffmpeg/php-ffmpeg/CHANGELOG.md index 924a138770..b6f5e14bae 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/CHANGELOG.md +++ b/vendor/php-ffmpeg/php-ffmpeg/CHANGELOG.md @@ -1,6 +1,29 @@ CHANGELOG --------- +* 0.4.4 (12-17-2013) + + * Fix width / height dimensions extraction. + +* 0.4.3 (12-02-2013) + + * Fix using rotate and resize filters at the same time (#78) + +* 0.4.2 (11-29-2013) + + * Add Rotate filter. + * Remove time_start metadata when using synchronize filter + * Remove restriction on filesystem resources. + +* 0.4.1 (11-26-2013) + + * Add Clip filter (@guimeira) + +* 0.4.0 (10-21-2013) + + * Add support for video to audio transcoding + * BC Break : Add FormatInterface::getPasses and FormatInterface::getExtraParams + * 0.3.5 (10-21-2013) * Add vorbis audio format (@jacobbudin). diff --git a/vendor/php-ffmpeg/php-ffmpeg/README.md b/vendor/php-ffmpeg/php-ffmpeg/README.md index 9ef5e31081..d0c486412b 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/README.md +++ b/vendor/php-ffmpeg/php-ffmpeg/README.md @@ -2,18 +2,28 @@ [![Build Status](https://secure.travis-ci.org/alchemy-fr/PHP-FFmpeg.png?branch=master)](http://travis-ci.org/alchemy-fr/PHP-FFmpeg) +[![SensioLabsInsight](https://insight.sensiolabs.com/projects/607f3111-e2d7-44e8-8bcc-54dd64521983/big.png)](https://insight.sensiolabs.com/projects/607f3111-e2d7-44e8-8bcc-54dd64521983) + An Object Oriented library to convert video/audio files with FFmpeg / AVConv. Check another amazing repo : [PHP FFMpeg extras](https://github.com/alchemy-fr/PHP-FFMpeg-Extras), you will find lots of Audio/Video formats there. ## Your attention please +### How this library works : + This library requires a working FFMpeg install. You will need both FFMpeg and FFProbe binaries to use it. -Be sure that these binaries can be located with system PATH to get the benefit of the binary detection, +Be sure that these binaries can be located with system PATH to get the benefit of the binary detection, otherwise you should have to explicitely give the binaries path on load. For Windows users : Please find the binaries at http://ffmpeg.zeranoe.com/builds/. +### Known issues : + +- Using rotate and resize will produce a corrupted output when using +[libav](http://libav.org/) 0.8. The bug is fixed in version 9. This bug does not +appear in latest ffmpeg version. + ## Installation The recommended way to install PHP-FFMpeg is through [Composer](https://getcomposer.org). @@ -21,7 +31,7 @@ The recommended way to install PHP-FFMpeg is through [Composer](https://getcompo ```json { "require": { - "php-ffmpeg/php-ffmpeg": "0.3.x-dev@dev" + "php-ffmpeg/php-ffmpeg": "~0.4" } } ``` @@ -73,8 +83,17 @@ $ffmpeg = FFMpeg\FFMpeg::create(array( ### Manipulate media -`FFMpeg\FFMpeg` creates media based on file paths. To open a file path, use the -`FFMpeg\FFMpeg::open` method. +`FFMpeg\FFMpeg` creates media based on URIs. URIs could be either a pointer to a +local filesystem resource, an HTTP resource or any resource supported by FFmpeg. + +**Note** : To list all supported resource type of your FFmpeg build, use the +`-protocols` command : + +``` +ffmpeg -protocols +``` + +To open a resource, use the `FFMpeg\FFMpeg::open` method. ```php $ffmpeg->open('video.mpeg'); @@ -93,12 +112,18 @@ video. Frames can be extracted. You can transcode videos using the `FFMpeg\Media\Video:save` method. You will pass a `FFMpeg\Format\FormatInterface` for that. +Please note that audio and video bitrate are set on the format. + ```php $format = new Format\Video\X264(); $format->on('progress', function ($video, $format, $percentage) { echo "$percentage % transcoded"; }); +$format + -> setKiloBitrate(1000) + -> setAudioKiloBitrate(256); + $video->save($format, 'video.avi'); ``` @@ -137,6 +162,20 @@ $video ->synchronize(); ``` +###### Rotate + +Rotates a video to a given angle. + +```php +$video->filters()->rotate($angle); +``` + +The `$angle` parameter must be one of the following constants : + +- `FFMpeg\Filters\Video\RotateFilter::ROTATE_90` : 90° clockwise +- `FFMpeg\Filters\Video\RotateFilter::ROTATE_180` : 180° +- `FFMpeg\Filters\Video\RotateFilter::ROTATE_270` : 90° counterclockwise + ###### Resize Resizes a video to a given size. @@ -175,6 +214,19 @@ filters solves this issue. $video->filters()->synchronize(); ``` +###### Clip + +Cuts the video at a desired point. + +```php +$video->filters()->clip(FFMpeg\Coordinate\TimeCode::fromSeconds(30), FFMpeg\Coordinate\TimeCode::fromSeconds(15)); +``` + +The clip filter takes two parameters: + +- `$start`, an instance of `FFMpeg\Coordinate\TimeCode`, specifies the start point of the clip +- `$duration`, optional, an instance of `FFMpeg\Coordinate\TimeCode`, specifies the duration of the clip + #### Audio `FFMpeg\Media\Audio` can be transcoded, ie : change codec, isolate audio or @@ -185,12 +237,17 @@ video. Frames can be extracted. You can transcode audios using the `FFMpeg\Media\Audio:save` method. You will pass a `FFMpeg\Format\FormatInterface` for that. +Please note that audio kilobitrate is set on the audio format. + ```php $format = new Format\Audio\Flac(); $format->on('progress', function ($$audio, $format, $percentage) { echo "$percentage % transcoded"; }); +$format + -> setAudioKiloBitrate(256); + $audio->save($format, 'track.flac'); ``` diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpeg.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpeg.php index 1abc05adf9..91ce361b81 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpeg.php +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpeg.php @@ -14,6 +14,7 @@ namespace FFMpeg; use Alchemy\BinaryDriver\ConfigurationInterface; use FFMpeg\Driver\FFMpegDriver; use FFMpeg\Exception\InvalidArgumentException; +use FFMpeg\Exception\RuntimeException; use FFMpeg\Media\Audio; use FFMpeg\Media\Video; use Psr\Log\LoggerInterface; @@ -88,12 +89,10 @@ class FFMpeg */ public function open($pathfile) { - if (!file_exists($pathfile)) { - throw new InvalidArgumentException(sprintf('File %s does not exists', $pathfile)); + if (null === $streams = $this->ffprobe->streams($pathfile)) { + throw new RuntimeException(sprintf('Unable to probe "%s".', $pathfile)); } - $streams = $this->ffprobe->streams($pathfile); - if (0 < count($streams->videos())) { return new Video($pathfile, $this->driver, $this->ffprobe); } elseif (0 < count($streams->audios())) { diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpegServiceProvider.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpegServiceProvider.php index 2d1419df76..4bb489b093 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpegServiceProvider.php +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFMpegServiceProvider.php @@ -35,7 +35,7 @@ class FFMpegServiceProvider implements ServiceProviderInterface return array_replace($app['ffmpeg.default.configuration'], $app['ffmpeg.configuration']); }); - $app['ffmpeg'] = $app['ffmpeg.ffmpeg'] = $app->share(function(Application $app) { + $app['ffmpeg'] = $app['ffmpeg.ffmpeg'] = $app->share(function (Application $app) { $configuration = $app['ffmpeg.configuration.build']; if (isset($configuration['ffmpeg.timeout'])) { @@ -49,7 +49,7 @@ class FFMpegServiceProvider implements ServiceProviderInterface return new ArrayCache(); }); - $app['ffmpeg.ffprobe'] = $app->share(function(Application $app) { + $app['ffmpeg.ffprobe'] = $app->share(function (Application $app) { $configuration = $app['ffmpeg.configuration.build']; if (isset($configuration['ffmpeg.timeout'])) { diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php index 7a32105815..f4790bd175 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php @@ -226,8 +226,13 @@ class FFProbe $parseIsToDo = false; if ($allowJson && $this->optionsTester->has('-print_format')) { + // allowed in latest PHP-FFmpeg version $commands[] = '-print_format'; $commands[] = 'json'; + } elseif ($allowJson && $this->optionsTester->has('-of')) { + // option has changed in avconv 9 + $commands[] = '-of'; + $commands[] = 'json'; } else { $parseIsToDo = true; } diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe/DataMapping/AbstractData.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe/DataMapping/AbstractData.php index d35e2b6d9c..6fee9e2ccc 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe/DataMapping/AbstractData.php +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe/DataMapping/AbstractData.php @@ -50,6 +50,21 @@ abstract class AbstractData implements \Countable return $this->properties[$property]; } + /** + * Sets the property value given its name. + * + * @param string $property + * @param mixed $value + * + * @return AbstractData + */ + public function set($property, $value) + { + $this->properties[$property] = $value; + + return $this; + } + /** * Returns all property names. * diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe/DataMapping/Stream.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe/DataMapping/Stream.php index 5c32520c8c..55957afa08 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe/DataMapping/Stream.php +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe/DataMapping/Stream.php @@ -71,7 +71,9 @@ class Stream extends AbstractData } if (null !== $displayRatio && null !== $sampleRatio) { - $width = round($width / $sampleRatio[0] * $sampleRatio[1] * $displayRatio[0] / $displayRatio[1]); + if ($sampleRatio[0] !== 1 && $sampleRatio[1] !== 1) { + $width = round($width / $sampleRatio[0] * $sampleRatio[1] * $displayRatio[0] / $displayRatio[1]); + } } return new Dimension($width, $height); diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Filters/Frame/FrameFilters.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Filters/Frame/FrameFilters.php index 255da0c48e..e4b9614dc8 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Filters/Frame/FrameFilters.php +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Filters/Frame/FrameFilters.php @@ -24,10 +24,10 @@ class FrameFilters /** * Fixes the display ratio of the output frame. - * + * * In case the sample ratio and display ratio are different, image may be * anamorphozed. This filter fixes this by specifying the output size. - * + * * @return FrameFilters */ public function fixDisplayRatio() diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Filters/Video/ClipFilter.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Filters/Video/ClipFilter.php new file mode 100644 index 0000000000..5e015a821a --- /dev/null +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Filters/Video/ClipFilter.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FFMpeg\Filters\Video; + +use FFMpeg\Format\VideoInterface; +use FFMpeg\Media\Video; +use FFMpeg\Coordinate\TimeCode; + +class ClipFilter implements VideoFilterInterface +{ + /** @var TimeCode */ + private $start; + /** @var TimeCode */ + private $duration; + /** @var integer */ + private $priority; + + public function __construct(TimeCode $start, TimeCode $duration = null, $priority = 0) + { + $this->start = $start; + $this->duration = $duration; + $this->priority = $priority; + } + + /** + * {@inheritdoc} + */ + public function getPriority() + { + return $this->priority; + } + + /** + * @return TimeCode + */ + public function getStart() + { + return $this->start; + } + + /** + * @return TimeCode + */ + public function getDuration() + { + return $this->duration; + } + + /** + * {@inheritdoc} + */ + public function apply(Video $video, VideoInterface $format) + { + $commands = array('-ss', (string) $this->start); + + if ($this->duration !== null) { + $commands[] = '-t'; + $commands[] = (string) $this->duration; + } + + return $commands; + } +} diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Filters/Video/RotateFilter.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Filters/Video/RotateFilter.php new file mode 100644 index 0000000000..1ccfff574e --- /dev/null +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Filters/Video/RotateFilter.php @@ -0,0 +1,82 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FFMpeg\Filters\Video; + +use FFMpeg\Coordinate\Dimension; +use FFMpeg\Exception\InvalidArgumentException; +use FFMpeg\Media\Video; +use FFMpeg\Format\VideoInterface; + +class RotateFilter implements VideoFilterInterface +{ + const ROTATE_90 = 'transpose=1'; + const ROTATE_180 = 'hflip,vflip'; + const ROTATE_270 = 'transpose=2'; + + /** @var string */ + private $angle; + /** @var integer */ + private $priority; + + public function __construct($angle, $priority = 0) + { + $this->setAngle($angle); + $this->priority = (int) $priority; + } + + /** + * {@inheritdoc} + */ + public function getPriority() + { + return $this->priority; + } + + /** + * @return Dimension + */ + public function getAngle() + { + return $this->angle; + } + + /** + * {@inheritdoc} + */ + public function apply(Video $video, VideoInterface $format) + { + if (in_array($this->angle, array(self::ROTATE_90, self::ROTATE_270), true)) { + foreach ($video->getStreams()->videos() as $stream) { + if ($stream->has('width') && $stream->has('height')) { + $width = $stream->get('width'); + $stream->set('width', $stream->get('height')); + $stream->set('height', $width); + } + } + } + + return array('-vf', $this->angle, '-metadata:s:v:0', 'rotate=0'); + } + + private function setAngle($angle) + { + switch ($angle) { + case self::ROTATE_90: + case self::ROTATE_180: + case self::ROTATE_270: + $this->angle = $angle; + break; + default: + throw new InvalidArgumentException('Invalid angle value.'); + } + } +} diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Filters/Video/SynchronizeFilter.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Filters/Video/SynchronizeFilter.php index 8ca72e09cc..97a4043b3e 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Filters/Video/SynchronizeFilter.php +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Filters/Video/SynchronizeFilter.php @@ -39,6 +39,6 @@ class SynchronizeFilter implements VideoFilterInterface */ public function apply(Video $video, VideoInterface $format) { - return array('-async', '1'); + return array('-async', '1', '-metadata:s:v:0', 'start_time=0'); } } diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Filters/Video/VideoFilters.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Filters/Video/VideoFilters.php index d0ffc8d04e..30b4b2adf2 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Filters/Video/VideoFilters.php +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Filters/Video/VideoFilters.php @@ -67,6 +67,21 @@ class VideoFilters extends AudioFilters return $this; } + /** + * Clips (cuts) the video. + * + * @param TimeCode $start + * @param TimeCode $duration + * + * @return VideoFilters + */ + public function clip($start, $duration = null) + { + $this->media->addFilter(new ClipFilter($start, $duration)); + + return $this; + } + /** * Resamples the audio file. * @@ -80,4 +95,11 @@ class VideoFilters extends AudioFilters return $this; } + + public function rotate($angle) + { + $this->media->addFilter(new RotateFilter($angle, 30)); + + return $this; + } } diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/Audio/DefaultAudio.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/Audio/DefaultAudio.php index a0002d1da1..7e099e3949 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/Audio/DefaultAudio.php +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/Audio/DefaultAudio.php @@ -103,4 +103,12 @@ abstract class DefaultAudio extends EventEmitter implements AudioInterface, Prog return array($listener); } + + /** + * {@inheritDoc} + */ + public function getPasses() + { + return 1; + } } diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/AudioInterface.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/AudioInterface.php index 3cf254bf05..10e6854e74 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/AudioInterface.php +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/AudioInterface.php @@ -19,13 +19,6 @@ interface AudioInterface extends FormatInterface */ public function getAudioKiloBitrate(); - /** - * Returns an array of extra parameters to add to ffmpeg commandline. - * - * @return array() - */ - public function getExtraParams(); - /** * Returns the audio codec. * diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/FormatInterface.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/FormatInterface.php index 4495f7aa4c..979a09177d 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/FormatInterface.php +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/FormatInterface.php @@ -12,4 +12,17 @@ namespace FFMpeg\Format; interface FormatInterface { + /** + * Returns the number of passes. + * + * @return string + */ + public function getPasses(); + + /** + * Returns an array of extra parameters to add to ffmpeg commandline. + * + * @return array() + */ + public function getExtraParams(); } diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/ProgressListener/AbstractProgressListener.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/ProgressListener/AbstractProgressListener.php index 8636825e1f..cda6815e86 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/ProgressListener/AbstractProgressListener.php +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/ProgressListener/AbstractProgressListener.php @@ -154,6 +154,10 @@ abstract class AbstractProgressListener extends EventEmitter implements Listener $this->initialize(); } + if (null === $this->totalSize || null === $this->duration) { + return; + } + $matches = array(); if (preg_match($this->getPattern(), $progress, $matches) !== 1) { @@ -226,9 +230,14 @@ abstract class AbstractProgressListener extends EventEmitter implements Listener private function initialize() { - $format = $this->ffprobe->format($this->pathfile); + try { + $format = $this->ffprobe->format($this->pathfile); + } catch (RuntimeException $e) { + return; + } if (false === $format->has('size') || false === $format->has('duration')) { + return; throw new RuntimeException(sprintf('Unable to probe format for %s', $this->pathfile)); } diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/Video/DefaultVideo.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/Video/DefaultVideo.php index f74b23eda9..b33965d918 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/Video/DefaultVideo.php +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/Video/DefaultVideo.php @@ -86,14 +86,6 @@ abstract class DefaultVideo extends DefaultAudio implements VideoInterface return $this; } - /** - * {@inheritDoc} - */ - public function getPasses() - { - return 1; - } - /** * @return integer */ diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/VideoInterface.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/VideoInterface.php index 6bf91a1dbb..fa6fb0cb83 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/VideoInterface.php +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Format/VideoInterface.php @@ -20,13 +20,6 @@ interface VideoInterface extends AudioInterface */ public function getKiloBitrate(); - /** - * Returns the number of passes. - * - * @return string - */ - public function getPasses(); - /** * Returns the modulus used by the Resizable video. * diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/AbstractMediaType.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/AbstractMediaType.php index 4cb3345959..45bb0c6e15 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/AbstractMediaType.php +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/AbstractMediaType.php @@ -12,7 +12,6 @@ namespace FFMpeg\Media; use FFMpeg\Driver\FFMpegDriver; -use FFMpeg\Exception\InvalidArgumentException; use FFMpeg\FFProbe; use FFMpeg\Filters\FiltersCollection; use FFMpeg\Media\MediaTypeInterface; @@ -30,8 +29,6 @@ abstract class AbstractMediaType implements MediaTypeInterface public function __construct($pathfile, FFMpegDriver $driver, FFProbe $ffprobe) { - $this->ensureFileIsPresent($pathfile); - $this->pathfile = $pathfile; $this->driver = $driver; $this->ffprobe = $ffprobe; @@ -106,15 +103,6 @@ abstract class AbstractMediaType implements MediaTypeInterface return $this->filters; } - protected function ensureFileIsPresent($filename) - { - if (!is_file($filename) || !is_readable($filename)) { - throw new InvalidArgumentException(sprintf( - '%s is not present or not readable', $filename - )); - } - } - protected function cleanupTemporaryFile($filename) { if (file_exists($filename) && is_writable($filename)) { diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/AbstractStreamableMedia.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/AbstractStreamableMedia.php index 545801572e..e09bba00fd 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/AbstractStreamableMedia.php +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/AbstractStreamableMedia.php @@ -16,12 +16,18 @@ use FFMpeg\FFProbe\DataMapping\StreamCollection; abstract class AbstractStreamableMedia extends AbstractMediaType { + private $streams; + /** * @return StreamCollection */ public function getStreams() { - return $this->ffprobe->streams($this->pathfile); + if (null === $this->streams) { + $this->streams = $this->ffprobe->streams($this->pathfile); + } + + return $this->streams; } /** diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/Frame.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/Frame.php index a48c50e884..b50e54993b 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/Frame.php +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/Frame.php @@ -110,7 +110,7 @@ class Frame extends AbstractMediaType foreach ($this->filters as $filter) { $commands = array_merge($commands, $filter->apply($this)); } - + $commands = array_merge($commands, array($pathfile)); try { diff --git a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/Video.php b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/Video.php index b51549a9c4..ae2996fe8b 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/Video.php +++ b/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/Video.php @@ -20,6 +20,8 @@ use FFMpeg\Filters\Video\VideoFilters; use FFMpeg\Filters\FilterInterface; use FFMpeg\Format\FormatInterface; use FFMpeg\Format\ProgressableInterface; +use FFMpeg\Format\AudioInterface; +use FFMpeg\Format\VideoInterface; use FFMpeg\Media\Frame; use Neutron\TemporaryFilesystem\Manager as FsManager; @@ -67,43 +69,51 @@ class Video extends Audio if ($this->driver->getConfiguration()->has('ffmpeg.threads')) { $filters->add(new SimpleFilter(array('-threads', $this->driver->getConfiguration()->get('ffmpeg.threads')))); } - if (null !== $format->getVideoCodec()) { - $filters->add(new SimpleFilter(array('-vcodec', $format->getVideoCodec()))); + if ($format instanceOf VideoInterface) { + if (null !== $format->getVideoCodec()) { + $filters->add(new SimpleFilter(array('-vcodec', $format->getVideoCodec()))); + } } - if (null !== $format->getAudioCodec()) { - $filters->add(new SimpleFilter(array('-acodec', $format->getAudioCodec()))); + if ($format instanceOf AudioInterface) { + if (null !== $format->getAudioCodec()) { + $filters->add(new SimpleFilter(array('-acodec', $format->getAudioCodec()))); + } } foreach ($filters as $filter) { $commands = array_merge($commands, $filter->apply($this, $format)); } - $commands[] = '-b:v'; - $commands[] = $format->getKiloBitrate() . 'k'; - $commands[] = '-refs'; - $commands[] = '6'; - $commands[] = '-coder'; - $commands[] = '1'; - $commands[] = '-sc_threshold'; - $commands[] = '40'; - $commands[] = '-flags'; - $commands[] = '+loop'; - $commands[] = '-me_range'; - $commands[] = '16'; - $commands[] = '-subq'; - $commands[] = '7'; - $commands[] = '-i_qfactor'; - $commands[] = '0.71'; - $commands[] = '-qcomp'; - $commands[] = '0.6'; - $commands[] = '-qdiff'; - $commands[] = '4'; - $commands[] = '-trellis'; - $commands[] = '1'; - - if (null !== $format->getAudioKiloBitrate()) { - $commands[] = '-b:a'; - $commands[] = $format->getAudioKiloBitrate() . 'k'; + if ($format instanceOf VideoInterface) { + $commands[] = '-b:v'; + $commands[] = $format->getKiloBitrate() . 'k'; + $commands[] = '-refs'; + $commands[] = '6'; + $commands[] = '-coder'; + $commands[] = '1'; + $commands[] = '-sc_threshold'; + $commands[] = '40'; + $commands[] = '-flags'; + $commands[] = '+loop'; + $commands[] = '-me_range'; + $commands[] = '16'; + $commands[] = '-subq'; + $commands[] = '7'; + $commands[] = '-i_qfactor'; + $commands[] = '0.71'; + $commands[] = '-qcomp'; + $commands[] = '0.6'; + $commands[] = '-qdiff'; + $commands[] = '4'; + $commands[] = '-trellis'; + $commands[] = '1'; + } + + if ($format instanceOf AudioInterface) { + if (null !== $format->getAudioKiloBitrate()) { + $commands[] = '-b:a'; + $commands[] = $format->getAudioKiloBitrate() . 'k'; + } } $fs = FsManager::create(); diff --git a/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Functional/FunctionalTestCase.php b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Functional/FunctionalTestCase.php index 062bf68950..25e646100b 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Functional/FunctionalTestCase.php +++ b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Functional/FunctionalTestCase.php @@ -6,6 +6,9 @@ use FFMpeg\FFMpeg; abstract class FunctionalTestCase extends \PHPUnit_Framework_TestCase { + /** + * @return FFMpeg + */ public function getFFMpeg() { return FFMpeg::create(array('timeout' => 300)); diff --git a/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Functional/VideoTranscodeTest.php b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Functional/VideoTranscodeTest.php index 2b9ff24142..9e690bf9e7 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Functional/VideoTranscodeTest.php +++ b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Functional/VideoTranscodeTest.php @@ -2,7 +2,11 @@ namespace FFMpeg\Functional; +use FFMpeg\Coordinate\Dimension; +use FFMpeg\Filters\Video\ResizeFilter; +use FFMpeg\Filters\Video\RotateFilter; use FFMpeg\Format\Video\X264; +use FFMpeg\Media\Video; class VideoTranscodeTest extends FunctionalTestCase { @@ -35,4 +39,80 @@ class VideoTranscodeTest extends FunctionalTestCase $this->assertFileExists($filename); unlink($filename); } + + /** + * @expectedException \FFMpeg\Exception\RuntimeException + */ + public function testTranscodeInvalidFile() + { + $ffmpeg = $this->getFFMpeg(); + $ffmpeg->open(__DIR__ . '/../../files/UnknownFileTest.ogv'); + } + + public function testSaveInvalidForgedVideo() + { + $ffmpeg = $this->getFFMpeg(); + $video = new Video(__DIR__ . '/../../files/UnknownFileTest.ogv', $ffmpeg->getFFMpegDriver(), $ffmpeg->getFFProbe()); + + $this->setExpectedException('FFMpeg\Exception\RuntimeException'); + $video->save(new X264('libvo_aacenc'), __DIR__ . '/output/output-x264.mp4'); + } + + public function testTranscodePortraitVideo() + { + $info = $this->getNameAndVersion(); + + if ($info['name'] === 'avconv' && version_compare($info['version'], '0.9', '<')) { + $this->markTestSkipped('This version of avconv is buggy and does not support this test.'); + } + + $filename = __DIR__ . '/output/output-x264.mp4'; + if (is_file($filename)) { + unlink(__DIR__ . '/output/output-x264.mp4'); + } + + $ffmpeg = $this->getFFMpeg(); + $video = $ffmpeg->open(__DIR__ . '/../../files/portrait.MOV'); + + $video->filters() + ->resize(new Dimension(320, 240), ResizeFilter::RESIZEMODE_INSET) + ->rotate(RotateFilter::ROTATE_90); + $video->save(new X264('libvo_aacenc'), $filename); + + $dimension = $ffmpeg->getFFProbe() + ->streams($filename) + ->videos() + ->first() + ->getDimensions(); + + $this->assertLessThan(1, $dimension->getRatio(false)->getValue()); + $this->assertEquals(240, $dimension->getHeight()); + + $this->assertFileExists($filename); + unlink($filename); + } + + private function getNameAndVersion() + { + $binary = $this + ->getFFMpeg() + ->getFFMpegDriver() + ->getProcessBuilderFactory() + ->getBinary(); + + $output = $matches = null; + exec($binary . ' -version 2>&1', $output); + + if (!isset($output[0])) { + return array('name' => null, 'version' => null); + } + + preg_match('/^([a-z]+)\s+version\s+([0-9\.]+)/i', $output[0], $matches); + + if (count($matches) > 0) { + return array('name' => $matches[1], 'version' => $matches[2]); + } + + return array('name' => null, 'version' => null); + } } diff --git a/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/FFMpegTest.php b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/FFMpegTest.php index 6695df09d4..f9e87796ff 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/FFMpegTest.php +++ b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/FFMpegTest.php @@ -10,7 +10,8 @@ use FFMpeg\FFProbe\DataMapping\Stream; class FFMpegTest Extends TestCase { /** - * @expectedException FFMpeg\Exception\InvalidArgumentException + * @expectedException \FFMpeg\Exception\RuntimeException + * @expectedExceptionMessage Unable to probe "/path/to/unknown/file". */ public function testOpenInvalid() { @@ -58,7 +59,7 @@ class FFMpegTest Extends TestCase } /** - * @expectedException FFMpeg\Exception\InvalidArgumentException + * @expectedException \FFMpeg\Exception\InvalidArgumentException */ public function testOpenUnknown() { diff --git a/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/FFProbe/DataMapping/StreamTest.php b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/FFProbe/DataMapping/StreamTest.php index 6f71d7ef9a..dc2877611c 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/FFProbe/DataMapping/StreamTest.php +++ b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/FFProbe/DataMapping/StreamTest.php @@ -83,6 +83,12 @@ class StreamTest extends TestCase $this->assertEquals(new Dimension(1280, 720), $stream->getDimensions()); } + public function testGetDimensionsFromVideoWith11SampleRatio() + { + $stream = new Stream(array('codec_type' => 'video', 'width' => 1920, 'height' => 1080, 'sample_aspect_ratio' => '1:1', 'display_aspect_ratio' => '16:9')); + $this->assertEquals(new Dimension(1920, 1080), $stream->getDimensions()); + } + /** * @dataProvider provideInvalidRatios */ @@ -91,7 +97,7 @@ class StreamTest extends TestCase $stream = new Stream(array('codec_type' => 'video', 'width' => 960, 'height' => 720, 'sample_aspect_ratio' => $invalidRatio, 'display_aspect_ratio' => '16:9')); $this->assertEquals(new Dimension(960, 720), $stream->getDimensions()); } - + public function provideInvalidRatios() { return array(array('0:1'), array('2:1:3')); diff --git a/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Filters/Frame/DisplayRatioFixerFilterTest.php b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Filters/Frame/DisplayRatioFixerFilterTest.php index bb642b40b0..ca8035f70b 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Filters/Frame/DisplayRatioFixerFilterTest.php +++ b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Filters/Frame/DisplayRatioFixerFilterTest.php @@ -15,12 +15,12 @@ class DisplayRatioFixerFilterTest extends TestCase { $stream = new Stream(array('codec_type' => 'video', 'width' => 960, 'height' => 720)); $streams = new StreamCollection(array($stream)); - + $video = $this->getVideoMock(__FILE__); $video->expects($this->once()) ->method('getStreams') ->will($this->returnValue($streams)); - + $frame = new Frame($video, $this->getFFMpegDriverMock(), $this->getFFProbeMock(), new TimeCode(0, 0, 0, 0)); $filter = new DisplayRatioFixerFilter(); $this->assertEquals(array('-s', '960x720'), $filter->apply($frame)); diff --git a/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Filters/Video/RotateFilterTest.php b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Filters/Video/RotateFilterTest.php new file mode 100644 index 0000000000..95c676f3d1 --- /dev/null +++ b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Filters/Video/RotateFilterTest.php @@ -0,0 +1,72 @@ + 320, 'height' => 240, 'codec_type' => 'video')); + $streams = new StreamCollection(array($stream)); + + $video = $this->getVideoMock(); + $video->expects($this->once()) + ->method('getStreams') + ->will($this->returnValue($streams)); + + $format = $this->getMock('FFMpeg\Format\VideoInterface'); + + $filter = new RotateFilter($value); + $this->assertEquals(array('-vf', $value, '-metadata:s:v:0', 'rotate=0'), $filter->apply($video, $format)); + + $this->assertEquals(240, $stream->get('width')); + $this->assertEquals(320, $stream->get('height')); + } + + public function provide90degresTranspositions() + { + return array( + array(RotateFilter::ROTATE_90), + array(RotateFilter::ROTATE_270), + ); + } + + /** + * @dataProvider provideDegresWithoutTranspositions + */ + public function testApplyWithoutSizeTransformation($value) + { + $video = $this->getVideoMock(); + $video->expects($this->never()) + ->method('getStreams'); + + $format = $this->getMock('FFMpeg\Format\VideoInterface'); + + $filter = new RotateFilter($value); + $this->assertEquals(array('-vf', $value, '-metadata:s:v:0', 'rotate=0'), $filter->apply($video, $format)); + } + + public function provideDegresWithoutTranspositions() + { + return array( + array(RotateFilter::ROTATE_180), + ); + } + + /** + * @expectedException \FFMpeg\Exception\InvalidArgumentException + * @expectedExceptionMessage Invalid angle value. + */ + public function testApplyInvalidAngle() + { + new RotateFilter('90'); + } +} diff --git a/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Filters/Video/SynchronizeFilterTest.php b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Filters/Video/SynchronizeFilterTest.php index 69fb6813ae..7bf2dc22ce 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Filters/Video/SynchronizeFilterTest.php +++ b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Filters/Video/SynchronizeFilterTest.php @@ -13,6 +13,6 @@ class SynchronizeFilterTest extends TestCase $format = $this->getMock('FFMpeg\Format\VideoInterface'); $filter = new SynchronizeFilter(); - $this->assertEquals(array('-async', '1'), $filter->apply($video, $format)); + $this->assertEquals(array('-async', '1', '-metadata:s:v:0', 'start_time=0'), $filter->apply($video, $format)); } } diff --git a/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Media/AbstractMediaTestCase.php b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Media/AbstractMediaTestCase.php index 1af48a5651..c30f1984a5 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Media/AbstractMediaTestCase.php +++ b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Media/AbstractMediaTestCase.php @@ -6,5 +6,4 @@ use FFMpeg\Tests\TestCase; abstract class AbstractMediaTestCase extends TestCase { - abstract public function testWithInvalidFile(); } diff --git a/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Media/AudioProg.php b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Media/AudioProg.php new file mode 100644 index 0000000000..e4554d4808 --- /dev/null +++ b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Media/AudioProg.php @@ -0,0 +1,10 @@ +getFFMpegDriverMock(); - $ffprobe = $this->getFFProbeMock(); - - new Audio('/no/file', $driver, $ffprobe); - } - public function testFiltersReturnsAudioFilters() { $driver = $this->getFFMpegDriverMock(); @@ -333,7 +321,3 @@ class AudioTest extends AbstractStreamableTestCase return 'FFMpeg\Media\Audio'; } } - -abstract class AudioProg implements ProgressableInterface, AudioInterface -{ -} diff --git a/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Media/FrameTest.php b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Media/FrameTest.php index b64d6e91e1..8f9af043bc 100644 --- a/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Media/FrameTest.php +++ b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Media/FrameTest.php @@ -6,14 +6,6 @@ use FFMpeg\Media\Frame; class FrameTest extends AbstractMediaTestCase { - /** - * @expectedException FFMpeg\Exception\InvalidArgumentException - */ - public function testWithInvalidFile() - { - new Frame($this->getVideoMock('/No/file'), $this->getFFMpegDriverMock(), $this->getFFProbeMock(), $this->getTimeCodeMock()); - } - public function testGetTimeCode() { $driver = $this->getFFMpegDriverMock(); diff --git a/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Media/Prog.php b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Media/Prog.php new file mode 100644 index 0000000000..98c0920475 --- /dev/null +++ b/vendor/php-ffmpeg/php-ffmpeg/tests/FFMpeg/Tests/Media/Prog.php @@ -0,0 +1,10 @@ +getFFMpegDriverMock(); - $ffprobe = $this->getFFProbeMock(); - - new Video('/no/file', $driver, $ffprobe); - } - public function testFiltersReturnsVideoFilters() { $driver = $this->getFFMpegDriverMock(); @@ -259,6 +247,20 @@ class VideoTest extends AbstractStreamableTestCase ->method('getPasses') ->will($this->returnValue(2)); + $audioFormat = $this->getMock('FFMpeg\Format\AudioInterface'); + $audioFormat->expects($this->any()) + ->method('getExtraParams') + ->will($this->returnValue(array())); + $audioFormat->expects($this->any()) + ->method('getAudioCodec') + ->will($this->returnValue('patati-patata-audio')); + $audioFormat->expects($this->any()) + ->method('getAudioKiloBitrate') + ->will($this->returnValue(92)); + $audioFormat->expects($this->any()) + ->method('getPasses') + ->will($this->returnValue(1)); + $audioVideoFormat = $this->getMock('FFMpeg\Format\VideoInterface'); $audioVideoFormat->expects($this->any()) ->method('getExtraParams') @@ -333,6 +335,24 @@ class VideoTest extends AbstractStreamableTestCase ->method('getPasses') ->will($this->returnValue(2)); + $progressableAudioFormat = $this->getMockBuilder('FFMpeg\Tests\Media\AudioProg') + ->disableOriginalConstructor()->getMock(); + $progressableAudioFormat->expects($this->any()) + ->method('getExtraParams') + ->will($this->returnValue(array())); + $progressableAudioFormat->expects($this->any()) + ->method('getAudioCodec') + ->will($this->returnValue('patati-patata-audio')); + $progressableAudioFormat->expects($this->any()) + ->method('createProgressListener') + ->will($this->returnValue($listeners)); + $progressableAudioFormat->expects($this->any()) + ->method('getAudioKiloBitrate') + ->will($this->returnValue(92)); + $progressableAudioFormat->expects($this->any()) + ->method('getPasses') + ->will($this->returnValue(1)); + return array( array(false, array(array( '-y', '-i', __FILE__, '-b:v', '663k', @@ -451,6 +471,18 @@ class VideoTest extends AbstractStreamableTestCase '-qdiff', '4', '-trellis', '1', '-b:a', '92k', '-pass', '2', '-passlogfile', '/target/file', )), $listeners, $progressableFormat), + array(true, array(array( + '-y', '-i', __FILE__, + '-threads', 24, '-acodec', 'patati-patata-audio', + '-b:a', '92k', + '/target/file', + )), null, $audioFormat), + array(true, array(array( + '-y', '-i', __FILE__, + '-threads', 24, '-acodec', 'patati-patata-audio', + '-b:a', '92k', + '/target/file', + )), $listeners, $progressableAudioFormat), ); } @@ -555,7 +587,3 @@ class VideoTest extends AbstractStreamableTestCase return 'FFMpeg\Media\Video'; } } - -abstract class Prog implements ProgressableInterface, VideoInterface -{ -} diff --git a/vendor/php-ffmpeg/php-ffmpeg/tests/files/portrait.MOV b/vendor/php-ffmpeg/php-ffmpeg/tests/files/portrait.MOV new file mode 100644 index 0000000000..4d31edcf62 Binary files /dev/null and b/vendor/php-ffmpeg/php-ffmpeg/tests/files/portrait.MOV differ diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/ConfigurationInterface.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/ConfigurationInterface.php index 9e2e209dd4..797c2c750a 100644 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/ConfigurationInterface.php +++ b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/ConfigurationInterface.php @@ -23,12 +23,12 @@ interface ConfigurationInterface * * @return string */ - public function getAliasName(); + function getAliasName(); /** * Returns whether multiple annotations of this type are allowed * * @return Boolean */ - public function allowArray(); + function allowArray(); } diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Method.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Method.php index b5ce66f5b4..730457db78 100644 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Method.php +++ b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Method.php @@ -68,7 +68,7 @@ class Method extends ConfigurationAnnotation } /** - * Only one method directive is allowed + * Only one cache directive is allowed * * @return Boolean * @see ConfigurationInterface diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/CacheListener.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/CacheListener.php index 56b7663862..d1282837f9 100644 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/CacheListener.php +++ b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/EventListener/CacheListener.php @@ -36,7 +36,7 @@ class CacheListener implements EventSubscriberInterface $response = $event->getResponse(); - if (!$response->isCacheable()) { + if (!$response->isSuccessful()) { return; } diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/meta/LICENSE b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/LICENSE similarity index 100% rename from vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/meta/LICENSE rename to vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/LICENSE diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/DateTimeParamConverter.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/DateTimeParamConverter.php index c63eb07946..fe4a8c0e61 100644 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/DateTimeParamConverter.php +++ b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/DateTimeParamConverter.php @@ -24,8 +24,8 @@ use DateTime; class DateTimeParamConverter implements ParamConverterInterface { /** - * {@inheritdoc} - * + * @{inheritdoc} + * * @throws NotFoundHttpException When invalid date given */ public function apply(Request $request, ConfigurationInterface $configuration) @@ -39,10 +39,6 @@ class DateTimeParamConverter implements ParamConverterInterface $options = $configuration->getOptions(); $value = $request->attributes->get($param); - if (!$value && $configuration->isOptional()) { - return false; - } - $date = isset($options['format']) ? DateTime::createFromFormat($options['format'], $value) : new DateTime($value); @@ -57,7 +53,7 @@ class DateTimeParamConverter implements ParamConverterInterface } /** - * {@inheritdoc} + * @{inheritdoc} */ public function supports(ConfigurationInterface $configuration) { diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/DoctrineParamConverter.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/DoctrineParamConverter.php index bfafdded54..f9a1e78326 100644 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/DoctrineParamConverter.php +++ b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/DoctrineParamConverter.php @@ -35,7 +35,7 @@ class DoctrineParamConverter implements ParamConverterInterface } /** - * {@inheritdoc} + * @{inheritdoc} * * @throws \LogicException When unable to guess how to get a Doctrine instance from the request information * @throws NotFoundHttpException When object not found @@ -161,7 +161,7 @@ class DoctrineParamConverter implements ParamConverterInterface } /** - * {@inheritdoc} + * @{inheritdoc} */ public function supports(ConfigurationInterface $configuration) { diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/ParamConverterInterface.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/ParamConverterInterface.php index 43f4408836..52acfd004c 100644 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/ParamConverterInterface.php +++ b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/ParamConverterInterface.php @@ -24,20 +24,20 @@ interface ParamConverterInterface { /** * Stores the object in the request. - * + * * @param Request $request The request * @param ConfigurationInterface $configuration Contains the name, class and options of the object - * + * * @return boolean True if the object has been successfully set, else false */ - public function apply(Request $request, ConfigurationInterface $configuration); + function apply(Request $request, ConfigurationInterface $configuration); /** * Checks if the object is supported. - * + * * @param ConfigurationInterface $configuration Should be an instance of ParamConverter - * + * * @return boolean True if the object is supported, else false */ - public function supports(ConfigurationInterface $configuration); + function supports(ConfigurationInterface $configuration); } diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/cache.rst b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/cache.rst index 7915def6fe..3c68e0fb07 100644 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/cache.rst +++ b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/cache.rst @@ -51,7 +51,7 @@ Annotation Response Method ``@Cache(expires="tomorrow")`` ``$response->setExpires()`` ``@Cache(smaxage="15")`` ``$response->setSharedMaxAge()`` ``@Cache(maxage="15")`` ``$response->setMaxAge()`` -``@Cache(vary={"Cookie"})`` ``$response->setVary()`` +``@Cache(vary=["Cookie"])`` ``$response->setVary()`` ``@Cache(public="true")`` ``$response->setPublic()`` ============================== =============== diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/converters.rst b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/converters.rst index 651e45b76b..10192e91db 100644 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/converters.rst +++ b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/converters.rst @@ -54,7 +54,7 @@ To detect which converter is run on a parameter the following process is run: Built-in Converters ------------------- -The bundle has two built-in converters, the Doctrine one and a DateTime +The bundle has two built-in converter, the Doctrine one and a DateTime converter. Doctrine Converter @@ -65,7 +65,7 @@ Converter Name: ``doctrine.orm`` The Doctrine Converter attempts to convert request attributes to Doctrine entities fetched from the database. Two different approaches are possible: -- Fetch object by primary key. +- Fetch object by primary key - Fetch object by one or several fields which contain unique values in the database. @@ -102,11 +102,6 @@ option:: { } -.. tip:: - - The ``id`` option specifies which placeholder from the route gets passed to the repository - method used. If no repository method is specified, ``find()`` is used by default. - This also allows you to have multiple converters in one action:: /** @@ -117,7 +112,7 @@ This also allows you to have multiple converters in one action:: { } -In the example above, the ``$post`` parameter is handled automatically, but ``$comment`` is +In the example above, the post parameter is handled automatically, but the comment is configured with the annotation since they can not both follow the default convention. If you want to match an entity using multiple fields use the ``mapping`` hash @@ -138,7 +133,7 @@ route parameter from being part of the criteria:: /** * @Route("/blog/{date}/{slug}") - * @ParamConverter("post", options={"exclude": {"date"}}) + * @ParamConverter("post", options={"exclude": ["date"]}) */ public function showAction(Post $post, \DateTime $date) { @@ -185,7 +180,8 @@ is accepted. You can be stricter with input given through the options:: Creating a Converter -------------------- -All converters must implement the ``ParamConverterInterface``:: +All converters must implement the +:class:`Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\ParamConverterInterface`:: namespace Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter; @@ -207,14 +203,14 @@ The ``ParamConverter`` instance has three information about the annotation: * ``name``: The attribute name; * ``class``: The attribute class name (can be any string representing a class name); -* ``options``: An array of options. +* ``options``: An array of options The ``apply()`` method is called whenever a configuration is supported. Based on the request attributes, it should set an attribute named ``$configuration->getName()``, which stores an object of class ``$configuration->getClass()``. -To register your converter service you must add a tag to your service: +To register your converter service you must add a tag to your service .. configuration-block:: diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/routing.rst b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/routing.rst index f697a6866d..8e4d91f89e 100644 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/routing.rst +++ b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/annotations/routing.rst @@ -4,7 +4,7 @@ Usage ----- -The ``@Route`` annotation maps a route pattern with a controller:: +The @Route annotation maps a route pattern with a controller:: use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; @@ -25,7 +25,7 @@ URL. This is equivalent to the following YAML configuration: .. code-block:: yaml blog_home: - path: / + pattern: / defaults: { _controller: SensioBlogBundle:Post:index } Like any route pattern, you can define placeholders, requirements, and default diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/index.rst b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/index.rst index 298556ab0f..b973754439 100644 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/index.rst +++ b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Resources/doc/index.rst @@ -128,7 +128,7 @@ This example shows all the available annotations in action:: * @Route("/{id}") * @Method("GET") * @ParamConverter("post", class="SensioBlogBundle:Post") - * @Template("SensioBlogBundle:Annot:show.html.twig", vars={"post"}) + * @Template("SensioBlogBundle:Annot:post.html.twig", vars={"post"}) * @Cache(smaxage="15") */ public function showAction(Post $post) diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Request/ParamConverter/DateTimeParamConverterTest.php b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Request/ParamConverter/DateTimeParamConverterTest.php index a59bb09238..b3cbfa4f3a 100644 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Request/ParamConverter/DateTimeParamConverterTest.php +++ b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Tests/Request/ParamConverter/DateTimeParamConverterTest.php @@ -47,23 +47,11 @@ class DateTimeParamConverterTest extends \PHPUnit_Framework_TestCase $this->converter->apply($request, $config); } - public function testApplyOptionalWithEmptyAttribute() - { - $request = new Request(array(), array(), array('start' => null)); - $config = $this->createConfiguration('DateTime', 'start'); - $config->expects($this->once()) - ->method('isOptional') - ->will($this->returnValue(true)); - - $this->assertFalse($this->converter->apply($request, $config)); - $this->assertNull($request->attributes->get('start')); - } - public function createConfiguration($class = null, $name = null) { $config = $this->getMock( 'Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationInterface', array( - 'getClass', 'getAliasName', 'getOptions', 'getName', 'allowArray', 'isOptional' + 'getClass', 'getAliasName', 'getOptions', 'getName', 'allowArray' )); if ($name !== null) { $config->expects($this->any()) diff --git a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/composer.json b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/composer.json index 33b1827882..1551d5bfdd 100644 --- a/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/composer.json +++ b/vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/composer.json @@ -22,5 +22,6 @@ "branch-alias": { "dev-master": "2.3.x-dev" } - } + }, + "minimum-stability": "dev" } diff --git a/vendor/silex/web-profiler/Silex/Provider/README.rst b/vendor/silex/web-profiler/Silex/Provider/README.rst index 2306105911..91b93e4558 100644 --- a/vendor/silex/web-profiler/Silex/Provider/README.rst +++ b/vendor/silex/web-profiler/Silex/Provider/README.rst @@ -35,11 +35,6 @@ to enable those if that's not already the case: $app->register(new Provider\TwigServiceProvider()); $app->register(new Provider\UrlGeneratorServiceProvider()); -If you are using ``FormServiceProvider``, the ``WebProfilerServiceProvider`` will detect that and -enable the corresponding panels. - -*Make sure to register all other required or used service providers before* ``WebProfilerServiceProvider``. - If you are using ``MonologServiceProvider`` for logs, you must also add ``symfony/monolog-bridge`` as a dependency in your ``composer.json`` to get the logs in the profiler. diff --git a/vendor/silex/web-profiler/Silex/Provider/WebProfilerServiceProvider.php b/vendor/silex/web-profiler/Silex/Provider/WebProfilerServiceProvider.php index 067fb14692..fb23c377a0 100644 --- a/vendor/silex/web-profiler/Silex/Provider/WebProfilerServiceProvider.php +++ b/vendor/silex/web-profiler/Silex/Provider/WebProfilerServiceProvider.php @@ -15,10 +15,6 @@ use Symfony\Bundle\WebProfilerBundle\Controller\ExceptionController; use Symfony\Bundle\WebProfilerBundle\Controller\RouterController; use Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController; use Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener; -use Symfony\Component\Form\Extension\DataCollector\FormDataCollector; -use Symfony\Component\Form\Extension\DataCollector\FormDataExtractor; -use Symfony\Component\Form\Extension\DataCollector\Proxy\ResolvedTypeFactoryDataCollectorProxy; -use Symfony\Component\Form\Extension\DataCollector\Type\DataCollectorTypeExtension; use Symfony\Component\HttpKernel\Profiler\Profiler; use Symfony\Component\HttpKernel\EventListener\ProfilerListener; use Symfony\Component\HttpKernel\Profiler\FileProfilerStorage; @@ -64,41 +60,18 @@ class WebProfilerServiceProvider implements ServiceProviderInterface, Controller array('time', '@WebProfiler/Collector/time.html.twig'), array('router', '@WebProfiler/Collector/router.html.twig'), array('memory', '@WebProfiler/Collector/memory.html.twig'), - array('form', '@WebProfiler/Collector/form.html.twig'), ); - $app['data_collectors'] = $app->share(function ($app) { - return array( - 'config' => $app->share(function ($app) { return new ConfigDataCollector(); }), - 'request' => $app->share(function ($app) { return new RequestDataCollector(); }), - 'exception' => $app->share(function ($app) { return new ExceptionDataCollector(); }), - 'events' => $app->share(function ($app) { return new EventDataCollector(); }), - 'logger' => $app->share(function ($app) { return new LoggerDataCollector($app['logger']); }), - 'time' => $app->share(function ($app) { return new TimeDataCollector(null, $app['stopwatch']); }), - 'router' => $app->share(function ($app) { return new RouterDataCollector(); }), - 'memory' => $app->share(function ($app) { return new MemoryDataCollector(); }), - ); - }); - - if (isset($app['form.resolved_type_factory']) && class_exists('\Symfony\Component\Form\Extension\DataCollector\FormDataCollector')) { - $app['data_collectors.form.extractor'] = $app->share(function () { return new FormDataExtractor(); }); - - $app['data_collectors'] = $app->share($app->extend('data_collectors', function ($collectors, $app) { - $collectors['form'] = $app->share(function ($app) { return new FormDataCollector($app['data_collectors.form.extractor']); }); - - return $collectors; - })); - - $app['form.resolved_type_factory'] = $app->share($app->extend('form.resolved_type_factory', function ($factory, $app) { - return new ResolvedTypeFactoryDataCollectorProxy($factory, $app['data_collectors']['form']($app)); - })); - - $app['form.type.extensions'] = $app->share($app->extend('form.type.extensions', function ($extensions, $app) { - $extensions[] = new DataCollectorTypeExtension($app['data_collectors']['form']($app)); - - return $extensions; - })); - } + $app['data_collectors'] = array( + 'config' => $app->share(function ($app) { return new ConfigDataCollector(); }), + 'request' => $app->share(function ($app) { return new RequestDataCollector(); }), + 'exception' => $app->share(function ($app) { return new ExceptionDataCollector(); }), + 'events' => $app->share(function ($app) { return new EventDataCollector(); }), + 'logger' => $app->share(function ($app) { return new LoggerDataCollector($app['logger']); }), + 'time' => $app->share(function ($app) { return new TimeDataCollector(null, $app['stopwatch']); }), + 'router' => $app->share(function ($app) { return new RouterDataCollector(); }), + 'memory' => $app->share(function ($app) { return new MemoryDataCollector(); }), + ); $app['web_profiler.controller.profiler'] = $app->share(function ($app) { return new ProfilerController($app['url_generator'], $app['profiler'], $app['twig'], $app['data_collector.templates'], $app['web_profiler.debug_toolbar.position']); diff --git a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php index 331a465b2f..5fd3090a79 100644 --- a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php +++ b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php @@ -365,9 +365,13 @@ abstract class AbstractDoctrineExtension extends Extension } $cacheDef->setPublic(false); - // generate a unique namespace for the given application - $namespace = 'sf2'.$this->getMappingResourceExtension().'_'.$objectManager['name'].'_'.md5($container->getParameter('kernel.root_dir').$container->getParameter('kernel.environment')); - $cacheDef->addMethodCall('setNamespace', array($namespace)); + + if (!isset($cacheDriver['namespace'])) { + // generate a unique namespace for the given application + $cacheDriver['namespace'] = 'sf2'.$this->getMappingResourceExtension().'_'.$objectManager['name'].'_'.hash('sha256',($container->getParameter('kernel.root_dir').$container->getParameter('kernel.environment'))); + } + + $cacheDef->addMethodCall('setNamespace', array($cacheDriver['namespace'])); $container->setDefinition($cacheDriverService, $cacheDef); } diff --git a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php index 4e871e563a..24688d1c1a 100644 --- a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php +++ b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php @@ -53,6 +53,13 @@ class RegisterEventListenersAndSubscribersPass implements CompilerPassInterface return; } + $taggedSubscribers = $container->findTaggedServiceIds($this->tagPrefix.'.event_subscriber'); + $taggedListeners = $container->findTaggedServiceIds($this->tagPrefix.'.event_listener'); + + if (empty($taggedSubscribers) && empty($taggedListeners)) { + return; + } + $this->container = $container; $this->connections = $container->getParameter($this->connections); $sortFunc = function ($a, $b) { @@ -62,26 +69,31 @@ class RegisterEventListenersAndSubscribersPass implements CompilerPassInterface return $a > $b ? -1 : 1; }; - $subscribersPerCon = $this->groupByConnection($container->findTaggedServiceIds($this->tagPrefix.'.event_subscriber')); - foreach ($subscribersPerCon as $con => $subscribers) { - $em = $this->getEventManager($con); - uasort($subscribers, $sortFunc); - foreach ($subscribers as $id => $instance) { - $em->addMethodCall('addEventSubscriber', array(new Reference($id))); + if (!empty($taggedSubscribers)) { + $subscribersPerCon = $this->groupByConnection($taggedSubscribers); + foreach ($subscribersPerCon as $con => $subscribers) { + $em = $this->getEventManager($con); + + uasort($subscribers, $sortFunc); + foreach ($subscribers as $id => $instance) { + $em->addMethodCall('addEventSubscriber', array(new Reference($id))); + } } } - $listenersPerCon = $this->groupByConnection($container->findTaggedServiceIds($this->tagPrefix.'.event_listener'), true); - foreach ($listenersPerCon as $con => $listeners) { - $em = $this->getEventManager($con); - - uasort($listeners, $sortFunc); - foreach ($listeners as $id => $instance) { - $em->addMethodCall('addEventListener', array( - array_unique($instance['event']), - isset($instance['lazy']) && $instance['lazy'] ? $id : new Reference($id), - )); + if (!empty($taggedListeners)) { + $listenersPerCon = $this->groupByConnection($taggedListeners, true); + foreach ($listenersPerCon as $con => $listeners) { + $em = $this->getEventManager($con); + + uasort($listeners, $sortFunc); + foreach ($listeners as $id => $instance) { + $em->addMethodCall('addEventListener', array( + array_unique($instance['event']), + isset($instance['lazy']) && $instance['lazy'] ? $id : new Reference($id), + )); + } } } } diff --git a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/ExpressionLanguage/DoctrineParserCache.php b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/ExpressionLanguage/DoctrineParserCache.php new file mode 100644 index 0000000000..0ff25ee3e5 --- /dev/null +++ b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/ExpressionLanguage/DoctrineParserCache.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bridge\Doctrine\ExpressionLanguage; + +use Doctrine\Common\Cache\Cache; +use Symfony\Component\ExpressionLanguage\ParsedExpression; +use Symfony\Component\ExpressionLanguage\ParserCache\ParserCacheInterface; + +/** + * @author Adrien Brault + */ +class DoctrineParserCache implements ParserCacheInterface +{ + /** + * @var Cache + */ + private $cache; + + public function __construct(Cache $cache) + { + $this->cache = $cache; + } + + /** + * {@inheritdoc} + */ + public function fetch($key) + { + if (false === $value = $this->cache->fetch($key)) { + return null; + } + + return $value; + } + + /** + * {@inheritdoc} + */ + public function save($key, ParsedExpression $expression) + { + $this->cache->save($key, $expression); + } +} diff --git a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php index 61f1a4c1a2..9719462f19 100644 --- a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php +++ b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php @@ -294,6 +294,8 @@ class EntityChoiceList extends ObjectChoiceList * @return array * * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface + * + * @deprecated Deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForChoices(array $entities) { @@ -334,6 +336,8 @@ class EntityChoiceList extends ObjectChoiceList * @return array * * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface + * + * @deprecated Deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForValues(array $values) { diff --git a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php index 5a2b423248..9a7a1f8774 100644 --- a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php +++ b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php @@ -25,12 +25,11 @@ class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface { protected $registry; - private $cache; + private $cache = array(); public function __construct(ManagerRegistry $registry) { $this->registry = $registry; - $this->cache = array(); } /** @@ -91,7 +90,7 @@ class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface return null; } - /* @var ClassMetadataInfo $classMetadata */ + /** @var ClassMetadataInfo $classMetadata */ $classMetadata = $classMetadatas[0]; // Check whether the field exists and is nullable or not diff --git a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php index 047cf12c5e..af127d42fa 100644 --- a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php +++ b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php @@ -116,7 +116,7 @@ abstract class DoctrineType extends AbstractType ? spl_object_hash($options['group_by']) : $options['group_by']; - $hash = md5(json_encode(array( + $hash = hash('sha256', json_encode(array( spl_object_hash($options['em']), $options['class'], $propertyHash, diff --git a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php index 999f469ff4..e786a8aeb5 100644 --- a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php +++ b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php @@ -47,7 +47,7 @@ class DoctrineTokenProvider implements TokenProviderInterface private $conn; /** - * new DoctrineTokenProvider for the RemembeMe authentication service + * new DoctrineTokenProvider for the RememberMe authentication service * * @param \Doctrine\DBAL\Connection $conn */ diff --git a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php index b5985caed4..5185a75998 100644 --- a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php +++ b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php @@ -18,10 +18,6 @@ class ContainerAwareEventManagerTest extends \PHPUnit_Framework_TestCase { protected function setUp() { - if (!class_exists('Symfony\Component\DependencyInjection\Container')) { - $this->markTestSkipped('The "DependencyInjection" component is not available'); - } - $this->container = new Container(); $this->evm = new ContainerAwareEventManager($this->container); } diff --git a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php index 067935608e..2772461c2e 100644 --- a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php +++ b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php @@ -18,17 +18,6 @@ use Symfony\Component\HttpFoundation\Response; class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) { - $this->markTestSkipped('Doctrine DBAL is not available.'); - } - - if (!class_exists('Symfony\Component\HttpKernel\HttpKernel')) { - $this->markTestSkipped('The "HttpKernel" component is not available'); - } - } - public function testCollectConnections() { $c = $this->createCollector(array()); diff --git a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/DataFixtures/ContainerAwareLoaderTest.php b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/DataFixtures/ContainerAwareLoaderTest.php index 52d653bdd9..cc6f47ca1c 100644 --- a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/DataFixtures/ContainerAwareLoaderTest.php +++ b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/DataFixtures/ContainerAwareLoaderTest.php @@ -16,17 +16,6 @@ use Symfony\Bridge\Doctrine\Tests\Fixtures\ContainerAwareFixture; class ContainerAwareLoaderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\DependencyInjection\Container')) { - $this->markTestSkipped('The "DependencyInjection" component is not available'); - } - - if (!class_exists('Doctrine\Common\DataFixtures\Loader')) { - $this->markTestSkipped('Doctrine Data Fixtures is not available.'); - } - } - public function testShouldSetContainerOnContainerAwareFixture() { $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); diff --git a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php index e096de2e4b..424f448c5e 100644 --- a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php +++ b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php @@ -16,13 +16,6 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; class RegisterEventListenersAndSubscribersPassTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\DependencyInjection\Container')) { - $this->markTestSkipped('The "DependencyInjection" component is not available'); - } - } - public function testProcessEventListenersWithPriorities() { $container = $this->createBuilder(); @@ -109,6 +102,17 @@ class RegisterEventListenersAndSubscribersPassTest extends \PHPUnit_Framework_Te $this->assertEquals(array('c', 'd', 'e', 'b', 'a'), $this->getServiceOrder($container, 'addEventSubscriber')); } + public function testProcessNoTaggedServices() + { + $container = $this->createBuilder(true); + + $this->process($container); + + $this->assertEquals(array(), $container->getDefinition('doctrine.dbal.default_connection.event_manager')->getMethodCalls()); + + $this->assertEquals(array(), $container->getDefinition('doctrine.dbal.second_connection.event_manager')->getMethodCalls()); + } + private function process(ContainerBuilder $container) { $pass = new RegisterEventListenersAndSubscribersPass('doctrine.connections', 'doctrine.dbal.%s_connection.event_manager', 'doctrine'); diff --git a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php index 970c997314..577d198599 100644 --- a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php +++ b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php @@ -21,21 +21,6 @@ use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper; */ abstract class DoctrineOrmTestCase extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Doctrine\Common\Version')) { - $this->markTestSkipped('Doctrine Common is not available.'); - } - - if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) { - $this->markTestSkipped('Doctrine DBAL is not available.'); - } - - if (!class_exists('Doctrine\ORM\EntityManager')) { - $this->markTestSkipped('Doctrine ORM is not available.'); - } - } - /** * @return \Doctrine\ORM\EntityManager */ diff --git a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/ExpressionLanguage/DoctrineParserCacheTest.php b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/ExpressionLanguage/DoctrineParserCacheTest.php new file mode 100644 index 0000000000..a473b3ace2 --- /dev/null +++ b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/ExpressionLanguage/DoctrineParserCacheTest.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bridge\Doctrine\Tests\ExpressionLanguage; + +use Symfony\Bridge\Doctrine\ExpressionLanguage\DoctrineParserCache; + +class DoctrineParserCacheTest extends \PHPUnit_Framework_TestCase +{ + public function testFetch() + { + $doctrineCacheMock = $this->getMock('Doctrine\Common\Cache\Cache'); + $parserCache = new DoctrineParserCache($doctrineCacheMock); + + $doctrineCacheMock->expects($this->once()) + ->method('fetch') + ->will($this->returnValue('bar')); + + $result = $parserCache->fetch('foo'); + + $this->assertEquals('bar', $result); + } + + public function testFetchUnexisting() + { + $doctrineCacheMock = $this->getMock('Doctrine\Common\Cache\Cache'); + $parserCache = new DoctrineParserCache($doctrineCacheMock); + + $doctrineCacheMock + ->expects($this->once()) + ->method('fetch') + ->will($this->returnValue(false)); + + $this->assertNull($parserCache->fetch('')); + } + + public function testSave() + { + $doctrineCacheMock = $this->getMock('Doctrine\Common\Cache\Cache'); + $parserCache = new DoctrineParserCache($doctrineCacheMock); + + $expression = $this->getMockBuilder('Symfony\Component\ExpressionLanguage\ParsedExpression') + ->disableOriginalConstructor() + ->getMock(); + + $doctrineCacheMock->expects($this->once()) + ->method('save') + ->with('foo', $expression); + + $parserCache->save('foo', $expression); + } +} diff --git a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php index bdb4013490..2c5de73500 100644 --- a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php +++ b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php @@ -50,22 +50,6 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase protected function setUp() { - if (!class_exists('Symfony\Component\Form\Form')) { - $this->markTestSkipped('The "Form" component is not available'); - } - - if (!class_exists('Doctrine\DBAL\Platforms\MySqlPlatform')) { - $this->markTestSkipped('Doctrine DBAL is not available.'); - } - - if (!class_exists('Doctrine\Common\Version')) { - $this->markTestSkipped('Doctrine Common is not available.'); - } - - if (!class_exists('Doctrine\ORM\EntityManager')) { - $this->markTestSkipped('Doctrine ORM is not available.'); - } - $this->em = DoctrineOrmTestCase::createTestEntityManager(); parent::setUp(); diff --git a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/HttpFoundation/DbalSessionHandlerTest.php b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/HttpFoundation/DbalSessionHandlerTest.php index 8e51f40f47..cb41a770da 100644 --- a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/HttpFoundation/DbalSessionHandlerTest.php +++ b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/HttpFoundation/DbalSessionHandlerTest.php @@ -20,13 +20,6 @@ use Symfony\Bridge\Doctrine\HttpFoundation\DbalSessionHandler; */ class DbalSessionHandlerTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - $this->markTestSkipped('The "HttpFoundation" component is not available'); - } - } - public function testConstruct() { $this->connection = $this->getMock('Doctrine\DBAL\Driver\Connection'); diff --git a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php index f791f97f01..8c179cd31f 100644 --- a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php +++ b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php @@ -18,15 +18,6 @@ use Doctrine\ORM\Tools\SchemaTool; class EntityUserProviderTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!class_exists('Symfony\Component\Security\Core\SecurityContext')) { - $this->markTestSkipped('The "Security" component is not available'); - } - - parent::setUp(); - } - public function testRefreshUserGetsUserByPrimaryKey() { $em = DoctrineTestHelper::createTestEntityManager(); diff --git a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueValidatorTest.php b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueValidatorTest.php index 9d0a75af5e..57eaf3295a 100644 --- a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueValidatorTest.php +++ b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueValidatorTest.php @@ -26,19 +26,6 @@ use Doctrine\ORM\Tools\SchemaTool; class UniqueValidatorTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - parent::setUp(); - - if (!class_exists('Symfony\Component\Security\Core\SecurityContext')) { - $this->markTestSkipped('The "Security" component is not available'); - } - - if (!class_exists('Symfony\Component\Validator\Constraint')) { - $this->markTestSkipped('The "Validator" component is not available'); - } - } - protected function createRegistryMock($entityManagerName, $em) { $registry = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry'); diff --git a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/composer.json b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/composer.json index e657db70d1..55dc2ed5cb 100644 --- a/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/composer.json +++ b/vendor/symfony/doctrine-bridge/Symfony/Bridge/Doctrine/composer.json @@ -25,6 +25,7 @@ "symfony/form": "~2.2", "symfony/http-kernel": "~2.2", "symfony/security": "~2.2", + "symfony/expression-language": "~2.2", "symfony/validator": "~2.2", "doctrine/data-fixtures": "1.0.*", "doctrine/dbal": "~2.2", @@ -44,7 +45,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-master": "2.4-dev" } } } diff --git a/vendor/symfony/finder/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php b/vendor/symfony/finder/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php index 42c8ce760d..e4eabbf804 100644 --- a/vendor/symfony/finder/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php +++ b/vendor/symfony/finder/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php @@ -18,7 +18,7 @@ namespace Symfony\Component\Finder\Iterator; */ class ExcludeDirectoryFilterIterator extends FilterIterator { - private $patterns; + private $patterns = array(); /** * Constructor. @@ -28,7 +28,6 @@ class ExcludeDirectoryFilterIterator extends FilterIterator */ public function __construct(\Iterator $iterator, array $directories) { - $this->patterns = array(); foreach ($directories as $directory) { $this->patterns[] = '#(^|/)'.preg_quote($directory, '#').'(/|$)#'; } diff --git a/vendor/symfony/finder/Symfony/Component/Finder/Iterator/MultiplePcreFilterIterator.php b/vendor/symfony/finder/Symfony/Component/Finder/Iterator/MultiplePcreFilterIterator.php index 3a9dd55582..df6d6dc6a7 100644 --- a/vendor/symfony/finder/Symfony/Component/Finder/Iterator/MultiplePcreFilterIterator.php +++ b/vendor/symfony/finder/Symfony/Component/Finder/Iterator/MultiplePcreFilterIterator.php @@ -20,8 +20,8 @@ use Symfony\Component\Finder\Expression\Expression; */ abstract class MultiplePcreFilterIterator extends FilterIterator { - protected $matchRegexps; - protected $noMatchRegexps; + protected $matchRegexps = array(); + protected $noMatchRegexps = array(); /** * Constructor. @@ -32,12 +32,10 @@ abstract class MultiplePcreFilterIterator extends FilterIterator */ public function __construct(\Iterator $iterator, array $matchPatterns, array $noMatchPatterns) { - $this->matchRegexps = array(); foreach ($matchPatterns as $pattern) { $this->matchRegexps[] = $this->toRegex($pattern); } - $this->noMatchRegexps = array(); foreach ($noMatchPatterns as $pattern) { $this->noMatchRegexps[] = $this->toRegex($pattern); } diff --git a/vendor/symfony/finder/Symfony/Component/Finder/Shell/Command.php b/vendor/symfony/finder/Symfony/Component/Finder/Shell/Command.php index 54f4f176fb..a891016b81 100644 --- a/vendor/symfony/finder/Symfony/Component/Finder/Shell/Command.php +++ b/vendor/symfony/finder/Symfony/Component/Finder/Shell/Command.php @@ -24,12 +24,12 @@ class Command /** * @var array */ - private $bits; + private $bits = array(); /** * @var array */ - private $labels; + private $labels = array(); /** * @var \Closure|null @@ -39,13 +39,11 @@ class Command /** * Constructor. * - * @param Command $parent Parent command + * @param Command|null $parent Parent command */ public function __construct(Command $parent = null) { $this->parent = $parent; - $this->bits = array(); - $this->labels = array(); } /** @@ -61,7 +59,7 @@ class Command /** * Creates a new Command instance. * - * @param Command $parent Parent command + * @param Command|null $parent Parent command * * @return Command New Command instance */ @@ -232,7 +230,7 @@ class Command } /** - * @return callable|null + * @return \Closure|null */ public function getErrorHandler() { diff --git a/vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/Iterator.php b/vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/Iterator.php index 7ffd38267b..849bf081e2 100644 --- a/vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/Iterator.php +++ b/vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/Iterator.php @@ -13,11 +13,10 @@ namespace Symfony\Component\Finder\Tests\Iterator; class Iterator implements \Iterator { - protected $values; + protected $values = array(); public function __construct(array $values = array()) { - $this->values = array(); foreach ($values as $value) { $this->attach(new \SplFileInfo($value)); } diff --git a/vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php b/vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php index f762514346..4a54d1d33f 100644 --- a/vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php +++ b/vendor/symfony/finder/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php @@ -20,7 +20,7 @@ class RecursiveDirectoryIteratorTest extends IteratorTestCase * * @param string $path * @param Boolean $seekable - * @param Boolean $supports + * @param array $contains * @param string $message */ public function testRewind($path, $seekable, $contains, $message = null) @@ -41,7 +41,7 @@ class RecursiveDirectoryIteratorTest extends IteratorTestCase * * @param string $path * @param Boolean $seekable - * @param Boolean $supports + * @param array $contains * @param string $message */ public function testSeek($path, $seekable, $contains, $message = null) diff --git a/vendor/symfony/finder/Symfony/Component/Finder/composer.json b/vendor/symfony/finder/Symfony/Component/Finder/composer.json index 7480b3edb1..7de47137f1 100644 --- a/vendor/symfony/finder/Symfony/Component/Finder/composer.json +++ b/vendor/symfony/finder/Symfony/Component/Finder/composer.json @@ -25,7 +25,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-master": "2.4-dev" } } } diff --git a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyAccessorArrayObjectTest.php b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/AccessException.php similarity index 51% rename from vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyAccessorArrayObjectTest.php rename to vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/AccessException.php index aaa86b3c25..b3a854646e 100644 --- a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyAccessorArrayObjectTest.php +++ b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/AccessException.php @@ -9,12 +9,13 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\PropertyAccess\Tests; +namespace Symfony\Component\PropertyAccess\Exception; -class PropertyAccessorArrayObjectTest extends PropertyAccessorCollectionTest +/** + * Thrown when a property path is not available. + * + * @author Stéphane Escandell + */ +class AccessException extends RuntimeException { - protected function getCollection(array $array) - { - return new \ArrayObject($array); - } } diff --git a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyAccessorArrayTest.php b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/NoSuchIndexException.php similarity index 52% rename from vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyAccessorArrayTest.php rename to vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/NoSuchIndexException.php index 5ab63c67cb..597b9904a2 100644 --- a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyAccessorArrayTest.php +++ b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/NoSuchIndexException.php @@ -9,12 +9,13 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\PropertyAccess\Tests; +namespace Symfony\Component\PropertyAccess\Exception; -class PropertyAccessorArrayTest extends PropertyAccessorCollectionTest +/** + * Thrown when an index cannot be found. + * + * @author Stéphane Escandell + */ +class NoSuchIndexException extends AccessException { - protected function getCollection(array $array) - { - return $array; - } } diff --git a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/NoSuchPropertyException.php b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/NoSuchPropertyException.php index ebaa5a3079..1c7eda5f83 100644 --- a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/NoSuchPropertyException.php +++ b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Exception/NoSuchPropertyException.php @@ -16,6 +16,6 @@ namespace Symfony\Component\PropertyAccess\Exception; * * @author Bernhard Schussek */ -class NoSuchPropertyException extends RuntimeException +class NoSuchPropertyException extends AccessException { } diff --git a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccessor.php b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccessor.php index 0a2eae259a..d48891ef27 100644 --- a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccessor.php +++ b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccessor.php @@ -12,6 +12,7 @@ namespace Symfony\Component\PropertyAccess; use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException; +use Symfony\Component\PropertyAccess\Exception\NoSuchIndexException; use Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException; /** @@ -24,15 +25,24 @@ class PropertyAccessor implements PropertyAccessorInterface const VALUE = 0; const IS_REF = 1; + /** + * @var Boolean + */ private $magicCall; + /** + * @var Boolean + */ + private $throwExceptionOnInvalidIndex; + /** * Should not be used by application code. Use - * {@link PropertyAccess::getPropertyAccessor()} instead. + * {@link PropertyAccess::createPropertyAccessor()} instead. */ - public function __construct($magicCall = false) + public function __construct($magicCall = false, $throwExceptionOnInvalidIndex = false) { $this->magicCall = $magicCall; + $this->throwExceptionOnInvalidIndex = $throwExceptionOnInvalidIndex; } /** @@ -46,7 +56,7 @@ class PropertyAccessor implements PropertyAccessorInterface throw new UnexpectedTypeException($propertyPath, 'string or Symfony\Component\PropertyAccess\PropertyPathInterface'); } - $propertyValues =& $this->readPropertiesUntil($objectOrArray, $propertyPath, $propertyPath->getLength()); + $propertyValues =& $this->readPropertiesUntil($objectOrArray, $propertyPath, $propertyPath->getLength(), $this->throwExceptionOnInvalidIndex); return $propertyValues[count($propertyValues) - 1][self::VALUE]; } @@ -106,7 +116,7 @@ class PropertyAccessor implements PropertyAccessorInterface * * @throws UnexpectedTypeException If a value within the path is neither object nor array. */ - private function &readPropertiesUntil(&$objectOrArray, PropertyPathInterface $propertyPath, $lastIndex) + private function &readPropertiesUntil(&$objectOrArray, PropertyPathInterface $propertyPath, $lastIndex, $throwExceptionOnNonexistantIndex = false) { $propertyValues = array(); @@ -121,6 +131,9 @@ class PropertyAccessor implements PropertyAccessorInterface // Create missing nested arrays on demand if ($isIndex && $isArrayAccess && !isset($objectOrArray[$property])) { + if ($throwExceptionOnNonexistantIndex) { + throw new NoSuchIndexException(sprintf('Cannot read property "%s". Available properties are "%s"', $property, print_r(array_keys($objectOrArray), true))); + } $objectOrArray[$property] = $i + 1 < $propertyPath->getLength() ? array() : null; } diff --git a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php index 25686e953f..50b872f3a3 100644 --- a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php +++ b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.php @@ -24,7 +24,12 @@ class PropertyAccessorBuilder private $magicCall = false; /** - * Enables the use of "__call" by the ProperyAccessor. + * @var Boolean + */ + private $throwExceptionOnInvalidIndex = false; + + /** + * Enables the use of "__call" by the PropertyAccessor. * * @return PropertyAccessorBuilder The builder object */ @@ -36,7 +41,7 @@ class PropertyAccessorBuilder } /** - * Disables the use of "__call" by the ProperyAccessor. + * Disables the use of "__call" by the PropertyAccessor. * * @return PropertyAccessorBuilder The builder object */ @@ -48,13 +53,45 @@ class PropertyAccessorBuilder } /** - * @return Boolean true if the use of "__call" by the ProperyAccessor is enabled + * @return Boolean true if the use of "__call" by the PropertyAccessor is enabled */ public function isMagicCallEnabled() { return $this->magicCall; } + /** + * Enables exceptions in read context for array by PropertyAccessor + * + * @return PropertyAccessorBuilder The builder object + */ + public function enableExceptionOnInvalidIndex() + { + $this->throwExceptionOnInvalidIndex = true; + + return $this; + } + + /** + * Disables exceptions in read context for array by PropertyAccessor + * + * @return PropertyAccessorBuilder The builder object + */ + public function disableExceptionOnInvalidIndex() + { + $this->throwExceptionOnInvalidIndex = false; + + return $this; + } + + /** + * @return Boolean true is exceptions in read context for array is enabled + */ + public function isExceptionOnInvalidIndexEnabled() + { + return $this->throwExceptionOnInvalidIndex; + } + /** * Builds and returns a new propertyAccessor object. * @@ -62,6 +99,6 @@ class PropertyAccessorBuilder */ public function getPropertyAccessor() { - return new PropertyAccessor($this->magicCall); + return new PropertyAccessor($this->magicCall, $this->throwExceptionOnInvalidIndex); } } diff --git a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyPath.php b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyPath.php index 840fc71572..a458de2c89 100644 --- a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyPath.php +++ b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/PropertyPath.php @@ -125,7 +125,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface throw new InvalidPropertyPathException(sprintf( 'Could not parse property path "%s". Unexpected token "%s" at position %d', $propertyPath, - $remaining{0}, + $remaining[0], $position )); } diff --git a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/Fixtures/Author.php b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/Fixtures/Author.php deleted file mode 100644 index ed2331bab0..0000000000 --- a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/Fixtures/Author.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\PropertyAccess\Tests\Fixtures; - -class Author -{ - public $firstName; - private $lastName; - private $australian; - public $child; - private $readPermissions; - - private $privateProperty; - - public function setLastName($lastName) - { - $this->lastName = $lastName; - } - - public function getLastName() - { - return $this->lastName; - } - - private function getPrivateGetter() - { - return 'foobar'; - } - - public function setAustralian($australian) - { - $this->australian = $australian; - } - - public function isAustralian() - { - return $this->australian; - } - - public function setReadPermissions($bool) - { - $this->readPermissions = $bool; - } - - public function hasReadPermissions() - { - return $this->readPermissions; - } - - private function isPrivateIsser() - { - return true; - } - - public function getPrivateSetter() - { - } - - private function setPrivateSetter($data) - { - } -} diff --git a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/Fixtures/CustomArrayObject.php b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/Fixtures/CustomArrayObject.php deleted file mode 100644 index cd23f7033f..0000000000 --- a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/Fixtures/CustomArrayObject.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\PropertyAccess\Tests\Fixtures; - -/** - * This class is a hand written simplified version of PHP native `ArrayObject` - * class, to show that it behaves differently than the PHP native implementation. - */ -class CustomArrayObject implements \ArrayAccess, \IteratorAggregate, \Countable, \Serializable -{ - private $array; - - public function __construct(array $array = null) - { - $this->array = $array ?: array(); - } - - public function offsetExists($offset) - { - return array_key_exists($offset, $this->array); - } - - public function offsetGet($offset) - { - return $this->array[$offset]; - } - - public function offsetSet($offset, $value) - { - if (null === $offset) { - $this->array[] = $value; - } else { - $this->array[$offset] = $value; - } - } - - public function offsetUnset($offset) - { - unset($this->array[$offset]); - } - - public function getIterator() - { - return new \ArrayIterator($this->array); - } - - public function count() - { - return count($this->array); - } - - public function serialize() - { - return serialize($this->array); - } - - public function unserialize($serialized) - { - $this->array = (array) unserialize((string) $serialized); - } -} diff --git a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/Fixtures/Magician.php b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/Fixtures/Magician.php deleted file mode 100644 index 6faa5dbf7b..0000000000 --- a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/Fixtures/Magician.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\PropertyAccess\Tests\Fixtures; - -class Magician -{ - private $foobar; - - public function __set($property, $value) - { - $this->$property = $value; - } - - public function __get($property) - { - return isset($this->$property) ? $this->$property : null; - } -} diff --git a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/Fixtures/MagicianCall.php b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/Fixtures/MagicianCall.php deleted file mode 100644 index 0508a71da1..0000000000 --- a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/Fixtures/MagicianCall.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\PropertyAccess\Tests\Fixtures; - -class MagicianCall -{ - private $foobar; - - public function __call($name, $args) - { - $property = lcfirst(substr($name, 3)); - if ('get' === substr($name, 0, 3)) { - return isset($this->$property) ? $this->$property : null; - } elseif ('set' === substr($name, 0, 3)) { - $value = 1 == count($args) ? $args[0] : null; - $this->$property = $value; - } - } -} diff --git a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyAccessorBuilderTest.php b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyAccessorBuilderTest.php deleted file mode 100644 index 951c6802f9..0000000000 --- a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyAccessorBuilderTest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\PropertyAccess\Tests; - -use Symfony\Component\PropertyAccess\PropertyAccessorBuilder; - -class PropertyAccessorBuilderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var PropertyAccessorBuilder - */ - protected $builder; - - protected function setUp() - { - $this->builder = new PropertyAccessorBuilder(); - } - - protected function tearDown() - { - $this->builder = null; - } - - public function testEnableMagicCall() - { - $this->assertSame($this->builder, $this->builder->enableMagicCall()); - } - - public function testDisableMagicCall() - { - $this->assertSame($this->builder, $this->builder->disableMagicCall()); - } - - public function testIsMagicCallEnable() - { - $this->assertFalse($this->builder->isMagicCallEnabled()); - $this->assertTrue($this->builder->enableMagicCall()->isMagicCallEnabled()); - $this->assertFalse($this->builder->disableMagicCall()->isMagicCallEnabled()); - } - - public function testGetPropertyAccessor() - { - $this->assertInstanceOf('Symfony\Component\PropertyAccess\PropertyAccessor', $this->builder->getPropertyAccessor()); - $this->assertInstanceOf('Symfony\Component\PropertyAccess\PropertyAccessor', $this->builder->enableMagicCall()->getPropertyAccessor()); - } -} diff --git a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyAccessorCollectionTest.php b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyAccessorCollectionTest.php deleted file mode 100644 index b0f75aa366..0000000000 --- a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyAccessorCollectionTest.php +++ /dev/null @@ -1,324 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\PropertyAccess\Tests; - -use Symfony\Component\PropertyAccess\Exception\ExceptionInterface; -use Symfony\Component\PropertyAccess\PropertyAccessor; -use Symfony\Component\PropertyAccess\StringUtil; - -class PropertyAccessorCollectionTest_Car -{ - private $axes; - - public function __construct($axes = null) - { - $this->axes = $axes; - } - - // In the test, use a name that StringUtil can't uniquely singularify - public function addAxis($axis) - { - $this->axes[] = $axis; - } - - public function removeAxis($axis) - { - foreach ($this->axes as $key => $value) { - if ($value === $axis) { - unset($this->axes[$key]); - - return; - } - } - } - - public function getAxes() - { - return $this->axes; - } -} - -class PropertyAccessorCollectionTest_CarCustomSingular -{ - public function addFoo($axis) {} - - public function removeFoo($axis) {} - - public function getAxes() {} -} - -class PropertyAccessorCollectionTest_Engine -{ -} - -class PropertyAccessorCollectionTest_CarOnlyAdder -{ - public function addAxis($axis) {} - - public function getAxes() {} -} - -class PropertyAccessorCollectionTest_CarOnlyRemover -{ - public function removeAxis($axis) {} - - public function getAxes() {} -} - -class PropertyAccessorCollectionTest_CarNoAdderAndRemover -{ - public function getAxes() {} -} - -class PropertyAccessorCollectionTest_CarNoAdderAndRemoverWithProperty -{ - protected $axes = array(); - - public function getAxes() {} -} - -class PropertyAccessorCollectionTest_CompositeCar -{ - public function getStructure() {} - - public function setStructure($structure) {} -} - -class PropertyAccessorCollectionTest_CarStructure -{ - public function addAxis($axis) {} - - public function removeAxis($axis) {} - - public function getAxes() {} -} - -abstract class PropertyAccessorCollectionTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var PropertyAccessor - */ - private $propertyAccessor; - - protected function setUp() - { - $this->propertyAccessor = new PropertyAccessor(); - } - - abstract protected function getCollection(array $array); - - public function testGetValueReadsArrayAccess() - { - $object = $this->getCollection(array('firstName' => 'Bernhard')); - - $this->assertEquals('Bernhard', $this->propertyAccessor->getValue($object, '[firstName]')); - } - - public function testGetValueReadsNestedArrayAccess() - { - $object = $this->getCollection(array('person' => array('firstName' => 'Bernhard'))); - - $this->assertEquals('Bernhard', $this->propertyAccessor->getValue($object, '[person][firstName]')); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException - */ - public function testGetValueThrowsExceptionIfArrayAccessExpected() - { - $this->propertyAccessor->getValue(new \stdClass(), '[firstName]'); - } - - public function testSetValueUpdatesArrayAccess() - { - $object = $this->getCollection(array()); - - $this->propertyAccessor->setValue($object, '[firstName]', 'Bernhard'); - - $this->assertEquals('Bernhard', $object['firstName']); - } - - public function testSetValueUpdatesNestedArrayAccess() - { - $object = $this->getCollection(array()); - - $this->propertyAccessor->setValue($object, '[person][firstName]', 'Bernhard'); - - $this->assertEquals('Bernhard', $object['person']['firstName']); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException - */ - public function testSetValueThrowsExceptionIfArrayAccessExpected() - { - $this->propertyAccessor->setValue(new \stdClass(), '[firstName]', 'Bernhard'); - } - - public function testSetValueCallsAdderAndRemoverForCollections() - { - $axesBefore = $this->getCollection(array(1 => 'second', 3 => 'fourth', 4 => 'fifth')); - $axesMerged = $this->getCollection(array(1 => 'first', 2 => 'second', 3 => 'third')); - $axesAfter = $this->getCollection(array(1 => 'second', 5 => 'first', 6 => 'third')); - $axesMergedCopy = is_object($axesMerged) ? clone $axesMerged : $axesMerged; - - // Don't use a mock in order to test whether the collections are - // modified while iterating them - $car = new PropertyAccessorCollectionTest_Car($axesBefore); - - $this->propertyAccessor->setValue($car, 'axes', $axesMerged); - - $this->assertEquals($axesAfter, $car->getAxes()); - - // The passed collection was not modified - $this->assertEquals($axesMergedCopy, $axesMerged); - } - - public function testSetValueCallsAdderAndRemoverForNestedCollections() - { - $car = $this->getMock(__CLASS__.'_CompositeCar'); - $structure = $this->getMock(__CLASS__.'_CarStructure'); - $axesBefore = $this->getCollection(array(1 => 'second', 3 => 'fourth')); - $axesAfter = $this->getCollection(array(0 => 'first', 1 => 'second', 2 => 'third')); - - $car->expects($this->any()) - ->method('getStructure') - ->will($this->returnValue($structure)); - - $structure->expects($this->at(0)) - ->method('getAxes') - ->will($this->returnValue($axesBefore)); - $structure->expects($this->at(1)) - ->method('removeAxis') - ->with('fourth'); - $structure->expects($this->at(2)) - ->method('addAxis') - ->with('first'); - $structure->expects($this->at(3)) - ->method('addAxis') - ->with('third'); - - $this->propertyAccessor->setValue($car, 'structure.axes', $axesAfter); - } - - public function testSetValueCallsCustomAdderAndRemover() - { - $this->markTestSkipped('This feature is temporarily disabled as of 2.1'); - - $car = $this->getMock(__CLASS__.'_CarCustomSingular'); - $axesBefore = $this->getCollection(array(1 => 'second', 3 => 'fourth')); - $axesAfter = $this->getCollection(array(0 => 'first', 1 => 'second', 2 => 'third')); - - $car->expects($this->at(0)) - ->method('getAxes') - ->will($this->returnValue($axesBefore)); - $car->expects($this->at(1)) - ->method('removeFoo') - ->with('fourth'); - $car->expects($this->at(2)) - ->method('addFoo') - ->with('first'); - $car->expects($this->at(3)) - ->method('addFoo') - ->with('third'); - - $this->propertyAccessor->setValue($car, 'axes|foo', $axesAfter); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException - */ - public function testSetValueFailsIfOnlyAdderFound() - { - $car = $this->getMock(__CLASS__.'_CarOnlyAdder'); - $axesBefore = $this->getCollection(array(1 => 'second', 3 => 'fourth')); - $axesAfter = $this->getCollection(array(0 => 'first', 1 => 'second', 2 => 'third')); - - $car->expects($this->any()) - ->method('getAxes') - ->will($this->returnValue($axesBefore)); - - $this->propertyAccessor->setValue($car, 'axes', $axesAfter); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException - */ - public function testSetValueFailsIfOnlyRemoverFound() - { - $car = $this->getMock(__CLASS__.'_CarOnlyRemover'); - $axesBefore = $this->getCollection(array(1 => 'second', 3 => 'fourth')); - $axesAfter = $this->getCollection(array(0 => 'first', 1 => 'second', 2 => 'third')); - - $car->expects($this->any()) - ->method('getAxes') - ->will($this->returnValue($axesBefore)); - - $this->propertyAccessor->setValue($car, 'axes', $axesAfter); - } - - /** - * @dataProvider noAdderRemoverData - */ - public function testNoAdderAndRemoverThrowsSensibleError($car, $path, $message) - { - $axes = $this->getCollection(array(0 => 'first', 1 => 'second', 2 => 'third')); - - try { - $this->propertyAccessor->setValue($car, $path, $axes); - $this->fail('An expected exception was not thrown!'); - } catch (ExceptionInterface $e) { - $this->assertEquals($message, $e->getMessage()); - } - } - - public function noAdderRemoverData() - { - $data = array(); - - $car = $this->getMock(__CLASS__.'_CarNoAdderAndRemover'); - $propertyPath = 'axes'; - $expectedMessage = sprintf( - 'Neither the property "axes" nor one of the methods "addAx()", '. - '"addAxe()", "addAxis()", "setAxes()", "__set()" or "__call()" exist and have '. - 'public access in class "%s".', - get_class($car) - ); - $data[] = array($car, $propertyPath, $expectedMessage); - - /* - Temporarily disabled in 2.1 - - $propertyPath = new PropertyPath('axes|boo'); - $expectedMessage = sprintf( - 'Neither element "axes" nor method "setAxes()" exists in class ' - .'"%s", nor could adders and removers be found based on the ' - .'passed singular: %s', - get_class($car), - 'boo' - ); - $data[] = array($car, $propertyPath, $expectedMessage); - */ - - $car = $this->getMock(__CLASS__.'_CarNoAdderAndRemoverWithProperty'); - $propertyPath = 'axes'; - $expectedMessage = sprintf( - 'Neither the property "axes" nor one of the methods "addAx()", '. - '"addAxe()", "addAxis()", "setAxes()", "__set()" or "__call()" exist and have '. - 'public access in class "%s".', - get_class($car) - ); - $data[] = array($car, $propertyPath, $expectedMessage); - - return $data; - } -} diff --git a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyAccessorCustomArrayObjectTest.php b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyAccessorCustomArrayObjectTest.php deleted file mode 100644 index 7340df720f..0000000000 --- a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyAccessorCustomArrayObjectTest.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\PropertyAccess\Tests; - -use Symfony\Component\PropertyAccess\Tests\Fixtures\CustomArrayObject; - -class PropertyAccessorCustomArrayObjectTest extends PropertyAccessorCollectionTest -{ - protected function getCollection(array $array) - { - return new CustomArrayObject($array); - } -} diff --git a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php deleted file mode 100644 index e22ca097be..0000000000 --- a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php +++ /dev/null @@ -1,383 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\PropertyAccess\Tests; - -use Symfony\Component\PropertyAccess\PropertyAccessor; -use Symfony\Component\PropertyAccess\Tests\Fixtures\Author; -use Symfony\Component\PropertyAccess\Tests\Fixtures\Magician; -use Symfony\Component\PropertyAccess\Tests\Fixtures\MagicianCall; - -class PropertyAccessorTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var PropertyAccessor - */ - private $propertyAccessor; - - protected function setUp() - { - $this->propertyAccessor = new PropertyAccessor(); - } - - public function testGetValueReadsArray() - { - $array = array('firstName' => 'Bernhard'); - - $this->assertEquals('Bernhard', $this->propertyAccessor->getValue($array, '[firstName]')); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException - */ - public function testGetValueThrowsExceptionIfIndexNotationExpected() - { - $array = array('firstName' => 'Bernhard'); - - $this->propertyAccessor->getValue($array, 'firstName'); - } - - public function testGetValueReadsZeroIndex() - { - $array = array('Bernhard'); - - $this->assertEquals('Bernhard', $this->propertyAccessor->getValue($array, '[0]')); - } - - public function testGetValueReadsIndexWithSpecialChars() - { - $array = array('%!@$§.' => 'Bernhard'); - - $this->assertEquals('Bernhard', $this->propertyAccessor->getValue($array, '[%!@$§.]')); - } - - public function testGetValueReadsNestedIndexWithSpecialChars() - { - $array = array('root' => array('%!@$§.' => 'Bernhard')); - - $this->assertEquals('Bernhard', $this->propertyAccessor->getValue($array, '[root][%!@$§.]')); - } - - public function testGetValueReadsArrayWithCustomPropertyPath() - { - $array = array('child' => array('index' => array('firstName' => 'Bernhard'))); - - $this->assertEquals('Bernhard', $this->propertyAccessor->getValue($array, '[child][index][firstName]')); - } - - public function testGetValueReadsArrayWithMissingIndexForCustomPropertyPath() - { - $array = array('child' => array('index' => array())); - - $this->assertNull($this->propertyAccessor->getValue($array, '[child][index][firstName]')); - } - - public function testGetValueReadsProperty() - { - $object = new Author(); - $object->firstName = 'Bernhard'; - - $this->assertEquals('Bernhard', $this->propertyAccessor->getValue($object, 'firstName')); - } - - public function testGetValueIgnoresSingular() - { - $this->markTestSkipped('This feature is temporarily disabled as of 2.1'); - - $object = (object) array('children' => 'Many'); - - $this->assertEquals('Many', $this->propertyAccessor->getValue($object, 'children|child')); - } - - public function testGetValueReadsPropertyWithSpecialCharsExceptDot() - { - $array = (object) array('%!@$§' => 'Bernhard'); - - $this->assertEquals('Bernhard', $this->propertyAccessor->getValue($array, '%!@$§')); - } - - public function testGetValueReadsPropertyWithCustomPropertyPath() - { - $object = new Author(); - $object->child = array(); - $object->child['index'] = new Author(); - $object->child['index']->firstName = 'Bernhard'; - - $this->assertEquals('Bernhard', $this->propertyAccessor->getValue($object, 'child[index].firstName')); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException - */ - public function testGetValueThrowsExceptionIfPropertyIsNotPublic() - { - $this->propertyAccessor->getValue(new Author(), 'privateProperty'); - } - - public function testGetValueReadsGetters() - { - $object = new Author(); - $object->setLastName('Schussek'); - - $this->assertEquals('Schussek', $this->propertyAccessor->getValue($object, 'lastName')); - } - - public function testGetValueCamelizesGetterNames() - { - $object = new Author(); - $object->setLastName('Schussek'); - - $this->assertEquals('Schussek', $this->propertyAccessor->getValue($object, 'last_name')); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException - */ - public function testGetValueThrowsExceptionIfGetterIsNotPublic() - { - $this->propertyAccessor->getValue(new Author(), 'privateGetter'); - } - - public function testGetValueReadsIssers() - { - $object = new Author(); - $object->setAustralian(false); - - $this->assertFalse($this->propertyAccessor->getValue($object, 'australian')); - } - - public function testGetValueReadHassers() - { - $object = new Author(); - $object->setReadPermissions(true); - - $this->assertTrue($this->propertyAccessor->getValue($object, 'read_permissions')); - } - - public function testGetValueReadsMagicGet() - { - $object = new Magician(); - $object->__set('magicProperty', 'foobar'); - - $this->assertSame('foobar', $this->propertyAccessor->getValue($object, 'magicProperty')); - } - - /* - * https://github.com/symfony/symfony/pull/4450 - */ - public function testGetValueReadsMagicGetThatReturnsConstant() - { - $object = new Magician(); - - $this->assertNull($this->propertyAccessor->getValue($object, 'magicProperty')); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException - */ - public function testGetValueThrowsExceptionIfIsserIsNotPublic() - { - $this->propertyAccessor->getValue(new Author(), 'privateIsser'); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException - */ - public function testGetValueThrowsExceptionIfPropertyDoesNotExist() - { - $this->propertyAccessor->getValue(new Author(), 'foobar'); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException - */ - public function testGetValueThrowsExceptionIfNotObjectOrArray() - { - $this->propertyAccessor->getValue('baz', 'foobar'); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException - */ - public function testGetValueThrowsExceptionIfNull() - { - $this->propertyAccessor->getValue(null, 'foobar'); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException - */ - public function testGetValueThrowsExceptionIfEmpty() - { - $this->propertyAccessor->getValue('', 'foobar'); - } - - public function testSetValueUpdatesArrays() - { - $array = array(); - - $this->propertyAccessor->setValue($array, '[firstName]', 'Bernhard'); - - $this->assertEquals(array('firstName' => 'Bernhard'), $array); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException - */ - public function testSetValueThrowsExceptionIfIndexNotationExpected() - { - $array = array(); - - $this->propertyAccessor->setValue($array, 'firstName', 'Bernhard'); - } - - public function testSetValueUpdatesArraysWithCustomPropertyPath() - { - $array = array(); - - $this->propertyAccessor->setValue($array, '[child][index][firstName]', 'Bernhard'); - - $this->assertEquals(array('child' => array('index' => array('firstName' => 'Bernhard'))), $array); - } - - public function testSetValueUpdatesProperties() - { - $object = new Author(); - - $this->propertyAccessor->setValue($object, 'firstName', 'Bernhard'); - - $this->assertEquals('Bernhard', $object->firstName); - } - - public function testSetValueUpdatesPropertiesWithCustomPropertyPath() - { - $object = new Author(); - $object->child = array(); - $object->child['index'] = new Author(); - - $this->propertyAccessor->setValue($object, 'child[index].firstName', 'Bernhard'); - - $this->assertEquals('Bernhard', $object->child['index']->firstName); - } - - public function testSetValueUpdateMagicSet() - { - $object = new Magician(); - - $this->propertyAccessor->setValue($object, 'magicProperty', 'foobar'); - - $this->assertEquals('foobar', $object->__get('magicProperty')); - } - - public function testSetValueUpdatesSetters() - { - $object = new Author(); - - $this->propertyAccessor->setValue($object, 'lastName', 'Schussek'); - - $this->assertEquals('Schussek', $object->getLastName()); - } - - public function testSetValueCamelizesSetterNames() - { - $object = new Author(); - - $this->propertyAccessor->setValue($object, 'last_name', 'Schussek'); - - $this->assertEquals('Schussek', $object->getLastName()); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException - */ - public function testSetValueThrowsExceptionIfGetterIsNotPublic() - { - $this->propertyAccessor->setValue(new Author(), 'privateSetter', 'foobar'); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException - */ - public function testSetValueThrowsExceptionIfNotObjectOrArray() - { - $value = 'baz'; - - $this->propertyAccessor->setValue($value, 'foobar', 'bam'); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException - */ - public function testSetValueThrowsExceptionIfNull() - { - $value = null; - - $this->propertyAccessor->setValue($value, 'foobar', 'bam'); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException - */ - public function testSetValueThrowsExceptionIfEmpty() - { - $value = ''; - - $this->propertyAccessor->setValue($value, 'foobar', 'bam'); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException - */ - public function testSetValueFailsIfMagicCallDisabled() - { - $value = new MagicianCall(); - - $this->propertyAccessor->setValue($value, 'foobar', 'bam'); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException - */ - public function testGetValueFailsIfMagicCallDisabled() - { - $value = new MagicianCall(); - - $this->propertyAccessor->getValue($value, 'foobar', 'bam'); - } - - public function testGetValueReadsMagicCall() - { - $propertyAccessor = new PropertyAccessor(true); - $object = new MagicianCall(); - $object->setMagicProperty('foobar'); - - $this->assertSame('foobar', $propertyAccessor->getValue($object, 'magicProperty')); - } - - public function testGetValueReadsMagicCallThatReturnsConstant() - { - $propertyAccessor = new PropertyAccessor(true); - $object = new MagicianCall(); - - $this->assertNull($propertyAccessor->getValue($object, 'MagicProperty')); - } - - public function testSetValueUpdatesMagicCall() - { - $propertyAccessor = new PropertyAccessor(true); - $object = new MagicianCall(); - - $propertyAccessor->setValue($object, 'magicProperty', 'foobar'); - - $this->assertEquals('foobar', $object->getMagicProperty()); - } - -} diff --git a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyPathBuilderTest.php b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyPathBuilderTest.php deleted file mode 100644 index 14300b1ded..0000000000 --- a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyPathBuilderTest.php +++ /dev/null @@ -1,279 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\PropertyAccess\Tests; - -use Symfony\Component\PropertyAccess\PropertyPath; -use Symfony\Component\PropertyAccess\PropertyPathBuilder; - -/** - * @author Bernhard Schussek - */ -class PropertyPathBuilderTest extends \PHPUnit_Framework_TestCase -{ - /** - * @var string - */ - const PREFIX = 'old1[old2].old3[old4][old5].old6'; - - /** - * @var PropertyPathBuilder - */ - private $builder; - - protected function setUp() - { - $this->builder = new PropertyPathBuilder(new PropertyPath(self::PREFIX)); - } - - public function testCreateEmpty() - { - $builder = new PropertyPathBuilder(); - - $this->assertNull($builder->getPropertyPath()); - } - - public function testCreateCopyPath() - { - $this->assertEquals(new PropertyPath(self::PREFIX), $this->builder->getPropertyPath()); - } - - public function testAppendIndex() - { - $this->builder->appendIndex('new1'); - - $path = new PropertyPath(self::PREFIX.'[new1]'); - - $this->assertEquals($path, $this->builder->getPropertyPath()); - } - - public function testAppendProperty() - { - $this->builder->appendProperty('new1'); - - $path = new PropertyPath(self::PREFIX.'.new1'); - - $this->assertEquals($path, $this->builder->getPropertyPath()); - } - - public function testAppend() - { - $this->builder->append(new PropertyPath('new1[new2]')); - - $path = new PropertyPath(self::PREFIX.'.new1[new2]'); - - $this->assertEquals($path, $this->builder->getPropertyPath()); - } - - public function testAppendUsingString() - { - $this->builder->append('new1[new2]'); - - $path = new PropertyPath(self::PREFIX . '.new1[new2]'); - - $this->assertEquals($path, $this->builder->getPropertyPath()); - } - - public function testAppendWithOffset() - { - $this->builder->append(new PropertyPath('new1[new2].new3'), 1); - - $path = new PropertyPath(self::PREFIX.'[new2].new3'); - - $this->assertEquals($path, $this->builder->getPropertyPath()); - } - - public function testAppendWithOffsetAndLength() - { - $this->builder->append(new PropertyPath('new1[new2].new3'), 1, 1); - - $path = new PropertyPath(self::PREFIX.'[new2]'); - - $this->assertEquals($path, $this->builder->getPropertyPath()); - } - - public function testReplaceByIndex() - { - $this->builder->replaceByIndex(1, 'new1'); - - $path = new PropertyPath('old1[new1].old3[old4][old5].old6'); - - $this->assertEquals($path, $this->builder->getPropertyPath()); - } - - public function testReplaceByIndexWithoutName() - { - $this->builder->replaceByIndex(0); - - $path = new PropertyPath('[old1][old2].old3[old4][old5].old6'); - - $this->assertEquals($path, $this->builder->getPropertyPath()); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testReplaceByIndexDoesNotAllowInvalidOffsets() - { - $this->builder->replaceByIndex(6, 'new1'); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testReplaceByIndexDoesNotAllowNegativeOffsets() - { - $this->builder->replaceByIndex(-1, 'new1'); - } - - public function testReplaceByProperty() - { - $this->builder->replaceByProperty(1, 'new1'); - - $path = new PropertyPath('old1.new1.old3[old4][old5].old6'); - - $this->assertEquals($path, $this->builder->getPropertyPath()); - } - - public function testReplaceByPropertyWithoutName() - { - $this->builder->replaceByProperty(1); - - $path = new PropertyPath('old1.old2.old3[old4][old5].old6'); - - $this->assertEquals($path, $this->builder->getPropertyPath()); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testReplaceByPropertyDoesNotAllowInvalidOffsets() - { - $this->builder->replaceByProperty(6, 'new1'); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testReplaceByPropertyDoesNotAllowNegativeOffsets() - { - $this->builder->replaceByProperty(-1, 'new1'); - } - - public function testReplace() - { - $this->builder->replace(1, 1, new PropertyPath('new1[new2].new3')); - - $path = new PropertyPath('old1.new1[new2].new3.old3[old4][old5].old6'); - - $this->assertEquals($path, $this->builder->getPropertyPath()); - } - - public function testReplaceUsingString() - { - $this->builder->replace(1, 1, 'new1[new2].new3'); - - $path = new PropertyPath('old1.new1[new2].new3.old3[old4][old5].old6'); - - $this->assertEquals($path, $this->builder->getPropertyPath()); - } - - public function testReplaceNegative() - { - $this->builder->replace(-1, 1, new PropertyPath('new1[new2].new3')); - - $path = new PropertyPath('old1[old2].old3[old4][old5].new1[new2].new3'); - - $this->assertEquals($path, $this->builder->getPropertyPath()); - } - - /** - * @dataProvider provideInvalidOffsets - * @expectedException \OutOfBoundsException - */ - public function testReplaceDoesNotAllowInvalidOffsets($offset) - { - $this->builder->replace($offset, 1, new PropertyPath('new1[new2].new3')); - } - - public function provideInvalidOffsets() - { - return array( - array(6), - array(-7), - ); - } - - public function testReplaceWithLengthGreaterOne() - { - $this->builder->replace(0, 2, new PropertyPath('new1[new2].new3')); - - $path = new PropertyPath('new1[new2].new3.old3[old4][old5].old6'); - - $this->assertEquals($path, $this->builder->getPropertyPath()); - } - - public function testReplaceSubstring() - { - $this->builder->replace(1, 1, new PropertyPath('new1[new2].new3.new4[new5]'), 1, 3); - - $path = new PropertyPath('old1[new2].new3.new4.old3[old4][old5].old6'); - - $this->assertEquals($path, $this->builder->getPropertyPath()); - } - - public function testReplaceSubstringWithLengthGreaterOne() - { - $this->builder->replace(1, 2, new PropertyPath('new1[new2].new3.new4[new5]'), 1, 3); - - $path = new PropertyPath('old1[new2].new3.new4[old4][old5].old6'); - - $this->assertEquals($path, $this->builder->getPropertyPath()); - } - - // https://github.com/symfony/symfony/issues/5605 - public function testReplaceWithLongerPath() - { - // error occurs when path contains at least two more elements - // than the builder - $path = new PropertyPath('new1.new2.new3'); - - $builder = new PropertyPathBuilder(new PropertyPath('old1')); - $builder->replace(0, 1, $path); - - $this->assertEquals($path, $builder->getPropertyPath()); - } - - public function testRemove() - { - $this->builder->remove(3); - - $path = new PropertyPath('old1[old2].old3[old5].old6'); - - $this->assertEquals($path, $this->builder->getPropertyPath()); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testRemoveDoesNotAllowInvalidOffsets() - { - $this->builder->remove(6); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testRemoveDoesNotAllowNegativeOffsets() - { - $this->builder->remove(-1); - } -} diff --git a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyPathTest.php b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyPathTest.php deleted file mode 100644 index 4e77a913ff..0000000000 --- a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/PropertyPathTest.php +++ /dev/null @@ -1,189 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\PropertyAccess\Tests; - -use Symfony\Component\PropertyAccess\PropertyPath; - -class PropertyPathTest extends \PHPUnit_Framework_TestCase -{ - public function testToString() - { - $path = new PropertyPath('reference.traversable[index].property'); - - $this->assertEquals('reference.traversable[index].property', $path->__toString()); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\InvalidPropertyPathException - */ - public function testDotIsRequiredBeforeProperty() - { - new PropertyPath('[index]property'); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\InvalidPropertyPathException - */ - public function testDotCannotBePresentAtTheBeginning() - { - new PropertyPath('.property'); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\InvalidPropertyPathException - */ - public function testUnexpectedCharacters() - { - new PropertyPath('property.$foo'); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\InvalidPropertyPathException - */ - public function testPathCannotBeEmpty() - { - new PropertyPath(''); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException - */ - public function testPathCannotBeNull() - { - new PropertyPath(null); - } - - /** - * @expectedException \Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException - */ - public function testPathCannotBeFalse() - { - new PropertyPath(false); - } - - public function testZeroIsValidPropertyPath() - { - new PropertyPath('0'); - } - - public function testGetParentWithDot() - { - $propertyPath = new PropertyPath('grandpa.parent.child'); - - $this->assertEquals(new PropertyPath('grandpa.parent'), $propertyPath->getParent()); - } - - public function testGetParentWithIndex() - { - $propertyPath = new PropertyPath('grandpa.parent[child]'); - - $this->assertEquals(new PropertyPath('grandpa.parent'), $propertyPath->getParent()); - } - - public function testGetParentWhenThereIsNoParent() - { - $propertyPath = new PropertyPath('path'); - - $this->assertNull($propertyPath->getParent()); - } - - public function testCopyConstructor() - { - $propertyPath = new PropertyPath('grandpa.parent[child]'); - $copy = new PropertyPath($propertyPath); - - $this->assertEquals($propertyPath, $copy); - } - - public function testGetElement() - { - $propertyPath = new PropertyPath('grandpa.parent[child]'); - - $this->assertEquals('child', $propertyPath->getElement(2)); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testGetElementDoesNotAcceptInvalidIndices() - { - $propertyPath = new PropertyPath('grandpa.parent[child]'); - - $propertyPath->getElement(3); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testGetElementDoesNotAcceptNegativeIndices() - { - $propertyPath = new PropertyPath('grandpa.parent[child]'); - - $propertyPath->getElement(-1); - } - - public function testIsProperty() - { - $propertyPath = new PropertyPath('grandpa.parent[child]'); - - $this->assertTrue($propertyPath->isProperty(1)); - $this->assertFalse($propertyPath->isProperty(2)); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testIsPropertyDoesNotAcceptInvalidIndices() - { - $propertyPath = new PropertyPath('grandpa.parent[child]'); - - $propertyPath->isProperty(3); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testIsPropertyDoesNotAcceptNegativeIndices() - { - $propertyPath = new PropertyPath('grandpa.parent[child]'); - - $propertyPath->isProperty(-1); - } - - public function testIsIndex() - { - $propertyPath = new PropertyPath('grandpa.parent[child]'); - - $this->assertFalse($propertyPath->isIndex(1)); - $this->assertTrue($propertyPath->isIndex(2)); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testIsIndexDoesNotAcceptInvalidIndices() - { - $propertyPath = new PropertyPath('grandpa.parent[child]'); - - $propertyPath->isIndex(3); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testIsIndexDoesNotAcceptNegativeIndices() - { - $propertyPath = new PropertyPath('grandpa.parent[child]'); - - $propertyPath->isIndex(-1); - } -} diff --git a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php deleted file mode 100644 index e33f01dd9c..0000000000 --- a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php +++ /dev/null @@ -1,139 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\PropertyAccess\Tests; - -use Symfony\Component\PropertyAccess\StringUtil; - -class StringUtilTest extends \PHPUnit_Framework_TestCase -{ - public function singularifyProvider() - { - // see http://english-zone.com/spelling/plurals.html - // see http://www.scribd.com/doc/3271143/List-of-100-Irregular-Plural-Nouns-in-English - return array( - array('tags', 'tag'), - array('alumni', 'alumnus'), - array('funguses', array('fungus', 'funguse', 'fungusis')), - array('fungi', 'fungus'), - array('axes', array('ax', 'axe', 'axis')), - array('appendices', array('appendex', 'appendix', 'appendice')), - array('indices', array('index', 'indix', 'indice')), - array('prices', array('prex', 'prix', 'price')), - array('indexes', 'index'), - array('children', 'child'), - array('men', 'man'), - array('women', 'woman'), - array('oxen', 'ox'), - array('bacteria', array('bacterion', 'bacterium')), - array('criteria', array('criterion', 'criterium')), - array('feet', 'foot'), - array('nebulae', 'nebula'), - array('babies', 'baby'), - array('hooves', 'hoof'), - array('chateaux', 'chateau'), - array('echoes', array('echo', 'echoe')), - array('analyses', array('analys', 'analyse', 'analysis')), - array('theses', array('thes', 'these', 'thesis')), - array('foci', 'focus'), - array('focuses', array('focus', 'focuse', 'focusis')), - array('oases', array('oas', 'oase', 'oasis')), - array('matrices', array('matrex', 'matrix', 'matrice')), - array('matrixes', 'matrix'), - array('bureaus', 'bureau'), - array('bureaux', 'bureau'), - array('beaux', 'beau'), - array('data', array('daton', 'datum')), - array('phenomena', array('phenomenon', 'phenomenum')), - array('strata', array('straton', 'stratum')), - array('geese', 'goose'), - array('teeth', 'tooth'), - array('antennae', 'antenna'), - array('antennas', 'antenna'), - array('houses', array('hous', 'house', 'housis')), - array('arches', array('arch', 'arche')), - array('atlases', array('atlas', 'atlase', 'atlasis')), - array('batches', array('batch', 'batche')), - array('bushes', array('bush', 'bushe')), - array('buses', array('bus', 'buse', 'busis')), - array('calves', 'calf'), - array('circuses', array('circus', 'circuse', 'circusis')), - array('crises', array('cris', 'crise', 'crisis')), - array('dwarves', 'dwarf'), - array('elves', 'elf'), - array('emphases', array('emphas', 'emphase', 'emphasis')), - array('faxes', 'fax'), - array('halves', 'half'), - array('heroes', array('hero', 'heroe')), - array('hoaxes', 'hoax'), - array('irises', array('iris', 'irise', 'irisis')), - array('kisses', 'kiss'), - array('addresses', 'address'), - array('accesses', 'access'), - array('knives', 'knife'), - array('lives', 'life'), - array('lice', 'louse'), - array('mice', 'mouse'), - array('neuroses', array('neuros', 'neurose', 'neurosis')), - array('plateaux', 'plateau'), - array('poppies', 'poppy'), - array('quizzes', 'quiz'), - array('scarves', 'scarf'), - array('spies', 'spy'), - array('stories', 'story'), - array('syllabi', 'syllabus'), - array('thieves', 'thief'), - array('waltzes', array('waltz', 'waltze')), - array('wharves', 'wharf'), - array('wives', 'wife'), - array('ions', 'ion'), - array('bases', array('bas', 'base', 'basis')), - array('cars', 'car'), - array('cassettes', array('cassett', 'cassette')), - array('lamps', 'lamp'), - array('hats', 'hat'), - array('cups', 'cup'), - array('boxes', 'box'), - array('sandwiches', array('sandwich', 'sandwiche')), - array('suitcases', array('suitcas', 'suitcase', 'suitcasis')), - array('roses', array('ros', 'rose', 'rosis')), - array('garages', array('garag', 'garage')), - array('shoes', array('sho', 'shoe')), - array('days', 'day'), - array('boys', 'boy'), - array('roofs', 'roof'), - array('cliffs', 'cliff'), - array('sheriffs', 'sheriff'), - array('discos', 'disco'), - array('pianos', 'piano'), - array('photos', 'photo'), - array('trees', array('tre', 'tree')), - array('bees', array('be', 'bee')), - array('cheeses', array('chees', 'cheese', 'cheesis')), - array('radii', 'radius'), - array('objectives', 'objective'), - array('moves', 'move'), - - // test casing: if the first letter was uppercase, it should remain so - array('Men', 'Man'), - array('GrandChildren', 'GrandChild'), - array('SubTrees', array('SubTre', 'SubTree')), - ); - } - - /** - * @dataProvider singularifyProvider - */ - public function testSingularify($plural, $singular) - { - $this->assertEquals($singular, StringUtil::singularify($plural)); - } -} diff --git a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/composer.json b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/composer.json index 318604274a..d79eba11fd 100644 --- a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/composer.json +++ b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/composer.json @@ -25,7 +25,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-master": "2.4-dev" } } } diff --git a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/phpunit.xml.dist b/vendor/symfony/property-access/Symfony/Component/PropertyAccess/phpunit.xml.dist deleted file mode 100644 index 8799eaccf5..0000000000 --- a/vendor/symfony/property-access/Symfony/Component/PropertyAccess/phpunit.xml.dist +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ./Tests/ - - - - - - ./ - - ./Resources - ./Tests - - - - diff --git a/vendor/zendframework/zend-config/Zend/Config/Config.php b/vendor/zendframework/zend-config/Zend/Config/Config.php index a1e1f7d65f..dd85f3d553 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Config.php +++ b/vendor/zendframework/zend-config/Zend/Config/Config.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Exception/ExceptionInterface.php b/vendor/zendframework/zend-config/Zend/Config/Exception/ExceptionInterface.php index 92272f8d16..5824f01f5c 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Exception/ExceptionInterface.php +++ b/vendor/zendframework/zend-config/Zend/Config/Exception/ExceptionInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Exception/InvalidArgumentException.php b/vendor/zendframework/zend-config/Zend/Config/Exception/InvalidArgumentException.php index 0d15e1f15b..ed733922f4 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Exception/InvalidArgumentException.php +++ b/vendor/zendframework/zend-config/Zend/Config/Exception/InvalidArgumentException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Exception/RuntimeException.php b/vendor/zendframework/zend-config/Zend/Config/Exception/RuntimeException.php index d91923ced8..d247775b75 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Exception/RuntimeException.php +++ b/vendor/zendframework/zend-config/Zend/Config/Exception/RuntimeException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Factory.php b/vendor/zendframework/zend-config/Zend/Config/Factory.php index 86fe6b6a3c..ba7ef07427 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Factory.php +++ b/vendor/zendframework/zend-config/Zend/Config/Factory.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Processor/Constant.php b/vendor/zendframework/zend-config/Zend/Config/Processor/Constant.php index 265c937db2..28f76b9a75 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Processor/Constant.php +++ b/vendor/zendframework/zend-config/Zend/Config/Processor/Constant.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Processor/Filter.php b/vendor/zendframework/zend-config/Zend/Config/Processor/Filter.php index 7740a26cbd..99909f289a 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Processor/Filter.php +++ b/vendor/zendframework/zend-config/Zend/Config/Processor/Filter.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Processor/ProcessorInterface.php b/vendor/zendframework/zend-config/Zend/Config/Processor/ProcessorInterface.php index aafe0991e4..6aa28e91c0 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Processor/ProcessorInterface.php +++ b/vendor/zendframework/zend-config/Zend/Config/Processor/ProcessorInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Processor/Queue.php b/vendor/zendframework/zend-config/Zend/Config/Processor/Queue.php index 386e2517eb..9a7905f219 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Processor/Queue.php +++ b/vendor/zendframework/zend-config/Zend/Config/Processor/Queue.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Processor/Token.php b/vendor/zendframework/zend-config/Zend/Config/Processor/Token.php index fb85b53f97..cff098b912 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Processor/Token.php +++ b/vendor/zendframework/zend-config/Zend/Config/Processor/Token.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Processor/Translator.php b/vendor/zendframework/zend-config/Zend/Config/Processor/Translator.php index db9691d197..62a2521692 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Processor/Translator.php +++ b/vendor/zendframework/zend-config/Zend/Config/Processor/Translator.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Reader/Ini.php b/vendor/zendframework/zend-config/Zend/Config/Reader/Ini.php index 8f682d2884..b44ab5380a 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Reader/Ini.php +++ b/vendor/zendframework/zend-config/Zend/Config/Reader/Ini.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Reader/Json.php b/vendor/zendframework/zend-config/Zend/Config/Reader/Json.php index 3166e6b0e4..407e2aafa5 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Reader/Json.php +++ b/vendor/zendframework/zend-config/Zend/Config/Reader/Json.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Reader/ReaderInterface.php b/vendor/zendframework/zend-config/Zend/Config/Reader/ReaderInterface.php index 9061c57a85..0393fe0528 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Reader/ReaderInterface.php +++ b/vendor/zendframework/zend-config/Zend/Config/Reader/ReaderInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Reader/Xml.php b/vendor/zendframework/zend-config/Zend/Config/Reader/Xml.php index ad81764c62..369b0b4f48 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Reader/Xml.php +++ b/vendor/zendframework/zend-config/Zend/Config/Reader/Xml.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Reader/Yaml.php b/vendor/zendframework/zend-config/Zend/Config/Reader/Yaml.php index 9ccbb9685c..67fe6fcb1a 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Reader/Yaml.php +++ b/vendor/zendframework/zend-config/Zend/Config/Reader/Yaml.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/ReaderPluginManager.php b/vendor/zendframework/zend-config/Zend/Config/ReaderPluginManager.php index 8b0a3ee048..3e74a5640c 100644 --- a/vendor/zendframework/zend-config/Zend/Config/ReaderPluginManager.php +++ b/vendor/zendframework/zend-config/Zend/Config/ReaderPluginManager.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Writer/AbstractWriter.php b/vendor/zendframework/zend-config/Zend/Config/Writer/AbstractWriter.php index 5c7d69896a..fa94a6b867 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Writer/AbstractWriter.php +++ b/vendor/zendframework/zend-config/Zend/Config/Writer/AbstractWriter.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Writer/Ini.php b/vendor/zendframework/zend-config/Zend/Config/Writer/Ini.php index 1fffa8f16a..9244f73e62 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Writer/Ini.php +++ b/vendor/zendframework/zend-config/Zend/Config/Writer/Ini.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Writer/Json.php b/vendor/zendframework/zend-config/Zend/Config/Writer/Json.php index 4048ee8e1f..04548495b7 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Writer/Json.php +++ b/vendor/zendframework/zend-config/Zend/Config/Writer/Json.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Writer/PhpArray.php b/vendor/zendframework/zend-config/Zend/Config/Writer/PhpArray.php index 478a006ad8..fa33604d95 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Writer/PhpArray.php +++ b/vendor/zendframework/zend-config/Zend/Config/Writer/PhpArray.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Writer/WriterInterface.php b/vendor/zendframework/zend-config/Zend/Config/Writer/WriterInterface.php index d121b8847d..afbecd104b 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Writer/WriterInterface.php +++ b/vendor/zendframework/zend-config/Zend/Config/Writer/WriterInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Writer/Xml.php b/vendor/zendframework/zend-config/Zend/Config/Writer/Xml.php index 41a5ca51d7..3f46c7d9f3 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Writer/Xml.php +++ b/vendor/zendframework/zend-config/Zend/Config/Writer/Xml.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/Writer/Yaml.php b/vendor/zendframework/zend-config/Zend/Config/Writer/Yaml.php index be2aa07a04..7170841ce0 100644 --- a/vendor/zendframework/zend-config/Zend/Config/Writer/Yaml.php +++ b/vendor/zendframework/zend-config/Zend/Config/Writer/Yaml.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-config/Zend/Config/WriterPluginManager.php b/vendor/zendframework/zend-config/Zend/Config/WriterPluginManager.php index e41c7d31d7..d6733452fd 100755 --- a/vendor/zendframework/zend-config/Zend/Config/WriterPluginManager.php +++ b/vendor/zendframework/zend-config/Zend/Config/WriterPluginManager.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -14,9 +14,9 @@ use Zend\ServiceManager\AbstractPluginManager; class WriterPluginManager extends AbstractPluginManager { protected $invokableClasses = array( - 'php' => 'Zend\Config\Writer\PhpArray', 'ini' => 'Zend\Config\Writer\Ini', 'json' => 'Zend\Config\Writer\Json', + 'php' => 'Zend\Config\Writer\PhpArray', 'yaml' => 'Zend\Config\Writer\Yaml', 'xml' => 'Zend\Config\Writer\Xml', ); diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/AbstractOptions.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/AbstractOptions.php index 0e68c29e11..ffe471a511 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/AbstractOptions.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/AbstractOptions.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayObject.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayObject.php index 806c128fc7..2bebaf8dd9 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayObject.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayObject.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayObject/PhpLegacyCompatibility.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayObject/PhpLegacyCompatibility.php index 9a71605e72..b34f21cb74 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayObject/PhpLegacyCompatibility.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayObject/PhpLegacyCompatibility.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayObject/PhpReferenceCompatibility.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayObject/PhpReferenceCompatibility.php index e25257c761..a6d7b9abba 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayObject/PhpReferenceCompatibility.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayObject/PhpReferenceCompatibility.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArraySerializableInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArraySerializableInterface.php index 7bd6f6eddb..222f57b0a1 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArraySerializableInterface.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArraySerializableInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayStack.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayStack.php index 559d65e3f0..0fcceb954f 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayStack.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayStack.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayUtils.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayUtils.php index 4261d2e65f..1518e22e80 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayUtils.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ArrayUtils.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/CallbackHandler.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/CallbackHandler.php index f1ac4a65b3..303558adfe 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/CallbackHandler.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/CallbackHandler.php @@ -3,13 +3,12 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Stdlib; -use Closure; use ReflectionClass; /** diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/DateTime.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/DateTime.php index 5c88ad4732..64a39f62fa 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/DateTime.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/DateTime.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/DispatchableInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/DispatchableInterface.php index ab672fa13f..b8bfdac168 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/DispatchableInterface.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/DispatchableInterface.php @@ -3,23 +3,20 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Stdlib; -use Zend\Stdlib\RequestInterface as Request; -use Zend\Stdlib\ResponseInterface as Response; - interface DispatchableInterface { /** * Dispatch a request * - * @param Request $request - * @param null|Response $response + * @param RequestInterface $request + * @param null|ResponseInterface $response * @return Response|mixed */ - public function dispatch(Request $request, Response $response = null); + public function dispatch(RequestInterface $request, ResponseInterface $response = null); } diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ErrorHandler.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ErrorHandler.php index 5096f53d9d..6a63ee22fc 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ErrorHandler.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ErrorHandler.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/BadMethodCallException.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/BadMethodCallException.php index 6cf1c9ecc0..4b06b38852 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/BadMethodCallException.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/BadMethodCallException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/DomainException.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/DomainException.php index 2744570f28..3178c15340 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/DomainException.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/DomainException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/ExceptionInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/ExceptionInterface.php index 0424a4ea9a..d43eb3078a 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/ExceptionInterface.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/ExceptionInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/ExtensionNotLoadedException.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/ExtensionNotLoadedException.php index b883641a63..3955952f80 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/ExtensionNotLoadedException.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/ExtensionNotLoadedException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/InvalidArgumentException.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/InvalidArgumentException.php index 9efb0e09b5..534d1906a8 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/InvalidArgumentException.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/InvalidArgumentException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/InvalidCallbackException.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/InvalidCallbackException.php index 30e97e83bd..bfc1070a1c 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/InvalidCallbackException.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/InvalidCallbackException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/LogicException.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/LogicException.php index 55e07d6a97..8becb252bd 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/LogicException.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/LogicException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/RuntimeException.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/RuntimeException.php index 20c065587d..bb52eb874a 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/RuntimeException.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Exception/RuntimeException.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Glob.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Glob.php index a9e29fd0c6..5a821be9e0 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Glob.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Glob.php @@ -3,14 +3,12 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Stdlib; -use Zend\Stdlib\Exception; -use Zend\Stdlib\ErrorHandler; /** * Wrapper for glob with fallback if GLOB_BRACE is not available. diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/AbstractHydrator.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/AbstractHydrator.php index 729260f910..6397a86a01 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/AbstractHydrator.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/AbstractHydrator.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -12,7 +12,6 @@ namespace Zend\Stdlib\Hydrator; use ArrayObject; use Zend\Stdlib\Exception; use Zend\Stdlib\Hydrator\Filter\FilterComposite; -use Zend\Stdlib\Hydrator\StrategyEnabledInterface; use Zend\Stdlib\Hydrator\Strategy\StrategyInterface; abstract class AbstractHydrator implements HydratorInterface, StrategyEnabledInterface diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/AggregateHydrator.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/AggregateHydrator.php index bdcf1eb0ad..335f5648ac 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/AggregateHydrator.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/AggregateHydrator.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -12,8 +12,6 @@ namespace Zend\Stdlib\Hydrator\Aggregate; use Zend\EventManager\EventManager; use Zend\EventManager\EventManagerAwareInterface; use Zend\EventManager\EventManagerInterface; -use Zend\Stdlib\Exception; -use Zend\Stdlib\Hydrator\Filter\FilterComposite; use Zend\Stdlib\Hydrator\HydratorInterface; /** diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/ExtractEvent.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/ExtractEvent.php index dfdfbcfb6b..7e199397a5 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/ExtractEvent.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/ExtractEvent.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/HydrateEvent.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/HydrateEvent.php index 11bab02379..0cc48abee0 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/HydrateEvent.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/HydrateEvent.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/HydratorListener.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/HydratorListener.php index 0ce5ddac03..d2d8ff46ac 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/HydratorListener.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Aggregate/HydratorListener.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ArraySerializable.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ArraySerializable.php index d9631122e1..6331af0087 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ArraySerializable.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ArraySerializable.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ClassMethods.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ClassMethods.php index a3d76ceffb..ec3fc6ffb9 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ClassMethods.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ClassMethods.php @@ -3,13 +3,12 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Stdlib\Hydrator; -use ReflectionMethod; use Traversable; use Zend\Stdlib\Exception; use Zend\Stdlib\ArrayUtils; diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/FilterComposite.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/FilterComposite.php index 35bb437c07..49cd785d4a 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/FilterComposite.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/FilterComposite.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Stdlib\Hydrator\Filter; diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/FilterInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/FilterInterface.php index 30bd3575a1..7e2ebaaea6 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/FilterInterface.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/FilterInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Stdlib\Hydrator\Filter; diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/FilterProviderInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/FilterProviderInterface.php index 18f3597a65..e3fbc8c078 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/FilterProviderInterface.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/FilterProviderInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Stdlib\Hydrator\Filter; diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/GetFilter.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/GetFilter.php index d112396ec0..8a303f8f3e 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/GetFilter.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/GetFilter.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Stdlib\Hydrator\Filter; diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/HasFilter.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/HasFilter.php index dfc23f97f2..48011fe055 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/HasFilter.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/HasFilter.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Stdlib\Hydrator\Filter; diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/IsFilter.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/IsFilter.php index 233ae139f6..736212b5b9 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/IsFilter.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/IsFilter.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Stdlib\Hydrator\Filter; diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/MethodMatchFilter.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/MethodMatchFilter.php index a61cd5a3d6..0f8db0714a 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/MethodMatchFilter.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/MethodMatchFilter.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Stdlib\Hydrator\Filter; diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/NumberOfParameterFilter.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/NumberOfParameterFilter.php index 7f4e05289f..25ed587dbd 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/NumberOfParameterFilter.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/NumberOfParameterFilter.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -12,7 +12,6 @@ namespace Zend\Stdlib\Hydrator\Filter; use ReflectionException; use ReflectionMethod; use Zend\Stdlib\Exception\InvalidArgumentException; -use Zend\Stdlib\Hydrator\Filter\FilterInterface; class NumberOfParameterFilter implements FilterInterface { diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/OptionalParametersFilter.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/OptionalParametersFilter.php index 9fa1de07e1..b78a21b1d2 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/OptionalParametersFilter.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Filter/OptionalParametersFilter.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Stdlib\Hydrator\Filter; diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/HydratorAwareInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/HydratorAwareInterface.php index f2784b3bb2..598af9f1ea 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/HydratorAwareInterface.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/HydratorAwareInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/HydratorInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/HydratorInterface.php index c6b3e89e20..7d65bb0851 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/HydratorInterface.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/HydratorInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/HydratorOptionsInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/HydratorOptionsInterface.php index 740cfb435d..0830b75818 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/HydratorOptionsInterface.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/HydratorOptionsInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/HydratorPluginManager.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/HydratorPluginManager.php index 0e9892a252..3b01f0c994 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/HydratorPluginManager.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/HydratorPluginManager.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ObjectProperty.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ObjectProperty.php index c0bf569a2f..c53dafb156 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ObjectProperty.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/ObjectProperty.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Reflection.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Reflection.php index fae361aab7..3e9cfd0cc2 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Reflection.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Reflection.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/ClosureStrategy.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/ClosureStrategy.php index e2b32a640c..a5cb3413a4 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/ClosureStrategy.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/ClosureStrategy.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/DefaultStrategy.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/DefaultStrategy.php index d98f1f4c72..d455f177d8 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/DefaultStrategy.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/DefaultStrategy.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/SerializableStrategy.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/SerializableStrategy.php index 67b323ad6a..71375bb978 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/SerializableStrategy.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/SerializableStrategy.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/StrategyInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/StrategyInterface.php index 8a16355fb3..03208b3eef 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/StrategyInterface.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/Strategy/StrategyInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/StrategyEnabledInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/StrategyEnabledInterface.php index 41fda04c4e..9cb0f4ab63 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/StrategyEnabledInterface.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Hydrator/StrategyEnabledInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/InitializableInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/InitializableInterface.php index 39a71ebf23..f50343c25b 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/InitializableInterface.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/InitializableInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Message.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Message.php index 3e3f1f5be5..c6c1c825c6 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Message.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Message.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/MessageInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/MessageInterface.php index 0abb1ff6b8..8d94e146bb 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/MessageInterface.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/MessageInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ParameterObjectInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ParameterObjectInterface.php index 416b8c2985..e03f4e6c45 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ParameterObjectInterface.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ParameterObjectInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Parameters.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Parameters.php index be72f3fd98..e33e4e482c 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Parameters.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Parameters.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ParametersInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ParametersInterface.php index e955b2ac7a..7dcd667784 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ParametersInterface.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ParametersInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/PriorityQueue.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/PriorityQueue.php index 21cca340a1..869af132f2 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/PriorityQueue.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/PriorityQueue.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Request.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Request.php index 8427bc08f3..674111e312 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Request.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Request.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/RequestInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/RequestInterface.php index 4a2252de4e..210e486907 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/RequestInterface.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/RequestInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Response.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Response.php index 1c2ea76b19..69b8818ae5 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/Response.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/Response.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ResponseInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ResponseInterface.php index cf5d0edd4e..2ddc9787ab 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/ResponseInterface.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/ResponseInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/SplPriorityQueue.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/SplPriorityQueue.php index 5baa967ff9..404e4c243f 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/SplPriorityQueue.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/SplPriorityQueue.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/SplQueue.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/SplQueue.php index e18ebc6821..fe06b88472 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/SplQueue.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/SplQueue.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/SplStack.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/SplStack.php index 3bb8f67960..1b17acc72f 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/SplStack.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/SplStack.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringUtils.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringUtils.php index 2945f9aa62..e468a8f294 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringUtils.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringUtils.php @@ -3,13 +3,12 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Stdlib; -use Zend\Stdlib\ErrorHandler; use Zend\Stdlib\StringWrapper\StringWrapperInterface; /** diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/AbstractStringWrapper.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/AbstractStringWrapper.php index e22649e7fa..d3e8830d65 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/AbstractStringWrapper.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/AbstractStringWrapper.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Iconv.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Iconv.php index 35dc39a1c9..d240eaaddb 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Iconv.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Iconv.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Intl.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Intl.php index 1c3973bb9d..77596c8473 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Intl.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Intl.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -65,7 +65,12 @@ class Intl extends AbstractStringWrapper */ public function substr($str, $offset = 0, $length = null) { - return grapheme_substr($str, $offset, $length); + // Due fix of PHP #62759 The third argument returns an empty string if is 0 or null. + if ($length !== null) { + return grapheme_substr($str, $offset, $length); + } + + return grapheme_substr($str, $offset); } /** diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/MbString.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/MbString.php index cc47d6ee32..fad6629560 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/MbString.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/MbString.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Native.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Native.php index 978b731118..d6e55b1086 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Native.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/Native.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/StringWrapperInterface.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/StringWrapperInterface.php index 974b0be489..a22c4e5573 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/StringWrapperInterface.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/StringWrapper/StringWrapperInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/vendor/zendframework/zend-stdlib/Zend/Stdlib/compatibility/autoload.php b/vendor/zendframework/zend-stdlib/Zend/Stdlib/compatibility/autoload.php index cfc5696262..1a237d227e 100644 --- a/vendor/zendframework/zend-stdlib/Zend/Stdlib/compatibility/autoload.php +++ b/vendor/zendframework/zend-stdlib/Zend/Stdlib/compatibility/autoload.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @deprecated */