Version Description
- 2017-01-17 =
- Improved: style/script conflicts on MailPoet pages are now resolved by unloading non-default assets. Thx Michel for reporting one such case!;
- Fixed: MySQL wait_timeout of less than 20 seconds results in errors when sending. Thx Tim!;
- Fixed: unsubscribe URL doesn't work when BuddyPress is enabled;
- Fixed: some form styles aren't saved. Thanks Pete!;
- Fixed: typo in subscription management shortcode instructions. Thx Tim once more!
Download this release
Release Info
Developer | wysija |
Plugin | MailPoet Newsletters (New) |
Version | 3.0.0-beta.13 |
Comparing to | |
See all releases |
Code changes from version 3.0.0-beta.12 to 3.0.0-beta.13
- assets/css/admin.css +2 -2
- assets/js/admin.js +51 -71
- assets/js/form_editor.js +676 -679
- assets/js/lib/tinymce/package.json +0 -83
- assets/js/mailpoet.js +6 -6
- assets/js/newsletter_editor.js +8 -9
- assets/js/public.js +6 -6
- lang/mailpoet.pot +20 -20
- lib/Config/Database.php +94 -0
- lib/Config/Initializer.php +35 -59
- lib/Config/Menu.php +67 -25
- lib/Form/Renderer.php +1 -1
- lib/Form/Util/Styles.php +21 -126
- lib/Router/Router.php +1 -0
- lib/Util/ConflictResolver.php +85 -0
- mailpoet.php +2 -2
- readme.txt +9 -2
- vendor/autoload.php +2 -2
- vendor/composer/ClassLoader.php +7 -5
- vendor/composer/autoload_classmap.php +40 -0
- vendor/composer/autoload_namespaces.php +1 -0
- vendor/composer/autoload_real.php +7 -7
- vendor/composer/autoload_static.php +52 -5
- vendor/composer/installed.json +84 -34
- vendor/j4mie/idiorm/composer.json +6 -0
- vendor/j4mie/idiorm/idiorm.php +102 -22
- vendor/sabberworm/index.php +0 -0
- vendor/sabberworm/php-css-parser/.travis.yml +12 -0
- vendor/sabberworm/php-css-parser/Doxyfile +2310 -0
- vendor/sabberworm/php-css-parser/composer.json +20 -0
- vendor/sabberworm/php-css-parser/composer.lock +1317 -0
- vendor/sabberworm/php-css-parser/index.php +0 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/AtRuleBlockList.php +48 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/CSSBlockList.php +82 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/CSSList.php +157 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/Document.php +105 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/KeyFrame.php +56 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/index.php +0 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Comment/Comment.php +51 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Comment/Commentable.php +23 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Comment/index.php +0 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/OutputFormat.php +289 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parser.php +719 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/OutputException.php +12 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/SourceException.php +18 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/UnexpectedTokenException.php +31 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/index.php +0 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/AtRule.php +15 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/CSSNamespace.php +75 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Charset.php +66 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Import.php +69 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Selector.php +74 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/index.php +0 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Renderable.php +9 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Rule/Rule.php +197 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Rule/index.php +0 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/AtRuleSet.php +44 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/DeclarationBlock.php +608 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/RuleSet.php +173 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/index.php +0 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Settings.php +54 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CSSFunction.php +40 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CSSString.php +32 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Color.php +41 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/PrimitiveValue.php +10 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/RuleValueList.php +9 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Size.php +73 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/URL.php +31 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Value.php +24 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/ValueList.php +47 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/index.php +0 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/index.php +0 -0
- vendor/sabberworm/php-css-parser/lib/Sabberworm/index.php +0 -0
- vendor/sabberworm/php-css-parser/lib/index.php +0 -0
- vendor/sabberworm/php-css-parser/phpunit.xml +10 -0
- vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/CSSList/AtRuleBlockListTest.php +27 -0
- vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/CSSList/DocumentTest.php +26 -0
- vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/CSSList/index.php +0 -0
- vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/OutputFormatTest.php +170 -0
- vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/ParserTest.php +585 -0
- vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/RuleSet/DeclarationBlockTest.php +267 -0
- vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/RuleSet/LenientParsingTest.php +76 -0
- vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/RuleSet/index.php +0 -0
- vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/index.php +0 -0
- vendor/sabberworm/php-css-parser/tests/Sabberworm/index.php +0 -0
- vendor/sabberworm/php-css-parser/tests/bootstrap.php +10 -0
- vendor/sabberworm/php-css-parser/tests/files/-charset-after-rule.css +5 -0
- vendor/sabberworm/php-css-parser/tests/files/-charset-in-block.css +3 -0
- vendor/sabberworm/php-css-parser/tests/files/-empty.css +0 -0
- vendor/sabberworm/php-css-parser/tests/files/-end-token-2.css +1 -0
- vendor/sabberworm/php-css-parser/tests/files/-end-token.css +1 -0
- vendor/sabberworm/php-css-parser/tests/files/-fault-tolerance.css +15 -0
- vendor/sabberworm/php-css-parser/tests/files/-tobedone.css +9 -0
- vendor/sabberworm/php-css-parser/tests/files/1readme.css +10 -0
- vendor/sabberworm/php-css-parser/tests/files/2readme.css +5 -0
- vendor/sabberworm/php-css-parser/tests/files/atrules.css +57 -0
- vendor/sabberworm/php-css-parser/tests/files/case-insensitivity.css +15 -0
- vendor/sabberworm/php-css-parser/tests/files/colortest.css +12 -0
- vendor/sabberworm/php-css-parser/tests/files/comments.css +17 -0
- vendor/sabberworm/php-css-parser/tests/files/create-shorthands.css +6 -0
- vendor/sabberworm/php-css-parser/tests/files/docuwiki.css +1 -0
- vendor/sabberworm/php-css-parser/tests/files/expand-shorthands.css +7 -0
- vendor/sabberworm/php-css-parser/tests/files/functions.css +21 -0
- vendor/sabberworm/php-css-parser/tests/files/ie-hacks.css +9 -0
- vendor/sabberworm/php-css-parser/tests/files/ie.css +6 -0
- vendor/sabberworm/php-css-parser/tests/files/important.css +8 -0
- vendor/sabberworm/php-css-parser/tests/files/index.php +0 -0
- vendor/sabberworm/php-css-parser/tests/files/inner-color.css +3 -0
- vendor/sabberworm/php-css-parser/tests/files/line-numbers.css +32 -0
- vendor/sabberworm/php-css-parser/tests/files/namespaces.css +18 -0
- vendor/sabberworm/php-css-parser/tests/files/nested.css +17 -0
- vendor/sabberworm/php-css-parser/tests/files/slashed.css +4 -0
- vendor/sabberworm/php-css-parser/tests/files/specificity.css +7 -0
- vendor/sabberworm/php-css-parser/tests/files/unicode.css +12 -0
- vendor/sabberworm/php-css-parser/tests/files/url.css +4 -0
- vendor/sabberworm/php-css-parser/tests/files/values.css +14 -0
- vendor/sabberworm/php-css-parser/tests/files/webkit.css +1 -0
- vendor/sabberworm/php-css-parser/tests/files/whitespace.css +3 -0
- vendor/sabberworm/php-css-parser/tests/index.php +0 -0
- vendor/sabberworm/php-css-parser/tests/phpunit.xml +1 -0
- vendor/sabberworm/php-css-parser/tests/quickdump.php +20 -0
- vendor/swiftmailer/swiftmailer/composer.json +2 -1
- vendor/swiftmailer/swiftmailer/lib/classes/Swift/MailTransport.php +2 -0
- vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php +7 -7
- vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php +1 -1
- vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/OpenDKIMHeader.php +1 -5
- vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php +29 -23
- vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php +8 -8
- vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ThrottlerPlugin.php +4 -4
- vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DKIMSigner.php +9 -9
- vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DomainKeySigner.php +8 -8
- vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php +1 -0
- vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php +1 -1
- vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php +1 -1
- vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/MailTransport.php +39 -1
- vendor/swiftmailer/swiftmailer/phpunit.xml.dist +3 -1
- vendor/symfony/polyfill-mbstring/Mbstring.php +53 -7
- vendor/symfony/polyfill-mbstring/bootstrap.php +6 -1
- vendor/symfony/polyfill-mbstring/composer.json +1 -1
- vendor/symfony/translation/Catalogue/TargetOperation.php +3 -3
- vendor/symfony/translation/DataCollectorTranslator.php +14 -0
- vendor/symfony/translation/Dumper/IcuResFileDumper.php +1 -1
- vendor/symfony/translation/LoggingTranslator.php +14 -0
- vendor/symfony/translation/MessageCatalogue.php +4 -0
- vendor/symfony/translation/MessageCatalogueInterface.php +3 -3
- vendor/symfony/translation/Translator.php +5 -5
- vendor/twig/twig/.php_cs.dist +15 -0
- vendor/twig/twig/.travis.yml +6 -1
- vendor/twig/twig/composer.json +2 -2
- vendor/twig/twig/ext/twig/php_twig.h +1 -1
- vendor/twig/twig/ext/twig/twig.c +106 -18
- vendor/twig/twig/lib/Twig/Autoloader.php +3 -3
- vendor/twig/twig/lib/Twig/BaseNodeVisitor.php +0 -12
- vendor/twig/twig/lib/Twig/Cache/Filesystem.php +1 -13
- vendor/twig/twig/lib/Twig/Cache/Null.php +3 -13
- vendor/twig/twig/lib/Twig/CacheInterface.php +1 -1
- vendor/twig/twig/lib/Twig/Compiler.php +14 -19
- vendor/twig/twig/lib/Twig/CompilerInterface.php +2 -4
- vendor/twig/twig/lib/Twig/Environment.php +80 -68
- vendor/twig/twig/lib/Twig/Error.php +73 -11
- vendor/twig/twig/lib/Twig/Error/Loader.php +10 -3
- vendor/twig/twig/lib/Twig/Error/Runtime.php +2 -2
- vendor/twig/twig/lib/Twig/Error/Syntax.php +2 -2
- vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php +1 -1
- vendor/twig/twig/lib/Twig/ExpressionParser.php +30 -22
- vendor/twig/twig/lib/Twig/Extension.php +1 -25
- vendor/twig/twig/lib/Twig/Extension/Core.php +105 -37
- vendor/twig/twig/lib/Twig/Extension/Debug.php +5 -1
- vendor/twig/twig/lib/Twig/Extension/Escaper.php +5 -3
- vendor/twig/twig/lib/Twig/Extension/Optimizer.php +5 -1
- vendor/twig/twig/lib/Twig/Extension/Profiler.php +1 -1
- vendor/twig/twig/lib/Twig/Extension/Sandbox.php +5 -1
- vendor/twig/twig/lib/Twig/Extension/Staging.php +18 -2
- vendor/twig/twig/lib/Twig/Extension/StringLoader.php +6 -2
- vendor/twig/twig/lib/Twig/ExtensionInterface.php +3 -5
- vendor/twig/twig/lib/Twig/FactoryRuntimeLoader.php +37 -0
- vendor/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php +1 -1
- vendor/twig/twig/lib/Twig/Filter.php +1 -1
- vendor/twig/twig/lib/Twig/Filter/Function.php +1 -1
- vendor/twig/twig/lib/Twig/Filter/Method.php +1 -1
- vendor/twig/twig/lib/Twig/Filter/Node.php +1 -1
- vendor/twig/twig/lib/Twig/FilterCallableInterface.php +1 -1
- vendor/twig/twig/lib/Twig/FilterInterface.php +1 -1
- vendor/twig/twig/lib/Twig/Function.php +1 -1
- vendor/twig/twig/lib/Twig/Function/Function.php +2 -2
- vendor/twig/twig/lib/Twig/Function/Method.php +2 -2
- vendor/twig/twig/lib/Twig/Function/Node.php +1 -1
- vendor/twig/twig/lib/Twig/FunctionCallableInterface.php +1 -1
- vendor/twig/twig/lib/Twig/FunctionInterface.php +2 -2
- vendor/twig/twig/lib/Twig/Lexer.php +21 -18
- vendor/twig/twig/lib/Twig/LexerInterface.php +2 -2
- vendor/twig/twig/lib/Twig/Loader/Array.php +4 -19
- vendor/twig/twig/lib/Twig/Loader/Chain.php +4 -24
- vendor/twig/twig/lib/Twig/Loader/Filesystem.php +1 -18
- vendor/twig/twig/lib/Twig/Loader/String.php +1 -16
- vendor/twig/twig/lib/Twig/LoaderInterface.php +1 -1
- vendor/twig/twig/lib/Twig/Markup.php +1 -1
- vendor/twig/twig/lib/Twig/Node.php +4 -38
- vendor/twig/twig/lib/Twig/Node/AutoEscape.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Block.php +2 -2
- vendor/twig/twig/lib/Twig/Node/BlockReference.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Body.php +1 -1
- vendor/twig/twig/lib/Twig/Node/CheckSecurity.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Do.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Embed.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/Array.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/Binary.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php +5 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php +61 -16
- vendor/twig/twig/lib/Twig/Node/Expression/Call.php +3 -3
- vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/Constant.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Filter.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Function.php +8 -3
- vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php +6 -2
- vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Name.php +16 -6
- vendor/twig/twig/lib/Twig/Node/Expression/NullCoalesce.php +23 -0
- vendor/twig/twig/lib/Twig/Node/Expression/Parent.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/TempName.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Test.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php +5 -2
- vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Expression/Unary.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Flush.php +1 -1
- vendor/twig/twig/lib/Twig/Node/For.php +2 -2
- vendor/twig/twig/lib/Twig/Node/ForLoop.php +1 -1
- vendor/twig/twig/lib/Twig/Node/If.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Import.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Include.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Macro.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Module.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Print.php +2 -2
- vendor/twig/twig/lib/Twig/Node/Sandbox.php +1 -1
- vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php +2 -4
- vendor/twig/twig/lib/Twig/Node/Set.php +2 -2
- vendor/twig/twig/lib/Twig/Node/SetTemp.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Spaceless.php +1 -1
- vendor/twig/twig/lib/Twig/Node/Text.php +2 -2
- vendor/twig/twig/lib/Twig/Node/With.php +62 -0
- vendor/twig/twig/lib/Twig/NodeCaptureInterface.php +19 -0
- vendor/twig/twig/lib/Twig/NodeInterface.php +1 -3
- vendor/twig/twig/lib/Twig/NodeOutputInterface.php +1 -1
- vendor/twig/twig/lib/Twig/NodeTraverser.php +5 -12
- vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php +3 -10
- vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php +8 -28
- vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php +3 -9
- vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php +3 -10
- vendor/twig/twig/lib/Twig/NodeVisitorInterface.php +1 -7
- vendor/twig/twig/lib/Twig/Parser.php +16 -30
- vendor/twig/twig/lib/Twig/ParserInterface.php +2 -4
- vendor/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php +3 -1
- vendor/twig/twig/lib/Twig/Profiler/Dumper/Html.php +3 -1
- vendor/twig/twig/lib/Twig/Profiler/Dumper/Text.php +3 -1
- vendor/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php +1 -4
- vendor/twig/twig/lib/Twig/Profiler/Node/LeaveProfile.php +1 -4
- vendor/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php +5 -12
- vendor/twig/twig/lib/Twig/Profiler/Profile.php +3 -1
- vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php +1 -1
- vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php +1 -1
- vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php +1 -1
- vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedMethodError.php +1 -1
- vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedPropertyError.php +1 -1
- vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php +1 -1
- vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php +3 -1
- vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php +1 -1
- vendor/twig/twig/lib/Twig/SimpleFilter.php +3 -1
- vendor/twig/twig/lib/Twig/SimpleFunction.php +3 -1
- vendor/twig/twig/lib/Twig/SimpleTest.php +3 -1
- vendor/twig/twig/lib/Twig/Source.php +3 -1
- vendor/twig/twig/lib/Twig/SourceContextLoaderInterface.php +1 -1
- vendor/twig/twig/lib/Twig/Template.php +147 -75
- vendor/twig/twig/lib/Twig/TemplateInterface.php +2 -2
- vendor/twig/twig/lib/Twig/TemplateWrapper.php +131 -0
- vendor/twig/twig/lib/Twig/Test.php +1 -1
- vendor/twig/twig/lib/Twig/Test/Function.php +1 -1
- vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php +2 -12
- vendor/twig/twig/lib/Twig/Test/Method.php +1 -1
- vendor/twig/twig/lib/Twig/Test/Node.php +1 -1
- vendor/twig/twig/lib/Twig/Test/NodeTestCase.php +4 -0
- vendor/twig/twig/lib/Twig/TestCallableInterface.php +1 -1
- vendor/twig/twig/lib/Twig/TestInterface.php +1 -1
- vendor/twig/twig/lib/Twig/Token.php +11 -22
- vendor/twig/twig/lib/Twig/TokenParser.php +1 -3
- vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php +5 -3
- vendor/twig/twig/lib/Twig/TokenParser/Block.php +6 -4
- vendor/twig/twig/lib/Twig/TokenParser/Do.php +3 -1
- vendor/twig/twig/lib/Twig/TokenParser/Embed.php +3 -1
- vendor/twig/twig/lib/Twig/TokenParser/Extends.php +6 -4
- vendor/twig/twig/lib/Twig/TokenParser/Filter.php +4 -2
- vendor/twig/twig/lib/Twig/TokenParser/Flush.php +3 -1
- vendor/twig/twig/lib/Twig/TokenParser/For.php +6 -4
- vendor/twig/twig/lib/Twig/TokenParser/From.php +4 -2
- vendor/twig/twig/lib/Twig/TokenParser/If.php +5 -3
- vendor/twig/twig/lib/Twig/TokenParser/Import.php +3 -1
- vendor/twig/twig/lib/Twig/TokenParser/Include.php +4 -2
- vendor/twig/twig/lib/Twig/TokenParser/Macro.php +4 -2
- vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php +4 -2
- vendor/twig/twig/lib/Twig/TokenParser/Set.php +5 -3
- vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php +3 -1
- vendor/twig/twig/lib/Twig/TokenParser/Use.php +4 -2
- vendor/twig/twig/lib/Twig/TokenParser/With.php +50 -0
- vendor/twig/twig/lib/Twig/TokenParserBroker.php +2 -24
- vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php +3 -5
- vendor/twig/twig/lib/Twig/TokenParserInterface.php +2 -6
- vendor/twig/twig/lib/Twig/TokenStream.php +7 -14
- vendor/twig/twig/lib/Twig/Util/DeprecationCollector.php +4 -2
- vendor/twig/twig/phpunit.xml.dist +8 -0
- views/settings/basics.html +1 -1
assets/css/admin.css
CHANGED
@@ -1799,8 +1799,8 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|
1799 |
position: relative;
|
1800 |
overflow: visible;
|
1801 |
-webkit-tap-highlight-color: transparent;
|
1802 |
-
-webkit-font-variant-ligatures:
|
1803 |
-
font-variant-ligatures:
|
1804 |
}
|
1805 |
.CodeMirror-wrap pre {
|
1806 |
word-wrap: break-word;
|
1799 |
position: relative;
|
1800 |
overflow: visible;
|
1801 |
-webkit-tap-highlight-color: transparent;
|
1802 |
+
-webkit-font-variant-ligatures: none;
|
1803 |
+
font-variant-ligatures: none;
|
1804 |
}
|
1805 |
.CodeMirror-wrap pre {
|
1806 |
word-wrap: break-word;
|
assets/js/admin.js
CHANGED
@@ -712,6 +712,17 @@ webpackJsonp([0],[
|
|
712 |
}
|
713 |
};
|
714 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
715 |
var standardReleaser = function (instance) {
|
716 |
var Klass = this;
|
717 |
!(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
|
@@ -751,7 +762,8 @@ webpackJsonp([0],[
|
|
751 |
oneArgumentPooler: oneArgumentPooler,
|
752 |
twoArgumentPooler: twoArgumentPooler,
|
753 |
threeArgumentPooler: threeArgumentPooler,
|
754 |
-
fourArgumentPooler: fourArgumentPooler
|
|
|
755 |
};
|
756 |
|
757 |
module.exports = PooledClass;
|
@@ -827,18 +839,12 @@ webpackJsonp([0],[
|
|
827 |
* will remain to ensure logic does not differ in production.
|
828 |
*/
|
829 |
|
830 |
-
|
831 |
-
|
832 |
-
if (process.env.NODE_ENV !== 'production') {
|
833 |
-
validateFormat = function validateFormat(format) {
|
834 |
if (format === undefined) {
|
835 |
throw new Error('invariant requires an error message argument');
|
836 |
}
|
837 |
-
}
|
838 |
-
}
|
839 |
-
|
840 |
-
function invariant(condition, format, a, b, c, d, e, f) {
|
841 |
-
validateFormat(format);
|
842 |
|
843 |
if (!condition) {
|
844 |
var error;
|
@@ -3091,14 +3097,7 @@ webpackJsonp([0],[
|
|
3091 |
// We warn in this case but don't throw. We expect the element creation to
|
3092 |
// succeed and there will likely be errors in render.
|
3093 |
if (!validType) {
|
3094 |
-
|
3095 |
-
var info = '';
|
3096 |
-
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
3097 |
-
info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.';
|
3098 |
-
}
|
3099 |
-
info += getDeclarationErrorAddendum();
|
3100 |
-
process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0;
|
3101 |
-
}
|
3102 |
}
|
3103 |
|
3104 |
var element = ReactElement.createElement.apply(this, arguments);
|
@@ -4069,7 +4068,7 @@ webpackJsonp([0],[
|
|
4069 |
|
4070 |
'use strict';
|
4071 |
|
4072 |
-
module.exports = '15.4.
|
4073 |
|
4074 |
/***/ },
|
4075 |
/* 32 */
|
@@ -4267,13 +4266,6 @@ webpackJsonp([0],[
|
|
4267 |
|
4268 |
var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
|
4269 |
|
4270 |
-
/**
|
4271 |
-
* Check if a given node should be cached.
|
4272 |
-
*/
|
4273 |
-
function shouldPrecacheNode(node, nodeID) {
|
4274 |
-
return node.nodeType === 1 && node.getAttribute(ATTR_NAME) === String(nodeID) || node.nodeType === 8 && node.nodeValue === ' react-text: ' + nodeID + ' ' || node.nodeType === 8 && node.nodeValue === ' react-empty: ' + nodeID + ' ';
|
4275 |
-
}
|
4276 |
-
|
4277 |
/**
|
4278 |
* Drill down (through composites and empty components) until we get a host or
|
4279 |
* host text component.
|
@@ -4339,7 +4331,7 @@ webpackJsonp([0],[
|
|
4339 |
}
|
4340 |
// We assume the child nodes are in the same order as the child instances.
|
4341 |
for (; childNode !== null; childNode = childNode.nextSibling) {
|
4342 |
-
if (
|
4343 |
precacheNode(childInst, childNode);
|
4344 |
continue outer;
|
4345 |
}
|
@@ -6669,6 +6661,17 @@ webpackJsonp([0],[
|
|
6669 |
}
|
6670 |
};
|
6671 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6672 |
var standardReleaser = function (instance) {
|
6673 |
var Klass = this;
|
6674 |
!(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
|
@@ -6708,7 +6711,8 @@ webpackJsonp([0],[
|
|
6708 |
oneArgumentPooler: oneArgumentPooler,
|
6709 |
twoArgumentPooler: twoArgumentPooler,
|
6710 |
threeArgumentPooler: threeArgumentPooler,
|
6711 |
-
fourArgumentPooler: fourArgumentPooler
|
|
|
6712 |
};
|
6713 |
|
6714 |
module.exports = PooledClass;
|
@@ -11526,18 +11530,12 @@ webpackJsonp([0],[
|
|
11526 |
} else {
|
11527 |
var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
|
11528 |
var childrenToUse = contentToUse != null ? null : props.children;
|
11529 |
-
// TODO: Validate that text is allowed as a child of this node
|
11530 |
if (contentToUse != null) {
|
11531 |
-
//
|
11532 |
-
|
11533 |
-
|
11534 |
-
// https://github.com/facebook/react/issues/6731#issuecomment-254874553
|
11535 |
-
if (contentToUse !== '') {
|
11536 |
-
if (process.env.NODE_ENV !== 'production') {
|
11537 |
-
setAndValidateContentChildDev.call(this, contentToUse);
|
11538 |
-
}
|
11539 |
-
DOMLazyTree.queueText(lazyTree, contentToUse);
|
11540 |
}
|
|
|
11541 |
} else if (childrenToUse != null) {
|
11542 |
var mountImages = this.mountChildren(childrenToUse, transaction, context);
|
11543 |
for (var i = 0; i < mountImages.length; i++) {
|
@@ -13457,17 +13455,7 @@ webpackJsonp([0],[
|
|
13457 |
}
|
13458 |
} else {
|
13459 |
if (props.value == null && props.defaultValue != null) {
|
13460 |
-
|
13461 |
-
// For number inputs, the display value loses trailing decimal points. For email inputs,
|
13462 |
-
// Chrome raises "The specified value <x> is not a valid email address".
|
13463 |
-
//
|
13464 |
-
// Here we check to see if the defaultValue has actually changed, avoiding these problems
|
13465 |
-
// when the user is inputting text
|
13466 |
-
//
|
13467 |
-
// https://github.com/facebook/react/issues/7253
|
13468 |
-
if (node.defaultValue !== '' + props.defaultValue) {
|
13469 |
-
node.defaultValue = '' + props.defaultValue;
|
13470 |
-
}
|
13471 |
}
|
13472 |
if (props.checked == null && props.defaultChecked != null) {
|
13473 |
node.defaultChecked = !!props.defaultChecked;
|
@@ -14214,15 +14202,9 @@ webpackJsonp([0],[
|
|
14214 |
// This is in postMount because we need access to the DOM node, which is not
|
14215 |
// available until after the component has mounted.
|
14216 |
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
|
14217 |
-
var textContent = node.textContent;
|
14218 |
|
14219 |
-
//
|
14220 |
-
|
14221 |
-
// will populate textContent as well.
|
14222 |
-
// https://developer.microsoft.com/microsoft-edge/platform/issues/101525/
|
14223 |
-
if (textContent === inst._wrapperState.initialValue) {
|
14224 |
-
node.value = textContent;
|
14225 |
-
}
|
14226 |
}
|
14227 |
};
|
14228 |
|
@@ -15024,17 +15006,7 @@ webpackJsonp([0],[
|
|
15024 |
instance = ReactEmptyComponent.create(instantiateReactComponent);
|
15025 |
} else if (typeof node === 'object') {
|
15026 |
var element = node;
|
15027 |
-
|
15028 |
-
if (typeof type !== 'function' && typeof type !== 'string') {
|
15029 |
-
var info = '';
|
15030 |
-
if (process.env.NODE_ENV !== 'production') {
|
15031 |
-
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
15032 |
-
info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.';
|
15033 |
-
}
|
15034 |
-
}
|
15035 |
-
info += getDeclarationErrorAddendum(element._owner);
|
15036 |
-
true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', type == null ? type : typeof type, info) : _prodInvariant('130', type == null ? type : typeof type, info) : void 0;
|
15037 |
-
}
|
15038 |
|
15039 |
// Special case string values
|
15040 |
if (typeof element.type === 'string') {
|
@@ -15324,7 +15296,7 @@ webpackJsonp([0],[
|
|
15324 |
// Since plain JS classes are defined without any special initialization
|
15325 |
// logic, we can not catch common errors early. Therefore, we have to
|
15326 |
// catch them here, at initialization time, instead.
|
15327 |
-
process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved
|
15328 |
process.env.NODE_ENV !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : void 0;
|
15329 |
process.env.NODE_ENV !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : void 0;
|
15330 |
process.env.NODE_ENV !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : void 0;
|
@@ -16328,11 +16300,14 @@ webpackJsonp([0],[
|
|
16328 |
|
16329 |
'use strict';
|
16330 |
|
16331 |
-
var _prodInvariant = __webpack_require__(36)
|
|
|
16332 |
|
16333 |
var invariant = __webpack_require__(9);
|
16334 |
|
16335 |
var genericComponentClass = null;
|
|
|
|
|
16336 |
var textComponentClass = null;
|
16337 |
|
16338 |
var ReactHostComponentInjection = {
|
@@ -16345,6 +16320,11 @@ webpackJsonp([0],[
|
|
16345 |
// rendered as props.
|
16346 |
injectTextComponentClass: function (componentClass) {
|
16347 |
textComponentClass = componentClass;
|
|
|
|
|
|
|
|
|
|
|
16348 |
}
|
16349 |
};
|
16350 |
|
@@ -21199,7 +21179,7 @@ webpackJsonp([0],[
|
|
21199 |
|
21200 |
'use strict';
|
21201 |
|
21202 |
-
module.exports = '15.4.
|
21203 |
|
21204 |
/***/ },
|
21205 |
/* 174 */
|
712 |
}
|
713 |
};
|
714 |
|
715 |
+
var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
|
716 |
+
var Klass = this;
|
717 |
+
if (Klass.instancePool.length) {
|
718 |
+
var instance = Klass.instancePool.pop();
|
719 |
+
Klass.call(instance, a1, a2, a3, a4, a5);
|
720 |
+
return instance;
|
721 |
+
} else {
|
722 |
+
return new Klass(a1, a2, a3, a4, a5);
|
723 |
+
}
|
724 |
+
};
|
725 |
+
|
726 |
var standardReleaser = function (instance) {
|
727 |
var Klass = this;
|
728 |
!(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
|
762 |
oneArgumentPooler: oneArgumentPooler,
|
763 |
twoArgumentPooler: twoArgumentPooler,
|
764 |
threeArgumentPooler: threeArgumentPooler,
|
765 |
+
fourArgumentPooler: fourArgumentPooler,
|
766 |
+
fiveArgumentPooler: fiveArgumentPooler
|
767 |
};
|
768 |
|
769 |
module.exports = PooledClass;
|
839 |
* will remain to ensure logic does not differ in production.
|
840 |
*/
|
841 |
|
842 |
+
function invariant(condition, format, a, b, c, d, e, f) {
|
843 |
+
if (process.env.NODE_ENV !== 'production') {
|
|
|
|
|
844 |
if (format === undefined) {
|
845 |
throw new Error('invariant requires an error message argument');
|
846 |
}
|
847 |
+
}
|
|
|
|
|
|
|
|
|
848 |
|
849 |
if (!condition) {
|
850 |
var error;
|
3097 |
// We warn in this case but don't throw. We expect the element creation to
|
3098 |
// succeed and there will likely be errors in render.
|
3099 |
if (!validType) {
|
3100 |
+
process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : void 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3101 |
}
|
3102 |
|
3103 |
var element = ReactElement.createElement.apply(this, arguments);
|
4068 |
|
4069 |
'use strict';
|
4070 |
|
4071 |
+
module.exports = '15.4.1';
|
4072 |
|
4073 |
/***/ },
|
4074 |
/* 32 */
|
4266 |
|
4267 |
var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
|
4268 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4269 |
/**
|
4270 |
* Drill down (through composites and empty components) until we get a host or
|
4271 |
* host text component.
|
4331 |
}
|
4332 |
// We assume the child nodes are in the same order as the child instances.
|
4333 |
for (; childNode !== null; childNode = childNode.nextSibling) {
|
4334 |
+
if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {
|
4335 |
precacheNode(childInst, childNode);
|
4336 |
continue outer;
|
4337 |
}
|
6661 |
}
|
6662 |
};
|
6663 |
|
6664 |
+
var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
|
6665 |
+
var Klass = this;
|
6666 |
+
if (Klass.instancePool.length) {
|
6667 |
+
var instance = Klass.instancePool.pop();
|
6668 |
+
Klass.call(instance, a1, a2, a3, a4, a5);
|
6669 |
+
return instance;
|
6670 |
+
} else {
|
6671 |
+
return new Klass(a1, a2, a3, a4, a5);
|
6672 |
+
}
|
6673 |
+
};
|
6674 |
+
|
6675 |
var standardReleaser = function (instance) {
|
6676 |
var Klass = this;
|
6677 |
!(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
|
6711 |
oneArgumentPooler: oneArgumentPooler,
|
6712 |
twoArgumentPooler: twoArgumentPooler,
|
6713 |
threeArgumentPooler: threeArgumentPooler,
|
6714 |
+
fourArgumentPooler: fourArgumentPooler,
|
6715 |
+
fiveArgumentPooler: fiveArgumentPooler
|
6716 |
};
|
6717 |
|
6718 |
module.exports = PooledClass;
|
11530 |
} else {
|
11531 |
var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
|
11532 |
var childrenToUse = contentToUse != null ? null : props.children;
|
|
|
11533 |
if (contentToUse != null) {
|
11534 |
+
// TODO: Validate that text is allowed as a child of this node
|
11535 |
+
if (process.env.NODE_ENV !== 'production') {
|
11536 |
+
setAndValidateContentChildDev.call(this, contentToUse);
|
|
|
|
|
|
|
|
|
|
|
|
|
11537 |
}
|
11538 |
+
DOMLazyTree.queueText(lazyTree, contentToUse);
|
11539 |
} else if (childrenToUse != null) {
|
11540 |
var mountImages = this.mountChildren(childrenToUse, transaction, context);
|
11541 |
for (var i = 0; i < mountImages.length; i++) {
|
13455 |
}
|
13456 |
} else {
|
13457 |
if (props.value == null && props.defaultValue != null) {
|
13458 |
+
node.defaultValue = '' + props.defaultValue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13459 |
}
|
13460 |
if (props.checked == null && props.defaultChecked != null) {
|
13461 |
node.defaultChecked = !!props.defaultChecked;
|
14202 |
// This is in postMount because we need access to the DOM node, which is not
|
14203 |
// available until after the component has mounted.
|
14204 |
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
|
|
|
14205 |
|
14206 |
+
// Warning: node.value may be the empty string at this point (IE11) if placeholder is set.
|
14207 |
+
node.value = node.textContent; // Detach value from defaultValue
|
|
|
|
|
|
|
|
|
|
|
14208 |
}
|
14209 |
};
|
14210 |
|
15006 |
instance = ReactEmptyComponent.create(instantiateReactComponent);
|
15007 |
} else if (typeof node === 'object') {
|
15008 |
var element = node;
|
15009 |
+
!(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : _prodInvariant('130', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : void 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15010 |
|
15011 |
// Special case string values
|
15012 |
if (typeof element.type === 'string') {
|
15296 |
// Since plain JS classes are defined without any special initialization
|
15297 |
// logic, we can not catch common errors early. Therefore, we have to
|
15298 |
// catch them here, at initialization time, instead.
|
15299 |
+
process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0;
|
15300 |
process.env.NODE_ENV !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : void 0;
|
15301 |
process.env.NODE_ENV !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : void 0;
|
15302 |
process.env.NODE_ENV !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : void 0;
|
16300 |
|
16301 |
'use strict';
|
16302 |
|
16303 |
+
var _prodInvariant = __webpack_require__(36),
|
16304 |
+
_assign = __webpack_require__(51);
|
16305 |
|
16306 |
var invariant = __webpack_require__(9);
|
16307 |
|
16308 |
var genericComponentClass = null;
|
16309 |
+
// This registry keeps track of wrapper classes around host tags.
|
16310 |
+
var tagToComponentClass = {};
|
16311 |
var textComponentClass = null;
|
16312 |
|
16313 |
var ReactHostComponentInjection = {
|
16320 |
// rendered as props.
|
16321 |
injectTextComponentClass: function (componentClass) {
|
16322 |
textComponentClass = componentClass;
|
16323 |
+
},
|
16324 |
+
// This accepts a keyed object with classes as values. Each key represents a
|
16325 |
+
// tag. That particular tag will use this class instead of the generic one.
|
16326 |
+
injectComponentClasses: function (componentClasses) {
|
16327 |
+
_assign(tagToComponentClass, componentClasses);
|
16328 |
}
|
16329 |
};
|
16330 |
|
21179 |
|
21180 |
'use strict';
|
21181 |
|
21182 |
+
module.exports = '15.4.1';
|
21183 |
|
21184 |
/***/ },
|
21185 |
/* 174 */
|
assets/js/form_editor.js
CHANGED
@@ -2077,12 +2077,12 @@ webpackJsonp([1],{
|
|
2077 |
var bidiOrdering = (function() {
|
2078 |
// Character types for codepoints 0 to 0xff
|
2079 |
var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"
|
2080 |
-
// Character types for codepoints 0x600 to
|
2081 |
-
var arabicTypes = "
|
2082 |
function charType(code) {
|
2083 |
if (code <= 0xf7) { return lowTypes.charAt(code) }
|
2084 |
else if (0x590 <= code && code <= 0x5f4) { return "R" }
|
2085 |
-
else if (0x600 <= code && code <=
|
2086 |
else if (0x6ee <= code && code <= 0x8ac) { return "r" }
|
2087 |
else if (0x2000 <= code && code <= 0x200b) { return "w" }
|
2088 |
else if (code == 0x200c) { return "b" }
|
@@ -4388,7 +4388,7 @@ webpackJsonp([1],{
|
|
4388 |
}
|
4389 |
}
|
4390 |
|
4391 |
-
|
4392 |
this.cm = cm
|
4393 |
var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar")
|
4394 |
var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar")
|
@@ -4404,92 +4404,91 @@ webpackJsonp([1],{
|
|
4404 |
this.checkedZeroWidth = false
|
4405 |
// Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).
|
4406 |
if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = "18px" }
|
4407 |
-
}
|
4408 |
-
|
4409 |
-
NativeScrollbars.prototype
|
4410 |
-
|
4411 |
-
|
4412 |
-
|
4413 |
-
|
4414 |
-
|
4415 |
-
|
4416 |
-
|
4417 |
-
|
4418 |
-
|
4419 |
-
|
4420 |
-
|
4421 |
-
|
4422 |
-
|
4423 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4424 |
}
|
|
|
4425 |
|
4426 |
-
|
4427 |
-
|
4428 |
-
|
4429 |
-
|
4430 |
-
|
4431 |
-
|
4432 |
-
|
4433 |
-
|
4434 |
-
this.horiz.style.display = ""
|
4435 |
-
this.horiz.firstChild.style.width = "0"
|
4436 |
-
}
|
4437 |
-
|
4438 |
-
if (!this.checkedZeroWidth && measure.clientHeight > 0) {
|
4439 |
-
if (sWidth == 0) { this.zeroWidthHack() }
|
4440 |
-
this.checkedZeroWidth = true
|
4441 |
-
}
|
4442 |
-
|
4443 |
-
return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}
|
4444 |
-
};
|
4445 |
-
|
4446 |
-
NativeScrollbars.prototype.setScrollLeft = function (pos) {
|
4447 |
-
if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos }
|
4448 |
-
if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz) }
|
4449 |
-
};
|
4450 |
-
|
4451 |
-
NativeScrollbars.prototype.setScrollTop = function (pos) {
|
4452 |
-
if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos }
|
4453 |
-
if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert) }
|
4454 |
-
};
|
4455 |
-
|
4456 |
-
NativeScrollbars.prototype.zeroWidthHack = function () {
|
4457 |
-
var w = mac && !mac_geMountainLion ? "12px" : "18px"
|
4458 |
-
this.horiz.style.height = this.vert.style.width = w
|
4459 |
-
this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none"
|
4460 |
-
this.disableHoriz = new Delayed
|
4461 |
-
this.disableVert = new Delayed
|
4462 |
-
};
|
4463 |
-
|
4464 |
-
NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay) {
|
4465 |
-
bar.style.pointerEvents = "auto"
|
4466 |
-
function maybeDisable() {
|
4467 |
-
// To find out whether the scrollbar is still visible, we
|
4468 |
-
// check whether the element under the pixel in the bottom
|
4469 |
-
// left corner of the scrollbar box is the scrollbar box
|
4470 |
-
// itself (when the bar is still visible) or its filler child
|
4471 |
-
// (when the bar is hidden). If it is still visible, we keep
|
4472 |
-
// it enabled, if it's hidden, we disable pointer events.
|
4473 |
-
var box = bar.getBoundingClientRect()
|
4474 |
-
var elt = document.elementFromPoint(box.left + 1, box.bottom - 1)
|
4475 |
-
if (elt != bar) { bar.style.pointerEvents = "none" }
|
4476 |
-
else { delay.set(1000, maybeDisable) }
|
4477 |
-
}
|
4478 |
-
delay.set(1000, maybeDisable)
|
4479 |
-
};
|
4480 |
-
|
4481 |
-
NativeScrollbars.prototype.clear = function () {
|
4482 |
-
var parent = this.horiz.parentNode
|
4483 |
-
parent.removeChild(this.horiz)
|
4484 |
-
parent.removeChild(this.vert)
|
4485 |
-
};
|
4486 |
-
|
4487 |
-
var NullScrollbars = function () {};
|
4488 |
-
|
4489 |
-
NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };
|
4490 |
-
NullScrollbars.prototype.setScrollLeft = function () {};
|
4491 |
-
NullScrollbars.prototype.setScrollTop = function () {};
|
4492 |
-
NullScrollbars.prototype.clear = function () {};
|
4493 |
|
4494 |
function updateScrollbars(cm, measure) {
|
4495 |
if (!measure) { measure = measureForScrollbars(cm) }
|
@@ -5068,7 +5067,7 @@ webpackJsonp([1],{
|
|
5068 |
|
5069 |
// DISPLAY DRAWING
|
5070 |
|
5071 |
-
|
5072 |
var display = cm.display
|
5073 |
|
5074 |
this.viewport = viewport
|
@@ -5081,18 +5080,18 @@ webpackJsonp([1],{
|
|
5081 |
this.force = force
|
5082 |
this.dims = getDimensions(cm)
|
5083 |
this.events = []
|
5084 |
-
}
|
5085 |
|
5086 |
-
DisplayUpdate.prototype.signal = function
|
5087 |
if (hasHandler(emitter, type))
|
5088 |
{ this.events.push(arguments) }
|
5089 |
-
}
|
5090 |
-
DisplayUpdate.prototype.finish = function
|
5091 |
-
|
5092 |
|
5093 |
for (var i = 0; i < this.events.length; i++)
|
5094 |
{ signal.apply(null, this$1.events[i]) }
|
5095 |
-
}
|
5096 |
|
5097 |
function maybeClipScrollbars(cm) {
|
5098 |
var display = cm.display
|
@@ -8220,7 +8219,7 @@ webpackJsonp([1],{
|
|
8220 |
for (var i = newBreaks.length - 1; i >= 0; i--)
|
8221 |
{ replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)) }
|
8222 |
})
|
8223 |
-
option("specialChars", /[\u0000-\u001f\u007f\u00ad\
|
8224 |
cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g")
|
8225 |
if (old != Init) { cm.refresh() }
|
8226 |
})
|
@@ -8310,7 +8309,7 @@ webpackJsonp([1],{
|
|
8310 |
function guttersChanged(cm) {
|
8311 |
updateGutters(cm)
|
8312 |
regChange(cm)
|
8313 |
-
alignHorizontally(cm)
|
8314 |
}
|
8315 |
|
8316 |
function dragDropChanged(cm, value, old) {
|
@@ -8365,6 +8364,7 @@ webpackJsonp([1],{
|
|
8365 |
themeChanged(this)
|
8366 |
if (options.lineWrapping)
|
8367 |
{ this.display.wrapper.className += " CodeMirror-wrap" }
|
|
|
8368 |
initScrollbars(this)
|
8369 |
|
8370 |
this.state = {
|
@@ -8383,8 +8383,6 @@ webpackJsonp([1],{
|
|
8383 |
specialChars: null
|
8384 |
}
|
8385 |
|
8386 |
-
if (options.autofocus && !mobile) { display.input.focus() }
|
8387 |
-
|
8388 |
// Override magic textarea content restore that IE sometimes does
|
8389 |
// on our hidden textarea on reload
|
8390 |
if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20) }
|
@@ -8740,7 +8738,6 @@ webpackJsonp([1],{
|
|
8740 |
options[option] = value
|
8741 |
if (optionHandlers.hasOwnProperty(option))
|
8742 |
{ operation(this, optionHandlers[option])(this, value, old) }
|
8743 |
-
signal(this, "optionChange", this, option)
|
8744 |
},
|
8745 |
|
8746 |
getOption: function(option) {return this.options[option]},
|
@@ -9248,333 +9245,331 @@ webpackJsonp([1],{
|
|
9248 |
|
9249 |
// CONTENTEDITABLE INPUT STYLE
|
9250 |
|
9251 |
-
|
9252 |
this.cm = cm
|
9253 |
this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null
|
9254 |
this.polling = new Delayed()
|
9255 |
this.composing = null
|
9256 |
this.gracePeriod = false
|
9257 |
this.readDOMTimeout = null
|
9258 |
-
}
|
9259 |
|
9260 |
-
ContentEditableInput.prototype
|
|
|
9261 |
var this$1 = this;
|
9262 |
|
9263 |
-
|
9264 |
-
|
9265 |
-
|
9266 |
|
9267 |
-
|
9268 |
-
|
9269 |
-
|
9270 |
-
|
9271 |
-
|
9272 |
-
|
9273 |
-
|
9274 |
|
9275 |
-
|
9276 |
-
|
9277 |
-
|
9278 |
-
|
9279 |
-
|
9280 |
-
|
9281 |
-
|
9282 |
-
|
9283 |
-
|
9284 |
-
|
9285 |
-
|
9286 |
-
|
9287 |
|
9288 |
-
|
9289 |
|
9290 |
-
|
9291 |
-
|
9292 |
-
|
9293 |
|
9294 |
-
|
9295 |
-
|
9296 |
-
|
9297 |
-
|
9298 |
-
|
9299 |
-
|
9300 |
-
return
|
9301 |
-
} else {
|
9302 |
-
var ranges = copyableRanges(cm)
|
9303 |
-
setLastCopied({lineWise: true, text: ranges.text})
|
9304 |
-
if (e.type == "cut") {
|
9305 |
-
cm.operation(function () {
|
9306 |
-
cm.setSelections(ranges.ranges, 0, sel_dontScroll)
|
9307 |
-
cm.replaceSelection("", null, "cut")
|
9308 |
-
})
|
9309 |
-
}
|
9310 |
-
}
|
9311 |
-
if (e.clipboardData) {
|
9312 |
-
e.clipboardData.clearData()
|
9313 |
-
var content = lastCopied.text.join("\n")
|
9314 |
-
// iOS exposes the clipboard API, but seems to discard content inserted into it
|
9315 |
-
e.clipboardData.setData("Text", content)
|
9316 |
-
if (e.clipboardData.getData("Text") == content) {
|
9317 |
-
e.preventDefault()
|
9318 |
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9319 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9320 |
}
|
9321 |
-
|
9322 |
-
|
9323 |
-
|
9324 |
-
|
9325 |
-
|
9326 |
-
|
9327 |
-
|
9328 |
-
|
9329 |
-
|
9330 |
-
|
9331 |
-
|
9332 |
-
|
9333 |
-
|
9334 |
-
|
9335 |
-
|
9336 |
-
|
9337 |
-
ContentEditableInput.prototype.prepareSelection = function () {
|
9338 |
-
var result = prepareSelection(this.cm, false)
|
9339 |
-
result.focus = this.cm.state.focused
|
9340 |
-
return result
|
9341 |
-
};
|
9342 |
-
|
9343 |
-
ContentEditableInput.prototype.showSelection = function (info, takeFocus) {
|
9344 |
-
if (!info || !this.cm.display.view.length) { return }
|
9345 |
-
if (info.focus || takeFocus) { this.showPrimarySelection() }
|
9346 |
-
this.showMultipleSelections(info)
|
9347 |
-
};
|
9348 |
-
|
9349 |
-
ContentEditableInput.prototype.showPrimarySelection = function () {
|
9350 |
-
var sel = window.getSelection(), prim = this.cm.doc.sel.primary()
|
9351 |
-
var curAnchor = domToPos(this.cm, sel.anchorNode, sel.anchorOffset)
|
9352 |
-
var curFocus = domToPos(this.cm, sel.focusNode, sel.focusOffset)
|
9353 |
-
if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&
|
9354 |
-
cmp(minPos(curAnchor, curFocus), prim.from()) == 0 &&
|
9355 |
-
cmp(maxPos(curAnchor, curFocus), prim.to()) == 0)
|
9356 |
-
{ return }
|
9357 |
|
9358 |
-
|
9359 |
-
|
9360 |
-
|
9361 |
-
|
9362 |
-
|
9363 |
-
|
9364 |
-
|
9365 |
-
|
9366 |
-
|
9367 |
-
var
|
9368 |
-
var
|
9369 |
-
|
9370 |
-
|
9371 |
-
|
9372 |
-
|
9373 |
-
|
9374 |
-
|
9375 |
-
|
9376 |
-
|
9377 |
-
|
9378 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9379 |
sel.removeAllRanges()
|
9380 |
sel.addRange(rng)
|
9381 |
}
|
9382 |
-
|
9383 |
-
|
9384 |
-
sel.addRange(rng)
|
9385 |
}
|
9386 |
-
|
9387 |
-
|
9388 |
-
}
|
9389 |
-
this.rememberSelection()
|
9390 |
-
};
|
9391 |
|
9392 |
-
|
9393 |
var this$1 = this;
|
9394 |
|
9395 |
-
|
9396 |
-
|
9397 |
-
|
9398 |
-
|
9399 |
-
|
9400 |
-
|
9401 |
-
|
9402 |
-
|
9403 |
-
ContentEditableInput.prototype.showMultipleSelections = function (info) {
|
9404 |
-
removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors)
|
9405 |
-
removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection)
|
9406 |
-
};
|
9407 |
-
|
9408 |
-
ContentEditableInput.prototype.rememberSelection = function () {
|
9409 |
-
var sel = window.getSelection()
|
9410 |
-
this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset
|
9411 |
-
this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset
|
9412 |
-
};
|
9413 |
-
|
9414 |
-
ContentEditableInput.prototype.selectionInEditor = function () {
|
9415 |
-
var sel = window.getSelection()
|
9416 |
-
if (!sel.rangeCount) { return false }
|
9417 |
-
var node = sel.getRangeAt(0).commonAncestorContainer
|
9418 |
-
return contains(this.div, node)
|
9419 |
-
};
|
9420 |
-
|
9421 |
-
ContentEditableInput.prototype.focus = function () {
|
9422 |
-
if (this.cm.options.readOnly != "nocursor") {
|
9423 |
-
if (!this.selectionInEditor())
|
9424 |
-
{ this.showSelection(this.prepareSelection(), true) }
|
9425 |
-
this.div.focus()
|
9426 |
-
}
|
9427 |
-
};
|
9428 |
-
ContentEditableInput.prototype.blur = function () { this.div.blur() };
|
9429 |
-
ContentEditableInput.prototype.getField = function () { return this.div };
|
9430 |
|
9431 |
-
|
|
|
|
|
|
|
9432 |
|
9433 |
-
|
9434 |
-
|
9435 |
-
|
9436 |
-
|
9437 |
-
|
9438 |
-
{ runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }) }
|
9439 |
|
9440 |
-
function
|
9441 |
-
|
9442 |
-
|
9443 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9444 |
}
|
9445 |
-
}
|
9446 |
-
this.
|
9447 |
-
|
9448 |
|
9449 |
-
|
9450 |
-
var sel = window.getSelection()
|
9451 |
-
return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||
|
9452 |
-
sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset
|
9453 |
-
};
|
9454 |
|
9455 |
-
|
9456 |
-
|
9457 |
-
|
9458 |
-
|
9459 |
-
|
9460 |
-
|
9461 |
-
if (anchor && head) { runInOp(cm, function () {
|
9462 |
-
setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll)
|
9463 |
-
if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true }
|
9464 |
-
}) }
|
9465 |
-
}
|
9466 |
-
};
|
9467 |
-
|
9468 |
-
ContentEditableInput.prototype.pollContent = function () {
|
9469 |
-
if (this.readDOMTimeout != null) {
|
9470 |
-
clearTimeout(this.readDOMTimeout)
|
9471 |
-
this.readDOMTimeout = null
|
9472 |
-
}
|
9473 |
-
|
9474 |
-
var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary()
|
9475 |
-
var from = sel.from(), to = sel.to()
|
9476 |
-
if (from.ch == 0 && from.line > cm.firstLine())
|
9477 |
-
{ from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length) }
|
9478 |
-
if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())
|
9479 |
-
{ to = Pos(to.line + 1, 0) }
|
9480 |
-
if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }
|
9481 |
-
|
9482 |
-
var fromIndex, fromLine, fromNode
|
9483 |
-
if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {
|
9484 |
-
fromLine = lineNo(display.view[0].line)
|
9485 |
-
fromNode = display.view[0].node
|
9486 |
-
} else {
|
9487 |
-
fromLine = lineNo(display.view[fromIndex].line)
|
9488 |
-
fromNode = display.view[fromIndex - 1].node.nextSibling
|
9489 |
-
}
|
9490 |
-
var toIndex = findViewIndex(cm, to.line)
|
9491 |
-
var toLine, toNode
|
9492 |
-
if (toIndex == display.view.length - 1) {
|
9493 |
-
toLine = display.viewTo - 1
|
9494 |
-
toNode = display.lineDiv.lastChild
|
9495 |
-
} else {
|
9496 |
-
toLine = lineNo(display.view[toIndex + 1].line) - 1
|
9497 |
-
toNode = display.view[toIndex + 1].node.previousSibling
|
9498 |
-
}
|
9499 |
|
9500 |
-
|
9501 |
-
|
9502 |
-
|
9503 |
-
|
9504 |
-
|
9505 |
-
|
9506 |
-
|
9507 |
-
}
|
9508 |
|
9509 |
-
|
9510 |
-
|
9511 |
-
|
9512 |
-
|
9513 |
-
|
9514 |
-
var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),
|
9515 |
-
oldBot.length - (oldText.length == 1 ? cutFront : 0))
|
9516 |
-
while (cutEnd < maxCutEnd &&
|
9517 |
-
newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))
|
9518 |
-
{ ++cutEnd }
|
9519 |
-
|
9520 |
-
newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, "")
|
9521 |
-
newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, "")
|
9522 |
-
|
9523 |
-
var chFrom = Pos(fromLine, cutFront)
|
9524 |
-
var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0)
|
9525 |
-
if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {
|
9526 |
-
replaceRange(cm.doc, newText, chFrom, chTo, "+input")
|
9527 |
-
return true
|
9528 |
-
}
|
9529 |
-
};
|
9530 |
-
|
9531 |
-
ContentEditableInput.prototype.ensurePolled = function () {
|
9532 |
-
this.forceCompositionEnd()
|
9533 |
-
};
|
9534 |
-
ContentEditableInput.prototype.reset = function () {
|
9535 |
-
this.forceCompositionEnd()
|
9536 |
-
};
|
9537 |
-
ContentEditableInput.prototype.forceCompositionEnd = function () {
|
9538 |
-
if (!this.composing) { return }
|
9539 |
-
clearTimeout(this.readDOMTimeout)
|
9540 |
-
this.composing = null
|
9541 |
-
if (!this.pollContent()) { regChange(this.cm) }
|
9542 |
-
this.div.blur()
|
9543 |
-
this.div.focus()
|
9544 |
-
};
|
9545 |
-
ContentEditableInput.prototype.readFromDOMSoon = function () {
|
9546 |
-
var this$1 = this;
|
9547 |
|
9548 |
-
|
9549 |
-
|
9550 |
-
|
9551 |
-
|
9552 |
-
|
9553 |
-
|
|
|
|
|
|
|
|
|
9554 |
}
|
9555 |
-
|
9556 |
-
{ runInOp(this$1.cm, function () { return regChange(this$1.cm); }) }
|
9557 |
-
}, 80)
|
9558 |
-
};
|
9559 |
|
9560 |
-
|
9561 |
-
|
9562 |
-
|
|
|
|
|
9563 |
|
9564 |
-
|
9565 |
-
|
9566 |
-
|
9567 |
-
|
9568 |
-
|
|
|
|
|
9569 |
|
9570 |
-
|
9571 |
-
|
9572 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9573 |
|
9574 |
-
|
9575 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9576 |
|
9577 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9578 |
|
9579 |
function posToDOM(cm, pos) {
|
9580 |
var view = findViewForLine(cm, pos.line)
|
@@ -9711,7 +9706,7 @@ webpackJsonp([1],{
|
|
9711 |
|
9712 |
// TEXTAREA INPUT STYLE
|
9713 |
|
9714 |
-
|
9715 |
this.cm = cm
|
9716 |
// See input.poll and input.reset
|
9717 |
this.prevInput = ""
|
@@ -9728,333 +9723,335 @@ webpackJsonp([1],{
|
|
9728 |
// Used to work around IE issue with selection being forgotten when focus moves away from textarea
|
9729 |
this.hasSelection = false
|
9730 |
this.composing = null
|
9731 |
-
}
|
9732 |
|
9733 |
-
TextareaInput.prototype
|
|
|
9734 |
var this$1 = this;
|
9735 |
|
9736 |
-
|
9737 |
|
9738 |
-
|
9739 |
-
|
9740 |
-
|
9741 |
-
|
9742 |
-
|
9743 |
-
|
9744 |
|
9745 |
-
|
9746 |
-
|
9747 |
|
9748 |
-
|
9749 |
-
|
9750 |
-
|
9751 |
-
|
9752 |
|
9753 |
-
|
9754 |
-
|
9755 |
|
9756 |
-
|
9757 |
-
|
9758 |
-
|
9759 |
|
9760 |
-
|
9761 |
-
|
9762 |
-
|
9763 |
-
|
9764 |
-
|
9765 |
-
|
9766 |
-
|
9767 |
-
|
9768 |
-
|
9769 |
-
|
9770 |
-
|
9771 |
-
|
9772 |
-
} else {
|
9773 |
-
var ranges = copyableRanges(cm)
|
9774 |
-
setLastCopied({lineWise: true, text: ranges.text})
|
9775 |
-
if (e.type == "cut") {
|
9776 |
-
cm.setSelections(ranges.ranges, null, sel_dontScroll)
|
9777 |
} else {
|
9778 |
-
|
9779 |
-
|
9780 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
9781 |
}
|
|
|
9782 |
}
|
9783 |
-
|
9784 |
-
|
9785 |
-
on(te, "cut", prepareCopyCut)
|
9786 |
-
on(te, "copy", prepareCopyCut)
|
9787 |
|
9788 |
-
|
9789 |
-
|
9790 |
-
|
9791 |
-
|
9792 |
-
|
9793 |
|
9794 |
-
|
9795 |
-
|
9796 |
-
|
9797 |
-
|
9798 |
|
9799 |
-
|
9800 |
-
|
9801 |
-
|
9802 |
-
|
9803 |
-
|
9804 |
-
|
9805 |
-
|
9806 |
-
|
9807 |
-
|
9808 |
-
|
9809 |
-
|
9810 |
-
|
9811 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9812 |
}
|
9813 |
-
})
|
9814 |
-
};
|
9815 |
|
9816 |
-
|
9817 |
-
|
9818 |
-
var cm = this.cm, display = cm.display, doc = cm.doc
|
9819 |
-
var result = prepareSelection(cm)
|
9820 |
|
9821 |
-
|
9822 |
-
|
9823 |
-
|
9824 |
-
|
9825 |
-
|
9826 |
-
|
9827 |
-
|
9828 |
-
|
9829 |
-
}
|
9830 |
|
9831 |
-
|
9832 |
-
|
9833 |
-
|
9834 |
-
|
9835 |
-
|
9836 |
-
|
9837 |
-
|
9838 |
-
|
9839 |
-
|
9840 |
-
|
9841 |
-
|
9842 |
-
|
9843 |
-
|
9844 |
-
|
9845 |
-
|
9846 |
-
|
9847 |
-
|
9848 |
-
|
9849 |
-
|
9850 |
-
|
9851 |
-
var range = doc.sel.primary()
|
9852 |
-
minimal = hasCopyEvent &&
|
9853 |
-
(range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000)
|
9854 |
-
var content = minimal ? "-" : selected || cm.getSelection()
|
9855 |
-
this.textarea.value = content
|
9856 |
-
if (cm.state.focused) { selectInput(this.textarea) }
|
9857 |
-
if (ie && ie_version >= 9) { this.hasSelection = content }
|
9858 |
-
} else if (!typing) {
|
9859 |
-
this.prevInput = this.textarea.value = ""
|
9860 |
-
if (ie && ie_version >= 9) { this.hasSelection = null }
|
9861 |
-
}
|
9862 |
-
this.inaccurateSelection = minimal
|
9863 |
-
};
|
9864 |
|
9865 |
-
|
9866 |
|
9867 |
-
|
9868 |
|
9869 |
-
|
9870 |
-
|
9871 |
-
|
9872 |
-
|
9873 |
-
|
9874 |
-
|
9875 |
|
9876 |
-
|
9877 |
|
9878 |
-
|
9879 |
-
|
9880 |
-
|
9881 |
|
9882 |
-
|
9883 |
|
9884 |
-
|
9885 |
-
|
9886 |
-
|
9887 |
var this$1 = this;
|
9888 |
|
9889 |
-
|
9890 |
-
|
9891 |
-
|
9892 |
-
|
9893 |
-
|
9894 |
-
|
9895 |
-
|
9896 |
-
|
9897 |
-
|
9898 |
-
|
9899 |
-
|
9900 |
-
|
9901 |
-
|
9902 |
-
|
9903 |
-
|
9904 |
-
|
9905 |
-
|
9906 |
-
|
9907 |
-
|
9908 |
-
|
9909 |
-
|
9910 |
-
|
9911 |
-
|
9912 |
-
|
9913 |
-
|
9914 |
-
|
9915 |
-
|
9916 |
-
|
9917 |
var this$1 = this;
|
9918 |
|
9919 |
-
|
9920 |
-
|
9921 |
-
|
9922 |
-
|
9923 |
-
|
9924 |
-
|
9925 |
-
|
9926 |
-
|
9927 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9928 |
|
9929 |
-
|
9930 |
-
|
9931 |
-
|
9932 |
-
|
9933 |
-
|
9934 |
-
|
9935 |
-
|
9936 |
-
|
9937 |
-
cm.display.input.reset()
|
9938 |
-
return false
|
9939 |
-
}
|
9940 |
|
9941 |
-
|
9942 |
-
|
9943 |
-
|
9944 |
-
if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo") }
|
9945 |
-
}
|
9946 |
-
// Find the part of the input that is actually new
|
9947 |
-
var same = 0, l = Math.min(prevInput.length, text.length)
|
9948 |
-
while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same }
|
9949 |
|
9950 |
-
|
9951 |
-
|
9952 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9953 |
|
9954 |
-
|
9955 |
-
if (
|
9956 |
-
|
|
|
9957 |
|
9958 |
-
|
9959 |
-
|
9960 |
-
|
9961 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9962 |
}
|
9963 |
-
|
9964 |
-
|
9965 |
-
|
9966 |
-
|
9967 |
-
|
9968 |
-
|
9969 |
-
|
9970 |
-
|
9971 |
-
|
9972 |
-
|
9973 |
-
|
9974 |
-
|
9975 |
-
|
9976 |
-
|
9977 |
-
|
9978 |
-
|
9979 |
-
|
9980 |
-
|
9981 |
-
// Reset the current text selection only if the click is done outside of the selection
|
9982 |
-
// and 'resetSelectionOnContextMenu' option is true.
|
9983 |
-
var reset = cm.options.resetSelectionOnContextMenu
|
9984 |
-
if (reset && cm.doc.sel.contains(pos) == -1)
|
9985 |
-
{ operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll) }
|
9986 |
-
|
9987 |
-
var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText
|
9988 |
-
input.wrapper.style.cssText = "position: absolute"
|
9989 |
-
var wrapperBox = input.wrapper.getBoundingClientRect()
|
9990 |
-
te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"
|
9991 |
-
var oldScrollY
|
9992 |
-
if (webkit) { oldScrollY = window.scrollY } // Work around Chrome issue (#2712)
|
9993 |
-
display.input.focus()
|
9994 |
-
if (webkit) { window.scrollTo(null, oldScrollY) }
|
9995 |
-
display.input.reset()
|
9996 |
-
// Adds "Select all" to context menu in FF
|
9997 |
-
if (!cm.somethingSelected()) { te.value = input.prevInput = " " }
|
9998 |
-
input.contextMenuPending = true
|
9999 |
-
display.selForContextMenu = cm.doc.sel
|
10000 |
-
clearTimeout(display.detectingSelectAll)
|
10001 |
-
|
10002 |
-
// Select-all will be greyed out if there's nothing to select, so
|
10003 |
-
// this adds a zero-width space so that we can later check whether
|
10004 |
-
// it got selected.
|
10005 |
-
function prepareSelectAllHack() {
|
10006 |
-
if (te.selectionStart != null) {
|
10007 |
-
var selected = cm.somethingSelected()
|
10008 |
-
var extval = "\u200b" + (selected ? te.value : "")
|
10009 |
-
te.value = "\u21da" // Used to catch context-menu undo
|
10010 |
-
te.value = extval
|
10011 |
-
input.prevInput = selected ? "" : "\u200b"
|
10012 |
-
te.selectionStart = 1; te.selectionEnd = extval.length
|
10013 |
-
// Re-set this, in case some other handler touched the
|
10014 |
-
// selection in the meantime.
|
10015 |
-
display.selForContextMenu = cm.doc.sel
|
10016 |
-
}
|
10017 |
-
}
|
10018 |
-
function rehide() {
|
10019 |
-
input.contextMenuPending = false
|
10020 |
-
input.wrapper.style.cssText = oldWrapperCSS
|
10021 |
-
te.style.cssText = oldCSS
|
10022 |
-
if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos) }
|
10023 |
-
|
10024 |
-
// Try to detect the user choosing select-all
|
10025 |
-
if (te.selectionStart != null) {
|
10026 |
-
if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack() }
|
10027 |
-
var i = 0, poll = function () {
|
10028 |
-
if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&
|
10029 |
-
te.selectionEnd > 0 && input.prevInput == "\u200b")
|
10030 |
-
{ operation(cm, selectAll)(cm) }
|
10031 |
-
else if (i++ < 10) { display.detectingSelectAll = setTimeout(poll, 500) }
|
10032 |
-
else { display.input.reset() }
|
10033 |
}
|
10034 |
-
display.detectingSelectAll = setTimeout(poll, 200)
|
10035 |
}
|
10036 |
-
}
|
10037 |
|
10038 |
-
|
10039 |
-
|
10040 |
-
|
10041 |
-
|
10042 |
-
|
10043 |
-
|
|
|
|
|
|
|
|
|
10044 |
}
|
10045 |
-
|
10046 |
-
} else {
|
10047 |
-
setTimeout(rehide, 50)
|
10048 |
-
}
|
10049 |
-
};
|
10050 |
|
10051 |
-
|
10052 |
-
|
10053 |
-
|
10054 |
|
10055 |
-
|
10056 |
|
10057 |
-
|
|
|
10058 |
|
10059 |
function fromTextArea(textarea, options) {
|
10060 |
options = options ? copyObj(options) : {}
|
@@ -10205,7 +10202,7 @@ webpackJsonp([1],{
|
|
10205 |
|
10206 |
addLegacyProps(CodeMirror)
|
10207 |
|
10208 |
-
CodeMirror.version = "5.
|
10209 |
|
10210 |
return CodeMirror;
|
10211 |
|
@@ -10742,7 +10739,7 @@ webpackJsonp([1],{
|
|
10742 |
"transition-property", "transition-timing-function", "unicode-bidi",
|
10743 |
"user-select", "vertical-align", "visibility", "voice-balance", "voice-duration",
|
10744 |
"voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress",
|
10745 |
-
"voice-volume", "volume", "white-space", "widows", "width", "
|
10746 |
"word-spacing", "word-wrap", "z-index",
|
10747 |
// SVG-specific
|
10748 |
"clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color",
|
@@ -10816,7 +10813,7 @@ webpackJsonp([1],{
|
|
10816 |
"cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch",
|
10817 |
"cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
|
10818 |
"col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse",
|
10819 |
-
"compact", "condensed", "contain", "content",
|
10820 |
"content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop",
|
10821 |
"cross", "crosshair", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
|
10822 |
"decimal-leading-zero", "default", "default-button", "dense", "destination-atop",
|
@@ -10859,7 +10856,7 @@ webpackJsonp([1],{
|
|
10859 |
"mix", "mongolian", "monospace", "move", "multiple", "multiply", "myanmar", "n-resize",
|
10860 |
"narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
|
10861 |
"no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
|
10862 |
-
"ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "
|
10863 |
"optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",
|
10864 |
"outside", "outside-shape", "overlay", "overline", "padding", "padding-box",
|
10865 |
"painted", "page", "paused", "persian", "perspective", "plus-darker", "plus-lighter",
|
@@ -10871,7 +10868,7 @@ webpackJsonp([1],{
|
|
10871 |
"rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY",
|
10872 |
"rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running",
|
10873 |
"s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
|
10874 |
-
"scroll", "scrollbar", "
|
10875 |
"searchfield-cancel-button", "searchfield-decoration",
|
10876 |
"searchfield-results-button", "searchfield-results-decoration",
|
10877 |
"semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
|
@@ -10889,9 +10886,9 @@ webpackJsonp([1],{
|
|
10889 |
"thick", "thin", "threeddarkshadow", "threedface", "threedhighlight",
|
10890 |
"threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er",
|
10891 |
"tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top",
|
10892 |
-
"trad-chinese-formal", "trad-chinese-informal",
|
10893 |
"translate", "translate3d", "translateX", "translateY", "translateZ",
|
10894 |
-
"transparent", "ultra-condensed", "ultra-expanded", "underline", "
|
10895 |
"upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal",
|
10896 |
"upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",
|
10897 |
"var", "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
|
2077 |
var bidiOrdering = (function() {
|
2078 |
// Character types for codepoints 0 to 0xff
|
2079 |
var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"
|
2080 |
+
// Character types for codepoints 0x600 to 0x6ff
|
2081 |
+
var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm"
|
2082 |
function charType(code) {
|
2083 |
if (code <= 0xf7) { return lowTypes.charAt(code) }
|
2084 |
else if (0x590 <= code && code <= 0x5f4) { return "R" }
|
2085 |
+
else if (0x600 <= code && code <= 0x6ed) { return arabicTypes.charAt(code - 0x600) }
|
2086 |
else if (0x6ee <= code && code <= 0x8ac) { return "r" }
|
2087 |
else if (0x2000 <= code && code <= 0x200b) { return "w" }
|
2088 |
else if (code == 0x200c) { return "b" }
|
4388 |
}
|
4389 |
}
|
4390 |
|
4391 |
+
function NativeScrollbars(place, scroll, cm) {
|
4392 |
this.cm = cm
|
4393 |
var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar")
|
4394 |
var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar")
|
4404 |
this.checkedZeroWidth = false
|
4405 |
// Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).
|
4406 |
if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = "18px" }
|
4407 |
+
}
|
4408 |
+
|
4409 |
+
NativeScrollbars.prototype = copyObj({
|
4410 |
+
update: function(measure) {
|
4411 |
+
var needsH = measure.scrollWidth > measure.clientWidth + 1
|
4412 |
+
var needsV = measure.scrollHeight > measure.clientHeight + 1
|
4413 |
+
var sWidth = measure.nativeBarWidth
|
4414 |
+
|
4415 |
+
if (needsV) {
|
4416 |
+
this.vert.style.display = "block"
|
4417 |
+
this.vert.style.bottom = needsH ? sWidth + "px" : "0"
|
4418 |
+
var totalHeight = measure.viewHeight - (needsH ? sWidth : 0)
|
4419 |
+
// A bug in IE8 can cause this value to be negative, so guard it.
|
4420 |
+
this.vert.firstChild.style.height =
|
4421 |
+
Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"
|
4422 |
+
} else {
|
4423 |
+
this.vert.style.display = ""
|
4424 |
+
this.vert.firstChild.style.height = "0"
|
4425 |
+
}
|
4426 |
+
|
4427 |
+
if (needsH) {
|
4428 |
+
this.horiz.style.display = "block"
|
4429 |
+
this.horiz.style.right = needsV ? sWidth + "px" : "0"
|
4430 |
+
this.horiz.style.left = measure.barLeft + "px"
|
4431 |
+
var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0)
|
4432 |
+
this.horiz.firstChild.style.width =
|
4433 |
+
(measure.scrollWidth - measure.clientWidth + totalWidth) + "px"
|
4434 |
+
} else {
|
4435 |
+
this.horiz.style.display = ""
|
4436 |
+
this.horiz.firstChild.style.width = "0"
|
4437 |
+
}
|
4438 |
+
|
4439 |
+
if (!this.checkedZeroWidth && measure.clientHeight > 0) {
|
4440 |
+
if (sWidth == 0) { this.zeroWidthHack() }
|
4441 |
+
this.checkedZeroWidth = true
|
4442 |
+
}
|
4443 |
+
|
4444 |
+
return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}
|
4445 |
+
},
|
4446 |
+
setScrollLeft: function(pos) {
|
4447 |
+
if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos }
|
4448 |
+
if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz) }
|
4449 |
+
},
|
4450 |
+
setScrollTop: function(pos) {
|
4451 |
+
if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos }
|
4452 |
+
if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert) }
|
4453 |
+
},
|
4454 |
+
zeroWidthHack: function() {
|
4455 |
+
var w = mac && !mac_geMountainLion ? "12px" : "18px"
|
4456 |
+
this.horiz.style.height = this.vert.style.width = w
|
4457 |
+
this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none"
|
4458 |
+
this.disableHoriz = new Delayed
|
4459 |
+
this.disableVert = new Delayed
|
4460 |
+
},
|
4461 |
+
enableZeroWidthBar: function(bar, delay) {
|
4462 |
+
bar.style.pointerEvents = "auto"
|
4463 |
+
function maybeDisable() {
|
4464 |
+
// To find out whether the scrollbar is still visible, we
|
4465 |
+
// check whether the element under the pixel in the bottom
|
4466 |
+
// left corner of the scrollbar box is the scrollbar box
|
4467 |
+
// itself (when the bar is still visible) or its filler child
|
4468 |
+
// (when the bar is hidden). If it is still visible, we keep
|
4469 |
+
// it enabled, if it's hidden, we disable pointer events.
|
4470 |
+
var box = bar.getBoundingClientRect()
|
4471 |
+
var elt = document.elementFromPoint(box.left + 1, box.bottom - 1)
|
4472 |
+
if (elt != bar) { bar.style.pointerEvents = "none" }
|
4473 |
+
else { delay.set(1000, maybeDisable) }
|
4474 |
+
}
|
4475 |
+
delay.set(1000, maybeDisable)
|
4476 |
+
},
|
4477 |
+
clear: function() {
|
4478 |
+
var parent = this.horiz.parentNode
|
4479 |
+
parent.removeChild(this.horiz)
|
4480 |
+
parent.removeChild(this.vert)
|
4481 |
}
|
4482 |
+
}, NativeScrollbars.prototype)
|
4483 |
|
4484 |
+
function NullScrollbars() {}
|
4485 |
+
|
4486 |
+
NullScrollbars.prototype = copyObj({
|
4487 |
+
update: function() { return {bottom: 0, right: 0} },
|
4488 |
+
setScrollLeft: function() {},
|
4489 |
+
setScrollTop: function() {},
|
4490 |
+
clear: function() {}
|
4491 |
+
}, NullScrollbars.prototype)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4492 |
|
4493 |
function updateScrollbars(cm, measure) {
|
4494 |
if (!measure) { measure = measureForScrollbars(cm) }
|
5067 |
|
5068 |
// DISPLAY DRAWING
|
5069 |
|
5070 |
+
function DisplayUpdate(cm, viewport, force) {
|
5071 |
var display = cm.display
|
5072 |
|
5073 |
this.viewport = viewport
|
5080 |
this.force = force
|
5081 |
this.dims = getDimensions(cm)
|
5082 |
this.events = []
|
5083 |
+
}
|
5084 |
|
5085 |
+
DisplayUpdate.prototype.signal = function(emitter, type) {
|
5086 |
if (hasHandler(emitter, type))
|
5087 |
{ this.events.push(arguments) }
|
5088 |
+
}
|
5089 |
+
DisplayUpdate.prototype.finish = function() {
|
5090 |
+
var this$1 = this;
|
5091 |
|
5092 |
for (var i = 0; i < this.events.length; i++)
|
5093 |
{ signal.apply(null, this$1.events[i]) }
|
5094 |
+
}
|
5095 |
|
5096 |
function maybeClipScrollbars(cm) {
|
5097 |
var display = cm.display
|
8219 |
for (var i = newBreaks.length - 1; i >= 0; i--)
|
8220 |
{ replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)) }
|
8221 |
})
|
8222 |
+
option("specialChars", /[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function (cm, val, old) {
|
8223 |
cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g")
|
8224 |
if (old != Init) { cm.refresh() }
|
8225 |
})
|
8309 |
function guttersChanged(cm) {
|
8310 |
updateGutters(cm)
|
8311 |
regChange(cm)
|
8312 |
+
setTimeout(function () { return alignHorizontally(cm); }, 20)
|
8313 |
}
|
8314 |
|
8315 |
function dragDropChanged(cm, value, old) {
|
8364 |
themeChanged(this)
|
8365 |
if (options.lineWrapping)
|
8366 |
{ this.display.wrapper.className += " CodeMirror-wrap" }
|
8367 |
+
if (options.autofocus && !mobile) { display.input.focus() }
|
8368 |
initScrollbars(this)
|
8369 |
|
8370 |
this.state = {
|
8383 |
specialChars: null
|
8384 |
}
|
8385 |
|
|
|
|
|
8386 |
// Override magic textarea content restore that IE sometimes does
|
8387 |
// on our hidden textarea on reload
|
8388 |
if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20) }
|
8738 |
options[option] = value
|
8739 |
if (optionHandlers.hasOwnProperty(option))
|
8740 |
{ operation(this, optionHandlers[option])(this, value, old) }
|
|
|
8741 |
},
|
8742 |
|
8743 |
getOption: function(option) {return this.options[option]},
|
9245 |
|
9246 |
// CONTENTEDITABLE INPUT STYLE
|
9247 |
|
9248 |
+
function ContentEditableInput(cm) {
|
9249 |
this.cm = cm
|
9250 |
this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null
|
9251 |
this.polling = new Delayed()
|
9252 |
this.composing = null
|
9253 |
this.gracePeriod = false
|
9254 |
this.readDOMTimeout = null
|
9255 |
+
}
|
9256 |
|
9257 |
+
ContentEditableInput.prototype = copyObj({
|
9258 |
+
init: function(display) {
|
9259 |
var this$1 = this;
|
9260 |
|
9261 |
+
var input = this, cm = input.cm
|
9262 |
+
var div = input.div = display.lineDiv
|
9263 |
+
disableBrowserMagic(div, cm.options.spellcheck)
|
9264 |
|
9265 |
+
on(div, "paste", function (e) {
|
9266 |
+
if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }
|
9267 |
+
// IE doesn't fire input events, so we schedule a read for the pasted content in this way
|
9268 |
+
if (ie_version <= 11) { setTimeout(operation(cm, function () {
|
9269 |
+
if (!input.pollContent()) { regChange(cm) }
|
9270 |
+
}), 20) }
|
9271 |
+
})
|
9272 |
|
9273 |
+
on(div, "compositionstart", function (e) {
|
9274 |
+
this$1.composing = {data: e.data}
|
9275 |
+
})
|
9276 |
+
on(div, "compositionupdate", function (e) {
|
9277 |
+
if (!this$1.composing) { this$1.composing = {data: e.data} }
|
9278 |
+
})
|
9279 |
+
on(div, "compositionend", function (e) {
|
9280 |
+
if (this$1.composing) {
|
9281 |
+
if (e.data != this$1.composing.data) { this$1.readFromDOMSoon() }
|
9282 |
+
this$1.composing = null
|
9283 |
+
}
|
9284 |
+
})
|
9285 |
|
9286 |
+
on(div, "touchstart", function () { return input.forceCompositionEnd(); })
|
9287 |
|
9288 |
+
on(div, "input", function () {
|
9289 |
+
if (!this$1.composing) { this$1.readFromDOMSoon() }
|
9290 |
+
})
|
9291 |
|
9292 |
+
function onCopyCut(e) {
|
9293 |
+
if (signalDOMEvent(cm, e)) { return }
|
9294 |
+
if (cm.somethingSelected()) {
|
9295 |
+
setLastCopied({lineWise: false, text: cm.getSelections()})
|
9296 |
+
if (e.type == "cut") { cm.replaceSelection("", null, "cut") }
|
9297 |
+
} else if (!cm.options.lineWiseCopyCut) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9298 |
return
|
9299 |
+
} else {
|
9300 |
+
var ranges = copyableRanges(cm)
|
9301 |
+
setLastCopied({lineWise: true, text: ranges.text})
|
9302 |
+
if (e.type == "cut") {
|
9303 |
+
cm.operation(function () {
|
9304 |
+
cm.setSelections(ranges.ranges, 0, sel_dontScroll)
|
9305 |
+
cm.replaceSelection("", null, "cut")
|
9306 |
+
})
|
9307 |
+
}
|
9308 |
+
}
|
9309 |
+
if (e.clipboardData) {
|
9310 |
+
e.clipboardData.clearData()
|
9311 |
+
var content = lastCopied.text.join("\n")
|
9312 |
+
// iOS exposes the clipboard API, but seems to discard content inserted into it
|
9313 |
+
e.clipboardData.setData("Text", content)
|
9314 |
+
if (e.clipboardData.getData("Text") == content) {
|
9315 |
+
e.preventDefault()
|
9316 |
+
return
|
9317 |
+
}
|
9318 |
}
|
9319 |
+
// Old-fashioned briefly-focus-a-textarea hack
|
9320 |
+
var kludge = hiddenTextarea(), te = kludge.firstChild
|
9321 |
+
cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild)
|
9322 |
+
te.value = lastCopied.text.join("\n")
|
9323 |
+
var hadFocus = document.activeElement
|
9324 |
+
selectInput(te)
|
9325 |
+
setTimeout(function () {
|
9326 |
+
cm.display.lineSpace.removeChild(kludge)
|
9327 |
+
hadFocus.focus()
|
9328 |
+
if (hadFocus == div) { input.showPrimarySelection() }
|
9329 |
+
}, 50)
|
9330 |
}
|
9331 |
+
on(div, "copy", onCopyCut)
|
9332 |
+
on(div, "cut", onCopyCut)
|
9333 |
+
},
|
9334 |
+
|
9335 |
+
prepareSelection: function() {
|
9336 |
+
var result = prepareSelection(this.cm, false)
|
9337 |
+
result.focus = this.cm.state.focused
|
9338 |
+
return result
|
9339 |
+
},
|
9340 |
+
|
9341 |
+
showSelection: function(info, takeFocus) {
|
9342 |
+
if (!info || !this.cm.display.view.length) { return }
|
9343 |
+
if (info.focus || takeFocus) { this.showPrimarySelection() }
|
9344 |
+
this.showMultipleSelections(info)
|
9345 |
+
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9346 |
|
9347 |
+
showPrimarySelection: function() {
|
9348 |
+
var sel = window.getSelection(), prim = this.cm.doc.sel.primary()
|
9349 |
+
var curAnchor = domToPos(this.cm, sel.anchorNode, sel.anchorOffset)
|
9350 |
+
var curFocus = domToPos(this.cm, sel.focusNode, sel.focusOffset)
|
9351 |
+
if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&
|
9352 |
+
cmp(minPos(curAnchor, curFocus), prim.from()) == 0 &&
|
9353 |
+
cmp(maxPos(curAnchor, curFocus), prim.to()) == 0)
|
9354 |
+
{ return }
|
9355 |
+
|
9356 |
+
var start = posToDOM(this.cm, prim.from())
|
9357 |
+
var end = posToDOM(this.cm, prim.to())
|
9358 |
+
if (!start && !end) { return }
|
9359 |
+
|
9360 |
+
var view = this.cm.display.view
|
9361 |
+
var old = sel.rangeCount && sel.getRangeAt(0)
|
9362 |
+
if (!start) {
|
9363 |
+
start = {node: view[0].measure.map[2], offset: 0}
|
9364 |
+
} else if (!end) { // FIXME dangerously hacky
|
9365 |
+
var measure = view[view.length - 1].measure
|
9366 |
+
var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map
|
9367 |
+
end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]}
|
9368 |
+
}
|
9369 |
+
|
9370 |
+
var rng
|
9371 |
+
try { rng = range(start.node, start.offset, end.offset, end.node) }
|
9372 |
+
catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible
|
9373 |
+
if (rng) {
|
9374 |
+
if (!gecko && this.cm.state.focused) {
|
9375 |
+
sel.collapse(start.node, start.offset)
|
9376 |
+
if (!rng.collapsed) {
|
9377 |
+
sel.removeAllRanges()
|
9378 |
+
sel.addRange(rng)
|
9379 |
+
}
|
9380 |
+
} else {
|
9381 |
sel.removeAllRanges()
|
9382 |
sel.addRange(rng)
|
9383 |
}
|
9384 |
+
if (old && sel.anchorNode == null) { sel.addRange(old) }
|
9385 |
+
else if (gecko) { this.startGracePeriod() }
|
|
|
9386 |
}
|
9387 |
+
this.rememberSelection()
|
9388 |
+
},
|
|
|
|
|
|
|
9389 |
|
9390 |
+
startGracePeriod: function() {
|
9391 |
var this$1 = this;
|
9392 |
|
9393 |
+
clearTimeout(this.gracePeriod)
|
9394 |
+
this.gracePeriod = setTimeout(function () {
|
9395 |
+
this$1.gracePeriod = false
|
9396 |
+
if (this$1.selectionChanged())
|
9397 |
+
{ this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }) }
|
9398 |
+
}, 20)
|
9399 |
+
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9400 |
|
9401 |
+
showMultipleSelections: function(info) {
|
9402 |
+
removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors)
|
9403 |
+
removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection)
|
9404 |
+
},
|
9405 |
|
9406 |
+
rememberSelection: function() {
|
9407 |
+
var sel = window.getSelection()
|
9408 |
+
this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset
|
9409 |
+
this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset
|
9410 |
+
},
|
|
|
9411 |
|
9412 |
+
selectionInEditor: function() {
|
9413 |
+
var sel = window.getSelection()
|
9414 |
+
if (!sel.rangeCount) { return false }
|
9415 |
+
var node = sel.getRangeAt(0).commonAncestorContainer
|
9416 |
+
return contains(this.div, node)
|
9417 |
+
},
|
9418 |
+
|
9419 |
+
focus: function() {
|
9420 |
+
if (this.cm.options.readOnly != "nocursor") {
|
9421 |
+
if (!this.selectionInEditor())
|
9422 |
+
{ this.showSelection(this.prepareSelection(), true) }
|
9423 |
+
this.div.focus()
|
9424 |
}
|
9425 |
+
},
|
9426 |
+
blur: function() { this.div.blur() },
|
9427 |
+
getField: function() { return this.div },
|
9428 |
|
9429 |
+
supportsTouch: function() { return true },
|
|
|
|
|
|
|
|
|
9430 |
|
9431 |
+
receivedFocus: function() {
|
9432 |
+
var input = this
|
9433 |
+
if (this.selectionInEditor())
|
9434 |
+
{ this.pollSelection() }
|
9435 |
+
else
|
9436 |
+
{ runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }) }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9437 |
|
9438 |
+
function poll() {
|
9439 |
+
if (input.cm.state.focused) {
|
9440 |
+
input.pollSelection()
|
9441 |
+
input.polling.set(input.cm.options.pollInterval, poll)
|
9442 |
+
}
|
9443 |
+
}
|
9444 |
+
this.polling.set(this.cm.options.pollInterval, poll)
|
9445 |
+
},
|
9446 |
|
9447 |
+
selectionChanged: function() {
|
9448 |
+
var sel = window.getSelection()
|
9449 |
+
return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||
|
9450 |
+
sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset
|
9451 |
+
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9452 |
|
9453 |
+
pollSelection: function() {
|
9454 |
+
if (!this.composing && this.readDOMTimeout == null && !this.gracePeriod && this.selectionChanged()) {
|
9455 |
+
var sel = window.getSelection(), cm = this.cm
|
9456 |
+
this.rememberSelection()
|
9457 |
+
var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset)
|
9458 |
+
var head = domToPos(cm, sel.focusNode, sel.focusOffset)
|
9459 |
+
if (anchor && head) { runInOp(cm, function () {
|
9460 |
+
setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll)
|
9461 |
+
if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true }
|
9462 |
+
}) }
|
9463 |
}
|
9464 |
+
},
|
|
|
|
|
|
|
9465 |
|
9466 |
+
pollContent: function() {
|
9467 |
+
if (this.readDOMTimeout != null) {
|
9468 |
+
clearTimeout(this.readDOMTimeout)
|
9469 |
+
this.readDOMTimeout = null
|
9470 |
+
}
|
9471 |
|
9472 |
+
var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary()
|
9473 |
+
var from = sel.from(), to = sel.to()
|
9474 |
+
if (from.ch == 0 && from.line > cm.firstLine())
|
9475 |
+
{ from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length) }
|
9476 |
+
if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())
|
9477 |
+
{ to = Pos(to.line + 1, 0) }
|
9478 |
+
if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }
|
9479 |
|
9480 |
+
var fromIndex, fromLine, fromNode
|
9481 |
+
if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {
|
9482 |
+
fromLine = lineNo(display.view[0].line)
|
9483 |
+
fromNode = display.view[0].node
|
9484 |
+
} else {
|
9485 |
+
fromLine = lineNo(display.view[fromIndex].line)
|
9486 |
+
fromNode = display.view[fromIndex - 1].node.nextSibling
|
9487 |
+
}
|
9488 |
+
var toIndex = findViewIndex(cm, to.line)
|
9489 |
+
var toLine, toNode
|
9490 |
+
if (toIndex == display.view.length - 1) {
|
9491 |
+
toLine = display.viewTo - 1
|
9492 |
+
toNode = display.lineDiv.lastChild
|
9493 |
+
} else {
|
9494 |
+
toLine = lineNo(display.view[toIndex + 1].line) - 1
|
9495 |
+
toNode = display.view[toIndex + 1].node.previousSibling
|
9496 |
+
}
|
9497 |
+
|
9498 |
+
if (!fromNode) { return false }
|
9499 |
+
var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine))
|
9500 |
+
var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length))
|
9501 |
+
while (newText.length > 1 && oldText.length > 1) {
|
9502 |
+
if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine-- }
|
9503 |
+
else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++ }
|
9504 |
+
else { break }
|
9505 |
+
}
|
9506 |
+
|
9507 |
+
var cutFront = 0, cutEnd = 0
|
9508 |
+
var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length)
|
9509 |
+
while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))
|
9510 |
+
{ ++cutFront }
|
9511 |
+
var newBot = lst(newText), oldBot = lst(oldText)
|
9512 |
+
var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),
|
9513 |
+
oldBot.length - (oldText.length == 1 ? cutFront : 0))
|
9514 |
+
while (cutEnd < maxCutEnd &&
|
9515 |
+
newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))
|
9516 |
+
{ ++cutEnd }
|
9517 |
+
|
9518 |
+
newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, "")
|
9519 |
+
newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, "")
|
9520 |
+
|
9521 |
+
var chFrom = Pos(fromLine, cutFront)
|
9522 |
+
var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0)
|
9523 |
+
if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {
|
9524 |
+
replaceRange(cm.doc, newText, chFrom, chTo, "+input")
|
9525 |
+
return true
|
9526 |
+
}
|
9527 |
+
},
|
9528 |
|
9529 |
+
ensurePolled: function() {
|
9530 |
+
this.forceCompositionEnd()
|
9531 |
+
},
|
9532 |
+
reset: function() {
|
9533 |
+
this.forceCompositionEnd()
|
9534 |
+
},
|
9535 |
+
forceCompositionEnd: function() {
|
9536 |
+
if (!this.composing) { return }
|
9537 |
+
this.composing = null
|
9538 |
+
if (!this.pollContent()) { regChange(this.cm) }
|
9539 |
+
this.div.blur()
|
9540 |
+
this.div.focus()
|
9541 |
+
},
|
9542 |
+
readFromDOMSoon: function() {
|
9543 |
+
var this$1 = this;
|
9544 |
|
9545 |
+
if (this.readDOMTimeout != null) { return }
|
9546 |
+
this.readDOMTimeout = setTimeout(function () {
|
9547 |
+
this$1.readDOMTimeout = null
|
9548 |
+
if (this$1.composing) { return }
|
9549 |
+
if (this$1.cm.isReadOnly() || !this$1.pollContent())
|
9550 |
+
{ runInOp(this$1.cm, function () { return regChange(this$1.cm); }) }
|
9551 |
+
}, 80)
|
9552 |
+
},
|
9553 |
+
|
9554 |
+
setUneditable: function(node) {
|
9555 |
+
node.contentEditable = "false"
|
9556 |
+
},
|
9557 |
+
|
9558 |
+
onKeyPress: function(e) {
|
9559 |
+
e.preventDefault()
|
9560 |
+
if (!this.cm.isReadOnly())
|
9561 |
+
{ operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0) }
|
9562 |
+
},
|
9563 |
+
|
9564 |
+
readOnlyChanged: function(val) {
|
9565 |
+
this.div.contentEditable = String(val != "nocursor")
|
9566 |
+
},
|
9567 |
+
|
9568 |
+
onContextMenu: nothing,
|
9569 |
+
resetPosition: nothing,
|
9570 |
+
|
9571 |
+
needsContentAttribute: true
|
9572 |
+
}, ContentEditableInput.prototype)
|
9573 |
|
9574 |
function posToDOM(cm, pos) {
|
9575 |
var view = findViewForLine(cm, pos.line)
|
9706 |
|
9707 |
// TEXTAREA INPUT STYLE
|
9708 |
|
9709 |
+
function TextareaInput(cm) {
|
9710 |
this.cm = cm
|
9711 |
// See input.poll and input.reset
|
9712 |
this.prevInput = ""
|
9723 |
// Used to work around IE issue with selection being forgotten when focus moves away from textarea
|
9724 |
this.hasSelection = false
|
9725 |
this.composing = null
|
9726 |
+
}
|
9727 |
|
9728 |
+
TextareaInput.prototype = copyObj({
|
9729 |
+
init: function(display) {
|
9730 |
var this$1 = this;
|
9731 |
|
9732 |
+
var input = this, cm = this.cm
|
9733 |
|
9734 |
+
// Wraps and hides input textarea
|
9735 |
+
var div = this.wrapper = hiddenTextarea()
|
9736 |
+
// The semihidden textarea that is focused when the editor is
|
9737 |
+
// focused, and receives input.
|
9738 |
+
var te = this.textarea = div.firstChild
|
9739 |
+
display.wrapper.insertBefore(div, display.wrapper.firstChild)
|
9740 |
|
9741 |
+
// Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)
|
9742 |
+
if (ios) { te.style.width = "0px" }
|
9743 |
|
9744 |
+
on(te, "input", function () {
|
9745 |
+
if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null }
|
9746 |
+
input.poll()
|
9747 |
+
})
|
9748 |
|
9749 |
+
on(te, "paste", function (e) {
|
9750 |
+
if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }
|
9751 |
|
9752 |
+
cm.state.pasteIncoming = true
|
9753 |
+
input.fastPoll()
|
9754 |
+
})
|
9755 |
|
9756 |
+
function prepareCopyCut(e) {
|
9757 |
+
if (signalDOMEvent(cm, e)) { return }
|
9758 |
+
if (cm.somethingSelected()) {
|
9759 |
+
setLastCopied({lineWise: false, text: cm.getSelections()})
|
9760 |
+
if (input.inaccurateSelection) {
|
9761 |
+
input.prevInput = ""
|
9762 |
+
input.inaccurateSelection = false
|
9763 |
+
te.value = lastCopied.text.join("\n")
|
9764 |
+
selectInput(te)
|
9765 |
+
}
|
9766 |
+
} else if (!cm.options.lineWiseCopyCut) {
|
9767 |
+
return
|
|
|
|
|
|
|
|
|
|
|
9768 |
} else {
|
9769 |
+
var ranges = copyableRanges(cm)
|
9770 |
+
setLastCopied({lineWise: true, text: ranges.text})
|
9771 |
+
if (e.type == "cut") {
|
9772 |
+
cm.setSelections(ranges.ranges, null, sel_dontScroll)
|
9773 |
+
} else {
|
9774 |
+
input.prevInput = ""
|
9775 |
+
te.value = ranges.text.join("\n")
|
9776 |
+
selectInput(te)
|
9777 |
+
}
|
9778 |
}
|
9779 |
+
if (e.type == "cut") { cm.state.cutIncoming = true }
|
9780 |
}
|
9781 |
+
on(te, "cut", prepareCopyCut)
|
9782 |
+
on(te, "copy", prepareCopyCut)
|
|
|
|
|
9783 |
|
9784 |
+
on(display.scroller, "paste", function (e) {
|
9785 |
+
if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }
|
9786 |
+
cm.state.pasteIncoming = true
|
9787 |
+
input.focus()
|
9788 |
+
})
|
9789 |
|
9790 |
+
// Prevent normal selection in the editor (we handle our own)
|
9791 |
+
on(display.lineSpace, "selectstart", function (e) {
|
9792 |
+
if (!eventInWidget(display, e)) { e_preventDefault(e) }
|
9793 |
+
})
|
9794 |
|
9795 |
+
on(te, "compositionstart", function () {
|
9796 |
+
var start = cm.getCursor("from")
|
9797 |
+
if (input.composing) { input.composing.range.clear() }
|
9798 |
+
input.composing = {
|
9799 |
+
start: start,
|
9800 |
+
range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"})
|
9801 |
+
}
|
9802 |
+
})
|
9803 |
+
on(te, "compositionend", function () {
|
9804 |
+
if (input.composing) {
|
9805 |
+
input.poll()
|
9806 |
+
input.composing.range.clear()
|
9807 |
+
input.composing = null
|
9808 |
+
}
|
9809 |
+
})
|
9810 |
+
},
|
9811 |
+
|
9812 |
+
prepareSelection: function() {
|
9813 |
+
// Redraw the selection and/or cursor
|
9814 |
+
var cm = this.cm, display = cm.display, doc = cm.doc
|
9815 |
+
var result = prepareSelection(cm)
|
9816 |
+
|
9817 |
+
// Move the hidden textarea near the cursor to prevent scrolling artifacts
|
9818 |
+
if (cm.options.moveInputWithCursor) {
|
9819 |
+
var headPos = cursorCoords(cm, doc.sel.primary().head, "div")
|
9820 |
+
var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect()
|
9821 |
+
result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,
|
9822 |
+
headPos.top + lineOff.top - wrapOff.top))
|
9823 |
+
result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,
|
9824 |
+
headPos.left + lineOff.left - wrapOff.left))
|
9825 |
}
|
|
|
|
|
9826 |
|
9827 |
+
return result
|
9828 |
+
},
|
|
|
|
|
9829 |
|
9830 |
+
showSelection: function(drawn) {
|
9831 |
+
var cm = this.cm, display = cm.display
|
9832 |
+
removeChildrenAndAdd(display.cursorDiv, drawn.cursors)
|
9833 |
+
removeChildrenAndAdd(display.selectionDiv, drawn.selection)
|
9834 |
+
if (drawn.teTop != null) {
|
9835 |
+
this.wrapper.style.top = drawn.teTop + "px"
|
9836 |
+
this.wrapper.style.left = drawn.teLeft + "px"
|
9837 |
+
}
|
9838 |
+
},
|
9839 |
|
9840 |
+
// Reset the input to correspond to the selection (or to be empty,
|
9841 |
+
// when not typing and nothing is selected)
|
9842 |
+
reset: function(typing) {
|
9843 |
+
if (this.contextMenuPending) { return }
|
9844 |
+
var minimal, selected, cm = this.cm, doc = cm.doc
|
9845 |
+
if (cm.somethingSelected()) {
|
9846 |
+
this.prevInput = ""
|
9847 |
+
var range = doc.sel.primary()
|
9848 |
+
minimal = hasCopyEvent &&
|
9849 |
+
(range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000)
|
9850 |
+
var content = minimal ? "-" : selected || cm.getSelection()
|
9851 |
+
this.textarea.value = content
|
9852 |
+
if (cm.state.focused) { selectInput(this.textarea) }
|
9853 |
+
if (ie && ie_version >= 9) { this.hasSelection = content }
|
9854 |
+
} else if (!typing) {
|
9855 |
+
this.prevInput = this.textarea.value = ""
|
9856 |
+
if (ie && ie_version >= 9) { this.hasSelection = null }
|
9857 |
+
}
|
9858 |
+
this.inaccurateSelection = minimal
|
9859 |
+
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9860 |
|
9861 |
+
getField: function() { return this.textarea },
|
9862 |
|
9863 |
+
supportsTouch: function() { return false },
|
9864 |
|
9865 |
+
focus: function() {
|
9866 |
+
if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) {
|
9867 |
+
try { this.textarea.focus() }
|
9868 |
+
catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM
|
9869 |
+
}
|
9870 |
+
},
|
9871 |
|
9872 |
+
blur: function() { this.textarea.blur() },
|
9873 |
|
9874 |
+
resetPosition: function() {
|
9875 |
+
this.wrapper.style.top = this.wrapper.style.left = 0
|
9876 |
+
},
|
9877 |
|
9878 |
+
receivedFocus: function() { this.slowPoll() },
|
9879 |
|
9880 |
+
// Poll for input changes, using the normal rate of polling. This
|
9881 |
+
// runs as long as the editor is focused.
|
9882 |
+
slowPoll: function() {
|
9883 |
var this$1 = this;
|
9884 |
|
9885 |
+
if (this.pollingFast) { return }
|
9886 |
+
this.polling.set(this.cm.options.pollInterval, function () {
|
9887 |
+
this$1.poll()
|
9888 |
+
if (this$1.cm.state.focused) { this$1.slowPoll() }
|
9889 |
+
})
|
9890 |
+
},
|
9891 |
+
|
9892 |
+
// When an event has just come in that is likely to add or change
|
9893 |
+
// something in the input textarea, we poll faster, to ensure that
|
9894 |
+
// the change appears on the screen quickly.
|
9895 |
+
fastPoll: function() {
|
9896 |
+
var missed = false, input = this
|
9897 |
+
input.pollingFast = true
|
9898 |
+
function p() {
|
9899 |
+
var changed = input.poll()
|
9900 |
+
if (!changed && !missed) {missed = true; input.polling.set(60, p)}
|
9901 |
+
else {input.pollingFast = false; input.slowPoll()}
|
9902 |
+
}
|
9903 |
+
input.polling.set(20, p)
|
9904 |
+
},
|
9905 |
+
|
9906 |
+
// Read input from the textarea, and update the document to match.
|
9907 |
+
// When something is selected, it is present in the textarea, and
|
9908 |
+
// selected (unless it is huge, in which case a placeholder is
|
9909 |
+
// used). When nothing is selected, the cursor sits after previously
|
9910 |
+
// seen text (can be empty), which is stored in prevInput (we must
|
9911 |
+
// not reset the textarea when typing, because that breaks IME).
|
9912 |
+
poll: function() {
|
9913 |
var this$1 = this;
|
9914 |
|
9915 |
+
var cm = this.cm, input = this.textarea, prevInput = this.prevInput
|
9916 |
+
// Since this is called a *lot*, try to bail out as cheaply as
|
9917 |
+
// possible when it is clear that nothing happened. hasSelection
|
9918 |
+
// will be the case when there is a lot of text in the textarea,
|
9919 |
+
// in which case reading its value would be expensive.
|
9920 |
+
if (this.contextMenuPending || !cm.state.focused ||
|
9921 |
+
(hasSelection(input) && !prevInput && !this.composing) ||
|
9922 |
+
cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)
|
9923 |
+
{ return false }
|
9924 |
+
|
9925 |
+
var text = input.value
|
9926 |
+
// If nothing changed, bail.
|
9927 |
+
if (text == prevInput && !cm.somethingSelected()) { return false }
|
9928 |
+
// Work around nonsensical selection resetting in IE9/10, and
|
9929 |
+
// inexplicable appearance of private area unicode characters on
|
9930 |
+
// some key combos in Mac (#2689).
|
9931 |
+
if (ie && ie_version >= 9 && this.hasSelection === text ||
|
9932 |
+
mac && /[\uf700-\uf7ff]/.test(text)) {
|
9933 |
+
cm.display.input.reset()
|
9934 |
+
return false
|
9935 |
+
}
|
9936 |
|
9937 |
+
if (cm.doc.sel == cm.display.selForContextMenu) {
|
9938 |
+
var first = text.charCodeAt(0)
|
9939 |
+
if (first == 0x200b && !prevInput) { prevInput = "\u200b" }
|
9940 |
+
if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo") }
|
9941 |
+
}
|
9942 |
+
// Find the part of the input that is actually new
|
9943 |
+
var same = 0, l = Math.min(prevInput.length, text.length)
|
9944 |
+
while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same }
|
|
|
|
|
|
|
9945 |
|
9946 |
+
runInOp(cm, function () {
|
9947 |
+
applyTextInput(cm, text.slice(same), prevInput.length - same,
|
9948 |
+
null, this$1.composing ? "*compose" : null)
|
|
|
|
|
|
|
|
|
|
|
9949 |
|
9950 |
+
// Don't leave long text in the textarea, since it makes further polling slow
|
9951 |
+
if (text.length > 1000 || text.indexOf("\n") > -1) { input.value = this$1.prevInput = "" }
|
9952 |
+
else { this$1.prevInput = text }
|
9953 |
+
|
9954 |
+
if (this$1.composing) {
|
9955 |
+
this$1.composing.range.clear()
|
9956 |
+
this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor("to"),
|
9957 |
+
{className: "CodeMirror-composing"})
|
9958 |
+
}
|
9959 |
+
})
|
9960 |
+
return true
|
9961 |
+
},
|
9962 |
+
|
9963 |
+
ensurePolled: function() {
|
9964 |
+
if (this.pollingFast && this.poll()) { this.pollingFast = false }
|
9965 |
+
},
|
9966 |
|
9967 |
+
onKeyPress: function() {
|
9968 |
+
if (ie && ie_version >= 9) { this.hasSelection = null }
|
9969 |
+
this.fastPoll()
|
9970 |
+
},
|
9971 |
|
9972 |
+
onContextMenu: function(e) {
|
9973 |
+
var input = this, cm = input.cm, display = cm.display, te = input.textarea
|
9974 |
+
var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop
|
9975 |
+
if (!pos || presto) { return } // Opera is difficult.
|
9976 |
+
|
9977 |
+
// Reset the current text selection only if the click is done outside of the selection
|
9978 |
+
// and 'resetSelectionOnContextMenu' option is true.
|
9979 |
+
var reset = cm.options.resetSelectionOnContextMenu
|
9980 |
+
if (reset && cm.doc.sel.contains(pos) == -1)
|
9981 |
+
{ operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll) }
|
9982 |
+
|
9983 |
+
var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText
|
9984 |
+
input.wrapper.style.cssText = "position: absolute"
|
9985 |
+
var wrapperBox = input.wrapper.getBoundingClientRect()
|
9986 |
+
te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"
|
9987 |
+
var oldScrollY
|
9988 |
+
if (webkit) { oldScrollY = window.scrollY } // Work around Chrome issue (#2712)
|
9989 |
+
display.input.focus()
|
9990 |
+
if (webkit) { window.scrollTo(null, oldScrollY) }
|
9991 |
+
display.input.reset()
|
9992 |
+
// Adds "Select all" to context menu in FF
|
9993 |
+
if (!cm.somethingSelected()) { te.value = input.prevInput = " " }
|
9994 |
+
input.contextMenuPending = true
|
9995 |
+
display.selForContextMenu = cm.doc.sel
|
9996 |
+
clearTimeout(display.detectingSelectAll)
|
9997 |
+
|
9998 |
+
// Select-all will be greyed out if there's nothing to select, so
|
9999 |
+
// this adds a zero-width space so that we can later check whether
|
10000 |
+
// it got selected.
|
10001 |
+
function prepareSelectAllHack() {
|
10002 |
+
if (te.selectionStart != null) {
|
10003 |
+
var selected = cm.somethingSelected()
|
10004 |
+
var extval = "\u200b" + (selected ? te.value : "")
|
10005 |
+
te.value = "\u21da" // Used to catch context-menu undo
|
10006 |
+
te.value = extval
|
10007 |
+
input.prevInput = selected ? "" : "\u200b"
|
10008 |
+
te.selectionStart = 1; te.selectionEnd = extval.length
|
10009 |
+
// Re-set this, in case some other handler touched the
|
10010 |
+
// selection in the meantime.
|
10011 |
+
display.selForContextMenu = cm.doc.sel
|
10012 |
+
}
|
10013 |
}
|
10014 |
+
function rehide() {
|
10015 |
+
input.contextMenuPending = false
|
10016 |
+
input.wrapper.style.cssText = oldWrapperCSS
|
10017 |
+
te.style.cssText = oldCSS
|
10018 |
+
if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos) }
|
10019 |
+
|
10020 |
+
// Try to detect the user choosing select-all
|
10021 |
+
if (te.selectionStart != null) {
|
10022 |
+
if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack() }
|
10023 |
+
var i = 0, poll = function () {
|
10024 |
+
if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&
|
10025 |
+
te.selectionEnd > 0 && input.prevInput == "\u200b")
|
10026 |
+
{ operation(cm, selectAll)(cm) }
|
10027 |
+
else if (i++ < 10) { display.detectingSelectAll = setTimeout(poll, 500) }
|
10028 |
+
else { display.input.reset() }
|
10029 |
+
}
|
10030 |
+
display.detectingSelectAll = setTimeout(poll, 200)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10031 |
}
|
|
|
10032 |
}
|
|
|
10033 |
|
10034 |
+
if (ie && ie_version >= 9) { prepareSelectAllHack() }
|
10035 |
+
if (captureRightClick) {
|
10036 |
+
e_stop(e)
|
10037 |
+
var mouseup = function () {
|
10038 |
+
off(window, "mouseup", mouseup)
|
10039 |
+
setTimeout(rehide, 20)
|
10040 |
+
}
|
10041 |
+
on(window, "mouseup", mouseup)
|
10042 |
+
} else {
|
10043 |
+
setTimeout(rehide, 50)
|
10044 |
}
|
10045 |
+
},
|
|
|
|
|
|
|
|
|
10046 |
|
10047 |
+
readOnlyChanged: function(val) {
|
10048 |
+
if (!val) { this.reset() }
|
10049 |
+
},
|
10050 |
|
10051 |
+
setUneditable: nothing,
|
10052 |
|
10053 |
+
needsContentAttribute: false
|
10054 |
+
}, TextareaInput.prototype)
|
10055 |
|
10056 |
function fromTextArea(textarea, options) {
|
10057 |
options = options ? copyObj(options) : {}
|
10202 |
|
10203 |
addLegacyProps(CodeMirror)
|
10204 |
|
10205 |
+
CodeMirror.version = "5.21.0"
|
10206 |
|
10207 |
return CodeMirror;
|
10208 |
|
10739 |
"transition-property", "transition-timing-function", "unicode-bidi",
|
10740 |
"user-select", "vertical-align", "visibility", "voice-balance", "voice-duration",
|
10741 |
"voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress",
|
10742 |
+
"voice-volume", "volume", "white-space", "widows", "width", "word-break",
|
10743 |
"word-spacing", "word-wrap", "z-index",
|
10744 |
// SVG-specific
|
10745 |
"clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color",
|
10813 |
"cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch",
|
10814 |
"cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
|
10815 |
"col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse",
|
10816 |
+
"compact", "condensed", "contain", "content",
|
10817 |
"content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop",
|
10818 |
"cross", "crosshair", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
|
10819 |
"decimal-leading-zero", "default", "default-button", "dense", "destination-atop",
|
10856 |
"mix", "mongolian", "monospace", "move", "multiple", "multiply", "myanmar", "n-resize",
|
10857 |
"narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
|
10858 |
"no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
|
10859 |
+
"ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote",
|
10860 |
"optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",
|
10861 |
"outside", "outside-shape", "overlay", "overline", "padding", "padding-box",
|
10862 |
"painted", "page", "paused", "persian", "perspective", "plus-darker", "plus-lighter",
|
10868 |
"rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY",
|
10869 |
"rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running",
|
10870 |
"s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
|
10871 |
+
"scroll", "scrollbar", "se-resize", "searchfield",
|
10872 |
"searchfield-cancel-button", "searchfield-decoration",
|
10873 |
"searchfield-results-button", "searchfield-results-decoration",
|
10874 |
"semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
|
10886 |
"thick", "thin", "threeddarkshadow", "threedface", "threedhighlight",
|
10887 |
"threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er",
|
10888 |
"tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top",
|
10889 |
+
"trad-chinese-formal", "trad-chinese-informal",
|
10890 |
"translate", "translate3d", "translateX", "translateY", "translateZ",
|
10891 |
+
"transparent", "ultra-condensed", "ultra-expanded", "underline", "up",
|
10892 |
"upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal",
|
10893 |
"upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",
|
10894 |
"var", "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
|
assets/js/lib/tinymce/package.json
DELETED
@@ -1,83 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"_args": [
|
3 |
-
[
|
4 |
-
{
|
5 |
-
"raw": "tinymce@4.3.12",
|
6 |
-
"scope": null,
|
7 |
-
"escapedName": "tinymce",
|
8 |
-
"name": "tinymce",
|
9 |
-
"rawSpec": "4.3.12",
|
10 |
-
"spec": "4.3.12",
|
11 |
-
"type": "version"
|
12 |
-
},
|
13 |
-
"/var/www/mailpoet"
|
14 |
-
]
|
15 |
-
],
|
16 |
-
"_from": "tinymce@4.3.12",
|
17 |
-
"_id": "tinymce@4.3.12",
|
18 |
-
"_inCache": true,
|
19 |
-
"_location": "/tinymce",
|
20 |
-
"_nodeVersion": "4.2.2",
|
21 |
-
"_npmOperationalInternal": {
|
22 |
-
"host": "packages-12-west.internal.npmjs.com",
|
23 |
-
"tmp": "tmp/tinymce-4.3.12.tgz_1462880672047_0.6823310567997396"
|
24 |
-
},
|
25 |
-
"_npmUser": {
|
26 |
-
"name": "ephox",
|
27 |
-
"email": "is-accounts@ephox.com"
|
28 |
-
},
|
29 |
-
"_npmVersion": "2.14.7",
|
30 |
-
"_phantomChildren": {},
|
31 |
-
"_requested": {
|
32 |
-
"raw": "tinymce@4.3.12",
|
33 |
-
"scope": null,
|
34 |
-
"escapedName": "tinymce",
|
35 |
-
"name": "tinymce",
|
36 |
-
"rawSpec": "4.3.12",
|
37 |
-
"spec": "4.3.12",
|
38 |
-
"type": "version"
|
39 |
-
},
|
40 |
-
"_requiredBy": [
|
41 |
-
"/"
|
42 |
-
],
|
43 |
-
"_resolved": "https://registry.npmjs.org/tinymce/-/tinymce-4.3.12.tgz",
|
44 |
-
"_shasum": "c9f847f897f604e1621432589df9d5dcb3c13b36",
|
45 |
-
"_shrinkwrap": null,
|
46 |
-
"_spec": "tinymce@4.3.12",
|
47 |
-
"_where": "/var/www/mailpoet",
|
48 |
-
"bugs": {
|
49 |
-
"url": "http://www.tinymce.com/develop/bugtracker.php"
|
50 |
-
},
|
51 |
-
"dependencies": {},
|
52 |
-
"description": "Web based JavaScript HTML WYSIWYG editor control.",
|
53 |
-
"devDependencies": {},
|
54 |
-
"directories": {},
|
55 |
-
"dist": {
|
56 |
-
"shasum": "c9f847f897f604e1621432589df9d5dcb3c13b36",
|
57 |
-
"tarball": "https://registry.npmjs.org/tinymce/-/tinymce-4.3.12.tgz"
|
58 |
-
},
|
59 |
-
"keywords": [
|
60 |
-
"editor",
|
61 |
-
"wysiwyg",
|
62 |
-
"tinymce",
|
63 |
-
"richtext",
|
64 |
-
"javascript",
|
65 |
-
"html"
|
66 |
-
],
|
67 |
-
"license": "LGPL-2.1",
|
68 |
-
"maintainers": [
|
69 |
-
{
|
70 |
-
"name": "ephox",
|
71 |
-
"email": "is-accounts@ephox.com"
|
72 |
-
},
|
73 |
-
{
|
74 |
-
"name": "spocke",
|
75 |
-
"email": "spocke@moxiecode.com"
|
76 |
-
}
|
77 |
-
],
|
78 |
-
"name": "tinymce",
|
79 |
-
"optionalDependencies": {},
|
80 |
-
"readme": "ERROR: No README data found!",
|
81 |
-
"scripts": {},
|
82 |
-
"version": "4.3.12"
|
83 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/mailpoet.js
CHANGED
@@ -18055,7 +18055,7 @@ webpackJsonp([2],[
|
|
18055 |
|
18056 |
/* WEBPACK VAR INJECTION */(function(global) {/*!
|
18057 |
* Parsley.js
|
18058 |
-
* Version 2.6.
|
18059 |
* http://parsleyjs.org
|
18060 |
* Guillaume Potier - <guillaume@wisembly.com>
|
18061 |
* Marc-Andre Lafortune - <petroselinum@marc-andre.ca>
|
@@ -19741,13 +19741,13 @@ webpackJsonp([2],[
|
|
19741 |
if ('string' === typeof this.$element.attr('pattern')) this.addConstraint('pattern', this.$element.attr('pattern'), undefined, true);
|
19742 |
|
19743 |
// range
|
19744 |
-
if (
|
19745 |
|
19746 |
// HTML5 min
|
19747 |
-
else if (
|
19748 |
|
19749 |
// HTML5 max
|
19750 |
-
else if (
|
19751 |
|
19752 |
// length
|
19753 |
if ('undefined' !== typeof this.$element.attr('minlength') && 'undefined' !== typeof this.$element.attr('maxlength')) this.addConstraint('length', [this.$element.attr('minlength'), this.$element.attr('maxlength')], undefined, true);
|
@@ -19938,7 +19938,7 @@ webpackJsonp([2],[
|
|
19938 |
ParsleyFactory.prototype = {
|
19939 |
init: function init(options) {
|
19940 |
this.__class__ = 'Parsley';
|
19941 |
-
this.__version__ = '2.6.
|
19942 |
this.__id__ = ParsleyUtils__default.generateID();
|
19943 |
|
19944 |
// Pre-compute options
|
@@ -20060,7 +20060,7 @@ webpackJsonp([2],[
|
|
20060 |
actualizeOptions: null,
|
20061 |
_resetOptions: null,
|
20062 |
Factory: ParsleyFactory,
|
20063 |
-
version: '2.6.
|
20064 |
});
|
20065 |
|
20066 |
// Supplement ParsleyField and Form with ParsleyAbstract
|
18055 |
|
18056 |
/* WEBPACK VAR INJECTION */(function(global) {/*!
|
18057 |
* Parsley.js
|
18058 |
+
* Version 2.6.0 - built Wed, Nov 2nd 2016, 10:27 am
|
18059 |
* http://parsleyjs.org
|
18060 |
* Guillaume Potier - <guillaume@wisembly.com>
|
18061 |
* Marc-Andre Lafortune - <petroselinum@marc-andre.ca>
|
19741 |
if ('string' === typeof this.$element.attr('pattern')) this.addConstraint('pattern', this.$element.attr('pattern'), undefined, true);
|
19742 |
|
19743 |
// range
|
19744 |
+
if ('undefined' !== typeof this.$element.attr('min') && 'undefined' !== typeof this.$element.attr('max')) this.addConstraint('range', [this.$element.attr('min'), this.$element.attr('max')], undefined, true);
|
19745 |
|
19746 |
// HTML5 min
|
19747 |
+
else if ('undefined' !== typeof this.$element.attr('min')) this.addConstraint('min', this.$element.attr('min'), undefined, true);
|
19748 |
|
19749 |
// HTML5 max
|
19750 |
+
else if ('undefined' !== typeof this.$element.attr('max')) this.addConstraint('max', this.$element.attr('max'), undefined, true);
|
19751 |
|
19752 |
// length
|
19753 |
if ('undefined' !== typeof this.$element.attr('minlength') && 'undefined' !== typeof this.$element.attr('maxlength')) this.addConstraint('length', [this.$element.attr('minlength'), this.$element.attr('maxlength')], undefined, true);
|
19938 |
ParsleyFactory.prototype = {
|
19939 |
init: function init(options) {
|
19940 |
this.__class__ = 'Parsley';
|
19941 |
+
this.__version__ = '2.6.0';
|
19942 |
this.__id__ = ParsleyUtils__default.generateID();
|
19943 |
|
19944 |
// Pre-compute options
|
20060 |
actualizeOptions: null,
|
20061 |
_resetOptions: null,
|
20062 |
Factory: ParsleyFactory,
|
20063 |
+
version: '2.6.0'
|
20064 |
});
|
20065 |
|
20066 |
// Supplement ParsleyField and Form with ParsleyAbstract
|
assets/js/newsletter_editor.js
CHANGED
@@ -14624,7 +14624,7 @@ webpackJsonp([3],{
|
|
14624 |
/***/ function(module, exports, __webpack_require__) {
|
14625 |
|
14626 |
/**
|
14627 |
-
* interact.js v1.2.
|
14628 |
*
|
14629 |
* Copyright (c) 2012-2015 Taye Adeyemi <dev@taye.me>
|
14630 |
* Open source under the MIT License.
|
@@ -14869,8 +14869,7 @@ webpackJsonp([3],{
|
|
14869 |
supportsTouch = (('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch),
|
14870 |
|
14871 |
// Does the browser support PointerEvents
|
14872 |
-
|
14873 |
-
supportsPointerEvent = PointerEvent && !/Chrome/.test(navigator.userAgent),
|
14874 |
|
14875 |
// Less Precision with touch input
|
14876 |
margin = supportsTouch || supportsPointerEvent? 20: 10,
|
@@ -16003,14 +16002,14 @@ webpackJsonp([3],{
|
|
16003 |
|
16004 |
this.pointerHover(pointer, event, this.matches, this.matchElements);
|
16005 |
events.add(eventTarget,
|
16006 |
-
|
16007 |
listeners.pointerHover);
|
16008 |
}
|
16009 |
else if (this.target) {
|
16010 |
if (nodeContains(prevTargetElement, eventTarget)) {
|
16011 |
this.pointerHover(pointer, event, this.matches, this.matchElements);
|
16012 |
events.add(this.element,
|
16013 |
-
|
16014 |
listeners.pointerHover);
|
16015 |
}
|
16016 |
else {
|
@@ -16062,7 +16061,7 @@ webpackJsonp([3],{
|
|
16062 |
// Remove temporary event listeners for selector Interactables
|
16063 |
if (!interactables.get(eventTarget)) {
|
16064 |
events.remove(eventTarget,
|
16065 |
-
|
16066 |
listeners.pointerHover);
|
16067 |
}
|
16068 |
|
@@ -16374,7 +16373,7 @@ webpackJsonp([3],{
|
|
16374 |
|
16375 |
// set the startCoords if there was no prepared action
|
16376 |
if (!this.prepared.name) {
|
16377 |
-
this.setEventXY(this.startCoords
|
16378 |
}
|
16379 |
|
16380 |
this.prepared.name = action.name;
|
@@ -18556,7 +18555,7 @@ webpackJsonp([3],{
|
|
18556 |
|
18557 |
if (isElement(element, _window)) {
|
18558 |
|
18559 |
-
if (
|
18560 |
events.add(this._element, pEventTypes.down, listeners.pointerDown );
|
18561 |
events.add(this._element, pEventTypes.move, listeners.pointerHover);
|
18562 |
}
|
@@ -20401,7 +20400,7 @@ webpackJsonp([3],{
|
|
20401 |
events.add(doc, eventType, delegateUseCapture, true);
|
20402 |
}
|
20403 |
|
20404 |
-
if (
|
20405 |
if (PointerEvent === win.MSPointerEvent) {
|
20406 |
pEventTypes = {
|
20407 |
up: 'MSPointerUp', down: 'MSPointerDown', over: 'mouseover',
|
14624 |
/***/ function(module, exports, __webpack_require__) {
|
14625 |
|
14626 |
/**
|
14627 |
+
* interact.js v1.2.6
|
14628 |
*
|
14629 |
* Copyright (c) 2012-2015 Taye Adeyemi <dev@taye.me>
|
14630 |
* Open source under the MIT License.
|
14869 |
supportsTouch = (('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch),
|
14870 |
|
14871 |
// Does the browser support PointerEvents
|
14872 |
+
supportsPointerEvent = !!PointerEvent,
|
|
|
14873 |
|
14874 |
// Less Precision with touch input
|
14875 |
margin = supportsTouch || supportsPointerEvent? 20: 10,
|
16002 |
|
16003 |
this.pointerHover(pointer, event, this.matches, this.matchElements);
|
16004 |
events.add(eventTarget,
|
16005 |
+
PointerEvent? pEventTypes.move : 'mousemove',
|
16006 |
listeners.pointerHover);
|
16007 |
}
|
16008 |
else if (this.target) {
|
16009 |
if (nodeContains(prevTargetElement, eventTarget)) {
|
16010 |
this.pointerHover(pointer, event, this.matches, this.matchElements);
|
16011 |
events.add(this.element,
|
16012 |
+
PointerEvent? pEventTypes.move : 'mousemove',
|
16013 |
listeners.pointerHover);
|
16014 |
}
|
16015 |
else {
|
16061 |
// Remove temporary event listeners for selector Interactables
|
16062 |
if (!interactables.get(eventTarget)) {
|
16063 |
events.remove(eventTarget,
|
16064 |
+
PointerEvent? pEventTypes.move : 'mousemove',
|
16065 |
listeners.pointerHover);
|
16066 |
}
|
16067 |
|
16373 |
|
16374 |
// set the startCoords if there was no prepared action
|
16375 |
if (!this.prepared.name) {
|
16376 |
+
this.setEventXY(this.startCoords);
|
16377 |
}
|
16378 |
|
16379 |
this.prepared.name = action.name;
|
18555 |
|
18556 |
if (isElement(element, _window)) {
|
18557 |
|
18558 |
+
if (PointerEvent) {
|
18559 |
events.add(this._element, pEventTypes.down, listeners.pointerDown );
|
18560 |
events.add(this._element, pEventTypes.move, listeners.pointerHover);
|
18561 |
}
|
20400 |
events.add(doc, eventType, delegateUseCapture, true);
|
20401 |
}
|
20402 |
|
20403 |
+
if (PointerEvent) {
|
20404 |
if (PointerEvent === win.MSPointerEvent) {
|
20405 |
pEventTypes = {
|
20406 |
up: 'MSPointerUp', down: 'MSPointerDown', over: 'mouseover',
|
assets/js/public.js
CHANGED
@@ -1945,7 +1945,7 @@
|
|
1945 |
|
1946 |
/* WEBPACK VAR INJECTION */(function(global) {/*!
|
1947 |
* Parsley.js
|
1948 |
-
* Version 2.6.
|
1949 |
* http://parsleyjs.org
|
1950 |
* Guillaume Potier - <guillaume@wisembly.com>
|
1951 |
* Marc-Andre Lafortune - <petroselinum@marc-andre.ca>
|
@@ -3631,13 +3631,13 @@
|
|
3631 |
if ('string' === typeof this.$element.attr('pattern')) this.addConstraint('pattern', this.$element.attr('pattern'), undefined, true);
|
3632 |
|
3633 |
// range
|
3634 |
-
if (
|
3635 |
|
3636 |
// HTML5 min
|
3637 |
-
else if (
|
3638 |
|
3639 |
// HTML5 max
|
3640 |
-
else if (
|
3641 |
|
3642 |
// length
|
3643 |
if ('undefined' !== typeof this.$element.attr('minlength') && 'undefined' !== typeof this.$element.attr('maxlength')) this.addConstraint('length', [this.$element.attr('minlength'), this.$element.attr('maxlength')], undefined, true);
|
@@ -3828,7 +3828,7 @@
|
|
3828 |
ParsleyFactory.prototype = {
|
3829 |
init: function init(options) {
|
3830 |
this.__class__ = 'Parsley';
|
3831 |
-
this.__version__ = '2.6.
|
3832 |
this.__id__ = ParsleyUtils__default.generateID();
|
3833 |
|
3834 |
// Pre-compute options
|
@@ -3950,7 +3950,7 @@
|
|
3950 |
actualizeOptions: null,
|
3951 |
_resetOptions: null,
|
3952 |
Factory: ParsleyFactory,
|
3953 |
-
version: '2.6.
|
3954 |
});
|
3955 |
|
3956 |
// Supplement ParsleyField and Form with ParsleyAbstract
|
1945 |
|
1946 |
/* WEBPACK VAR INJECTION */(function(global) {/*!
|
1947 |
* Parsley.js
|
1948 |
+
* Version 2.6.0 - built Wed, Nov 2nd 2016, 10:27 am
|
1949 |
* http://parsleyjs.org
|
1950 |
* Guillaume Potier - <guillaume@wisembly.com>
|
1951 |
* Marc-Andre Lafortune - <petroselinum@marc-andre.ca>
|
3631 |
if ('string' === typeof this.$element.attr('pattern')) this.addConstraint('pattern', this.$element.attr('pattern'), undefined, true);
|
3632 |
|
3633 |
// range
|
3634 |
+
if ('undefined' !== typeof this.$element.attr('min') && 'undefined' !== typeof this.$element.attr('max')) this.addConstraint('range', [this.$element.attr('min'), this.$element.attr('max')], undefined, true);
|
3635 |
|
3636 |
// HTML5 min
|
3637 |
+
else if ('undefined' !== typeof this.$element.attr('min')) this.addConstraint('min', this.$element.attr('min'), undefined, true);
|
3638 |
|
3639 |
// HTML5 max
|
3640 |
+
else if ('undefined' !== typeof this.$element.attr('max')) this.addConstraint('max', this.$element.attr('max'), undefined, true);
|
3641 |
|
3642 |
// length
|
3643 |
if ('undefined' !== typeof this.$element.attr('minlength') && 'undefined' !== typeof this.$element.attr('maxlength')) this.addConstraint('length', [this.$element.attr('minlength'), this.$element.attr('maxlength')], undefined, true);
|
3828 |
ParsleyFactory.prototype = {
|
3829 |
init: function init(options) {
|
3830 |
this.__class__ = 'Parsley';
|
3831 |
+
this.__version__ = '2.6.0';
|
3832 |
this.__id__ = ParsleyUtils__default.generateID();
|
3833 |
|
3834 |
// Pre-compute options
|
3950 |
actualizeOptions: null,
|
3951 |
_resetOptions: null,
|
3952 |
Factory: ParsleyFactory,
|
3953 |
+
version: '2.6.0'
|
3954 |
});
|
3955 |
|
3956 |
// Supplement ParsleyField and Form with ParsleyAbstract
|
lang/mailpoet.pot
CHANGED
@@ -4,7 +4,7 @@ msgid ""
|
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: \n"
|
6 |
"Report-Msgid-Bugs-To: http://support.mailpoet.com/\n"
|
7 |
-
"POT-Creation-Date: 2017-01-
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -145,71 +145,71 @@ msgstr ""
|
|
145 |
msgid "MailPoet Newsletter"
|
146 |
msgstr ""
|
147 |
|
148 |
-
#: lib/Config/Menu.php:
|
149 |
msgid "Emails"
|
150 |
msgstr ""
|
151 |
|
152 |
-
#: lib/Config/Menu.php:
|
153 |
msgid "Forms"
|
154 |
msgstr ""
|
155 |
|
156 |
-
#: lib/Config/Menu.php:
|
157 |
#: views/subscribers/subscribers.html:17
|
158 |
msgid "Subscribers"
|
159 |
msgstr ""
|
160 |
|
161 |
-
#: lib/Config/Menu.php:
|
162 |
#: views/newsletters.html:63 views/newsletters.html:149 views/segments.html:13
|
163 |
#: views/subscribers/subscribers.html:61
|
164 |
msgid "Lists"
|
165 |
msgstr ""
|
166 |
|
167 |
-
#: lib/Config/Menu.php:
|
168 |
#: views/newsletters.html:64 views/settings.html:6
|
169 |
msgid "Settings"
|
170 |
msgstr ""
|
171 |
|
172 |
-
#: lib/Config/Menu.php:
|
173 |
#: views/subscribers/importExport/import.html:7
|
174 |
#: views/subscribers/subscribers.html:89
|
175 |
msgid "Import"
|
176 |
msgstr ""
|
177 |
|
178 |
-
#: lib/Config/Menu.php:
|
179 |
#: views/subscribers/importExport/export.html:6
|
180 |
#: views/subscribers/importExport/export.html:96
|
181 |
#: views/subscribers/subscribers.html:90
|
182 |
msgid "Export"
|
183 |
msgstr ""
|
184 |
|
185 |
-
#: lib/Config/Menu.php:
|
186 |
#: views/welcome.html:29
|
187 |
msgid "Welcome"
|
188 |
msgstr ""
|
189 |
|
190 |
-
#: lib/Config/Menu.php:
|
191 |
msgid "Update"
|
192 |
msgstr ""
|
193 |
|
194 |
-
#: lib/Config/Menu.php:
|
195 |
msgid "Form Editor"
|
196 |
msgstr ""
|
197 |
|
198 |
-
#: lib/Config/Menu.php:
|
199 |
#: views/newsletter/templates/components/sidebar/styles.hbs:74
|
200 |
#: views/newsletters.html:105
|
201 |
msgid "Newsletter"
|
202 |
msgstr ""
|
203 |
|
204 |
-
#: lib/Config/Menu.php:
|
205 |
msgid "Newsletter Editor"
|
206 |
msgstr ""
|
207 |
|
208 |
-
#: lib/Config/Menu.php:
|
209 |
msgid "In any WordPress role"
|
210 |
msgstr ""
|
211 |
|
212 |
-
#: lib/Config/Menu.php:
|
213 |
msgid "MailPoet"
|
214 |
msgstr ""
|
215 |
|
@@ -3709,7 +3709,7 @@ msgstr ""
|
|
3709 |
#: views/settings/basics.html:275
|
3710 |
msgid ""
|
3711 |
"If you want to use a custom Unsubscribe page, simply paste this shortcode "
|
3712 |
-
"on to a WordPress page: [
|
3713 |
msgstr ""
|
3714 |
|
3715 |
#: views/settings/basics.html:307
|
@@ -4583,22 +4583,22 @@ msgid ""
|
|
4583 |
"updates!"
|
4584 |
msgstr ""
|
4585 |
|
4586 |
-
#: lib/Config/Menu.php:
|
4587 |
msgctxt "newsletters per page (screen options)"
|
4588 |
msgid "Number of newsletters per page"
|
4589 |
msgstr ""
|
4590 |
|
4591 |
-
#: lib/Config/Menu.php:
|
4592 |
msgctxt "forms per page (screen options)"
|
4593 |
msgid "Number of forms per page"
|
4594 |
msgstr ""
|
4595 |
|
4596 |
-
#: lib/Config/Menu.php:
|
4597 |
msgctxt "subscribers per page (screen options)"
|
4598 |
msgid "Number of subscribers per page"
|
4599 |
msgstr ""
|
4600 |
|
4601 |
-
#: lib/Config/Menu.php:
|
4602 |
msgctxt "segments per page (screen options)"
|
4603 |
msgid "Number of segments per page"
|
4604 |
msgstr ""
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: \n"
|
6 |
"Report-Msgid-Bugs-To: http://support.mailpoet.com/\n"
|
7 |
+
"POT-Creation-Date: 2017-01-17 17:30:15+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
145 |
msgid "MailPoet Newsletter"
|
146 |
msgstr ""
|
147 |
|
148 |
+
#: lib/Config/Menu.php:62 lib/Config/Menu.php:63 views/newsletters.html:23
|
149 |
msgid "Emails"
|
150 |
msgstr ""
|
151 |
|
152 |
+
#: lib/Config/Menu.php:85 lib/Config/Menu.php:86 views/forms.html:16
|
153 |
msgid "Forms"
|
154 |
msgstr ""
|
155 |
|
156 |
+
#: lib/Config/Menu.php:107 lib/Config/Menu.php:108
|
157 |
#: views/subscribers/subscribers.html:17
|
158 |
msgid "Subscribers"
|
159 |
msgstr ""
|
160 |
|
161 |
+
#: lib/Config/Menu.php:129 lib/Config/Menu.php:130 views/forms.html:43
|
162 |
#: views/newsletters.html:63 views/newsletters.html:149 views/segments.html:13
|
163 |
#: views/subscribers/subscribers.html:61
|
164 |
msgid "Lists"
|
165 |
msgstr ""
|
166 |
|
167 |
+
#: lib/Config/Menu.php:152 lib/Config/Menu.php:153 views/form/editor.html:37
|
168 |
#: views/newsletters.html:64 views/settings.html:6
|
169 |
msgid "Settings"
|
170 |
msgstr ""
|
171 |
|
172 |
+
#: lib/Config/Menu.php:163 lib/Config/Menu.php:164
|
173 |
#: views/subscribers/importExport/import.html:7
|
174 |
#: views/subscribers/subscribers.html:89
|
175 |
msgid "Import"
|
176 |
msgstr ""
|
177 |
|
178 |
+
#: lib/Config/Menu.php:175 lib/Config/Menu.php:176
|
179 |
#: views/subscribers/importExport/export.html:6
|
180 |
#: views/subscribers/importExport/export.html:96
|
181 |
#: views/subscribers/subscribers.html:90
|
182 |
msgid "Export"
|
183 |
msgstr ""
|
184 |
|
185 |
+
#: lib/Config/Menu.php:187 lib/Config/Menu.php:188 views/update.html:20
|
186 |
#: views/welcome.html:29
|
187 |
msgid "Welcome"
|
188 |
msgstr ""
|
189 |
|
190 |
+
#: lib/Config/Menu.php:199 lib/Config/Menu.php:200 views/segments.html:43
|
191 |
msgid "Update"
|
192 |
msgstr ""
|
193 |
|
194 |
+
#: lib/Config/Menu.php:211 lib/Config/Menu.php:212
|
195 |
msgid "Form Editor"
|
196 |
msgstr ""
|
197 |
|
198 |
+
#: lib/Config/Menu.php:223 lib/Newsletter/Shortcodes/ShortcodesHelper.php:32
|
199 |
#: views/newsletter/templates/components/sidebar/styles.hbs:74
|
200 |
#: views/newsletters.html:105
|
201 |
msgid "Newsletter"
|
202 |
msgstr ""
|
203 |
|
204 |
+
#: lib/Config/Menu.php:224
|
205 |
msgid "Newsletter Editor"
|
206 |
msgstr ""
|
207 |
|
208 |
+
#: lib/Config/Menu.php:399
|
209 |
msgid "In any WordPress role"
|
210 |
msgstr ""
|
211 |
|
212 |
+
#: lib/Config/Menu.php:474
|
213 |
msgid "MailPoet"
|
214 |
msgstr ""
|
215 |
|
3709 |
#: views/settings/basics.html:275
|
3710 |
msgid ""
|
3711 |
"If you want to use a custom Unsubscribe page, simply paste this shortcode "
|
3712 |
+
"on to a WordPress page: [mailpoet_manage text=\"Manage your subscription\"]"
|
3713 |
msgstr ""
|
3714 |
|
3715 |
#: views/settings/basics.html:307
|
4583 |
"updates!"
|
4584 |
msgstr ""
|
4585 |
|
4586 |
+
#: lib/Config/Menu.php:75
|
4587 |
msgctxt "newsletters per page (screen options)"
|
4588 |
msgid "Number of newsletters per page"
|
4589 |
msgstr ""
|
4590 |
|
4591 |
+
#: lib/Config/Menu.php:97
|
4592 |
msgctxt "forms per page (screen options)"
|
4593 |
msgid "Number of forms per page"
|
4594 |
msgstr ""
|
4595 |
|
4596 |
+
#: lib/Config/Menu.php:119
|
4597 |
msgctxt "subscribers per page (screen options)"
|
4598 |
msgid "Number of subscribers per page"
|
4599 |
msgstr ""
|
4600 |
|
4601 |
+
#: lib/Config/Menu.php:142
|
4602 |
msgctxt "segments per page (screen options)"
|
4603 |
msgid "Number of segments per page"
|
4604 |
msgstr ""
|
lib/Config/Database.php
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace MailPoet\Config;
|
3 |
+
|
4 |
+
use ORM as ORM;
|
5 |
+
use PDO as PDO;
|
6 |
+
|
7 |
+
if(!defined('ABSPATH')) exit;
|
8 |
+
|
9 |
+
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
10 |
+
|
11 |
+
class Database {
|
12 |
+
public $driver_option_wait_timeout = 60;
|
13 |
+
|
14 |
+
function init() {
|
15 |
+
$this->setupConnection();
|
16 |
+
$this->setupLogging();
|
17 |
+
$this->setupDriverOptions();
|
18 |
+
$this->defineTables();
|
19 |
+
}
|
20 |
+
|
21 |
+
function setupConnection() {
|
22 |
+
ORM::configure(Env::$db_source_name);
|
23 |
+
ORM::configure('username', Env::$db_username);
|
24 |
+
ORM::configure('password', Env::$db_password);
|
25 |
+
}
|
26 |
+
|
27 |
+
function setupLogging() {
|
28 |
+
ORM::configure('logging', WP_DEBUG);
|
29 |
+
}
|
30 |
+
|
31 |
+
function setupDriverOptions() {
|
32 |
+
$driver_options = array(
|
33 |
+
'TIME_ZONE = "' . Env::$db_timezone_offset . '"',
|
34 |
+
'sql_mode=(SELECT REPLACE(@@sql_mode,"ONLY_FULL_GROUP_BY",""))',
|
35 |
+
);
|
36 |
+
$current_options = ORM::for_table("")
|
37 |
+
->raw_query('SELECT @@session.wait_timeout as wait_timeout')
|
38 |
+
->findOne();
|
39 |
+
if($current_options && (int)$current_options->wait_timeout < $this->driver_option_wait_timeout) {
|
40 |
+
$driver_options[] = 'SESSION wait_timeout = ' . $this->driver_option_wait_timeout;
|
41 |
+
}
|
42 |
+
// reset the database
|
43 |
+
ORM::set_db(null);
|
44 |
+
ORM::configure('driver_options', array(
|
45 |
+
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET ' . implode(', ', $driver_options)
|
46 |
+
));
|
47 |
+
}
|
48 |
+
|
49 |
+
function defineTables() {
|
50 |
+
if(!defined('MP_SETTINGS_TABLE')) {
|
51 |
+
$settings = Env::$db_prefix . 'settings';
|
52 |
+
$segments = Env::$db_prefix . 'segments';
|
53 |
+
$forms = Env::$db_prefix . 'forms';
|
54 |
+
$custom_fields = Env::$db_prefix . 'custom_fields';
|
55 |
+
$subscribers = Env::$db_prefix . 'subscribers';
|
56 |
+
$subscriber_segment = Env::$db_prefix . 'subscriber_segment';
|
57 |
+
$subscriber_custom_field = Env::$db_prefix . 'subscriber_custom_field';
|
58 |
+
$newsletter_segment = Env::$db_prefix . 'newsletter_segment';
|
59 |
+
$sending_queues = Env::$db_prefix . 'sending_queues';
|
60 |
+
$newsletters = Env::$db_prefix . 'newsletters';
|
61 |
+
$newsletter_templates = Env::$db_prefix . 'newsletter_templates';
|
62 |
+
$newsletter_option_fields = Env::$db_prefix . 'newsletter_option_fields';
|
63 |
+
$newsletter_option = Env::$db_prefix . 'newsletter_option';
|
64 |
+
$newsletter_links = Env::$db_prefix . 'newsletter_links';
|
65 |
+
$newsletter_posts = Env::$db_prefix . 'newsletter_posts';
|
66 |
+
$statistics_newsletters = Env::$db_prefix . 'statistics_newsletters';
|
67 |
+
$statistics_clicks = Env::$db_prefix . 'statistics_clicks';
|
68 |
+
$statistics_opens = Env::$db_prefix . 'statistics_opens';
|
69 |
+
$statistics_unsubscribes = Env::$db_prefix . 'statistics_unsubscribes';
|
70 |
+
$statistics_forms = Env::$db_prefix . 'statistics_forms';
|
71 |
+
|
72 |
+
define('MP_SETTINGS_TABLE', $settings);
|
73 |
+
define('MP_SEGMENTS_TABLE', $segments);
|
74 |
+
define('MP_FORMS_TABLE', $forms);
|
75 |
+
define('MP_CUSTOM_FIELDS_TABLE', $custom_fields);
|
76 |
+
define('MP_SUBSCRIBERS_TABLE', $subscribers);
|
77 |
+
define('MP_SUBSCRIBER_SEGMENT_TABLE', $subscriber_segment);
|
78 |
+
define('MP_SUBSCRIBER_CUSTOM_FIELD_TABLE', $subscriber_custom_field);
|
79 |
+
define('MP_SENDING_QUEUES_TABLE', $sending_queues);
|
80 |
+
define('MP_NEWSLETTERS_TABLE', $newsletters);
|
81 |
+
define('MP_NEWSLETTER_TEMPLATES_TABLE', $newsletter_templates);
|
82 |
+
define('MP_NEWSLETTER_SEGMENT_TABLE', $newsletter_segment);
|
83 |
+
define('MP_NEWSLETTER_OPTION_FIELDS_TABLE', $newsletter_option_fields);
|
84 |
+
define('MP_NEWSLETTER_LINKS_TABLE', $newsletter_links);
|
85 |
+
define('MP_NEWSLETTER_POSTS_TABLE', $newsletter_posts);
|
86 |
+
define('MP_NEWSLETTER_OPTION_TABLE', $newsletter_option);
|
87 |
+
define('MP_STATISTICS_NEWSLETTERS_TABLE', $statistics_newsletters);
|
88 |
+
define('MP_STATISTICS_CLICKS_TABLE', $statistics_clicks);
|
89 |
+
define('MP_STATISTICS_OPENS_TABLE', $statistics_opens);
|
90 |
+
define('MP_STATISTICS_UNSUBSCRIBES_TABLE', $statistics_unsubscribes);
|
91 |
+
define('MP_STATISTICS_FORMS_TABLE', $statistics_forms);
|
92 |
+
}
|
93 |
+
}
|
94 |
+
}
|
lib/Config/Initializer.php
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
<?php
|
2 |
namespace MailPoet\Config;
|
3 |
|
|
|
4 |
use MailPoet\Cron\CronTrigger;
|
5 |
use MailPoet\Router;
|
6 |
-
use MailPoet\
|
7 |
use MailPoet\WP\Notice as WPNotice;
|
8 |
|
9 |
if(!defined('ABSPATH')) exit;
|
@@ -18,7 +19,7 @@ class Initializer {
|
|
18 |
'file' => '',
|
19 |
'version' => '1.0.0'
|
20 |
)) {
|
21 |
-
|
22 |
}
|
23 |
|
24 |
function init() {
|
@@ -26,20 +27,38 @@ class Initializer {
|
|
26 |
|
27 |
// abort initialization if PDO extension is missing
|
28 |
if(!$requirements_check_results[RequirementsChecker::TEST_PDO_EXTENSION] ||
|
29 |
-
!$requirements_check_results[RequirementsChecker::TEST_VENDOR_SOURCE]
|
|
|
|
|
|
|
30 |
|
31 |
$this->setupDB();
|
32 |
|
33 |
// activation function
|
34 |
register_activation_hook(
|
35 |
Env::$file,
|
36 |
-
array(
|
|
|
|
|
|
|
37 |
);
|
38 |
|
39 |
-
add_action('plugins_loaded', array(
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
}
|
44 |
|
45 |
function checkRequirements() {
|
@@ -48,57 +67,8 @@ class Initializer {
|
|
48 |
}
|
49 |
|
50 |
function setupDB() {
|
51 |
-
|
52 |
-
|
53 |
-
\ORM::configure('password', Env::$db_password);
|
54 |
-
\ORM::configure('logging', WP_DEBUG);
|
55 |
-
\ORM::configure('driver_options', array(
|
56 |
-
\PDO::MYSQL_ATTR_INIT_COMMAND =>
|
57 |
-
'SET TIME_ZONE = "' . Env::$db_timezone_offset . '", ' .
|
58 |
-
'sql_mode=(SELECT REPLACE(@@sql_mode,"ONLY_FULL_GROUP_BY",""))'
|
59 |
-
));
|
60 |
-
|
61 |
-
$settings = Env::$db_prefix . 'settings';
|
62 |
-
$segments = Env::$db_prefix . 'segments';
|
63 |
-
$forms = Env::$db_prefix . 'forms';
|
64 |
-
$custom_fields = Env::$db_prefix . 'custom_fields';
|
65 |
-
$subscribers = Env::$db_prefix . 'subscribers';
|
66 |
-
$subscriber_segment = Env::$db_prefix . 'subscriber_segment';
|
67 |
-
$subscriber_custom_field = Env::$db_prefix . 'subscriber_custom_field';
|
68 |
-
$newsletter_segment = Env::$db_prefix . 'newsletter_segment';
|
69 |
-
$sending_queues = Env::$db_prefix . 'sending_queues';
|
70 |
-
$newsletters = Env::$db_prefix . 'newsletters';
|
71 |
-
$newsletter_templates = Env::$db_prefix . 'newsletter_templates';
|
72 |
-
$newsletter_option_fields = Env::$db_prefix . 'newsletter_option_fields';
|
73 |
-
$newsletter_option = Env::$db_prefix . 'newsletter_option';
|
74 |
-
$newsletter_links = Env::$db_prefix . 'newsletter_links';
|
75 |
-
$newsletter_posts = Env::$db_prefix . 'newsletter_posts';
|
76 |
-
$statistics_newsletters = Env::$db_prefix . 'statistics_newsletters';
|
77 |
-
$statistics_clicks = Env::$db_prefix . 'statistics_clicks';
|
78 |
-
$statistics_opens = Env::$db_prefix . 'statistics_opens';
|
79 |
-
$statistics_unsubscribes = Env::$db_prefix . 'statistics_unsubscribes';
|
80 |
-
$statistics_forms = Env::$db_prefix . 'statistics_forms';
|
81 |
-
|
82 |
-
define('MP_SETTINGS_TABLE', $settings);
|
83 |
-
define('MP_SEGMENTS_TABLE', $segments);
|
84 |
-
define('MP_FORMS_TABLE', $forms);
|
85 |
-
define('MP_CUSTOM_FIELDS_TABLE', $custom_fields);
|
86 |
-
define('MP_SUBSCRIBERS_TABLE', $subscribers);
|
87 |
-
define('MP_SUBSCRIBER_SEGMENT_TABLE', $subscriber_segment);
|
88 |
-
define('MP_SUBSCRIBER_CUSTOM_FIELD_TABLE', $subscriber_custom_field);
|
89 |
-
define('MP_SENDING_QUEUES_TABLE', $sending_queues);
|
90 |
-
define('MP_NEWSLETTERS_TABLE', $newsletters);
|
91 |
-
define('MP_NEWSLETTER_TEMPLATES_TABLE', $newsletter_templates);
|
92 |
-
define('MP_NEWSLETTER_SEGMENT_TABLE', $newsletter_segment);
|
93 |
-
define('MP_NEWSLETTER_OPTION_FIELDS_TABLE', $newsletter_option_fields);
|
94 |
-
define('MP_NEWSLETTER_LINKS_TABLE', $newsletter_links);
|
95 |
-
define('MP_NEWSLETTER_POSTS_TABLE', $newsletter_posts);
|
96 |
-
define('MP_NEWSLETTER_OPTION_TABLE', $newsletter_option);
|
97 |
-
define('MP_STATISTICS_NEWSLETTERS_TABLE', $statistics_newsletters);
|
98 |
-
define('MP_STATISTICS_CLICKS_TABLE', $statistics_clicks);
|
99 |
-
define('MP_STATISTICS_OPENS_TABLE', $statistics_opens);
|
100 |
-
define('MP_STATISTICS_UNSUBSCRIBES_TABLE', $statistics_unsubscribes);
|
101 |
-
define('MP_STATISTICS_FORMS_TABLE', $statistics_forms);
|
102 |
}
|
103 |
|
104 |
function setup() {
|
@@ -112,6 +82,7 @@ class Initializer {
|
|
112 |
$this->setupShortcodes();
|
113 |
$this->setupImages();
|
114 |
$this->setupCronTrigger();
|
|
|
115 |
|
116 |
$this->plugin_initialized = true;
|
117 |
} catch(\Exception $e) {
|
@@ -222,6 +193,11 @@ class Initializer {
|
|
222 |
add_image_size('mailpoet_newsletter_max', 1320);
|
223 |
}
|
224 |
|
|
|
|
|
|
|
|
|
|
|
225 |
function handleFailedInitialization($message) {
|
226 |
return WPNotice::displayError($message);
|
227 |
}
|
1 |
<?php
|
2 |
namespace MailPoet\Config;
|
3 |
|
4 |
+
use MailPoet\API;
|
5 |
use MailPoet\Cron\CronTrigger;
|
6 |
use MailPoet\Router;
|
7 |
+
use MailPoet\Util\ConflictResolver;
|
8 |
use MailPoet\WP\Notice as WPNotice;
|
9 |
|
10 |
if(!defined('ABSPATH')) exit;
|
19 |
'file' => '',
|
20 |
'version' => '1.0.0'
|
21 |
)) {
|
22 |
+
Env::init($params['file'], $params['version']);
|
23 |
}
|
24 |
|
25 |
function init() {
|
27 |
|
28 |
// abort initialization if PDO extension is missing
|
29 |
if(!$requirements_check_results[RequirementsChecker::TEST_PDO_EXTENSION] ||
|
30 |
+
!$requirements_check_results[RequirementsChecker::TEST_VENDOR_SOURCE]
|
31 |
+
) {
|
32 |
+
return;
|
33 |
+
}
|
34 |
|
35 |
$this->setupDB();
|
36 |
|
37 |
// activation function
|
38 |
register_activation_hook(
|
39 |
Env::$file,
|
40 |
+
array(
|
41 |
+
'MailPoet\Config\Activator',
|
42 |
+
'activate'
|
43 |
+
)
|
44 |
);
|
45 |
|
46 |
+
add_action('plugins_loaded', array(
|
47 |
+
$this,
|
48 |
+
'setup'
|
49 |
+
));
|
50 |
+
add_action('init', array(
|
51 |
+
$this,
|
52 |
+
'onInit'
|
53 |
+
));
|
54 |
+
add_action('widgets_init', array(
|
55 |
+
$this,
|
56 |
+
'setupWidget'
|
57 |
+
));
|
58 |
+
add_action('wp_loaded', array(
|
59 |
+
$this,
|
60 |
+
'setupHooks'
|
61 |
+
));
|
62 |
}
|
63 |
|
64 |
function checkRequirements() {
|
67 |
}
|
68 |
|
69 |
function setupDB() {
|
70 |
+
$database = new Database();
|
71 |
+
$database->init();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
}
|
73 |
|
74 |
function setup() {
|
82 |
$this->setupShortcodes();
|
83 |
$this->setupImages();
|
84 |
$this->setupCronTrigger();
|
85 |
+
$this->setupConflictResolver();
|
86 |
|
87 |
$this->plugin_initialized = true;
|
88 |
} catch(\Exception $e) {
|
193 |
add_image_size('mailpoet_newsletter_max', 1320);
|
194 |
}
|
195 |
|
196 |
+
function setupConflictResolver() {
|
197 |
+
$conflict_resolver = new ConflictResolver();
|
198 |
+
$conflict_resolver->init();
|
199 |
+
}
|
200 |
+
|
201 |
function handleFailedInitialization($message) {
|
202 |
return WPNotice::displayError($message);
|
203 |
}
|
lib/Config/Menu.php
CHANGED
@@ -4,6 +4,7 @@ namespace MailPoet\Config;
|
|
4 |
use MailPoet\Cron\CronTrigger;
|
5 |
use MailPoet\Form\Block;
|
6 |
use MailPoet\Form\Renderer as FormRenderer;
|
|
|
7 |
use MailPoet\Models\CustomField;
|
8 |
use MailPoet\Models\Form;
|
9 |
use MailPoet\Models\Segment;
|
@@ -13,7 +14,6 @@ use MailPoet\Newsletter\Shortcodes\ShortcodesHelper;
|
|
13 |
use MailPoet\Settings\Hosts;
|
14 |
use MailPoet\Settings\Pages;
|
15 |
use MailPoet\Subscribers\ImportExport\ImportExportFactory;
|
16 |
-
use MailPoet\Listing;
|
17 |
use MailPoet\Util\License\Features\Subscribers as SubscribersFeature;
|
18 |
use MailPoet\WP\DateTime;
|
19 |
use MailPoet\WP\Notice as WPNotice;
|
@@ -40,6 +40,11 @@ class Menu {
|
|
40 |
}
|
41 |
|
42 |
function setup() {
|
|
|
|
|
|
|
|
|
|
|
43 |
$main_page_slug = 'mailpoet-newsletters';
|
44 |
|
45 |
add_menu_page(
|
@@ -58,11 +63,14 @@ class Menu {
|
|
58 |
__('Emails', 'mailpoet'),
|
59 |
Env::$required_permission,
|
60 |
$main_page_slug,
|
61 |
-
array(
|
|
|
|
|
|
|
62 |
);
|
63 |
|
64 |
// add limit per page to screen options
|
65 |
-
add_action('load-'
|
66 |
add_screen_option('per_page', array(
|
67 |
'label' => _x(
|
68 |
'Number of newsletters per page',
|
@@ -78,10 +86,13 @@ class Menu {
|
|
78 |
__('Forms', 'mailpoet'),
|
79 |
Env::$required_permission,
|
80 |
'mailpoet-forms',
|
81 |
-
array(
|
|
|
|
|
|
|
82 |
);
|
83 |
// add limit per page to screen options
|
84 |
-
add_action('load-'
|
85 |
add_screen_option('per_page', array(
|
86 |
'label' => _x(
|
87 |
'Number of forms per page',
|
@@ -97,10 +108,13 @@ class Menu {
|
|
97 |
__('Subscribers', 'mailpoet'),
|
98 |
Env::$required_permission,
|
99 |
'mailpoet-subscribers',
|
100 |
-
array(
|
|
|
|
|
|
|
101 |
);
|
102 |
// add limit per page to screen options
|
103 |
-
add_action('load-'
|
104 |
add_screen_option('per_page', array(
|
105 |
'label' => _x(
|
106 |
'Number of subscribers per page',
|
@@ -116,11 +130,14 @@ class Menu {
|
|
116 |
__('Lists', 'mailpoet'),
|
117 |
Env::$required_permission,
|
118 |
'mailpoet-segments',
|
119 |
-
array(
|
|
|
|
|
|
|
120 |
);
|
121 |
|
122 |
// add limit per page to screen options
|
123 |
-
add_action('load-'
|
124 |
add_screen_option('per_page', array(
|
125 |
'label' => _x(
|
126 |
'Number of segments per page',
|
@@ -132,19 +149,25 @@ class Menu {
|
|
132 |
|
133 |
add_submenu_page(
|
134 |
$main_page_slug,
|
135 |
-
$this->setPageTitle(
|
136 |
__('Settings', 'mailpoet'),
|
137 |
Env::$required_permission,
|
138 |
'mailpoet-settings',
|
139 |
-
array(
|
|
|
|
|
|
|
140 |
);
|
141 |
add_submenu_page(
|
142 |
'admin.php?page=mailpoet-subscribers',
|
143 |
-
$this->setPageTitle(
|
144 |
__('Import', 'mailpoet'),
|
145 |
Env::$required_permission,
|
146 |
'mailpoet-import',
|
147 |
-
array(
|
|
|
|
|
|
|
148 |
);
|
149 |
|
150 |
add_submenu_page(
|
@@ -153,7 +176,10 @@ class Menu {
|
|
153 |
__('Export', 'mailpoet'),
|
154 |
Env::$required_permission,
|
155 |
'mailpoet-export',
|
156 |
-
array(
|
|
|
|
|
|
|
157 |
);
|
158 |
|
159 |
add_submenu_page(
|
@@ -162,7 +188,10 @@ class Menu {
|
|
162 |
__('Welcome', 'mailpoet'),
|
163 |
Env::$required_permission,
|
164 |
'mailpoet-welcome',
|
165 |
-
array(
|
|
|
|
|
|
|
166 |
);
|
167 |
|
168 |
add_submenu_page(
|
@@ -171,7 +200,10 @@ class Menu {
|
|
171 |
__('Update', 'mailpoet'),
|
172 |
Env::$required_permission,
|
173 |
'mailpoet-update',
|
174 |
-
array(
|
|
|
|
|
|
|
175 |
);
|
176 |
|
177 |
add_submenu_page(
|
@@ -180,7 +212,10 @@ class Menu {
|
|
180 |
__('Form Editor', 'mailpoet'),
|
181 |
Env::$required_permission,
|
182 |
'mailpoet-form-editor',
|
183 |
-
array(
|
|
|
|
|
|
|
184 |
);
|
185 |
|
186 |
add_submenu_page(
|
@@ -189,7 +224,10 @@ class Menu {
|
|
189 |
__('Newsletter Editor', 'mailpoet'),
|
190 |
Env::$required_permission,
|
191 |
'mailpoet-newsletter-editor',
|
192 |
-
array(
|
|
|
|
|
|
|
193 |
);
|
194 |
}
|
195 |
|
@@ -255,7 +293,7 @@ class Menu {
|
|
255 |
}
|
256 |
|
257 |
function settings() {
|
258 |
-
if
|
259 |
|
260 |
$settings = Setting::getAll();
|
261 |
$flags = $this->_getFlags();
|
@@ -329,7 +367,7 @@ class Menu {
|
|
329 |
}
|
330 |
|
331 |
function segments() {
|
332 |
-
if
|
333 |
|
334 |
$data = array();
|
335 |
$data['items_per_page'] = $this->getLimitPerPage('segments');
|
@@ -337,7 +375,7 @@ class Menu {
|
|
337 |
}
|
338 |
|
339 |
function forms() {
|
340 |
-
if
|
341 |
|
342 |
$data = array();
|
343 |
|
@@ -348,7 +386,7 @@ class Menu {
|
|
348 |
}
|
349 |
|
350 |
function newsletters() {
|
351 |
-
if
|
352 |
|
353 |
global $wp_roles;
|
354 |
|
@@ -451,7 +489,7 @@ class Menu {
|
|
451 |
}
|
452 |
|
453 |
$listing_per_page = get_user_meta(
|
454 |
-
get_current_user_id(), 'mailpoet_'
|
455 |
);
|
456 |
return (!empty($listing_per_page))
|
457 |
? (int)$listing_per_page
|
@@ -461,9 +499,13 @@ class Menu {
|
|
461 |
private function displayPage($template, $data) {
|
462 |
try {
|
463 |
echo $this->renderer->render($template, $data);
|
464 |
-
} catch
|
465 |
$notice = new WPNotice(WPNotice::TYPE_ERROR, $e->getMessage());
|
466 |
$notice->displayWPNotice();
|
467 |
}
|
468 |
}
|
469 |
-
|
|
|
|
|
|
|
|
4 |
use MailPoet\Cron\CronTrigger;
|
5 |
use MailPoet\Form\Block;
|
6 |
use MailPoet\Form\Renderer as FormRenderer;
|
7 |
+
use MailPoet\Listing;
|
8 |
use MailPoet\Models\CustomField;
|
9 |
use MailPoet\Models\Form;
|
10 |
use MailPoet\Models\Segment;
|
14 |
use MailPoet\Settings\Hosts;
|
15 |
use MailPoet\Settings\Pages;
|
16 |
use MailPoet\Subscribers\ImportExport\ImportExportFactory;
|
|
|
17 |
use MailPoet\Util\License\Features\Subscribers as SubscribersFeature;
|
18 |
use MailPoet\WP\DateTime;
|
19 |
use MailPoet\WP\Notice as WPNotice;
|
40 |
}
|
41 |
|
42 |
function setup() {
|
43 |
+
if(self::isOnMailPoetAdminPage()) {
|
44 |
+
do_action('mailpoet_conflict_resolver_styles');
|
45 |
+
do_action('mailpoet_conflict_resolver_scripts');
|
46 |
+
}
|
47 |
+
|
48 |
$main_page_slug = 'mailpoet-newsletters';
|
49 |
|
50 |
add_menu_page(
|
63 |
__('Emails', 'mailpoet'),
|
64 |
Env::$required_permission,
|
65 |
$main_page_slug,
|
66 |
+
array(
|
67 |
+
$this,
|
68 |
+
'newsletters'
|
69 |
+
)
|
70 |
);
|
71 |
|
72 |
// add limit per page to screen options
|
73 |
+
add_action('load-' . $newsletters_page, function() {
|
74 |
add_screen_option('per_page', array(
|
75 |
'label' => _x(
|
76 |
'Number of newsletters per page',
|
86 |
__('Forms', 'mailpoet'),
|
87 |
Env::$required_permission,
|
88 |
'mailpoet-forms',
|
89 |
+
array(
|
90 |
+
$this,
|
91 |
+
'forms'
|
92 |
+
)
|
93 |
);
|
94 |
// add limit per page to screen options
|
95 |
+
add_action('load-' . $forms_page, function() {
|
96 |
add_screen_option('per_page', array(
|
97 |
'label' => _x(
|
98 |
'Number of forms per page',
|
108 |
__('Subscribers', 'mailpoet'),
|
109 |
Env::$required_permission,
|
110 |
'mailpoet-subscribers',
|
111 |
+
array(
|
112 |
+
$this,
|
113 |
+
'subscribers'
|
114 |
+
)
|
115 |
);
|
116 |
// add limit per page to screen options
|
117 |
+
add_action('load-' . $subscribers_page, function() {
|
118 |
add_screen_option('per_page', array(
|
119 |
'label' => _x(
|
120 |
'Number of subscribers per page',
|
130 |
__('Lists', 'mailpoet'),
|
131 |
Env::$required_permission,
|
132 |
'mailpoet-segments',
|
133 |
+
array(
|
134 |
+
$this,
|
135 |
+
'segments'
|
136 |
+
)
|
137 |
);
|
138 |
|
139 |
// add limit per page to screen options
|
140 |
+
add_action('load-' . $segments_page, function() {
|
141 |
add_screen_option('per_page', array(
|
142 |
'label' => _x(
|
143 |
'Number of segments per page',
|
149 |
|
150 |
add_submenu_page(
|
151 |
$main_page_slug,
|
152 |
+
$this->setPageTitle(__('Settings', 'mailpoet')),
|
153 |
__('Settings', 'mailpoet'),
|
154 |
Env::$required_permission,
|
155 |
'mailpoet-settings',
|
156 |
+
array(
|
157 |
+
$this,
|
158 |
+
'settings'
|
159 |
+
)
|
160 |
);
|
161 |
add_submenu_page(
|
162 |
'admin.php?page=mailpoet-subscribers',
|
163 |
+
$this->setPageTitle(__('Import', 'mailpoet')),
|
164 |
__('Import', 'mailpoet'),
|
165 |
Env::$required_permission,
|
166 |
'mailpoet-import',
|
167 |
+
array(
|
168 |
+
$this,
|
169 |
+
'import'
|
170 |
+
)
|
171 |
);
|
172 |
|
173 |
add_submenu_page(
|
176 |
__('Export', 'mailpoet'),
|
177 |
Env::$required_permission,
|
178 |
'mailpoet-export',
|
179 |
+
array(
|
180 |
+
$this,
|
181 |
+
'export'
|
182 |
+
)
|
183 |
);
|
184 |
|
185 |
add_submenu_page(
|
188 |
__('Welcome', 'mailpoet'),
|
189 |
Env::$required_permission,
|
190 |
'mailpoet-welcome',
|
191 |
+
array(
|
192 |
+
$this,
|
193 |
+
'welcome'
|
194 |
+
)
|
195 |
);
|
196 |
|
197 |
add_submenu_page(
|
200 |
__('Update', 'mailpoet'),
|
201 |
Env::$required_permission,
|
202 |
'mailpoet-update',
|
203 |
+
array(
|
204 |
+
$this,
|
205 |
+
'update'
|
206 |
+
)
|
207 |
);
|
208 |
|
209 |
add_submenu_page(
|
212 |
__('Form Editor', 'mailpoet'),
|
213 |
Env::$required_permission,
|
214 |
'mailpoet-form-editor',
|
215 |
+
array(
|
216 |
+
$this,
|
217 |
+
'formEditor'
|
218 |
+
)
|
219 |
);
|
220 |
|
221 |
add_submenu_page(
|
224 |
__('Newsletter Editor', 'mailpoet'),
|
225 |
Env::$required_permission,
|
226 |
'mailpoet-newsletter-editor',
|
227 |
+
array(
|
228 |
+
$this,
|
229 |
+
'newletterEditor'
|
230 |
+
)
|
231 |
);
|
232 |
}
|
233 |
|
293 |
}
|
294 |
|
295 |
function settings() {
|
296 |
+
if($this->subscribers_over_limit) return $this->displaySubscriberLimitExceededTemplate();
|
297 |
|
298 |
$settings = Setting::getAll();
|
299 |
$flags = $this->_getFlags();
|
367 |
}
|
368 |
|
369 |
function segments() {
|
370 |
+
if($this->subscribers_over_limit) return $this->displaySubscriberLimitExceededTemplate();
|
371 |
|
372 |
$data = array();
|
373 |
$data['items_per_page'] = $this->getLimitPerPage('segments');
|
375 |
}
|
376 |
|
377 |
function forms() {
|
378 |
+
if($this->subscribers_over_limit) return $this->displaySubscriberLimitExceededTemplate();
|
379 |
|
380 |
$data = array();
|
381 |
|
386 |
}
|
387 |
|
388 |
function newsletters() {
|
389 |
+
if($this->subscribers_over_limit) return $this->displaySubscriberLimitExceededTemplate();
|
390 |
|
391 |
global $wp_roles;
|
392 |
|
489 |
}
|
490 |
|
491 |
$listing_per_page = get_user_meta(
|
492 |
+
get_current_user_id(), 'mailpoet_' . $model . '_per_page', true
|
493 |
);
|
494 |
return (!empty($listing_per_page))
|
495 |
? (int)$listing_per_page
|
499 |
private function displayPage($template, $data) {
|
500 |
try {
|
501 |
echo $this->renderer->render($template, $data);
|
502 |
+
} catch(\Exception $e) {
|
503 |
$notice = new WPNotice(WPNotice::TYPE_ERROR, $e->getMessage());
|
504 |
$notice->displayWPNotice();
|
505 |
}
|
506 |
}
|
507 |
+
|
508 |
+
static function isOnMailPoetAdminPage() {
|
509 |
+
return (!empty($_REQUEST['page']) && stripos($_REQUEST['page'], 'mailpoet-') !== false);
|
510 |
+
}
|
511 |
+
}
|
lib/Form/Renderer.php
CHANGED
@@ -35,7 +35,7 @@ class Renderer {
|
|
35 |
&& strlen(trim($form['styles'])) > 0) {
|
36 |
return strip_tags($form['styles']);
|
37 |
} else {
|
38 |
-
return Util\Styles::$
|
39 |
}
|
40 |
}
|
41 |
|
35 |
&& strlen(trim($form['styles'])) > 0) {
|
36 |
return strip_tags($form['styles']);
|
37 |
} else {
|
38 |
+
return Util\Styles::$default_styles;
|
39 |
}
|
40 |
}
|
41 |
|
lib/Form/Util/Styles.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
namespace MailPoet\Form\Util;
|
3 |
|
4 |
-
|
5 |
-
private $_stylesheet = null;
|
6 |
-
private $_styles = array();
|
7 |
|
8 |
-
|
|
|
|
|
9 |
/* form */
|
10 |
.mailpoet_form {
|
11 |
|
@@ -49,130 +49,25 @@ class Styles {
|
|
49 |
EOL;
|
50 |
|
51 |
function __construct($stylesheet = null) {
|
52 |
-
|
53 |
-
$this->setStylesheet($stylesheet);
|
54 |
-
|
55 |
-
// extract rules/properties
|
56 |
-
$this->parseStyles();
|
57 |
-
|
58 |
-
return $this;
|
59 |
}
|
60 |
|
61 |
function render($prefix = '') {
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
// format selector
|
78 |
-
$output[] = $selector . ' {';
|
79 |
-
|
80 |
-
// format rules
|
81 |
-
if(!empty($style['rules'])) {
|
82 |
-
$rules = join("\n", array_map(function($rule) {
|
83 |
-
return "\t".$rule['property'] . ': ' . $rule['value'].';';
|
84 |
-
}, $style['rules']));
|
85 |
-
|
86 |
-
$output[] = $rules;
|
87 |
-
}
|
88 |
-
|
89 |
-
$output[] = '}';
|
90 |
-
}
|
91 |
-
|
92 |
-
return join("\n", $output);
|
93 |
}
|
|
|
94 |
}
|
95 |
-
|
96 |
-
private function setStylesheet($stylesheet) {
|
97 |
-
$this->_stylesheet = $this->stripComments($stylesheet);
|
98 |
-
return $this;
|
99 |
-
}
|
100 |
-
|
101 |
-
private function stripComments($stylesheet) {
|
102 |
-
// remove comments
|
103 |
-
return preg_replace('!/\*.*?\*/!s', '', $stylesheet);
|
104 |
-
}
|
105 |
-
|
106 |
-
private function getStylesheet() {
|
107 |
-
return $this->_stylesheet;
|
108 |
-
}
|
109 |
-
|
110 |
-
private function setStyles($styles) {
|
111 |
-
$this->_styles = $styles;
|
112 |
-
return $this;
|
113 |
-
}
|
114 |
-
|
115 |
-
private function getStyles() {
|
116 |
-
return $this->_styles;
|
117 |
-
}
|
118 |
-
|
119 |
-
private function parseStyles() {
|
120 |
-
if($this->getStylesheet() !== null) {
|
121 |
-
// extract selectors and rules
|
122 |
-
preg_match_all( '/(?ims)([a-z0-9\s\.\:#_\-@,]+)\{([^\}]*)\}/',
|
123 |
-
$this->getStylesheet(),
|
124 |
-
$matches
|
125 |
-
);
|
126 |
-
$selectors = $matches[1];
|
127 |
-
$rules = $matches[2];
|
128 |
-
|
129 |
-
// extracted styles
|
130 |
-
$styles = array();
|
131 |
-
|
132 |
-
// loop through each selector
|
133 |
-
foreach($selectors as $index => $selector) {
|
134 |
-
// trim selector
|
135 |
-
$selector = trim($selector);
|
136 |
-
// get selector rules
|
137 |
-
$selector_rules = array_filter(array_map(function($value) {
|
138 |
-
if(strlen(trim($value)) > 0) {
|
139 |
-
// split property / value
|
140 |
-
$pair = explode(':', trim($value));
|
141 |
-
if(isset($pair[0]) && isset($pair[1])) {
|
142 |
-
return array(
|
143 |
-
'property' => $pair[0],
|
144 |
-
'value' => $pair[1]
|
145 |
-
);
|
146 |
-
}
|
147 |
-
}
|
148 |
-
}, explode(';', trim($rules[$index]))));
|
149 |
-
|
150 |
-
// check if we have multiple selectors
|
151 |
-
if(strpos($selector, ',') !== false) {
|
152 |
-
$selectors_array = array_filter(array_map(function($value) {
|
153 |
-
return trim($value);
|
154 |
-
}, explode(',', $selector)));
|
155 |
-
|
156 |
-
// multiple selectors
|
157 |
-
$styles[$index] = array(
|
158 |
-
'selector' => $selectors_array,
|
159 |
-
'rules' => $selector_rules
|
160 |
-
);
|
161 |
-
} else {
|
162 |
-
// it's a single selector
|
163 |
-
$styles[$index] = array(
|
164 |
-
'selector' => $selector,
|
165 |
-
'rules' => $selector_rules
|
166 |
-
);
|
167 |
-
}
|
168 |
-
}
|
169 |
-
|
170 |
-
$this->setStyles($styles);
|
171 |
-
}
|
172 |
-
}
|
173 |
-
|
174 |
-
function __toString() {
|
175 |
-
$this->stripComments();
|
176 |
-
return $this->render();
|
177 |
-
}
|
178 |
-
}
|
1 |
<?php
|
2 |
namespace MailPoet\Form\Util;
|
3 |
|
4 |
+
use Sabberworm\CSS\Parser as CSSParser;
|
|
|
|
|
5 |
|
6 |
+
class Styles {
|
7 |
+
public $styles;
|
8 |
+
static $default_styles = <<<EOL
|
9 |
/* form */
|
10 |
.mailpoet_form {
|
11 |
|
49 |
EOL;
|
50 |
|
51 |
function __construct($stylesheet = null) {
|
52 |
+
$this->stylesheet = $stylesheet;
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
|
55 |
function render($prefix = '') {
|
56 |
+
if(!$this->stylesheet) return;
|
57 |
+
$styles = new CSSParser($this->stylesheet);
|
58 |
+
$styles = $styles->parse();
|
59 |
+
$formatted_styles = array();
|
60 |
+
foreach($styles->getAllDeclarationBlocks() as $style_declaration) {
|
61 |
+
$selectors = array_map(function($selector) use ($prefix) {
|
62 |
+
return sprintf('%s %s', $prefix, $selector->__toString());
|
63 |
+
}, $style_declaration->getSelectors());
|
64 |
+
$selectors = implode(', ', $selectors);
|
65 |
+
$rules = array_map(function($rule) {
|
66 |
+
return $rule->__toString();
|
67 |
+
}, $style_declaration->getRules());
|
68 |
+
$rules = sprintf('{ %s }', implode(' ', $rules));
|
69 |
+
$formatted_styles[] = sprintf('%s %s', $selectors, $rules);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
}
|
71 |
+
return implode(PHP_EOL, $formatted_styles);
|
72 |
}
|
73 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Router/Router.php
CHANGED
@@ -37,6 +37,7 @@ class Router {
|
|
37 |
if(!method_exists($endpoint, $this->action) || !in_array($this->action, $endpoint->allowed_actions)) {
|
38 |
return $this->terminateRequest(self::RESPONSE_ERROR, __('Invalid router endpoint action.', 'mailpoet'));
|
39 |
}
|
|
|
40 |
return call_user_func(
|
41 |
array(
|
42 |
$endpoint,
|
37 |
if(!method_exists($endpoint, $this->action) || !in_array($this->action, $endpoint->allowed_actions)) {
|
38 |
return $this->terminateRequest(self::RESPONSE_ERROR, __('Invalid router endpoint action.', 'mailpoet'));
|
39 |
}
|
40 |
+
do_action('mailpoet_conflict_resolver_router_url_query_parameters');
|
41 |
return call_user_func(
|
42 |
array(
|
43 |
$endpoint,
|
lib/Util/ConflictResolver.php
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace MailPoet\Util;
|
3 |
+
|
4 |
+
class ConflictResolver {
|
5 |
+
public $allowed_assets = array(
|
6 |
+
'styles' => array(
|
7 |
+
// WP default
|
8 |
+
'admin-bar',
|
9 |
+
'colors',
|
10 |
+
'ie',
|
11 |
+
'wp-auth-check',
|
12 |
+
// third-party
|
13 |
+
'query-monitor'
|
14 |
+
),
|
15 |
+
'scripts' => array(
|
16 |
+
// WP default
|
17 |
+
'common',
|
18 |
+
'admin-bar',
|
19 |
+
'utils',
|
20 |
+
'svg-painter',
|
21 |
+
'wp-auth-check',
|
22 |
+
// third-party
|
23 |
+
'query-monitor'
|
24 |
+
)
|
25 |
+
);
|
26 |
+
|
27 |
+
function init() {
|
28 |
+
add_action(
|
29 |
+
'mailpoet_conflict_resolver_router_url_query_parameters',
|
30 |
+
array(
|
31 |
+
$this,
|
32 |
+
'resolveRouterUrlQueryParametersConflict'
|
33 |
+
)
|
34 |
+
);
|
35 |
+
add_action(
|
36 |
+
'mailpoet_conflict_resolver_styles',
|
37 |
+
array(
|
38 |
+
$this,
|
39 |
+
'resolveStylesConflict'
|
40 |
+
)
|
41 |
+
);
|
42 |
+
add_action(
|
43 |
+
'mailpoet_conflict_resolver_scripts',
|
44 |
+
array(
|
45 |
+
$this,
|
46 |
+
'resolveScriptsConflict'
|
47 |
+
)
|
48 |
+
);
|
49 |
+
}
|
50 |
+
|
51 |
+
function resolveRouterUrlQueryParametersConflict() {
|
52 |
+
// prevents other plugins from overtaking URL query parameters 'action=' and 'endpoint='
|
53 |
+
unset($_GET['endpoint'], $_GET['action']);
|
54 |
+
}
|
55 |
+
|
56 |
+
function resolveStylesConflict() {
|
57 |
+
// unload all styles except from the list of allowed
|
58 |
+
$dequeue_styles = function() {
|
59 |
+
global $wp_styles;
|
60 |
+
foreach($wp_styles->queue as $wp_style) {
|
61 |
+
if(!in_array($wp_style, $this->allowed_assets['styles'])) {
|
62 |
+
wp_dequeue_style($wp_style);
|
63 |
+
}
|
64 |
+
}
|
65 |
+
};
|
66 |
+
add_action('wp_print_styles', $dequeue_styles);
|
67 |
+
add_action('admin_print_styles', $dequeue_styles);
|
68 |
+
add_action('admin_print_footer_scripts', $dequeue_styles);
|
69 |
+
add_action('admin_footer', $dequeue_styles);
|
70 |
+
}
|
71 |
+
|
72 |
+
function resolveScriptsConflict() {
|
73 |
+
// unload all scripts except from the list of allowed
|
74 |
+
$dequeue_scripts = function() {
|
75 |
+
global $wp_scripts;
|
76 |
+
foreach($wp_scripts->queue as $wp_script) {
|
77 |
+
if(!in_array($wp_script, $this->allowed_assets['scripts'])) {
|
78 |
+
wp_dequeue_script($wp_script);
|
79 |
+
}
|
80 |
+
}
|
81 |
+
};
|
82 |
+
add_action('wp_print_scripts', $dequeue_scripts);
|
83 |
+
add_action('admin_print_footer_scripts', $dequeue_scripts);
|
84 |
+
}
|
85 |
+
}
|
mailpoet.php
CHANGED
@@ -5,7 +5,7 @@ use MailPoet\Config\Initializer;
|
|
5 |
|
6 |
/*
|
7 |
* Plugin Name: MailPoet
|
8 |
-
* Version: 3.0.0-beta.
|
9 |
* Plugin URI: http://www.mailpoet.com
|
10 |
* Description: Create and send beautiful email newsletters, autoresponders, and post notifications without leaving WordPress. This is a beta version of our brand new plugin!
|
11 |
* Author: MailPoet
|
@@ -24,7 +24,7 @@ use MailPoet\Config\Initializer;
|
|
24 |
$mailpoet_loader = dirname(__FILE__) . '/vendor/autoload.php';
|
25 |
if(file_exists($mailpoet_loader)) {
|
26 |
require $mailpoet_loader;
|
27 |
-
define('MAILPOET_VERSION', '3.0.0-beta.
|
28 |
$initializer = new Initializer(
|
29 |
array(
|
30 |
'file' => __FILE__,
|
5 |
|
6 |
/*
|
7 |
* Plugin Name: MailPoet
|
8 |
+
* Version: 3.0.0-beta.13
|
9 |
* Plugin URI: http://www.mailpoet.com
|
10 |
* Description: Create and send beautiful email newsletters, autoresponders, and post notifications without leaving WordPress. This is a beta version of our brand new plugin!
|
11 |
* Author: MailPoet
|
24 |
$mailpoet_loader = dirname(__FILE__) . '/vendor/autoload.php';
|
25 |
if(file_exists($mailpoet_loader)) {
|
26 |
require $mailpoet_loader;
|
27 |
+
define('MAILPOET_VERSION', '3.0.0-beta.13');
|
28 |
$initializer = new Initializer(
|
29 |
array(
|
30 |
'file' => __FILE__,
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: mailpoet, wysija
|
|
3 |
Tags: newsletter, email, welcome email, post notification, autoresponder, mailchimp, signup, smtp
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 4.7
|
6 |
-
Stable tag: 3.0.0-beta.
|
7 |
Create and send beautiful emails and newsletters from WordPress.
|
8 |
|
9 |
== Description ==
|
@@ -83,12 +83,19 @@ Our [support site](https://docs.mailpoet.com/) has plenty of articles. You can w
|
|
83 |
|
84 |
== Changelog ==
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
= 3.0.0-beta.12 - 2017-01-10 =
|
87 |
* Improved: faster load times of Emails page with large database;
|
88 |
* Improved: sender header is now set for SMTP/PHPMail method to work with MS Exchange. Thx Karsten!;
|
89 |
* Improved: better asset conflict management with other plugins;
|
90 |
* Fixed: newly published custom post types are now sent. Thx Jim!;
|
91 |
-
* Fixed: post notifications now
|
92 |
* Fixed: shortcode "date:dtext" displays full name (e.g., Sunday) instead of abbreviated (e.g., Sun);
|
93 |
* Fixed: hide mailer error on send previews. Thx Karsten again!;
|
94 |
* Fixed: various minor issues.
|
3 |
Tags: newsletter, email, welcome email, post notification, autoresponder, mailchimp, signup, smtp
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 4.7
|
6 |
+
Stable tag: 3.0.0-beta.13
|
7 |
Create and send beautiful emails and newsletters from WordPress.
|
8 |
|
9 |
== Description ==
|
83 |
|
84 |
== Changelog ==
|
85 |
|
86 |
+
= 3.0.0-beta.13 - 2017-01-17 =
|
87 |
+
* Improved: style/script conflicts on MailPoet pages are now resolved by unloading non-default assets. Thx Michel for reporting one such case!;
|
88 |
+
* Fixed: MySQL wait_timeout of less than 20 seconds results in errors when sending. Thx Tim!;
|
89 |
+
* Fixed: unsubscribe URL doesn't work when BuddyPress is enabled;
|
90 |
+
* Fixed: some form styles aren't saved. Thanks Pete!;
|
91 |
+
* Fixed: typo in subscription management shortcode instructions. Thx Tim once more!
|
92 |
+
|
93 |
= 3.0.0-beta.12 - 2017-01-10 =
|
94 |
* Improved: faster load times of Emails page with large database;
|
95 |
* Improved: sender header is now set for SMTP/PHPMail method to work with MS Exchange. Thx Karsten!;
|
96 |
* Improved: better asset conflict management with other plugins;
|
97 |
* Fixed: newly published custom post types are now sent. Thx Jim!;
|
98 |
+
* Fixed: post notifications now sent when ALC block is configured to display titles only. Thx Pete;
|
99 |
* Fixed: shortcode "date:dtext" displays full name (e.g., Sunday) instead of abbreviated (e.g., Sun);
|
100 |
* Fixed: hide mailer error on send previews. Thx Karsten again!;
|
101 |
* Fixed: various minor issues.
|
vendor/autoload.php
CHANGED
@@ -2,6 +2,6 @@
|
|
2 |
|
3 |
// autoload.php @generated by Composer
|
4 |
|
5 |
-
require_once __DIR__ . '/composer
|
6 |
|
7 |
-
return
|
2 |
|
3 |
// autoload.php @generated by Composer
|
4 |
|
5 |
+
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit2344798a24c3433a0a523c6adee5b65d::getLoader();
|
vendor/composer/ClassLoader.php
CHANGED
@@ -53,8 +53,8 @@ class ClassLoader
|
|
53 |
|
54 |
private $useIncludePath = false;
|
55 |
private $classMap = array();
|
56 |
-
|
57 |
private $classMapAuthoritative = false;
|
|
|
58 |
|
59 |
public function getPrefixes()
|
60 |
{
|
@@ -322,20 +322,20 @@ class ClassLoader
|
|
322 |
if (isset($this->classMap[$class])) {
|
323 |
return $this->classMap[$class];
|
324 |
}
|
325 |
-
if ($this->classMapAuthoritative) {
|
326 |
return false;
|
327 |
}
|
328 |
|
329 |
$file = $this->findFileWithExtension($class, '.php');
|
330 |
|
331 |
// Search for Hack files if we are running on HHVM
|
332 |
-
if (
|
333 |
$file = $this->findFileWithExtension($class, '.hh');
|
334 |
}
|
335 |
|
336 |
-
if (
|
337 |
// Remember that this class does not exist.
|
338 |
-
|
339 |
}
|
340 |
|
341 |
return $file;
|
@@ -399,6 +399,8 @@ class ClassLoader
|
|
399 |
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
400 |
return $file;
|
401 |
}
|
|
|
|
|
402 |
}
|
403 |
}
|
404 |
|
53 |
|
54 |
private $useIncludePath = false;
|
55 |
private $classMap = array();
|
|
|
56 |
private $classMapAuthoritative = false;
|
57 |
+
private $missingClasses = array();
|
58 |
|
59 |
public function getPrefixes()
|
60 |
{
|
322 |
if (isset($this->classMap[$class])) {
|
323 |
return $this->classMap[$class];
|
324 |
}
|
325 |
+
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
326 |
return false;
|
327 |
}
|
328 |
|
329 |
$file = $this->findFileWithExtension($class, '.php');
|
330 |
|
331 |
// Search for Hack files if we are running on HHVM
|
332 |
+
if (false === $file && defined('HHVM_VERSION')) {
|
333 |
$file = $this->findFileWithExtension($class, '.hh');
|
334 |
}
|
335 |
|
336 |
+
if (false === $file) {
|
337 |
// Remember that this class does not exist.
|
338 |
+
$this->missingClasses[$class] = true;
|
339 |
}
|
340 |
|
341 |
return $file;
|
399 |
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
400 |
return $file;
|
401 |
}
|
402 |
+
|
403 |
+
return false;
|
404 |
}
|
405 |
}
|
406 |
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -47,6 +47,7 @@ return array(
|
|
47 |
'MailPoet\\Config\\Activator' => $baseDir . '/lib/Config/Activator.php',
|
48 |
'MailPoet\\Config\\Analytics' => $baseDir . '/lib/Config/Analytics.php',
|
49 |
'MailPoet\\Config\\Changelog' => $baseDir . '/lib/Config/Changelog.php',
|
|
|
50 |
'MailPoet\\Config\\Env' => $baseDir . '/lib/Config/Env.php',
|
51 |
'MailPoet\\Config\\Hooks' => $baseDir . '/lib/Config/Hooks.php',
|
52 |
'MailPoet\\Config\\Initializer' => $baseDir . '/lib/Config/Initializer.php',
|
@@ -191,6 +192,7 @@ return array(
|
|
191 |
'MailPoet\\Twig\\Helpscout' => $baseDir . '/lib/Twig/Helpscout.php',
|
192 |
'MailPoet\\Twig\\I18n' => $baseDir . '/lib/Twig/I18n.php',
|
193 |
'MailPoet\\Util\\CSS' => $baseDir . '/lib/Util/CSS.php',
|
|
|
194 |
'MailPoet\\Util\\Helpers' => $baseDir . '/lib/Util/Helpers.php',
|
195 |
'MailPoet\\Util\\License\\Features\\Subscribers' => $baseDir . '/lib/Util/License/Features/Subscribers.php',
|
196 |
'MailPoet\\Util\\License\\License' => $baseDir . '/lib/Util/License/License.php',
|
@@ -205,6 +207,39 @@ return array(
|
|
205 |
'ORM' => $vendorDir . '/j4mie/idiorm/idiorm.php',
|
206 |
'ORMWrapper' => $vendorDir . '/j4mie/paris/paris.php',
|
207 |
'ParisMethodMissingException' => $vendorDir . '/j4mie/paris/paris.php',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
'Sudzy\\Engine' => $baseDir . '/lib/Util/Sudzy/Engine.php',
|
209 |
'Sudzy\\ValidModel' => $baseDir . '/lib/Util/Sudzy/ValidModel.php',
|
210 |
'Sudzy\\ValidationException' => $baseDir . '/lib/Util/Sudzy/ValidationException.php',
|
@@ -288,6 +323,7 @@ return array(
|
|
288 |
'Twig_Extension_Sandbox' => $vendorDir . '/twig/twig/lib/Twig/Extension/Sandbox.php',
|
289 |
'Twig_Extension_Staging' => $vendorDir . '/twig/twig/lib/Twig/Extension/Staging.php',
|
290 |
'Twig_Extension_StringLoader' => $vendorDir . '/twig/twig/lib/Twig/Extension/StringLoader.php',
|
|
|
291 |
'Twig_FileExtensionEscapingStrategy' => $vendorDir . '/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php',
|
292 |
'Twig_Filter' => $vendorDir . '/twig/twig/lib/Twig/Filter.php',
|
293 |
'Twig_FilterCallableInterface' => $vendorDir . '/twig/twig/lib/Twig/FilterCallableInterface.php',
|
@@ -310,6 +346,7 @@ return array(
|
|
310 |
'Twig_Loader_String' => $vendorDir . '/twig/twig/lib/Twig/Loader/String.php',
|
311 |
'Twig_Markup' => $vendorDir . '/twig/twig/lib/Twig/Markup.php',
|
312 |
'Twig_Node' => $vendorDir . '/twig/twig/lib/Twig/Node.php',
|
|
|
313 |
'Twig_NodeInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeInterface.php',
|
314 |
'Twig_NodeOutputInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeOutputInterface.php',
|
315 |
'Twig_NodeTraverser' => $vendorDir . '/twig/twig/lib/Twig/NodeTraverser.php',
|
@@ -395,6 +432,7 @@ return array(
|
|
395 |
'Twig_Node_SetTemp' => $vendorDir . '/twig/twig/lib/Twig/Node/SetTemp.php',
|
396 |
'Twig_Node_Spaceless' => $vendorDir . '/twig/twig/lib/Twig/Node/Spaceless.php',
|
397 |
'Twig_Node_Text' => $vendorDir . '/twig/twig/lib/Twig/Node/Text.php',
|
|
|
398 |
'Twig_Parser' => $vendorDir . '/twig/twig/lib/Twig/Parser.php',
|
399 |
'Twig_ParserInterface' => $vendorDir . '/twig/twig/lib/Twig/ParserInterface.php',
|
400 |
'Twig_Profiler_Dumper_Blackfire' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php',
|
@@ -420,6 +458,7 @@ return array(
|
|
420 |
'Twig_SourceContextLoaderInterface' => $vendorDir . '/twig/twig/lib/Twig/SourceContextLoaderInterface.php',
|
421 |
'Twig_Template' => $vendorDir . '/twig/twig/lib/Twig/Template.php',
|
422 |
'Twig_TemplateInterface' => $vendorDir . '/twig/twig/lib/Twig/TemplateInterface.php',
|
|
|
423 |
'Twig_Test' => $vendorDir . '/twig/twig/lib/Twig/Test.php',
|
424 |
'Twig_TestCallableInterface' => $vendorDir . '/twig/twig/lib/Twig/TestCallableInterface.php',
|
425 |
'Twig_TestInterface' => $vendorDir . '/twig/twig/lib/Twig/TestInterface.php',
|
@@ -450,6 +489,7 @@ return array(
|
|
450 |
'Twig_TokenParser_Set' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Set.php',
|
451 |
'Twig_TokenParser_Spaceless' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Spaceless.php',
|
452 |
'Twig_TokenParser_Use' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Use.php',
|
|
|
453 |
'Twig_TokenStream' => $vendorDir . '/twig/twig/lib/Twig/TokenStream.php',
|
454 |
'Twig_Util_DeprecationCollector' => $vendorDir . '/twig/twig/lib/Twig/Util/DeprecationCollector.php',
|
455 |
'Twig_Util_TemplateDirIterator' => $vendorDir . '/twig/twig/lib/Twig/Util/TemplateDirIterator.php',
|
47 |
'MailPoet\\Config\\Activator' => $baseDir . '/lib/Config/Activator.php',
|
48 |
'MailPoet\\Config\\Analytics' => $baseDir . '/lib/Config/Analytics.php',
|
49 |
'MailPoet\\Config\\Changelog' => $baseDir . '/lib/Config/Changelog.php',
|
50 |
+
'MailPoet\\Config\\Database' => $baseDir . '/lib/Config/Database.php',
|
51 |
'MailPoet\\Config\\Env' => $baseDir . '/lib/Config/Env.php',
|
52 |
'MailPoet\\Config\\Hooks' => $baseDir . '/lib/Config/Hooks.php',
|
53 |
'MailPoet\\Config\\Initializer' => $baseDir . '/lib/Config/Initializer.php',
|
192 |
'MailPoet\\Twig\\Helpscout' => $baseDir . '/lib/Twig/Helpscout.php',
|
193 |
'MailPoet\\Twig\\I18n' => $baseDir . '/lib/Twig/I18n.php',
|
194 |
'MailPoet\\Util\\CSS' => $baseDir . '/lib/Util/CSS.php',
|
195 |
+
'MailPoet\\Util\\ConflictResolver' => $baseDir . '/lib/Util/ConflictResolver.php',
|
196 |
'MailPoet\\Util\\Helpers' => $baseDir . '/lib/Util/Helpers.php',
|
197 |
'MailPoet\\Util\\License\\Features\\Subscribers' => $baseDir . '/lib/Util/License/Features/Subscribers.php',
|
198 |
'MailPoet\\Util\\License\\License' => $baseDir . '/lib/Util/License/License.php',
|
207 |
'ORM' => $vendorDir . '/j4mie/idiorm/idiorm.php',
|
208 |
'ORMWrapper' => $vendorDir . '/j4mie/paris/paris.php',
|
209 |
'ParisMethodMissingException' => $vendorDir . '/j4mie/paris/paris.php',
|
210 |
+
'Sabberworm\\CSS\\CSSList\\AtRuleBlockList' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/AtRuleBlockList.php',
|
211 |
+
'Sabberworm\\CSS\\CSSList\\CSSBlockList' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/CSSBlockList.php',
|
212 |
+
'Sabberworm\\CSS\\CSSList\\CSSList' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/CSSList.php',
|
213 |
+
'Sabberworm\\CSS\\CSSList\\Document' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/Document.php',
|
214 |
+
'Sabberworm\\CSS\\CSSList\\KeyFrame' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/KeyFrame.php',
|
215 |
+
'Sabberworm\\CSS\\Comment\\Comment' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Comment/Comment.php',
|
216 |
+
'Sabberworm\\CSS\\Comment\\Commentable' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Comment/Commentable.php',
|
217 |
+
'Sabberworm\\CSS\\OutputFormat' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/OutputFormat.php',
|
218 |
+
'Sabberworm\\CSS\\OutputFormatter' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/OutputFormat.php',
|
219 |
+
'Sabberworm\\CSS\\Parser' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parser.php',
|
220 |
+
'Sabberworm\\CSS\\Parsing\\OutputException' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/OutputException.php',
|
221 |
+
'Sabberworm\\CSS\\Parsing\\SourceException' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/SourceException.php',
|
222 |
+
'Sabberworm\\CSS\\Parsing\\UnexpectedTokenException' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/UnexpectedTokenException.php',
|
223 |
+
'Sabberworm\\CSS\\Property\\AtRule' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/AtRule.php',
|
224 |
+
'Sabberworm\\CSS\\Property\\CSSNamespace' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/CSSNamespace.php',
|
225 |
+
'Sabberworm\\CSS\\Property\\Charset' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Charset.php',
|
226 |
+
'Sabberworm\\CSS\\Property\\Import' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Import.php',
|
227 |
+
'Sabberworm\\CSS\\Property\\Selector' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Selector.php',
|
228 |
+
'Sabberworm\\CSS\\Renderable' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Renderable.php',
|
229 |
+
'Sabberworm\\CSS\\RuleSet\\AtRuleSet' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/AtRuleSet.php',
|
230 |
+
'Sabberworm\\CSS\\RuleSet\\DeclarationBlock' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/DeclarationBlock.php',
|
231 |
+
'Sabberworm\\CSS\\RuleSet\\RuleSet' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/RuleSet.php',
|
232 |
+
'Sabberworm\\CSS\\Rule\\Rule' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Rule/Rule.php',
|
233 |
+
'Sabberworm\\CSS\\Settings' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Settings.php',
|
234 |
+
'Sabberworm\\CSS\\Value\\CSSFunction' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CSSFunction.php',
|
235 |
+
'Sabberworm\\CSS\\Value\\CSSString' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CSSString.php',
|
236 |
+
'Sabberworm\\CSS\\Value\\Color' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Color.php',
|
237 |
+
'Sabberworm\\CSS\\Value\\PrimitiveValue' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/PrimitiveValue.php',
|
238 |
+
'Sabberworm\\CSS\\Value\\RuleValueList' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/RuleValueList.php',
|
239 |
+
'Sabberworm\\CSS\\Value\\Size' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Size.php',
|
240 |
+
'Sabberworm\\CSS\\Value\\URL' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/URL.php',
|
241 |
+
'Sabberworm\\CSS\\Value\\Value' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Value.php',
|
242 |
+
'Sabberworm\\CSS\\Value\\ValueList' => $vendorDir . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/ValueList.php',
|
243 |
'Sudzy\\Engine' => $baseDir . '/lib/Util/Sudzy/Engine.php',
|
244 |
'Sudzy\\ValidModel' => $baseDir . '/lib/Util/Sudzy/ValidModel.php',
|
245 |
'Sudzy\\ValidationException' => $baseDir . '/lib/Util/Sudzy/ValidationException.php',
|
323 |
'Twig_Extension_Sandbox' => $vendorDir . '/twig/twig/lib/Twig/Extension/Sandbox.php',
|
324 |
'Twig_Extension_Staging' => $vendorDir . '/twig/twig/lib/Twig/Extension/Staging.php',
|
325 |
'Twig_Extension_StringLoader' => $vendorDir . '/twig/twig/lib/Twig/Extension/StringLoader.php',
|
326 |
+
'Twig_FactoryRuntimeLoader' => $vendorDir . '/twig/twig/lib/Twig/FactoryRuntimeLoader.php',
|
327 |
'Twig_FileExtensionEscapingStrategy' => $vendorDir . '/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php',
|
328 |
'Twig_Filter' => $vendorDir . '/twig/twig/lib/Twig/Filter.php',
|
329 |
'Twig_FilterCallableInterface' => $vendorDir . '/twig/twig/lib/Twig/FilterCallableInterface.php',
|
346 |
'Twig_Loader_String' => $vendorDir . '/twig/twig/lib/Twig/Loader/String.php',
|
347 |
'Twig_Markup' => $vendorDir . '/twig/twig/lib/Twig/Markup.php',
|
348 |
'Twig_Node' => $vendorDir . '/twig/twig/lib/Twig/Node.php',
|
349 |
+
'Twig_NodeCaptureInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeCaptureInterface.php',
|
350 |
'Twig_NodeInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeInterface.php',
|
351 |
'Twig_NodeOutputInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeOutputInterface.php',
|
352 |
'Twig_NodeTraverser' => $vendorDir . '/twig/twig/lib/Twig/NodeTraverser.php',
|
432 |
'Twig_Node_SetTemp' => $vendorDir . '/twig/twig/lib/Twig/Node/SetTemp.php',
|
433 |
'Twig_Node_Spaceless' => $vendorDir . '/twig/twig/lib/Twig/Node/Spaceless.php',
|
434 |
'Twig_Node_Text' => $vendorDir . '/twig/twig/lib/Twig/Node/Text.php',
|
435 |
+
'Twig_Node_With' => $vendorDir . '/twig/twig/lib/Twig/Node/With.php',
|
436 |
'Twig_Parser' => $vendorDir . '/twig/twig/lib/Twig/Parser.php',
|
437 |
'Twig_ParserInterface' => $vendorDir . '/twig/twig/lib/Twig/ParserInterface.php',
|
438 |
'Twig_Profiler_Dumper_Blackfire' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php',
|
458 |
'Twig_SourceContextLoaderInterface' => $vendorDir . '/twig/twig/lib/Twig/SourceContextLoaderInterface.php',
|
459 |
'Twig_Template' => $vendorDir . '/twig/twig/lib/Twig/Template.php',
|
460 |
'Twig_TemplateInterface' => $vendorDir . '/twig/twig/lib/Twig/TemplateInterface.php',
|
461 |
+
'Twig_TemplateWrapper' => $vendorDir . '/twig/twig/lib/Twig/TemplateWrapper.php',
|
462 |
'Twig_Test' => $vendorDir . '/twig/twig/lib/Twig/Test.php',
|
463 |
'Twig_TestCallableInterface' => $vendorDir . '/twig/twig/lib/Twig/TestCallableInterface.php',
|
464 |
'Twig_TestInterface' => $vendorDir . '/twig/twig/lib/Twig/TestInterface.php',
|
489 |
'Twig_TokenParser_Set' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Set.php',
|
490 |
'Twig_TokenParser_Spaceless' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Spaceless.php',
|
491 |
'Twig_TokenParser_Use' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Use.php',
|
492 |
+
'Twig_TokenParser_With' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/With.php',
|
493 |
'Twig_TokenStream' => $vendorDir . '/twig/twig/lib/Twig/TokenStream.php',
|
494 |
'Twig_Util_DeprecationCollector' => $vendorDir . '/twig/twig/lib/Twig/Util/DeprecationCollector.php',
|
495 |
'Twig_Util_TemplateDirIterator' => $vendorDir . '/twig/twig/lib/Twig/Util/TemplateDirIterator.php',
|
vendor/composer/autoload_namespaces.php
CHANGED
@@ -7,5 +7,6 @@ $baseDir = dirname($vendorDir);
|
|
7 |
|
8 |
return array(
|
9 |
'Twig_' => array($vendorDir . '/twig/twig/lib'),
|
|
|
10 |
'Cron' => array($vendorDir . '/mtdowling/cron-expression/src'),
|
11 |
);
|
7 |
|
8 |
return array(
|
9 |
'Twig_' => array($vendorDir . '/twig/twig/lib'),
|
10 |
+
'Sabberworm\\CSS' => array($vendorDir . '/sabberworm/php-css-parser/lib'),
|
11 |
'Cron' => array($vendorDir . '/mtdowling/cron-expression/src'),
|
12 |
);
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit2eacd2eb1637501d63079c44ce235c23
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
-
call_user_func(\Composer\Autoload\
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
@@ -48,19 +48,19 @@ class ComposerAutoloaderInit2eacd2eb1637501d63079c44ce235c23
|
|
48 |
$loader->register(true);
|
49 |
|
50 |
if ($useStaticLoader) {
|
51 |
-
$includeFiles = Composer\Autoload\
|
52 |
} else {
|
53 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
54 |
}
|
55 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
56 |
-
|
57 |
}
|
58 |
|
59 |
return $loader;
|
60 |
}
|
61 |
}
|
62 |
|
63 |
-
function
|
64 |
{
|
65 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
66 |
require $file;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit2344798a24c3433a0a523c6adee5b65d
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit2344798a24c3433a0a523c6adee5b65d', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit2344798a24c3433a0a523c6adee5b65d', 'loadClassLoader'));
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit2344798a24c3433a0a523c6adee5b65d::getInitializer($loader));
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
48 |
$loader->register(true);
|
49 |
|
50 |
if ($useStaticLoader) {
|
51 |
+
$includeFiles = Composer\Autoload\ComposerStaticInit2344798a24c3433a0a523c6adee5b65d::$files;
|
52 |
} else {
|
53 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
54 |
}
|
55 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
56 |
+
composerRequire2344798a24c3433a0a523c6adee5b65d($fileIdentifier, $file);
|
57 |
}
|
58 |
|
59 |
return $loader;
|
60 |
}
|
61 |
}
|
62 |
|
63 |
+
function composerRequire2344798a24c3433a0a523c6adee5b65d($fileIdentifier, $file)
|
64 |
{
|
65 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
66 |
require $file;
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
@@ -67,6 +67,13 @@ class ComposerStaticInit2eacd2eb1637501d63079c44ce235c23
|
|
67 |
0 => __DIR__ . '/..' . '/twig/twig/lib',
|
68 |
),
|
69 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
'C' =>
|
71 |
array (
|
72 |
'Cron' =>
|
@@ -118,6 +125,7 @@ class ComposerStaticInit2eacd2eb1637501d63079c44ce235c23
|
|
118 |
'MailPoet\\Config\\Activator' => __DIR__ . '/../..' . '/lib/Config/Activator.php',
|
119 |
'MailPoet\\Config\\Analytics' => __DIR__ . '/../..' . '/lib/Config/Analytics.php',
|
120 |
'MailPoet\\Config\\Changelog' => __DIR__ . '/../..' . '/lib/Config/Changelog.php',
|
|
|
121 |
'MailPoet\\Config\\Env' => __DIR__ . '/../..' . '/lib/Config/Env.php',
|
122 |
'MailPoet\\Config\\Hooks' => __DIR__ . '/../..' . '/lib/Config/Hooks.php',
|
123 |
'MailPoet\\Config\\Initializer' => __DIR__ . '/../..' . '/lib/Config/Initializer.php',
|
@@ -262,6 +270,7 @@ class ComposerStaticInit2eacd2eb1637501d63079c44ce235c23
|
|
262 |
'MailPoet\\Twig\\Helpscout' => __DIR__ . '/../..' . '/lib/Twig/Helpscout.php',
|
263 |
'MailPoet\\Twig\\I18n' => __DIR__ . '/../..' . '/lib/Twig/I18n.php',
|
264 |
'MailPoet\\Util\\CSS' => __DIR__ . '/../..' . '/lib/Util/CSS.php',
|
|
|
265 |
'MailPoet\\Util\\Helpers' => __DIR__ . '/../..' . '/lib/Util/Helpers.php',
|
266 |
'MailPoet\\Util\\License\\Features\\Subscribers' => __DIR__ . '/../..' . '/lib/Util/License/Features/Subscribers.php',
|
267 |
'MailPoet\\Util\\License\\License' => __DIR__ . '/../..' . '/lib/Util/License/License.php',
|
@@ -276,6 +285,39 @@ class ComposerStaticInit2eacd2eb1637501d63079c44ce235c23
|
|
276 |
'ORM' => __DIR__ . '/..' . '/j4mie/idiorm/idiorm.php',
|
277 |
'ORMWrapper' => __DIR__ . '/..' . '/j4mie/paris/paris.php',
|
278 |
'ParisMethodMissingException' => __DIR__ . '/..' . '/j4mie/paris/paris.php',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
'Sudzy\\Engine' => __DIR__ . '/../..' . '/lib/Util/Sudzy/Engine.php',
|
280 |
'Sudzy\\ValidModel' => __DIR__ . '/../..' . '/lib/Util/Sudzy/ValidModel.php',
|
281 |
'Sudzy\\ValidationException' => __DIR__ . '/../..' . '/lib/Util/Sudzy/ValidationException.php',
|
@@ -359,6 +401,7 @@ class ComposerStaticInit2eacd2eb1637501d63079c44ce235c23
|
|
359 |
'Twig_Extension_Sandbox' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Sandbox.php',
|
360 |
'Twig_Extension_Staging' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Staging.php',
|
361 |
'Twig_Extension_StringLoader' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/StringLoader.php',
|
|
|
362 |
'Twig_FileExtensionEscapingStrategy' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php',
|
363 |
'Twig_Filter' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Filter.php',
|
364 |
'Twig_FilterCallableInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FilterCallableInterface.php',
|
@@ -381,6 +424,7 @@ class ComposerStaticInit2eacd2eb1637501d63079c44ce235c23
|
|
381 |
'Twig_Loader_String' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Loader/String.php',
|
382 |
'Twig_Markup' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Markup.php',
|
383 |
'Twig_Node' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node.php',
|
|
|
384 |
'Twig_NodeInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeInterface.php',
|
385 |
'Twig_NodeOutputInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeOutputInterface.php',
|
386 |
'Twig_NodeTraverser' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeTraverser.php',
|
@@ -466,6 +510,7 @@ class ComposerStaticInit2eacd2eb1637501d63079c44ce235c23
|
|
466 |
'Twig_Node_SetTemp' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/SetTemp.php',
|
467 |
'Twig_Node_Spaceless' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Spaceless.php',
|
468 |
'Twig_Node_Text' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Text.php',
|
|
|
469 |
'Twig_Parser' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Parser.php',
|
470 |
'Twig_ParserInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/ParserInterface.php',
|
471 |
'Twig_Profiler_Dumper_Blackfire' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php',
|
@@ -491,6 +536,7 @@ class ComposerStaticInit2eacd2eb1637501d63079c44ce235c23
|
|
491 |
'Twig_SourceContextLoaderInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/SourceContextLoaderInterface.php',
|
492 |
'Twig_Template' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Template.php',
|
493 |
'Twig_TemplateInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TemplateInterface.php',
|
|
|
494 |
'Twig_Test' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test.php',
|
495 |
'Twig_TestCallableInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TestCallableInterface.php',
|
496 |
'Twig_TestInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TestInterface.php',
|
@@ -521,6 +567,7 @@ class ComposerStaticInit2eacd2eb1637501d63079c44ce235c23
|
|
521 |
'Twig_TokenParser_Set' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Set.php',
|
522 |
'Twig_TokenParser_Spaceless' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Spaceless.php',
|
523 |
'Twig_TokenParser_Use' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Use.php',
|
|
|
524 |
'Twig_TokenStream' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenStream.php',
|
525 |
'Twig_Util_DeprecationCollector' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Util/DeprecationCollector.php',
|
526 |
'Twig_Util_TemplateDirIterator' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Util/TemplateDirIterator.php',
|
@@ -555,10 +602,10 @@ class ComposerStaticInit2eacd2eb1637501d63079c44ce235c23
|
|
555 |
public static function getInitializer(ClassLoader $loader)
|
556 |
{
|
557 |
return \Closure::bind(function () use ($loader) {
|
558 |
-
$loader->prefixLengthsPsr4 =
|
559 |
-
$loader->prefixDirsPsr4 =
|
560 |
-
$loader->prefixesPsr0 =
|
561 |
-
$loader->classMap =
|
562 |
|
563 |
}, null, ClassLoader::class);
|
564 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit2344798a24c3433a0a523c6adee5b65d
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
67 |
0 => __DIR__ . '/..' . '/twig/twig/lib',
|
68 |
),
|
69 |
),
|
70 |
+
'S' =>
|
71 |
+
array (
|
72 |
+
'Sabberworm\\CSS' =>
|
73 |
+
array (
|
74 |
+
0 => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib',
|
75 |
+
),
|
76 |
+
),
|
77 |
'C' =>
|
78 |
array (
|
79 |
'Cron' =>
|
125 |
'MailPoet\\Config\\Activator' => __DIR__ . '/../..' . '/lib/Config/Activator.php',
|
126 |
'MailPoet\\Config\\Analytics' => __DIR__ . '/../..' . '/lib/Config/Analytics.php',
|
127 |
'MailPoet\\Config\\Changelog' => __DIR__ . '/../..' . '/lib/Config/Changelog.php',
|
128 |
+
'MailPoet\\Config\\Database' => __DIR__ . '/../..' . '/lib/Config/Database.php',
|
129 |
'MailPoet\\Config\\Env' => __DIR__ . '/../..' . '/lib/Config/Env.php',
|
130 |
'MailPoet\\Config\\Hooks' => __DIR__ . '/../..' . '/lib/Config/Hooks.php',
|
131 |
'MailPoet\\Config\\Initializer' => __DIR__ . '/../..' . '/lib/Config/Initializer.php',
|
270 |
'MailPoet\\Twig\\Helpscout' => __DIR__ . '/../..' . '/lib/Twig/Helpscout.php',
|
271 |
'MailPoet\\Twig\\I18n' => __DIR__ . '/../..' . '/lib/Twig/I18n.php',
|
272 |
'MailPoet\\Util\\CSS' => __DIR__ . '/../..' . '/lib/Util/CSS.php',
|
273 |
+
'MailPoet\\Util\\ConflictResolver' => __DIR__ . '/../..' . '/lib/Util/ConflictResolver.php',
|
274 |
'MailPoet\\Util\\Helpers' => __DIR__ . '/../..' . '/lib/Util/Helpers.php',
|
275 |
'MailPoet\\Util\\License\\Features\\Subscribers' => __DIR__ . '/../..' . '/lib/Util/License/Features/Subscribers.php',
|
276 |
'MailPoet\\Util\\License\\License' => __DIR__ . '/../..' . '/lib/Util/License/License.php',
|
285 |
'ORM' => __DIR__ . '/..' . '/j4mie/idiorm/idiorm.php',
|
286 |
'ORMWrapper' => __DIR__ . '/..' . '/j4mie/paris/paris.php',
|
287 |
'ParisMethodMissingException' => __DIR__ . '/..' . '/j4mie/paris/paris.php',
|
288 |
+
'Sabberworm\\CSS\\CSSList\\AtRuleBlockList' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/AtRuleBlockList.php',
|
289 |
+
'Sabberworm\\CSS\\CSSList\\CSSBlockList' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/CSSBlockList.php',
|
290 |
+
'Sabberworm\\CSS\\CSSList\\CSSList' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/CSSList.php',
|
291 |
+
'Sabberworm\\CSS\\CSSList\\Document' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/Document.php',
|
292 |
+
'Sabberworm\\CSS\\CSSList\\KeyFrame' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/KeyFrame.php',
|
293 |
+
'Sabberworm\\CSS\\Comment\\Comment' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Comment/Comment.php',
|
294 |
+
'Sabberworm\\CSS\\Comment\\Commentable' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Comment/Commentable.php',
|
295 |
+
'Sabberworm\\CSS\\OutputFormat' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/OutputFormat.php',
|
296 |
+
'Sabberworm\\CSS\\OutputFormatter' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/OutputFormat.php',
|
297 |
+
'Sabberworm\\CSS\\Parser' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parser.php',
|
298 |
+
'Sabberworm\\CSS\\Parsing\\OutputException' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/OutputException.php',
|
299 |
+
'Sabberworm\\CSS\\Parsing\\SourceException' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/SourceException.php',
|
300 |
+
'Sabberworm\\CSS\\Parsing\\UnexpectedTokenException' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/UnexpectedTokenException.php',
|
301 |
+
'Sabberworm\\CSS\\Property\\AtRule' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/AtRule.php',
|
302 |
+
'Sabberworm\\CSS\\Property\\CSSNamespace' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/CSSNamespace.php',
|
303 |
+
'Sabberworm\\CSS\\Property\\Charset' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Charset.php',
|
304 |
+
'Sabberworm\\CSS\\Property\\Import' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Import.php',
|
305 |
+
'Sabberworm\\CSS\\Property\\Selector' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Selector.php',
|
306 |
+
'Sabberworm\\CSS\\Renderable' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Renderable.php',
|
307 |
+
'Sabberworm\\CSS\\RuleSet\\AtRuleSet' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/AtRuleSet.php',
|
308 |
+
'Sabberworm\\CSS\\RuleSet\\DeclarationBlock' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/DeclarationBlock.php',
|
309 |
+
'Sabberworm\\CSS\\RuleSet\\RuleSet' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/RuleSet.php',
|
310 |
+
'Sabberworm\\CSS\\Rule\\Rule' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Rule/Rule.php',
|
311 |
+
'Sabberworm\\CSS\\Settings' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Settings.php',
|
312 |
+
'Sabberworm\\CSS\\Value\\CSSFunction' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CSSFunction.php',
|
313 |
+
'Sabberworm\\CSS\\Value\\CSSString' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CSSString.php',
|
314 |
+
'Sabberworm\\CSS\\Value\\Color' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Color.php',
|
315 |
+
'Sabberworm\\CSS\\Value\\PrimitiveValue' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/PrimitiveValue.php',
|
316 |
+
'Sabberworm\\CSS\\Value\\RuleValueList' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/RuleValueList.php',
|
317 |
+
'Sabberworm\\CSS\\Value\\Size' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Size.php',
|
318 |
+
'Sabberworm\\CSS\\Value\\URL' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/URL.php',
|
319 |
+
'Sabberworm\\CSS\\Value\\Value' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Value.php',
|
320 |
+
'Sabberworm\\CSS\\Value\\ValueList' => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/ValueList.php',
|
321 |
'Sudzy\\Engine' => __DIR__ . '/../..' . '/lib/Util/Sudzy/Engine.php',
|
322 |
'Sudzy\\ValidModel' => __DIR__ . '/../..' . '/lib/Util/Sudzy/ValidModel.php',
|
323 |
'Sudzy\\ValidationException' => __DIR__ . '/../..' . '/lib/Util/Sudzy/ValidationException.php',
|
401 |
'Twig_Extension_Sandbox' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Sandbox.php',
|
402 |
'Twig_Extension_Staging' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Staging.php',
|
403 |
'Twig_Extension_StringLoader' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/StringLoader.php',
|
404 |
+
'Twig_FactoryRuntimeLoader' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FactoryRuntimeLoader.php',
|
405 |
'Twig_FileExtensionEscapingStrategy' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php',
|
406 |
'Twig_Filter' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Filter.php',
|
407 |
'Twig_FilterCallableInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FilterCallableInterface.php',
|
424 |
'Twig_Loader_String' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Loader/String.php',
|
425 |
'Twig_Markup' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Markup.php',
|
426 |
'Twig_Node' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node.php',
|
427 |
+
'Twig_NodeCaptureInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeCaptureInterface.php',
|
428 |
'Twig_NodeInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeInterface.php',
|
429 |
'Twig_NodeOutputInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeOutputInterface.php',
|
430 |
'Twig_NodeTraverser' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeTraverser.php',
|
510 |
'Twig_Node_SetTemp' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/SetTemp.php',
|
511 |
'Twig_Node_Spaceless' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Spaceless.php',
|
512 |
'Twig_Node_Text' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Text.php',
|
513 |
+
'Twig_Node_With' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/With.php',
|
514 |
'Twig_Parser' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Parser.php',
|
515 |
'Twig_ParserInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/ParserInterface.php',
|
516 |
'Twig_Profiler_Dumper_Blackfire' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php',
|
536 |
'Twig_SourceContextLoaderInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/SourceContextLoaderInterface.php',
|
537 |
'Twig_Template' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Template.php',
|
538 |
'Twig_TemplateInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TemplateInterface.php',
|
539 |
+
'Twig_TemplateWrapper' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TemplateWrapper.php',
|
540 |
'Twig_Test' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test.php',
|
541 |
'Twig_TestCallableInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TestCallableInterface.php',
|
542 |
'Twig_TestInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TestInterface.php',
|
567 |
'Twig_TokenParser_Set' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Set.php',
|
568 |
'Twig_TokenParser_Spaceless' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Spaceless.php',
|
569 |
'Twig_TokenParser_Use' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Use.php',
|
570 |
+
'Twig_TokenParser_With' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/With.php',
|
571 |
'Twig_TokenStream' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenStream.php',
|
572 |
'Twig_Util_DeprecationCollector' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Util/DeprecationCollector.php',
|
573 |
'Twig_Util_TemplateDirIterator' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Util/TemplateDirIterator.php',
|
602 |
public static function getInitializer(ClassLoader $loader)
|
603 |
{
|
604 |
return \Closure::bind(function () use ($loader) {
|
605 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit2344798a24c3433a0a523c6adee5b65d::$prefixLengthsPsr4;
|
606 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit2344798a24c3433a0a523c6adee5b65d::$prefixDirsPsr4;
|
607 |
+
$loader->prefixesPsr0 = ComposerStaticInit2344798a24c3433a0a523c6adee5b65d::$prefixesPsr0;
|
608 |
+
$loader->classMap = ComposerStaticInit2344798a24c3433a0a523c6adee5b65d::$classMap;
|
609 |
|
610 |
}, null, ClassLoader::class);
|
611 |
}
|
vendor/composer/installed.json
CHANGED
@@ -36,23 +36,26 @@
|
|
36 |
},
|
37 |
{
|
38 |
"name": "j4mie/idiorm",
|
39 |
-
"version": "v1.5.
|
40 |
-
"version_normalized": "1.5.
|
41 |
"source": {
|
42 |
"type": "git",
|
43 |
"url": "https://github.com/j4mie/idiorm.git",
|
44 |
-
"reference": "
|
45 |
},
|
46 |
"dist": {
|
47 |
"type": "zip",
|
48 |
-
"url": "https://api.github.com/repos/j4mie/idiorm/zipball/
|
49 |
-
"reference": "
|
50 |
"shasum": ""
|
51 |
},
|
52 |
"require": {
|
53 |
"php": ">=5.2.0"
|
54 |
},
|
55 |
-
"
|
|
|
|
|
|
|
56 |
"type": "library",
|
57 |
"installation-source": "dist",
|
58 |
"autoload": {
|
@@ -204,17 +207,17 @@
|
|
204 |
},
|
205 |
{
|
206 |
"name": "symfony/polyfill-mbstring",
|
207 |
-
"version": "v1.
|
208 |
-
"version_normalized": "1.
|
209 |
"source": {
|
210 |
"type": "git",
|
211 |
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
212 |
-
"reference": "
|
213 |
},
|
214 |
"dist": {
|
215 |
"type": "zip",
|
216 |
-
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/
|
217 |
-
"reference": "
|
218 |
"shasum": ""
|
219 |
},
|
220 |
"require": {
|
@@ -223,11 +226,11 @@
|
|
223 |
"suggest": {
|
224 |
"ext-mbstring": "For best performance"
|
225 |
},
|
226 |
-
"time": "2016-
|
227 |
"type": "library",
|
228 |
"extra": {
|
229 |
"branch-alias": {
|
230 |
-
"dev-master": "1.
|
231 |
}
|
232 |
},
|
233 |
"installation-source": "dist",
|
@@ -265,17 +268,17 @@
|
|
265 |
},
|
266 |
{
|
267 |
"name": "symfony/translation",
|
268 |
-
"version": "v2.8.
|
269 |
-
"version_normalized": "2.8.
|
270 |
"source": {
|
271 |
"type": "git",
|
272 |
"url": "https://github.com/symfony/translation.git",
|
273 |
-
"reference": "
|
274 |
},
|
275 |
"dist": {
|
276 |
"type": "zip",
|
277 |
-
"url": "https://api.github.com/repos/symfony/translation/zipball/
|
278 |
-
"reference": "
|
279 |
"shasum": ""
|
280 |
},
|
281 |
"require": {
|
@@ -296,7 +299,7 @@
|
|
296 |
"symfony/config": "",
|
297 |
"symfony/yaml": ""
|
298 |
},
|
299 |
-
"time": "
|
300 |
"type": "library",
|
301 |
"extra": {
|
302 |
"branch-alias": {
|
@@ -378,6 +381,52 @@
|
|
378 |
"time"
|
379 |
]
|
380 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
381 |
{
|
382 |
"name": "soundasleep/html2text",
|
383 |
"version": "dev-master",
|
@@ -435,26 +484,27 @@
|
|
435 |
},
|
436 |
{
|
437 |
"name": "swiftmailer/swiftmailer",
|
438 |
-
"version": "v5.4.
|
439 |
-
"version_normalized": "5.4.
|
440 |
"source": {
|
441 |
"type": "git",
|
442 |
"url": "https://github.com/swiftmailer/swiftmailer.git",
|
443 |
-
"reference": "
|
444 |
},
|
445 |
"dist": {
|
446 |
"type": "zip",
|
447 |
-
"url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/
|
448 |
-
"reference": "
|
449 |
"shasum": ""
|
450 |
},
|
451 |
"require": {
|
452 |
"php": ">=5.3.3"
|
453 |
},
|
454 |
"require-dev": {
|
455 |
-
"mockery/mockery": "~0.9.1"
|
|
|
456 |
},
|
457 |
-
"time": "2016-
|
458 |
"type": "library",
|
459 |
"extra": {
|
460 |
"branch-alias": {
|
@@ -544,17 +594,17 @@
|
|
544 |
},
|
545 |
{
|
546 |
"name": "twig/twig",
|
547 |
-
"version": "v1.
|
548 |
-
"version_normalized": "1.
|
549 |
"source": {
|
550 |
"type": "git",
|
551 |
"url": "https://github.com/twigphp/Twig.git",
|
552 |
-
"reference": "
|
553 |
},
|
554 |
"dist": {
|
555 |
"type": "zip",
|
556 |
-
"url": "https://api.github.com/repos/twigphp/Twig/zipball/
|
557 |
-
"reference": "
|
558 |
"shasum": ""
|
559 |
},
|
560 |
"require": {
|
@@ -562,13 +612,13 @@
|
|
562 |
},
|
563 |
"require-dev": {
|
564 |
"symfony/debug": "~2.7",
|
565 |
-
"symfony/phpunit-bridge": "~2
|
566 |
},
|
567 |
-
"time": "
|
568 |
"type": "library",
|
569 |
"extra": {
|
570 |
"branch-alias": {
|
571 |
-
"dev-master": "1.
|
572 |
}
|
573 |
},
|
574 |
"installation-source": "dist",
|
36 |
},
|
37 |
{
|
38 |
"name": "j4mie/idiorm",
|
39 |
+
"version": "v1.5.2",
|
40 |
+
"version_normalized": "1.5.2.0",
|
41 |
"source": {
|
42 |
"type": "git",
|
43 |
"url": "https://github.com/j4mie/idiorm.git",
|
44 |
+
"reference": "00b5fcd6e615a8572577eae401f80e41525efd5e"
|
45 |
},
|
46 |
"dist": {
|
47 |
"type": "zip",
|
48 |
+
"url": "https://api.github.com/repos/j4mie/idiorm/zipball/00b5fcd6e615a8572577eae401f80e41525efd5e",
|
49 |
+
"reference": "00b5fcd6e615a8572577eae401f80e41525efd5e",
|
50 |
"shasum": ""
|
51 |
},
|
52 |
"require": {
|
53 |
"php": ">=5.2.0"
|
54 |
},
|
55 |
+
"require-dev": {
|
56 |
+
"phpunit/phpunit": "^5.6"
|
57 |
+
},
|
58 |
+
"time": "2016-12-14 06:28:26",
|
59 |
"type": "library",
|
60 |
"installation-source": "dist",
|
61 |
"autoload": {
|
207 |
},
|
208 |
{
|
209 |
"name": "symfony/polyfill-mbstring",
|
210 |
+
"version": "v1.3.0",
|
211 |
+
"version_normalized": "1.3.0.0",
|
212 |
"source": {
|
213 |
"type": "git",
|
214 |
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
215 |
+
"reference": "e79d363049d1c2128f133a2667e4f4190904f7f4"
|
216 |
},
|
217 |
"dist": {
|
218 |
"type": "zip",
|
219 |
+
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4",
|
220 |
+
"reference": "e79d363049d1c2128f133a2667e4f4190904f7f4",
|
221 |
"shasum": ""
|
222 |
},
|
223 |
"require": {
|
226 |
"suggest": {
|
227 |
"ext-mbstring": "For best performance"
|
228 |
},
|
229 |
+
"time": "2016-11-14 01:06:16",
|
230 |
"type": "library",
|
231 |
"extra": {
|
232 |
"branch-alias": {
|
233 |
+
"dev-master": "1.3-dev"
|
234 |
}
|
235 |
},
|
236 |
"installation-source": "dist",
|
268 |
},
|
269 |
{
|
270 |
"name": "symfony/translation",
|
271 |
+
"version": "v2.8.16",
|
272 |
+
"version_normalized": "2.8.16.0",
|
273 |
"source": {
|
274 |
"type": "git",
|
275 |
"url": "https://github.com/symfony/translation.git",
|
276 |
+
"reference": "b4ac4a393f6970cc157fba17be537380de396a86"
|
277 |
},
|
278 |
"dist": {
|
279 |
"type": "zip",
|
280 |
+
"url": "https://api.github.com/repos/symfony/translation/zipball/b4ac4a393f6970cc157fba17be537380de396a86",
|
281 |
+
"reference": "b4ac4a393f6970cc157fba17be537380de396a86",
|
282 |
"shasum": ""
|
283 |
},
|
284 |
"require": {
|
299 |
"symfony/config": "",
|
300 |
"symfony/yaml": ""
|
301 |
},
|
302 |
+
"time": "2017-01-02 20:30:24",
|
303 |
"type": "library",
|
304 |
"extra": {
|
305 |
"branch-alias": {
|
381 |
"time"
|
382 |
]
|
383 |
},
|
384 |
+
{
|
385 |
+
"name": "sabberworm/php-css-parser",
|
386 |
+
"version": "8.1.0",
|
387 |
+
"version_normalized": "8.1.0.0",
|
388 |
+
"source": {
|
389 |
+
"type": "git",
|
390 |
+
"url": "https://github.com/sabberworm/PHP-CSS-Parser.git",
|
391 |
+
"reference": "850cbbcbe7fbb155387a151ea562897a67e242ef"
|
392 |
+
},
|
393 |
+
"dist": {
|
394 |
+
"type": "zip",
|
395 |
+
"url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/850cbbcbe7fbb155387a151ea562897a67e242ef",
|
396 |
+
"reference": "850cbbcbe7fbb155387a151ea562897a67e242ef",
|
397 |
+
"shasum": ""
|
398 |
+
},
|
399 |
+
"require": {
|
400 |
+
"php": ">=5.3.2"
|
401 |
+
},
|
402 |
+
"require-dev": {
|
403 |
+
"phpunit/phpunit": "*"
|
404 |
+
},
|
405 |
+
"time": "2016-07-19 19:14:21",
|
406 |
+
"type": "library",
|
407 |
+
"installation-source": "dist",
|
408 |
+
"autoload": {
|
409 |
+
"psr-0": {
|
410 |
+
"Sabberworm\\CSS": "lib/"
|
411 |
+
}
|
412 |
+
},
|
413 |
+
"notification-url": "https://packagist.org/downloads/",
|
414 |
+
"license": [
|
415 |
+
"MIT"
|
416 |
+
],
|
417 |
+
"authors": [
|
418 |
+
{
|
419 |
+
"name": "Raphael Schweikert"
|
420 |
+
}
|
421 |
+
],
|
422 |
+
"description": "Parser for CSS Files written in PHP",
|
423 |
+
"homepage": "http://www.sabberworm.com/blog/2010/6/10/php-css-parser",
|
424 |
+
"keywords": [
|
425 |
+
"css",
|
426 |
+
"parser",
|
427 |
+
"stylesheet"
|
428 |
+
]
|
429 |
+
},
|
430 |
{
|
431 |
"name": "soundasleep/html2text",
|
432 |
"version": "dev-master",
|
484 |
},
|
485 |
{
|
486 |
"name": "swiftmailer/swiftmailer",
|
487 |
+
"version": "v5.4.5",
|
488 |
+
"version_normalized": "5.4.5.0",
|
489 |
"source": {
|
490 |
"type": "git",
|
491 |
"url": "https://github.com/swiftmailer/swiftmailer.git",
|
492 |
+
"reference": "cd142238a339459b10da3d8234220963f392540c"
|
493 |
},
|
494 |
"dist": {
|
495 |
"type": "zip",
|
496 |
+
"url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/cd142238a339459b10da3d8234220963f392540c",
|
497 |
+
"reference": "cd142238a339459b10da3d8234220963f392540c",
|
498 |
"shasum": ""
|
499 |
},
|
500 |
"require": {
|
501 |
"php": ">=5.3.3"
|
502 |
},
|
503 |
"require-dev": {
|
504 |
+
"mockery/mockery": "~0.9.1",
|
505 |
+
"symfony/phpunit-bridge": "~3.2"
|
506 |
},
|
507 |
+
"time": "2016-12-29 10:02:40",
|
508 |
"type": "library",
|
509 |
"extra": {
|
510 |
"branch-alias": {
|
594 |
},
|
595 |
{
|
596 |
"name": "twig/twig",
|
597 |
+
"version": "v1.31.0",
|
598 |
+
"version_normalized": "1.31.0.0",
|
599 |
"source": {
|
600 |
"type": "git",
|
601 |
"url": "https://github.com/twigphp/Twig.git",
|
602 |
+
"reference": "ddc9e3e20ee9c0b6908f401ac8353635b750eca7"
|
603 |
},
|
604 |
"dist": {
|
605 |
"type": "zip",
|
606 |
+
"url": "https://api.github.com/repos/twigphp/Twig/zipball/ddc9e3e20ee9c0b6908f401ac8353635b750eca7",
|
607 |
+
"reference": "ddc9e3e20ee9c0b6908f401ac8353635b750eca7",
|
608 |
"shasum": ""
|
609 |
},
|
610 |
"require": {
|
612 |
},
|
613 |
"require-dev": {
|
614 |
"symfony/debug": "~2.7",
|
615 |
+
"symfony/phpunit-bridge": "~3.2"
|
616 |
},
|
617 |
+
"time": "2017-01-11 19:36:15",
|
618 |
"type": "library",
|
619 |
"extra": {
|
620 |
"branch-alias": {
|
621 |
+
"dev-master": "1.31-dev"
|
622 |
}
|
623 |
},
|
624 |
"installation-source": "dist",
|
vendor/j4mie/idiorm/composer.json
CHANGED
@@ -28,6 +28,12 @@
|
|
28 |
"role": "Maintainer"
|
29 |
}
|
30 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
"license": [
|
32 |
"BSD-2-Clause",
|
33 |
"BSD-3-Clause",
|
28 |
"role": "Maintainer"
|
29 |
}
|
30 |
],
|
31 |
+
"scripts": {
|
32 |
+
"test": "vendor/bin/phpunit"
|
33 |
+
},
|
34 |
+
"require-dev": {
|
35 |
+
"phpunit/phpunit": "^5.6"
|
36 |
+
},
|
37 |
"license": [
|
38 |
"BSD-2-Clause",
|
39 |
"BSD-3-Clause",
|
vendor/j4mie/idiorm/idiorm.php
CHANGED
@@ -36,6 +36,80 @@
|
|
36 |
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
37 |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
38 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
*/
|
40 |
|
41 |
class ORM implements ArrayAccess {
|
@@ -456,29 +530,33 @@
|
|
456 |
self::$_query_log[$connection_name] = array();
|
457 |
}
|
458 |
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
}
|
463 |
-
|
464 |
-
if (count($parameters) > 0) {
|
465 |
// Escape the parameters
|
466 |
$parameters = array_map(array(self::get_db($connection_name), 'quote'), $parameters);
|
467 |
|
468 |
-
|
469 |
-
|
|
|
|
|
470 |
|
471 |
-
|
472 |
-
|
473 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
474 |
} else {
|
475 |
-
|
|
|
|
|
|
|
|
|
476 |
}
|
477 |
-
|
478 |
-
// Replace the question marks in the query with the parameters
|
479 |
-
$bound_query = vsprintf($query, $parameters);
|
480 |
-
} else {
|
481 |
-
$bound_query = $query;
|
482 |
}
|
483 |
|
484 |
self::$_last_query = $bound_query;
|
@@ -1255,14 +1333,14 @@
|
|
1255 |
$data = array();
|
1256 |
$query = array("((");
|
1257 |
$first = true;
|
1258 |
-
foreach ($values as $
|
1259 |
if ($first) {
|
1260 |
$first = false;
|
1261 |
} else {
|
1262 |
$query[] = ") OR (";
|
1263 |
}
|
1264 |
$firstsub = true;
|
1265 |
-
foreach($
|
1266 |
$op = is_string($operator) ? $operator : (isset($operator[$key]) ? $operator[$key] : '=');
|
1267 |
if ($firstsub) {
|
1268 |
$firstsub = false;
|
@@ -1469,7 +1547,7 @@
|
|
1469 |
*/
|
1470 |
public function having_id_is($id) {
|
1471 |
return (is_array($this->_get_id_column_name())) ?
|
1472 |
-
$this->having($this->_get_compound_id_column_values($
|
1473 |
$this->having($this->_get_id_column_name(), $id);
|
1474 |
}
|
1475 |
|
@@ -1964,7 +2042,7 @@
|
|
1964 |
* object was saved.
|
1965 |
*/
|
1966 |
public function is_dirty($key) {
|
1967 |
-
return
|
1968 |
}
|
1969 |
|
1970 |
/**
|
@@ -2023,7 +2101,7 @@
|
|
2023 |
// if the primary key is compound, assign the last inserted id
|
2024 |
// to the first column
|
2025 |
if (is_array($column)) {
|
2026 |
-
$column =
|
2027 |
}
|
2028 |
$this->_data[$column] = $db->lastInsertId();
|
2029 |
}
|
@@ -2313,6 +2391,8 @@
|
|
2313 |
/**
|
2314 |
* A result set class for working with collections of model instances
|
2315 |
* @author Simon Holywell <treffynnon@php.net>
|
|
|
|
|
2316 |
*/
|
2317 |
class IdiormResultSet implements Countable, IteratorAggregate, ArrayAccess, Serializable {
|
2318 |
/**
|
36 |
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
37 |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
38 |
*
|
39 |
+
*
|
40 |
+
* The methods documented below are magic methods that conform to PSR-1.
|
41 |
+
* This documentation exposes these methods to doc generators and IDEs.
|
42 |
+
* @see http://www.php-fig.org/psr/psr-1/
|
43 |
+
*
|
44 |
+
* @method static array|string getConfig($key = null, $connection_name = self::DEFAULT_CONNECTION)
|
45 |
+
* @method static null resetConfig()
|
46 |
+
* @method static \ORM forTable($table_name, $connection_name = self::DEFAULT_CONNECTION)
|
47 |
+
* @method static null setDb($db, $connection_name = self::DEFAULT_CONNECTION)
|
48 |
+
* @method static null resetDb()
|
49 |
+
* @method static null setupLimitClauseStyle($connection_name)
|
50 |
+
* @method static \PDO getDb($connection_name = self::DEFAULT_CONNECTION)
|
51 |
+
* @method static bool rawExecute($query, $parameters = array())
|
52 |
+
* @method static \PDOStatement getLastStatement()
|
53 |
+
* @method static string getLastQuery($connection_name = null)
|
54 |
+
* @method static array getQueryLog($connection_name = self::DEFAULT_CONNECTION)
|
55 |
+
* @method array getConnectionNames()
|
56 |
+
* @method $this useIdColumn($id_column)
|
57 |
+
* @method \ORM|bool findOne($id=null)
|
58 |
+
* @method array|\IdiormResultSet findMany()
|
59 |
+
* @method \IdiormResultSet findResultSet()
|
60 |
+
* @method array findArray()
|
61 |
+
* @method $this forceAllDirty()
|
62 |
+
* @method $this rawQuery($query, $parameters = array())
|
63 |
+
* @method $this tableAlias($alias)
|
64 |
+
* @method int countNullIdColumns()
|
65 |
+
* @method $this selectExpr($expr, $alias=null)
|
66 |
+
* @method \ORM selectMany()
|
67 |
+
* @method \ORM selectManyExpr()
|
68 |
+
* @method $this rawJoin($table, $constraint, $table_alias, $parameters = array())
|
69 |
+
* @method $this innerJoin($table, $constraint, $table_alias=null)
|
70 |
+
* @method $this leftOuterJoin($table, $constraint, $table_alias=null)
|
71 |
+
* @method $this rightOuterJoin($table, $constraint, $table_alias=null)
|
72 |
+
* @method $this fullOuterJoin($table, $constraint, $table_alias=null)
|
73 |
+
* @method $this whereEqual($column_name, $value=null)
|
74 |
+
* @method $this whereNotEqual($column_name, $value=null)
|
75 |
+
* @method $this whereIdIs($id)
|
76 |
+
* @method $this whereAnyIs($values, $operator='=')
|
77 |
+
* @method array|string whereIdIn($ids)
|
78 |
+
* @method $this whereLike($column_name, $value=null)
|
79 |
+
* @method $this whereNotLike($column_name, $value=null)
|
80 |
+
* @method $this whereGt($column_name, $value=null)
|
81 |
+
* @method $this whereLt($column_name, $value=null)
|
82 |
+
* @method $this whereGte($column_name, $value=null)
|
83 |
+
* @method $this whereLte($column_name, $value=null)
|
84 |
+
* @method $this whereIn($column_name, $values)
|
85 |
+
* @method $this whereNotIn($column_name, $values)
|
86 |
+
* @method $this whereNull($column_name)
|
87 |
+
* @method $this whereNotNull($column_name)
|
88 |
+
* @method $this whereRaw($clause, $parameters=array())
|
89 |
+
* @method $this orderByDesc($column_name)
|
90 |
+
* @method $this orderByAsc($column_name)
|
91 |
+
* @method $this orderByExpr($clause)
|
92 |
+
* @method $this groupBy($column_name)
|
93 |
+
* @method $this groupByExpr($expr)
|
94 |
+
* @method $this havingEqual($column_name, $value=null)
|
95 |
+
* @method $this havingNotEqual($column_name, $value=null)
|
96 |
+
* @method $this havingIdIs($id)
|
97 |
+
* @method $this havingLike($column_name, $value=null)
|
98 |
+
* @method $this havingNotLike($column_name, $value=null)
|
99 |
+
* @method $this havingGt($column_name, $value=null)
|
100 |
+
* @method $this havingLt($column_name, $value=null)
|
101 |
+
* @method $this havingGte($column_name, $value=null)
|
102 |
+
* @method $this havingLte($column_name, $value=null)
|
103 |
+
* @method $this havingIn($column_name, $values=null)
|
104 |
+
* @method $this havingNotIn($column_name, $values=null)
|
105 |
+
* @method $this havingNull($column_name)
|
106 |
+
* @method $this havingNotNull($column_name)
|
107 |
+
* @method $this havingRaw($clause, $parameters=array())
|
108 |
+
* @method static this clearCache($table_name = null, $connection_name = self::DEFAULT_CONNECTION)
|
109 |
+
* @method array asArray()
|
110 |
+
* @method bool setExpr($key, $value = null)
|
111 |
+
* @method bool isDirty($key)
|
112 |
+
* @method bool isNew()
|
113 |
*/
|
114 |
|
115 |
class ORM implements ArrayAccess {
|
530 |
self::$_query_log[$connection_name] = array();
|
531 |
}
|
532 |
|
533 |
+
if (empty($parameters)) {
|
534 |
+
$bound_query = $query;
|
535 |
+
} else {
|
|
|
|
|
|
|
536 |
// Escape the parameters
|
537 |
$parameters = array_map(array(self::get_db($connection_name), 'quote'), $parameters);
|
538 |
|
539 |
+
if (array_values($parameters) === $parameters) {
|
540 |
+
// ? placeholders
|
541 |
+
// Avoid %format collision for vsprintf
|
542 |
+
$query = str_replace("%", "%%", $query);
|
543 |
|
544 |
+
// Replace placeholders in the query for vsprintf
|
545 |
+
if(false !== strpos($query, "'") || false !== strpos($query, '"')) {
|
546 |
+
$query = IdiormString::str_replace_outside_quotes("?", "%s", $query);
|
547 |
+
} else {
|
548 |
+
$query = str_replace("?", "%s", $query);
|
549 |
+
}
|
550 |
+
|
551 |
+
// Replace the question marks in the query with the parameters
|
552 |
+
$bound_query = vsprintf($query, $parameters);
|
553 |
} else {
|
554 |
+
// named placeholders
|
555 |
+
foreach ($parameters as $key => $val) {
|
556 |
+
$query = str_replace($key, $val, $query);
|
557 |
+
}
|
558 |
+
$bound_query = $query;
|
559 |
}
|
|
|
|
|
|
|
|
|
|
|
560 |
}
|
561 |
|
562 |
self::$_last_query = $bound_query;
|
1333 |
$data = array();
|
1334 |
$query = array("((");
|
1335 |
$first = true;
|
1336 |
+
foreach ($values as $value) {
|
1337 |
if ($first) {
|
1338 |
$first = false;
|
1339 |
} else {
|
1340 |
$query[] = ") OR (";
|
1341 |
}
|
1342 |
$firstsub = true;
|
1343 |
+
foreach($value as $key => $item) {
|
1344 |
$op = is_string($operator) ? $operator : (isset($operator[$key]) ? $operator[$key] : '=');
|
1345 |
if ($firstsub) {
|
1346 |
$firstsub = false;
|
1547 |
*/
|
1548 |
public function having_id_is($id) {
|
1549 |
return (is_array($this->_get_id_column_name())) ?
|
1550 |
+
$this->having($this->_get_compound_id_column_values($id), null) :
|
1551 |
$this->having($this->_get_id_column_name(), $id);
|
1552 |
}
|
1553 |
|
2042 |
* object was saved.
|
2043 |
*/
|
2044 |
public function is_dirty($key) {
|
2045 |
+
return array_key_exists($key, $this->_dirty_fields);
|
2046 |
}
|
2047 |
|
2048 |
/**
|
2101 |
// if the primary key is compound, assign the last inserted id
|
2102 |
// to the first column
|
2103 |
if (is_array($column)) {
|
2104 |
+
$column = reset($column);
|
2105 |
}
|
2106 |
$this->_data[$column] = $db->lastInsertId();
|
2107 |
}
|
2391 |
/**
|
2392 |
* A result set class for working with collections of model instances
|
2393 |
* @author Simon Holywell <treffynnon@php.net>
|
2394 |
+
* @method null setResults(array $results)
|
2395 |
+
* @method array getResults()
|
2396 |
*/
|
2397 |
class IdiormResultSet implements Countable, IteratorAggregate, ArrayAccess, Serializable {
|
2398 |
/**
|
vendor/sabberworm/index.php
ADDED
File without changes
|
vendor/sabberworm/php-css-parser/.travis.yml
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
language: php
|
2 |
+
php:
|
3 |
+
- "5.4"
|
4 |
+
- "5.3"
|
5 |
+
- "5.5"
|
6 |
+
- "5.6"
|
7 |
+
- "7.0"
|
8 |
+
- "nightly"
|
9 |
+
- hhvm
|
10 |
+
script: phpunit .
|
11 |
+
sudo: false
|
12 |
+
|
vendor/sabberworm/php-css-parser/Doxyfile
ADDED
@@ -0,0 +1,2310 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Doxyfile 1.8.7
|
2 |
+
|
3 |
+
# This file describes the settings to be used by the documentation system
|
4 |
+
# doxygen (www.doxygen.org) for a project.
|
5 |
+
#
|
6 |
+
# All text after a double hash (##) is considered a comment and is placed in
|
7 |
+
# front of the TAG it is preceding.
|
8 |
+
#
|
9 |
+
# All text after a single hash (#) is considered a comment and will be ignored.
|
10 |
+
# The format is:
|
11 |
+
# TAG = value [value, ...]
|
12 |
+
# For lists, items can also be appended using:
|
13 |
+
# TAG += value [value, ...]
|
14 |
+
# Values that contain spaces should be placed between quotes (\" \").
|
15 |
+
|
16 |
+
#---------------------------------------------------------------------------
|
17 |
+
# Project related configuration options
|
18 |
+
#---------------------------------------------------------------------------
|
19 |
+
|
20 |
+
# This tag specifies the encoding used for all characters in the config file
|
21 |
+
# that follow. The default is UTF-8 which is also the encoding used for all text
|
22 |
+
# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
|
23 |
+
# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
|
24 |
+
# for the list of possible encodings.
|
25 |
+
# The default value is: UTF-8.
|
26 |
+
|
27 |
+
DOXYFILE_ENCODING = UTF-8
|
28 |
+
|
29 |
+
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
|
30 |
+
# double-quotes, unless you are using Doxywizard) that should identify the
|
31 |
+
# project for which the documentation is generated. This name is used in the
|
32 |
+
# title of most generated pages and in a few other places.
|
33 |
+
# The default value is: My Project.
|
34 |
+
|
35 |
+
PROJECT_NAME = "Sabberworm/PHP-CSS-Parser"
|
36 |
+
|
37 |
+
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
|
38 |
+
# could be handy for archiving the generated documentation or if some version
|
39 |
+
# control system is used.
|
40 |
+
|
41 |
+
PROJECT_NUMBER = "7.0.3"
|
42 |
+
|
43 |
+
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
44 |
+
# for a project that appears at the top of each page and should give viewer a
|
45 |
+
# quick idea about the purpose of the project. Keep the description short.
|
46 |
+
|
47 |
+
PROJECT_BRIEF = "A Parser for CSS Files written in PHP. Allows extraction of CSS files into a data structure, manipulation of said structure and output as (optimized) CSS"
|
48 |
+
|
49 |
+
# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
|
50 |
+
# the documentation. The maximum height of the logo should not exceed 55 pixels
|
51 |
+
# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
|
52 |
+
# to the output directory.
|
53 |
+
|
54 |
+
PROJECT_LOGO =
|
55 |
+
|
56 |
+
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
|
57 |
+
# into which the generated documentation will be written. If a relative path is
|
58 |
+
# entered, it will be relative to the location where doxygen was started. If
|
59 |
+
# left blank the current directory will be used.
|
60 |
+
|
61 |
+
OUTPUT_DIRECTORY = "../PHP-CSS-Parser-Documentation"
|
62 |
+
|
63 |
+
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
|
64 |
+
# directories (in 2 levels) under the output directory of each output format and
|
65 |
+
# will distribute the generated files over these directories. Enabling this
|
66 |
+
# option can be useful when feeding doxygen a huge amount of source files, where
|
67 |
+
# putting all generated files in the same directory would otherwise causes
|
68 |
+
# performance problems for the file system.
|
69 |
+
# The default value is: NO.
|
70 |
+
|
71 |
+
CREATE_SUBDIRS = NO
|
72 |
+
|
73 |
+
# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
|
74 |
+
# characters to appear in the names of generated files. If set to NO, non-ASCII
|
75 |
+
# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
|
76 |
+
# U+3044.
|
77 |
+
# The default value is: NO.
|
78 |
+
|
79 |
+
ALLOW_UNICODE_NAMES = NO
|
80 |
+
|
81 |
+
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
|
82 |
+
# documentation generated by doxygen is written. Doxygen will use this
|
83 |
+
# information to generate all constant output in the proper language.
|
84 |
+
# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
|
85 |
+
# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
|
86 |
+
# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
|
87 |
+
# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
|
88 |
+
# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
|
89 |
+
# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
|
90 |
+
# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
|
91 |
+
# Ukrainian and Vietnamese.
|
92 |
+
# The default value is: English.
|
93 |
+
|
94 |
+
OUTPUT_LANGUAGE = English
|
95 |
+
|
96 |
+
# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
|
97 |
+
# descriptions after the members that are listed in the file and class
|
98 |
+
# documentation (similar to Javadoc). Set to NO to disable this.
|
99 |
+
# The default value is: YES.
|
100 |
+
|
101 |
+
BRIEF_MEMBER_DESC = YES
|
102 |
+
|
103 |
+
# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
|
104 |
+
# description of a member or function before the detailed description
|
105 |
+
#
|
106 |
+
# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
|
107 |
+
# brief descriptions will be completely suppressed.
|
108 |
+
# The default value is: YES.
|
109 |
+
|
110 |
+
REPEAT_BRIEF = YES
|
111 |
+
|
112 |
+
# This tag implements a quasi-intelligent brief description abbreviator that is
|
113 |
+
# used to form the text in various listings. Each string in this list, if found
|
114 |
+
# as the leading text of the brief description, will be stripped from the text
|
115 |
+
# and the result, after processing the whole list, is used as the annotated
|
116 |
+
# text. Otherwise, the brief description is used as-is. If left blank, the
|
117 |
+
# following values are used ($name is automatically replaced with the name of
|
118 |
+
# the entity):The $name class, The $name widget, The $name file, is, provides,
|
119 |
+
# specifies, contains, represents, a, an and the.
|
120 |
+
|
121 |
+
ABBREVIATE_BRIEF =
|
122 |
+
|
123 |
+
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
|
124 |
+
# doxygen will generate a detailed section even if there is only a brief
|
125 |
+
# description.
|
126 |
+
# The default value is: NO.
|
127 |
+
|
128 |
+
ALWAYS_DETAILED_SEC = NO
|
129 |
+
|
130 |
+
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
|
131 |
+
# inherited members of a class in the documentation of that class as if those
|
132 |
+
# members were ordinary class members. Constructors, destructors and assignment
|
133 |
+
# operators of the base classes will not be shown.
|
134 |
+
# The default value is: NO.
|
135 |
+
|
136 |
+
INLINE_INHERITED_MEMB = NO
|
137 |
+
|
138 |
+
# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
|
139 |
+
# before files name in the file list and in the header files. If set to NO the
|
140 |
+
# shortest path that makes the file name unique will be used
|
141 |
+
# The default value is: YES.
|
142 |
+
|
143 |
+
FULL_PATH_NAMES = YES
|
144 |
+
|
145 |
+
# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
|
146 |
+
# Stripping is only done if one of the specified strings matches the left-hand
|
147 |
+
# part of the path. The tag can be used to show relative paths in the file list.
|
148 |
+
# If left blank the directory from which doxygen is run is used as the path to
|
149 |
+
# strip.
|
150 |
+
#
|
151 |
+
# Note that you can specify absolute paths here, but also relative paths, which
|
152 |
+
# will be relative from the directory where doxygen is started.
|
153 |
+
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
|
154 |
+
|
155 |
+
STRIP_FROM_PATH = ./lib
|
156 |
+
|
157 |
+
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
|
158 |
+
# path mentioned in the documentation of a class, which tells the reader which
|
159 |
+
# header file to include in order to use a class. If left blank only the name of
|
160 |
+
# the header file containing the class definition is used. Otherwise one should
|
161 |
+
# specify the list of include paths that are normally passed to the compiler
|
162 |
+
# using the -I flag.
|
163 |
+
|
164 |
+
STRIP_FROM_INC_PATH =
|
165 |
+
|
166 |
+
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
|
167 |
+
# less readable) file names. This can be useful is your file systems doesn't
|
168 |
+
# support long names like on DOS, Mac, or CD-ROM.
|
169 |
+
# The default value is: NO.
|
170 |
+
|
171 |
+
SHORT_NAMES = NO
|
172 |
+
|
173 |
+
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
|
174 |
+
# first line (until the first dot) of a Javadoc-style comment as the brief
|
175 |
+
# description. If set to NO, the Javadoc-style will behave just like regular Qt-
|
176 |
+
# style comments (thus requiring an explicit @brief command for a brief
|
177 |
+
# description.)
|
178 |
+
# The default value is: NO.
|
179 |
+
|
180 |
+
JAVADOC_AUTOBRIEF = YES
|
181 |
+
|
182 |
+
# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
|
183 |
+
# line (until the first dot) of a Qt-style comment as the brief description. If
|
184 |
+
# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
|
185 |
+
# requiring an explicit \brief command for a brief description.)
|
186 |
+
# The default value is: NO.
|
187 |
+
|
188 |
+
QT_AUTOBRIEF = YES
|
189 |
+
|
190 |
+
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
|
191 |
+
# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
|
192 |
+
# a brief description. This used to be the default behavior. The new default is
|
193 |
+
# to treat a multi-line C++ comment block as a detailed description. Set this
|
194 |
+
# tag to YES if you prefer the old behavior instead.
|
195 |
+
#
|
196 |
+
# Note that setting this tag to YES also means that rational rose comments are
|
197 |
+
# not recognized any more.
|
198 |
+
# The default value is: NO.
|
199 |
+
|
200 |
+
MULTILINE_CPP_IS_BRIEF = YES
|
201 |
+
|
202 |
+
# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
|
203 |
+
# documentation from any documented member that it re-implements.
|
204 |
+
# The default value is: YES.
|
205 |
+
|
206 |
+
INHERIT_DOCS = YES
|
207 |
+
|
208 |
+
# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
|
209 |
+
# new page for each member. If set to NO, the documentation of a member will be
|
210 |
+
# part of the file/class/namespace that contains it.
|
211 |
+
# The default value is: NO.
|
212 |
+
|
213 |
+
SEPARATE_MEMBER_PAGES = NO
|
214 |
+
|
215 |
+
# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
|
216 |
+
# uses this value to replace tabs by spaces in code fragments.
|
217 |
+
# Minimum value: 1, maximum value: 16, default value: 4.
|
218 |
+
|
219 |
+
TAB_SIZE = 2
|
220 |
+
|
221 |
+
# This tag can be used to specify a number of aliases that act as commands in
|
222 |
+
# the documentation. An alias has the form:
|
223 |
+
# name=value
|
224 |
+
# For example adding
|
225 |
+
# "sideeffect=@par Side Effects:\n"
|
226 |
+
# will allow you to put the command \sideeffect (or @sideeffect) in the
|
227 |
+
# documentation, which will result in a user-defined paragraph with heading
|
228 |
+
# "Side Effects:". You can put \n's in the value part of an alias to insert
|
229 |
+
# newlines.
|
230 |
+
|
231 |
+
ALIASES =
|
232 |
+
|
233 |
+
# This tag can be used to specify a number of word-keyword mappings (TCL only).
|
234 |
+
# A mapping has the form "name=value". For example adding "class=itcl::class"
|
235 |
+
# will allow you to use the command class in the itcl::class meaning.
|
236 |
+
|
237 |
+
TCL_SUBST =
|
238 |
+
|
239 |
+
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
|
240 |
+
# only. Doxygen will then generate output that is more tailored for C. For
|
241 |
+
# instance, some of the names that are used will be different. The list of all
|
242 |
+
# members will be omitted, etc.
|
243 |
+
# The default value is: NO.
|
244 |
+
|
245 |
+
OPTIMIZE_OUTPUT_FOR_C = NO
|
246 |
+
|
247 |
+
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
|
248 |
+
# Python sources only. Doxygen will then generate output that is more tailored
|
249 |
+
# for that language. For instance, namespaces will be presented as packages,
|
250 |
+
# qualified scopes will look different, etc.
|
251 |
+
# The default value is: NO.
|
252 |
+
|
253 |
+
OPTIMIZE_OUTPUT_JAVA = NO
|
254 |
+
|
255 |
+
# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
|
256 |
+
# sources. Doxygen will then generate output that is tailored for Fortran.
|
257 |
+
# The default value is: NO.
|
258 |
+
|
259 |
+
OPTIMIZE_FOR_FORTRAN = NO
|
260 |
+
|
261 |
+
# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
|
262 |
+
# sources. Doxygen will then generate output that is tailored for VHDL.
|
263 |
+
# The default value is: NO.
|
264 |
+
|
265 |
+
OPTIMIZE_OUTPUT_VHDL = NO
|
266 |
+
|
267 |
+
# Doxygen selects the parser to use depending on the extension of the files it
|
268 |
+
# parses. With this tag you can assign which parser to use for a given
|
269 |
+
# extension. Doxygen has a built-in mapping, but you can override or extend it
|
270 |
+
# using this tag. The format is ext=language, where ext is a file extension, and
|
271 |
+
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
|
272 |
+
# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
|
273 |
+
# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
|
274 |
+
# Fortran. In the later case the parser tries to guess whether the code is fixed
|
275 |
+
# or free formatted code, this is the default for Fortran type files), VHDL. For
|
276 |
+
# instance to make doxygen treat .inc files as Fortran files (default is PHP),
|
277 |
+
# and .f files as C (default is Fortran), use: inc=Fortran f=C.
|
278 |
+
#
|
279 |
+
# Note For files without extension you can use no_extension as a placeholder.
|
280 |
+
#
|
281 |
+
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
|
282 |
+
# the files are not read by doxygen.
|
283 |
+
|
284 |
+
EXTENSION_MAPPING =
|
285 |
+
|
286 |
+
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
|
287 |
+
# according to the Markdown format, which allows for more readable
|
288 |
+
# documentation. See http://daringfireball.net/projects/markdown/ for details.
|
289 |
+
# The output of markdown processing is further processed by doxygen, so you can
|
290 |
+
# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
|
291 |
+
# case of backward compatibilities issues.
|
292 |
+
# The default value is: YES.
|
293 |
+
|
294 |
+
MARKDOWN_SUPPORT = YES
|
295 |
+
|
296 |
+
# When enabled doxygen tries to link words that correspond to documented
|
297 |
+
# classes, or namespaces to their corresponding documentation. Such a link can
|
298 |
+
# be prevented in individual cases by by putting a % sign in front of the word
|
299 |
+
# or globally by setting AUTOLINK_SUPPORT to NO.
|
300 |
+
# The default value is: YES.
|
301 |
+
|
302 |
+
AUTOLINK_SUPPORT = YES
|
303 |
+
|
304 |
+
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
|
305 |
+
# to include (a tag file for) the STL sources as input, then you should set this
|
306 |
+
# tag to YES in order to let doxygen match functions declarations and
|
307 |
+
# definitions whose arguments contain STL classes (e.g. func(std::string);
|
308 |
+
# versus func(std::string) {}). This also make the inheritance and collaboration
|
309 |
+
# diagrams that involve STL classes more complete and accurate.
|
310 |
+
# The default value is: NO.
|
311 |
+
|
312 |
+
BUILTIN_STL_SUPPORT = NO
|
313 |
+
|
314 |
+
# If you use Microsoft's C++/CLI language, you should set this option to YES to
|
315 |
+
# enable parsing support.
|
316 |
+
# The default value is: NO.
|
317 |
+
|
318 |
+
CPP_CLI_SUPPORT = NO
|
319 |
+
|
320 |
+
# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
|
321 |
+
# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
|
322 |
+
# will parse them like normal C++ but will assume all classes use public instead
|
323 |
+
# of private inheritance when no explicit protection keyword is present.
|
324 |
+
# The default value is: NO.
|
325 |
+
|
326 |
+
SIP_SUPPORT = NO
|
327 |
+
|
328 |
+
# For Microsoft's IDL there are propget and propput attributes to indicate
|
329 |
+
# getter and setter methods for a property. Setting this option to YES will make
|
330 |
+
# doxygen to replace the get and set methods by a property in the documentation.
|
331 |
+
# This will only work if the methods are indeed getting or setting a simple
|
332 |
+
# type. If this is not the case, or you want to show the methods anyway, you
|
333 |
+
# should set this option to NO.
|
334 |
+
# The default value is: YES.
|
335 |
+
|
336 |
+
IDL_PROPERTY_SUPPORT = YES
|
337 |
+
|
338 |
+
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
|
339 |
+
# tag is set to YES, then doxygen will reuse the documentation of the first
|
340 |
+
# member in the group (if any) for the other members of the group. By default
|
341 |
+
# all members of a group must be documented explicitly.
|
342 |
+
# The default value is: NO.
|
343 |
+
|
344 |
+
DISTRIBUTE_GROUP_DOC = NO
|
345 |
+
|
346 |
+
# Set the SUBGROUPING tag to YES to allow class member groups of the same type
|
347 |
+
# (for instance a group of public functions) to be put as a subgroup of that
|
348 |
+
# type (e.g. under the Public Functions section). Set it to NO to prevent
|
349 |
+
# subgrouping. Alternatively, this can be done per class using the
|
350 |
+
# \nosubgrouping command.
|
351 |
+
# The default value is: YES.
|
352 |
+
|
353 |
+
SUBGROUPING = YES
|
354 |
+
|
355 |
+
# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
|
356 |
+
# are shown inside the group in which they are included (e.g. using \ingroup)
|
357 |
+
# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
|
358 |
+
# and RTF).
|
359 |
+
#
|
360 |
+
# Note that this feature does not work in combination with
|
361 |
+
# SEPARATE_MEMBER_PAGES.
|
362 |
+
# The default value is: NO.
|
363 |
+
|
364 |
+
INLINE_GROUPED_CLASSES = NO
|
365 |
+
|
366 |
+
# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
|
367 |
+
# with only public data fields or simple typedef fields will be shown inline in
|
368 |
+
# the documentation of the scope in which they are defined (i.e. file,
|
369 |
+
# namespace, or group documentation), provided this scope is documented. If set
|
370 |
+
# to NO, structs, classes, and unions are shown on a separate page (for HTML and
|
371 |
+
# Man pages) or section (for LaTeX and RTF).
|
372 |
+
# The default value is: NO.
|
373 |
+
|
374 |
+
INLINE_SIMPLE_STRUCTS = NO
|
375 |
+
|
376 |
+
# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
|
377 |
+
# enum is documented as struct, union, or enum with the name of the typedef. So
|
378 |
+
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
|
379 |
+
# with name TypeT. When disabled the typedef will appear as a member of a file,
|
380 |
+
# namespace, or class. And the struct will be named TypeS. This can typically be
|
381 |
+
# useful for C code in case the coding convention dictates that all compound
|
382 |
+
# types are typedef'ed and only the typedef is referenced, never the tag name.
|
383 |
+
# The default value is: NO.
|
384 |
+
|
385 |
+
TYPEDEF_HIDES_STRUCT = NO
|
386 |
+
|
387 |
+
# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
|
388 |
+
# cache is used to resolve symbols given their name and scope. Since this can be
|
389 |
+
# an expensive process and often the same symbol appears multiple times in the
|
390 |
+
# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
|
391 |
+
# doxygen will become slower. If the cache is too large, memory is wasted. The
|
392 |
+
# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
|
393 |
+
# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
|
394 |
+
# symbols. At the end of a run doxygen will report the cache usage and suggest
|
395 |
+
# the optimal cache size from a speed point of view.
|
396 |
+
# Minimum value: 0, maximum value: 9, default value: 0.
|
397 |
+
|
398 |
+
LOOKUP_CACHE_SIZE = 0
|
399 |
+
|
400 |
+
#---------------------------------------------------------------------------
|
401 |
+
# Build related configuration options
|
402 |
+
#---------------------------------------------------------------------------
|
403 |
+
|
404 |
+
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
|
405 |
+
# documentation are documented, even if no documentation was available. Private
|
406 |
+
# class members and static file members will be hidden unless the
|
407 |
+
# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
|
408 |
+
# Note: This will also disable the warnings about undocumented members that are
|
409 |
+
# normally produced when WARNINGS is set to YES.
|
410 |
+
# The default value is: NO.
|
411 |
+
|
412 |
+
EXTRACT_ALL = NO
|
413 |
+
|
414 |
+
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
|
415 |
+
# be included in the documentation.
|
416 |
+
# The default value is: NO.
|
417 |
+
|
418 |
+
EXTRACT_PRIVATE = NO
|
419 |
+
|
420 |
+
# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
|
421 |
+
# scope will be included in the documentation.
|
422 |
+
# The default value is: NO.
|
423 |
+
|
424 |
+
EXTRACT_PACKAGE = NO
|
425 |
+
|
426 |
+
# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
|
427 |
+
# included in the documentation.
|
428 |
+
# The default value is: NO.
|
429 |
+
|
430 |
+
EXTRACT_STATIC = NO
|
431 |
+
|
432 |
+
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
|
433 |
+
# locally in source files will be included in the documentation. If set to NO
|
434 |
+
# only classes defined in header files are included. Does not have any effect
|
435 |
+
# for Java sources.
|
436 |
+
# The default value is: YES.
|
437 |
+
|
438 |
+
EXTRACT_LOCAL_CLASSES = YES
|
439 |
+
|
440 |
+
# This flag is only useful for Objective-C code. When set to YES local methods,
|
441 |
+
# which are defined in the implementation section but not in the interface are
|
442 |
+
# included in the documentation. If set to NO only methods in the interface are
|
443 |
+
# included.
|
444 |
+
# The default value is: NO.
|
445 |
+
|
446 |
+
EXTRACT_LOCAL_METHODS = NO
|
447 |
+
|
448 |
+
# If this flag is set to YES, the members of anonymous namespaces will be
|
449 |
+
# extracted and appear in the documentation as a namespace called
|
450 |
+
# 'anonymous_namespace{file}', where file will be replaced with the base name of
|
451 |
+
# the file that contains the anonymous namespace. By default anonymous namespace
|
452 |
+
# are hidden.
|
453 |
+
# The default value is: NO.
|
454 |
+
|
455 |
+
EXTRACT_ANON_NSPACES = NO
|
456 |
+
|
457 |
+
# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
|
458 |
+
# undocumented members inside documented classes or files. If set to NO these
|
459 |
+
# members will be included in the various overviews, but no documentation
|
460 |
+
# section is generated. This option has no effect if EXTRACT_ALL is enabled.
|
461 |
+
# The default value is: NO.
|
462 |
+
|
463 |
+
HIDE_UNDOC_MEMBERS = NO
|
464 |
+
|
465 |
+
# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
|
466 |
+
# undocumented classes that are normally visible in the class hierarchy. If set
|
467 |
+
# to NO these classes will be included in the various overviews. This option has
|
468 |
+
# no effect if EXTRACT_ALL is enabled.
|
469 |
+
# The default value is: NO.
|
470 |
+
|
471 |
+
HIDE_UNDOC_CLASSES = NO
|
472 |
+
|
473 |
+
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
|
474 |
+
# (class|struct|union) declarations. If set to NO these declarations will be
|
475 |
+
# included in the documentation.
|
476 |
+
# The default value is: NO.
|
477 |
+
|
478 |
+
HIDE_FRIEND_COMPOUNDS = NO
|
479 |
+
|
480 |
+
# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
|
481 |
+
# documentation blocks found inside the body of a function. If set to NO these
|
482 |
+
# blocks will be appended to the function's detailed documentation block.
|
483 |
+
# The default value is: NO.
|
484 |
+
|
485 |
+
HIDE_IN_BODY_DOCS = NO
|
486 |
+
|
487 |
+
# The INTERNAL_DOCS tag determines if documentation that is typed after a
|
488 |
+
# \internal command is included. If the tag is set to NO then the documentation
|
489 |
+
# will be excluded. Set it to YES to include the internal documentation.
|
490 |
+
# The default value is: NO.
|
491 |
+
|
492 |
+
INTERNAL_DOCS = NO
|
493 |
+
|
494 |
+
# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
|
495 |
+
# names in lower-case letters. If set to YES upper-case letters are also
|
496 |
+
# allowed. This is useful if you have classes or files whose names only differ
|
497 |
+
# in case and if your file system supports case sensitive file names. Windows
|
498 |
+
# and Mac users are advised to set this option to NO.
|
499 |
+
# The default value is: system dependent.
|
500 |
+
|
501 |
+
CASE_SENSE_NAMES = NO
|
502 |
+
|
503 |
+
# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
|
504 |
+
# their full class and namespace scopes in the documentation. If set to YES the
|
505 |
+
# scope will be hidden.
|
506 |
+
# The default value is: NO.
|
507 |
+
|
508 |
+
HIDE_SCOPE_NAMES = YES
|
509 |
+
|
510 |
+
# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
|
511 |
+
# the files that are included by a file in the documentation of that file.
|
512 |
+
# The default value is: YES.
|
513 |
+
|
514 |
+
SHOW_INCLUDE_FILES = YES
|
515 |
+
|
516 |
+
# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
|
517 |
+
# grouped member an include statement to the documentation, telling the reader
|
518 |
+
# which file to include in order to use the member.
|
519 |
+
# The default value is: NO.
|
520 |
+
|
521 |
+
SHOW_GROUPED_MEMB_INC = NO
|
522 |
+
|
523 |
+
# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
|
524 |
+
# files with double quotes in the documentation rather than with sharp brackets.
|
525 |
+
# The default value is: NO.
|
526 |
+
|
527 |
+
FORCE_LOCAL_INCLUDES = NO
|
528 |
+
|
529 |
+
# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
|
530 |
+
# documentation for inline members.
|
531 |
+
# The default value is: YES.
|
532 |
+
|
533 |
+
INLINE_INFO = YES
|
534 |
+
|
535 |
+
# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
|
536 |
+
# (detailed) documentation of file and class members alphabetically by member
|
537 |
+
# name. If set to NO the members will appear in declaration order.
|
538 |
+
# The default value is: YES.
|
539 |
+
|
540 |
+
SORT_MEMBER_DOCS = YES
|
541 |
+
|
542 |
+
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
|
543 |
+
# descriptions of file, namespace and class members alphabetically by member
|
544 |
+
# name. If set to NO the members will appear in declaration order. Note that
|
545 |
+
# this will also influence the order of the classes in the class list.
|
546 |
+
# The default value is: NO.
|
547 |
+
|
548 |
+
SORT_BRIEF_DOCS = NO
|
549 |
+
|
550 |
+
# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
|
551 |
+
# (brief and detailed) documentation of class members so that constructors and
|
552 |
+
# destructors are listed first. If set to NO the constructors will appear in the
|
553 |
+
# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
|
554 |
+
# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
|
555 |
+
# member documentation.
|
556 |
+
# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
|
557 |
+
# detailed member documentation.
|
558 |
+
# The default value is: NO.
|
559 |
+
|
560 |
+
SORT_MEMBERS_CTORS_1ST = NO
|
561 |
+
|
562 |
+
# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
|
563 |
+
# of group names into alphabetical order. If set to NO the group names will
|
564 |
+
# appear in their defined order.
|
565 |
+
# The default value is: NO.
|
566 |
+
|
567 |
+
SORT_GROUP_NAMES = NO
|
568 |
+
|
569 |
+
# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
|
570 |
+
# fully-qualified names, including namespaces. If set to NO, the class list will
|
571 |
+
# be sorted only by class name, not including the namespace part.
|
572 |
+
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
|
573 |
+
# Note: This option applies only to the class list, not to the alphabetical
|
574 |
+
# list.
|
575 |
+
# The default value is: NO.
|
576 |
+
|
577 |
+
SORT_BY_SCOPE_NAME = NO
|
578 |
+
|
579 |
+
# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
|
580 |
+
# type resolution of all parameters of a function it will reject a match between
|
581 |
+
# the prototype and the implementation of a member function even if there is
|
582 |
+
# only one candidate or it is obvious which candidate to choose by doing a
|
583 |
+
# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
|
584 |
+
# accept a match between prototype and implementation in such cases.
|
585 |
+
# The default value is: NO.
|
586 |
+
|
587 |
+
STRICT_PROTO_MATCHING = NO
|
588 |
+
|
589 |
+
# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
|
590 |
+
# todo list. This list is created by putting \todo commands in the
|
591 |
+
# documentation.
|
592 |
+
# The default value is: YES.
|
593 |
+
|
594 |
+
GENERATE_TODOLIST = YES
|
595 |
+
|
596 |
+
# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
|
597 |
+
# test list. This list is created by putting \test commands in the
|
598 |
+
# documentation.
|
599 |
+
# The default value is: YES.
|
600 |
+
|
601 |
+
GENERATE_TESTLIST = YES
|
602 |
+
|
603 |
+
# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
|
604 |
+
# list. This list is created by putting \bug commands in the documentation.
|
605 |
+
# The default value is: YES.
|
606 |
+
|
607 |
+
GENERATE_BUGLIST = YES
|
608 |
+
|
609 |
+
# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
|
610 |
+
# the deprecated list. This list is created by putting \deprecated commands in
|
611 |
+
# the documentation.
|
612 |
+
# The default value is: YES.
|
613 |
+
|
614 |
+
GENERATE_DEPRECATEDLIST= YES
|
615 |
+
|
616 |
+
# The ENABLED_SECTIONS tag can be used to enable conditional documentation
|
617 |
+
# sections, marked by \if <section_label> ... \endif and \cond <section_label>
|
618 |
+
# ... \endcond blocks.
|
619 |
+
|
620 |
+
ENABLED_SECTIONS =
|
621 |
+
|
622 |
+
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
|
623 |
+
# initial value of a variable or macro / define can have for it to appear in the
|
624 |
+
# documentation. If the initializer consists of more lines than specified here
|
625 |
+
# it will be hidden. Use a value of 0 to hide initializers completely. The
|
626 |
+
# appearance of the value of individual variables and macros / defines can be
|
627 |
+
# controlled using \showinitializer or \hideinitializer command in the
|
628 |
+
# documentation regardless of this setting.
|
629 |
+
# Minimum value: 0, maximum value: 10000, default value: 30.
|
630 |
+
|
631 |
+
MAX_INITIALIZER_LINES = 30
|
632 |
+
|
633 |
+
# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
|
634 |
+
# the bottom of the documentation of classes and structs. If set to YES the list
|
635 |
+
# will mention the files that were used to generate the documentation.
|
636 |
+
# The default value is: YES.
|
637 |
+
|
638 |
+
SHOW_USED_FILES = YES
|
639 |
+
|
640 |
+
# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
|
641 |
+
# will remove the Files entry from the Quick Index and from the Folder Tree View
|
642 |
+
# (if specified).
|
643 |
+
# The default value is: YES.
|
644 |
+
|
645 |
+
SHOW_FILES = YES
|
646 |
+
|
647 |
+
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
|
648 |
+
# page. This will remove the Namespaces entry from the Quick Index and from the
|
649 |
+
# Folder Tree View (if specified).
|
650 |
+
# The default value is: YES.
|
651 |
+
|
652 |
+
SHOW_NAMESPACES = NO
|
653 |
+
|
654 |
+
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
|
655 |
+
# doxygen should invoke to get the current version for each file (typically from
|
656 |
+
# the version control system). Doxygen will invoke the program by executing (via
|
657 |
+
# popen()) the command command input-file, where command is the value of the
|
658 |
+
# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
|
659 |
+
# by doxygen. Whatever the program writes to standard output is used as the file
|
660 |
+
# version. For an example see the documentation.
|
661 |
+
|
662 |
+
FILE_VERSION_FILTER =
|
663 |
+
|
664 |
+
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
|
665 |
+
# by doxygen. The layout file controls the global structure of the generated
|
666 |
+
# output files in an output format independent way. To create the layout file
|
667 |
+
# that represents doxygen's defaults, run doxygen with the -l option. You can
|
668 |
+
# optionally specify a file name after the option, if omitted DoxygenLayout.xml
|
669 |
+
# will be used as the name of the layout file.
|
670 |
+
#
|
671 |
+
# Note that if you run doxygen from a directory containing a file called
|
672 |
+
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
|
673 |
+
# tag is left empty.
|
674 |
+
|
675 |
+
LAYOUT_FILE =
|
676 |
+
|
677 |
+
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
|
678 |
+
# the reference definitions. This must be a list of .bib files. The .bib
|
679 |
+
# extension is automatically appended if omitted. This requires the bibtex tool
|
680 |
+
# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
|
681 |
+
# For LaTeX the style of the bibliography can be controlled using
|
682 |
+
# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
|
683 |
+
# search path. Do not use file names with spaces, bibtex cannot handle them. See
|
684 |
+
# also \cite for info how to create references.
|
685 |
+
|
686 |
+
CITE_BIB_FILES =
|
687 |
+
|
688 |
+
#---------------------------------------------------------------------------
|
689 |
+
# Configuration options related to warning and progress messages
|
690 |
+
#---------------------------------------------------------------------------
|
691 |
+
|
692 |
+
# The QUIET tag can be used to turn on/off the messages that are generated to
|
693 |
+
# standard output by doxygen. If QUIET is set to YES this implies that the
|
694 |
+
# messages are off.
|
695 |
+
# The default value is: NO.
|
696 |
+
|
697 |
+
QUIET = NO
|
698 |
+
|
699 |
+
# The WARNINGS tag can be used to turn on/off the warning messages that are
|
700 |
+
# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
|
701 |
+
# this implies that the warnings are on.
|
702 |
+
#
|
703 |
+
# Tip: Turn warnings on while writing the documentation.
|
704 |
+
# The default value is: YES.
|
705 |
+
|
706 |
+
WARNINGS = YES
|
707 |
+
|
708 |
+
# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
|
709 |
+
# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
|
710 |
+
# will automatically be disabled.
|
711 |
+
# The default value is: YES.
|
712 |
+
|
713 |
+
WARN_IF_UNDOCUMENTED = YES
|
714 |
+
|
715 |
+
# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
|
716 |
+
# potential errors in the documentation, such as not documenting some parameters
|
717 |
+
# in a documented function, or documenting parameters that don't exist or using
|
718 |
+
# markup commands wrongly.
|
719 |
+
# The default value is: YES.
|
720 |
+
|
721 |
+
WARN_IF_DOC_ERROR = YES
|
722 |
+
|
723 |
+
# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
|
724 |
+
# are documented, but have no documentation for their parameters or return
|
725 |
+
# value. If set to NO doxygen will only warn about wrong or incomplete parameter
|
726 |
+
# documentation, but not about the absence of documentation.
|
727 |
+
# The default value is: NO.
|
728 |
+
|
729 |
+
WARN_NO_PARAMDOC = NO
|
730 |
+
|
731 |
+
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
|
732 |
+
# can produce. The string should contain the $file, $line, and $text tags, which
|
733 |
+
# will be replaced by the file and line number from which the warning originated
|
734 |
+
# and the warning text. Optionally the format may contain $version, which will
|
735 |
+
# be replaced by the version of the file (if it could be obtained via
|
736 |
+
# FILE_VERSION_FILTER)
|
737 |
+
# The default value is: $file:$line: $text.
|
738 |
+
|
739 |
+
WARN_FORMAT = "$file:$line: $text"
|
740 |
+
|
741 |
+
# The WARN_LOGFILE tag can be used to specify a file to which warning and error
|
742 |
+
# messages should be written. If left blank the output is written to standard
|
743 |
+
# error (stderr).
|
744 |
+
|
745 |
+
WARN_LOGFILE =
|
746 |
+
|
747 |
+
#---------------------------------------------------------------------------
|
748 |
+
# Configuration options related to the input files
|
749 |
+
#---------------------------------------------------------------------------
|
750 |
+
|
751 |
+
# The INPUT tag is used to specify the files and/or directories that contain
|
752 |
+
# documented source files. You may enter file names like myfile.cpp or
|
753 |
+
# directories like /usr/src/myproject. Separate the files or directories with
|
754 |
+
# spaces.
|
755 |
+
# Note: If this tag is empty the current directory is searched.
|
756 |
+
|
757 |
+
INPUT =
|
758 |
+
|
759 |
+
# This tag can be used to specify the character encoding of the source files
|
760 |
+
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
|
761 |
+
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
|
762 |
+
# documentation (see: http://www.gnu.org/software/libiconv) for the list of
|
763 |
+
# possible encodings.
|
764 |
+
# The default value is: UTF-8.
|
765 |
+
|
766 |
+
INPUT_ENCODING = UTF-8
|
767 |
+
|
768 |
+
# If the value of the INPUT tag contains directories, you can use the
|
769 |
+
# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
|
770 |
+
# *.h) to filter out the source-files in the directories. If left blank the
|
771 |
+
# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
|
772 |
+
# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
|
773 |
+
# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
|
774 |
+
# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
|
775 |
+
# *.qsf, *.as and *.js.
|
776 |
+
|
777 |
+
FILE_PATTERNS =
|
778 |
+
|
779 |
+
# The RECURSIVE tag can be used to specify whether or not subdirectories should
|
780 |
+
# be searched for input files as well.
|
781 |
+
# The default value is: NO.
|
782 |
+
|
783 |
+
RECURSIVE = YES
|
784 |
+
|
785 |
+
# The EXCLUDE tag can be used to specify files and/or directories that should be
|
786 |
+
# excluded from the INPUT source files. This way you can easily exclude a
|
787 |
+
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
788 |
+
#
|
789 |
+
# Note that relative paths are relative to the directory from which doxygen is
|
790 |
+
# run.
|
791 |
+
|
792 |
+
EXCLUDE = tests
|
793 |
+
|
794 |
+
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
|
795 |
+
# directories that are symbolic links (a Unix file system feature) are excluded
|
796 |
+
# from the input.
|
797 |
+
# The default value is: NO.
|
798 |
+
|
799 |
+
EXCLUDE_SYMLINKS = NO
|
800 |
+
|
801 |
+
# If the value of the INPUT tag contains directories, you can use the
|
802 |
+
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
|
803 |
+
# certain files from those directories.
|
804 |
+
#
|
805 |
+
# Note that the wildcards are matched against the file with absolute path, so to
|
806 |
+
# exclude all test directories for example use the pattern */test/*
|
807 |
+
|
808 |
+
EXCLUDE_PATTERNS =
|
809 |
+
|
810 |
+
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
|
811 |
+
# (namespaces, classes, functions, etc.) that should be excluded from the
|
812 |
+
# output. The symbol name can be a fully qualified name, a word, or if the
|
813 |
+
# wildcard * is used, a substring. Examples: ANamespace, AClass,
|
814 |
+
# AClass::ANamespace, ANamespace::*Test
|
815 |
+
#
|
816 |
+
# Note that the wildcards are matched against the file with absolute path, so to
|
817 |
+
# exclude all test directories use the pattern */test/*
|
818 |
+
|
819 |
+
EXCLUDE_SYMBOLS =
|
820 |
+
|
821 |
+
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
|
822 |
+
# that contain example code fragments that are included (see the \include
|
823 |
+
# command).
|
824 |
+
|
825 |
+
EXAMPLE_PATH =
|
826 |
+
|
827 |
+
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
|
828 |
+
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
|
829 |
+
# *.h) to filter out the source-files in the directories. If left blank all
|
830 |
+
# files are included.
|
831 |
+
|
832 |
+
EXAMPLE_PATTERNS =
|
833 |
+
|
834 |
+
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
|
835 |
+
# searched for input files to be used with the \include or \dontinclude commands
|
836 |
+
# irrespective of the value of the RECURSIVE tag.
|
837 |
+
# The default value is: NO.
|
838 |
+
|
839 |
+
EXAMPLE_RECURSIVE = NO
|
840 |
+
|
841 |
+
# The IMAGE_PATH tag can be used to specify one or more files or directories
|
842 |
+
# that contain images that are to be included in the documentation (see the
|
843 |
+
# \image command).
|
844 |
+
|
845 |
+
IMAGE_PATH =
|
846 |
+
|
847 |
+
# The INPUT_FILTER tag can be used to specify a program that doxygen should
|
848 |
+
# invoke to filter for each input file. Doxygen will invoke the filter program
|
849 |
+
# by executing (via popen()) the command:
|
850 |
+
#
|
851 |
+
# <filter> <input-file>
|
852 |
+
#
|
853 |
+
# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
|
854 |
+
# name of an input file. Doxygen will then use the output that the filter
|
855 |
+
# program writes to standard output. If FILTER_PATTERNS is specified, this tag
|
856 |
+
# will be ignored.
|
857 |
+
#
|
858 |
+
# Note that the filter must not add or remove lines; it is applied before the
|
859 |
+
# code is scanned, but not when the output code is generated. If lines are added
|
860 |
+
# or removed, the anchors will not be placed correctly.
|
861 |
+
|
862 |
+
INPUT_FILTER =
|
863 |
+
|
864 |
+
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
|
865 |
+
# basis. Doxygen will compare the file name with each pattern and apply the
|
866 |
+
# filter if there is a match. The filters are a list of the form: pattern=filter
|
867 |
+
# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
|
868 |
+
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
|
869 |
+
# patterns match the file name, INPUT_FILTER is applied.
|
870 |
+
|
871 |
+
FILTER_PATTERNS =
|
872 |
+
|
873 |
+
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
|
874 |
+
# INPUT_FILTER ) will also be used to filter the input files that are used for
|
875 |
+
# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
|
876 |
+
# The default value is: NO.
|
877 |
+
|
878 |
+
FILTER_SOURCE_FILES = NO
|
879 |
+
|
880 |
+
# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
|
881 |
+
# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
|
882 |
+
# it is also possible to disable source filtering for a specific pattern using
|
883 |
+
# *.ext= (so without naming a filter).
|
884 |
+
# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
|
885 |
+
|
886 |
+
FILTER_SOURCE_PATTERNS =
|
887 |
+
|
888 |
+
# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
|
889 |
+
# is part of the input, its contents will be placed on the main page
|
890 |
+
# (index.html). This can be useful if you have a project on for instance GitHub
|
891 |
+
# and want to reuse the introduction page also for the doxygen output.
|
892 |
+
|
893 |
+
USE_MDFILE_AS_MAINPAGE = README.md
|
894 |
+
|
895 |
+
#---------------------------------------------------------------------------
|
896 |
+
# Configuration options related to source browsing
|
897 |
+
#---------------------------------------------------------------------------
|
898 |
+
|
899 |
+
# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
|
900 |
+
# generated. Documented entities will be cross-referenced with these sources.
|
901 |
+
#
|
902 |
+
# Note: To get rid of all source code in the generated output, make sure that
|
903 |
+
# also VERBATIM_HEADERS is set to NO.
|
904 |
+
# The default value is: NO.
|
905 |
+
|
906 |
+
SOURCE_BROWSER = NO
|
907 |
+
|
908 |
+
# Setting the INLINE_SOURCES tag to YES will include the body of functions,
|
909 |
+
# classes and enums directly into the documentation.
|
910 |
+
# The default value is: NO.
|
911 |
+
|
912 |
+
INLINE_SOURCES = NO
|
913 |
+
|
914 |
+
# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
|
915 |
+
# special comment blocks from generated source code fragments. Normal C, C++ and
|
916 |
+
# Fortran comments will always remain visible.
|
917 |
+
# The default value is: YES.
|
918 |
+
|
919 |
+
STRIP_CODE_COMMENTS = YES
|
920 |
+
|
921 |
+
# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
|
922 |
+
# function all documented functions referencing it will be listed.
|
923 |
+
# The default value is: NO.
|
924 |
+
|
925 |
+
REFERENCED_BY_RELATION = NO
|
926 |
+
|
927 |
+
# If the REFERENCES_RELATION tag is set to YES then for each documented function
|
928 |
+
# all documented entities called/used by that function will be listed.
|
929 |
+
# The default value is: NO.
|
930 |
+
|
931 |
+
REFERENCES_RELATION = NO
|
932 |
+
|
933 |
+
# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
|
934 |
+
# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
|
935 |
+
# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
|
936 |
+
# link to the documentation.
|
937 |
+
# The default value is: YES.
|
938 |
+
|
939 |
+
REFERENCES_LINK_SOURCE = YES
|
940 |
+
|
941 |
+
# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
|
942 |
+
# source code will show a tooltip with additional information such as prototype,
|
943 |
+
# brief description and links to the definition and documentation. Since this
|
944 |
+
# will make the HTML file larger and loading of large files a bit slower, you
|
945 |
+
# can opt to disable this feature.
|
946 |
+
# The default value is: YES.
|
947 |
+
# This tag requires that the tag SOURCE_BROWSER is set to YES.
|
948 |
+
|
949 |
+
SOURCE_TOOLTIPS = YES
|
950 |
+
|
951 |
+
# If the USE_HTAGS tag is set to YES then the references to source code will
|
952 |
+
# point to the HTML generated by the htags(1) tool instead of doxygen built-in
|
953 |
+
# source browser. The htags tool is part of GNU's global source tagging system
|
954 |
+
# (see http://www.gnu.org/software/global/global.html). You will need version
|
955 |
+
# 4.8.6 or higher.
|
956 |
+
#
|
957 |
+
# To use it do the following:
|
958 |
+
# - Install the latest version of global
|
959 |
+
# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
|
960 |
+
# - Make sure the INPUT points to the root of the source tree
|
961 |
+
# - Run doxygen as normal
|
962 |
+
#
|
963 |
+
# Doxygen will invoke htags (and that will in turn invoke gtags), so these
|
964 |
+
# tools must be available from the command line (i.e. in the search path).
|
965 |
+
#
|
966 |
+
# The result: instead of the source browser generated by doxygen, the links to
|
967 |
+
# source code will now point to the output of htags.
|
968 |
+
# The default value is: NO.
|
969 |
+
# This tag requires that the tag SOURCE_BROWSER is set to YES.
|
970 |
+
|
971 |
+
USE_HTAGS = NO
|
972 |
+
|
973 |
+
# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
|
974 |
+
# verbatim copy of the header file for each class for which an include is
|
975 |
+
# specified. Set to NO to disable this.
|
976 |
+
# See also: Section \class.
|
977 |
+
# The default value is: YES.
|
978 |
+
|
979 |
+
VERBATIM_HEADERS = YES
|
980 |
+
|
981 |
+
#---------------------------------------------------------------------------
|
982 |
+
# Configuration options related to the alphabetical class index
|
983 |
+
#---------------------------------------------------------------------------
|
984 |
+
|
985 |
+
# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
|
986 |
+
# compounds will be generated. Enable this if the project contains a lot of
|
987 |
+
# classes, structs, unions or interfaces.
|
988 |
+
# The default value is: YES.
|
989 |
+
|
990 |
+
ALPHABETICAL_INDEX = YES
|
991 |
+
|
992 |
+
# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
|
993 |
+
# which the alphabetical index list will be split.
|
994 |
+
# Minimum value: 1, maximum value: 20, default value: 5.
|
995 |
+
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
|
996 |
+
|
997 |
+
COLS_IN_ALPHA_INDEX = 5
|
998 |
+
|
999 |
+
# In case all classes in a project start with a common prefix, all classes will
|
1000 |
+
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
|
1001 |
+
# can be used to specify a prefix (or a list of prefixes) that should be ignored
|
1002 |
+
# while generating the index headers.
|
1003 |
+
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
|
1004 |
+
|
1005 |
+
IGNORE_PREFIX =
|
1006 |
+
|
1007 |
+
#---------------------------------------------------------------------------
|
1008 |
+
# Configuration options related to the HTML output
|
1009 |
+
#---------------------------------------------------------------------------
|
1010 |
+
|
1011 |
+
# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
|
1012 |
+
# The default value is: YES.
|
1013 |
+
|
1014 |
+
GENERATE_HTML = YES
|
1015 |
+
|
1016 |
+
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
|
1017 |
+
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
|
1018 |
+
# it.
|
1019 |
+
# The default directory is: html.
|
1020 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1021 |
+
|
1022 |
+
HTML_OUTPUT = .
|
1023 |
+
|
1024 |
+
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
|
1025 |
+
# generated HTML page (for example: .htm, .php, .asp).
|
1026 |
+
# The default value is: .html.
|
1027 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1028 |
+
|
1029 |
+
HTML_FILE_EXTENSION = .html
|
1030 |
+
|
1031 |
+
# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
|
1032 |
+
# each generated HTML page. If the tag is left blank doxygen will generate a
|
1033 |
+
# standard header.
|
1034 |
+
#
|
1035 |
+
# To get valid HTML the header file that includes any scripts and style sheets
|
1036 |
+
# that doxygen needs, which is dependent on the configuration options used (e.g.
|
1037 |
+
# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
|
1038 |
+
# default header using
|
1039 |
+
# doxygen -w html new_header.html new_footer.html new_stylesheet.css
|
1040 |
+
# YourConfigFile
|
1041 |
+
# and then modify the file new_header.html. See also section "Doxygen usage"
|
1042 |
+
# for information on how to generate the default header that doxygen normally
|
1043 |
+
# uses.
|
1044 |
+
# Note: The header is subject to change so you typically have to regenerate the
|
1045 |
+
# default header when upgrading to a newer version of doxygen. For a description
|
1046 |
+
# of the possible markers and block names see the documentation.
|
1047 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1048 |
+
|
1049 |
+
HTML_HEADER =
|
1050 |
+
|
1051 |
+
# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
|
1052 |
+
# generated HTML page. If the tag is left blank doxygen will generate a standard
|
1053 |
+
# footer. See HTML_HEADER for more information on how to generate a default
|
1054 |
+
# footer and what special commands can be used inside the footer. See also
|
1055 |
+
# section "Doxygen usage" for information on how to generate the default footer
|
1056 |
+
# that doxygen normally uses.
|
1057 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1058 |
+
|
1059 |
+
HTML_FOOTER =
|
1060 |
+
|
1061 |
+
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
|
1062 |
+
# sheet that is used by each HTML page. It can be used to fine-tune the look of
|
1063 |
+
# the HTML output. If left blank doxygen will generate a default style sheet.
|
1064 |
+
# See also section "Doxygen usage" for information on how to generate the style
|
1065 |
+
# sheet that doxygen normally uses.
|
1066 |
+
# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
|
1067 |
+
# it is more robust and this tag (HTML_STYLESHEET) will in the future become
|
1068 |
+
# obsolete.
|
1069 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1070 |
+
|
1071 |
+
HTML_STYLESHEET =
|
1072 |
+
|
1073 |
+
# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-
|
1074 |
+
# defined cascading style sheet that is included after the standard style sheets
|
1075 |
+
# created by doxygen. Using this option one can overrule certain style aspects.
|
1076 |
+
# This is preferred over using HTML_STYLESHEET since it does not replace the
|
1077 |
+
# standard style sheet and is therefor more robust against future updates.
|
1078 |
+
# Doxygen will copy the style sheet file to the output directory. For an example
|
1079 |
+
# see the documentation.
|
1080 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1081 |
+
|
1082 |
+
HTML_EXTRA_STYLESHEET =
|
1083 |
+
|
1084 |
+
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
|
1085 |
+
# other source files which should be copied to the HTML output directory. Note
|
1086 |
+
# that these files will be copied to the base HTML output directory. Use the
|
1087 |
+
# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
|
1088 |
+
# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
|
1089 |
+
# files will be copied as-is; there are no commands or markers available.
|
1090 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1091 |
+
|
1092 |
+
HTML_EXTRA_FILES =
|
1093 |
+
|
1094 |
+
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
|
1095 |
+
# will adjust the colors in the stylesheet and background images according to
|
1096 |
+
# this color. Hue is specified as an angle on a colorwheel, see
|
1097 |
+
# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
|
1098 |
+
# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
|
1099 |
+
# purple, and 360 is red again.
|
1100 |
+
# Minimum value: 0, maximum value: 359, default value: 220.
|
1101 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1102 |
+
|
1103 |
+
HTML_COLORSTYLE_HUE = 220
|
1104 |
+
|
1105 |
+
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
|
1106 |
+
# in the HTML output. For a value of 0 the output will use grayscales only. A
|
1107 |
+
# value of 255 will produce the most vivid colors.
|
1108 |
+
# Minimum value: 0, maximum value: 255, default value: 100.
|
1109 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1110 |
+
|
1111 |
+
HTML_COLORSTYLE_SAT = 100
|
1112 |
+
|
1113 |
+
# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
|
1114 |
+
# luminance component of the colors in the HTML output. Values below 100
|
1115 |
+
# gradually make the output lighter, whereas values above 100 make the output
|
1116 |
+
# darker. The value divided by 100 is the actual gamma applied, so 80 represents
|
1117 |
+
# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
|
1118 |
+
# change the gamma.
|
1119 |
+
# Minimum value: 40, maximum value: 240, default value: 80.
|
1120 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1121 |
+
|
1122 |
+
HTML_COLORSTYLE_GAMMA = 80
|
1123 |
+
|
1124 |
+
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
|
1125 |
+
# page will contain the date and time when the page was generated. Setting this
|
1126 |
+
# to NO can help when comparing the output of multiple runs.
|
1127 |
+
# The default value is: YES.
|
1128 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1129 |
+
|
1130 |
+
HTML_TIMESTAMP = YES
|
1131 |
+
|
1132 |
+
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
|
1133 |
+
# documentation will contain sections that can be hidden and shown after the
|
1134 |
+
# page has loaded.
|
1135 |
+
# The default value is: NO.
|
1136 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1137 |
+
|
1138 |
+
HTML_DYNAMIC_SECTIONS = NO
|
1139 |
+
|
1140 |
+
# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
|
1141 |
+
# shown in the various tree structured indices initially; the user can expand
|
1142 |
+
# and collapse entries dynamically later on. Doxygen will expand the tree to
|
1143 |
+
# such a level that at most the specified number of entries are visible (unless
|
1144 |
+
# a fully collapsed tree already exceeds this amount). So setting the number of
|
1145 |
+
# entries 1 will produce a full collapsed tree by default. 0 is a special value
|
1146 |
+
# representing an infinite number of entries and will result in a full expanded
|
1147 |
+
# tree by default.
|
1148 |
+
# Minimum value: 0, maximum value: 9999, default value: 100.
|
1149 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1150 |
+
|
1151 |
+
HTML_INDEX_NUM_ENTRIES = 100
|
1152 |
+
|
1153 |
+
# If the GENERATE_DOCSET tag is set to YES, additional index files will be
|
1154 |
+
# generated that can be used as input for Apple's Xcode 3 integrated development
|
1155 |
+
# environment (see: http://developer.apple.com/tools/xcode/), introduced with
|
1156 |
+
# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
|
1157 |
+
# Makefile in the HTML output directory. Running make will produce the docset in
|
1158 |
+
# that directory and running make install will install the docset in
|
1159 |
+
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
|
1160 |
+
# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
|
1161 |
+
# for more information.
|
1162 |
+
# The default value is: NO.
|
1163 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1164 |
+
|
1165 |
+
GENERATE_DOCSET = NO
|
1166 |
+
|
1167 |
+
# This tag determines the name of the docset feed. A documentation feed provides
|
1168 |
+
# an umbrella under which multiple documentation sets from a single provider
|
1169 |
+
# (such as a company or product suite) can be grouped.
|
1170 |
+
# The default value is: Doxygen generated docs.
|
1171 |
+
# This tag requires that the tag GENERATE_DOCSET is set to YES.
|
1172 |
+
|
1173 |
+
DOCSET_FEEDNAME = "Doxygen generated docs"
|
1174 |
+
|
1175 |
+
# This tag specifies a string that should uniquely identify the documentation
|
1176 |
+
# set bundle. This should be a reverse domain-name style string, e.g.
|
1177 |
+
# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
|
1178 |
+
# The default value is: org.doxygen.Project.
|
1179 |
+
# This tag requires that the tag GENERATE_DOCSET is set to YES.
|
1180 |
+
|
1181 |
+
DOCSET_BUNDLE_ID = org.doxygen.Project
|
1182 |
+
|
1183 |
+
# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
|
1184 |
+
# the documentation publisher. This should be a reverse domain-name style
|
1185 |
+
# string, e.g. com.mycompany.MyDocSet.documentation.
|
1186 |
+
# The default value is: org.doxygen.Publisher.
|
1187 |
+
# This tag requires that the tag GENERATE_DOCSET is set to YES.
|
1188 |
+
|
1189 |
+
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
|
1190 |
+
|
1191 |
+
# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
|
1192 |
+
# The default value is: Publisher.
|
1193 |
+
# This tag requires that the tag GENERATE_DOCSET is set to YES.
|
1194 |
+
|
1195 |
+
DOCSET_PUBLISHER_NAME = Publisher
|
1196 |
+
|
1197 |
+
# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
|
1198 |
+
# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
|
1199 |
+
# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
|
1200 |
+
# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
|
1201 |
+
# Windows.
|
1202 |
+
#
|
1203 |
+
# The HTML Help Workshop contains a compiler that can convert all HTML output
|
1204 |
+
# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
|
1205 |
+
# files are now used as the Windows 98 help format, and will replace the old
|
1206 |
+
# Windows help format (.hlp) on all Windows platforms in the future. Compressed
|
1207 |
+
# HTML files also contain an index, a table of contents, and you can search for
|
1208 |
+
# words in the documentation. The HTML workshop also contains a viewer for
|
1209 |
+
# compressed HTML files.
|
1210 |
+
# The default value is: NO.
|
1211 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1212 |
+
|
1213 |
+
GENERATE_HTMLHELP = NO
|
1214 |
+
|
1215 |
+
# The CHM_FILE tag can be used to specify the file name of the resulting .chm
|
1216 |
+
# file. You can add a path in front of the file if the result should not be
|
1217 |
+
# written to the html output directory.
|
1218 |
+
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
|
1219 |
+
|
1220 |
+
CHM_FILE =
|
1221 |
+
|
1222 |
+
# The HHC_LOCATION tag can be used to specify the location (absolute path
|
1223 |
+
# including file name) of the HTML help compiler ( hhc.exe). If non-empty
|
1224 |
+
# doxygen will try to run the HTML help compiler on the generated index.hhp.
|
1225 |
+
# The file has to be specified with full path.
|
1226 |
+
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
|
1227 |
+
|
1228 |
+
HHC_LOCATION =
|
1229 |
+
|
1230 |
+
# The GENERATE_CHI flag controls if a separate .chi index file is generated (
|
1231 |
+
# YES) or that it should be included in the master .chm file ( NO).
|
1232 |
+
# The default value is: NO.
|
1233 |
+
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
|
1234 |
+
|
1235 |
+
GENERATE_CHI = NO
|
1236 |
+
|
1237 |
+
# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
|
1238 |
+
# and project file content.
|
1239 |
+
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
|
1240 |
+
|
1241 |
+
CHM_INDEX_ENCODING =
|
1242 |
+
|
1243 |
+
# The BINARY_TOC flag controls whether a binary table of contents is generated (
|
1244 |
+
# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it
|
1245 |
+
# enables the Previous and Next buttons.
|
1246 |
+
# The default value is: NO.
|
1247 |
+
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
|
1248 |
+
|
1249 |
+
BINARY_TOC = NO
|
1250 |
+
|
1251 |
+
# The TOC_EXPAND flag can be set to YES to add extra items for group members to
|
1252 |
+
# the table of contents of the HTML help documentation and to the tree view.
|
1253 |
+
# The default value is: NO.
|
1254 |
+
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
|
1255 |
+
|
1256 |
+
TOC_EXPAND = NO
|
1257 |
+
|
1258 |
+
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
|
1259 |
+
# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
|
1260 |
+
# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
|
1261 |
+
# (.qch) of the generated HTML documentation.
|
1262 |
+
# The default value is: NO.
|
1263 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1264 |
+
|
1265 |
+
GENERATE_QHP = NO
|
1266 |
+
|
1267 |
+
# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
|
1268 |
+
# the file name of the resulting .qch file. The path specified is relative to
|
1269 |
+
# the HTML output folder.
|
1270 |
+
# This tag requires that the tag GENERATE_QHP is set to YES.
|
1271 |
+
|
1272 |
+
QCH_FILE =
|
1273 |
+
|
1274 |
+
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
|
1275 |
+
# Project output. For more information please see Qt Help Project / Namespace
|
1276 |
+
# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
|
1277 |
+
# The default value is: org.doxygen.Project.
|
1278 |
+
# This tag requires that the tag GENERATE_QHP is set to YES.
|
1279 |
+
|
1280 |
+
QHP_NAMESPACE = org.doxygen.Project
|
1281 |
+
|
1282 |
+
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
|
1283 |
+
# Help Project output. For more information please see Qt Help Project / Virtual
|
1284 |
+
# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
|
1285 |
+
# folders).
|
1286 |
+
# The default value is: doc.
|
1287 |
+
# This tag requires that the tag GENERATE_QHP is set to YES.
|
1288 |
+
|
1289 |
+
QHP_VIRTUAL_FOLDER = doc
|
1290 |
+
|
1291 |
+
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
|
1292 |
+
# filter to add. For more information please see Qt Help Project / Custom
|
1293 |
+
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
|
1294 |
+
# filters).
|
1295 |
+
# This tag requires that the tag GENERATE_QHP is set to YES.
|
1296 |
+
|
1297 |
+
QHP_CUST_FILTER_NAME =
|
1298 |
+
|
1299 |
+
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
|
1300 |
+
# custom filter to add. For more information please see Qt Help Project / Custom
|
1301 |
+
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
|
1302 |
+
# filters).
|
1303 |
+
# This tag requires that the tag GENERATE_QHP is set to YES.
|
1304 |
+
|
1305 |
+
QHP_CUST_FILTER_ATTRS =
|
1306 |
+
|
1307 |
+
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
|
1308 |
+
# project's filter section matches. Qt Help Project / Filter Attributes (see:
|
1309 |
+
# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
|
1310 |
+
# This tag requires that the tag GENERATE_QHP is set to YES.
|
1311 |
+
|
1312 |
+
QHP_SECT_FILTER_ATTRS =
|
1313 |
+
|
1314 |
+
# The QHG_LOCATION tag can be used to specify the location of Qt's
|
1315 |
+
# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
|
1316 |
+
# generated .qhp file.
|
1317 |
+
# This tag requires that the tag GENERATE_QHP is set to YES.
|
1318 |
+
|
1319 |
+
QHG_LOCATION =
|
1320 |
+
|
1321 |
+
# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
|
1322 |
+
# generated, together with the HTML files, they form an Eclipse help plugin. To
|
1323 |
+
# install this plugin and make it available under the help contents menu in
|
1324 |
+
# Eclipse, the contents of the directory containing the HTML and XML files needs
|
1325 |
+
# to be copied into the plugins directory of eclipse. The name of the directory
|
1326 |
+
# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
|
1327 |
+
# After copying Eclipse needs to be restarted before the help appears.
|
1328 |
+
# The default value is: NO.
|
1329 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1330 |
+
|
1331 |
+
GENERATE_ECLIPSEHELP = NO
|
1332 |
+
|
1333 |
+
# A unique identifier for the Eclipse help plugin. When installing the plugin
|
1334 |
+
# the directory name containing the HTML and XML files should also have this
|
1335 |
+
# name. Each documentation set should have its own identifier.
|
1336 |
+
# The default value is: org.doxygen.Project.
|
1337 |
+
# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
|
1338 |
+
|
1339 |
+
ECLIPSE_DOC_ID = org.doxygen.Project
|
1340 |
+
|
1341 |
+
# If you want full control over the layout of the generated HTML pages it might
|
1342 |
+
# be necessary to disable the index and replace it with your own. The
|
1343 |
+
# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
|
1344 |
+
# of each HTML page. A value of NO enables the index and the value YES disables
|
1345 |
+
# it. Since the tabs in the index contain the same information as the navigation
|
1346 |
+
# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
|
1347 |
+
# The default value is: NO.
|
1348 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1349 |
+
|
1350 |
+
DISABLE_INDEX = NO
|
1351 |
+
|
1352 |
+
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
|
1353 |
+
# structure should be generated to display hierarchical information. If the tag
|
1354 |
+
# value is set to YES, a side panel will be generated containing a tree-like
|
1355 |
+
# index structure (just like the one that is generated for HTML Help). For this
|
1356 |
+
# to work a browser that supports JavaScript, DHTML, CSS and frames is required
|
1357 |
+
# (i.e. any modern browser). Windows users are probably better off using the
|
1358 |
+
# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
|
1359 |
+
# further fine-tune the look of the index. As an example, the default style
|
1360 |
+
# sheet generated by doxygen has an example that shows how to put an image at
|
1361 |
+
# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
|
1362 |
+
# the same information as the tab index, you could consider setting
|
1363 |
+
# DISABLE_INDEX to YES when enabling this option.
|
1364 |
+
# The default value is: NO.
|
1365 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1366 |
+
|
1367 |
+
GENERATE_TREEVIEW = NO
|
1368 |
+
|
1369 |
+
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
|
1370 |
+
# doxygen will group on one line in the generated HTML documentation.
|
1371 |
+
#
|
1372 |
+
# Note that a value of 0 will completely suppress the enum values from appearing
|
1373 |
+
# in the overview section.
|
1374 |
+
# Minimum value: 0, maximum value: 20, default value: 4.
|
1375 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1376 |
+
|
1377 |
+
ENUM_VALUES_PER_LINE = 4
|
1378 |
+
|
1379 |
+
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
|
1380 |
+
# to set the initial width (in pixels) of the frame in which the tree is shown.
|
1381 |
+
# Minimum value: 0, maximum value: 1500, default value: 250.
|
1382 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1383 |
+
|
1384 |
+
TREEVIEW_WIDTH = 250
|
1385 |
+
|
1386 |
+
# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
|
1387 |
+
# external symbols imported via tag files in a separate window.
|
1388 |
+
# The default value is: NO.
|
1389 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1390 |
+
|
1391 |
+
EXT_LINKS_IN_WINDOW = NO
|
1392 |
+
|
1393 |
+
# Use this tag to change the font size of LaTeX formulas included as images in
|
1394 |
+
# the HTML documentation. When you change the font size after a successful
|
1395 |
+
# doxygen run you need to manually remove any form_*.png images from the HTML
|
1396 |
+
# output directory to force them to be regenerated.
|
1397 |
+
# Minimum value: 8, maximum value: 50, default value: 10.
|
1398 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1399 |
+
|
1400 |
+
FORMULA_FONTSIZE = 10
|
1401 |
+
|
1402 |
+
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
|
1403 |
+
# generated for formulas are transparent PNGs. Transparent PNGs are not
|
1404 |
+
# supported properly for IE 6.0, but are supported on all modern browsers.
|
1405 |
+
#
|
1406 |
+
# Note that when changing this option you need to delete any form_*.png files in
|
1407 |
+
# the HTML output directory before the changes have effect.
|
1408 |
+
# The default value is: YES.
|
1409 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1410 |
+
|
1411 |
+
FORMULA_TRANSPARENT = YES
|
1412 |
+
|
1413 |
+
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
|
1414 |
+
# http://www.mathjax.org) which uses client side Javascript for the rendering
|
1415 |
+
# instead of using prerendered bitmaps. Use this if you do not have LaTeX
|
1416 |
+
# installed or if you want to formulas look prettier in the HTML output. When
|
1417 |
+
# enabled you may also need to install MathJax separately and configure the path
|
1418 |
+
# to it using the MATHJAX_RELPATH option.
|
1419 |
+
# The default value is: NO.
|
1420 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1421 |
+
|
1422 |
+
USE_MATHJAX = NO
|
1423 |
+
|
1424 |
+
# When MathJax is enabled you can set the default output format to be used for
|
1425 |
+
# the MathJax output. See the MathJax site (see:
|
1426 |
+
# http://docs.mathjax.org/en/latest/output.html) for more details.
|
1427 |
+
# Possible values are: HTML-CSS (which is slower, but has the best
|
1428 |
+
# compatibility), NativeMML (i.e. MathML) and SVG.
|
1429 |
+
# The default value is: HTML-CSS.
|
1430 |
+
# This tag requires that the tag USE_MATHJAX is set to YES.
|
1431 |
+
|
1432 |
+
MATHJAX_FORMAT = HTML-CSS
|
1433 |
+
|
1434 |
+
# When MathJax is enabled you need to specify the location relative to the HTML
|
1435 |
+
# output directory using the MATHJAX_RELPATH option. The destination directory
|
1436 |
+
# should contain the MathJax.js script. For instance, if the mathjax directory
|
1437 |
+
# is located at the same level as the HTML output directory, then
|
1438 |
+
# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
|
1439 |
+
# Content Delivery Network so you can quickly see the result without installing
|
1440 |
+
# MathJax. However, it is strongly recommended to install a local copy of
|
1441 |
+
# MathJax from http://www.mathjax.org before deployment.
|
1442 |
+
# The default value is: http://cdn.mathjax.org/mathjax/latest.
|
1443 |
+
# This tag requires that the tag USE_MATHJAX is set to YES.
|
1444 |
+
|
1445 |
+
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
|
1446 |
+
|
1447 |
+
# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
|
1448 |
+
# extension names that should be enabled during MathJax rendering. For example
|
1449 |
+
# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
|
1450 |
+
# This tag requires that the tag USE_MATHJAX is set to YES.
|
1451 |
+
|
1452 |
+
MATHJAX_EXTENSIONS =
|
1453 |
+
|
1454 |
+
# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
|
1455 |
+
# of code that will be used on startup of the MathJax code. See the MathJax site
|
1456 |
+
# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
|
1457 |
+
# example see the documentation.
|
1458 |
+
# This tag requires that the tag USE_MATHJAX is set to YES.
|
1459 |
+
|
1460 |
+
MATHJAX_CODEFILE =
|
1461 |
+
|
1462 |
+
# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
|
1463 |
+
# the HTML output. The underlying search engine uses javascript and DHTML and
|
1464 |
+
# should work on any modern browser. Note that when using HTML help
|
1465 |
+
# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
|
1466 |
+
# there is already a search function so this one should typically be disabled.
|
1467 |
+
# For large projects the javascript based search engine can be slow, then
|
1468 |
+
# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
|
1469 |
+
# search using the keyboard; to jump to the search box use <access key> + S
|
1470 |
+
# (what the <access key> is depends on the OS and browser, but it is typically
|
1471 |
+
# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
|
1472 |
+
# key> to jump into the search results window, the results can be navigated
|
1473 |
+
# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
|
1474 |
+
# the search. The filter options can be selected when the cursor is inside the
|
1475 |
+
# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
|
1476 |
+
# to select a filter and <Enter> or <escape> to activate or cancel the filter
|
1477 |
+
# option.
|
1478 |
+
# The default value is: YES.
|
1479 |
+
# This tag requires that the tag GENERATE_HTML is set to YES.
|
1480 |
+
|
1481 |
+
SEARCHENGINE = YES
|
1482 |
+
|
1483 |
+
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
|
1484 |
+
# implemented using a web server instead of a web client using Javascript. There
|
1485 |
+
# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
|
1486 |
+
# setting. When disabled, doxygen will generate a PHP script for searching and
|
1487 |
+
# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
|
1488 |
+
# and searching needs to be provided by external tools. See the section
|
1489 |
+
# "External Indexing and Searching" for details.
|
1490 |
+
# The default value is: NO.
|
1491 |
+
# This tag requires that the tag SEARCHENGINE is set to YES.
|
1492 |
+
|
1493 |
+
SERVER_BASED_SEARCH = NO
|
1494 |
+
|
1495 |
+
# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
|
1496 |
+
# script for searching. Instead the search results are written to an XML file
|
1497 |
+
# which needs to be processed by an external indexer. Doxygen will invoke an
|
1498 |
+
# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
|
1499 |
+
# search results.
|
1500 |
+
#
|
1501 |
+
# Doxygen ships with an example indexer ( doxyindexer) and search engine
|
1502 |
+
# (doxysearch.cgi) which are based on the open source search engine library
|
1503 |
+
# Xapian (see: http://xapian.org/).
|
1504 |
+
#
|
1505 |
+
# See the section "External Indexing and Searching" for details.
|
1506 |
+
# The default value is: NO.
|
1507 |
+
# This tag requires that the tag SEARCHENGINE is set to YES.
|
1508 |
+
|
1509 |
+
EXTERNAL_SEARCH = NO
|
1510 |
+
|
1511 |
+
# The SEARCHENGINE_URL should point to a search engine hosted by a web server
|
1512 |
+
# which will return the search results when EXTERNAL_SEARCH is enabled.
|
1513 |
+
#
|
1514 |
+
# Doxygen ships with an example indexer ( doxyindexer) and search engine
|
1515 |
+
# (doxysearch.cgi) which are based on the open source search engine library
|
1516 |
+
# Xapian (see: http://xapian.org/). See the section "External Indexing and
|
1517 |
+
# Searching" for details.
|
1518 |
+
# This tag requires that the tag SEARCHENGINE is set to YES.
|
1519 |
+
|
1520 |
+
SEARCHENGINE_URL =
|
1521 |
+
|
1522 |
+
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
|
1523 |
+
# search data is written to a file for indexing by an external tool. With the
|
1524 |
+
# SEARCHDATA_FILE tag the name of this file can be specified.
|
1525 |
+
# The default file is: searchdata.xml.
|
1526 |
+
# This tag requires that the tag SEARCHENGINE is set to YES.
|
1527 |
+
|
1528 |
+
SEARCHDATA_FILE = searchdata.xml
|
1529 |
+
|
1530 |
+
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
|
1531 |
+
# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
|
1532 |
+
# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
|
1533 |
+
# projects and redirect the results back to the right project.
|
1534 |
+
# This tag requires that the tag SEARCHENGINE is set to YES.
|
1535 |
+
|
1536 |
+
EXTERNAL_SEARCH_ID =
|
1537 |
+
|
1538 |
+
# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
|
1539 |
+
# projects other than the one defined by this configuration file, but that are
|
1540 |
+
# all added to the same external search index. Each project needs to have a
|
1541 |
+
# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
|
1542 |
+
# to a relative location where the documentation can be found. The format is:
|
1543 |
+
# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
|
1544 |
+
# This tag requires that the tag SEARCHENGINE is set to YES.
|
1545 |
+
|
1546 |
+
EXTRA_SEARCH_MAPPINGS =
|
1547 |
+
|
1548 |
+
#---------------------------------------------------------------------------
|
1549 |
+
# Configuration options related to the LaTeX output
|
1550 |
+
#---------------------------------------------------------------------------
|
1551 |
+
|
1552 |
+
# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
|
1553 |
+
# The default value is: YES.
|
1554 |
+
|
1555 |
+
GENERATE_LATEX = NO
|
1556 |
+
|
1557 |
+
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
|
1558 |
+
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
|
1559 |
+
# it.
|
1560 |
+
# The default directory is: latex.
|
1561 |
+
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
1562 |
+
|
1563 |
+
LATEX_OUTPUT = latex
|
1564 |
+
|
1565 |
+
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
|
1566 |
+
# invoked.
|
1567 |
+
#
|
1568 |
+
# Note that when enabling USE_PDFLATEX this option is only used for generating
|
1569 |
+
# bitmaps for formulas in the HTML output, but not in the Makefile that is
|
1570 |
+
# written to the output directory.
|
1571 |
+
# The default file is: latex.
|
1572 |
+
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
1573 |
+
|
1574 |
+
LATEX_CMD_NAME = latex
|
1575 |
+
|
1576 |
+
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
|
1577 |
+
# index for LaTeX.
|
1578 |
+
# The default file is: makeindex.
|
1579 |
+
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
1580 |
+
|
1581 |
+
MAKEINDEX_CMD_NAME = makeindex
|
1582 |
+
|
1583 |
+
# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX
|
1584 |
+
# documents. This may be useful for small projects and may help to save some
|
1585 |
+
# trees in general.
|
1586 |
+
# The default value is: NO.
|
1587 |
+
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
1588 |
+
|
1589 |
+
COMPACT_LATEX = NO
|
1590 |
+
|
1591 |
+
# The PAPER_TYPE tag can be used to set the paper type that is used by the
|
1592 |
+
# printer.
|
1593 |
+
# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
|
1594 |
+
# 14 inches) and executive (7.25 x 10.5 inches).
|
1595 |
+
# The default value is: a4.
|
1596 |
+
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
1597 |
+
|
1598 |
+
PAPER_TYPE = a4
|
1599 |
+
|
1600 |
+
# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
|
1601 |
+
# that should be included in the LaTeX output. To get the times font for
|
1602 |
+
# instance you can specify
|
1603 |
+
# EXTRA_PACKAGES=times
|
1604 |
+
# If left blank no extra packages will be included.
|
1605 |
+
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
1606 |
+
|
1607 |
+
EXTRA_PACKAGES =
|
1608 |
+
|
1609 |
+
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
|
1610 |
+
# generated LaTeX document. The header should contain everything until the first
|
1611 |
+
# chapter. If it is left blank doxygen will generate a standard header. See
|
1612 |
+
# section "Doxygen usage" for information on how to let doxygen write the
|
1613 |
+
# default header to a separate file.
|
1614 |
+
#
|
1615 |
+
# Note: Only use a user-defined header if you know what you are doing! The
|
1616 |
+
# following commands have a special meaning inside the header: $title,
|
1617 |
+
# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will
|
1618 |
+
# replace them by respectively the title of the page, the current date and time,
|
1619 |
+
# only the current date, the version number of doxygen, the project name (see
|
1620 |
+
# PROJECT_NAME), or the project number (see PROJECT_NUMBER).
|
1621 |
+
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
1622 |
+
|
1623 |
+
LATEX_HEADER =
|
1624 |
+
|
1625 |
+
# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
|
1626 |
+
# generated LaTeX document. The footer should contain everything after the last
|
1627 |
+
# chapter. If it is left blank doxygen will generate a standard footer.
|
1628 |
+
#
|
1629 |
+
# Note: Only use a user-defined footer if you know what you are doing!
|
1630 |
+
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
1631 |
+
|
1632 |
+
LATEX_FOOTER =
|
1633 |
+
|
1634 |
+
# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
|
1635 |
+
# other source files which should be copied to the LATEX_OUTPUT output
|
1636 |
+
# directory. Note that the files will be copied as-is; there are no commands or
|
1637 |
+
# markers available.
|
1638 |
+
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
1639 |
+
|
1640 |
+
LATEX_EXTRA_FILES =
|
1641 |
+
|
1642 |
+
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
|
1643 |
+
# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
|
1644 |
+
# contain links (just like the HTML output) instead of page references. This
|
1645 |
+
# makes the output suitable for online browsing using a PDF viewer.
|
1646 |
+
# The default value is: YES.
|
1647 |
+
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
1648 |
+
|
1649 |
+
PDF_HYPERLINKS = YES
|
1650 |
+
|
1651 |
+
# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
|
1652 |
+
# the PDF file directly from the LaTeX files. Set this option to YES to get a
|
1653 |
+
# higher quality PDF documentation.
|
1654 |
+
# The default value is: YES.
|
1655 |
+
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
1656 |
+
|
1657 |
+
USE_PDFLATEX = YES
|
1658 |
+
|
1659 |
+
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
|
1660 |
+
# command to the generated LaTeX files. This will instruct LaTeX to keep running
|
1661 |
+
# if errors occur, instead of asking the user for help. This option is also used
|
1662 |
+
# when generating formulas in HTML.
|
1663 |
+
# The default value is: NO.
|
1664 |
+
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
1665 |
+
|
1666 |
+
LATEX_BATCHMODE = NO
|
1667 |
+
|
1668 |
+
# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
|
1669 |
+
# index chapters (such as File Index, Compound Index, etc.) in the output.
|
1670 |
+
# The default value is: NO.
|
1671 |
+
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
1672 |
+
|
1673 |
+
LATEX_HIDE_INDICES = NO
|
1674 |
+
|
1675 |
+
# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
|
1676 |
+
# code with syntax highlighting in the LaTeX output.
|
1677 |
+
#
|
1678 |
+
# Note that which sources are shown also depends on other settings such as
|
1679 |
+
# SOURCE_BROWSER.
|
1680 |
+
# The default value is: NO.
|
1681 |
+
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
1682 |
+
|
1683 |
+
LATEX_SOURCE_CODE = NO
|
1684 |
+
|
1685 |
+
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
|
1686 |
+
# bibliography, e.g. plainnat, or ieeetr. See
|
1687 |
+
# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
|
1688 |
+
# The default value is: plain.
|
1689 |
+
# This tag requires that the tag GENERATE_LATEX is set to YES.
|
1690 |
+
|
1691 |
+
LATEX_BIB_STYLE = plain
|
1692 |
+
|
1693 |
+
#---------------------------------------------------------------------------
|
1694 |
+
# Configuration options related to the RTF output
|
1695 |
+
#---------------------------------------------------------------------------
|
1696 |
+
|
1697 |
+
# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
|
1698 |
+
# RTF output is optimized for Word 97 and may not look too pretty with other RTF
|
1699 |
+
# readers/editors.
|
1700 |
+
# The default value is: NO.
|
1701 |
+
|
1702 |
+
GENERATE_RTF = NO
|
1703 |
+
|
1704 |
+
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
|
1705 |
+
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
|
1706 |
+
# it.
|
1707 |
+
# The default directory is: rtf.
|
1708 |
+
# This tag requires that the tag GENERATE_RTF is set to YES.
|
1709 |
+
|
1710 |
+
RTF_OUTPUT = rtf
|
1711 |
+
|
1712 |
+
# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
|
1713 |
+
# documents. This may be useful for small projects and may help to save some
|
1714 |
+
# trees in general.
|
1715 |
+
# The default value is: NO.
|
1716 |
+
# This tag requires that the tag GENERATE_RTF is set to YES.
|
1717 |
+
|
1718 |
+
COMPACT_RTF = NO
|
1719 |
+
|
1720 |
+
# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
|
1721 |
+
# contain hyperlink fields. The RTF file will contain links (just like the HTML
|
1722 |
+
# output) instead of page references. This makes the output suitable for online
|
1723 |
+
# browsing using Word or some other Word compatible readers that support those
|
1724 |
+
# fields.
|
1725 |
+
#
|
1726 |
+
# Note: WordPad (write) and others do not support links.
|
1727 |
+
# The default value is: NO.
|
1728 |
+
# This tag requires that the tag GENERATE_RTF is set to YES.
|
1729 |
+
|
1730 |
+
RTF_HYPERLINKS = NO
|
1731 |
+
|
1732 |
+
# Load stylesheet definitions from file. Syntax is similar to doxygen's config
|
1733 |
+
# file, i.e. a series of assignments. You only have to provide replacements,
|
1734 |
+
# missing definitions are set to their default value.
|
1735 |
+
#
|
1736 |
+
# See also section "Doxygen usage" for information on how to generate the
|
1737 |
+
# default style sheet that doxygen normally uses.
|
1738 |
+
# This tag requires that the tag GENERATE_RTF is set to YES.
|
1739 |
+
|
1740 |
+
RTF_STYLESHEET_FILE =
|
1741 |
+
|
1742 |
+
# Set optional variables used in the generation of an RTF document. Syntax is
|
1743 |
+
# similar to doxygen's config file. A template extensions file can be generated
|
1744 |
+
# using doxygen -e rtf extensionFile.
|
1745 |
+
# This tag requires that the tag GENERATE_RTF is set to YES.
|
1746 |
+
|
1747 |
+
RTF_EXTENSIONS_FILE =
|
1748 |
+
|
1749 |
+
#---------------------------------------------------------------------------
|
1750 |
+
# Configuration options related to the man page output
|
1751 |
+
#---------------------------------------------------------------------------
|
1752 |
+
|
1753 |
+
# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
|
1754 |
+
# classes and files.
|
1755 |
+
# The default value is: NO.
|
1756 |
+
|
1757 |
+
GENERATE_MAN = NO
|
1758 |
+
|
1759 |
+
# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
|
1760 |
+
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
|
1761 |
+
# it. A directory man3 will be created inside the directory specified by
|
1762 |
+
# MAN_OUTPUT.
|
1763 |
+
# The default directory is: man.
|
1764 |
+
# This tag requires that the tag GENERATE_MAN is set to YES.
|
1765 |
+
|
1766 |
+
MAN_OUTPUT = man
|
1767 |
+
|
1768 |
+
# The MAN_EXTENSION tag determines the extension that is added to the generated
|
1769 |
+
# man pages. In case the manual section does not start with a number, the number
|
1770 |
+
# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
|
1771 |
+
# optional.
|
1772 |
+
# The default value is: .3.
|
1773 |
+
# This tag requires that the tag GENERATE_MAN is set to YES.
|
1774 |
+
|
1775 |
+
MAN_EXTENSION = .3
|
1776 |
+
|
1777 |
+
# The MAN_SUBDIR tag determines the name of the directory created within
|
1778 |
+
# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
|
1779 |
+
# MAN_EXTENSION with the initial . removed.
|
1780 |
+
# This tag requires that the tag GENERATE_MAN is set to YES.
|
1781 |
+
|
1782 |
+
MAN_SUBDIR =
|
1783 |
+
|
1784 |
+
# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
|
1785 |
+
# will generate one additional man file for each entity documented in the real
|
1786 |
+
# man page(s). These additional files only source the real man page, but without
|
1787 |
+
# them the man command would be unable to find the correct page.
|
1788 |
+
# The default value is: NO.
|
1789 |
+
# This tag requires that the tag GENERATE_MAN is set to YES.
|
1790 |
+
|
1791 |
+
MAN_LINKS = NO
|
1792 |
+
|
1793 |
+
#---------------------------------------------------------------------------
|
1794 |
+
# Configuration options related to the XML output
|
1795 |
+
#---------------------------------------------------------------------------
|
1796 |
+
|
1797 |
+
# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
|
1798 |
+
# captures the structure of the code including all documentation.
|
1799 |
+
# The default value is: NO.
|
1800 |
+
|
1801 |
+
GENERATE_XML = NO
|
1802 |
+
|
1803 |
+
# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
|
1804 |
+
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
|
1805 |
+
# it.
|
1806 |
+
# The default directory is: xml.
|
1807 |
+
# This tag requires that the tag GENERATE_XML is set to YES.
|
1808 |
+
|
1809 |
+
XML_OUTPUT = xml
|
1810 |
+
|
1811 |
+
# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
|
1812 |
+
# listings (including syntax highlighting and cross-referencing information) to
|
1813 |
+
# the XML output. Note that enabling this will significantly increase the size
|
1814 |
+
# of the XML output.
|
1815 |
+
# The default value is: YES.
|
1816 |
+
# This tag requires that the tag GENERATE_XML is set to YES.
|
1817 |
+
|
1818 |
+
XML_PROGRAMLISTING = YES
|
1819 |
+
|
1820 |
+
#---------------------------------------------------------------------------
|
1821 |
+
# Configuration options related to the DOCBOOK output
|
1822 |
+
#---------------------------------------------------------------------------
|
1823 |
+
|
1824 |
+
# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
|
1825 |
+
# that can be used to generate PDF.
|
1826 |
+
# The default value is: NO.
|
1827 |
+
|
1828 |
+
GENERATE_DOCBOOK = NO
|
1829 |
+
|
1830 |
+
# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
|
1831 |
+
# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
|
1832 |
+
# front of it.
|
1833 |
+
# The default directory is: docbook.
|
1834 |
+
# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
|
1835 |
+
|
1836 |
+
DOCBOOK_OUTPUT = docbook
|
1837 |
+
|
1838 |
+
#---------------------------------------------------------------------------
|
1839 |
+
# Configuration options for the AutoGen Definitions output
|
1840 |
+
#---------------------------------------------------------------------------
|
1841 |
+
|
1842 |
+
# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen
|
1843 |
+
# Definitions (see http://autogen.sf.net) file that captures the structure of
|
1844 |
+
# the code including all documentation. Note that this feature is still
|
1845 |
+
# experimental and incomplete at the moment.
|
1846 |
+
# The default value is: NO.
|
1847 |
+
|
1848 |
+
GENERATE_AUTOGEN_DEF = NO
|
1849 |
+
|
1850 |
+
#---------------------------------------------------------------------------
|
1851 |
+
# Configuration options related to the Perl module output
|
1852 |
+
#---------------------------------------------------------------------------
|
1853 |
+
|
1854 |
+
# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
|
1855 |
+
# file that captures the structure of the code including all documentation.
|
1856 |
+
#
|
1857 |
+
# Note that this feature is still experimental and incomplete at the moment.
|
1858 |
+
# The default value is: NO.
|
1859 |
+
|
1860 |
+
GENERATE_PERLMOD = NO
|
1861 |
+
|
1862 |
+
# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
|
1863 |
+
# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
|
1864 |
+
# output from the Perl module output.
|
1865 |
+
# The default value is: NO.
|
1866 |
+
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
|
1867 |
+
|
1868 |
+
PERLMOD_LATEX = NO
|
1869 |
+
|
1870 |
+
# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
|
1871 |
+
# formatted so it can be parsed by a human reader. This is useful if you want to
|
1872 |
+
# understand what is going on. On the other hand, if this tag is set to NO the
|
1873 |
+
# size of the Perl module output will be much smaller and Perl will parse it
|
1874 |
+
# just the same.
|
1875 |
+
# The default value is: YES.
|
1876 |
+
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
|
1877 |
+
|
1878 |
+
PERLMOD_PRETTY = YES
|
1879 |
+
|
1880 |
+
# The names of the make variables in the generated doxyrules.make file are
|
1881 |
+
# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
|
1882 |
+
# so different doxyrules.make files included by the same Makefile don't
|
1883 |
+
# overwrite each other's variables.
|
1884 |
+
# This tag requires that the tag GENERATE_PERLMOD is set to YES.
|
1885 |
+
|
1886 |
+
PERLMOD_MAKEVAR_PREFIX =
|
1887 |
+
|
1888 |
+
#---------------------------------------------------------------------------
|
1889 |
+
# Configuration options related to the preprocessor
|
1890 |
+
#---------------------------------------------------------------------------
|
1891 |
+
|
1892 |
+
# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
|
1893 |
+
# C-preprocessor directives found in the sources and include files.
|
1894 |
+
# The default value is: YES.
|
1895 |
+
|
1896 |
+
ENABLE_PREPROCESSING = YES
|
1897 |
+
|
1898 |
+
# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
|
1899 |
+
# in the source code. If set to NO only conditional compilation will be
|
1900 |
+
# performed. Macro expansion can be done in a controlled way by setting
|
1901 |
+
# EXPAND_ONLY_PREDEF to YES.
|
1902 |
+
# The default value is: NO.
|
1903 |
+
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
1904 |
+
|
1905 |
+
MACRO_EXPANSION = NO
|
1906 |
+
|
1907 |
+
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
|
1908 |
+
# the macro expansion is limited to the macros specified with the PREDEFINED and
|
1909 |
+
# EXPAND_AS_DEFINED tags.
|
1910 |
+
# The default value is: NO.
|
1911 |
+
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
1912 |
+
|
1913 |
+
EXPAND_ONLY_PREDEF = NO
|
1914 |
+
|
1915 |
+
# If the SEARCH_INCLUDES tag is set to YES the includes files in the
|
1916 |
+
# INCLUDE_PATH will be searched if a #include is found.
|
1917 |
+
# The default value is: YES.
|
1918 |
+
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
1919 |
+
|
1920 |
+
SEARCH_INCLUDES = YES
|
1921 |
+
|
1922 |
+
# The INCLUDE_PATH tag can be used to specify one or more directories that
|
1923 |
+
# contain include files that are not input files but should be processed by the
|
1924 |
+
# preprocessor.
|
1925 |
+
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
|
1926 |
+
|
1927 |
+
INCLUDE_PATH =
|
1928 |
+
|
1929 |
+
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
|
1930 |
+
# patterns (like *.h and *.hpp) to filter out the header-files in the
|
1931 |
+
# directories. If left blank, the patterns specified with FILE_PATTERNS will be
|
1932 |
+
# used.
|
1933 |
+
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
1934 |
+
|
1935 |
+
INCLUDE_FILE_PATTERNS =
|
1936 |
+
|
1937 |
+
# The PREDEFINED tag can be used to specify one or more macro names that are
|
1938 |
+
# defined before the preprocessor is started (similar to the -D option of e.g.
|
1939 |
+
# gcc). The argument of the tag is a list of macros of the form: name or
|
1940 |
+
# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
|
1941 |
+
# is assumed. To prevent a macro definition from being undefined via #undef or
|
1942 |
+
# recursively expanded use the := operator instead of the = operator.
|
1943 |
+
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
1944 |
+
|
1945 |
+
PREDEFINED =
|
1946 |
+
|
1947 |
+
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
|
1948 |
+
# tag can be used to specify a list of macro names that should be expanded. The
|
1949 |
+
# macro definition that is found in the sources will be used. Use the PREDEFINED
|
1950 |
+
# tag if you want to use a different macro definition that overrules the
|
1951 |
+
# definition found in the source code.
|
1952 |
+
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
1953 |
+
|
1954 |
+
EXPAND_AS_DEFINED =
|
1955 |
+
|
1956 |
+
# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
|
1957 |
+
# remove all references to function-like macros that are alone on a line, have
|
1958 |
+
# an all uppercase name, and do not end with a semicolon. Such function macros
|
1959 |
+
# are typically used for boiler-plate code, and will confuse the parser if not
|
1960 |
+
# removed.
|
1961 |
+
# The default value is: YES.
|
1962 |
+
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
1963 |
+
|
1964 |
+
SKIP_FUNCTION_MACROS = YES
|
1965 |
+
|
1966 |
+
#---------------------------------------------------------------------------
|
1967 |
+
# Configuration options related to external references
|
1968 |
+
#---------------------------------------------------------------------------
|
1969 |
+
|
1970 |
+
# The TAGFILES tag can be used to specify one or more tag files. For each tag
|
1971 |
+
# file the location of the external documentation should be added. The format of
|
1972 |
+
# a tag file without this location is as follows:
|
1973 |
+
# TAGFILES = file1 file2 ...
|
1974 |
+
# Adding location for the tag files is done as follows:
|
1975 |
+
# TAGFILES = file1=loc1 "file2 = loc2" ...
|
1976 |
+
# where loc1 and loc2 can be relative or absolute paths or URLs. See the
|
1977 |
+
# section "Linking to external documentation" for more information about the use
|
1978 |
+
# of tag files.
|
1979 |
+
# Note: Each tag file must have a unique name (where the name does NOT include
|
1980 |
+
# the path). If a tag file is not located in the directory in which doxygen is
|
1981 |
+
# run, you must also specify the path to the tagfile here.
|
1982 |
+
|
1983 |
+
TAGFILES =
|
1984 |
+
|
1985 |
+
# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
|
1986 |
+
# tag file that is based on the input files it reads. See section "Linking to
|
1987 |
+
# external documentation" for more information about the usage of tag files.
|
1988 |
+
|
1989 |
+
GENERATE_TAGFILE =
|
1990 |
+
|
1991 |
+
# If the ALLEXTERNALS tag is set to YES all external class will be listed in the
|
1992 |
+
# class index. If set to NO only the inherited external classes will be listed.
|
1993 |
+
# The default value is: NO.
|
1994 |
+
|
1995 |
+
ALLEXTERNALS = NO
|
1996 |
+
|
1997 |
+
# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in
|
1998 |
+
# the modules index. If set to NO, only the current project's groups will be
|
1999 |
+
# listed.
|
2000 |
+
# The default value is: YES.
|
2001 |
+
|
2002 |
+
EXTERNAL_GROUPS = YES
|
2003 |
+
|
2004 |
+
# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
|
2005 |
+
# the related pages index. If set to NO, only the current project's pages will
|
2006 |
+
# be listed.
|
2007 |
+
# The default value is: YES.
|
2008 |
+
|
2009 |
+
EXTERNAL_PAGES = YES
|
2010 |
+
|
2011 |
+
# The PERL_PATH should be the absolute path and name of the perl script
|
2012 |
+
# interpreter (i.e. the result of 'which perl').
|
2013 |
+
# The default file (with absolute path) is: /usr/bin/perl.
|
2014 |
+
|
2015 |
+
PERL_PATH = /usr/bin/perl
|
2016 |
+
|
2017 |
+
#---------------------------------------------------------------------------
|
2018 |
+
# Configuration options related to the dot tool
|
2019 |
+
#---------------------------------------------------------------------------
|
2020 |
+
|
2021 |
+
# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
|
2022 |
+
# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
|
2023 |
+
# NO turns the diagrams off. Note that this option also works with HAVE_DOT
|
2024 |
+
# disabled, but it is recommended to install and use dot, since it yields more
|
2025 |
+
# powerful graphs.
|
2026 |
+
# The default value is: YES.
|
2027 |
+
|
2028 |
+
CLASS_DIAGRAMS = YES
|
2029 |
+
|
2030 |
+
# You can define message sequence charts within doxygen comments using the \msc
|
2031 |
+
# command. Doxygen will then run the mscgen tool (see:
|
2032 |
+
# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
|
2033 |
+
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
|
2034 |
+
# the mscgen tool resides. If left empty the tool is assumed to be found in the
|
2035 |
+
# default search path.
|
2036 |
+
|
2037 |
+
MSCGEN_PATH =
|
2038 |
+
|
2039 |
+
# You can include diagrams made with dia in doxygen documentation. Doxygen will
|
2040 |
+
# then run dia to produce the diagram and insert it in the documentation. The
|
2041 |
+
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
|
2042 |
+
# If left empty dia is assumed to be found in the default search path.
|
2043 |
+
|
2044 |
+
DIA_PATH =
|
2045 |
+
|
2046 |
+
# If set to YES, the inheritance and collaboration graphs will hide inheritance
|
2047 |
+
# and usage relations if the target is undocumented or is not a class.
|
2048 |
+
# The default value is: YES.
|
2049 |
+
|
2050 |
+
HIDE_UNDOC_RELATIONS = YES
|
2051 |
+
|
2052 |
+
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
|
2053 |
+
# available from the path. This tool is part of Graphviz (see:
|
2054 |
+
# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
|
2055 |
+
# Bell Labs. The other options in this section have no effect if this option is
|
2056 |
+
# set to NO
|
2057 |
+
# The default value is: NO.
|
2058 |
+
|
2059 |
+
HAVE_DOT = YES
|
2060 |
+
|
2061 |
+
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
|
2062 |
+
# to run in parallel. When set to 0 doxygen will base this on the number of
|
2063 |
+
# processors available in the system. You can set it explicitly to a value
|
2064 |
+
# larger than 0 to get control over the balance between CPU load and processing
|
2065 |
+
# speed.
|
2066 |
+
# Minimum value: 0, maximum value: 32, default value: 0.
|
2067 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2068 |
+
|
2069 |
+
DOT_NUM_THREADS = 0
|
2070 |
+
|
2071 |
+
# When you want a differently looking font n the dot files that doxygen
|
2072 |
+
# generates you can specify the font name using DOT_FONTNAME. You need to make
|
2073 |
+
# sure dot is able to find the font, which can be done by putting it in a
|
2074 |
+
# standard location or by setting the DOTFONTPATH environment variable or by
|
2075 |
+
# setting DOT_FONTPATH to the directory containing the font.
|
2076 |
+
# The default value is: Helvetica.
|
2077 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2078 |
+
|
2079 |
+
DOT_FONTNAME = Helvetica
|
2080 |
+
|
2081 |
+
# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
|
2082 |
+
# dot graphs.
|
2083 |
+
# Minimum value: 4, maximum value: 24, default value: 10.
|
2084 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2085 |
+
|
2086 |
+
DOT_FONTSIZE = 10
|
2087 |
+
|
2088 |
+
# By default doxygen will tell dot to use the default font as specified with
|
2089 |
+
# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
|
2090 |
+
# the path where dot can find it using this tag.
|
2091 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2092 |
+
|
2093 |
+
DOT_FONTPATH =
|
2094 |
+
|
2095 |
+
# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
|
2096 |
+
# each documented class showing the direct and indirect inheritance relations.
|
2097 |
+
# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
|
2098 |
+
# The default value is: YES.
|
2099 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2100 |
+
|
2101 |
+
CLASS_GRAPH = YES
|
2102 |
+
|
2103 |
+
# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
|
2104 |
+
# graph for each documented class showing the direct and indirect implementation
|
2105 |
+
# dependencies (inheritance, containment, and class references variables) of the
|
2106 |
+
# class with other documented classes.
|
2107 |
+
# The default value is: YES.
|
2108 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2109 |
+
|
2110 |
+
COLLABORATION_GRAPH = YES
|
2111 |
+
|
2112 |
+
# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
|
2113 |
+
# groups, showing the direct groups dependencies.
|
2114 |
+
# The default value is: YES.
|
2115 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2116 |
+
|
2117 |
+
GROUP_GRAPHS = YES
|
2118 |
+
|
2119 |
+
# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
|
2120 |
+
# collaboration diagrams in a style similar to the OMG's Unified Modeling
|
2121 |
+
# Language.
|
2122 |
+
# The default value is: NO.
|
2123 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2124 |
+
|
2125 |
+
UML_LOOK = NO
|
2126 |
+
|
2127 |
+
# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
|
2128 |
+
# class node. If there are many fields or methods and many nodes the graph may
|
2129 |
+
# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
|
2130 |
+
# number of items for each type to make the size more manageable. Set this to 0
|
2131 |
+
# for no limit. Note that the threshold may be exceeded by 50% before the limit
|
2132 |
+
# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
|
2133 |
+
# but if the number exceeds 15, the total amount of fields shown is limited to
|
2134 |
+
# 10.
|
2135 |
+
# Minimum value: 0, maximum value: 100, default value: 10.
|
2136 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2137 |
+
|
2138 |
+
UML_LIMIT_NUM_FIELDS = 10
|
2139 |
+
|
2140 |
+
# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
|
2141 |
+
# collaboration graphs will show the relations between templates and their
|
2142 |
+
# instances.
|
2143 |
+
# The default value is: NO.
|
2144 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2145 |
+
|
2146 |
+
TEMPLATE_RELATIONS = NO
|
2147 |
+
|
2148 |
+
# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
|
2149 |
+
# YES then doxygen will generate a graph for each documented file showing the
|
2150 |
+
# direct and indirect include dependencies of the file with other documented
|
2151 |
+
# files.
|
2152 |
+
# The default value is: YES.
|
2153 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2154 |
+
|
2155 |
+
INCLUDE_GRAPH = YES
|
2156 |
+
|
2157 |
+
# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
|
2158 |
+
# set to YES then doxygen will generate a graph for each documented file showing
|
2159 |
+
# the direct and indirect include dependencies of the file with other documented
|
2160 |
+
# files.
|
2161 |
+
# The default value is: YES.
|
2162 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2163 |
+
|
2164 |
+
INCLUDED_BY_GRAPH = YES
|
2165 |
+
|
2166 |
+
# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
|
2167 |
+
# dependency graph for every global function or class method.
|
2168 |
+
#
|
2169 |
+
# Note that enabling this option will significantly increase the time of a run.
|
2170 |
+
# So in most cases it will be better to enable call graphs for selected
|
2171 |
+
# functions only using the \callgraph command.
|
2172 |
+
# The default value is: NO.
|
2173 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2174 |
+
|
2175 |
+
CALL_GRAPH = YES
|
2176 |
+
|
2177 |
+
# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
|
2178 |
+
# dependency graph for every global function or class method.
|
2179 |
+
#
|
2180 |
+
# Note that enabling this option will significantly increase the time of a run.
|
2181 |
+
# So in most cases it will be better to enable caller graphs for selected
|
2182 |
+
# functions only using the \callergraph command.
|
2183 |
+
# The default value is: NO.
|
2184 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2185 |
+
|
2186 |
+
CALLER_GRAPH = YES
|
2187 |
+
|
2188 |
+
# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
|
2189 |
+
# hierarchy of all classes instead of a textual one.
|
2190 |
+
# The default value is: YES.
|
2191 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2192 |
+
|
2193 |
+
GRAPHICAL_HIERARCHY = YES
|
2194 |
+
|
2195 |
+
# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
|
2196 |
+
# dependencies a directory has on other directories in a graphical way. The
|
2197 |
+
# dependency relations are determined by the #include relations between the
|
2198 |
+
# files in the directories.
|
2199 |
+
# The default value is: YES.
|
2200 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2201 |
+
|
2202 |
+
DIRECTORY_GRAPH = YES
|
2203 |
+
|
2204 |
+
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
|
2205 |
+
# generated by dot.
|
2206 |
+
# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
|
2207 |
+
# to make the SVG files visible in IE 9+ (other browsers do not have this
|
2208 |
+
# requirement).
|
2209 |
+
# Possible values are: png, jpg, gif and svg.
|
2210 |
+
# The default value is: png.
|
2211 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2212 |
+
|
2213 |
+
DOT_IMAGE_FORMAT = svg
|
2214 |
+
|
2215 |
+
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
|
2216 |
+
# enable generation of interactive SVG images that allow zooming and panning.
|
2217 |
+
#
|
2218 |
+
# Note that this requires a modern browser other than Internet Explorer. Tested
|
2219 |
+
# and working are Firefox, Chrome, Safari, and Opera.
|
2220 |
+
# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
|
2221 |
+
# the SVG files visible. Older versions of IE do not have SVG support.
|
2222 |
+
# The default value is: NO.
|
2223 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2224 |
+
|
2225 |
+
INTERACTIVE_SVG = YES
|
2226 |
+
|
2227 |
+
# The DOT_PATH tag can be used to specify the path where the dot tool can be
|
2228 |
+
# found. If left blank, it is assumed the dot tool can be found in the path.
|
2229 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2230 |
+
|
2231 |
+
DOT_PATH =
|
2232 |
+
|
2233 |
+
# The DOTFILE_DIRS tag can be used to specify one or more directories that
|
2234 |
+
# contain dot files that are included in the documentation (see the \dotfile
|
2235 |
+
# command).
|
2236 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2237 |
+
|
2238 |
+
DOTFILE_DIRS =
|
2239 |
+
|
2240 |
+
# The MSCFILE_DIRS tag can be used to specify one or more directories that
|
2241 |
+
# contain msc files that are included in the documentation (see the \mscfile
|
2242 |
+
# command).
|
2243 |
+
|
2244 |
+
MSCFILE_DIRS =
|
2245 |
+
|
2246 |
+
# The DIAFILE_DIRS tag can be used to specify one or more directories that
|
2247 |
+
# contain dia files that are included in the documentation (see the \diafile
|
2248 |
+
# command).
|
2249 |
+
|
2250 |
+
DIAFILE_DIRS =
|
2251 |
+
|
2252 |
+
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
|
2253 |
+
# that will be shown in the graph. If the number of nodes in a graph becomes
|
2254 |
+
# larger than this value, doxygen will truncate the graph, which is visualized
|
2255 |
+
# by representing a node as a red box. Note that doxygen if the number of direct
|
2256 |
+
# children of the root node in a graph is already larger than
|
2257 |
+
# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
|
2258 |
+
# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
|
2259 |
+
# Minimum value: 0, maximum value: 10000, default value: 50.
|
2260 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2261 |
+
|
2262 |
+
DOT_GRAPH_MAX_NODES = 50
|
2263 |
+
|
2264 |
+
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
|
2265 |
+
# generated by dot. A depth value of 3 means that only nodes reachable from the
|
2266 |
+
# root by following a path via at most 3 edges will be shown. Nodes that lay
|
2267 |
+
# further from the root node will be omitted. Note that setting this option to 1
|
2268 |
+
# or 2 may greatly reduce the computation time needed for large code bases. Also
|
2269 |
+
# note that the size of a graph can be further restricted by
|
2270 |
+
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
|
2271 |
+
# Minimum value: 0, maximum value: 1000, default value: 0.
|
2272 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2273 |
+
|
2274 |
+
MAX_DOT_GRAPH_DEPTH = 0
|
2275 |
+
|
2276 |
+
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
|
2277 |
+
# background. This is disabled by default, because dot on Windows does not seem
|
2278 |
+
# to support this out of the box.
|
2279 |
+
#
|
2280 |
+
# Warning: Depending on the platform used, enabling this option may lead to
|
2281 |
+
# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
|
2282 |
+
# read).
|
2283 |
+
# The default value is: NO.
|
2284 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2285 |
+
|
2286 |
+
DOT_TRANSPARENT = NO
|
2287 |
+
|
2288 |
+
# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
|
2289 |
+
# files in one run (i.e. multiple -o and -T options on the command line). This
|
2290 |
+
# makes dot run faster, but since only newer versions of dot (>1.8.10) support
|
2291 |
+
# this, this feature is disabled by default.
|
2292 |
+
# The default value is: NO.
|
2293 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2294 |
+
|
2295 |
+
DOT_MULTI_TARGETS = NO
|
2296 |
+
|
2297 |
+
# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
|
2298 |
+
# explaining the meaning of the various boxes and arrows in the dot generated
|
2299 |
+
# graphs.
|
2300 |
+
# The default value is: YES.
|
2301 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2302 |
+
|
2303 |
+
GENERATE_LEGEND = YES
|
2304 |
+
|
2305 |
+
# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot
|
2306 |
+
# files that are used to generate the various graphs.
|
2307 |
+
# The default value is: YES.
|
2308 |
+
# This tag requires that the tag HAVE_DOT is set to YES.
|
2309 |
+
|
2310 |
+
DOT_CLEANUP = YES
|
vendor/sabberworm/php-css-parser/composer.json
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "sabberworm/php-css-parser",
|
3 |
+
"type": "library",
|
4 |
+
"description": "Parser for CSS Files written in PHP",
|
5 |
+
"keywords": ["parser", "css", "stylesheet"],
|
6 |
+
"homepage": "http://www.sabberworm.com/blog/2010/6/10/php-css-parser",
|
7 |
+
"license": "MIT",
|
8 |
+
"authors": [
|
9 |
+
{"name": "Raphael Schweikert"}
|
10 |
+
],
|
11 |
+
"require": {
|
12 |
+
"php": ">=5.3.2"
|
13 |
+
},
|
14 |
+
"require-dev": {
|
15 |
+
"phpunit/phpunit": "*"
|
16 |
+
},
|
17 |
+
"autoload": {
|
18 |
+
"psr-0": { "Sabberworm\\CSS": "lib/" }
|
19 |
+
}
|
20 |
+
}
|
vendor/sabberworm/php-css-parser/composer.lock
ADDED
@@ -0,0 +1,1317 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_readme": [
|
3 |
+
"This file locks the dependencies of your project to a known state",
|
4 |
+
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
5 |
+
"This file is @generated automatically"
|
6 |
+
],
|
7 |
+
"hash": "bed930f26e019e0a48bd041d15c90e7d",
|
8 |
+
"content-hash": "8a1a6e7f5a04b933b11b9677113dcc44",
|
9 |
+
"packages": [],
|
10 |
+
"packages-dev": [
|
11 |
+
{
|
12 |
+
"name": "doctrine/instantiator",
|
13 |
+
"version": "1.0.5",
|
14 |
+
"source": {
|
15 |
+
"type": "git",
|
16 |
+
"url": "https://github.com/doctrine/instantiator.git",
|
17 |
+
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
|
18 |
+
},
|
19 |
+
"dist": {
|
20 |
+
"type": "zip",
|
21 |
+
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
|
22 |
+
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
|
23 |
+
"shasum": ""
|
24 |
+
},
|
25 |
+
"require": {
|
26 |
+
"php": ">=5.3,<8.0-DEV"
|
27 |
+
},
|
28 |
+
"require-dev": {
|
29 |
+
"athletic/athletic": "~0.1.8",
|
30 |
+
"ext-pdo": "*",
|
31 |
+
"ext-phar": "*",
|
32 |
+
"phpunit/phpunit": "~4.0",
|
33 |
+
"squizlabs/php_codesniffer": "~2.0"
|
34 |
+
},
|
35 |
+
"type": "library",
|
36 |
+
"extra": {
|
37 |
+
"branch-alias": {
|
38 |
+
"dev-master": "1.0.x-dev"
|
39 |
+
}
|
40 |
+
},
|
41 |
+
"autoload": {
|
42 |
+
"psr-4": {
|
43 |
+
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
|
44 |
+
}
|
45 |
+
},
|
46 |
+
"notification-url": "https://packagist.org/downloads/",
|
47 |
+
"license": [
|
48 |
+
"MIT"
|
49 |
+
],
|
50 |
+
"authors": [
|
51 |
+
{
|
52 |
+
"name": "Marco Pivetta",
|
53 |
+
"email": "ocramius@gmail.com",
|
54 |
+
"homepage": "http://ocramius.github.com/"
|
55 |
+
}
|
56 |
+
],
|
57 |
+
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
|
58 |
+
"homepage": "https://github.com/doctrine/instantiator",
|
59 |
+
"keywords": [
|
60 |
+
"constructor",
|
61 |
+
"instantiate"
|
62 |
+
],
|
63 |
+
"time": "2015-06-14 21:17:01"
|
64 |
+
},
|
65 |
+
{
|
66 |
+
"name": "myclabs/deep-copy",
|
67 |
+
"version": "1.5.1",
|
68 |
+
"source": {
|
69 |
+
"type": "git",
|
70 |
+
"url": "https://github.com/myclabs/DeepCopy.git",
|
71 |
+
"reference": "a8773992b362b58498eed24bf85005f363c34771"
|
72 |
+
},
|
73 |
+
"dist": {
|
74 |
+
"type": "zip",
|
75 |
+
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/a8773992b362b58498eed24bf85005f363c34771",
|
76 |
+
"reference": "a8773992b362b58498eed24bf85005f363c34771",
|
77 |
+
"shasum": ""
|
78 |
+
},
|
79 |
+
"require": {
|
80 |
+
"php": ">=5.4.0"
|
81 |
+
},
|
82 |
+
"require-dev": {
|
83 |
+
"doctrine/collections": "1.*",
|
84 |
+
"phpunit/phpunit": "~4.1"
|
85 |
+
},
|
86 |
+
"type": "library",
|
87 |
+
"autoload": {
|
88 |
+
"psr-4": {
|
89 |
+
"DeepCopy\\": "src/DeepCopy/"
|
90 |
+
}
|
91 |
+
},
|
92 |
+
"notification-url": "https://packagist.org/downloads/",
|
93 |
+
"license": [
|
94 |
+
"MIT"
|
95 |
+
],
|
96 |
+
"description": "Create deep copies (clones) of your objects",
|
97 |
+
"homepage": "https://github.com/myclabs/DeepCopy",
|
98 |
+
"keywords": [
|
99 |
+
"clone",
|
100 |
+
"copy",
|
101 |
+
"duplicate",
|
102 |
+
"object",
|
103 |
+
"object graph"
|
104 |
+
],
|
105 |
+
"time": "2015-11-20 12:04:31"
|
106 |
+
},
|
107 |
+
{
|
108 |
+
"name": "phpdocumentor/reflection-common",
|
109 |
+
"version": "1.0",
|
110 |
+
"source": {
|
111 |
+
"type": "git",
|
112 |
+
"url": "https://github.com/phpDocumentor/ReflectionCommon.git",
|
113 |
+
"reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c"
|
114 |
+
},
|
115 |
+
"dist": {
|
116 |
+
"type": "zip",
|
117 |
+
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c",
|
118 |
+
"reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c",
|
119 |
+
"shasum": ""
|
120 |
+
},
|
121 |
+
"require": {
|
122 |
+
"php": ">=5.5"
|
123 |
+
},
|
124 |
+
"require-dev": {
|
125 |
+
"phpunit/phpunit": "^4.6"
|
126 |
+
},
|
127 |
+
"type": "library",
|
128 |
+
"extra": {
|
129 |
+
"branch-alias": {
|
130 |
+
"dev-master": "1.0.x-dev"
|
131 |
+
}
|
132 |
+
},
|
133 |
+
"autoload": {
|
134 |
+
"psr-4": {
|
135 |
+
"phpDocumentor\\Reflection\\": [
|
136 |
+
"src"
|
137 |
+
]
|
138 |
+
}
|
139 |
+
},
|
140 |
+
"notification-url": "https://packagist.org/downloads/",
|
141 |
+
"license": [
|
142 |
+
"MIT"
|
143 |
+
],
|
144 |
+
"authors": [
|
145 |
+
{
|
146 |
+
"name": "Jaap van Otterdijk",
|
147 |
+
"email": "opensource@ijaap.nl"
|
148 |
+
}
|
149 |
+
],
|
150 |
+
"description": "Common reflection classes used by phpdocumentor to reflect the code structure",
|
151 |
+
"homepage": "http://www.phpdoc.org",
|
152 |
+
"keywords": [
|
153 |
+
"FQSEN",
|
154 |
+
"phpDocumentor",
|
155 |
+
"phpdoc",
|
156 |
+
"reflection",
|
157 |
+
"static analysis"
|
158 |
+
],
|
159 |
+
"time": "2015-12-27 11:43:31"
|
160 |
+
},
|
161 |
+
{
|
162 |
+
"name": "phpdocumentor/reflection-docblock",
|
163 |
+
"version": "3.1.0",
|
164 |
+
"source": {
|
165 |
+
"type": "git",
|
166 |
+
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
|
167 |
+
"reference": "9270140b940ff02e58ec577c237274e92cd40cdd"
|
168 |
+
},
|
169 |
+
"dist": {
|
170 |
+
"type": "zip",
|
171 |
+
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd",
|
172 |
+
"reference": "9270140b940ff02e58ec577c237274e92cd40cdd",
|
173 |
+
"shasum": ""
|
174 |
+
},
|
175 |
+
"require": {
|
176 |
+
"php": ">=5.5",
|
177 |
+
"phpdocumentor/reflection-common": "^1.0@dev",
|
178 |
+
"phpdocumentor/type-resolver": "^0.2.0",
|
179 |
+
"webmozart/assert": "^1.0"
|
180 |
+
},
|
181 |
+
"require-dev": {
|
182 |
+
"mockery/mockery": "^0.9.4",
|
183 |
+
"phpunit/phpunit": "^4.4"
|
184 |
+
},
|
185 |
+
"type": "library",
|
186 |
+
"autoload": {
|
187 |
+
"psr-4": {
|
188 |
+
"phpDocumentor\\Reflection\\": [
|
189 |
+
"src/"
|
190 |
+
]
|
191 |
+
}
|
192 |
+
},
|
193 |
+
"notification-url": "https://packagist.org/downloads/",
|
194 |
+
"license": [
|
195 |
+
"MIT"
|
196 |
+
],
|
197 |
+
"authors": [
|
198 |
+
{
|
199 |
+
"name": "Mike van Riel",
|
200 |
+
"email": "me@mikevanriel.com"
|
201 |
+
}
|
202 |
+
],
|
203 |
+
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
|
204 |
+
"time": "2016-06-10 09:48:41"
|
205 |
+
},
|
206 |
+
{
|
207 |
+
"name": "phpdocumentor/type-resolver",
|
208 |
+
"version": "0.2",
|
209 |
+
"source": {
|
210 |
+
"type": "git",
|
211 |
+
"url": "https://github.com/phpDocumentor/TypeResolver.git",
|
212 |
+
"reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443"
|
213 |
+
},
|
214 |
+
"dist": {
|
215 |
+
"type": "zip",
|
216 |
+
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443",
|
217 |
+
"reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443",
|
218 |
+
"shasum": ""
|
219 |
+
},
|
220 |
+
"require": {
|
221 |
+
"php": ">=5.5",
|
222 |
+
"phpdocumentor/reflection-common": "^1.0"
|
223 |
+
},
|
224 |
+
"require-dev": {
|
225 |
+
"mockery/mockery": "^0.9.4",
|
226 |
+
"phpunit/phpunit": "^5.2||^4.8.24"
|
227 |
+
},
|
228 |
+
"type": "library",
|
229 |
+
"extra": {
|
230 |
+
"branch-alias": {
|
231 |
+
"dev-master": "1.0.x-dev"
|
232 |
+
}
|
233 |
+
},
|
234 |
+
"autoload": {
|
235 |
+
"psr-4": {
|
236 |
+
"phpDocumentor\\Reflection\\": [
|
237 |
+
"src/"
|
238 |
+
]
|
239 |
+
}
|
240 |
+
},
|
241 |
+
"notification-url": "https://packagist.org/downloads/",
|
242 |
+
"license": [
|
243 |
+
"MIT"
|
244 |
+
],
|
245 |
+
"authors": [
|
246 |
+
{
|
247 |
+
"name": "Mike van Riel",
|
248 |
+
"email": "me@mikevanriel.com"
|
249 |
+
}
|
250 |
+
],
|
251 |
+
"time": "2016-06-10 07:14:17"
|
252 |
+
},
|
253 |
+
{
|
254 |
+
"name": "phpspec/prophecy",
|
255 |
+
"version": "v1.6.1",
|
256 |
+
"source": {
|
257 |
+
"type": "git",
|
258 |
+
"url": "https://github.com/phpspec/prophecy.git",
|
259 |
+
"reference": "58a8137754bc24b25740d4281399a4a3596058e0"
|
260 |
+
},
|
261 |
+
"dist": {
|
262 |
+
"type": "zip",
|
263 |
+
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0",
|
264 |
+
"reference": "58a8137754bc24b25740d4281399a4a3596058e0",
|
265 |
+
"shasum": ""
|
266 |
+
},
|
267 |
+
"require": {
|
268 |
+
"doctrine/instantiator": "^1.0.2",
|
269 |
+
"php": "^5.3|^7.0",
|
270 |
+
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2",
|
271 |
+
"sebastian/comparator": "^1.1",
|
272 |
+
"sebastian/recursion-context": "^1.0"
|
273 |
+
},
|
274 |
+
"require-dev": {
|
275 |
+
"phpspec/phpspec": "^2.0"
|
276 |
+
},
|
277 |
+
"type": "library",
|
278 |
+
"extra": {
|
279 |
+
"branch-alias": {
|
280 |
+
"dev-master": "1.6.x-dev"
|
281 |
+
}
|
282 |
+
},
|
283 |
+
"autoload": {
|
284 |
+
"psr-0": {
|
285 |
+
"Prophecy\\": "src/"
|
286 |
+
}
|
287 |
+
},
|
288 |
+
"notification-url": "https://packagist.org/downloads/",
|
289 |
+
"license": [
|
290 |
+
"MIT"
|
291 |
+
],
|
292 |
+
"authors": [
|
293 |
+
{
|
294 |
+
"name": "Konstantin Kudryashov",
|
295 |
+
"email": "ever.zet@gmail.com",
|
296 |
+
"homepage": "http://everzet.com"
|
297 |
+
},
|
298 |
+
{
|
299 |
+
"name": "Marcello Duarte",
|
300 |
+
"email": "marcello.duarte@gmail.com"
|
301 |
+
}
|
302 |
+
],
|
303 |
+
"description": "Highly opinionated mocking framework for PHP 5.3+",
|
304 |
+
"homepage": "https://github.com/phpspec/prophecy",
|
305 |
+
"keywords": [
|
306 |
+
"Double",
|
307 |
+
"Dummy",
|
308 |
+
"fake",
|
309 |
+
"mock",
|
310 |
+
"spy",
|
311 |
+
"stub"
|
312 |
+
],
|
313 |
+
"time": "2016-06-07 08:13:47"
|
314 |
+
},
|
315 |
+
{
|
316 |
+
"name": "phpunit/php-code-coverage",
|
317 |
+
"version": "4.0.0",
|
318 |
+
"source": {
|
319 |
+
"type": "git",
|
320 |
+
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
321 |
+
"reference": "900370c81280cc0d942ffbc5912d80464eaee7e9"
|
322 |
+
},
|
323 |
+
"dist": {
|
324 |
+
"type": "zip",
|
325 |
+
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/900370c81280cc0d942ffbc5912d80464eaee7e9",
|
326 |
+
"reference": "900370c81280cc0d942ffbc5912d80464eaee7e9",
|
327 |
+
"shasum": ""
|
328 |
+
},
|
329 |
+
"require": {
|
330 |
+
"php": "^5.6 || ^7.0",
|
331 |
+
"phpunit/php-file-iterator": "~1.3",
|
332 |
+
"phpunit/php-text-template": "~1.2",
|
333 |
+
"phpunit/php-token-stream": "^1.4.2",
|
334 |
+
"sebastian/code-unit-reverse-lookup": "~1.0",
|
335 |
+
"sebastian/environment": "^1.3.2",
|
336 |
+
"sebastian/version": "~1.0|~2.0"
|
337 |
+
},
|
338 |
+
"require-dev": {
|
339 |
+
"ext-xdebug": ">=2.1.4",
|
340 |
+
"phpunit/phpunit": "^5.4"
|
341 |
+
},
|
342 |
+
"suggest": {
|
343 |
+
"ext-dom": "*",
|
344 |
+
"ext-xdebug": ">=2.4.0",
|
345 |
+
"ext-xmlwriter": "*"
|
346 |
+
},
|
347 |
+
"type": "library",
|
348 |
+
"extra": {
|
349 |
+
"branch-alias": {
|
350 |
+
"dev-master": "4.0.x-dev"
|
351 |
+
}
|
352 |
+
},
|
353 |
+
"autoload": {
|
354 |
+
"classmap": [
|
355 |
+
"src/"
|
356 |
+
]
|
357 |
+
},
|
358 |
+
"notification-url": "https://packagist.org/downloads/",
|
359 |
+
"license": [
|
360 |
+
"BSD-3-Clause"
|
361 |
+
],
|
362 |
+
"authors": [
|
363 |
+
{
|
364 |
+
"name": "Sebastian Bergmann",
|
365 |
+
"email": "sb@sebastian-bergmann.de",
|
366 |
+
"role": "lead"
|
367 |
+
}
|
368 |
+
],
|
369 |
+
"description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
|
370 |
+
"homepage": "https://github.com/sebastianbergmann/php-code-coverage",
|
371 |
+
"keywords": [
|
372 |
+
"coverage",
|
373 |
+
"testing",
|
374 |
+
"xunit"
|
375 |
+
],
|
376 |
+
"time": "2016-06-03 05:03:56"
|
377 |
+
},
|
378 |
+
{
|
379 |
+
"name": "phpunit/php-file-iterator",
|
380 |
+
"version": "1.4.1",
|
381 |
+
"source": {
|
382 |
+
"type": "git",
|
383 |
+
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
|
384 |
+
"reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0"
|
385 |
+
},
|
386 |
+
"dist": {
|
387 |
+
"type": "zip",
|
388 |
+
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
|
389 |
+
"reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
|
390 |
+
"shasum": ""
|
391 |
+
},
|
392 |
+
"require": {
|
393 |
+
"php": ">=5.3.3"
|
394 |
+
},
|
395 |
+
"type": "library",
|
396 |
+
"extra": {
|
397 |
+
"branch-alias": {
|
398 |
+
"dev-master": "1.4.x-dev"
|
399 |
+
}
|
400 |
+
},
|
401 |
+
"autoload": {
|
402 |
+
"classmap": [
|
403 |
+
"src/"
|
404 |
+
]
|
405 |
+
},
|
406 |
+
"notification-url": "https://packagist.org/downloads/",
|
407 |
+
"license": [
|
408 |
+
"BSD-3-Clause"
|
409 |
+
],
|
410 |
+
"authors": [
|
411 |
+
{
|
412 |
+
"name": "Sebastian Bergmann",
|
413 |
+
"email": "sb@sebastian-bergmann.de",
|
414 |
+
"role": "lead"
|
415 |
+
}
|
416 |
+
],
|
417 |
+
"description": "FilterIterator implementation that filters files based on a list of suffixes.",
|
418 |
+
"homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
|
419 |
+
"keywords": [
|
420 |
+
"filesystem",
|
421 |
+
"iterator"
|
422 |
+
],
|
423 |
+
"time": "2015-06-21 13:08:43"
|
424 |
+
},
|
425 |
+
{
|
426 |
+
"name": "phpunit/php-text-template",
|
427 |
+
"version": "1.2.1",
|
428 |
+
"source": {
|
429 |
+
"type": "git",
|
430 |
+
"url": "https://github.com/sebastianbergmann/php-text-template.git",
|
431 |
+
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
|
432 |
+
},
|
433 |
+
"dist": {
|
434 |
+
"type": "zip",
|
435 |
+
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
|
436 |
+
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
|
437 |
+
"shasum": ""
|
438 |
+
},
|
439 |
+
"require": {
|
440 |
+
"php": ">=5.3.3"
|
441 |
+
},
|
442 |
+
"type": "library",
|
443 |
+
"autoload": {
|
444 |
+
"classmap": [
|
445 |
+
"src/"
|
446 |
+
]
|
447 |
+
},
|
448 |
+
"notification-url": "https://packagist.org/downloads/",
|
449 |
+
"license": [
|
450 |
+
"BSD-3-Clause"
|
451 |
+
],
|
452 |
+
"authors": [
|
453 |
+
{
|
454 |
+
"name": "Sebastian Bergmann",
|
455 |
+
"email": "sebastian@phpunit.de",
|
456 |
+
"role": "lead"
|
457 |
+
}
|
458 |
+
],
|
459 |
+
"description": "Simple template engine.",
|
460 |
+
"homepage": "https://github.com/sebastianbergmann/php-text-template/",
|
461 |
+
"keywords": [
|
462 |
+
"template"
|
463 |
+
],
|
464 |
+
"time": "2015-06-21 13:50:34"
|
465 |
+
},
|
466 |
+
{
|
467 |
+
"name": "phpunit/php-timer",
|
468 |
+
"version": "1.0.8",
|
469 |
+
"source": {
|
470 |
+
"type": "git",
|
471 |
+
"url": "https://github.com/sebastianbergmann/php-timer.git",
|
472 |
+
"reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260"
|
473 |
+
},
|
474 |
+
"dist": {
|
475 |
+
"type": "zip",
|
476 |
+
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260",
|
477 |
+
"reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260",
|
478 |
+
"shasum": ""
|
479 |
+
},
|
480 |
+
"require": {
|
481 |
+
"php": ">=5.3.3"
|
482 |
+
},
|
483 |
+
"require-dev": {
|
484 |
+
"phpunit/phpunit": "~4|~5"
|
485 |
+
},
|
486 |
+
"type": "library",
|
487 |
+
"autoload": {
|
488 |
+
"classmap": [
|
489 |
+
"src/"
|
490 |
+
]
|
491 |
+
},
|
492 |
+
"notification-url": "https://packagist.org/downloads/",
|
493 |
+
"license": [
|
494 |
+
"BSD-3-Clause"
|
495 |
+
],
|
496 |
+
"authors": [
|
497 |
+
{
|
498 |
+
"name": "Sebastian Bergmann",
|
499 |
+
"email": "sb@sebastian-bergmann.de",
|
500 |
+
"role": "lead"
|
501 |
+
}
|
502 |
+
],
|
503 |
+
"description": "Utility class for timing",
|
504 |
+
"homepage": "https://github.com/sebastianbergmann/php-timer/",
|
505 |
+
"keywords": [
|
506 |
+
"timer"
|
507 |
+
],
|
508 |
+
"time": "2016-05-12 18:03:57"
|
509 |
+
},
|
510 |
+
{
|
511 |
+
"name": "phpunit/php-token-stream",
|
512 |
+
"version": "1.4.8",
|
513 |
+
"source": {
|
514 |
+
"type": "git",
|
515 |
+
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
|
516 |
+
"reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da"
|
517 |
+
},
|
518 |
+
"dist": {
|
519 |
+
"type": "zip",
|
520 |
+
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
|
521 |
+
"reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
|
522 |
+
"shasum": ""
|
523 |
+
},
|
524 |
+
"require": {
|
525 |
+
"ext-tokenizer": "*",
|
526 |
+
"php": ">=5.3.3"
|
527 |
+
},
|
528 |
+
"require-dev": {
|
529 |
+
"phpunit/phpunit": "~4.2"
|
530 |
+
},
|
531 |
+
"type": "library",
|
532 |
+
"extra": {
|
533 |
+
"branch-alias": {
|
534 |
+
"dev-master": "1.4-dev"
|
535 |
+
}
|
536 |
+
},
|
537 |
+
"autoload": {
|
538 |
+
"classmap": [
|
539 |
+
"src/"
|
540 |
+
]
|
541 |
+
},
|
542 |
+
"notification-url": "https://packagist.org/downloads/",
|
543 |
+
"license": [
|
544 |
+
"BSD-3-Clause"
|
545 |
+
],
|
546 |
+
"authors": [
|
547 |
+
{
|
548 |
+
"name": "Sebastian Bergmann",
|
549 |
+
"email": "sebastian@phpunit.de"
|
550 |
+
}
|
551 |
+
],
|
552 |
+
"description": "Wrapper around PHP's tokenizer extension.",
|
553 |
+
"homepage": "https://github.com/sebastianbergmann/php-token-stream/",
|
554 |
+
"keywords": [
|
555 |
+
"tokenizer"
|
556 |
+
],
|
557 |
+
"time": "2015-09-15 10:49:45"
|
558 |
+
},
|
559 |
+
{
|
560 |
+
"name": "phpunit/phpunit",
|
561 |
+
"version": "5.4.6",
|
562 |
+
"source": {
|
563 |
+
"type": "git",
|
564 |
+
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
565 |
+
"reference": "2f1fc94b77ea6418bd6a06c64a1dac0645fbce59"
|
566 |
+
},
|
567 |
+
"dist": {
|
568 |
+
"type": "zip",
|
569 |
+
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2f1fc94b77ea6418bd6a06c64a1dac0645fbce59",
|
570 |
+
"reference": "2f1fc94b77ea6418bd6a06c64a1dac0645fbce59",
|
571 |
+
"shasum": ""
|
572 |
+
},
|
573 |
+
"require": {
|
574 |
+
"ext-dom": "*",
|
575 |
+
"ext-json": "*",
|
576 |
+
"ext-pcre": "*",
|
577 |
+
"ext-reflection": "*",
|
578 |
+
"ext-spl": "*",
|
579 |
+
"myclabs/deep-copy": "~1.3",
|
580 |
+
"php": "^5.6 || ^7.0",
|
581 |
+
"phpspec/prophecy": "^1.3.1",
|
582 |
+
"phpunit/php-code-coverage": "^4.0",
|
583 |
+
"phpunit/php-file-iterator": "~1.4",
|
584 |
+
"phpunit/php-text-template": "~1.2",
|
585 |
+
"phpunit/php-timer": "^1.0.6",
|
586 |
+
"phpunit/phpunit-mock-objects": "^3.2",
|
587 |
+
"sebastian/comparator": "~1.1",
|
588 |
+
"sebastian/diff": "~1.2",
|
589 |
+
"sebastian/environment": "^1.3 || ^2.0",
|
590 |
+
"sebastian/exporter": "~1.2",
|
591 |
+
"sebastian/global-state": "~1.0",
|
592 |
+
"sebastian/object-enumerator": "~1.0",
|
593 |
+
"sebastian/resource-operations": "~1.0",
|
594 |
+
"sebastian/version": "~1.0|~2.0",
|
595 |
+
"symfony/yaml": "~2.1|~3.0"
|
596 |
+
},
|
597 |
+
"conflict": {
|
598 |
+
"phpdocumentor/reflection-docblock": "3.0.2"
|
599 |
+
},
|
600 |
+
"suggest": {
|
601 |
+
"phpunit/php-invoker": "~1.1"
|
602 |
+
},
|
603 |
+
"bin": [
|
604 |
+
"phpunit"
|
605 |
+
],
|
606 |
+
"type": "library",
|
607 |
+
"extra": {
|
608 |
+
"branch-alias": {
|
609 |
+
"dev-master": "5.4.x-dev"
|
610 |
+
}
|
611 |
+
},
|
612 |
+
"autoload": {
|
613 |
+
"classmap": [
|
614 |
+
"src/"
|
615 |
+
]
|
616 |
+
},
|
617 |
+
"notification-url": "https://packagist.org/downloads/",
|
618 |
+
"license": [
|
619 |
+
"BSD-3-Clause"
|
620 |
+
],
|
621 |
+
"authors": [
|
622 |
+
{
|
623 |
+
"name": "Sebastian Bergmann",
|
624 |
+
"email": "sebastian@phpunit.de",
|
625 |
+
"role": "lead"
|
626 |
+
}
|
627 |
+
],
|
628 |
+
"description": "The PHP Unit Testing framework.",
|
629 |
+
"homepage": "https://phpunit.de/",
|
630 |
+
"keywords": [
|
631 |
+
"phpunit",
|
632 |
+
"testing",
|
633 |
+
"xunit"
|
634 |
+
],
|
635 |
+
"time": "2016-06-16 06:01:15"
|
636 |
+
},
|
637 |
+
{
|
638 |
+
"name": "phpunit/phpunit-mock-objects",
|
639 |
+
"version": "3.2.3",
|
640 |
+
"source": {
|
641 |
+
"type": "git",
|
642 |
+
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
|
643 |
+
"reference": "b13d0d9426ced06958bd32104653526a6c998a52"
|
644 |
+
},
|
645 |
+
"dist": {
|
646 |
+
"type": "zip",
|
647 |
+
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/b13d0d9426ced06958bd32104653526a6c998a52",
|
648 |
+
"reference": "b13d0d9426ced06958bd32104653526a6c998a52",
|
649 |
+
"shasum": ""
|
650 |
+
},
|
651 |
+
"require": {
|
652 |
+
"doctrine/instantiator": "^1.0.2",
|
653 |
+
"php": "^5.6 || ^7.0",
|
654 |
+
"phpunit/php-text-template": "^1.2",
|
655 |
+
"sebastian/exporter": "^1.2"
|
656 |
+
},
|
657 |
+
"conflict": {
|
658 |
+
"phpunit/phpunit": "<5.4.0"
|
659 |
+
},
|
660 |
+
"require-dev": {
|
661 |
+
"phpunit/phpunit": "^5.4"
|
662 |
+
},
|
663 |
+
"suggest": {
|
664 |
+
"ext-soap": "*"
|
665 |
+
},
|
666 |
+
"type": "library",
|
667 |
+
"extra": {
|
668 |
+
"branch-alias": {
|
669 |
+
"dev-master": "3.2.x-dev"
|
670 |
+
}
|
671 |
+
},
|
672 |
+
"autoload": {
|
673 |
+
"classmap": [
|
674 |
+
"src/"
|
675 |
+
]
|
676 |
+
},
|
677 |
+
"notification-url": "https://packagist.org/downloads/",
|
678 |
+
"license": [
|
679 |
+
"BSD-3-Clause"
|
680 |
+
],
|
681 |
+
"authors": [
|
682 |
+
{
|
683 |
+
"name": "Sebastian Bergmann",
|
684 |
+
"email": "sb@sebastian-bergmann.de",
|
685 |
+
"role": "lead"
|
686 |
+
}
|
687 |
+
],
|
688 |
+
"description": "Mock Object library for PHPUnit",
|
689 |
+
"homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
|
690 |
+
"keywords": [
|
691 |
+
"mock",
|
692 |
+
"xunit"
|
693 |
+
],
|
694 |
+
"time": "2016-06-12 07:37:26"
|
695 |
+
},
|
696 |
+
{
|
697 |
+
"name": "sebastian/code-unit-reverse-lookup",
|
698 |
+
"version": "1.0.0",
|
699 |
+
"source": {
|
700 |
+
"type": "git",
|
701 |
+
"url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
|
702 |
+
"reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe"
|
703 |
+
},
|
704 |
+
"dist": {
|
705 |
+
"type": "zip",
|
706 |
+
"url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c36f5e7cfce482fde5bf8d10d41a53591e0198fe",
|
707 |
+
"reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe",
|
708 |
+
"shasum": ""
|
709 |
+
},
|
710 |
+
"require": {
|
711 |
+
"php": ">=5.6"
|
712 |
+
},
|
713 |
+
"require-dev": {
|
714 |
+
"phpunit/phpunit": "~5"
|
715 |
+
},
|
716 |
+
"type": "library",
|
717 |
+
"extra": {
|
718 |
+
"branch-alias": {
|
719 |
+
"dev-master": "1.0.x-dev"
|
720 |
+
}
|
721 |
+
},
|
722 |
+
"autoload": {
|
723 |
+
"classmap": [
|
724 |
+
"src/"
|
725 |
+
]
|
726 |
+
},
|
727 |
+
"notification-url": "https://packagist.org/downloads/",
|
728 |
+
"license": [
|
729 |
+
"BSD-3-Clause"
|
730 |
+
],
|
731 |
+
"authors": [
|
732 |
+
{
|
733 |
+
"name": "Sebastian Bergmann",
|
734 |
+
"email": "sebastian@phpunit.de"
|
735 |
+
}
|
736 |
+
],
|
737 |
+
"description": "Looks up which function or method a line of code belongs to",
|
738 |
+
"homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
|
739 |
+
"time": "2016-02-13 06:45:14"
|
740 |
+
},
|
741 |
+
{
|
742 |
+
"name": "sebastian/comparator",
|
743 |
+
"version": "1.2.0",
|
744 |
+
"source": {
|
745 |
+
"type": "git",
|
746 |
+
"url": "https://github.com/sebastianbergmann/comparator.git",
|
747 |
+
"reference": "937efb279bd37a375bcadf584dec0726f84dbf22"
|
748 |
+
},
|
749 |
+
"dist": {
|
750 |
+
"type": "zip",
|
751 |
+
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22",
|
752 |
+
"reference": "937efb279bd37a375bcadf584dec0726f84dbf22",
|
753 |
+
"shasum": ""
|
754 |
+
},
|
755 |
+
"require": {
|
756 |
+
"php": ">=5.3.3",
|
757 |
+
"sebastian/diff": "~1.2",
|
758 |
+
"sebastian/exporter": "~1.2"
|
759 |
+
},
|
760 |
+
"require-dev": {
|
761 |
+
"phpunit/phpunit": "~4.4"
|
762 |
+
},
|
763 |
+
"type": "library",
|
764 |
+
"extra": {
|
765 |
+
"branch-alias": {
|
766 |
+
"dev-master": "1.2.x-dev"
|
767 |
+
}
|
768 |
+
},
|
769 |
+
"autoload": {
|
770 |
+
"classmap": [
|
771 |
+
"src/"
|
772 |
+
]
|
773 |
+
},
|
774 |
+
"notification-url": "https://packagist.org/downloads/",
|
775 |
+
"license": [
|
776 |
+
"BSD-3-Clause"
|
777 |
+
],
|
778 |
+
"authors": [
|
779 |
+
{
|
780 |
+
"name": "Jeff Welch",
|
781 |
+
"email": "whatthejeff@gmail.com"
|
782 |
+
},
|
783 |
+
{
|
784 |
+
"name": "Volker Dusch",
|
785 |
+
"email": "github@wallbash.com"
|
786 |
+
},
|
787 |
+
{
|
788 |
+
"name": "Bernhard Schussek",
|
789 |
+
"email": "bschussek@2bepublished.at"
|
790 |
+
},
|
791 |
+
{
|
792 |
+
"name": "Sebastian Bergmann",
|
793 |
+
"email": "sebastian@phpunit.de"
|
794 |
+
}
|
795 |
+
],
|
796 |
+
"description": "Provides the functionality to compare PHP values for equality",
|
797 |
+
"homepage": "http://www.github.com/sebastianbergmann/comparator",
|
798 |
+
"keywords": [
|
799 |
+
"comparator",
|
800 |
+
"compare",
|
801 |
+
"equality"
|
802 |
+
],
|
803 |
+
"time": "2015-07-26 15:48:44"
|
804 |
+
},
|
805 |
+
{
|
806 |
+
"name": "sebastian/diff",
|
807 |
+
"version": "1.4.1",
|
808 |
+
"source": {
|
809 |
+
"type": "git",
|
810 |
+
"url": "https://github.com/sebastianbergmann/diff.git",
|
811 |
+
"reference": "13edfd8706462032c2f52b4b862974dd46b71c9e"
|
812 |
+
},
|
813 |
+
"dist": {
|
814 |
+
"type": "zip",
|
815 |
+
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e",
|
816 |
+
"reference": "13edfd8706462032c2f52b4b862974dd46b71c9e",
|
817 |
+
"shasum": ""
|
818 |
+
},
|
819 |
+
"require": {
|
820 |
+
"php": ">=5.3.3"
|
821 |
+
},
|
822 |
+
"require-dev": {
|
823 |
+
"phpunit/phpunit": "~4.8"
|
824 |
+
},
|
825 |
+
"type": "library",
|
826 |
+
"extra": {
|
827 |
+
"branch-alias": {
|
828 |
+
"dev-master": "1.4-dev"
|
829 |
+
}
|
830 |
+
},
|
831 |
+
"autoload": {
|
832 |
+
"classmap": [
|
833 |
+
"src/"
|
834 |
+
]
|
835 |
+
},
|
836 |
+
"notification-url": "https://packagist.org/downloads/",
|
837 |
+
"license": [
|
838 |
+
"BSD-3-Clause"
|
839 |
+
],
|
840 |
+
"authors": [
|
841 |
+
{
|
842 |
+
"name": "Kore Nordmann",
|
843 |
+
"email": "mail@kore-nordmann.de"
|
844 |
+
},
|
845 |
+
{
|
846 |
+
"name": "Sebastian Bergmann",
|
847 |
+
"email": "sebastian@phpunit.de"
|
848 |
+
}
|
849 |
+
],
|
850 |
+
"description": "Diff implementation",
|
851 |
+
"homepage": "https://github.com/sebastianbergmann/diff",
|
852 |
+
"keywords": [
|
853 |
+
"diff"
|
854 |
+
],
|
855 |
+
"time": "2015-12-08 07:14:41"
|
856 |
+
},
|
857 |
+
{
|
858 |
+
"name": "sebastian/environment",
|
859 |
+
"version": "1.3.7",
|
860 |
+
"source": {
|
861 |
+
"type": "git",
|
862 |
+
"url": "https://github.com/sebastianbergmann/environment.git",
|
863 |
+
"reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716"
|
864 |
+
},
|
865 |
+
"dist": {
|
866 |
+
"type": "zip",
|
867 |
+
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716",
|
868 |
+
"reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716",
|
869 |
+
"shasum": ""
|
870 |
+
},
|
871 |
+
"require": {
|
872 |
+
"php": ">=5.3.3"
|
873 |
+
},
|
874 |
+
"require-dev": {
|
875 |
+
"phpunit/phpunit": "~4.4"
|
876 |
+
},
|
877 |
+
"type": "library",
|
878 |
+
"extra": {
|
879 |
+
"branch-alias": {
|
880 |
+
"dev-master": "1.3.x-dev"
|
881 |
+
}
|
882 |
+
},
|
883 |
+
"autoload": {
|
884 |
+
"classmap": [
|
885 |
+
"src/"
|
886 |
+
]
|
887 |
+
},
|
888 |
+
"notification-url": "https://packagist.org/downloads/",
|
889 |
+
"license": [
|
890 |
+
"BSD-3-Clause"
|
891 |
+
],
|
892 |
+
"authors": [
|
893 |
+
{
|
894 |
+
"name": "Sebastian Bergmann",
|
895 |
+
"email": "sebastian@phpunit.de"
|
896 |
+
}
|
897 |
+
],
|
898 |
+
"description": "Provides functionality to handle HHVM/PHP environments",
|
899 |
+
"homepage": "http://www.github.com/sebastianbergmann/environment",
|
900 |
+
"keywords": [
|
901 |
+
"Xdebug",
|
902 |
+
"environment",
|
903 |
+
"hhvm"
|
904 |
+
],
|
905 |
+
"time": "2016-05-17 03:18:57"
|
906 |
+
},
|
907 |
+
{
|
908 |
+
"name": "sebastian/exporter",
|
909 |
+
"version": "1.2.2",
|
910 |
+
"source": {
|
911 |
+
"type": "git",
|
912 |
+
"url": "https://github.com/sebastianbergmann/exporter.git",
|
913 |
+
"reference": "42c4c2eec485ee3e159ec9884f95b431287edde4"
|
914 |
+
},
|
915 |
+
"dist": {
|
916 |
+
"type": "zip",
|
917 |
+
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4",
|
918 |
+
"reference": "42c4c2eec485ee3e159ec9884f95b431287edde4",
|
919 |
+
"shasum": ""
|
920 |
+
},
|
921 |
+
"require": {
|
922 |
+
"php": ">=5.3.3",
|
923 |
+
"sebastian/recursion-context": "~1.0"
|
924 |
+
},
|
925 |
+
"require-dev": {
|
926 |
+
"ext-mbstring": "*",
|
927 |
+
"phpunit/phpunit": "~4.4"
|
928 |
+
},
|
929 |
+
"type": "library",
|
930 |
+
"extra": {
|
931 |
+
"branch-alias": {
|
932 |
+
"dev-master": "1.3.x-dev"
|
933 |
+
}
|
934 |
+
},
|
935 |
+
"autoload": {
|
936 |
+
"classmap": [
|
937 |
+
"src/"
|
938 |
+
]
|
939 |
+
},
|
940 |
+
"notification-url": "https://packagist.org/downloads/",
|
941 |
+
"license": [
|
942 |
+
"BSD-3-Clause"
|
943 |
+
],
|
944 |
+
"authors": [
|
945 |
+
{
|
946 |
+
"name": "Jeff Welch",
|
947 |
+
"email": "whatthejeff@gmail.com"
|
948 |
+
},
|
949 |
+
{
|
950 |
+
"name": "Volker Dusch",
|
951 |
+
"email": "github@wallbash.com"
|
952 |
+
},
|
953 |
+
{
|
954 |
+
"name": "Bernhard Schussek",
|
955 |
+
"email": "bschussek@2bepublished.at"
|
956 |
+
},
|
957 |
+
{
|
958 |
+
"name": "Sebastian Bergmann",
|
959 |
+
"email": "sebastian@phpunit.de"
|
960 |
+
},
|
961 |
+
{
|
962 |
+
"name": "Adam Harvey",
|
963 |
+
"email": "aharvey@php.net"
|
964 |
+
}
|
965 |
+
],
|
966 |
+
"description": "Provides the functionality to export PHP variables for visualization",
|
967 |
+
"homepage": "http://www.github.com/sebastianbergmann/exporter",
|
968 |
+
"keywords": [
|
969 |
+
"export",
|
970 |
+
"exporter"
|
971 |
+
],
|
972 |
+
"time": "2016-06-17 09:04:28"
|
973 |
+
},
|
974 |
+
{
|
975 |
+
"name": "sebastian/global-state",
|
976 |
+
"version": "1.1.1",
|
977 |
+
"source": {
|
978 |
+
"type": "git",
|
979 |
+
"url": "https://github.com/sebastianbergmann/global-state.git",
|
980 |
+
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
|
981 |
+
},
|
982 |
+
"dist": {
|
983 |
+
"type": "zip",
|
984 |
+
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
|
985 |
+
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
|
986 |
+
"shasum": ""
|
987 |
+
},
|
988 |
+
"require": {
|
989 |
+
"php": ">=5.3.3"
|
990 |
+
},
|
991 |
+
"require-dev": {
|
992 |
+
"phpunit/phpunit": "~4.2"
|
993 |
+
},
|
994 |
+
"suggest": {
|
995 |
+
"ext-uopz": "*"
|
996 |
+
},
|
997 |
+
"type": "library",
|
998 |
+
"extra": {
|
999 |
+
"branch-alias": {
|
1000 |
+
"dev-master": "1.0-dev"
|
1001 |
+
}
|
1002 |
+
},
|
1003 |
+
"autoload": {
|
1004 |
+
"classmap": [
|
1005 |
+
"src/"
|
1006 |
+
]
|
1007 |
+
},
|
1008 |
+
"notification-url": "https://packagist.org/downloads/",
|
1009 |
+
"license": [
|
1010 |
+
"BSD-3-Clause"
|
1011 |
+
],
|
1012 |
+
"authors": [
|
1013 |
+
{
|
1014 |
+
"name": "Sebastian Bergmann",
|
1015 |
+
"email": "sebastian@phpunit.de"
|
1016 |
+
}
|
1017 |
+
],
|
1018 |
+
"description": "Snapshotting of global state",
|
1019 |
+
"homepage": "http://www.github.com/sebastianbergmann/global-state",
|
1020 |
+
"keywords": [
|
1021 |
+
"global state"
|
1022 |
+
],
|
1023 |
+
"time": "2015-10-12 03:26:01"
|
1024 |
+
},
|
1025 |
+
{
|
1026 |
+
"name": "sebastian/object-enumerator",
|
1027 |
+
"version": "1.0.0",
|
1028 |
+
"source": {
|
1029 |
+
"type": "git",
|
1030 |
+
"url": "https://github.com/sebastianbergmann/object-enumerator.git",
|
1031 |
+
"reference": "d4ca2fb70344987502567bc50081c03e6192fb26"
|
1032 |
+
},
|
1033 |
+
"dist": {
|
1034 |
+
"type": "zip",
|
1035 |
+
"url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/d4ca2fb70344987502567bc50081c03e6192fb26",
|
1036 |
+
"reference": "d4ca2fb70344987502567bc50081c03e6192fb26",
|
1037 |
+
"shasum": ""
|
1038 |
+
},
|
1039 |
+
"require": {
|
1040 |
+
"php": ">=5.6",
|
1041 |
+
"sebastian/recursion-context": "~1.0"
|
1042 |
+
},
|
1043 |
+
"require-dev": {
|
1044 |
+
"phpunit/phpunit": "~5"
|
1045 |
+
},
|
1046 |
+
"type": "library",
|
1047 |
+
"extra": {
|
1048 |
+
"branch-alias": {
|
1049 |
+
"dev-master": "1.0.x-dev"
|
1050 |
+
}
|
1051 |
+
},
|
1052 |
+
"autoload": {
|
1053 |
+
"classmap": [
|
1054 |
+
"src/"
|
1055 |
+
]
|
1056 |
+
},
|
1057 |
+
"notification-url": "https://packagist.org/downloads/",
|
1058 |
+
"license": [
|
1059 |
+
"BSD-3-Clause"
|
1060 |
+
],
|
1061 |
+
"authors": [
|
1062 |
+
{
|
1063 |
+
"name": "Sebastian Bergmann",
|
1064 |
+
"email": "sebastian@phpunit.de"
|
1065 |
+
}
|
1066 |
+
],
|
1067 |
+
"description": "Traverses array structures and object graphs to enumerate all referenced objects",
|
1068 |
+
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
|
1069 |
+
"time": "2016-01-28 13:25:10"
|
1070 |
+
},
|
1071 |
+
{
|
1072 |
+
"name": "sebastian/recursion-context",
|
1073 |
+
"version": "1.0.2",
|
1074 |
+
"source": {
|
1075 |
+
"type": "git",
|
1076 |
+
"url": "https://github.com/sebastianbergmann/recursion-context.git",
|
1077 |
+
"reference": "913401df809e99e4f47b27cdd781f4a258d58791"
|
1078 |
+
},
|
1079 |
+
"dist": {
|
1080 |
+
"type": "zip",
|
1081 |
+
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791",
|
1082 |
+
"reference": "913401df809e99e4f47b27cdd781f4a258d58791",
|
1083 |
+
"shasum": ""
|
1084 |
+
},
|
1085 |
+
"require": {
|
1086 |
+
"php": ">=5.3.3"
|
1087 |
+
},
|
1088 |
+
"require-dev": {
|
1089 |
+
"phpunit/phpunit": "~4.4"
|
1090 |
+
},
|
1091 |
+
"type": "library",
|
1092 |
+
"extra": {
|
1093 |
+
"branch-alias": {
|
1094 |
+
"dev-master": "1.0.x-dev"
|
1095 |
+
}
|
1096 |
+
},
|
1097 |
+
"autoload": {
|
1098 |
+
"classmap": [
|
1099 |
+
"src/"
|
1100 |
+
]
|
1101 |
+
},
|
1102 |
+
"notification-url": "https://packagist.org/downloads/",
|
1103 |
+
"license": [
|
1104 |
+
"BSD-3-Clause"
|
1105 |
+
],
|
1106 |
+
"authors": [
|
1107 |
+
{
|
1108 |
+
"name": "Jeff Welch",
|
1109 |
+
"email": "whatthejeff@gmail.com"
|
1110 |
+
},
|
1111 |
+
{
|
1112 |
+
"name": "Sebastian Bergmann",
|
1113 |
+
"email": "sebastian@phpunit.de"
|
1114 |
+
},
|
1115 |
+
{
|
1116 |
+
"name": "Adam Harvey",
|
1117 |
+
"email": "aharvey@php.net"
|
1118 |
+
}
|
1119 |
+
],
|
1120 |
+
"description": "Provides functionality to recursively process PHP variables",
|
1121 |
+
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
|
1122 |
+
"time": "2015-11-11 19:50:13"
|
1123 |
+
},
|
1124 |
+
{
|
1125 |
+
"name": "sebastian/resource-operations",
|
1126 |
+
"version": "1.0.0",
|
1127 |
+
"source": {
|
1128 |
+
"type": "git",
|
1129 |
+
"url": "https://github.com/sebastianbergmann/resource-operations.git",
|
1130 |
+
"reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52"
|
1131 |
+
},
|
1132 |
+
"dist": {
|
1133 |
+
"type": "zip",
|
1134 |
+
"url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
|
1135 |
+
"reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
|
1136 |
+
"shasum": ""
|
1137 |
+
},
|
1138 |
+
"require": {
|
1139 |
+
"php": ">=5.6.0"
|
1140 |
+
},
|
1141 |
+
"type": "library",
|
1142 |
+
"extra": {
|
1143 |
+
"branch-alias": {
|
1144 |
+
"dev-master": "1.0.x-dev"
|
1145 |
+
}
|
1146 |
+
},
|
1147 |
+
"autoload": {
|
1148 |
+
"classmap": [
|
1149 |
+
"src/"
|
1150 |
+
]
|
1151 |
+
},
|
1152 |
+
"notification-url": "https://packagist.org/downloads/",
|
1153 |
+
"license": [
|
1154 |
+
"BSD-3-Clause"
|
1155 |
+
],
|
1156 |
+
"authors": [
|
1157 |
+
{
|
1158 |
+
"name": "Sebastian Bergmann",
|
1159 |
+
"email": "sebastian@phpunit.de"
|
1160 |
+
}
|
1161 |
+
],
|
1162 |
+
"description": "Provides a list of PHP built-in functions that operate on resources",
|
1163 |
+
"homepage": "https://www.github.com/sebastianbergmann/resource-operations",
|
1164 |
+
"time": "2015-07-28 20:34:47"
|
1165 |
+
},
|
1166 |
+
{
|
1167 |
+
"name": "sebastian/version",
|
1168 |
+
"version": "2.0.0",
|
1169 |
+
"source": {
|
1170 |
+
"type": "git",
|
1171 |
+
"url": "https://github.com/sebastianbergmann/version.git",
|
1172 |
+
"reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5"
|
1173 |
+
},
|
1174 |
+
"dist": {
|
1175 |
+
"type": "zip",
|
1176 |
+
"url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5",
|
1177 |
+
"reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5",
|
1178 |
+
"shasum": ""
|
1179 |
+
},
|
1180 |
+
"require": {
|
1181 |
+
"php": ">=5.6"
|
1182 |
+
},
|
1183 |
+
"type": "library",
|
1184 |
+
"extra": {
|
1185 |
+
"branch-alias": {
|
1186 |
+
"dev-master": "2.0.x-dev"
|
1187 |
+
}
|
1188 |
+
},
|
1189 |
+
"autoload": {
|
1190 |
+
"classmap": [
|
1191 |
+
"src/"
|
1192 |
+
]
|
1193 |
+
},
|
1194 |
+
"notification-url": "https://packagist.org/downloads/",
|
1195 |
+
"license": [
|
1196 |
+
"BSD-3-Clause"
|
1197 |
+
],
|
1198 |
+
"authors": [
|
1199 |
+
{
|
1200 |
+
"name": "Sebastian Bergmann",
|
1201 |
+
"email": "sebastian@phpunit.de",
|
1202 |
+
"role": "lead"
|
1203 |
+
}
|
1204 |
+
],
|
1205 |
+
"description": "Library that helps with managing the version number of Git-hosted PHP projects",
|
1206 |
+
"homepage": "https://github.com/sebastianbergmann/version",
|
1207 |
+
"time": "2016-02-04 12:56:52"
|
1208 |
+
},
|
1209 |
+
{
|
1210 |
+
"name": "symfony/yaml",
|
1211 |
+
"version": "v3.1.2",
|
1212 |
+
"source": {
|
1213 |
+
"type": "git",
|
1214 |
+
"url": "https://github.com/symfony/yaml.git",
|
1215 |
+
"reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de"
|
1216 |
+
},
|
1217 |
+
"dist": {
|
1218 |
+
"type": "zip",
|
1219 |
+
"url": "https://api.github.com/repos/symfony/yaml/zipball/2884c26ce4c1d61aebf423a8b912950fe7c764de",
|
1220 |
+
"reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de",
|
1221 |
+
"shasum": ""
|
1222 |
+
},
|
1223 |
+
"require": {
|
1224 |
+
"php": ">=5.5.9"
|
1225 |
+
},
|
1226 |
+
"type": "library",
|
1227 |
+
"extra": {
|
1228 |
+
"branch-alias": {
|
1229 |
+
"dev-master": "3.1-dev"
|
1230 |
+
}
|
1231 |
+
},
|
1232 |
+
"autoload": {
|
1233 |
+
"psr-4": {
|
1234 |
+
"Symfony\\Component\\Yaml\\": ""
|
1235 |
+
},
|
1236 |
+
"exclude-from-classmap": [
|
1237 |
+
"/Tests/"
|
1238 |
+
]
|
1239 |
+
},
|
1240 |
+
"notification-url": "https://packagist.org/downloads/",
|
1241 |
+
"license": [
|
1242 |
+
"MIT"
|
1243 |
+
],
|
1244 |
+
"authors": [
|
1245 |
+
{
|
1246 |
+
"name": "Fabien Potencier",
|
1247 |
+
"email": "fabien@symfony.com"
|
1248 |
+
},
|
1249 |
+
{
|
1250 |
+
"name": "Symfony Community",
|
1251 |
+
"homepage": "https://symfony.com/contributors"
|
1252 |
+
}
|
1253 |
+
],
|
1254 |
+
"description": "Symfony Yaml Component",
|
1255 |
+
"homepage": "https://symfony.com",
|
1256 |
+
"time": "2016-06-29 05:41:56"
|
1257 |
+
},
|
1258 |
+
{
|
1259 |
+
"name": "webmozart/assert",
|
1260 |
+
"version": "1.0.2",
|
1261 |
+
"source": {
|
1262 |
+
"type": "git",
|
1263 |
+
"url": "https://github.com/webmozart/assert.git",
|
1264 |
+
"reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde"
|
1265 |
+
},
|
1266 |
+
"dist": {
|
1267 |
+
"type": "zip",
|
1268 |
+
"url": "https://api.github.com/repos/webmozart/assert/zipball/30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde",
|
1269 |
+
"reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde",
|
1270 |
+
"shasum": ""
|
1271 |
+
},
|
1272 |
+
"require": {
|
1273 |
+
"php": ">=5.3.3"
|
1274 |
+
},
|
1275 |
+
"require-dev": {
|
1276 |
+
"phpunit/phpunit": "^4.6"
|
1277 |
+
},
|
1278 |
+
"type": "library",
|
1279 |
+
"extra": {
|
1280 |
+
"branch-alias": {
|
1281 |
+
"dev-master": "1.0-dev"
|
1282 |
+
}
|
1283 |
+
},
|
1284 |
+
"autoload": {
|
1285 |
+
"psr-4": {
|
1286 |
+
"Webmozart\\Assert\\": "src/"
|
1287 |
+
}
|
1288 |
+
},
|
1289 |
+
"notification-url": "https://packagist.org/downloads/",
|
1290 |
+
"license": [
|
1291 |
+
"MIT"
|
1292 |
+
],
|
1293 |
+
"authors": [
|
1294 |
+
{
|
1295 |
+
"name": "Bernhard Schussek",
|
1296 |
+
"email": "bschussek@gmail.com"
|
1297 |
+
}
|
1298 |
+
],
|
1299 |
+
"description": "Assertions to validate method input/output with nice error messages.",
|
1300 |
+
"keywords": [
|
1301 |
+
"assert",
|
1302 |
+
"check",
|
1303 |
+
"validate"
|
1304 |
+
],
|
1305 |
+
"time": "2015-08-24 13:29:44"
|
1306 |
+
}
|
1307 |
+
],
|
1308 |
+
"aliases": [],
|
1309 |
+
"minimum-stability": "stable",
|
1310 |
+
"stability-flags": [],
|
1311 |
+
"prefer-stable": false,
|
1312 |
+
"prefer-lowest": false,
|
1313 |
+
"platform": {
|
1314 |
+
"php": ">=5.3.2"
|
1315 |
+
},
|
1316 |
+
"platform-dev": []
|
1317 |
+
}
|
vendor/sabberworm/php-css-parser/index.php
ADDED
File without changes
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/AtRuleBlockList.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\CSSList;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Property\AtRule;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* A BlockList constructed by an unknown @-rule. @media rules are rendered into AtRuleBlockList objects.
|
9 |
+
*/
|
10 |
+
class AtRuleBlockList extends CSSBlockList implements AtRule {
|
11 |
+
|
12 |
+
private $sType;
|
13 |
+
private $sArgs;
|
14 |
+
|
15 |
+
public function __construct($sType, $sArgs = '', $iLineNo = 0) {
|
16 |
+
parent::__construct($iLineNo);
|
17 |
+
$this->sType = $sType;
|
18 |
+
$this->sArgs = $sArgs;
|
19 |
+
}
|
20 |
+
|
21 |
+
public function atRuleName() {
|
22 |
+
return $this->sType;
|
23 |
+
}
|
24 |
+
|
25 |
+
public function atRuleArgs() {
|
26 |
+
return $this->sArgs;
|
27 |
+
}
|
28 |
+
|
29 |
+
public function __toString() {
|
30 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
31 |
+
}
|
32 |
+
|
33 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
34 |
+
$sArgs = $this->sArgs;
|
35 |
+
if($sArgs) {
|
36 |
+
$sArgs = ' ' . $sArgs;
|
37 |
+
}
|
38 |
+
$sResult = "@{$this->sType}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{";
|
39 |
+
$sResult .= parent::render($oOutputFormat);
|
40 |
+
$sResult .= '}';
|
41 |
+
return $sResult;
|
42 |
+
}
|
43 |
+
|
44 |
+
public function isRootList() {
|
45 |
+
return false;
|
46 |
+
}
|
47 |
+
|
48 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/CSSBlockList.php
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\CSSList;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\RuleSet\DeclarationBlock;
|
6 |
+
use Sabberworm\CSS\RuleSet\RuleSet;
|
7 |
+
use Sabberworm\CSS\Property\Selector;
|
8 |
+
use Sabberworm\CSS\Rule\Rule;
|
9 |
+
use Sabberworm\CSS\Value\ValueList;
|
10 |
+
use Sabberworm\CSS\Value\CSSFunction;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* A CSSBlockList is a CSSList whose DeclarationBlocks are guaranteed to contain valid declaration blocks or at-rules.
|
14 |
+
* Most CSSLists conform to this category but some at-rules (such as @keyframes) do not.
|
15 |
+
*/
|
16 |
+
abstract class CSSBlockList extends CSSList {
|
17 |
+
public function __construct($iLineNo = 0) {
|
18 |
+
parent::__construct($iLineNo);
|
19 |
+
}
|
20 |
+
|
21 |
+
protected function allDeclarationBlocks(&$aResult) {
|
22 |
+
foreach ($this->aContents as $mContent) {
|
23 |
+
if ($mContent instanceof DeclarationBlock) {
|
24 |
+
$aResult[] = $mContent;
|
25 |
+
} else if ($mContent instanceof CSSBlockList) {
|
26 |
+
$mContent->allDeclarationBlocks($aResult);
|
27 |
+
}
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
protected function allRuleSets(&$aResult) {
|
32 |
+
foreach ($this->aContents as $mContent) {
|
33 |
+
if ($mContent instanceof RuleSet) {
|
34 |
+
$aResult[] = $mContent;
|
35 |
+
} else if ($mContent instanceof CSSBlockList) {
|
36 |
+
$mContent->allRuleSets($aResult);
|
37 |
+
}
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
protected function allValues($oElement, &$aResult, $sSearchString = null, $bSearchInFunctionArguments = false) {
|
42 |
+
if ($oElement instanceof CSSBlockList) {
|
43 |
+
foreach ($oElement->getContents() as $oContent) {
|
44 |
+
$this->allValues($oContent, $aResult, $sSearchString, $bSearchInFunctionArguments);
|
45 |
+
}
|
46 |
+
} else if ($oElement instanceof RuleSet) {
|
47 |
+
foreach ($oElement->getRules($sSearchString) as $oRule) {
|
48 |
+
$this->allValues($oRule, $aResult, $sSearchString, $bSearchInFunctionArguments);
|
49 |
+
}
|
50 |
+
} else if ($oElement instanceof Rule) {
|
51 |
+
$this->allValues($oElement->getValue(), $aResult, $sSearchString, $bSearchInFunctionArguments);
|
52 |
+
} else if ($oElement instanceof ValueList) {
|
53 |
+
if ($bSearchInFunctionArguments || !($oElement instanceof CSSFunction)) {
|
54 |
+
foreach ($oElement->getListComponents() as $mComponent) {
|
55 |
+
$this->allValues($mComponent, $aResult, $sSearchString, $bSearchInFunctionArguments);
|
56 |
+
}
|
57 |
+
}
|
58 |
+
} else {
|
59 |
+
//Non-List Value or CSSString (CSS identifier)
|
60 |
+
$aResult[] = $oElement;
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
protected function allSelectors(&$aResult, $sSpecificitySearch = null) {
|
65 |
+
$aDeclarationBlocks = array();
|
66 |
+
$this->allDeclarationBlocks($aDeclarationBlocks);
|
67 |
+
foreach ($aDeclarationBlocks as $oBlock) {
|
68 |
+
foreach ($oBlock->getSelectors() as $oSelector) {
|
69 |
+
if ($sSpecificitySearch === null) {
|
70 |
+
$aResult[] = $oSelector;
|
71 |
+
} else {
|
72 |
+
$sComparison = "\$bRes = {$oSelector->getSpecificity()} $sSpecificitySearch;";
|
73 |
+
eval($sComparison);
|
74 |
+
if ($bRes) {
|
75 |
+
$aResult[] = $oSelector;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
}
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/CSSList.php
ADDED
@@ -0,0 +1,157 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\CSSList;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Renderable;
|
6 |
+
use Sabberworm\CSS\RuleSet\DeclarationBlock;
|
7 |
+
use Sabberworm\CSS\RuleSet\RuleSet;
|
8 |
+
use Sabberworm\CSS\Property\Selector;
|
9 |
+
use Sabberworm\CSS\Comment\Commentable;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* A CSSList is the most generic container available. Its contents include RuleSet as well as other CSSList objects.
|
13 |
+
* Also, it may contain Import and Charset objects stemming from @-rules.
|
14 |
+
*/
|
15 |
+
abstract class CSSList implements Renderable, Commentable {
|
16 |
+
|
17 |
+
protected $aComments;
|
18 |
+
protected $aContents;
|
19 |
+
protected $iLineNo;
|
20 |
+
|
21 |
+
public function __construct($iLineNo = 0) {
|
22 |
+
$this->aComments = array();
|
23 |
+
$this->aContents = array();
|
24 |
+
$this->iLineNo = $iLineNo;
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @return int
|
29 |
+
*/
|
30 |
+
public function getLineNo() {
|
31 |
+
return $this->iLineNo;
|
32 |
+
}
|
33 |
+
|
34 |
+
public function append($oItem) {
|
35 |
+
$this->aContents[] = $oItem;
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Removes an item from the CSS list.
|
40 |
+
* @param RuleSet|Import|Charset|CSSList $oItemToRemove May be a RuleSet (most likely a DeclarationBlock), a Import, a Charset or another CSSList (most likely a MediaQuery)
|
41 |
+
*/
|
42 |
+
public function remove($oItemToRemove) {
|
43 |
+
$iKey = array_search($oItemToRemove, $this->aContents, true);
|
44 |
+
if ($iKey !== false) {
|
45 |
+
unset($this->aContents[$iKey]);
|
46 |
+
return true;
|
47 |
+
}
|
48 |
+
return false;
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Set the contents.
|
53 |
+
* @param array $aContents Objects to set as content.
|
54 |
+
*/
|
55 |
+
public function setContents(array $aContents) {
|
56 |
+
$this->aContents = array();
|
57 |
+
foreach ($aContents as $content) {
|
58 |
+
$this->append($content);
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Removes a declaration block from the CSS list if it matches all given selectors.
|
64 |
+
* @param array|string $mSelector The selectors to match.
|
65 |
+
* @param boolean $bRemoveAll Whether to stop at the first declaration block found or remove all blocks
|
66 |
+
*/
|
67 |
+
public function removeDeclarationBlockBySelector($mSelector, $bRemoveAll = false) {
|
68 |
+
if ($mSelector instanceof DeclarationBlock) {
|
69 |
+
$mSelector = $mSelector->getSelectors();
|
70 |
+
}
|
71 |
+
if (!is_array($mSelector)) {
|
72 |
+
$mSelector = explode(',', $mSelector);
|
73 |
+
}
|
74 |
+
foreach ($mSelector as $iKey => &$mSel) {
|
75 |
+
if (!($mSel instanceof Selector)) {
|
76 |
+
$mSel = new Selector($mSel);
|
77 |
+
}
|
78 |
+
}
|
79 |
+
foreach ($this->aContents as $iKey => $mItem) {
|
80 |
+
if (!($mItem instanceof DeclarationBlock)) {
|
81 |
+
continue;
|
82 |
+
}
|
83 |
+
if ($mItem->getSelectors() == $mSelector) {
|
84 |
+
unset($this->aContents[$iKey]);
|
85 |
+
if (!$bRemoveAll) {
|
86 |
+
return;
|
87 |
+
}
|
88 |
+
}
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
public function __toString() {
|
93 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
94 |
+
}
|
95 |
+
|
96 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
97 |
+
$sResult = '';
|
98 |
+
$bIsFirst = true;
|
99 |
+
$oNextLevel = $oOutputFormat;
|
100 |
+
if(!$this->isRootList()) {
|
101 |
+
$oNextLevel = $oOutputFormat->nextLevel();
|
102 |
+
}
|
103 |
+
foreach ($this->aContents as $oContent) {
|
104 |
+
$sRendered = $oOutputFormat->safely(function() use ($oNextLevel, $oContent) {
|
105 |
+
return $oContent->render($oNextLevel);
|
106 |
+
});
|
107 |
+
if($sRendered === null) {
|
108 |
+
continue;
|
109 |
+
}
|
110 |
+
if($bIsFirst) {
|
111 |
+
$bIsFirst = false;
|
112 |
+
$sResult .= $oNextLevel->spaceBeforeBlocks();
|
113 |
+
} else {
|
114 |
+
$sResult .= $oNextLevel->spaceBetweenBlocks();
|
115 |
+
}
|
116 |
+
$sResult .= $sRendered;
|
117 |
+
}
|
118 |
+
|
119 |
+
if(!$bIsFirst) {
|
120 |
+
// Had some output
|
121 |
+
$sResult .= $oOutputFormat->spaceAfterBlocks();
|
122 |
+
}
|
123 |
+
|
124 |
+
return $sResult;
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Return true if the list can not be further outdented. Only important when rendering.
|
129 |
+
*/
|
130 |
+
public abstract function isRootList();
|
131 |
+
|
132 |
+
public function getContents() {
|
133 |
+
return $this->aContents;
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* @param array $aComments Array of comments.
|
138 |
+
*/
|
139 |
+
public function addComments(array $aComments) {
|
140 |
+
$this->aComments = array_merge($this->aComments, $aComments);
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* @return array
|
145 |
+
*/
|
146 |
+
public function getComments() {
|
147 |
+
return $this->aComments;
|
148 |
+
}
|
149 |
+
|
150 |
+
/**
|
151 |
+
* @param array $aComments Array containing Comment objects.
|
152 |
+
*/
|
153 |
+
public function setComments(array $aComments) {
|
154 |
+
$this->aComments = $aComments;
|
155 |
+
}
|
156 |
+
|
157 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/Document.php
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\CSSList;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* The root CSSList of a parsed file. Contains all top-level css contents, mostly declaration blocks, but also any @-rules encountered.
|
7 |
+
*/
|
8 |
+
class Document extends CSSBlockList {
|
9 |
+
/**
|
10 |
+
* Document constructor.
|
11 |
+
* @param int $iLineNo
|
12 |
+
*/
|
13 |
+
public function __construct($iLineNo = 0) {
|
14 |
+
parent::__construct($iLineNo);
|
15 |
+
}
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Gets all DeclarationBlock objects recursively.
|
19 |
+
*/
|
20 |
+
public function getAllDeclarationBlocks() {
|
21 |
+
$aResult = array();
|
22 |
+
$this->allDeclarationBlocks($aResult);
|
23 |
+
return $aResult;
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @deprecated use getAllDeclarationBlocks()
|
28 |
+
*/
|
29 |
+
public function getAllSelectors() {
|
30 |
+
return $this->getAllDeclarationBlocks();
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Returns all RuleSet objects found recursively in the tree.
|
35 |
+
*/
|
36 |
+
public function getAllRuleSets() {
|
37 |
+
$aResult = array();
|
38 |
+
$this->allRuleSets($aResult);
|
39 |
+
return $aResult;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Returns all Value objects found recursively in the tree.
|
44 |
+
* @param (object|string) $mElement the CSSList or RuleSet to start the search from (defaults to the whole document). If a string is given, it is used as rule name filter (@see{RuleSet->getRules()}).
|
45 |
+
* @param (bool) $bSearchInFunctionArguments whether to also return Value objects used as Function arguments.
|
46 |
+
*/
|
47 |
+
public function getAllValues($mElement = null, $bSearchInFunctionArguments = false) {
|
48 |
+
$sSearchString = null;
|
49 |
+
if ($mElement === null) {
|
50 |
+
$mElement = $this;
|
51 |
+
} else if (is_string($mElement)) {
|
52 |
+
$sSearchString = $mElement;
|
53 |
+
$mElement = $this;
|
54 |
+
}
|
55 |
+
$aResult = array();
|
56 |
+
$this->allValues($mElement, $aResult, $sSearchString, $bSearchInFunctionArguments);
|
57 |
+
return $aResult;
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Returns all Selector objects found recursively in the tree.
|
62 |
+
* Note that this does not yield the full DeclarationBlock that the selector belongs to (and, currently, there is no way to get to that).
|
63 |
+
* @param $sSpecificitySearch An optional filter by specificity. May contain a comparison operator and a number or just a number (defaults to "==").
|
64 |
+
* @example getSelectorsBySpecificity('>= 100')
|
65 |
+
*/
|
66 |
+
public function getSelectorsBySpecificity($sSpecificitySearch = null) {
|
67 |
+
if (is_numeric($sSpecificitySearch) || is_numeric($sSpecificitySearch[0])) {
|
68 |
+
$sSpecificitySearch = "== $sSpecificitySearch";
|
69 |
+
}
|
70 |
+
$aResult = array();
|
71 |
+
$this->allSelectors($aResult, $sSpecificitySearch);
|
72 |
+
return $aResult;
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Expands all shorthand properties to their long value
|
77 |
+
*/
|
78 |
+
public function expandShorthands() {
|
79 |
+
foreach ($this->getAllDeclarationBlocks() as $oDeclaration) {
|
80 |
+
$oDeclaration->expandShorthands();
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Create shorthands properties whenever possible
|
86 |
+
*/
|
87 |
+
public function createShorthands() {
|
88 |
+
foreach ($this->getAllDeclarationBlocks() as $oDeclaration) {
|
89 |
+
$oDeclaration->createShorthands();
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
// Override render() to make format argument optional
|
94 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat = null) {
|
95 |
+
if($oOutputFormat === null) {
|
96 |
+
$oOutputFormat = new \Sabberworm\CSS\OutputFormat();
|
97 |
+
}
|
98 |
+
return parent::render($oOutputFormat);
|
99 |
+
}
|
100 |
+
|
101 |
+
public function isRootList() {
|
102 |
+
return true;
|
103 |
+
}
|
104 |
+
|
105 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/KeyFrame.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\CSSList;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Property\AtRule;
|
6 |
+
|
7 |
+
class KeyFrame extends CSSList implements AtRule {
|
8 |
+
|
9 |
+
private $vendorKeyFrame;
|
10 |
+
private $animationName;
|
11 |
+
|
12 |
+
public function __construct($iLineNo = 0) {
|
13 |
+
parent::__construct($iLineNo);
|
14 |
+
$this->vendorKeyFrame = null;
|
15 |
+
$this->animationName = null;
|
16 |
+
}
|
17 |
+
|
18 |
+
public function setVendorKeyFrame($vendorKeyFrame) {
|
19 |
+
$this->vendorKeyFrame = $vendorKeyFrame;
|
20 |
+
}
|
21 |
+
|
22 |
+
public function getVendorKeyFrame() {
|
23 |
+
return $this->vendorKeyFrame;
|
24 |
+
}
|
25 |
+
|
26 |
+
public function setAnimationName($animationName) {
|
27 |
+
$this->animationName = $animationName;
|
28 |
+
}
|
29 |
+
|
30 |
+
public function getAnimationName() {
|
31 |
+
return $this->animationName;
|
32 |
+
}
|
33 |
+
|
34 |
+
public function __toString() {
|
35 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
36 |
+
}
|
37 |
+
|
38 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
39 |
+
$sResult = "@{$this->vendorKeyFrame} {$this->animationName}{$oOutputFormat->spaceBeforeOpeningBrace()}{";
|
40 |
+
$sResult .= parent::render($oOutputFormat);
|
41 |
+
$sResult .= '}';
|
42 |
+
return $sResult;
|
43 |
+
}
|
44 |
+
|
45 |
+
public function isRootList() {
|
46 |
+
return false;
|
47 |
+
}
|
48 |
+
|
49 |
+
public function atRuleName() {
|
50 |
+
return $this->vendorKeyFrame;
|
51 |
+
}
|
52 |
+
|
53 |
+
public function atRuleArgs() {
|
54 |
+
return $this->animationName;
|
55 |
+
}
|
56 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/index.php
ADDED
File without changes
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Comment/Comment.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Comment;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Renderable;
|
6 |
+
|
7 |
+
class Comment implements Renderable {
|
8 |
+
protected $iLineNo;
|
9 |
+
protected $sComment;
|
10 |
+
|
11 |
+
public function __construct($sComment = '', $iLineNo = 0) {
|
12 |
+
$this->sComment = $sComment;
|
13 |
+
$this->iLineNo = $iLineNo;
|
14 |
+
}
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @return string
|
18 |
+
*/
|
19 |
+
public function getComment() {
|
20 |
+
return $this->sComment;
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @return int
|
25 |
+
*/
|
26 |
+
public function getLineNo() {
|
27 |
+
return $this->iLineNo;
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @return string
|
32 |
+
*/
|
33 |
+
public function setComment($sComment) {
|
34 |
+
$this->sComment = $sComment;
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* @return string
|
39 |
+
*/
|
40 |
+
public function __toString() {
|
41 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* @return string
|
46 |
+
*/
|
47 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
48 |
+
return '/*' . $this->sComment . '*/';
|
49 |
+
}
|
50 |
+
|
51 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Comment/Commentable.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Comment;
|
4 |
+
|
5 |
+
interface Commentable {
|
6 |
+
|
7 |
+
/**
|
8 |
+
* @param array $aComments Array of comments.
|
9 |
+
*/
|
10 |
+
public function addComments(array $aComments);
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @return array
|
14 |
+
*/
|
15 |
+
public function getComments();
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @param array $aComments Array containing Comment objects.
|
19 |
+
*/
|
20 |
+
public function setComments(array $aComments);
|
21 |
+
|
22 |
+
|
23 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Comment/index.php
ADDED
File without changes
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/OutputFormat.php
ADDED
@@ -0,0 +1,289 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Parsing\OutputException;
|
6 |
+
|
7 |
+
class OutputFormat {
|
8 |
+
/**
|
9 |
+
* Value format
|
10 |
+
*/
|
11 |
+
// " means double-quote, ' means single-quote
|
12 |
+
public $sStringQuotingType = '"';
|
13 |
+
// Output RGB colors in hash notation if possible
|
14 |
+
public $bRGBHashNotation = true;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Declaration format
|
18 |
+
*/
|
19 |
+
// Semicolon after the last rule of a declaration block can be omitted. To do that, set this false.
|
20 |
+
public $bSemicolonAfterLastRule = true;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Spacing
|
24 |
+
* Note that these strings are not sanity-checked: the value should only consist of whitespace
|
25 |
+
* Any newline character will be indented according to the current level.
|
26 |
+
* The triples (After, Before, Between) can be set using a wildcard (e.g. `$oFormat->set('Space*Rules', "\n");`)
|
27 |
+
*/
|
28 |
+
public $sSpaceAfterRuleName = ' ';
|
29 |
+
|
30 |
+
public $sSpaceBeforeRules = '';
|
31 |
+
public $sSpaceAfterRules = '';
|
32 |
+
public $sSpaceBetweenRules = '';
|
33 |
+
|
34 |
+
public $sSpaceBeforeBlocks = '';
|
35 |
+
public $sSpaceAfterBlocks = '';
|
36 |
+
public $sSpaceBetweenBlocks = "\n";
|
37 |
+
|
38 |
+
// This is what’s printed before and after the comma if a declaration block contains multiple selectors.
|
39 |
+
public $sSpaceBeforeSelectorSeparator = '';
|
40 |
+
public $sSpaceAfterSelectorSeparator = ' ';
|
41 |
+
// This is what’s printed after the comma of value lists
|
42 |
+
public $sSpaceBeforeListArgumentSeparator = '';
|
43 |
+
public $sSpaceAfterListArgumentSeparator = '';
|
44 |
+
|
45 |
+
public $sSpaceBeforeOpeningBrace = ' ';
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Indentation
|
49 |
+
*/
|
50 |
+
// Indentation character(s) per level. Only applicable if newlines are used in any of the spacing settings.
|
51 |
+
public $sIndentation = "\t";
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Output exceptions.
|
55 |
+
*/
|
56 |
+
public $bIgnoreExceptions = false;
|
57 |
+
|
58 |
+
|
59 |
+
private $oFormatter = null;
|
60 |
+
private $oNextLevelFormat = null;
|
61 |
+
private $iIndentationLevel = 0;
|
62 |
+
|
63 |
+
public function __construct() {
|
64 |
+
}
|
65 |
+
|
66 |
+
public function get($sName) {
|
67 |
+
$aVarPrefixes = array('a', 's', 'm', 'b', 'f', 'o', 'c', 'i');
|
68 |
+
foreach($aVarPrefixes as $sPrefix) {
|
69 |
+
$sFieldName = $sPrefix.ucfirst($sName);
|
70 |
+
if(isset($this->$sFieldName)) {
|
71 |
+
return $this->$sFieldName;
|
72 |
+
}
|
73 |
+
}
|
74 |
+
return null;
|
75 |
+
}
|
76 |
+
|
77 |
+
public function set($aNames, $mValue) {
|
78 |
+
$aVarPrefixes = array('a', 's', 'm', 'b', 'f', 'o', 'c', 'i');
|
79 |
+
if(is_string($aNames) && strpos($aNames, '*') !== false) {
|
80 |
+
$aNames = array(str_replace('*', 'Before', $aNames), str_replace('*', 'Between', $aNames), str_replace('*', 'After', $aNames));
|
81 |
+
} else if(!is_array($aNames)) {
|
82 |
+
$aNames = array($aNames);
|
83 |
+
}
|
84 |
+
foreach($aVarPrefixes as $sPrefix) {
|
85 |
+
$bDidReplace = false;
|
86 |
+
foreach($aNames as $sName) {
|
87 |
+
$sFieldName = $sPrefix.ucfirst($sName);
|
88 |
+
if(isset($this->$sFieldName)) {
|
89 |
+
$this->$sFieldName = $mValue;
|
90 |
+
$bDidReplace = true;
|
91 |
+
}
|
92 |
+
}
|
93 |
+
if($bDidReplace) {
|
94 |
+
return $this;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
// Break the chain so the user knows this option is invalid
|
98 |
+
return false;
|
99 |
+
}
|
100 |
+
|
101 |
+
public function __call($sMethodName, $aArguments) {
|
102 |
+
if(strpos($sMethodName, 'set') === 0) {
|
103 |
+
return $this->set(substr($sMethodName, 3), $aArguments[0]);
|
104 |
+
} else if(strpos($sMethodName, 'get') === 0) {
|
105 |
+
return $this->get(substr($sMethodName, 3));
|
106 |
+
} else if(method_exists('\\Sabberworm\\CSS\\OutputFormatter', $sMethodName)) {
|
107 |
+
return call_user_func_array(array($this->getFormatter(), $sMethodName), $aArguments);
|
108 |
+
} else {
|
109 |
+
throw new \Exception('Unknown OutputFormat method called: '.$sMethodName);
|
110 |
+
}
|
111 |
+
}
|
112 |
+
|
113 |
+
public function indentWithTabs($iNumber = 1) {
|
114 |
+
return $this->setIndentation(str_repeat("\t", $iNumber));
|
115 |
+
}
|
116 |
+
|
117 |
+
public function indentWithSpaces($iNumber = 2) {
|
118 |
+
return $this->setIndentation(str_repeat(" ", $iNumber));
|
119 |
+
}
|
120 |
+
|
121 |
+
public function nextLevel() {
|
122 |
+
if($this->oNextLevelFormat === null) {
|
123 |
+
$this->oNextLevelFormat = clone $this;
|
124 |
+
$this->oNextLevelFormat->iIndentationLevel++;
|
125 |
+
$this->oNextLevelFormat->oFormatter = null;
|
126 |
+
}
|
127 |
+
return $this->oNextLevelFormat;
|
128 |
+
}
|
129 |
+
|
130 |
+
public function beLenient() {
|
131 |
+
$this->bIgnoreExceptions = true;
|
132 |
+
}
|
133 |
+
|
134 |
+
public function getFormatter() {
|
135 |
+
if($this->oFormatter === null) {
|
136 |
+
$this->oFormatter = new OutputFormatter($this);
|
137 |
+
}
|
138 |
+
return $this->oFormatter;
|
139 |
+
}
|
140 |
+
|
141 |
+
public function level() {
|
142 |
+
return $this->iIndentationLevel;
|
143 |
+
}
|
144 |
+
|
145 |
+
public static function create() {
|
146 |
+
return new OutputFormat();
|
147 |
+
}
|
148 |
+
|
149 |
+
public static function createCompact() {
|
150 |
+
return self::create()->set('Space*Rules', "")->set('Space*Blocks', "")->setSpaceAfterRuleName('')->setSpaceBeforeOpeningBrace('')->setSpaceAfterSelectorSeparator('');
|
151 |
+
}
|
152 |
+
|
153 |
+
public static function createPretty() {
|
154 |
+
return self::create()->set('Space*Rules', "\n")->set('Space*Blocks', "\n")->setSpaceBetweenBlocks("\n\n")->set('SpaceAfterListArgumentSeparator', array('default' => '', ',' => ' '));
|
155 |
+
}
|
156 |
+
}
|
157 |
+
|
158 |
+
class OutputFormatter {
|
159 |
+
private $oFormat;
|
160 |
+
|
161 |
+
public function __construct(OutputFormat $oFormat) {
|
162 |
+
$this->oFormat = $oFormat;
|
163 |
+
}
|
164 |
+
|
165 |
+
public function space($sName, $sType = null) {
|
166 |
+
$sSpaceString = $this->oFormat->get("Space$sName");
|
167 |
+
// If $sSpaceString is an array, we have multple values configured depending on the type of object the space applies to
|
168 |
+
if(is_array($sSpaceString)) {
|
169 |
+
if($sType !== null && isset($sSpaceString[$sType])) {
|
170 |
+
$sSpaceString = $sSpaceString[$sType];
|
171 |
+
} else {
|
172 |
+
$sSpaceString = reset($sSpaceString);
|
173 |
+
}
|
174 |
+
}
|
175 |
+
return $this->prepareSpace($sSpaceString);
|
176 |
+
}
|
177 |
+
|
178 |
+
public function spaceAfterRuleName() {
|
179 |
+
return $this->space('AfterRuleName');
|
180 |
+
}
|
181 |
+
|
182 |
+
public function spaceBeforeRules() {
|
183 |
+
return $this->space('BeforeRules');
|
184 |
+
}
|
185 |
+
|
186 |
+
public function spaceAfterRules() {
|
187 |
+
return $this->space('AfterRules');
|
188 |
+
}
|
189 |
+
|
190 |
+
public function spaceBetweenRules() {
|
191 |
+
return $this->space('BetweenRules');
|
192 |
+
}
|
193 |
+
|
194 |
+
public function spaceBeforeBlocks() {
|
195 |
+
return $this->space('BeforeBlocks');
|
196 |
+
}
|
197 |
+
|
198 |
+
public function spaceAfterBlocks() {
|
199 |
+
return $this->space('AfterBlocks');
|
200 |
+
}
|
201 |
+
|
202 |
+
public function spaceBetweenBlocks() {
|
203 |
+
return $this->space('BetweenBlocks');
|
204 |
+
}
|
205 |
+
|
206 |
+
public function spaceBeforeSelectorSeparator() {
|
207 |
+
return $this->space('BeforeSelectorSeparator');
|
208 |
+
}
|
209 |
+
|
210 |
+
public function spaceAfterSelectorSeparator() {
|
211 |
+
return $this->space('AfterSelectorSeparator');
|
212 |
+
}
|
213 |
+
|
214 |
+
public function spaceBeforeListArgumentSeparator($sSeparator) {
|
215 |
+
return $this->space('BeforeListArgumentSeparator', $sSeparator);
|
216 |
+
}
|
217 |
+
|
218 |
+
public function spaceAfterListArgumentSeparator($sSeparator) {
|
219 |
+
return $this->space('AfterListArgumentSeparator', $sSeparator);
|
220 |
+
}
|
221 |
+
|
222 |
+
public function spaceBeforeOpeningBrace() {
|
223 |
+
return $this->space('BeforeOpeningBrace');
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Runs the given code, either swallowing or passing exceptions, depending on the bIgnoreExceptions setting.
|
228 |
+
*/
|
229 |
+
public function safely($cCode) {
|
230 |
+
if($this->oFormat->get('IgnoreExceptions')) {
|
231 |
+
// If output exceptions are ignored, run the code with exception guards
|
232 |
+
try {
|
233 |
+
return $cCode();
|
234 |
+
} catch (OutputException $e) {
|
235 |
+
return null;
|
236 |
+
} //Do nothing
|
237 |
+
} else {
|
238 |
+
// Run the code as-is
|
239 |
+
return $cCode();
|
240 |
+
}
|
241 |
+
}
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Clone of the implode function but calls ->render with the current output format instead of __toString()
|
245 |
+
*/
|
246 |
+
public function implode($sSeparator, $aValues, $bIncreaseLevel = false) {
|
247 |
+
$sResult = '';
|
248 |
+
$oFormat = $this->oFormat;
|
249 |
+
if($bIncreaseLevel) {
|
250 |
+
$oFormat = $oFormat->nextLevel();
|
251 |
+
}
|
252 |
+
$bIsFirst = true;
|
253 |
+
foreach($aValues as $mValue) {
|
254 |
+
if($bIsFirst) {
|
255 |
+
$bIsFirst = false;
|
256 |
+
} else {
|
257 |
+
$sResult .= $sSeparator;
|
258 |
+
}
|
259 |
+
if($mValue instanceof \Sabberworm\CSS\Renderable) {
|
260 |
+
$sResult .= $mValue->render($oFormat);
|
261 |
+
} else {
|
262 |
+
$sResult .= $mValue;
|
263 |
+
}
|
264 |
+
}
|
265 |
+
return $sResult;
|
266 |
+
}
|
267 |
+
|
268 |
+
public function removeLastSemicolon($sString) {
|
269 |
+
if($this->oFormat->get('SemicolonAfterLastRule')) {
|
270 |
+
return $sString;
|
271 |
+
}
|
272 |
+
$sString = explode(';', $sString);
|
273 |
+
if(count($sString) < 2) {
|
274 |
+
return $sString[0];
|
275 |
+
}
|
276 |
+
$sLast = array_pop($sString);
|
277 |
+
$sNextToLast = array_pop($sString);
|
278 |
+
array_push($sString, $sNextToLast.$sLast);
|
279 |
+
return implode(';', $sString);
|
280 |
+
}
|
281 |
+
|
282 |
+
private function prepareSpace($sSpaceString) {
|
283 |
+
return str_replace("\n", "\n".$this->indent(), $sSpaceString);
|
284 |
+
}
|
285 |
+
|
286 |
+
private function indent() {
|
287 |
+
return str_repeat($this->oFormat->sIndentation, $this->oFormat->level());
|
288 |
+
}
|
289 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parser.php
ADDED
@@ -0,0 +1,719 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\CSSList\CSSList;
|
6 |
+
use Sabberworm\CSS\CSSList\Document;
|
7 |
+
use Sabberworm\CSS\CSSList\KeyFrame;
|
8 |
+
use Sabberworm\CSS\Parsing\SourceException;
|
9 |
+
use Sabberworm\CSS\Property\AtRule;
|
10 |
+
use Sabberworm\CSS\Property\Import;
|
11 |
+
use Sabberworm\CSS\Property\Charset;
|
12 |
+
use Sabberworm\CSS\Property\CSSNamespace;
|
13 |
+
use Sabberworm\CSS\RuleSet\AtRuleSet;
|
14 |
+
use Sabberworm\CSS\CSSList\AtRuleBlockList;
|
15 |
+
use Sabberworm\CSS\RuleSet\DeclarationBlock;
|
16 |
+
use Sabberworm\CSS\Value\CSSFunction;
|
17 |
+
use Sabberworm\CSS\Value\RuleValueList;
|
18 |
+
use Sabberworm\CSS\Value\Size;
|
19 |
+
use Sabberworm\CSS\Value\Color;
|
20 |
+
use Sabberworm\CSS\Value\URL;
|
21 |
+
use Sabberworm\CSS\Value\CSSString;
|
22 |
+
use Sabberworm\CSS\Rule\Rule;
|
23 |
+
use Sabberworm\CSS\Parsing\UnexpectedTokenException;
|
24 |
+
use Sabberworm\CSS\Comment\Comment;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Parser class parses CSS from text into a data structure.
|
28 |
+
*/
|
29 |
+
class Parser {
|
30 |
+
|
31 |
+
private $sText;
|
32 |
+
private $aText;
|
33 |
+
private $iCurrentPosition;
|
34 |
+
private $oParserSettings;
|
35 |
+
private $sCharset;
|
36 |
+
private $iLength;
|
37 |
+
private $blockRules;
|
38 |
+
private $aSizeUnits;
|
39 |
+
private $iLineNo;
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Parser constructor.
|
43 |
+
* Note that that iLineNo starts from 1 and not 0
|
44 |
+
*
|
45 |
+
* @param $sText
|
46 |
+
* @param Settings|null $oParserSettings
|
47 |
+
* @param int $iLineNo
|
48 |
+
*/
|
49 |
+
public function __construct($sText, Settings $oParserSettings = null, $iLineNo = 1) {
|
50 |
+
$this->sText = $sText;
|
51 |
+
$this->iCurrentPosition = 0;
|
52 |
+
$this->iLineNo = $iLineNo;
|
53 |
+
if ($oParserSettings === null) {
|
54 |
+
$oParserSettings = Settings::create();
|
55 |
+
}
|
56 |
+
$this->oParserSettings = $oParserSettings;
|
57 |
+
$this->blockRules = explode('/', AtRule::BLOCK_RULES);
|
58 |
+
|
59 |
+
foreach (explode('/', Size::ABSOLUTE_SIZE_UNITS.'/'.Size::RELATIVE_SIZE_UNITS.'/'.Size::NON_SIZE_UNITS) as $val) {
|
60 |
+
$iSize = strlen($val);
|
61 |
+
if(!isset($this->aSizeUnits[$iSize])) {
|
62 |
+
$this->aSizeUnits[$iSize] = array();
|
63 |
+
}
|
64 |
+
$this->aSizeUnits[$iSize][strtolower($val)] = $val;
|
65 |
+
}
|
66 |
+
ksort($this->aSizeUnits, SORT_NUMERIC);
|
67 |
+
}
|
68 |
+
|
69 |
+
public function setCharset($sCharset) {
|
70 |
+
$this->sCharset = $sCharset;
|
71 |
+
$this->aText = $this->strsplit($this->sText);
|
72 |
+
$this->iLength = count($this->aText);
|
73 |
+
}
|
74 |
+
|
75 |
+
public function getCharset() {
|
76 |
+
return $this->sCharset;
|
77 |
+
}
|
78 |
+
|
79 |
+
public function parse() {
|
80 |
+
$this->setCharset($this->oParserSettings->sDefaultCharset);
|
81 |
+
$oResult = new Document($this->iLineNo);
|
82 |
+
$this->parseDocument($oResult);
|
83 |
+
return $oResult;
|
84 |
+
}
|
85 |
+
|
86 |
+
private function parseDocument(Document $oDocument) {
|
87 |
+
$this->parseList($oDocument, true);
|
88 |
+
}
|
89 |
+
|
90 |
+
private function parseList(CSSList $oList, $bIsRoot = false) {
|
91 |
+
while (!$this->isEnd()) {
|
92 |
+
$comments = $this->consumeWhiteSpace();
|
93 |
+
$oListItem = null;
|
94 |
+
if($this->oParserSettings->bLenientParsing) {
|
95 |
+
try {
|
96 |
+
$oListItem = $this->parseListItem($oList, $bIsRoot);
|
97 |
+
} catch (UnexpectedTokenException $e) {
|
98 |
+
$oListItem = false;
|
99 |
+
}
|
100 |
+
} else {
|
101 |
+
$oListItem = $this->parseListItem($oList, $bIsRoot);
|
102 |
+
}
|
103 |
+
if($oListItem === null) {
|
104 |
+
// List parsing finished
|
105 |
+
return;
|
106 |
+
}
|
107 |
+
if($oListItem) {
|
108 |
+
$oListItem->setComments($comments);
|
109 |
+
$oList->append($oListItem);
|
110 |
+
}
|
111 |
+
}
|
112 |
+
if (!$bIsRoot) {
|
113 |
+
throw new SourceException("Unexpected end of document", $this->iLineNo);
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
private function parseListItem(CSSList $oList, $bIsRoot = false) {
|
118 |
+
if ($this->comes('@')) {
|
119 |
+
$oAtRule = $this->parseAtRule();
|
120 |
+
if($oAtRule instanceof Charset) {
|
121 |
+
if(!$bIsRoot) {
|
122 |
+
throw new UnexpectedTokenException('@charset may only occur in root document', '', 'custom', $this->iLineNo);
|
123 |
+
}
|
124 |
+
if(count($oList->getContents()) > 0) {
|
125 |
+
throw new UnexpectedTokenException('@charset must be the first parseable token in a document', '', 'custom', $this->iLineNo);
|
126 |
+
}
|
127 |
+
$this->setCharset($oAtRule->getCharset()->getString());
|
128 |
+
}
|
129 |
+
return $oAtRule;
|
130 |
+
} else if ($this->comes('}')) {
|
131 |
+
$this->consume('}');
|
132 |
+
if ($bIsRoot) {
|
133 |
+
throw new SourceException("Unopened {", $this->iLineNo);
|
134 |
+
} else {
|
135 |
+
return null;
|
136 |
+
}
|
137 |
+
} else {
|
138 |
+
return $this->parseSelector();
|
139 |
+
}
|
140 |
+
}
|
141 |
+
|
142 |
+
private function parseAtRule() {
|
143 |
+
$this->consume('@');
|
144 |
+
$sIdentifier = $this->parseIdentifier(false);
|
145 |
+
$iIdentifierLineNum = $this->iLineNo;
|
146 |
+
$this->consumeWhiteSpace();
|
147 |
+
if ($sIdentifier === 'import') {
|
148 |
+
$oLocation = $this->parseURLValue();
|
149 |
+
$this->consumeWhiteSpace();
|
150 |
+
$sMediaQuery = null;
|
151 |
+
if (!$this->comes(';')) {
|
152 |
+
$sMediaQuery = $this->consumeUntil(';');
|
153 |
+
}
|
154 |
+
$this->consume(';');
|
155 |
+
return new Import($oLocation, $sMediaQuery, $iIdentifierLineNum);
|
156 |
+
} else if ($sIdentifier === 'charset') {
|
157 |
+
$sCharset = $this->parseStringValue();
|
158 |
+
$this->consumeWhiteSpace();
|
159 |
+
$this->consume(';');
|
160 |
+
return new Charset($sCharset, $iIdentifierLineNum);
|
161 |
+
} else if ($this->identifierIs($sIdentifier, 'keyframes')) {
|
162 |
+
$oResult = new KeyFrame($iIdentifierLineNum);
|
163 |
+
$oResult->setVendorKeyFrame($sIdentifier);
|
164 |
+
$oResult->setAnimationName(trim($this->consumeUntil('{', false, true)));
|
165 |
+
$this->parseList($oResult);
|
166 |
+
return $oResult;
|
167 |
+
} else if ($sIdentifier === 'namespace') {
|
168 |
+
$sPrefix = null;
|
169 |
+
$mUrl = $this->parsePrimitiveValue();
|
170 |
+
if (!$this->comes(';')) {
|
171 |
+
$sPrefix = $mUrl;
|
172 |
+
$mUrl = $this->parsePrimitiveValue();
|
173 |
+
}
|
174 |
+
$this->consume(';');
|
175 |
+
if ($sPrefix !== null && !is_string($sPrefix)) {
|
176 |
+
throw new UnexpectedTokenException('Wrong namespace prefix', $sPrefix, 'custom', $iIdentifierLineNum);
|
177 |
+
}
|
178 |
+
if (!($mUrl instanceof CSSString || $mUrl instanceof URL)) {
|
179 |
+
throw new UnexpectedTokenException('Wrong namespace url of invalid type', $mUrl, 'custom', $iIdentifierLineNum);
|
180 |
+
}
|
181 |
+
return new CSSNamespace($mUrl, $sPrefix, $iIdentifierLineNum);
|
182 |
+
} else {
|
183 |
+
//Unknown other at rule (font-face or such)
|
184 |
+
$sArgs = trim($this->consumeUntil('{', false, true));
|
185 |
+
$bUseRuleSet = true;
|
186 |
+
foreach($this->blockRules as $sBlockRuleName) {
|
187 |
+
if($this->identifierIs($sIdentifier, $sBlockRuleName)) {
|
188 |
+
$bUseRuleSet = false;
|
189 |
+
break;
|
190 |
+
}
|
191 |
+
}
|
192 |
+
if($bUseRuleSet) {
|
193 |
+
$oAtRule = new AtRuleSet($sIdentifier, $sArgs, $iIdentifierLineNum);
|
194 |
+
$this->parseRuleSet($oAtRule);
|
195 |
+
} else {
|
196 |
+
$oAtRule = new AtRuleBlockList($sIdentifier, $sArgs, $iIdentifierLineNum);
|
197 |
+
$this->parseList($oAtRule);
|
198 |
+
}
|
199 |
+
return $oAtRule;
|
200 |
+
}
|
201 |
+
}
|
202 |
+
|
203 |
+
private function parseIdentifier($bAllowFunctions = true, $bIgnoreCase = true) {
|
204 |
+
$sResult = $this->parseCharacter(true);
|
205 |
+
if ($sResult === null) {
|
206 |
+
throw new UnexpectedTokenException($sResult, $this->peek(5), 'identifier', $this->iLineNo);
|
207 |
+
}
|
208 |
+
$sCharacter = null;
|
209 |
+
while (($sCharacter = $this->parseCharacter(true)) !== null) {
|
210 |
+
$sResult .= $sCharacter;
|
211 |
+
}
|
212 |
+
if ($bIgnoreCase) {
|
213 |
+
$sResult = $this->strtolower($sResult);
|
214 |
+
}
|
215 |
+
if ($bAllowFunctions && $this->comes('(')) {
|
216 |
+
$this->consume('(');
|
217 |
+
$aArguments = $this->parseValue(array('=', ' ', ','));
|
218 |
+
$sResult = new CSSFunction($sResult, $aArguments, ',', $this->iLineNo);
|
219 |
+
$this->consume(')');
|
220 |
+
}
|
221 |
+
return $sResult;
|
222 |
+
}
|
223 |
+
|
224 |
+
private function parseStringValue() {
|
225 |
+
$sBegin = $this->peek();
|
226 |
+
$sQuote = null;
|
227 |
+
if ($sBegin === "'") {
|
228 |
+
$sQuote = "'";
|
229 |
+
} else if ($sBegin === '"') {
|
230 |
+
$sQuote = '"';
|
231 |
+
}
|
232 |
+
if ($sQuote !== null) {
|
233 |
+
$this->consume($sQuote);
|
234 |
+
}
|
235 |
+
$sResult = "";
|
236 |
+
$sContent = null;
|
237 |
+
if ($sQuote === null) {
|
238 |
+
//Unquoted strings end in whitespace or with braces, brackets, parentheses
|
239 |
+
while (!preg_match('/[\\s{}()<>\\[\\]]/isu', $this->peek())) {
|
240 |
+
$sResult .= $this->parseCharacter(false);
|
241 |
+
}
|
242 |
+
} else {
|
243 |
+
while (!$this->comes($sQuote)) {
|
244 |
+
$sContent = $this->parseCharacter(false);
|
245 |
+
if ($sContent === null) {
|
246 |
+
throw new SourceException("Non-well-formed quoted string {$this->peek(3)}", $this->iLineNo);
|
247 |
+
}
|
248 |
+
$sResult .= $sContent;
|
249 |
+
}
|
250 |
+
$this->consume($sQuote);
|
251 |
+
}
|
252 |
+
return new CSSString($sResult, $this->iLineNo);
|
253 |
+
}
|
254 |
+
|
255 |
+
private function parseCharacter($bIsForIdentifier) {
|
256 |
+
if ($this->peek() === '\\') {
|
257 |
+
if ($bIsForIdentifier && $this->oParserSettings->bLenientParsing && ($this->comes('\0') || $this->comes('\9'))) {
|
258 |
+
// Non-strings can contain \0 or \9 which is an IE hack supported in lenient parsing.
|
259 |
+
return null;
|
260 |
+
}
|
261 |
+
$this->consume('\\');
|
262 |
+
if ($this->comes('\n') || $this->comes('\r')) {
|
263 |
+
return '';
|
264 |
+
}
|
265 |
+
if (preg_match('/[0-9a-fA-F]/Su', $this->peek()) === 0) {
|
266 |
+
return $this->consume(1);
|
267 |
+
}
|
268 |
+
$sUnicode = $this->consumeExpression('/^[0-9a-fA-F]{1,6}/u');
|
269 |
+
if ($this->strlen($sUnicode) < 6) {
|
270 |
+
//Consume whitespace after incomplete unicode escape
|
271 |
+
if (preg_match('/\\s/isSu', $this->peek())) {
|
272 |
+
if ($this->comes('\r\n')) {
|
273 |
+
$this->consume(2);
|
274 |
+
} else {
|
275 |
+
$this->consume(1);
|
276 |
+
}
|
277 |
+
}
|
278 |
+
}
|
279 |
+
$iUnicode = intval($sUnicode, 16);
|
280 |
+
$sUtf32 = "";
|
281 |
+
for ($i = 0; $i < 4; ++$i) {
|
282 |
+
$sUtf32 .= chr($iUnicode & 0xff);
|
283 |
+
$iUnicode = $iUnicode >> 8;
|
284 |
+
}
|
285 |
+
return iconv('utf-32le', $this->sCharset, $sUtf32);
|
286 |
+
}
|
287 |
+
if ($bIsForIdentifier) {
|
288 |
+
$peek = ord($this->peek());
|
289 |
+
// Ranges: a-z A-Z 0-9 - _
|
290 |
+
if (($peek >= 97 && $peek <= 122) ||
|
291 |
+
($peek >= 65 && $peek <= 90) ||
|
292 |
+
($peek >= 48 && $peek <= 57) ||
|
293 |
+
($peek === 45) ||
|
294 |
+
($peek === 95) ||
|
295 |
+
($peek > 0xa1)) {
|
296 |
+
return $this->consume(1);
|
297 |
+
}
|
298 |
+
} else {
|
299 |
+
return $this->consume(1);
|
300 |
+
}
|
301 |
+
return null;
|
302 |
+
}
|
303 |
+
|
304 |
+
private function parseSelector() {
|
305 |
+
$aComments = array();
|
306 |
+
$oResult = new DeclarationBlock($this->iLineNo);
|
307 |
+
$oResult->setSelector($this->consumeUntil('{', false, true, $aComments));
|
308 |
+
$oResult->setComments($aComments);
|
309 |
+
$this->parseRuleSet($oResult);
|
310 |
+
return $oResult;
|
311 |
+
}
|
312 |
+
|
313 |
+
private function parseRuleSet($oRuleSet) {
|
314 |
+
while ($this->comes(';')) {
|
315 |
+
$this->consume(';');
|
316 |
+
}
|
317 |
+
while (!$this->comes('}')) {
|
318 |
+
$oRule = null;
|
319 |
+
if($this->oParserSettings->bLenientParsing) {
|
320 |
+
try {
|
321 |
+
$oRule = $this->parseRule();
|
322 |
+
} catch (UnexpectedTokenException $e) {
|
323 |
+
try {
|
324 |
+
$sConsume = $this->consumeUntil(array("\n", ";", '}'), true);
|
325 |
+
// We need to “unfind” the matches to the end of the ruleSet as this will be matched later
|
326 |
+
if($this->streql(substr($sConsume, -1), '}')) {
|
327 |
+
--$this->iCurrentPosition;
|
328 |
+
} else {
|
329 |
+
while ($this->comes(';')) {
|
330 |
+
$this->consume(';');
|
331 |
+
}
|
332 |
+
}
|
333 |
+
} catch (UnexpectedTokenException $e) {
|
334 |
+
// We’ve reached the end of the document. Just close the RuleSet.
|
335 |
+
return;
|
336 |
+
}
|
337 |
+
}
|
338 |
+
} else {
|
339 |
+
$oRule = $this->parseRule();
|
340 |
+
}
|
341 |
+
if($oRule) {
|
342 |
+
$oRuleSet->addRule($oRule);
|
343 |
+
}
|
344 |
+
}
|
345 |
+
$this->consume('}');
|
346 |
+
}
|
347 |
+
|
348 |
+
private function parseRule() {
|
349 |
+
$aComments = $this->consumeWhiteSpace();
|
350 |
+
$oRule = new Rule($this->parseIdentifier(), $this->iLineNo);
|
351 |
+
$oRule->setComments($aComments);
|
352 |
+
$oRule->addComments($this->consumeWhiteSpace());
|
353 |
+
$this->consume(':');
|
354 |
+
$oValue = $this->parseValue(self::listDelimiterForRule($oRule->getRule()));
|
355 |
+
$oRule->setValue($oValue);
|
356 |
+
if ($this->oParserSettings->bLenientParsing) {
|
357 |
+
while ($this->comes('\\')) {
|
358 |
+
$this->consume('\\');
|
359 |
+
$oRule->addIeHack($this->consume());
|
360 |
+
$this->consumeWhiteSpace();
|
361 |
+
}
|
362 |
+
}
|
363 |
+
if ($this->comes('!')) {
|
364 |
+
$this->consume('!');
|
365 |
+
$this->consumeWhiteSpace();
|
366 |
+
$this->consume('important');
|
367 |
+
$oRule->setIsImportant(true);
|
368 |
+
}
|
369 |
+
while ($this->comes(';')) {
|
370 |
+
$this->consume(';');
|
371 |
+
}
|
372 |
+
return $oRule;
|
373 |
+
}
|
374 |
+
|
375 |
+
private function parseValue($aListDelimiters) {
|
376 |
+
$aStack = array();
|
377 |
+
$this->consumeWhiteSpace();
|
378 |
+
//Build a list of delimiters and parsed values
|
379 |
+
while (!($this->comes('}') || $this->comes(';') || $this->comes('!') || $this->comes(')') || $this->comes('\\'))) {
|
380 |
+
if (count($aStack) > 0) {
|
381 |
+
$bFoundDelimiter = false;
|
382 |
+
foreach ($aListDelimiters as $sDelimiter) {
|
383 |
+
if ($this->comes($sDelimiter)) {
|
384 |
+
array_push($aStack, $this->consume($sDelimiter));
|
385 |
+
$this->consumeWhiteSpace();
|
386 |
+
$bFoundDelimiter = true;
|
387 |
+
break;
|
388 |
+
}
|
389 |
+
}
|
390 |
+
if (!$bFoundDelimiter) {
|
391 |
+
//Whitespace was the list delimiter
|
392 |
+
array_push($aStack, ' ');
|
393 |
+
}
|
394 |
+
}
|
395 |
+
array_push($aStack, $this->parsePrimitiveValue());
|
396 |
+
$this->consumeWhiteSpace();
|
397 |
+
}
|
398 |
+
//Convert the list to list objects
|
399 |
+
foreach ($aListDelimiters as $sDelimiter) {
|
400 |
+
if (count($aStack) === 1) {
|
401 |
+
return $aStack[0];
|
402 |
+
}
|
403 |
+
$iStartPosition = null;
|
404 |
+
while (($iStartPosition = array_search($sDelimiter, $aStack, true)) !== false) {
|
405 |
+
$iLength = 2; //Number of elements to be joined
|
406 |
+
for ($i = $iStartPosition + 2; $i < count($aStack); $i+=2, ++$iLength) {
|
407 |
+
if ($sDelimiter !== $aStack[$i]) {
|
408 |
+
break;
|
409 |
+
}
|
410 |
+
}
|
411 |
+
$oList = new RuleValueList($sDelimiter, $this->iLineNo);
|
412 |
+
for ($i = $iStartPosition - 1; $i - $iStartPosition + 1 < $iLength * 2; $i+=2) {
|
413 |
+
$oList->addListComponent($aStack[$i]);
|
414 |
+
}
|
415 |
+
array_splice($aStack, $iStartPosition - 1, $iLength * 2 - 1, array($oList));
|
416 |
+
}
|
417 |
+
}
|
418 |
+
return $aStack[0];
|
419 |
+
}
|
420 |
+
|
421 |
+
private static function listDelimiterForRule($sRule) {
|
422 |
+
if (preg_match('/^font($|-)/', $sRule)) {
|
423 |
+
return array(',', '/', ' ');
|
424 |
+
}
|
425 |
+
return array(',', ' ', '/');
|
426 |
+
}
|
427 |
+
|
428 |
+
private function parsePrimitiveValue() {
|
429 |
+
$oValue = null;
|
430 |
+
$this->consumeWhiteSpace();
|
431 |
+
if (is_numeric($this->peek()) || ($this->comes('-.') && is_numeric($this->peek(1, 2))) || (($this->comes('-') || $this->comes('.')) && is_numeric($this->peek(1, 1)))) {
|
432 |
+
$oValue = $this->parseNumericValue();
|
433 |
+
} else if ($this->comes('#') || $this->comes('rgb', true) || $this->comes('hsl', true)) {
|
434 |
+
$oValue = $this->parseColorValue();
|
435 |
+
} else if ($this->comes('url', true)) {
|
436 |
+
$oValue = $this->parseURLValue();
|
437 |
+
} else if ($this->comes("'") || $this->comes('"')) {
|
438 |
+
$oValue = $this->parseStringValue();
|
439 |
+
} else {
|
440 |
+
$oValue = $this->parseIdentifier(true, false);
|
441 |
+
}
|
442 |
+
$this->consumeWhiteSpace();
|
443 |
+
return $oValue;
|
444 |
+
}
|
445 |
+
|
446 |
+
private function parseNumericValue($bForColor = false) {
|
447 |
+
$sSize = '';
|
448 |
+
if ($this->comes('-')) {
|
449 |
+
$sSize .= $this->consume('-');
|
450 |
+
}
|
451 |
+
while (is_numeric($this->peek()) || $this->comes('.')) {
|
452 |
+
if ($this->comes('.')) {
|
453 |
+
$sSize .= $this->consume('.');
|
454 |
+
} else {
|
455 |
+
$sSize .= $this->consume(1);
|
456 |
+
}
|
457 |
+
}
|
458 |
+
|
459 |
+
$sUnit = null;
|
460 |
+
foreach ($this->aSizeUnits as $iLength => &$aValues) {
|
461 |
+
$sKey = strtolower($this->peek($iLength));
|
462 |
+
if(array_key_exists($sKey, $aValues)) {
|
463 |
+
if (($sUnit = $aValues[$sKey]) !== null) {
|
464 |
+
$this->consume($iLength);
|
465 |
+
break;
|
466 |
+
}
|
467 |
+
}
|
468 |
+
}
|
469 |
+
return new Size(floatval($sSize), $sUnit, $bForColor, $this->iLineNo);
|
470 |
+
}
|
471 |
+
|
472 |
+
private function parseColorValue() {
|
473 |
+
$aColor = array();
|
474 |
+
if ($this->comes('#')) {
|
475 |
+
$this->consume('#');
|
476 |
+
$sValue = $this->parseIdentifier(false);
|
477 |
+
if ($this->strlen($sValue) === 3) {
|
478 |
+
$sValue = $sValue[0] . $sValue[0] . $sValue[1] . $sValue[1] . $sValue[2] . $sValue[2];
|
479 |
+
}
|
480 |
+
$aColor = array('r' => new Size(intval($sValue[0] . $sValue[1], 16), null, true, $this->iLineNo), 'g' => new Size(intval($sValue[2] . $sValue[3], 16), null, true, $this->iLineNo), 'b' => new Size(intval($sValue[4] . $sValue[5], 16), null, true, $this->iLineNo));
|
481 |
+
} else {
|
482 |
+
$sColorMode = $this->parseIdentifier(false);
|
483 |
+
$this->consumeWhiteSpace();
|
484 |
+
$this->consume('(');
|
485 |
+
$iLength = $this->strlen($sColorMode);
|
486 |
+
for ($i = 0; $i < $iLength; ++$i) {
|
487 |
+
$this->consumeWhiteSpace();
|
488 |
+
$aColor[$sColorMode[$i]] = $this->parseNumericValue(true);
|
489 |
+
$this->consumeWhiteSpace();
|
490 |
+
if ($i < ($iLength - 1)) {
|
491 |
+
$this->consume(',');
|
492 |
+
}
|
493 |
+
}
|
494 |
+
$this->consume(')');
|
495 |
+
}
|
496 |
+
return new Color($aColor, $this->iLineNo);
|
497 |
+
}
|
498 |
+
|
499 |
+
private function parseURLValue() {
|
500 |
+
$bUseUrl = $this->comes('url', true);
|
501 |
+
if ($bUseUrl) {
|
502 |
+
$this->consume('url');
|
503 |
+
$this->consumeWhiteSpace();
|
504 |
+
$this->consume('(');
|
505 |
+
}
|
506 |
+
$this->consumeWhiteSpace();
|
507 |
+
$oResult = new URL($this->parseStringValue(), $this->iLineNo);
|
508 |
+
if ($bUseUrl) {
|
509 |
+
$this->consumeWhiteSpace();
|
510 |
+
$this->consume(')');
|
511 |
+
}
|
512 |
+
return $oResult;
|
513 |
+
}
|
514 |
+
|
515 |
+
/**
|
516 |
+
* Tests an identifier for a given value. Since identifiers are all keywords, they can be vendor-prefixed. We need to check for these versions too.
|
517 |
+
*/
|
518 |
+
private function identifierIs($sIdentifier, $sMatch) {
|
519 |
+
return (strcasecmp($sIdentifier, $sMatch) === 0)
|
520 |
+
?: preg_match("/^(-\\w+-)?$sMatch$/i", $sIdentifier) === 1;
|
521 |
+
}
|
522 |
+
|
523 |
+
private function comes($sString, $bCaseInsensitive = false) {
|
524 |
+
$sPeek = $this->peek(strlen($sString));
|
525 |
+
return ($sPeek == '')
|
526 |
+
? false
|
527 |
+
: $this->streql($sPeek, $sString, $bCaseInsensitive);
|
528 |
+
}
|
529 |
+
|
530 |
+
private function peek($iLength = 1, $iOffset = 0) {
|
531 |
+
$iOffset += $this->iCurrentPosition;
|
532 |
+
if ($iOffset >= $this->iLength) {
|
533 |
+
return '';
|
534 |
+
}
|
535 |
+
return $this->substr($iOffset, $iLength);
|
536 |
+
}
|
537 |
+
|
538 |
+
private function consume($mValue = 1) {
|
539 |
+
if (is_string($mValue)) {
|
540 |
+
$iLineCount = substr_count($mValue, "\n");
|
541 |
+
$iLength = $this->strlen($mValue);
|
542 |
+
if (!$this->streql($this->substr($this->iCurrentPosition, $iLength), $mValue)) {
|
543 |
+
throw new UnexpectedTokenException($mValue, $this->peek(max($iLength, 5)), $this->iLineNo);
|
544 |
+
}
|
545 |
+
$this->iLineNo += $iLineCount;
|
546 |
+
$this->iCurrentPosition += $this->strlen($mValue);
|
547 |
+
return $mValue;
|
548 |
+
} else {
|
549 |
+
if ($this->iCurrentPosition + $mValue > $this->iLength) {
|
550 |
+
throw new UnexpectedTokenException($mValue, $this->peek(5), 'count', $this->iLineNo);
|
551 |
+
}
|
552 |
+
$sResult = $this->substr($this->iCurrentPosition, $mValue);
|
553 |
+
$iLineCount = substr_count($sResult, "\n");
|
554 |
+
$this->iLineNo += $iLineCount;
|
555 |
+
$this->iCurrentPosition += $mValue;
|
556 |
+
return $sResult;
|
557 |
+
}
|
558 |
+
}
|
559 |
+
|
560 |
+
private function consumeExpression($mExpression) {
|
561 |
+
$aMatches = null;
|
562 |
+
if (preg_match($mExpression, $this->inputLeft(), $aMatches, PREG_OFFSET_CAPTURE) === 1) {
|
563 |
+
return $this->consume($aMatches[0][0]);
|
564 |
+
}
|
565 |
+
throw new UnexpectedTokenException($mExpression, $this->peek(5), 'expression', $this->iLineNo);
|
566 |
+
}
|
567 |
+
|
568 |
+
private function consumeWhiteSpace() {
|
569 |
+
$comments = array();
|
570 |
+
do {
|
571 |
+
while (preg_match('/\\s/isSu', $this->peek()) === 1) {
|
572 |
+
$this->consume(1);
|
573 |
+
}
|
574 |
+
if($this->oParserSettings->bLenientParsing) {
|
575 |
+
try {
|
576 |
+
$oComment = $this->consumeComment();
|
577 |
+
} catch(UnexpectedTokenException $e) {
|
578 |
+
// When we can’t find the end of a comment, we assume the document is finished.
|
579 |
+
$this->iCurrentPosition = $this->iLength;
|
580 |
+
return;
|
581 |
+
}
|
582 |
+
} else {
|
583 |
+
$oComment = $this->consumeComment();
|
584 |
+
}
|
585 |
+
if ($oComment !== false) {
|
586 |
+
$comments[] = $oComment;
|
587 |
+
}
|
588 |
+
} while($oComment !== false);
|
589 |
+
return $comments;
|
590 |
+
}
|
591 |
+
|
592 |
+
/**
|
593 |
+
* @return false|Comment
|
594 |
+
*/
|
595 |
+
private function consumeComment() {
|
596 |
+
$mComment = false;
|
597 |
+
if ($this->comes('/*')) {
|
598 |
+
$iLineNo = $this->iLineNo;
|
599 |
+
$this->consume(1);
|
600 |
+
$mComment = '';
|
601 |
+
while (($char = $this->consume(1)) !== '') {
|
602 |
+
$mComment .= $char;
|
603 |
+
if ($this->comes('*/')) {
|
604 |
+
$this->consume(2);
|
605 |
+
break;
|
606 |
+
}
|
607 |
+
}
|
608 |
+
}
|
609 |
+
|
610 |
+
if ($mComment !== false) {
|
611 |
+
// We skip the * which was included in the comment.
|
612 |
+
return new Comment(substr($mComment, 1), $iLineNo);
|
613 |
+
}
|
614 |
+
|
615 |
+
return $mComment;
|
616 |
+
}
|
617 |
+
|
618 |
+
private function isEnd() {
|
619 |
+
return $this->iCurrentPosition >= $this->iLength;
|
620 |
+
}
|
621 |
+
|
622 |
+
private function consumeUntil($aEnd, $bIncludeEnd = false, $consumeEnd = false, array &$comments = array()) {
|
623 |
+
$aEnd = is_array($aEnd) ? $aEnd : array($aEnd);
|
624 |
+
$out = '';
|
625 |
+
$start = $this->iCurrentPosition;
|
626 |
+
|
627 |
+
while (($char = $this->consume(1)) !== '') {
|
628 |
+
if (in_array($char, $aEnd)) {
|
629 |
+
if ($bIncludeEnd) {
|
630 |
+
$out .= $char;
|
631 |
+
} elseif (!$consumeEnd) {
|
632 |
+
$this->iCurrentPosition -= $this->strlen($char);
|
633 |
+
}
|
634 |
+
return $out;
|
635 |
+
}
|
636 |
+
$out .= $char;
|
637 |
+
if ($comment = $this->consumeComment()) {
|
638 |
+
$comments[] = $comment;
|
639 |
+
}
|
640 |
+
}
|
641 |
+
|
642 |
+
$this->iCurrentPosition = $start;
|
643 |
+
throw new UnexpectedTokenException('One of ("'.implode('","', $aEnd).'")', $this->peek(5), 'search', $this->iLineNo);
|
644 |
+
}
|
645 |
+
|
646 |
+
private function inputLeft() {
|
647 |
+
return $this->substr($this->iCurrentPosition, -1);
|
648 |
+
}
|
649 |
+
|
650 |
+
private function substr($iStart, $iLength) {
|
651 |
+
if ($iLength < 0) {
|
652 |
+
$iLength = $this->iLength - $iStart + $iLength;
|
653 |
+
}
|
654 |
+
if ($iStart + $iLength > $this->iLength) {
|
655 |
+
$iLength = $this->iLength - $iStart;
|
656 |
+
}
|
657 |
+
$sResult = '';
|
658 |
+
while ($iLength > 0) {
|
659 |
+
$sResult .= $this->aText[$iStart];
|
660 |
+
$iStart++;
|
661 |
+
$iLength--;
|
662 |
+
}
|
663 |
+
return $sResult;
|
664 |
+
}
|
665 |
+
|
666 |
+
private function strlen($sString) {
|
667 |
+
if ($this->oParserSettings->bMultibyteSupport) {
|
668 |
+
return mb_strlen($sString, $this->sCharset);
|
669 |
+
} else {
|
670 |
+
return strlen($sString);
|
671 |
+
}
|
672 |
+
}
|
673 |
+
|
674 |
+
private function streql($sString1, $sString2, $bCaseInsensitive = true) {
|
675 |
+
if($bCaseInsensitive) {
|
676 |
+
return $this->strtolower($sString1) === $this->strtolower($sString2);
|
677 |
+
} else {
|
678 |
+
return $sString1 === $sString2;
|
679 |
+
}
|
680 |
+
}
|
681 |
+
|
682 |
+
private function strtolower($sString) {
|
683 |
+
if ($this->oParserSettings->bMultibyteSupport) {
|
684 |
+
return mb_strtolower($sString, $this->sCharset);
|
685 |
+
} else {
|
686 |
+
return strtolower($sString);
|
687 |
+
}
|
688 |
+
}
|
689 |
+
|
690 |
+
private function strsplit($sString) {
|
691 |
+
if ($this->oParserSettings->bMultibyteSupport) {
|
692 |
+
if ($this->streql($this->sCharset, 'utf-8')) {
|
693 |
+
return preg_split('//u', $sString, null, PREG_SPLIT_NO_EMPTY);
|
694 |
+
} else {
|
695 |
+
$iLength = mb_strlen($sString, $this->sCharset);
|
696 |
+
$aResult = array();
|
697 |
+
for ($i = 0; $i < $iLength; ++$i) {
|
698 |
+
$aResult[] = mb_substr($sString, $i, 1, $this->sCharset);
|
699 |
+
}
|
700 |
+
return $aResult;
|
701 |
+
}
|
702 |
+
} else {
|
703 |
+
if($sString === '') {
|
704 |
+
return array();
|
705 |
+
} else {
|
706 |
+
return str_split($sString);
|
707 |
+
}
|
708 |
+
}
|
709 |
+
}
|
710 |
+
|
711 |
+
private function strpos($sString, $sNeedle, $iOffset) {
|
712 |
+
if ($this->oParserSettings->bMultibyteSupport) {
|
713 |
+
return mb_strpos($sString, $sNeedle, $iOffset, $this->sCharset);
|
714 |
+
} else {
|
715 |
+
return strpos($sString, $sNeedle, $iOffset);
|
716 |
+
}
|
717 |
+
}
|
718 |
+
|
719 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/OutputException.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Parsing;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Thrown if the CSS parsers attempts to print something invalid
|
7 |
+
*/
|
8 |
+
class OutputException extends SourceException {
|
9 |
+
public function __construct($sMessage, $iLineNo = 0) {
|
10 |
+
parent::__construct($sMessage, $iLineNo);
|
11 |
+
}
|
12 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/SourceException.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Parsing;
|
4 |
+
|
5 |
+
class SourceException extends \Exception {
|
6 |
+
private $iLineNo;
|
7 |
+
public function __construct($sMessage, $iLineNo = 0) {
|
8 |
+
$this->iLineNo = $iLineNo;
|
9 |
+
if (!empty($iLineNo)) {
|
10 |
+
$sMessage .= " [line no: $iLineNo]";
|
11 |
+
}
|
12 |
+
parent::__construct($sMessage);
|
13 |
+
}
|
14 |
+
|
15 |
+
public function getLineNo() {
|
16 |
+
return $this->iLineNo;
|
17 |
+
}
|
18 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/UnexpectedTokenException.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Parsing;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Thrown if the CSS parsers encounters a token it did not expect
|
7 |
+
*/
|
8 |
+
class UnexpectedTokenException extends SourceException {
|
9 |
+
private $sExpected;
|
10 |
+
private $sFound;
|
11 |
+
// Possible values: literal, identifier, count, expression, search
|
12 |
+
private $sMatchType;
|
13 |
+
|
14 |
+
public function __construct($sExpected, $sFound, $sMatchType = 'literal', $iLineNo = 0) {
|
15 |
+
$this->sExpected = $sExpected;
|
16 |
+
$this->sFound = $sFound;
|
17 |
+
$this->sMatchType = $sMatchType;
|
18 |
+
$sMessage = "Token “{$sExpected}” ({$sMatchType}) not found. Got “{$sFound}”.";
|
19 |
+
if($this->sMatchType === 'search') {
|
20 |
+
$sMessage = "Search for “{$sExpected}” returned no results. Context: “{$sFound}”.";
|
21 |
+
} else if($this->sMatchType === 'count') {
|
22 |
+
$sMessage = "Next token was expected to have {$sExpected} chars. Context: “{$sFound}”.";
|
23 |
+
} else if($this->sMatchType === 'identifier') {
|
24 |
+
$sMessage = "Identifier expected. Got “{$sFound}”";
|
25 |
+
} else if($this->sMatchType === 'custom') {
|
26 |
+
$sMessage = trim("$sExpected $sFound");
|
27 |
+
}
|
28 |
+
|
29 |
+
parent::__construct($sMessage, $iLineNo);
|
30 |
+
}
|
31 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/index.php
ADDED
File without changes
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/AtRule.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Property;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Renderable;
|
6 |
+
use Sabberworm\CSS\Comment\Commentable;
|
7 |
+
|
8 |
+
interface AtRule extends Renderable, Commentable {
|
9 |
+
const BLOCK_RULES = 'media/document/supports/region-style/font-feature-values';
|
10 |
+
// Since there are more set rules than block rules, we’re whitelisting the block rules and have anything else be treated as a set rule.
|
11 |
+
const SET_RULES = 'font-face/counter-style/page/swash/styleset/annotation'; //…and more font-specific ones (to be used inside font-feature-values)
|
12 |
+
|
13 |
+
public function atRuleName();
|
14 |
+
public function atRuleArgs();
|
15 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/CSSNamespace.php
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Property;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* CSSNamespace represents an @namespace rule.
|
7 |
+
*/
|
8 |
+
class CSSNamespace implements AtRule {
|
9 |
+
private $mUrl;
|
10 |
+
private $sPrefix;
|
11 |
+
private $iLineNo;
|
12 |
+
protected $aComments;
|
13 |
+
|
14 |
+
public function __construct($mUrl, $sPrefix = null, $iLineNo = 0) {
|
15 |
+
$this->mUrl = $mUrl;
|
16 |
+
$this->sPrefix = $sPrefix;
|
17 |
+
$this->iLineNo = $iLineNo;
|
18 |
+
$this->aComments = array();
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* @return int
|
23 |
+
*/
|
24 |
+
public function getLineNo() {
|
25 |
+
return $this->iLineNo;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function __toString() {
|
29 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
30 |
+
}
|
31 |
+
|
32 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
33 |
+
return '@namespace '.($this->sPrefix === null ? '' : $this->sPrefix.' ').$this->mUrl->render($oOutputFormat).';';
|
34 |
+
}
|
35 |
+
|
36 |
+
public function getUrl() {
|
37 |
+
return $this->mUrl;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function getPrefix() {
|
41 |
+
return $this->sPrefix;
|
42 |
+
}
|
43 |
+
|
44 |
+
public function setUrl($mUrl) {
|
45 |
+
$this->mUrl = $mUrl;
|
46 |
+
}
|
47 |
+
|
48 |
+
public function setPrefix($sPrefix) {
|
49 |
+
$this->sPrefix = $sPrefix;
|
50 |
+
}
|
51 |
+
|
52 |
+
public function atRuleName() {
|
53 |
+
return 'namespace';
|
54 |
+
}
|
55 |
+
|
56 |
+
public function atRuleArgs() {
|
57 |
+
$aResult = array($this->mUrl);
|
58 |
+
if($this->sPrefix) {
|
59 |
+
array_unshift($aResult, $this->sPrefix);
|
60 |
+
}
|
61 |
+
return $aResult;
|
62 |
+
}
|
63 |
+
|
64 |
+
public function addComments(array $aComments) {
|
65 |
+
$this->aComments = array_merge($this->aComments, $aComments);
|
66 |
+
}
|
67 |
+
|
68 |
+
public function getComments() {
|
69 |
+
return $this->aComments;
|
70 |
+
}
|
71 |
+
|
72 |
+
public function setComments(array $aComments) {
|
73 |
+
$this->aComments = $aComments;
|
74 |
+
}
|
75 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Charset.php
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Property;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Class representing an @charset rule.
|
7 |
+
* The following restrictions apply:
|
8 |
+
* • May not be found in any CSSList other than the Document.
|
9 |
+
* • May only appear at the very top of a Document’s contents.
|
10 |
+
* • Must not appear more than once.
|
11 |
+
*/
|
12 |
+
class Charset implements AtRule {
|
13 |
+
|
14 |
+
private $sCharset;
|
15 |
+
protected $iLineNo;
|
16 |
+
protected $aComment;
|
17 |
+
|
18 |
+
public function __construct($sCharset, $iLineNo = 0) {
|
19 |
+
$this->sCharset = $sCharset;
|
20 |
+
$this->iLineNo = $iLineNo;
|
21 |
+
$this->aComments = array();
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* @return int
|
26 |
+
*/
|
27 |
+
public function getLineNo() {
|
28 |
+
return $this->iLineNo;
|
29 |
+
}
|
30 |
+
|
31 |
+
public function setCharset($sCharset) {
|
32 |
+
$this->sCharset = $sCharset;
|
33 |
+
}
|
34 |
+
|
35 |
+
public function getCharset() {
|
36 |
+
return $this->sCharset;
|
37 |
+
}
|
38 |
+
|
39 |
+
public function __toString() {
|
40 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
41 |
+
}
|
42 |
+
|
43 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
44 |
+
return "@charset {$this->sCharset->render($oOutputFormat)};";
|
45 |
+
}
|
46 |
+
|
47 |
+
public function atRuleName() {
|
48 |
+
return 'charset';
|
49 |
+
}
|
50 |
+
|
51 |
+
public function atRuleArgs() {
|
52 |
+
return $this->sCharset;
|
53 |
+
}
|
54 |
+
|
55 |
+
public function addComments(array $aComments) {
|
56 |
+
$this->aComments = array_merge($this->aComments, $aComments);
|
57 |
+
}
|
58 |
+
|
59 |
+
public function getComments() {
|
60 |
+
return $this->aComments;
|
61 |
+
}
|
62 |
+
|
63 |
+
public function setComments(array $aComments) {
|
64 |
+
$this->aComments = $aComments;
|
65 |
+
}
|
66 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Import.php
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Property;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Value\URL;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Class representing an @import rule.
|
9 |
+
*/
|
10 |
+
class Import implements AtRule {
|
11 |
+
private $oLocation;
|
12 |
+
private $sMediaQuery;
|
13 |
+
protected $iLineNo;
|
14 |
+
protected $aComments;
|
15 |
+
|
16 |
+
public function __construct(URL $oLocation, $sMediaQuery, $iLineNo = 0) {
|
17 |
+
$this->oLocation = $oLocation;
|
18 |
+
$this->sMediaQuery = $sMediaQuery;
|
19 |
+
$this->iLineNo = $iLineNo;
|
20 |
+
$this->aComments = array();
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @return int
|
25 |
+
*/
|
26 |
+
public function getLineNo() {
|
27 |
+
return $this->iLineNo;
|
28 |
+
}
|
29 |
+
|
30 |
+
public function setLocation($oLocation) {
|
31 |
+
$this->oLocation = $oLocation;
|
32 |
+
}
|
33 |
+
|
34 |
+
public function getLocation() {
|
35 |
+
return $this->oLocation;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function __toString() {
|
39 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
40 |
+
}
|
41 |
+
|
42 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
43 |
+
return "@import ".$this->oLocation->render($oOutputFormat).($this->sMediaQuery === null ? '' : ' '.$this->sMediaQuery).';';
|
44 |
+
}
|
45 |
+
|
46 |
+
public function atRuleName() {
|
47 |
+
return 'import';
|
48 |
+
}
|
49 |
+
|
50 |
+
public function atRuleArgs() {
|
51 |
+
$aResult = array($this->oLocation);
|
52 |
+
if($this->sMediaQuery) {
|
53 |
+
array_push($aResult, $this->sMediaQuery);
|
54 |
+
}
|
55 |
+
return $aResult;
|
56 |
+
}
|
57 |
+
|
58 |
+
public function addComments(array $aComments) {
|
59 |
+
$this->aComments = array_merge($this->aComments, $aComments);
|
60 |
+
}
|
61 |
+
|
62 |
+
public function getComments() {
|
63 |
+
return $this->aComments;
|
64 |
+
}
|
65 |
+
|
66 |
+
public function setComments(array $aComments) {
|
67 |
+
$this->aComments = $aComments;
|
68 |
+
}
|
69 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Selector.php
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Property;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Class representing a single CSS selector. Selectors have to be split by the comma prior to being passed into this class.
|
7 |
+
*/
|
8 |
+
class Selector {
|
9 |
+
|
10 |
+
//Regexes for specificity calculations
|
11 |
+
const NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX = '/
|
12 |
+
(\.[\w]+) # classes
|
13 |
+
|
|
14 |
+
\[(\w+) # attributes
|
15 |
+
|
|
16 |
+
(\:( # pseudo classes
|
17 |
+
link|visited|active
|
18 |
+
|hover|focus
|
19 |
+
|lang
|
20 |
+
|target
|
21 |
+
|enabled|disabled|checked|indeterminate
|
22 |
+
|root
|
23 |
+
|nth-child|nth-last-child|nth-of-type|nth-last-of-type
|
24 |
+
|first-child|last-child|first-of-type|last-of-type
|
25 |
+
|only-child|only-of-type
|
26 |
+
|empty|contains
|
27 |
+
))
|
28 |
+
/ix';
|
29 |
+
|
30 |
+
const ELEMENTS_AND_PSEUDO_ELEMENTS_RX = '/
|
31 |
+
((^|[\s\+\>\~]+)[\w]+ # elements
|
32 |
+
|
|
33 |
+
\:{1,2}( # pseudo-elements
|
34 |
+
after|before|first-letter|first-line|selection
|
35 |
+
))
|
36 |
+
/ix';
|
37 |
+
|
38 |
+
private $sSelector;
|
39 |
+
private $iSpecificity;
|
40 |
+
|
41 |
+
public function __construct($sSelector, $bCalculateSpecificity = false) {
|
42 |
+
$this->setSelector($sSelector);
|
43 |
+
if ($bCalculateSpecificity) {
|
44 |
+
$this->getSpecificity();
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
public function getSelector() {
|
49 |
+
return $this->sSelector;
|
50 |
+
}
|
51 |
+
|
52 |
+
public function setSelector($sSelector) {
|
53 |
+
$this->sSelector = trim($sSelector);
|
54 |
+
$this->iSpecificity = null;
|
55 |
+
}
|
56 |
+
|
57 |
+
public function __toString() {
|
58 |
+
return $this->getSelector();
|
59 |
+
}
|
60 |
+
|
61 |
+
public function getSpecificity() {
|
62 |
+
if ($this->iSpecificity === null) {
|
63 |
+
$a = 0;
|
64 |
+
/// @todo should exclude \# as well as "#"
|
65 |
+
$aMatches = null;
|
66 |
+
$b = substr_count($this->sSelector, '#');
|
67 |
+
$c = preg_match_all(self::NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX, $this->sSelector, $aMatches);
|
68 |
+
$d = preg_match_all(self::ELEMENTS_AND_PSEUDO_ELEMENTS_RX, $this->sSelector, $aMatches);
|
69 |
+
$this->iSpecificity = ($a * 1000) + ($b * 100) + ($c * 10) + $d;
|
70 |
+
}
|
71 |
+
return $this->iSpecificity;
|
72 |
+
}
|
73 |
+
|
74 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/index.php
ADDED
File without changes
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Renderable.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS;
|
4 |
+
|
5 |
+
interface Renderable {
|
6 |
+
public function __toString();
|
7 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat);
|
8 |
+
public function getLineNo();
|
9 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Rule/Rule.php
ADDED
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Rule;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Renderable;
|
6 |
+
use Sabberworm\CSS\Value\RuleValueList;
|
7 |
+
use Sabberworm\CSS\Value\Value;
|
8 |
+
use Sabberworm\CSS\Comment\Commentable;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* RuleSets contains Rule objects which always have a key and a value.
|
12 |
+
* In CSS, Rules are expressed as follows: “key: value[0][0] value[0][1], value[1][0] value[1][1];”
|
13 |
+
*/
|
14 |
+
class Rule implements Renderable, Commentable {
|
15 |
+
|
16 |
+
private $sRule;
|
17 |
+
private $mValue;
|
18 |
+
private $bIsImportant;
|
19 |
+
private $aIeHack;
|
20 |
+
protected $iLineNo;
|
21 |
+
protected $aComments;
|
22 |
+
|
23 |
+
public function __construct($sRule, $iLineNo = 0) {
|
24 |
+
$this->sRule = $sRule;
|
25 |
+
$this->mValue = null;
|
26 |
+
$this->bIsImportant = false;
|
27 |
+
$this->aIeHack = array();
|
28 |
+
$this->iLineNo = $iLineNo;
|
29 |
+
$this->aComments = array();
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* @return int
|
34 |
+
*/
|
35 |
+
public function getLineNo() {
|
36 |
+
return $this->iLineNo;
|
37 |
+
}
|
38 |
+
|
39 |
+
public function setRule($sRule) {
|
40 |
+
$this->sRule = $sRule;
|
41 |
+
}
|
42 |
+
|
43 |
+
public function getRule() {
|
44 |
+
return $this->sRule;
|
45 |
+
}
|
46 |
+
|
47 |
+
public function getValue() {
|
48 |
+
return $this->mValue;
|
49 |
+
}
|
50 |
+
|
51 |
+
public function setValue($mValue) {
|
52 |
+
$this->mValue = $mValue;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* @deprecated Old-Style 2-dimensional array given. Retained for (some) backwards-compatibility. Use setValue() instead and wrapp the value inside a RuleValueList if necessary.
|
57 |
+
*/
|
58 |
+
public function setValues($aSpaceSeparatedValues) {
|
59 |
+
$oSpaceSeparatedList = null;
|
60 |
+
if (count($aSpaceSeparatedValues) > 1) {
|
61 |
+
$oSpaceSeparatedList = new RuleValueList(' ', $this->iLineNo);
|
62 |
+
}
|
63 |
+
foreach ($aSpaceSeparatedValues as $aCommaSeparatedValues) {
|
64 |
+
$oCommaSeparatedList = null;
|
65 |
+
if (count($aCommaSeparatedValues) > 1) {
|
66 |
+
$oCommaSeparatedList = new RuleValueList(',', $this->iLineNo);
|
67 |
+
}
|
68 |
+
foreach ($aCommaSeparatedValues as $mValue) {
|
69 |
+
if (!$oSpaceSeparatedList && !$oCommaSeparatedList) {
|
70 |
+
$this->mValue = $mValue;
|
71 |
+
return $mValue;
|
72 |
+
}
|
73 |
+
if ($oCommaSeparatedList) {
|
74 |
+
$oCommaSeparatedList->addListComponent($mValue);
|
75 |
+
} else {
|
76 |
+
$oSpaceSeparatedList->addListComponent($mValue);
|
77 |
+
}
|
78 |
+
}
|
79 |
+
if (!$oSpaceSeparatedList) {
|
80 |
+
$this->mValue = $oCommaSeparatedList;
|
81 |
+
return $oCommaSeparatedList;
|
82 |
+
} else {
|
83 |
+
$oSpaceSeparatedList->addListComponent($oCommaSeparatedList);
|
84 |
+
}
|
85 |
+
}
|
86 |
+
$this->mValue = $oSpaceSeparatedList;
|
87 |
+
return $oSpaceSeparatedList;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* @deprecated Old-Style 2-dimensional array returned. Retained for (some) backwards-compatibility. Use getValue() instead and check for the existance of a (nested set of) ValueList object(s).
|
92 |
+
*/
|
93 |
+
public function getValues() {
|
94 |
+
if (!$this->mValue instanceof RuleValueList) {
|
95 |
+
return array(array($this->mValue));
|
96 |
+
}
|
97 |
+
if ($this->mValue->getListSeparator() === ',') {
|
98 |
+
return array($this->mValue->getListComponents());
|
99 |
+
}
|
100 |
+
$aResult = array();
|
101 |
+
foreach ($this->mValue->getListComponents() as $mValue) {
|
102 |
+
if (!$mValue instanceof RuleValueList || $mValue->getListSeparator() !== ',') {
|
103 |
+
$aResult[] = array($mValue);
|
104 |
+
continue;
|
105 |
+
}
|
106 |
+
if ($this->mValue->getListSeparator() === ' ' || count($aResult) === 0) {
|
107 |
+
$aResult[] = array();
|
108 |
+
}
|
109 |
+
foreach ($mValue->getListComponents() as $mValue) {
|
110 |
+
$aResult[count($aResult) - 1][] = $mValue;
|
111 |
+
}
|
112 |
+
}
|
113 |
+
return $aResult;
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Adds a value to the existing value. Value will be appended if a RuleValueList exists of the given type. Otherwise, the existing value will be wrapped by one.
|
118 |
+
*/
|
119 |
+
public function addValue($mValue, $sType = ' ') {
|
120 |
+
if (!is_array($mValue)) {
|
121 |
+
$mValue = array($mValue);
|
122 |
+
}
|
123 |
+
if (!$this->mValue instanceof RuleValueList || $this->mValue->getListSeparator() !== $sType) {
|
124 |
+
$mCurrentValue = $this->mValue;
|
125 |
+
$this->mValue = new RuleValueList($sType, $this->iLineNo);
|
126 |
+
if ($mCurrentValue) {
|
127 |
+
$this->mValue->addListComponent($mCurrentValue);
|
128 |
+
}
|
129 |
+
}
|
130 |
+
foreach ($mValue as $mValueItem) {
|
131 |
+
$this->mValue->addListComponent($mValueItem);
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
public function addIeHack($iModifier) {
|
136 |
+
$this->aIeHack[] = $iModifier;
|
137 |
+
}
|
138 |
+
|
139 |
+
public function setIeHack(array $aModifiers) {
|
140 |
+
$this->aIeHack = $aModifiers;
|
141 |
+
}
|
142 |
+
|
143 |
+
public function getIeHack() {
|
144 |
+
return $this->aIeHack;
|
145 |
+
}
|
146 |
+
|
147 |
+
public function setIsImportant($bIsImportant) {
|
148 |
+
$this->bIsImportant = $bIsImportant;
|
149 |
+
}
|
150 |
+
|
151 |
+
public function getIsImportant() {
|
152 |
+
return $this->bIsImportant;
|
153 |
+
}
|
154 |
+
|
155 |
+
public function __toString() {
|
156 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
157 |
+
}
|
158 |
+
|
159 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
160 |
+
$sResult = "{$this->sRule}:{$oOutputFormat->spaceAfterRuleName()}";
|
161 |
+
if ($this->mValue instanceof Value) { //Can also be a ValueList
|
162 |
+
$sResult .= $this->mValue->render($oOutputFormat);
|
163 |
+
} else {
|
164 |
+
$sResult .= $this->mValue;
|
165 |
+
}
|
166 |
+
if (!empty($this->aIeHack)) {
|
167 |
+
$sResult .= ' \\' . implode('\\', $this->aIeHack);
|
168 |
+
}
|
169 |
+
if ($this->bIsImportant) {
|
170 |
+
$sResult .= ' !important';
|
171 |
+
}
|
172 |
+
$sResult .= ';';
|
173 |
+
return $sResult;
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* @param array $aComments Array of comments.
|
178 |
+
*/
|
179 |
+
public function addComments(array $aComments) {
|
180 |
+
$this->aComments = array_merge($this->aComments, $aComments);
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* @return array
|
185 |
+
*/
|
186 |
+
public function getComments() {
|
187 |
+
return $this->aComments;
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* @param array $aComments Array containing Comment objects.
|
192 |
+
*/
|
193 |
+
public function setComments(array $aComments) {
|
194 |
+
$this->aComments = $aComments;
|
195 |
+
}
|
196 |
+
|
197 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Rule/index.php
ADDED
File without changes
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/AtRuleSet.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\RuleSet;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Property\AtRule;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* A RuleSet constructed by an unknown @-rule. @font-face rules are rendered into AtRuleSet objects.
|
9 |
+
*/
|
10 |
+
class AtRuleSet extends RuleSet implements AtRule {
|
11 |
+
|
12 |
+
private $sType;
|
13 |
+
private $sArgs;
|
14 |
+
|
15 |
+
public function __construct($sType, $sArgs = '', $iLineNo = 0) {
|
16 |
+
parent::__construct($iLineNo);
|
17 |
+
$this->sType = $sType;
|
18 |
+
$this->sArgs = $sArgs;
|
19 |
+
}
|
20 |
+
|
21 |
+
public function atRuleName() {
|
22 |
+
return $this->sType;
|
23 |
+
}
|
24 |
+
|
25 |
+
public function atRuleArgs() {
|
26 |
+
return $this->sArgs;
|
27 |
+
}
|
28 |
+
|
29 |
+
public function __toString() {
|
30 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
31 |
+
}
|
32 |
+
|
33 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
34 |
+
$sArgs = $this->sArgs;
|
35 |
+
if($sArgs) {
|
36 |
+
$sArgs = ' ' . $sArgs;
|
37 |
+
}
|
38 |
+
$sResult = "@{$this->sType}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{";
|
39 |
+
$sResult .= parent::render($oOutputFormat);
|
40 |
+
$sResult .= '}';
|
41 |
+
return $sResult;
|
42 |
+
}
|
43 |
+
|
44 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/DeclarationBlock.php
ADDED
@@ -0,0 +1,608 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\RuleSet;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Property\Selector;
|
6 |
+
use Sabberworm\CSS\Rule\Rule;
|
7 |
+
use Sabberworm\CSS\Value\RuleValueList;
|
8 |
+
use Sabberworm\CSS\Value\Value;
|
9 |
+
use Sabberworm\CSS\Value\Size;
|
10 |
+
use Sabberworm\CSS\Value\Color;
|
11 |
+
use Sabberworm\CSS\Value\URL;
|
12 |
+
use Sabberworm\CSS\Parsing\OutputException;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Declaration blocks are the parts of a css file which denote the rules belonging to a selector.
|
16 |
+
* Declaration blocks usually appear directly inside a Document or another CSSList (mostly a MediaQuery).
|
17 |
+
*/
|
18 |
+
class DeclarationBlock extends RuleSet {
|
19 |
+
|
20 |
+
private $aSelectors;
|
21 |
+
|
22 |
+
public function __construct($iLineNo = 0) {
|
23 |
+
parent::__construct($iLineNo);
|
24 |
+
$this->aSelectors = array();
|
25 |
+
}
|
26 |
+
|
27 |
+
public function setSelectors($mSelector) {
|
28 |
+
if (is_array($mSelector)) {
|
29 |
+
$this->aSelectors = $mSelector;
|
30 |
+
} else {
|
31 |
+
$this->aSelectors = explode(',', $mSelector);
|
32 |
+
}
|
33 |
+
foreach ($this->aSelectors as $iKey => $mSelector) {
|
34 |
+
if (!($mSelector instanceof Selector)) {
|
35 |
+
$this->aSelectors[$iKey] = new Selector($mSelector);
|
36 |
+
}
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
// remove one of the selector of the block
|
41 |
+
public function removeSelector($mSelector) {
|
42 |
+
if($mSelector instanceof Selector) {
|
43 |
+
$mSelector = $mSelector->getSelector();
|
44 |
+
}
|
45 |
+
foreach($this->aSelectors as $iKey => $oSelector) {
|
46 |
+
if($oSelector->getSelector() === $mSelector) {
|
47 |
+
unset($this->aSelectors[$iKey]);
|
48 |
+
return true;
|
49 |
+
}
|
50 |
+
}
|
51 |
+
return false;
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* @deprecated use getSelectors()
|
56 |
+
*/
|
57 |
+
public function getSelector() {
|
58 |
+
return $this->getSelectors();
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* @deprecated use setSelectors()
|
63 |
+
*/
|
64 |
+
public function setSelector($mSelector) {
|
65 |
+
$this->setSelectors($mSelector);
|
66 |
+
}
|
67 |
+
|
68 |
+
public function getSelectors() {
|
69 |
+
return $this->aSelectors;
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Split shorthand declarations (e.g. +margin+ or +font+) into their constituent parts.
|
74 |
+
* */
|
75 |
+
public function expandShorthands() {
|
76 |
+
// border must be expanded before dimensions
|
77 |
+
$this->expandBorderShorthand();
|
78 |
+
$this->expandDimensionsShorthand();
|
79 |
+
$this->expandFontShorthand();
|
80 |
+
$this->expandBackgroundShorthand();
|
81 |
+
$this->expandListStyleShorthand();
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Create shorthand declarations (e.g. +margin+ or +font+) whenever possible.
|
86 |
+
* */
|
87 |
+
public function createShorthands() {
|
88 |
+
$this->createBackgroundShorthand();
|
89 |
+
$this->createDimensionsShorthand();
|
90 |
+
// border must be shortened after dimensions
|
91 |
+
$this->createBorderShorthand();
|
92 |
+
$this->createFontShorthand();
|
93 |
+
$this->createListStyleShorthand();
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Split shorthand border declarations (e.g. <tt>border: 1px red;</tt>)
|
98 |
+
* Additional splitting happens in expandDimensionsShorthand
|
99 |
+
* Multiple borders are not yet supported as of 3
|
100 |
+
* */
|
101 |
+
public function expandBorderShorthand() {
|
102 |
+
$aBorderRules = array(
|
103 |
+
'border', 'border-left', 'border-right', 'border-top', 'border-bottom'
|
104 |
+
);
|
105 |
+
$aBorderSizes = array(
|
106 |
+
'thin', 'medium', 'thick'
|
107 |
+
);
|
108 |
+
$aRules = $this->getRulesAssoc();
|
109 |
+
foreach ($aBorderRules as $sBorderRule) {
|
110 |
+
if (!isset($aRules[$sBorderRule]))
|
111 |
+
continue;
|
112 |
+
$oRule = $aRules[$sBorderRule];
|
113 |
+
$mRuleValue = $oRule->getValue();
|
114 |
+
$aValues = array();
|
115 |
+
if (!$mRuleValue instanceof RuleValueList) {
|
116 |
+
$aValues[] = $mRuleValue;
|
117 |
+
} else {
|
118 |
+
$aValues = $mRuleValue->getListComponents();
|
119 |
+
}
|
120 |
+
foreach ($aValues as $mValue) {
|
121 |
+
if ($mValue instanceof Value) {
|
122 |
+
$mNewValue = clone $mValue;
|
123 |
+
} else {
|
124 |
+
$mNewValue = $mValue;
|
125 |
+
}
|
126 |
+
if ($mValue instanceof Size) {
|
127 |
+
$sNewRuleName = $sBorderRule . "-width";
|
128 |
+
} else if ($mValue instanceof Color) {
|
129 |
+
$sNewRuleName = $sBorderRule . "-color";
|
130 |
+
} else {
|
131 |
+
if (in_array($mValue, $aBorderSizes)) {
|
132 |
+
$sNewRuleName = $sBorderRule . "-width";
|
133 |
+
} else/* if(in_array($mValue, $aBorderStyles)) */ {
|
134 |
+
$sNewRuleName = $sBorderRule . "-style";
|
135 |
+
}
|
136 |
+
}
|
137 |
+
$oNewRule = new Rule($sNewRuleName, $this->iLineNo);
|
138 |
+
$oNewRule->setIsImportant($oRule->getIsImportant());
|
139 |
+
$oNewRule->addValue(array($mNewValue));
|
140 |
+
$this->addRule($oNewRule);
|
141 |
+
}
|
142 |
+
$this->removeRule($sBorderRule);
|
143 |
+
}
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Split shorthand dimensional declarations (e.g. <tt>margin: 0px auto;</tt>)
|
148 |
+
* into their constituent parts.
|
149 |
+
* Handles margin, padding, border-color, border-style and border-width.
|
150 |
+
* */
|
151 |
+
public function expandDimensionsShorthand() {
|
152 |
+
$aExpansions = array(
|
153 |
+
'margin' => 'margin-%s',
|
154 |
+
'padding' => 'padding-%s',
|
155 |
+
'border-color' => 'border-%s-color',
|
156 |
+
'border-style' => 'border-%s-style',
|
157 |
+
'border-width' => 'border-%s-width'
|
158 |
+
);
|
159 |
+
$aRules = $this->getRulesAssoc();
|
160 |
+
foreach ($aExpansions as $sProperty => $sExpanded) {
|
161 |
+
if (!isset($aRules[$sProperty]))
|
162 |
+
continue;
|
163 |
+
$oRule = $aRules[$sProperty];
|
164 |
+
$mRuleValue = $oRule->getValue();
|
165 |
+
$aValues = array();
|
166 |
+
if (!$mRuleValue instanceof RuleValueList) {
|
167 |
+
$aValues[] = $mRuleValue;
|
168 |
+
} else {
|
169 |
+
$aValues = $mRuleValue->getListComponents();
|
170 |
+
}
|
171 |
+
$top = $right = $bottom = $left = null;
|
172 |
+
switch (count($aValues)) {
|
173 |
+
case 1:
|
174 |
+
$top = $right = $bottom = $left = $aValues[0];
|
175 |
+
break;
|
176 |
+
case 2:
|
177 |
+
$top = $bottom = $aValues[0];
|
178 |
+
$left = $right = $aValues[1];
|
179 |
+
break;
|
180 |
+
case 3:
|
181 |
+
$top = $aValues[0];
|
182 |
+
$left = $right = $aValues[1];
|
183 |
+
$bottom = $aValues[2];
|
184 |
+
break;
|
185 |
+
case 4:
|
186 |
+
$top = $aValues[0];
|
187 |
+
$right = $aValues[1];
|
188 |
+
$bottom = $aValues[2];
|
189 |
+
$left = $aValues[3];
|
190 |
+
break;
|
191 |
+
}
|
192 |
+
foreach (array('top', 'right', 'bottom', 'left') as $sPosition) {
|
193 |
+
$oNewRule = new Rule(sprintf($sExpanded, $sPosition), $this->iLineNo);
|
194 |
+
$oNewRule->setIsImportant($oRule->getIsImportant());
|
195 |
+
$oNewRule->addValue(${$sPosition});
|
196 |
+
$this->addRule($oNewRule);
|
197 |
+
}
|
198 |
+
$this->removeRule($sProperty);
|
199 |
+
}
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Convert shorthand font declarations
|
204 |
+
* (e.g. <tt>font: 300 italic 11px/14px verdana, helvetica, sans-serif;</tt>)
|
205 |
+
* into their constituent parts.
|
206 |
+
* */
|
207 |
+
public function expandFontShorthand() {
|
208 |
+
$aRules = $this->getRulesAssoc();
|
209 |
+
if (!isset($aRules['font']))
|
210 |
+
return;
|
211 |
+
$oRule = $aRules['font'];
|
212 |
+
// reset properties to 'normal' per http://www.w3.org/TR/21/fonts.html#font-shorthand
|
213 |
+
$aFontProperties = array(
|
214 |
+
'font-style' => 'normal',
|
215 |
+
'font-variant' => 'normal',
|
216 |
+
'font-weight' => 'normal',
|
217 |
+
'font-size' => 'normal',
|
218 |
+
'line-height' => 'normal'
|
219 |
+
);
|
220 |
+
$mRuleValue = $oRule->getValue();
|
221 |
+
$aValues = array();
|
222 |
+
if (!$mRuleValue instanceof RuleValueList) {
|
223 |
+
$aValues[] = $mRuleValue;
|
224 |
+
} else {
|
225 |
+
$aValues = $mRuleValue->getListComponents();
|
226 |
+
}
|
227 |
+
foreach ($aValues as $mValue) {
|
228 |
+
if (!$mValue instanceof Value) {
|
229 |
+
$mValue = mb_strtolower($mValue);
|
230 |
+
}
|
231 |
+
if (in_array($mValue, array('normal', 'inherit'))) {
|
232 |
+
foreach (array('font-style', 'font-weight', 'font-variant') as $sProperty) {
|
233 |
+
if (!isset($aFontProperties[$sProperty])) {
|
234 |
+
$aFontProperties[$sProperty] = $mValue;
|
235 |
+
}
|
236 |
+
}
|
237 |
+
} else if (in_array($mValue, array('italic', 'oblique'))) {
|
238 |
+
$aFontProperties['font-style'] = $mValue;
|
239 |
+
} else if ($mValue == 'small-caps') {
|
240 |
+
$aFontProperties['font-variant'] = $mValue;
|
241 |
+
} else if (
|
242 |
+
in_array($mValue, array('bold', 'bolder', 'lighter'))
|
243 |
+
|| ($mValue instanceof Size
|
244 |
+
&& in_array($mValue->getSize(), range(100, 900, 100)))
|
245 |
+
) {
|
246 |
+
$aFontProperties['font-weight'] = $mValue;
|
247 |
+
} else if ($mValue instanceof RuleValueList && $mValue->getListSeparator() == '/') {
|
248 |
+
list($oSize, $oHeight) = $mValue->getListComponents();
|
249 |
+
$aFontProperties['font-size'] = $oSize;
|
250 |
+
$aFontProperties['line-height'] = $oHeight;
|
251 |
+
} else if ($mValue instanceof Size && $mValue->getUnit() !== null) {
|
252 |
+
$aFontProperties['font-size'] = $mValue;
|
253 |
+
} else {
|
254 |
+
$aFontProperties['font-family'] = $mValue;
|
255 |
+
}
|
256 |
+
}
|
257 |
+
foreach ($aFontProperties as $sProperty => $mValue) {
|
258 |
+
$oNewRule = new Rule($sProperty, $this->iLineNo);
|
259 |
+
$oNewRule->addValue($mValue);
|
260 |
+
$oNewRule->setIsImportant($oRule->getIsImportant());
|
261 |
+
$this->addRule($oNewRule);
|
262 |
+
}
|
263 |
+
$this->removeRule('font');
|
264 |
+
}
|
265 |
+
|
266 |
+
/*
|
267 |
+
* Convert shorthand background declarations
|
268 |
+
* (e.g. <tt>background: url("chess.png") gray 50% repeat fixed;</tt>)
|
269 |
+
* into their constituent parts.
|
270 |
+
* @see http://www.w3.org/TR/21/colors.html#propdef-background
|
271 |
+
* */
|
272 |
+
|
273 |
+
public function expandBackgroundShorthand() {
|
274 |
+
$aRules = $this->getRulesAssoc();
|
275 |
+
if (!isset($aRules['background']))
|
276 |
+
return;
|
277 |
+
$oRule = $aRules['background'];
|
278 |
+
$aBgProperties = array(
|
279 |
+
'background-color' => array('transparent'), 'background-image' => array('none'),
|
280 |
+
'background-repeat' => array('repeat'), 'background-attachment' => array('scroll'),
|
281 |
+
'background-position' => array(new Size(0, '%', null, false, $this->iLineNo), new Size(0, '%', null, false, $this->iLineNo))
|
282 |
+
);
|
283 |
+
$mRuleValue = $oRule->getValue();
|
284 |
+
$aValues = array();
|
285 |
+
if (!$mRuleValue instanceof RuleValueList) {
|
286 |
+
$aValues[] = $mRuleValue;
|
287 |
+
} else {
|
288 |
+
$aValues = $mRuleValue->getListComponents();
|
289 |
+
}
|
290 |
+
if (count($aValues) == 1 && $aValues[0] == 'inherit') {
|
291 |
+
foreach ($aBgProperties as $sProperty => $mValue) {
|
292 |
+
$oNewRule = new Rule($sProperty, $this->iLineNo);
|
293 |
+
$oNewRule->addValue('inherit');
|
294 |
+
$oNewRule->setIsImportant($oRule->getIsImportant());
|
295 |
+
$this->addRule($oNewRule);
|
296 |
+
}
|
297 |
+
$this->removeRule('background');
|
298 |
+
return;
|
299 |
+
}
|
300 |
+
$iNumBgPos = 0;
|
301 |
+
foreach ($aValues as $mValue) {
|
302 |
+
if (!$mValue instanceof Value) {
|
303 |
+
$mValue = mb_strtolower($mValue);
|
304 |
+
}
|
305 |
+
if ($mValue instanceof URL) {
|
306 |
+
$aBgProperties['background-image'] = $mValue;
|
307 |
+
} else if ($mValue instanceof Color) {
|
308 |
+
$aBgProperties['background-color'] = $mValue;
|
309 |
+
} else if (in_array($mValue, array('scroll', 'fixed'))) {
|
310 |
+
$aBgProperties['background-attachment'] = $mValue;
|
311 |
+
} else if (in_array($mValue, array('repeat', 'no-repeat', 'repeat-x', 'repeat-y'))) {
|
312 |
+
$aBgProperties['background-repeat'] = $mValue;
|
313 |
+
} else if (in_array($mValue, array('left', 'center', 'right', 'top', 'bottom'))
|
314 |
+
|| $mValue instanceof Size
|
315 |
+
) {
|
316 |
+
if ($iNumBgPos == 0) {
|
317 |
+
$aBgProperties['background-position'][0] = $mValue;
|
318 |
+
$aBgProperties['background-position'][1] = 'center';
|
319 |
+
} else {
|
320 |
+
$aBgProperties['background-position'][$iNumBgPos] = $mValue;
|
321 |
+
}
|
322 |
+
$iNumBgPos++;
|
323 |
+
}
|
324 |
+
}
|
325 |
+
foreach ($aBgProperties as $sProperty => $mValue) {
|
326 |
+
$oNewRule = new Rule($sProperty, $this->iLineNo);
|
327 |
+
$oNewRule->setIsImportant($oRule->getIsImportant());
|
328 |
+
$oNewRule->addValue($mValue);
|
329 |
+
$this->addRule($oNewRule);
|
330 |
+
}
|
331 |
+
$this->removeRule('background');
|
332 |
+
}
|
333 |
+
|
334 |
+
public function expandListStyleShorthand() {
|
335 |
+
$aListProperties = array(
|
336 |
+
'list-style-type' => 'disc',
|
337 |
+
'list-style-position' => 'outside',
|
338 |
+
'list-style-image' => 'none'
|
339 |
+
);
|
340 |
+
$aListStyleTypes = array(
|
341 |
+
'none', 'disc', 'circle', 'square', 'decimal-leading-zero', 'decimal',
|
342 |
+
'lower-roman', 'upper-roman', 'lower-greek', 'lower-alpha', 'lower-latin',
|
343 |
+
'upper-alpha', 'upper-latin', 'hebrew', 'armenian', 'georgian', 'cjk-ideographic',
|
344 |
+
'hiragana', 'hira-gana-iroha', 'katakana-iroha', 'katakana'
|
345 |
+
);
|
346 |
+
$aListStylePositions = array(
|
347 |
+
'inside', 'outside'
|
348 |
+
);
|
349 |
+
$aRules = $this->getRulesAssoc();
|
350 |
+
if (!isset($aRules['list-style']))
|
351 |
+
return;
|
352 |
+
$oRule = $aRules['list-style'];
|
353 |
+
$mRuleValue = $oRule->getValue();
|
354 |
+
$aValues = array();
|
355 |
+
if (!$mRuleValue instanceof RuleValueList) {
|
356 |
+
$aValues[] = $mRuleValue;
|
357 |
+
} else {
|
358 |
+
$aValues = $mRuleValue->getListComponents();
|
359 |
+
}
|
360 |
+
if (count($aValues) == 1 && $aValues[0] == 'inherit') {
|
361 |
+
foreach ($aListProperties as $sProperty => $mValue) {
|
362 |
+
$oNewRule = new Rule($sProperty, $this->iLineNo);
|
363 |
+
$oNewRule->addValue('inherit');
|
364 |
+
$oNewRule->setIsImportant($oRule->getIsImportant());
|
365 |
+
$this->addRule($oNewRule);
|
366 |
+
}
|
367 |
+
$this->removeRule('list-style');
|
368 |
+
return;
|
369 |
+
}
|
370 |
+
foreach ($aValues as $mValue) {
|
371 |
+
if (!$mValue instanceof Value) {
|
372 |
+
$mValue = mb_strtolower($mValue);
|
373 |
+
}
|
374 |
+
if ($mValue instanceof Url) {
|
375 |
+
$aListProperties['list-style-image'] = $mValue;
|
376 |
+
} else if (in_array($mValue, $aListStyleTypes)) {
|
377 |
+
$aListProperties['list-style-types'] = $mValue;
|
378 |
+
} else if (in_array($mValue, $aListStylePositions)) {
|
379 |
+
$aListProperties['list-style-position'] = $mValue;
|
380 |
+
}
|
381 |
+
}
|
382 |
+
foreach ($aListProperties as $sProperty => $mValue) {
|
383 |
+
$oNewRule = new Rule($sProperty, $this->iLineNo);
|
384 |
+
$oNewRule->setIsImportant($oRule->getIsImportant());
|
385 |
+
$oNewRule->addValue($mValue);
|
386 |
+
$this->addRule($oNewRule);
|
387 |
+
}
|
388 |
+
$this->removeRule('list-style');
|
389 |
+
}
|
390 |
+
|
391 |
+
public function createShorthandProperties(array $aProperties, $sShorthand) {
|
392 |
+
$aRules = $this->getRulesAssoc();
|
393 |
+
$aNewValues = array();
|
394 |
+
foreach ($aProperties as $sProperty) {
|
395 |
+
if (!isset($aRules[$sProperty]))
|
396 |
+
continue;
|
397 |
+
$oRule = $aRules[$sProperty];
|
398 |
+
if (!$oRule->getIsImportant()) {
|
399 |
+
$mRuleValue = $oRule->getValue();
|
400 |
+
$aValues = array();
|
401 |
+
if (!$mRuleValue instanceof RuleValueList) {
|
402 |
+
$aValues[] = $mRuleValue;
|
403 |
+
} else {
|
404 |
+
$aValues = $mRuleValue->getListComponents();
|
405 |
+
}
|
406 |
+
foreach ($aValues as $mValue) {
|
407 |
+
$aNewValues[] = $mValue;
|
408 |
+
}
|
409 |
+
$this->removeRule($sProperty);
|
410 |
+
}
|
411 |
+
}
|
412 |
+
if (count($aNewValues)) {
|
413 |
+
$oNewRule = new Rule($sShorthand, $this->iLineNo);
|
414 |
+
foreach ($aNewValues as $mValue) {
|
415 |
+
$oNewRule->addValue($mValue);
|
416 |
+
}
|
417 |
+
$this->addRule($oNewRule);
|
418 |
+
}
|
419 |
+
}
|
420 |
+
|
421 |
+
public function createBackgroundShorthand() {
|
422 |
+
$aProperties = array(
|
423 |
+
'background-color', 'background-image', 'background-repeat',
|
424 |
+
'background-position', 'background-attachment'
|
425 |
+
);
|
426 |
+
$this->createShorthandProperties($aProperties, 'background');
|
427 |
+
}
|
428 |
+
|
429 |
+
public function createListStyleShorthand() {
|
430 |
+
$aProperties = array(
|
431 |
+
'list-style-type', 'list-style-position', 'list-style-image'
|
432 |
+
);
|
433 |
+
$this->createShorthandProperties($aProperties, 'list-style');
|
434 |
+
}
|
435 |
+
|
436 |
+
/**
|
437 |
+
* Combine border-color, border-style and border-width into border
|
438 |
+
* Should be run after create_dimensions_shorthand!
|
439 |
+
* */
|
440 |
+
public function createBorderShorthand() {
|
441 |
+
$aProperties = array(
|
442 |
+
'border-width', 'border-style', 'border-color'
|
443 |
+
);
|
444 |
+
$this->createShorthandProperties($aProperties, 'border');
|
445 |
+
}
|
446 |
+
|
447 |
+
/*
|
448 |
+
* Looks for long format CSS dimensional properties
|
449 |
+
* (margin, padding, border-color, border-style and border-width)
|
450 |
+
* and converts them into shorthand CSS properties.
|
451 |
+
* */
|
452 |
+
|
453 |
+
public function createDimensionsShorthand() {
|
454 |
+
$aPositions = array('top', 'right', 'bottom', 'left');
|
455 |
+
$aExpansions = array(
|
456 |
+
'margin' => 'margin-%s',
|
457 |
+
'padding' => 'padding-%s',
|
458 |
+
'border-color' => 'border-%s-color',
|
459 |
+
'border-style' => 'border-%s-style',
|
460 |
+
'border-width' => 'border-%s-width'
|
461 |
+
);
|
462 |
+
$aRules = $this->getRulesAssoc();
|
463 |
+
foreach ($aExpansions as $sProperty => $sExpanded) {
|
464 |
+
$aFoldable = array();
|
465 |
+
foreach ($aRules as $sRuleName => $oRule) {
|
466 |
+
foreach ($aPositions as $sPosition) {
|
467 |
+
if ($sRuleName == sprintf($sExpanded, $sPosition)) {
|
468 |
+
$aFoldable[$sRuleName] = $oRule;
|
469 |
+
}
|
470 |
+
}
|
471 |
+
}
|
472 |
+
// All four dimensions must be present
|
473 |
+
if (count($aFoldable) == 4) {
|
474 |
+
$aValues = array();
|
475 |
+
foreach ($aPositions as $sPosition) {
|
476 |
+
$oRule = $aRules[sprintf($sExpanded, $sPosition)];
|
477 |
+
$mRuleValue = $oRule->getValue();
|
478 |
+
$aRuleValues = array();
|
479 |
+
if (!$mRuleValue instanceof RuleValueList) {
|
480 |
+
$aRuleValues[] = $mRuleValue;
|
481 |
+
} else {
|
482 |
+
$aRuleValues = $mRuleValue->getListComponents();
|
483 |
+
}
|
484 |
+
$aValues[$sPosition] = $aRuleValues;
|
485 |
+
}
|
486 |
+
$oNewRule = new Rule($sProperty, $this->iLineNo);
|
487 |
+
if ((string) $aValues['left'][0] == (string) $aValues['right'][0]) {
|
488 |
+
if ((string) $aValues['top'][0] == (string) $aValues['bottom'][0]) {
|
489 |
+
if ((string) $aValues['top'][0] == (string) $aValues['left'][0]) {
|
490 |
+
// All 4 sides are equal
|
491 |
+
$oNewRule->addValue($aValues['top']);
|
492 |
+
} else {
|
493 |
+
// Top and bottom are equal, left and right are equal
|
494 |
+
$oNewRule->addValue($aValues['top']);
|
495 |
+
$oNewRule->addValue($aValues['left']);
|
496 |
+
}
|
497 |
+
} else {
|
498 |
+
// Only left and right are equal
|
499 |
+
$oNewRule->addValue($aValues['top']);
|
500 |
+
$oNewRule->addValue($aValues['left']);
|
501 |
+
$oNewRule->addValue($aValues['bottom']);
|
502 |
+
}
|
503 |
+
} else {
|
504 |
+
// No sides are equal
|
505 |
+
$oNewRule->addValue($aValues['top']);
|
506 |
+
$oNewRule->addValue($aValues['left']);
|
507 |
+
$oNewRule->addValue($aValues['bottom']);
|
508 |
+
$oNewRule->addValue($aValues['right']);
|
509 |
+
}
|
510 |
+
$this->addRule($oNewRule);
|
511 |
+
foreach ($aPositions as $sPosition) {
|
512 |
+
$this->removeRule(sprintf($sExpanded, $sPosition));
|
513 |
+
}
|
514 |
+
}
|
515 |
+
}
|
516 |
+
}
|
517 |
+
|
518 |
+
/**
|
519 |
+
* Looks for long format CSS font properties (e.g. <tt>font-weight</tt>) and
|
520 |
+
* tries to convert them into a shorthand CSS <tt>font</tt> property.
|
521 |
+
* At least font-size AND font-family must be present in order to create a shorthand declaration.
|
522 |
+
* */
|
523 |
+
public function createFontShorthand() {
|
524 |
+
$aFontProperties = array(
|
525 |
+
'font-style', 'font-variant', 'font-weight', 'font-size', 'line-height', 'font-family'
|
526 |
+
);
|
527 |
+
$aRules = $this->getRulesAssoc();
|
528 |
+
if (!isset($aRules['font-size']) || !isset($aRules['font-family'])) {
|
529 |
+
return;
|
530 |
+
}
|
531 |
+
$oNewRule = new Rule('font', $this->iLineNo);
|
532 |
+
foreach (array('font-style', 'font-variant', 'font-weight') as $sProperty) {
|
533 |
+
if (isset($aRules[$sProperty])) {
|
534 |
+
$oRule = $aRules[$sProperty];
|
535 |
+
$mRuleValue = $oRule->getValue();
|
536 |
+
$aValues = array();
|
537 |
+
if (!$mRuleValue instanceof RuleValueList) {
|
538 |
+
$aValues[] = $mRuleValue;
|
539 |
+
} else {
|
540 |
+
$aValues = $mRuleValue->getListComponents();
|
541 |
+
}
|
542 |
+
if ($aValues[0] !== 'normal') {
|
543 |
+
$oNewRule->addValue($aValues[0]);
|
544 |
+
}
|
545 |
+
}
|
546 |
+
}
|
547 |
+
// Get the font-size value
|
548 |
+
$oRule = $aRules['font-size'];
|
549 |
+
$mRuleValue = $oRule->getValue();
|
550 |
+
$aFSValues = array();
|
551 |
+
if (!$mRuleValue instanceof RuleValueList) {
|
552 |
+
$aFSValues[] = $mRuleValue;
|
553 |
+
} else {
|
554 |
+
$aFSValues = $mRuleValue->getListComponents();
|
555 |
+
}
|
556 |
+
// But wait to know if we have line-height to add it
|
557 |
+
if (isset($aRules['line-height'])) {
|
558 |
+
$oRule = $aRules['line-height'];
|
559 |
+
$mRuleValue = $oRule->getValue();
|
560 |
+
$aLHValues = array();
|
561 |
+
if (!$mRuleValue instanceof RuleValueList) {
|
562 |
+
$aLHValues[] = $mRuleValue;
|
563 |
+
} else {
|
564 |
+
$aLHValues = $mRuleValue->getListComponents();
|
565 |
+
}
|
566 |
+
if ($aLHValues[0] !== 'normal') {
|
567 |
+
$val = new RuleValueList('/', $this->iLineNo);
|
568 |
+
$val->addListComponent($aFSValues[0]);
|
569 |
+
$val->addListComponent($aLHValues[0]);
|
570 |
+
$oNewRule->addValue($val);
|
571 |
+
}
|
572 |
+
} else {
|
573 |
+
$oNewRule->addValue($aFSValues[0]);
|
574 |
+
}
|
575 |
+
$oRule = $aRules['font-family'];
|
576 |
+
$mRuleValue = $oRule->getValue();
|
577 |
+
$aFFValues = array();
|
578 |
+
if (!$mRuleValue instanceof RuleValueList) {
|
579 |
+
$aFFValues[] = $mRuleValue;
|
580 |
+
} else {
|
581 |
+
$aFFValues = $mRuleValue->getListComponents();
|
582 |
+
}
|
583 |
+
$oFFValue = new RuleValueList(',', $this->iLineNo);
|
584 |
+
$oFFValue->setListComponents($aFFValues);
|
585 |
+
$oNewRule->addValue($oFFValue);
|
586 |
+
|
587 |
+
$this->addRule($oNewRule);
|
588 |
+
foreach ($aFontProperties as $sProperty) {
|
589 |
+
$this->removeRule($sProperty);
|
590 |
+
}
|
591 |
+
}
|
592 |
+
|
593 |
+
public function __toString() {
|
594 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
595 |
+
}
|
596 |
+
|
597 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
598 |
+
if(count($this->aSelectors) === 0) {
|
599 |
+
// If all the selectors have been removed, this declaration block becomes invalid
|
600 |
+
throw new OutputException("Attempt to print declaration block with missing selector", $this->iLineNo);
|
601 |
+
}
|
602 |
+
$sResult = $oOutputFormat->implode($oOutputFormat->spaceBeforeSelectorSeparator() . ',' . $oOutputFormat->spaceAfterSelectorSeparator(), $this->aSelectors) . $oOutputFormat->spaceBeforeOpeningBrace() . '{';
|
603 |
+
$sResult .= parent::render($oOutputFormat);
|
604 |
+
$sResult .= '}';
|
605 |
+
return $sResult;
|
606 |
+
}
|
607 |
+
|
608 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/RuleSet.php
ADDED
@@ -0,0 +1,173 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\RuleSet;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Rule\Rule;
|
6 |
+
use Sabberworm\CSS\Renderable;
|
7 |
+
use Sabberworm\CSS\Comment\Commentable;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* RuleSet is a generic superclass denoting rules. The typical example for rule sets are declaration block.
|
11 |
+
* However, unknown At-Rules (like @font-face) are also rule sets.
|
12 |
+
*/
|
13 |
+
abstract class RuleSet implements Renderable, Commentable {
|
14 |
+
|
15 |
+
private $aRules;
|
16 |
+
protected $iLineNo;
|
17 |
+
protected $aComments;
|
18 |
+
|
19 |
+
public function __construct($iLineNo = 0) {
|
20 |
+
$this->aRules = array();
|
21 |
+
$this->iLineNo = $iLineNo;
|
22 |
+
$this->aComments = array();
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @return int
|
27 |
+
*/
|
28 |
+
public function getLineNo() {
|
29 |
+
return $this->iLineNo;
|
30 |
+
}
|
31 |
+
|
32 |
+
public function addRule(Rule $oRule, Rule $oSibling = null) {
|
33 |
+
$sRule = $oRule->getRule();
|
34 |
+
if(!isset($this->aRules[$sRule])) {
|
35 |
+
$this->aRules[$sRule] = array();
|
36 |
+
}
|
37 |
+
|
38 |
+
$iPosition = count($this->aRules[$sRule]);
|
39 |
+
|
40 |
+
if ($oSibling !== null) {
|
41 |
+
$iSiblingPos = array_search($oSibling, $this->aRules[$sRule], true);
|
42 |
+
if ($iSiblingPos !== false) {
|
43 |
+
$iPosition = $iSiblingPos;
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
array_splice($this->aRules[$sRule], $iPosition, 0, array($oRule));
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Returns all rules matching the given rule name
|
52 |
+
* @param (null|string|Rule) $mRule pattern to search for. If null, returns all rules. if the pattern ends with a dash, all rules starting with the pattern are returned as well as one matching the pattern with the dash excluded. passing a Rule behaves like calling getRules($mRule->getRule()).
|
53 |
+
* @example $oRuleSet->getRules('font-') //returns an array of all rules either beginning with font- or matching font.
|
54 |
+
* @example $oRuleSet->getRules('font') //returns array(0 => $oRule, …) or array().
|
55 |
+
*/
|
56 |
+
public function getRules($mRule = null) {
|
57 |
+
if ($mRule instanceof Rule) {
|
58 |
+
$mRule = $mRule->getRule();
|
59 |
+
}
|
60 |
+
$aResult = array();
|
61 |
+
foreach($this->aRules as $sName => $aRules) {
|
62 |
+
// Either no search rule is given or the search rule matches the found rule exactly or the search rule ends in “-” and the found rule starts with the search rule.
|
63 |
+
if(!$mRule || $sName === $mRule || (strrpos($mRule, '-') === strlen($mRule) - strlen('-') && (strpos($sName, $mRule) === 0 || $sName === substr($mRule, 0, -1)))) {
|
64 |
+
$aResult = array_merge($aResult, $aRules);
|
65 |
+
}
|
66 |
+
}
|
67 |
+
return $aResult;
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Override all the rules of this set.
|
72 |
+
* @param array $aRules The rules to override with.
|
73 |
+
*/
|
74 |
+
public function setRules(array $aRules) {
|
75 |
+
$this->aRules = array();
|
76 |
+
foreach ($aRules as $rule) {
|
77 |
+
$this->addRule($rule);
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Returns all rules matching the given pattern and returns them in an associative array with the rule’s name as keys. This method exists mainly for backwards-compatibility and is really only partially useful.
|
83 |
+
* @param (string) $mRule pattern to search for. If null, returns all rules. if the pattern ends with a dash, all rules starting with the pattern are returned as well as one matching the pattern with the dash excluded. passing a Rule behaves like calling getRules($mRule->getRule()).
|
84 |
+
* Note: This method loses some information: Calling this (with an argument of 'background-') on a declaration block like { background-color: green; background-color; rgba(0, 127, 0, 0.7); } will only yield an associative array containing the rgba-valued rule while @link{getRules()} would yield an indexed array containing both.
|
85 |
+
*/
|
86 |
+
public function getRulesAssoc($mRule = null) {
|
87 |
+
$aResult = array();
|
88 |
+
foreach($this->getRules($mRule) as $oRule) {
|
89 |
+
$aResult[$oRule->getRule()] = $oRule;
|
90 |
+
}
|
91 |
+
return $aResult;
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Remove a rule from this RuleSet. This accepts all the possible values that @link{getRules()} accepts. If given a Rule, it will only remove this particular rule (by identity). If given a name, it will remove all rules by that name. Note: this is different from pre-v.2.0 behaviour of PHP-CSS-Parser, where passing a Rule instance would remove all rules with the same name. To get the old behvaiour, use removeRule($oRule->getRule()).
|
96 |
+
* @param (null|string|Rule) $mRule pattern to remove. If $mRule is null, all rules are removed. If the pattern ends in a dash, all rules starting with the pattern are removed as well as one matching the pattern with the dash excluded. Passing a Rule behaves matches by identity.
|
97 |
+
*/
|
98 |
+
public function removeRule($mRule) {
|
99 |
+
if($mRule instanceof Rule) {
|
100 |
+
$sRule = $mRule->getRule();
|
101 |
+
if(!isset($this->aRules[$sRule])) {
|
102 |
+
return;
|
103 |
+
}
|
104 |
+
foreach($this->aRules[$sRule] as $iKey => $oRule) {
|
105 |
+
if($oRule === $mRule) {
|
106 |
+
unset($this->aRules[$sRule][$iKey]);
|
107 |
+
}
|
108 |
+
}
|
109 |
+
} else {
|
110 |
+
foreach($this->aRules as $sName => $aRules) {
|
111 |
+
// Either no search rule is given or the search rule matches the found rule exactly or the search rule ends in “-” and the found rule starts with the search rule or equals it (without the trailing dash).
|
112 |
+
if(!$mRule || $sName === $mRule || (strrpos($mRule, '-') === strlen($mRule) - strlen('-') && (strpos($sName, $mRule) === 0 || $sName === substr($mRule, 0, -1)))) {
|
113 |
+
unset($this->aRules[$sName]);
|
114 |
+
}
|
115 |
+
}
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
public function __toString() {
|
120 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
121 |
+
}
|
122 |
+
|
123 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
124 |
+
$sResult = '';
|
125 |
+
$bIsFirst = true;
|
126 |
+
foreach ($this->aRules as $aRules) {
|
127 |
+
foreach($aRules as $oRule) {
|
128 |
+
$sRendered = $oOutputFormat->safely(function() use ($oRule, $oOutputFormat) {
|
129 |
+
return $oRule->render($oOutputFormat->nextLevel());
|
130 |
+
});
|
131 |
+
if($sRendered === null) {
|
132 |
+
continue;
|
133 |
+
}
|
134 |
+
if($bIsFirst) {
|
135 |
+
$bIsFirst = false;
|
136 |
+
$sResult .= $oOutputFormat->nextLevel()->spaceBeforeRules();
|
137 |
+
} else {
|
138 |
+
$sResult .= $oOutputFormat->nextLevel()->spaceBetweenRules();
|
139 |
+
}
|
140 |
+
$sResult .= $sRendered;
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
if(!$bIsFirst) {
|
145 |
+
// Had some output
|
146 |
+
$sResult .= $oOutputFormat->spaceAfterRules();
|
147 |
+
}
|
148 |
+
|
149 |
+
return $oOutputFormat->removeLastSemicolon($sResult);
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* @param array $aComments Array of comments.
|
154 |
+
*/
|
155 |
+
public function addComments(array $aComments) {
|
156 |
+
$this->aComments = array_merge($this->aComments, $aComments);
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* @return array
|
161 |
+
*/
|
162 |
+
public function getComments() {
|
163 |
+
return $this->aComments;
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* @param array $aComments Array containing Comment objects.
|
168 |
+
*/
|
169 |
+
public function setComments(array $aComments) {
|
170 |
+
$this->aComments = $aComments;
|
171 |
+
}
|
172 |
+
|
173 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/index.php
ADDED
File without changes
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Settings.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Rule\Rule;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Parser settings class.
|
9 |
+
*
|
10 |
+
* Configure parser behaviour here.
|
11 |
+
*/
|
12 |
+
class Settings {
|
13 |
+
/**
|
14 |
+
* Multi-byte string support. If true (mbstring extension must be enabled), will use (slower) mb_strlen, mb_convert_case, mb_substr and mb_strpos functions. Otherwise, the normal (ASCII-Only) functions will be used.
|
15 |
+
*/
|
16 |
+
public $bMultibyteSupport;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* The default charset for the CSS if no `@charset` rule is found. Defaults to utf-8.
|
20 |
+
*/
|
21 |
+
public $sDefaultCharset = 'utf-8';
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Lenient parsing. When used (which is true by default), the parser will not choke on unexpected tokens but simply ignore them.
|
25 |
+
*/
|
26 |
+
public $bLenientParsing = true;
|
27 |
+
|
28 |
+
private function __construct() {
|
29 |
+
$this->bMultibyteSupport = extension_loaded('mbstring');
|
30 |
+
}
|
31 |
+
|
32 |
+
public static function create() {
|
33 |
+
return new Settings();
|
34 |
+
}
|
35 |
+
|
36 |
+
public function withMultibyteSupport($bMultibyteSupport = true) {
|
37 |
+
$this->bMultibyteSupport = $bMultibyteSupport;
|
38 |
+
return $this;
|
39 |
+
}
|
40 |
+
|
41 |
+
public function withDefaultCharset($sDefaultCharset) {
|
42 |
+
$this->sDefaultCharset = $sDefaultCharset;
|
43 |
+
return $this;
|
44 |
+
}
|
45 |
+
|
46 |
+
public function withLenientParsing($bLenientParsing = true) {
|
47 |
+
$this->bLenientParsing = $bLenientParsing;
|
48 |
+
return $this;
|
49 |
+
}
|
50 |
+
|
51 |
+
public function beStrict() {
|
52 |
+
return $this->withLenientParsing(false);
|
53 |
+
}
|
54 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CSSFunction.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Value;
|
4 |
+
|
5 |
+
class CSSFunction extends ValueList {
|
6 |
+
|
7 |
+
private $sName;
|
8 |
+
|
9 |
+
public function __construct($sName, $aArguments, $sSeparator = ',', $iLineNo = 0) {
|
10 |
+
if($aArguments instanceof RuleValueList) {
|
11 |
+
$sSeparator = $aArguments->getListSeparator();
|
12 |
+
$aArguments = $aArguments->getListComponents();
|
13 |
+
}
|
14 |
+
$this->sName = $sName;
|
15 |
+
$this->iLineNo = $iLineNo;
|
16 |
+
parent::__construct($aArguments, $sSeparator, $iLineNo);
|
17 |
+
}
|
18 |
+
|
19 |
+
public function getName() {
|
20 |
+
return $this->sName;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function setName($sName) {
|
24 |
+
$this->sName = $sName;
|
25 |
+
}
|
26 |
+
|
27 |
+
public function getArguments() {
|
28 |
+
return $this->aComponents;
|
29 |
+
}
|
30 |
+
|
31 |
+
public function __toString() {
|
32 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
33 |
+
}
|
34 |
+
|
35 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
36 |
+
$aArguments = parent::render($oOutputFormat);
|
37 |
+
return "{$this->sName}({$aArguments})";
|
38 |
+
}
|
39 |
+
|
40 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/CSSString.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Value;
|
4 |
+
|
5 |
+
class CSSString extends PrimitiveValue {
|
6 |
+
|
7 |
+
private $sString;
|
8 |
+
|
9 |
+
public function __construct($sString, $iLineNo = 0) {
|
10 |
+
$this->sString = $sString;
|
11 |
+
parent::__construct($iLineNo);
|
12 |
+
}
|
13 |
+
|
14 |
+
public function setString($sString) {
|
15 |
+
$this->sString = $sString;
|
16 |
+
}
|
17 |
+
|
18 |
+
public function getString() {
|
19 |
+
return $this->sString;
|
20 |
+
}
|
21 |
+
|
22 |
+
public function __toString() {
|
23 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
24 |
+
}
|
25 |
+
|
26 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
27 |
+
$sString = addslashes($this->sString);
|
28 |
+
$sString = str_replace("\n", '\A', $sString);
|
29 |
+
return $oOutputFormat->getStringQuotingType() . $sString . $oOutputFormat->getStringQuotingType();
|
30 |
+
}
|
31 |
+
|
32 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Color.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Value;
|
4 |
+
|
5 |
+
class Color extends CSSFunction {
|
6 |
+
|
7 |
+
public function __construct($aColor, $iLineNo = 0) {
|
8 |
+
parent::__construct(implode('', array_keys($aColor)), $aColor, ',', $iLineNo);
|
9 |
+
}
|
10 |
+
|
11 |
+
public function getColor() {
|
12 |
+
return $this->aComponents;
|
13 |
+
}
|
14 |
+
|
15 |
+
public function setColor($aColor) {
|
16 |
+
$this->setName(implode('', array_keys($aColor)));
|
17 |
+
$this->aComponents = $aColor;
|
18 |
+
}
|
19 |
+
|
20 |
+
public function getColorDescription() {
|
21 |
+
return $this->getName();
|
22 |
+
}
|
23 |
+
|
24 |
+
public function __toString() {
|
25 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
26 |
+
}
|
27 |
+
|
28 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
29 |
+
// Shorthand RGB color values
|
30 |
+
if($oOutputFormat->getRGBHashNotation() && implode('', array_keys($this->aComponents)) === 'rgb') {
|
31 |
+
$sResult = sprintf(
|
32 |
+
'%02x%02x%02x',
|
33 |
+
$this->aComponents['r']->getSize(),
|
34 |
+
$this->aComponents['g']->getSize(),
|
35 |
+
$this->aComponents['b']->getSize()
|
36 |
+
);
|
37 |
+
return '#'.(($sResult[0] == $sResult[1]) && ($sResult[2] == $sResult[3]) && ($sResult[4] == $sResult[5]) ? "$sResult[0]$sResult[2]$sResult[4]" : $sResult);
|
38 |
+
}
|
39 |
+
return parent::render($oOutputFormat);
|
40 |
+
}
|
41 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/PrimitiveValue.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Value;
|
4 |
+
|
5 |
+
abstract class PrimitiveValue extends Value {
|
6 |
+
public function __construct($iLineNo = 0) {
|
7 |
+
parent::__construct($iLineNo);
|
8 |
+
}
|
9 |
+
|
10 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/RuleValueList.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Value;
|
4 |
+
|
5 |
+
class RuleValueList extends ValueList {
|
6 |
+
public function __construct($sSeparator = ',', $iLineNo = 0) {
|
7 |
+
parent::__construct(array(), $sSeparator, $iLineNo);
|
8 |
+
}
|
9 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Size.php
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Value;
|
4 |
+
|
5 |
+
class Size extends PrimitiveValue {
|
6 |
+
|
7 |
+
const ABSOLUTE_SIZE_UNITS = 'px/cm/mm/mozmm/in/pt/pc/vh/vw/vm/vmin/vmax/rem'; //vh/vw/vm(ax)/vmin/rem are absolute insofar as they don’t scale to the immediate parent (only the viewport)
|
8 |
+
const RELATIVE_SIZE_UNITS = '%/em/ex/ch/fr';
|
9 |
+
const NON_SIZE_UNITS = 'deg/grad/rad/s/ms/turns/Hz/kHz';
|
10 |
+
|
11 |
+
private $fSize;
|
12 |
+
private $sUnit;
|
13 |
+
private $bIsColorComponent;
|
14 |
+
|
15 |
+
public function __construct($fSize, $sUnit = null, $bIsColorComponent = false, $iLineNo = 0) {
|
16 |
+
parent::__construct($iLineNo);
|
17 |
+
$this->fSize = floatval($fSize);
|
18 |
+
$this->sUnit = $sUnit;
|
19 |
+
$this->bIsColorComponent = $bIsColorComponent;
|
20 |
+
}
|
21 |
+
|
22 |
+
public function setUnit($sUnit) {
|
23 |
+
$this->sUnit = $sUnit;
|
24 |
+
}
|
25 |
+
|
26 |
+
public function getUnit() {
|
27 |
+
return $this->sUnit;
|
28 |
+
}
|
29 |
+
|
30 |
+
public function setSize($fSize) {
|
31 |
+
$this->fSize = floatval($fSize);
|
32 |
+
}
|
33 |
+
|
34 |
+
public function getSize() {
|
35 |
+
return $this->fSize;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function isColorComponent() {
|
39 |
+
return $this->bIsColorComponent;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Returns whether the number stored in this Size really represents a size (as in a length of something on screen).
|
44 |
+
* @return false if the unit an angle, a duration, a frequency or the number is a component in a Color object.
|
45 |
+
*/
|
46 |
+
public function isSize() {
|
47 |
+
if (in_array($this->sUnit, explode('/', self::NON_SIZE_UNITS))) {
|
48 |
+
return false;
|
49 |
+
}
|
50 |
+
return !$this->isColorComponent();
|
51 |
+
}
|
52 |
+
|
53 |
+
public function isRelative() {
|
54 |
+
if (in_array($this->sUnit, explode('/', self::RELATIVE_SIZE_UNITS))) {
|
55 |
+
return true;
|
56 |
+
}
|
57 |
+
if ($this->sUnit === null && $this->fSize != 0) {
|
58 |
+
return true;
|
59 |
+
}
|
60 |
+
return false;
|
61 |
+
}
|
62 |
+
|
63 |
+
public function __toString() {
|
64 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
65 |
+
}
|
66 |
+
|
67 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
68 |
+
$l = localeconv();
|
69 |
+
$sPoint = preg_quote($l['decimal_point'], '/');
|
70 |
+
return preg_replace(array("/$sPoint/", "/^(-?)0\./"), array('.', '$1.'), $this->fSize) . ($this->sUnit === null ? '' : $this->sUnit);
|
71 |
+
}
|
72 |
+
|
73 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/URL.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Value;
|
4 |
+
|
5 |
+
|
6 |
+
class URL extends PrimitiveValue {
|
7 |
+
|
8 |
+
private $oURL;
|
9 |
+
|
10 |
+
public function __construct(CSSString $oURL, $iLineNo = 0) {
|
11 |
+
parent::__construct($iLineNo);
|
12 |
+
$this->oURL = $oURL;
|
13 |
+
}
|
14 |
+
|
15 |
+
public function setURL(CSSString $oURL) {
|
16 |
+
$this->oURL = $oURL;
|
17 |
+
}
|
18 |
+
|
19 |
+
public function getURL() {
|
20 |
+
return $this->oURL;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function __toString() {
|
24 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
25 |
+
}
|
26 |
+
|
27 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
28 |
+
return "url({$this->oURL->render($oOutputFormat)})";
|
29 |
+
}
|
30 |
+
|
31 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Value.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Value;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Renderable;
|
6 |
+
|
7 |
+
abstract class Value implements Renderable {
|
8 |
+
protected $iLineNo;
|
9 |
+
|
10 |
+
public function __construct($iLineNo = 0) {
|
11 |
+
$this->iLineNo = $iLineNo;
|
12 |
+
}
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @return int
|
16 |
+
*/
|
17 |
+
public function getLineNo() {
|
18 |
+
return $this->iLineNo;
|
19 |
+
}
|
20 |
+
|
21 |
+
//Methods are commented out because re-declaring them here is a fatal error in PHP < 5.3.9
|
22 |
+
//public abstract function __toString();
|
23 |
+
//public abstract function render(\Sabberworm\CSS\OutputFormat $oOutputFormat);
|
24 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/ValueList.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Value;
|
4 |
+
|
5 |
+
abstract class ValueList extends Value {
|
6 |
+
|
7 |
+
protected $aComponents;
|
8 |
+
protected $sSeparator;
|
9 |
+
|
10 |
+
public function __construct($aComponents = array(), $sSeparator = ',', $iLineNo = 0) {
|
11 |
+
parent::__construct($iLineNo);
|
12 |
+
if (!is_array($aComponents)) {
|
13 |
+
$aComponents = array($aComponents);
|
14 |
+
}
|
15 |
+
$this->aComponents = $aComponents;
|
16 |
+
$this->sSeparator = $sSeparator;
|
17 |
+
}
|
18 |
+
|
19 |
+
public function addListComponent($mComponent) {
|
20 |
+
$this->aComponents[] = $mComponent;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function getListComponents() {
|
24 |
+
return $this->aComponents;
|
25 |
+
}
|
26 |
+
|
27 |
+
public function setListComponents($aComponents) {
|
28 |
+
$this->aComponents = $aComponents;
|
29 |
+
}
|
30 |
+
|
31 |
+
public function getListSeparator() {
|
32 |
+
return $this->sSeparator;
|
33 |
+
}
|
34 |
+
|
35 |
+
public function setListSeparator($sSeparator) {
|
36 |
+
$this->sSeparator = $sSeparator;
|
37 |
+
}
|
38 |
+
|
39 |
+
public function __toString() {
|
40 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
41 |
+
}
|
42 |
+
|
43 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
44 |
+
return $oOutputFormat->implode($oOutputFormat->spaceBeforeListArgumentSeparator($this->sSeparator) . $this->sSeparator . $oOutputFormat->spaceAfterListArgumentSeparator($this->sSeparator), $this->aComponents);
|
45 |
+
}
|
46 |
+
|
47 |
+
}
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/index.php
ADDED
File without changes
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/index.php
ADDED
File without changes
|
vendor/sabberworm/php-css-parser/lib/Sabberworm/index.php
ADDED
File without changes
|
vendor/sabberworm/php-css-parser/lib/index.php
ADDED
File without changes
|
vendor/sabberworm/php-css-parser/phpunit.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<phpunit
|
2 |
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
3 |
+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd"
|
4 |
+
bootstrap="tests/bootstrap.php">
|
5 |
+
<testsuites>
|
6 |
+
<testsuite name="Project Test Suite">
|
7 |
+
<directory>tests</directory>
|
8 |
+
</testsuite>
|
9 |
+
</testsuites>
|
10 |
+
</phpunit>
|
vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/CSSList/AtRuleBlockListTest.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\CSSList;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Parser;
|
6 |
+
|
7 |
+
class AtRuleBlockListTest extends \PHPUnit_Framework_TestCase {
|
8 |
+
|
9 |
+
public function testMediaQueries() {
|
10 |
+
$sCss = '@media(min-width: 768px){.class{color:red}}';
|
11 |
+
$oParser = new Parser($sCss);
|
12 |
+
$oDoc = $oParser->parse();
|
13 |
+
$aContents = $oDoc->getContents();
|
14 |
+
$oMediaQuery = $aContents[0];
|
15 |
+
$this->assertSame('media', $oMediaQuery->atRuleName(), 'Does not interpret the type as a function');
|
16 |
+
$this->assertSame('(min-width: 768px)', $oMediaQuery->atRuleArgs(), 'The media query is the value');
|
17 |
+
|
18 |
+
$sCss = '@media (min-width: 768px) {.class{color:red}}';
|
19 |
+
$oParser = new Parser($sCss);
|
20 |
+
$oDoc = $oParser->parse();
|
21 |
+
$aContents = $oDoc->getContents();
|
22 |
+
$oMediaQuery = $aContents[0];
|
23 |
+
$this->assertSame('media', $oMediaQuery->atRuleName(), 'Does not interpret the type as a function');
|
24 |
+
$this->assertSame('(min-width: 768px)', $oMediaQuery->atRuleArgs(), 'The media query is the value');
|
25 |
+
}
|
26 |
+
|
27 |
+
}
|
vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/CSSList/DocumentTest.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\CSSList;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Parser;
|
6 |
+
|
7 |
+
class DocumentTest extends \PHPUnit_Framework_TestCase {
|
8 |
+
|
9 |
+
public function testOverrideContents() {
|
10 |
+
$sCss = '.thing { left: 10px; }';
|
11 |
+
$oParser = new Parser($sCss);
|
12 |
+
$oDoc = $oParser->parse();
|
13 |
+
$aContents = $oDoc->getContents();
|
14 |
+
$this->assertCount(1, $aContents);
|
15 |
+
|
16 |
+
$sCss2 = '.otherthing { right: 10px; }';
|
17 |
+
$oParser2 = new Parser($sCss);
|
18 |
+
$oDoc2 = $oParser2->parse();
|
19 |
+
$aContents2 = $oDoc2->getContents();
|
20 |
+
|
21 |
+
$oDoc->setContents(array($aContents[0], $aContents2[0]));
|
22 |
+
$aFinalContents = $oDoc->getContents();
|
23 |
+
$this->assertCount(2, $aFinalContents);
|
24 |
+
}
|
25 |
+
|
26 |
+
}
|
vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/CSSList/index.php
ADDED
File without changes
|
vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/OutputFormatTest.php
ADDED
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Parser;
|
6 |
+
use Sabberworm\CSS\OutputFormat;
|
7 |
+
|
8 |
+
global $TEST_CSS;
|
9 |
+
|
10 |
+
$TEST_CSS = <<<EOT
|
11 |
+
|
12 |
+
.main, .test {
|
13 |
+
font: italic normal bold 16px/1.2 "Helvetica", Verdana, sans-serif;
|
14 |
+
background: white;
|
15 |
+
}
|
16 |
+
|
17 |
+
@media screen {
|
18 |
+
.main {
|
19 |
+
background-size: 100% 100%;
|
20 |
+
font-size: 1.3em;
|
21 |
+
background-color: #fff;
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
EOT;
|
26 |
+
|
27 |
+
class OutputFormatTest extends \PHPUnit_Framework_TestCase {
|
28 |
+
private $oParser;
|
29 |
+
private $oDocument;
|
30 |
+
|
31 |
+
function setUp() {
|
32 |
+
global $TEST_CSS;
|
33 |
+
$this->oParser = new Parser($TEST_CSS);
|
34 |
+
$this->oDocument = $this->oParser->parse();
|
35 |
+
}
|
36 |
+
|
37 |
+
public function testPlain() {
|
38 |
+
$this->assertSame('.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
|
39 |
+
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render());
|
40 |
+
}
|
41 |
+
|
42 |
+
public function testCompact() {
|
43 |
+
$this->assertSame('.main,.test{font:italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background:white;}@media screen{.main{background-size:100% 100%;font-size:1.3em;background-color:#fff;}}', $this->oDocument->render(OutputFormat::createCompact()));
|
44 |
+
}
|
45 |
+
|
46 |
+
public function testPretty() {
|
47 |
+
global $TEST_CSS;
|
48 |
+
$this->assertSame($TEST_CSS, $this->oDocument->render(OutputFormat::createPretty()));
|
49 |
+
}
|
50 |
+
|
51 |
+
public function testSpaceAfterListArgumentSeparator() {
|
52 |
+
$this->assertSame('.main, .test {font: italic normal bold 16px/ 1.2 "Helvetica", Verdana, sans-serif;background: white;}
|
53 |
+
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render(OutputFormat::create()->setSpaceAfterListArgumentSeparator(" ")));
|
54 |
+
}
|
55 |
+
|
56 |
+
public function testSpaceAfterListArgumentSeparatorComplex() {
|
57 |
+
$this->assertSame('.main, .test {font: italic normal bold 16px/1.2 "Helvetica", Verdana, sans-serif;background: white;}
|
58 |
+
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render(OutputFormat::create()->setSpaceAfterListArgumentSeparator(array('default' => ' ', ',' => "\t", '/' => '', ' ' => ''))));
|
59 |
+
}
|
60 |
+
|
61 |
+
public function testSpaceAfterSelectorSeparator() {
|
62 |
+
$this->assertSame('.main,
|
63 |
+
.test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
|
64 |
+
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render(OutputFormat::create()->setSpaceAfterSelectorSeparator("\n")));
|
65 |
+
}
|
66 |
+
|
67 |
+
public function testStringQuotingType() {
|
68 |
+
$this->assertSame('.main, .test {font: italic normal bold 16px/1.2 \'Helvetica\',Verdana,sans-serif;background: white;}
|
69 |
+
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render(OutputFormat::create()->setStringQuotingType("'")));
|
70 |
+
}
|
71 |
+
|
72 |
+
public function testRGBHashNotation() {
|
73 |
+
$this->assertSame('.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
|
74 |
+
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: rgb(255,255,255);}}', $this->oDocument->render(OutputFormat::create()->setRGBHashNotation(false)));
|
75 |
+
}
|
76 |
+
|
77 |
+
public function testSemicolonAfterLastRule() {
|
78 |
+
$this->assertSame('.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white}
|
79 |
+
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff}}', $this->oDocument->render(OutputFormat::create()->setSemicolonAfterLastRule(false)));
|
80 |
+
}
|
81 |
+
|
82 |
+
public function testSpaceAfterRuleName() {
|
83 |
+
$this->assertSame('.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
|
84 |
+
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render(OutputFormat::create()->setSpaceAfterRuleName("\t")));
|
85 |
+
}
|
86 |
+
|
87 |
+
public function testSpaceRules() {
|
88 |
+
$this->assertSame('.main, .test {
|
89 |
+
font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;
|
90 |
+
background: white;
|
91 |
+
}
|
92 |
+
@media screen {.main {
|
93 |
+
background-size: 100% 100%;
|
94 |
+
font-size: 1.3em;
|
95 |
+
background-color: #fff;
|
96 |
+
}}', $this->oDocument->render(OutputFormat::create()->set('Space*Rules', "\n")));
|
97 |
+
}
|
98 |
+
|
99 |
+
public function testSpaceBlocks() {
|
100 |
+
$this->assertSame('
|
101 |
+
.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
|
102 |
+
@media screen {
|
103 |
+
.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}
|
104 |
+
}
|
105 |
+
', $this->oDocument->render(OutputFormat::create()->set('Space*Blocks', "\n")));
|
106 |
+
}
|
107 |
+
|
108 |
+
public function testSpaceBoth() {
|
109 |
+
$this->assertSame('
|
110 |
+
.main, .test {
|
111 |
+
font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;
|
112 |
+
background: white;
|
113 |
+
}
|
114 |
+
@media screen {
|
115 |
+
.main {
|
116 |
+
background-size: 100% 100%;
|
117 |
+
font-size: 1.3em;
|
118 |
+
background-color: #fff;
|
119 |
+
}
|
120 |
+
}
|
121 |
+
', $this->oDocument->render(OutputFormat::create()->set('Space*Rules', "\n")->set('Space*Blocks', "\n")));
|
122 |
+
}
|
123 |
+
|
124 |
+
public function testSpaceBetweenBlocks() {
|
125 |
+
$this->assertSame('.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render(OutputFormat::create()->setSpaceBetweenBlocks('')));
|
126 |
+
}
|
127 |
+
|
128 |
+
public function testIndentation() {
|
129 |
+
$this->assertSame('
|
130 |
+
.main, .test {
|
131 |
+
font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;
|
132 |
+
background: white;
|
133 |
+
}
|
134 |
+
@media screen {
|
135 |
+
.main {
|
136 |
+
background-size: 100% 100%;
|
137 |
+
font-size: 1.3em;
|
138 |
+
background-color: #fff;
|
139 |
+
}
|
140 |
+
}
|
141 |
+
', $this->oDocument->render(OutputFormat::create()->set('Space*Rules', "\n")->set('Space*Blocks', "\n")->setIndentation('')));
|
142 |
+
}
|
143 |
+
|
144 |
+
public function testSpaceBeforeBraces() {
|
145 |
+
$this->assertSame('.main, .test{font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
|
146 |
+
@media screen{.main{background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render(OutputFormat::create()->setSpaceBeforeOpeningBrace('')));
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* @expectedException Sabberworm\CSS\Parsing\OutputException
|
151 |
+
*/
|
152 |
+
public function testIgnoreExceptionsOff() {
|
153 |
+
$aBlocks = $this->oDocument->getAllDeclarationBlocks();
|
154 |
+
$oFirstBlock = $aBlocks[0];
|
155 |
+
$oFirstBlock->removeSelector('.main');
|
156 |
+
$this->assertSame('.test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
|
157 |
+
@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render(OutputFormat::create()->setIgnoreExceptions(false)));
|
158 |
+
$oFirstBlock->removeSelector('.test');
|
159 |
+
$this->oDocument->render(OutputFormat::create()->setIgnoreExceptions(false));
|
160 |
+
}
|
161 |
+
|
162 |
+
public function testIgnoreExceptionsOn() {
|
163 |
+
$aBlocks = $this->oDocument->getAllDeclarationBlocks();
|
164 |
+
$oFirstBlock = $aBlocks[0];
|
165 |
+
$oFirstBlock->removeSelector('.main');
|
166 |
+
$oFirstBlock->removeSelector('.test');
|
167 |
+
$this->assertSame('@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}}', $this->oDocument->render(OutputFormat::create()->setIgnoreExceptions(true)));
|
168 |
+
}
|
169 |
+
|
170 |
+
}
|
vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/ParserTest.php
ADDED
@@ -0,0 +1,585 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\CSSList\KeyFrame;
|
6 |
+
use Sabberworm\CSS\Value\Size;
|
7 |
+
use Sabberworm\CSS\Property\Selector;
|
8 |
+
use Sabberworm\CSS\RuleSet\DeclarationBlock;
|
9 |
+
use Sabberworm\CSS\Property\AtRule;
|
10 |
+
use Sabberworm\CSS\Value\URL;
|
11 |
+
use Sabberworm\CSS\Parsing\UnexpectedTokenException;
|
12 |
+
|
13 |
+
class ParserTest extends \PHPUnit_Framework_TestCase {
|
14 |
+
|
15 |
+
function testFiles() {
|
16 |
+
$sDirectory = dirname(__FILE__) . '/../../files';
|
17 |
+
if ($rHandle = opendir($sDirectory)) {
|
18 |
+
/* This is the correct way to loop over the directory. */
|
19 |
+
while (false !== ($sFileName = readdir($rHandle))) {
|
20 |
+
if (strpos($sFileName, '.') === 0) {
|
21 |
+
continue;
|
22 |
+
}
|
23 |
+
if (strrpos($sFileName, '.css') !== strlen($sFileName) - strlen('.css')) {
|
24 |
+
continue;
|
25 |
+
}
|
26 |
+
if (strpos($sFileName, '-') === 0) {
|
27 |
+
//Either a file which SHOULD fail (at least in strict mode) or a future test of a as-of-now missing feature
|
28 |
+
continue;
|
29 |
+
}
|
30 |
+
$oParser = new Parser(file_get_contents($sDirectory . DIRECTORY_SEPARATOR . $sFileName));
|
31 |
+
try {
|
32 |
+
$this->assertNotEquals('', $oParser->parse()->render());
|
33 |
+
} catch (\Exception $e) {
|
34 |
+
$this->fail($e);
|
35 |
+
}
|
36 |
+
}
|
37 |
+
closedir($rHandle);
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* @depends testFiles
|
43 |
+
*/
|
44 |
+
function testColorParsing() {
|
45 |
+
$oDoc = $this->parsedStructureForFile('colortest');
|
46 |
+
foreach ($oDoc->getAllRuleSets() as $oRuleSet) {
|
47 |
+
if (!$oRuleSet instanceof DeclarationBlock) {
|
48 |
+
continue;
|
49 |
+
}
|
50 |
+
$sSelector = $oRuleSet->getSelectors();
|
51 |
+
$sSelector = $sSelector[0]->getSelector();
|
52 |
+
if ($sSelector === '#mine') {
|
53 |
+
$aColorRule = $oRuleSet->getRules('color');
|
54 |
+
$oColor = $aColorRule[0]->getValue();
|
55 |
+
$this->assertSame('red', $oColor);
|
56 |
+
$aColorRule = $oRuleSet->getRules('background-');
|
57 |
+
$oColor = $aColorRule[0]->getValue();
|
58 |
+
$this->assertEquals(array('r' => new Size(35.0, null, true, $oColor->getLineNo()), 'g' => new Size(35.0, null, true, $oColor->getLineNo()), 'b' => new Size(35.0, null, true, $oColor->getLineNo())), $oColor->getColor());
|
59 |
+
$aColorRule = $oRuleSet->getRules('border-color');
|
60 |
+
$oColor = $aColorRule[0]->getValue();
|
61 |
+
$this->assertEquals(array('r' => new Size(10.0, null, true, $oColor->getLineNo()), 'g' => new Size(100.0, null, true, $oColor->getLineNo()), 'b' => new Size(230.0, null, true, $oColor->getLineNo())), $oColor->getColor());
|
62 |
+
$oColor = $aColorRule[1]->getValue();
|
63 |
+
$this->assertEquals(array('r' => new Size(10.0, null, true, $oColor->getLineNo()), 'g' => new Size(100.0, null, true, $oColor->getLineNo()), 'b' => new Size(231.0, null, true, $oColor->getLineNo()), 'a' => new Size("0000.3", null, true, $oColor->getLineNo())), $oColor->getColor());
|
64 |
+
$aColorRule = $oRuleSet->getRules('outline-color');
|
65 |
+
$oColor = $aColorRule[0]->getValue();
|
66 |
+
$this->assertEquals(array('r' => new Size(34.0, null, true, $oColor->getLineNo()), 'g' => new Size(34.0, null, true, $oColor->getLineNo()), 'b' => new Size(34.0, null, true, $oColor->getLineNo())), $oColor->getColor());
|
67 |
+
} else if($sSelector === '#yours') {
|
68 |
+
$aColorRule = $oRuleSet->getRules('background-color');
|
69 |
+
$oColor = $aColorRule[0]->getValue();
|
70 |
+
$this->assertEquals(array('h' => new Size(220.0, null, true, $oColor->getLineNo()), 's' => new Size(10.0, '%', true, $oColor->getLineNo()), 'l' => new Size(220.0, '%', true, $oColor->getLineNo())), $oColor->getColor());
|
71 |
+
$oColor = $aColorRule[1]->getValue();
|
72 |
+
$this->assertEquals(array('h' => new Size(220.0, null, true, $oColor->getLineNo()), 's' => new Size(10.0, '%', true, $oColor->getLineNo()), 'l' => new Size(220.0, '%', true, $oColor->getLineNo()), 'a' => new Size(0000.3, null, true, $oColor->getLineNo())), $oColor->getColor());
|
73 |
+
}
|
74 |
+
}
|
75 |
+
foreach ($oDoc->getAllValues('color') as $sColor) {
|
76 |
+
$this->assertSame('red', $sColor);
|
77 |
+
}
|
78 |
+
$this->assertSame('#mine {color: red;border-color: #0a64e6;border-color: rgba(10,100,231,.3);outline-color: #222;background-color: #232323;}
|
79 |
+
#yours {background-color: hsl(220,10%,220%);background-color: hsla(220,10%,220%,.3);}', $oDoc->render());
|
80 |
+
}
|
81 |
+
|
82 |
+
function testUnicodeParsing() {
|
83 |
+
$oDoc = $this->parsedStructureForFile('unicode');
|
84 |
+
foreach ($oDoc->getAllDeclarationBlocks() as $oRuleSet) {
|
85 |
+
$sSelector = $oRuleSet->getSelectors();
|
86 |
+
$sSelector = $sSelector[0]->getSelector();
|
87 |
+
if (substr($sSelector, 0, strlen('.test-')) !== '.test-') {
|
88 |
+
continue;
|
89 |
+
}
|
90 |
+
$aContentRules = $oRuleSet->getRules('content');
|
91 |
+
$aContents = $aContentRules[0]->getValues();
|
92 |
+
$sString = $aContents[0][0]->__toString();
|
93 |
+
if ($sSelector == '.test-1') {
|
94 |
+
$this->assertSame('" "', $sString);
|
95 |
+
}
|
96 |
+
if ($sSelector == '.test-2') {
|
97 |
+
$this->assertSame('"é"', $sString);
|
98 |
+
}
|
99 |
+
if ($sSelector == '.test-3') {
|
100 |
+
$this->assertSame('" "', $sString);
|
101 |
+
}
|
102 |
+
if ($sSelector == '.test-4') {
|
103 |
+
$this->assertSame('"𝄞"', $sString);
|
104 |
+
}
|
105 |
+
if ($sSelector == '.test-5') {
|
106 |
+
$this->assertSame('"水"', $sString);
|
107 |
+
}
|
108 |
+
if ($sSelector == '.test-6') {
|
109 |
+
$this->assertSame('"¥"', $sString);
|
110 |
+
}
|
111 |
+
if ($sSelector == '.test-7') {
|
112 |
+
$this->assertSame('"\A"', $sString);
|
113 |
+
}
|
114 |
+
if ($sSelector == '.test-8') {
|
115 |
+
$this->assertSame('"\"\""', $sString);
|
116 |
+
}
|
117 |
+
if ($sSelector == '.test-9') {
|
118 |
+
$this->assertSame('"\"\\\'"', $sString);
|
119 |
+
}
|
120 |
+
if ($sSelector == '.test-10') {
|
121 |
+
$this->assertSame('"\\\'\\\\"', $sString);
|
122 |
+
}
|
123 |
+
if ($sSelector == '.test-11') {
|
124 |
+
$this->assertSame('"test"', $sString);
|
125 |
+
}
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
function testSpecificity() {
|
130 |
+
$oDoc = $this->parsedStructureForFile('specificity');
|
131 |
+
$oDeclarationBlock = $oDoc->getAllDeclarationBlocks();
|
132 |
+
$oDeclarationBlock = $oDeclarationBlock[0];
|
133 |
+
$aSelectors = $oDeclarationBlock->getSelectors();
|
134 |
+
foreach ($aSelectors as $oSelector) {
|
135 |
+
switch ($oSelector->getSelector()) {
|
136 |
+
case "#test .help":
|
137 |
+
$this->assertSame(110, $oSelector->getSpecificity());
|
138 |
+
break;
|
139 |
+
case "#file":
|
140 |
+
$this->assertSame(100, $oSelector->getSpecificity());
|
141 |
+
break;
|
142 |
+
case ".help:hover":
|
143 |
+
$this->assertSame(20, $oSelector->getSpecificity());
|
144 |
+
break;
|
145 |
+
case "ol li::before":
|
146 |
+
$this->assertSame(3, $oSelector->getSpecificity());
|
147 |
+
break;
|
148 |
+
case "li.green":
|
149 |
+
$this->assertSame(11, $oSelector->getSpecificity());
|
150 |
+
break;
|
151 |
+
default:
|
152 |
+
$this->fail("specificity: untested selector " . $oSelector->getSelector());
|
153 |
+
}
|
154 |
+
}
|
155 |
+
$this->assertEquals(array(new Selector('#test .help', true)), $oDoc->getSelectorsBySpecificity('> 100'));
|
156 |
+
}
|
157 |
+
|
158 |
+
function testManipulation() {
|
159 |
+
$oDoc = $this->parsedStructureForFile('atrules');
|
160 |
+
$this->assertSame('@charset "utf-8";
|
161 |
+
@font-face {font-family: "CrassRoots";src: url("../media/cr.ttf");}
|
162 |
+
html, body {font-size: -.6em;}
|
163 |
+
@keyframes mymove {from {top: 0px;}
|
164 |
+
to {top: 200px;}}
|
165 |
+
@-moz-keyframes some-move {from {top: 0px;}
|
166 |
+
to {top: 200px;}}
|
167 |
+
@supports ( (perspective: 10px) or (-moz-perspective: 10px) or (-webkit-perspective: 10px) or (-ms-perspective: 10px) or (-o-perspective: 10px) ) {body {font-family: "Helvetica";}}
|
168 |
+
@page :pseudo-class {margin: 2in;}
|
169 |
+
@-moz-document url(http://www.w3.org/),
|
170 |
+
url-prefix(http://www.w3.org/Style/),
|
171 |
+
domain(mozilla.org),
|
172 |
+
regexp("https:.*") {body {color: purple;background: yellow;}}
|
173 |
+
@media screen and (orientation: landscape) {@-ms-viewport {width: 1024px;height: 768px;}}
|
174 |
+
@region-style #intro {p {color: blue;}}', $oDoc->render());
|
175 |
+
foreach ($oDoc->getAllDeclarationBlocks() as $oBlock) {
|
176 |
+
foreach ($oBlock->getSelectors() as $oSelector) {
|
177 |
+
//Loop over all selector parts (the comma-separated strings in a selector) and prepend the id
|
178 |
+
$oSelector->setSelector('#my_id ' . $oSelector->getSelector());
|
179 |
+
}
|
180 |
+
}
|
181 |
+
$this->assertSame('@charset "utf-8";
|
182 |
+
@font-face {font-family: "CrassRoots";src: url("../media/cr.ttf");}
|
183 |
+
#my_id html, #my_id body {font-size: -.6em;}
|
184 |
+
@keyframes mymove {from {top: 0px;}
|
185 |
+
to {top: 200px;}}
|
186 |
+
@-moz-keyframes some-move {from {top: 0px;}
|
187 |
+
to {top: 200px;}}
|
188 |
+
@supports ( (perspective: 10px) or (-moz-perspective: 10px) or (-webkit-perspective: 10px) or (-ms-perspective: 10px) or (-o-perspective: 10px) ) {#my_id body {font-family: "Helvetica";}}
|
189 |
+
@page :pseudo-class {margin: 2in;}
|
190 |
+
@-moz-document url(http://www.w3.org/),
|
191 |
+
url-prefix(http://www.w3.org/Style/),
|
192 |
+
domain(mozilla.org),
|
193 |
+
regexp("https:.*") {#my_id body {color: purple;background: yellow;}}
|
194 |
+
@media screen and (orientation: landscape) {@-ms-viewport {width: 1024px;height: 768px;}}
|
195 |
+
@region-style #intro {#my_id p {color: blue;}}', $oDoc->render());
|
196 |
+
|
197 |
+
$oDoc = $this->parsedStructureForFile('values');
|
198 |
+
$this->assertSame('#header {margin: 10px 2em 1cm 2%;font-family: Verdana,Helvetica,"Gill Sans",sans-serif;font-size: 10px;color: red !important;background-color: green;background-color: rgba(0,128,0,.7);frequency: 30Hz;}
|
199 |
+
body {color: green;font: 75% "Lucida Grande","Trebuchet MS",Verdana,sans-serif;}', $oDoc->render());
|
200 |
+
foreach ($oDoc->getAllRuleSets() as $oRuleSet) {
|
201 |
+
$oRuleSet->removeRule('font-');
|
202 |
+
}
|
203 |
+
$this->assertSame('#header {margin: 10px 2em 1cm 2%;color: red !important;background-color: green;background-color: rgba(0,128,0,.7);frequency: 30Hz;}
|
204 |
+
body {color: green;}', $oDoc->render());
|
205 |
+
foreach ($oDoc->getAllRuleSets() as $oRuleSet) {
|
206 |
+
$oRuleSet->removeRule('background-');
|
207 |
+
}
|
208 |
+
$this->assertSame('#header {margin: 10px 2em 1cm 2%;color: red !important;frequency: 30Hz;}
|
209 |
+
body {color: green;}', $oDoc->render());
|
210 |
+
}
|
211 |
+
|
212 |
+
function testRuleGetters() {
|
213 |
+
$oDoc = $this->parsedStructureForFile('values');
|
214 |
+
$aBlocks = $oDoc->getAllDeclarationBlocks();
|
215 |
+
$oHeaderBlock = $aBlocks[0];
|
216 |
+
$oBodyBlock = $aBlocks[1];
|
217 |
+
$aHeaderRules = $oHeaderBlock->getRules('background-');
|
218 |
+
$this->assertSame(2, count($aHeaderRules));
|
219 |
+
$this->assertSame('background-color', $aHeaderRules[0]->getRule());
|
220 |
+
$this->assertSame('background-color', $aHeaderRules[1]->getRule());
|
221 |
+
$aHeaderRules = $oHeaderBlock->getRulesAssoc('background-');
|
222 |
+
$this->assertSame(1, count($aHeaderRules));
|
223 |
+
$this->assertSame(true, $aHeaderRules['background-color']->getValue() instanceof \Sabberworm\CSS\Value\Color);
|
224 |
+
$this->assertSame('rgba', $aHeaderRules['background-color']->getValue()->getColorDescription());
|
225 |
+
$oHeaderBlock->removeRule($aHeaderRules['background-color']);
|
226 |
+
$aHeaderRules = $oHeaderBlock->getRules('background-');
|
227 |
+
$this->assertSame(1, count($aHeaderRules));
|
228 |
+
$this->assertSame('green', $aHeaderRules[0]->getValue());
|
229 |
+
}
|
230 |
+
|
231 |
+
function testSlashedValues() {
|
232 |
+
$oDoc = $this->parsedStructureForFile('slashed');
|
233 |
+
$this->assertSame('.test {font: 12px/1.5 Verdana,Arial,sans-serif;border-radius: 5px 10px 5px 10px/10px 5px 10px 5px;}', $oDoc->render());
|
234 |
+
foreach ($oDoc->getAllValues(null) as $mValue) {
|
235 |
+
if ($mValue instanceof Size && $mValue->isSize() && !$mValue->isRelative()) {
|
236 |
+
$mValue->setSize($mValue->getSize() * 3);
|
237 |
+
}
|
238 |
+
}
|
239 |
+
foreach ($oDoc->getAllDeclarationBlocks() as $oBlock) {
|
240 |
+
$oRule = $oBlock->getRules('font');
|
241 |
+
$oRule = $oRule[0];
|
242 |
+
$oSpaceList = $oRule->getValue();
|
243 |
+
$this->assertEquals(' ', $oSpaceList->getListSeparator());
|
244 |
+
$oSlashList = $oSpaceList->getListComponents();
|
245 |
+
$oCommaList = $oSlashList[1];
|
246 |
+
$oSlashList = $oSlashList[0];
|
247 |
+
$this->assertEquals(',', $oCommaList->getListSeparator());
|
248 |
+
$this->assertEquals('/', $oSlashList->getListSeparator());
|
249 |
+
$oRule = $oBlock->getRules('border-radius');
|
250 |
+
$oRule = $oRule[0];
|
251 |
+
$oSlashList = $oRule->getValue();
|
252 |
+
$this->assertEquals('/', $oSlashList->getListSeparator());
|
253 |
+
$oSpaceList1 = $oSlashList->getListComponents();
|
254 |
+
$oSpaceList2 = $oSpaceList1[1];
|
255 |
+
$oSpaceList1 = $oSpaceList1[0];
|
256 |
+
$this->assertEquals(' ', $oSpaceList1->getListSeparator());
|
257 |
+
$this->assertEquals(' ', $oSpaceList2->getListSeparator());
|
258 |
+
}
|
259 |
+
$this->assertSame('.test {font: 36px/1.5 Verdana,Arial,sans-serif;border-radius: 15px 30px 15px 30px/30px 15px 30px 15px;}', $oDoc->render());
|
260 |
+
}
|
261 |
+
|
262 |
+
function testFunctionSyntax() {
|
263 |
+
$oDoc = $this->parsedStructureForFile('functions');
|
264 |
+
$sExpected = 'div.main {background-image: linear-gradient(#000,#fff);}
|
265 |
+
.collapser::before, .collapser::-moz-before, .collapser::-webkit-before {content: "»";font-size: 1.2em;margin-right: .2em;-moz-transition-property: -moz-transform;-moz-transition-duration: .2s;-moz-transform-origin: center 60%;}
|
266 |
+
.collapser.expanded::before, .collapser.expanded::-moz-before, .collapser.expanded::-webkit-before {-moz-transform: rotate(90deg);}
|
267 |
+
.collapser + * {height: 0;overflow: hidden;-moz-transition-property: height;-moz-transition-duration: .3s;}
|
268 |
+
.collapser.expanded + * {height: auto;}';
|
269 |
+
$this->assertSame($sExpected, $oDoc->render());
|
270 |
+
|
271 |
+
foreach ($oDoc->getAllValues(null, true) as $mValue) {
|
272 |
+
if ($mValue instanceof Size && $mValue->isSize()) {
|
273 |
+
$mValue->setSize($mValue->getSize() * 3);
|
274 |
+
}
|
275 |
+
}
|
276 |
+
$sExpected = str_replace(array('1.2em', '.2em', '60%'), array('3.6em', '.6em', '180%'), $sExpected);
|
277 |
+
$this->assertSame($sExpected, $oDoc->render());
|
278 |
+
|
279 |
+
foreach ($oDoc->getAllValues(null, true) as $mValue) {
|
280 |
+
if ($mValue instanceof Size && !$mValue->isRelative() && !$mValue->isColorComponent()) {
|
281 |
+
$mValue->setSize($mValue->getSize() * 2);
|
282 |
+
}
|
283 |
+
}
|
284 |
+
$sExpected = str_replace(array('.2s', '.3s', '90deg'), array('.4s', '.6s', '180deg'), $sExpected);
|
285 |
+
$this->assertSame($sExpected, $oDoc->render());
|
286 |
+
}
|
287 |
+
|
288 |
+
function testExpandShorthands() {
|
289 |
+
$oDoc = $this->parsedStructureForFile('expand-shorthands');
|
290 |
+
$sExpected = 'body {font: italic 500 14px/1.618 "Trebuchet MS",Georgia,serif;border: 2px solid #f0f;background: #ccc url("/images/foo.png") no-repeat left top;margin: 1em !important;padding: 2px 6px 3px;}';
|
291 |
+
$this->assertSame($sExpected, $oDoc->render());
|
292 |
+
$oDoc->expandShorthands();
|
293 |
+
$sExpected = 'body {margin-top: 1em !important;margin-right: 1em !important;margin-bottom: 1em !important;margin-left: 1em !important;padding-top: 2px;padding-right: 6px;padding-bottom: 3px;padding-left: 6px;border-top-color: #f0f;border-right-color: #f0f;border-bottom-color: #f0f;border-left-color: #f0f;border-top-style: solid;border-right-style: solid;border-bottom-style: solid;border-left-style: solid;border-top-width: 2px;border-right-width: 2px;border-bottom-width: 2px;border-left-width: 2px;font-style: italic;font-variant: normal;font-weight: 500;font-size: 14px;line-height: 1.618;font-family: "Trebuchet MS",Georgia,serif;background-color: #ccc;background-image: url("/images/foo.png");background-repeat: no-repeat;background-attachment: scroll;background-position: left top;}';
|
294 |
+
$this->assertSame($sExpected, $oDoc->render());
|
295 |
+
}
|
296 |
+
|
297 |
+
function testCreateShorthands() {
|
298 |
+
$oDoc = $this->parsedStructureForFile('create-shorthands');
|
299 |
+
$sExpected = 'body {font-size: 2em;font-family: Helvetica,Arial,sans-serif;font-weight: bold;border-width: 2px;border-color: #999;border-style: dotted;background-color: #fff;background-image: url("foobar.png");background-repeat: repeat-y;margin-top: 2px;margin-right: 3px;margin-bottom: 4px;margin-left: 5px;}';
|
300 |
+
$this->assertSame($sExpected, $oDoc->render());
|
301 |
+
$oDoc->createShorthands();
|
302 |
+
$sExpected = 'body {background: #fff url("foobar.png") repeat-y;margin: 2px 5px 4px 3px;border: 2px dotted #999;font: bold 2em Helvetica,Arial,sans-serif;}';
|
303 |
+
$this->assertSame($sExpected, $oDoc->render());
|
304 |
+
}
|
305 |
+
|
306 |
+
function testNamespaces() {
|
307 |
+
$oDoc = $this->parsedStructureForFile('namespaces');
|
308 |
+
$sExpected = '@namespace toto "http://toto.example.org";
|
309 |
+
@namespace "http://example.com/foo";
|
310 |
+
@namespace foo url("http://www.example.com/");
|
311 |
+
@namespace foo url("http://www.example.com/");
|
312 |
+
foo|test {gaga: 1;}
|
313 |
+
|test {gaga: 2;}';
|
314 |
+
$this->assertSame($sExpected, $oDoc->render());
|
315 |
+
}
|
316 |
+
|
317 |
+
function testInnerColors() {
|
318 |
+
$oDoc = $this->parsedStructureForFile('inner-color');
|
319 |
+
$sExpected = 'test {background: -webkit-gradient(linear,0 0,0 bottom,from(#006cad),to(hsl(202,100%,49%)));}';
|
320 |
+
$this->assertSame($sExpected, $oDoc->render());
|
321 |
+
}
|
322 |
+
|
323 |
+
function testPrefixedGradient() {
|
324 |
+
$oDoc = $this->parsedStructureForFile('webkit');
|
325 |
+
$sExpected = '.test {background: -webkit-linear-gradient(top right,white,black);}';
|
326 |
+
$this->assertSame($sExpected, $oDoc->render());
|
327 |
+
}
|
328 |
+
|
329 |
+
function testListValueRemoval() {
|
330 |
+
$oDoc = $this->parsedStructureForFile('atrules');
|
331 |
+
foreach ($oDoc->getContents() as $oItem) {
|
332 |
+
if ($oItem instanceof AtRule) {
|
333 |
+
$oDoc->remove($oItem);
|
334 |
+
continue;
|
335 |
+
}
|
336 |
+
}
|
337 |
+
$this->assertSame('html, body {font-size: -.6em;}', $oDoc->render());
|
338 |
+
|
339 |
+
$oDoc = $this->parsedStructureForFile('nested');
|
340 |
+
foreach ($oDoc->getAllDeclarationBlocks() as $oBlock) {
|
341 |
+
$oDoc->removeDeclarationBlockBySelector($oBlock, false);
|
342 |
+
break;
|
343 |
+
}
|
344 |
+
$this->assertSame('html {some-other: -test(val1);}
|
345 |
+
@media screen {html {some: -test(val2);}}
|
346 |
+
#unrelated {other: yes;}', $oDoc->render());
|
347 |
+
|
348 |
+
$oDoc = $this->parsedStructureForFile('nested');
|
349 |
+
foreach ($oDoc->getAllDeclarationBlocks() as $oBlock) {
|
350 |
+
$oDoc->removeDeclarationBlockBySelector($oBlock, true);
|
351 |
+
break;
|
352 |
+
}
|
353 |
+
$this->assertSame('@media screen {html {some: -test(val2);}}
|
354 |
+
#unrelated {other: yes;}', $oDoc->render());
|
355 |
+
}
|
356 |
+
|
357 |
+
/**
|
358 |
+
* @expectedException Sabberworm\CSS\Parsing\OutputException
|
359 |
+
*/
|
360 |
+
function testSelectorRemoval() {
|
361 |
+
$oDoc = $this->parsedStructureForFile('1readme');
|
362 |
+
$aBlocks = $oDoc->getAllDeclarationBlocks();
|
363 |
+
$oBlock1 = $aBlocks[0];
|
364 |
+
$this->assertSame(true, $oBlock1->removeSelector('html'));
|
365 |
+
$sExpected = '@charset "utf-8";
|
366 |
+
@font-face {font-family: "CrassRoots";src: url("../media/cr.ttf");}
|
367 |
+
body {font-size: 1.6em;}';
|
368 |
+
$this->assertSame($sExpected, $oDoc->render());
|
369 |
+
$this->assertSame(false, $oBlock1->removeSelector('html'));
|
370 |
+
$this->assertSame(true, $oBlock1->removeSelector('body'));
|
371 |
+
// This tries to output a declaration block without a selector and throws.
|
372 |
+
$oDoc->render();
|
373 |
+
}
|
374 |
+
|
375 |
+
function testComments() {
|
376 |
+
$oDoc = $this->parsedStructureForFile('comments');
|
377 |
+
$sExpected = '@import url("some/url.css") screen;
|
378 |
+
.foo, #bar {background-color: #000;}
|
379 |
+
@media screen {#foo.bar {position: absolute;}}';
|
380 |
+
$this->assertSame($sExpected, $oDoc->render());
|
381 |
+
}
|
382 |
+
|
383 |
+
function testUrlInFile() {
|
384 |
+
$oDoc = $this->parsedStructureForFile('url', Settings::create()->withMultibyteSupport(true));
|
385 |
+
$sExpected = 'body {background: #fff url("http://somesite.com/images/someimage.gif") repeat top center;}
|
386 |
+
body {background-url: url("http://somesite.com/images/someimage.gif");}';
|
387 |
+
$this->assertSame($sExpected, $oDoc->render());
|
388 |
+
}
|
389 |
+
|
390 |
+
function testUrlInFileMbOff() {
|
391 |
+
$oDoc = $this->parsedStructureForFile('url', Settings::create()->withMultibyteSupport(false));
|
392 |
+
$sExpected = 'body {background: #fff url("http://somesite.com/images/someimage.gif") repeat top center;}
|
393 |
+
body {background-url: url("http://somesite.com/images/someimage.gif");}';
|
394 |
+
$this->assertSame($sExpected, $oDoc->render());
|
395 |
+
}
|
396 |
+
|
397 |
+
function testEmptyFile() {
|
398 |
+
$oDoc = $this->parsedStructureForFile('-empty', Settings::create()->withMultibyteSupport(true));
|
399 |
+
$sExpected = '';
|
400 |
+
$this->assertSame($sExpected, $oDoc->render());
|
401 |
+
}
|
402 |
+
|
403 |
+
function testEmptyFileMbOff() {
|
404 |
+
$oDoc = $this->parsedStructureForFile('-empty', Settings::create()->withMultibyteSupport(false));
|
405 |
+
$sExpected = '';
|
406 |
+
$this->assertSame($sExpected, $oDoc->render());
|
407 |
+
}
|
408 |
+
|
409 |
+
function testCharsetLenient1() {
|
410 |
+
$oDoc = $this->parsedStructureForFile('-charset-after-rule', Settings::create()->withLenientParsing(true));
|
411 |
+
$sExpected = '#id {prop: var(--val);}';
|
412 |
+
$this->assertSame($sExpected, $oDoc->render());
|
413 |
+
}
|
414 |
+
|
415 |
+
function testCharsetLenient2() {
|
416 |
+
$oDoc = $this->parsedStructureForFile('-charset-in-block', Settings::create()->withLenientParsing(true));
|
417 |
+
$sExpected = '@media print {}';
|
418 |
+
$this->assertSame($sExpected, $oDoc->render());
|
419 |
+
}
|
420 |
+
|
421 |
+
/**
|
422 |
+
* @expectedException Sabberworm\CSS\Parsing\UnexpectedTokenException
|
423 |
+
*/
|
424 |
+
function testCharsetFailure1() {
|
425 |
+
$this->parsedStructureForFile('-charset-after-rule', Settings::create()->withLenientParsing(false));
|
426 |
+
}
|
427 |
+
|
428 |
+
/**
|
429 |
+
* @expectedException Sabberworm\CSS\Parsing\UnexpectedTokenException
|
430 |
+
*/
|
431 |
+
function testCharsetFailure2() {
|
432 |
+
$this->parsedStructureForFile('-charset-in-block', Settings::create()->withLenientParsing(false));
|
433 |
+
}
|
434 |
+
|
435 |
+
function parsedStructureForFile($sFileName, $oSettings = null) {
|
436 |
+
$sFile = dirname(__FILE__) . '/../../files' . DIRECTORY_SEPARATOR . "$sFileName.css";
|
437 |
+
$oParser = new Parser(file_get_contents($sFile), $oSettings);
|
438 |
+
return $oParser->parse();
|
439 |
+
}
|
440 |
+
|
441 |
+
/**
|
442 |
+
* @depends testFiles
|
443 |
+
*/
|
444 |
+
function testLineNumbersParsing() {
|
445 |
+
$oDoc = $this->parsedStructureForFile('line-numbers');
|
446 |
+
// array key is the expected line number
|
447 |
+
$aExpected = array(
|
448 |
+
1 => array('Sabberworm\CSS\Property\Charset'),
|
449 |
+
3 => array('Sabberworm\CSS\Property\CSSNamespace'),
|
450 |
+
5 => array('Sabberworm\CSS\RuleSet\AtRuleSet'),
|
451 |
+
11 => array('Sabberworm\CSS\RuleSet\DeclarationBlock'),
|
452 |
+
// Line Numbers of the inner declaration blocks
|
453 |
+
17 => array('Sabberworm\CSS\CSSList\KeyFrame', 18, 20),
|
454 |
+
23 => array('Sabberworm\CSS\Property\Import'),
|
455 |
+
25 => array('Sabberworm\CSS\RuleSet\DeclarationBlock')
|
456 |
+
);
|
457 |
+
|
458 |
+
$aActual = array();
|
459 |
+
foreach ($oDoc->getContents() as $oContent) {
|
460 |
+
$aActual[$oContent->getLineNo()] = array(get_class($oContent));
|
461 |
+
if ($oContent instanceof KeyFrame) {
|
462 |
+
foreach ($oContent->getContents() as $block) {
|
463 |
+
$aActual[$oContent->getLineNo()][] = $block->getLineNo();
|
464 |
+
}
|
465 |
+
}
|
466 |
+
}
|
467 |
+
|
468 |
+
$aUrlExpected = array(7, 26); // expected line numbers
|
469 |
+
$aUrlActual = array();
|
470 |
+
foreach ($oDoc->getAllValues() as $oValue) {
|
471 |
+
if ($oValue instanceof URL) {
|
472 |
+
$aUrlActual[] = $oValue->getLineNo();
|
473 |
+
}
|
474 |
+
}
|
475 |
+
|
476 |
+
// Checking for the multiline color rule lines 27-31
|
477 |
+
$aExpectedColorLines = array(28, 29, 30);
|
478 |
+
$aDeclBlocks = $oDoc->getAllDeclarationBlocks();
|
479 |
+
// Choose the 2nd one
|
480 |
+
$oDeclBlock = $aDeclBlocks[1];
|
481 |
+
$aRules = $oDeclBlock->getRules();
|
482 |
+
// Choose the 2nd one
|
483 |
+
$oColor = $aRules[1]->getValue();
|
484 |
+
$this->assertEquals(27, $aRules[1]->getLineNo());
|
485 |
+
|
486 |
+
foreach ($oColor->getColor() as $oSize) {
|
487 |
+
$aActualColorLines[] = $oSize->getLineNo();
|
488 |
+
}
|
489 |
+
|
490 |
+
$this->assertEquals($aExpectedColorLines, $aActualColorLines);
|
491 |
+
$this->assertEquals($aUrlExpected, $aUrlActual);
|
492 |
+
$this->assertEquals($aExpected, $aActual);
|
493 |
+
}
|
494 |
+
|
495 |
+
/**
|
496 |
+
* @expectedException \Sabberworm\CSS\Parsing\UnexpectedTokenException
|
497 |
+
* Credit: This test by @sabberworm (from https://github.com/sabberworm/PHP-CSS-Parser/pull/105#issuecomment-229643910 )
|
498 |
+
*/
|
499 |
+
function testUnexpectedTokenExceptionLineNo() {
|
500 |
+
$oParser = new Parser("\ntest: 1;", Settings::create()->beStrict());
|
501 |
+
try {
|
502 |
+
$oParser->parse();
|
503 |
+
} catch (UnexpectedTokenException $e) {
|
504 |
+
$this->assertSame(2, $e->getLineNo());
|
505 |
+
throw $e;
|
506 |
+
}
|
507 |
+
}
|
508 |
+
|
509 |
+
/**
|
510 |
+
* @expectedException Sabberworm\CSS\Parsing\UnexpectedTokenException
|
511 |
+
*/
|
512 |
+
function testIeHacksStrictParsing() {
|
513 |
+
// We can't strictly parse IE hacks.
|
514 |
+
$this->parsedStructureForFile('ie-hacks', Settings::create()->beStrict());
|
515 |
+
}
|
516 |
+
|
517 |
+
function testIeHacksParsing() {
|
518 |
+
$oDoc = $this->parsedStructureForFile('ie-hacks', Settings::create()->withLenientParsing(true));
|
519 |
+
$sExpected = 'p {padding-right: .75rem \9;background-image: none \9;color: red \9\0;background-color: red \9\0;background-color: red \9\0 !important;content: "red \0";content: "red઼";}';
|
520 |
+
$this->assertEquals($sExpected, $oDoc->render());
|
521 |
+
}
|
522 |
+
|
523 |
+
/**
|
524 |
+
* @depends testFiles
|
525 |
+
*/
|
526 |
+
function testCommentExtracting() {
|
527 |
+
$oDoc = $this->parsedStructureForFile('comments');
|
528 |
+
$aNodes = $oDoc->getContents();
|
529 |
+
|
530 |
+
// Import property.
|
531 |
+
$importComments = $aNodes[0]->getComments();
|
532 |
+
$this->assertCount(1, $importComments);
|
533 |
+
$this->assertEquals("*\n * Comments Hell.\n ", $importComments[0]->getComment());
|
534 |
+
|
535 |
+
// Declaration block.
|
536 |
+
$fooBarBlock = $aNodes[1];
|
537 |
+
$fooBarBlockComments = $fooBarBlock->getComments();
|
538 |
+
// TODO Support comments in selectors.
|
539 |
+
// $this->assertCount(2, $fooBarBlockComments);
|
540 |
+
// $this->assertEquals("* Number 4 *", $fooBarBlockComments[0]->getComment());
|
541 |
+
// $this->assertEquals("* Number 5 *", $fooBarBlockComments[1]->getComment());
|
542 |
+
|
543 |
+
// Declaration rules.
|
544 |
+
$fooBarRules = $fooBarBlock->getRules();
|
545 |
+
$fooBarRule = $fooBarRules[0];
|
546 |
+
$fooBarRuleComments = $fooBarRule->getComments();
|
547 |
+
$this->assertCount(1, $fooBarRuleComments);
|
548 |
+
$this->assertEquals(" Number 6 ", $fooBarRuleComments[0]->getComment());
|
549 |
+
|
550 |
+
// Media property.
|
551 |
+
$mediaComments = $aNodes[2]->getComments();
|
552 |
+
$this->assertCount(0, $mediaComments);
|
553 |
+
|
554 |
+
// Media children.
|
555 |
+
$mediaRules = $aNodes[2]->getContents();
|
556 |
+
$fooBarComments = $mediaRules[0]->getComments();
|
557 |
+
$this->assertCount(1, $fooBarComments);
|
558 |
+
$this->assertEquals("* Number 10 *", $fooBarComments[0]->getComment());
|
559 |
+
|
560 |
+
// Media -> declaration -> rule.
|
561 |
+
$fooBarRules = $mediaRules[0]->getRules();
|
562 |
+
$fooBarChildComments = $fooBarRules[0]->getComments();
|
563 |
+
$this->assertCount(1, $fooBarChildComments);
|
564 |
+
$this->assertEquals("* Number 10b *", $fooBarChildComments[0]->getComment());
|
565 |
+
}
|
566 |
+
|
567 |
+
function testFlatCommentExtracting() {
|
568 |
+
$parser = new Parser('div {/*Find Me!*/left:10px; text-align:left;}');
|
569 |
+
$doc = $parser->parse();
|
570 |
+
$contents = $doc->getContents();
|
571 |
+
$divRules = $contents[0]->getRules();
|
572 |
+
$comments = $divRules[0]->getComments();
|
573 |
+
$this->assertCount(1, $comments);
|
574 |
+
$this->assertEquals("Find Me!", $comments[0]->getComment());
|
575 |
+
}
|
576 |
+
|
577 |
+
function testTopLevelCommentExtracting() {
|
578 |
+
$parser = new Parser('/*Find Me!*/div {left:10px; text-align:left;}');
|
579 |
+
$doc = $parser->parse();
|
580 |
+
$contents = $doc->getContents();
|
581 |
+
$comments = $contents[0]->getComments();
|
582 |
+
$this->assertCount(1, $comments);
|
583 |
+
$this->assertEquals("Find Me!", $comments[0]->getComment());
|
584 |
+
}
|
585 |
+
}
|
vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/RuleSet/DeclarationBlockTest.php
ADDED
@@ -0,0 +1,267 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\RuleSet;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Parser;
|
6 |
+
use Sabberworm\CSS\Rule\Rule;
|
7 |
+
use Sabberworm\CSS\Value\Size;
|
8 |
+
|
9 |
+
class DeclarationBlockTest extends \PHPUnit_Framework_TestCase {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* @dataProvider expandBorderShorthandProvider
|
13 |
+
* */
|
14 |
+
public function testExpandBorderShorthand($sCss, $sExpected) {
|
15 |
+
$oParser = new Parser($sCss);
|
16 |
+
$oDoc = $oParser->parse();
|
17 |
+
foreach ($oDoc->getAllDeclarationBlocks() as $oDeclaration) {
|
18 |
+
$oDeclaration->expandBorderShorthand();
|
19 |
+
}
|
20 |
+
$this->assertSame(trim((string) $oDoc), $sExpected);
|
21 |
+
}
|
22 |
+
|
23 |
+
public function expandBorderShorthandProvider() {
|
24 |
+
return array(
|
25 |
+
array('body{ border: 2px solid #000 }', 'body {border-width: 2px;border-style: solid;border-color: #000;}'),
|
26 |
+
array('body{ border: none }', 'body {border-style: none;}'),
|
27 |
+
array('body{ border: 2px }', 'body {border-width: 2px;}'),
|
28 |
+
array('body{ border: #f00 }', 'body {border-color: #f00;}'),
|
29 |
+
array('body{ border: 1em solid }', 'body {border-width: 1em;border-style: solid;}'),
|
30 |
+
array('body{ margin: 1em; }', 'body {margin: 1em;}')
|
31 |
+
);
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* @dataProvider expandFontShorthandProvider
|
36 |
+
* */
|
37 |
+
public function testExpandFontShorthand($sCss, $sExpected) {
|
38 |
+
$oParser = new Parser($sCss);
|
39 |
+
$oDoc = $oParser->parse();
|
40 |
+
foreach ($oDoc->getAllDeclarationBlocks() as $oDeclaration) {
|
41 |
+
$oDeclaration->expandFontShorthand();
|
42 |
+
}
|
43 |
+
$this->assertSame(trim((string) $oDoc), $sExpected);
|
44 |
+
}
|
45 |
+
|
46 |
+
public function expandFontShorthandProvider() {
|
47 |
+
return array(
|
48 |
+
array(
|
49 |
+
'body{ margin: 1em; }',
|
50 |
+
'body {margin: 1em;}'
|
51 |
+
),
|
52 |
+
array(
|
53 |
+
'body {font: 12px serif;}',
|
54 |
+
'body {font-style: normal;font-variant: normal;font-weight: normal;font-size: 12px;line-height: normal;font-family: serif;}'
|
55 |
+
),
|
56 |
+
array(
|
57 |
+
'body {font: italic 12px serif;}',
|
58 |
+
'body {font-style: italic;font-variant: normal;font-weight: normal;font-size: 12px;line-height: normal;font-family: serif;}'
|
59 |
+
),
|
60 |
+
array(
|
61 |
+
'body {font: italic bold 12px serif;}',
|
62 |
+
'body {font-style: italic;font-variant: normal;font-weight: bold;font-size: 12px;line-height: normal;font-family: serif;}'
|
63 |
+
),
|
64 |
+
array(
|
65 |
+
'body {font: italic bold 12px/1.6 serif;}',
|
66 |
+
'body {font-style: italic;font-variant: normal;font-weight: bold;font-size: 12px;line-height: 1.6;font-family: serif;}'
|
67 |
+
),
|
68 |
+
array(
|
69 |
+
'body {font: italic small-caps bold 12px/1.6 serif;}',
|
70 |
+
'body {font-style: italic;font-variant: small-caps;font-weight: bold;font-size: 12px;line-height: 1.6;font-family: serif;}'
|
71 |
+
),
|
72 |
+
);
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* @dataProvider expandBackgroundShorthandProvider
|
77 |
+
* */
|
78 |
+
public function testExpandBackgroundShorthand($sCss, $sExpected) {
|
79 |
+
$oParser = new Parser($sCss);
|
80 |
+
$oDoc = $oParser->parse();
|
81 |
+
foreach ($oDoc->getAllDeclarationBlocks() as $oDeclaration) {
|
82 |
+
$oDeclaration->expandBackgroundShorthand();
|
83 |
+
}
|
84 |
+
$this->assertSame(trim((string) $oDoc), $sExpected);
|
85 |
+
}
|
86 |
+
|
87 |
+
public function expandBackgroundShorthandProvider() {
|
88 |
+
return array(
|
89 |
+
array('body {border: 1px;}', 'body {border: 1px;}'),
|
90 |
+
array('body {background: #f00;}', 'body {background-color: #f00;background-image: none;background-repeat: repeat;background-attachment: scroll;background-position: 0% 0%;}'),
|
91 |
+
array('body {background: #f00 url("foobar.png");}', 'body {background-color: #f00;background-image: url("foobar.png");background-repeat: repeat;background-attachment: scroll;background-position: 0% 0%;}'),
|
92 |
+
array('body {background: #f00 url("foobar.png") no-repeat;}', 'body {background-color: #f00;background-image: url("foobar.png");background-repeat: no-repeat;background-attachment: scroll;background-position: 0% 0%;}'),
|
93 |
+
array('body {background: #f00 url("foobar.png") no-repeat center;}', 'body {background-color: #f00;background-image: url("foobar.png");background-repeat: no-repeat;background-attachment: scroll;background-position: center center;}'),
|
94 |
+
array('body {background: #f00 url("foobar.png") no-repeat top left;}', 'body {background-color: #f00;background-image: url("foobar.png");background-repeat: no-repeat;background-attachment: scroll;background-position: top left;}'),
|
95 |
+
);
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* @dataProvider expandDimensionsShorthandProvider
|
100 |
+
* */
|
101 |
+
public function testExpandDimensionsShorthand($sCss, $sExpected) {
|
102 |
+
$oParser = new Parser($sCss);
|
103 |
+
$oDoc = $oParser->parse();
|
104 |
+
foreach ($oDoc->getAllDeclarationBlocks() as $oDeclaration) {
|
105 |
+
$oDeclaration->expandDimensionsShorthand();
|
106 |
+
}
|
107 |
+
$this->assertSame(trim((string) $oDoc), $sExpected);
|
108 |
+
}
|
109 |
+
|
110 |
+
public function expandDimensionsShorthandProvider() {
|
111 |
+
return array(
|
112 |
+
array('body {border: 1px;}', 'body {border: 1px;}'),
|
113 |
+
array('body {margin-top: 1px;}', 'body {margin-top: 1px;}'),
|
114 |
+
array('body {margin: 1em;}', 'body {margin-top: 1em;margin-right: 1em;margin-bottom: 1em;margin-left: 1em;}'),
|
115 |
+
array('body {margin: 1em 2em;}', 'body {margin-top: 1em;margin-right: 2em;margin-bottom: 1em;margin-left: 2em;}'),
|
116 |
+
array('body {margin: 1em 2em 3em;}', 'body {margin-top: 1em;margin-right: 2em;margin-bottom: 3em;margin-left: 2em;}'),
|
117 |
+
);
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* @dataProvider createBorderShorthandProvider
|
122 |
+
* */
|
123 |
+
public function testCreateBorderShorthand($sCss, $sExpected) {
|
124 |
+
$oParser = new Parser($sCss);
|
125 |
+
$oDoc = $oParser->parse();
|
126 |
+
foreach ($oDoc->getAllDeclarationBlocks() as $oDeclaration) {
|
127 |
+
$oDeclaration->createBorderShorthand();
|
128 |
+
}
|
129 |
+
$this->assertSame(trim((string) $oDoc), $sExpected);
|
130 |
+
}
|
131 |
+
|
132 |
+
public function createBorderShorthandProvider() {
|
133 |
+
return array(
|
134 |
+
array('body {border-width: 2px;border-style: solid;border-color: #000;}', 'body {border: 2px solid #000;}'),
|
135 |
+
array('body {border-style: none;}', 'body {border: none;}'),
|
136 |
+
array('body {border-width: 1em;border-style: solid;}', 'body {border: 1em solid;}'),
|
137 |
+
array('body {margin: 1em;}', 'body {margin: 1em;}')
|
138 |
+
);
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* @dataProvider createFontShorthandProvider
|
143 |
+
* */
|
144 |
+
public function testCreateFontShorthand($sCss, $sExpected) {
|
145 |
+
$oParser = new Parser($sCss);
|
146 |
+
$oDoc = $oParser->parse();
|
147 |
+
foreach ($oDoc->getAllDeclarationBlocks() as $oDeclaration) {
|
148 |
+
$oDeclaration->createFontShorthand();
|
149 |
+
}
|
150 |
+
$this->assertSame(trim((string) $oDoc), $sExpected);
|
151 |
+
}
|
152 |
+
|
153 |
+
public function createFontShorthandProvider() {
|
154 |
+
return array(
|
155 |
+
array('body {font-size: 12px; font-family: serif}', 'body {font: 12px serif;}'),
|
156 |
+
array('body {font-size: 12px; font-family: serif; font-style: italic;}', 'body {font: italic 12px serif;}'),
|
157 |
+
array('body {font-size: 12px; font-family: serif; font-style: italic; font-weight: bold;}', 'body {font: italic bold 12px serif;}'),
|
158 |
+
array('body {font-size: 12px; font-family: serif; font-style: italic; font-weight: bold; line-height: 1.6;}', 'body {font: italic bold 12px/1.6 serif;}'),
|
159 |
+
array('body {font-size: 12px; font-family: serif; font-style: italic; font-weight: bold; line-height: 1.6; font-variant: small-caps;}', 'body {font: italic small-caps bold 12px/1.6 serif;}'),
|
160 |
+
array('body {margin: 1em;}', 'body {margin: 1em;}')
|
161 |
+
);
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* @dataProvider createDimensionsShorthandProvider
|
166 |
+
* */
|
167 |
+
public function testCreateDimensionsShorthand($sCss, $sExpected) {
|
168 |
+
$oParser = new Parser($sCss);
|
169 |
+
$oDoc = $oParser->parse();
|
170 |
+
foreach ($oDoc->getAllDeclarationBlocks() as $oDeclaration) {
|
171 |
+
$oDeclaration->createDimensionsShorthand();
|
172 |
+
}
|
173 |
+
$this->assertSame(trim((string) $oDoc), $sExpected);
|
174 |
+
}
|
175 |
+
|
176 |
+
public function createDimensionsShorthandProvider() {
|
177 |
+
return array(
|
178 |
+
array('body {border: 1px;}', 'body {border: 1px;}'),
|
179 |
+
array('body {margin-top: 1px;}', 'body {margin-top: 1px;}'),
|
180 |
+
array('body {margin-top: 1em; margin-right: 1em; margin-bottom: 1em; margin-left: 1em;}', 'body {margin: 1em;}'),
|
181 |
+
array('body {margin-top: 1em; margin-right: 2em; margin-bottom: 1em; margin-left: 2em;}', 'body {margin: 1em 2em;}'),
|
182 |
+
array('body {margin-top: 1em; margin-right: 2em; margin-bottom: 3em; margin-left: 2em;}', 'body {margin: 1em 2em 3em;}'),
|
183 |
+
);
|
184 |
+
}
|
185 |
+
|
186 |
+
/**
|
187 |
+
* @dataProvider createBackgroundShorthandProvider
|
188 |
+
* */
|
189 |
+
public function testCreateBackgroundShorthand($sCss, $sExpected) {
|
190 |
+
$oParser = new Parser($sCss);
|
191 |
+
$oDoc = $oParser->parse();
|
192 |
+
foreach ($oDoc->getAllDeclarationBlocks() as $oDeclaration) {
|
193 |
+
$oDeclaration->createBackgroundShorthand();
|
194 |
+
}
|
195 |
+
$this->assertSame(trim((string) $oDoc), $sExpected);
|
196 |
+
}
|
197 |
+
|
198 |
+
public function createBackgroundShorthandProvider() {
|
199 |
+
return array(
|
200 |
+
array('body {border: 1px;}', 'body {border: 1px;}'),
|
201 |
+
array('body {background-color: #f00;}', 'body {background: #f00;}'),
|
202 |
+
array('body {background-color: #f00;background-image: url(foobar.png);}', 'body {background: #f00 url("foobar.png");}'),
|
203 |
+
array('body {background-color: #f00;background-image: url(foobar.png);background-repeat: no-repeat;}', 'body {background: #f00 url("foobar.png") no-repeat;}'),
|
204 |
+
array('body {background-color: #f00;background-image: url(foobar.png);background-repeat: no-repeat;}', 'body {background: #f00 url("foobar.png") no-repeat;}'),
|
205 |
+
array('body {background-color: #f00;background-image: url(foobar.png);background-repeat: no-repeat;background-position: center;}', 'body {background: #f00 url("foobar.png") no-repeat center;}'),
|
206 |
+
array('body {background-color: #f00;background-image: url(foobar.png);background-repeat: no-repeat;background-position: top left;}', 'body {background: #f00 url("foobar.png") no-repeat top left;}'),
|
207 |
+
);
|
208 |
+
}
|
209 |
+
|
210 |
+
public function testOverrideRules() {
|
211 |
+
$sCss = '.wrapper { left: 10px; text-align: left; }';
|
212 |
+
$oParser = new Parser($sCss);
|
213 |
+
$oDoc = $oParser->parse();
|
214 |
+
$oRule = new Rule('right');
|
215 |
+
$oRule->setValue('-10px');
|
216 |
+
$aContents = $oDoc->getContents();
|
217 |
+
$oWrapper = $aContents[0];
|
218 |
+
|
219 |
+
$this->assertCount(2, $oWrapper->getRules());
|
220 |
+
$aContents[0]->setRules(array($oRule));
|
221 |
+
|
222 |
+
$aRules = $oWrapper->getRules();
|
223 |
+
$this->assertCount(1, $aRules);
|
224 |
+
$this->assertEquals('right', $aRules[0]->getRule());
|
225 |
+
$this->assertEquals('-10px', $aRules[0]->getValue());
|
226 |
+
}
|
227 |
+
|
228 |
+
public function testRuleInsertion() {
|
229 |
+
$sCss = '.wrapper { left: 10px; text-align: left; }';
|
230 |
+
$oParser = new Parser($sCss);
|
231 |
+
$oDoc = $oParser->parse();
|
232 |
+
$aContents = $oDoc->getContents();
|
233 |
+
$oWrapper = $aContents[0];
|
234 |
+
|
235 |
+
$oFirst = $oWrapper->getRules('left');
|
236 |
+
$this->assertCount(1, $oFirst);
|
237 |
+
$oFirst = $oFirst[0];
|
238 |
+
|
239 |
+
$oSecond = $oWrapper->getRules('text-');
|
240 |
+
$this->assertCount(1, $oSecond);
|
241 |
+
$oSecond = $oSecond[0];
|
242 |
+
|
243 |
+
$oBefore = new Rule('left');
|
244 |
+
$oBefore->setValue(new Size(16, 'em'));
|
245 |
+
|
246 |
+
$oMiddle = new Rule('text-align');
|
247 |
+
$oMiddle->setValue(new Size(1));
|
248 |
+
|
249 |
+
$oAfter = new Rule('border-bottom-width');
|
250 |
+
$oAfter->setValue(new Size(1, 'px'));
|
251 |
+
|
252 |
+
$oWrapper->addRule($oAfter);
|
253 |
+
$oWrapper->addRule($oBefore, $oFirst);
|
254 |
+
$oWrapper->addRule($oMiddle, $oSecond);
|
255 |
+
|
256 |
+
$aRules = $oWrapper->getRules();
|
257 |
+
|
258 |
+
$this->assertSame($oBefore, $aRules[0]);
|
259 |
+
$this->assertSame($oFirst, $aRules[1]);
|
260 |
+
$this->assertSame($oMiddle, $aRules[2]);
|
261 |
+
$this->assertSame($oSecond, $aRules[3]);
|
262 |
+
$this->assertSame($oAfter, $aRules[4]);
|
263 |
+
|
264 |
+
$this->assertSame('.wrapper {left: 16em;left: 10px;text-align: 1;text-align: left;border-bottom-width: 1px;}', $oDoc->render());
|
265 |
+
}
|
266 |
+
|
267 |
+
}
|
vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/RuleSet/LenientParsingTest.php
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\RuleSet;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Parser;
|
6 |
+
use Sabberworm\CSS\Settings;
|
7 |
+
|
8 |
+
class LenientParsingTest extends \PHPUnit_Framework_TestCase {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* @expectedException Sabberworm\CSS\Parsing\UnexpectedTokenException
|
12 |
+
*/
|
13 |
+
public function testFaultToleranceOff() {
|
14 |
+
$sFile = dirname(__FILE__) . '/../../../files' . DIRECTORY_SEPARATOR . "-fault-tolerance.css";
|
15 |
+
$oParser = new Parser(file_get_contents($sFile), Settings::create()->beStrict());
|
16 |
+
$oParser->parse();
|
17 |
+
}
|
18 |
+
|
19 |
+
public function testFaultToleranceOn() {
|
20 |
+
$sFile = dirname(__FILE__) . '/../../../files' . DIRECTORY_SEPARATOR . "-fault-tolerance.css";
|
21 |
+
$oParser = new Parser(file_get_contents($sFile), Settings::create()->withLenientParsing(true));
|
22 |
+
$oResult = $oParser->parse();
|
23 |
+
$this->assertSame('.test1 {}'."\n".'.test2 {hello: 2.2;hello: 2000000000000.2;}'."\n".'#test {}'."\n".'#test2 {help: none;}', $oResult->render());
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @expectedException Sabberworm\CSS\Parsing\UnexpectedTokenException
|
28 |
+
*/
|
29 |
+
public function testEndToken() {
|
30 |
+
$sFile = dirname(__FILE__) . '/../../../files' . DIRECTORY_SEPARATOR . "-end-token.css";
|
31 |
+
$oParser = new Parser(file_get_contents($sFile), Settings::create()->beStrict());
|
32 |
+
$oParser->parse();
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* @expectedException Sabberworm\CSS\Parsing\UnexpectedTokenException
|
37 |
+
*/
|
38 |
+
public function testEndToken2() {
|
39 |
+
$sFile = dirname(__FILE__) . '/../../../files' . DIRECTORY_SEPARATOR . "-end-token-2.css";
|
40 |
+
$oParser = new Parser(file_get_contents($sFile), Settings::create()->beStrict());
|
41 |
+
$oParser->parse();
|
42 |
+
}
|
43 |
+
|
44 |
+
public function testEndTokenPositive() {
|
45 |
+
$sFile = dirname(__FILE__) . '/../../../files' . DIRECTORY_SEPARATOR . "-end-token.css";
|
46 |
+
$oParser = new Parser(file_get_contents($sFile), Settings::create()->withLenientParsing(true));
|
47 |
+
$oResult = $oParser->parse();
|
48 |
+
$this->assertSame("", $oResult->render());
|
49 |
+
}
|
50 |
+
|
51 |
+
public function testEndToken2Positive() {
|
52 |
+
$sFile = dirname(__FILE__) . '/../../../files' . DIRECTORY_SEPARATOR . "-end-token-2.css";
|
53 |
+
$oParser = new Parser(file_get_contents($sFile), Settings::create()->withLenientParsing(true));
|
54 |
+
$oResult = $oParser->parse();
|
55 |
+
$this->assertSame('#home .bg-layout {background-image: url("/bundles/main/img/bg1.png?5");}', $oResult->render());
|
56 |
+
}
|
57 |
+
|
58 |
+
public function testLocaleTrap() {
|
59 |
+
setlocale(LC_ALL, "pt_PT", "no");
|
60 |
+
$sFile = dirname(__FILE__) . '/../../../files' . DIRECTORY_SEPARATOR . "-fault-tolerance.css";
|
61 |
+
$oParser = new Parser(file_get_contents($sFile), Settings::create()->withLenientParsing(true));
|
62 |
+
$oResult = $oParser->parse();
|
63 |
+
$this->assertSame('.test1 {}'."\n".'.test2 {hello: 2.2;hello: 2000000000000.2;}'."\n".'#test {}'."\n".'#test2 {help: none;}', $oResult->render());
|
64 |
+
}
|
65 |
+
|
66 |
+
public function testCaseInsensitivity() {
|
67 |
+
$sFile = dirname(__FILE__) . '/../../../files' . DIRECTORY_SEPARATOR . "case-insensitivity.css";
|
68 |
+
$oParser = new Parser(file_get_contents($sFile));
|
69 |
+
$oResult = $oParser->parse();
|
70 |
+
$this->assertSame('@charset "utf-8";
|
71 |
+
@import url("test.css");
|
72 |
+
@media screen {}
|
73 |
+
#myid {case: insensitive !important;frequency: 30Hz;font-size: 1em;color: #ff0;color: hsl(40,40%,30%);font-family: Arial;}', $oResult->render());
|
74 |
+
}
|
75 |
+
|
76 |
+
}
|
vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/RuleSet/index.php
ADDED
File without changes
|
vendor/sabberworm/php-css-parser/tests/Sabberworm/CSS/index.php
ADDED
File without changes
|
vendor/sabberworm/php-css-parser/tests/Sabberworm/index.php
ADDED
File without changes
|
vendor/sabberworm/php-css-parser/tests/bootstrap.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
spl_autoload_register(function($class)
|
4 |
+
{
|
5 |
+
$file = __DIR__.'/../lib/'.strtr($class, '\\', '/').'.php';
|
6 |
+
if (file_exists($file)) {
|
7 |
+
require $file;
|
8 |
+
return true;
|
9 |
+
}
|
10 |
+
});
|
vendor/sabberworm/php-css-parser/tests/files/-charset-after-rule.css
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#id {
|
2 |
+
prop: var(--val);
|
3 |
+
}
|
4 |
+
|
5 |
+
@charset 'utf-16';
|
vendor/sabberworm/php-css-parser/tests/files/-charset-in-block.css
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
@media print {
|
2 |
+
@charset 'utf-16';
|
3 |
+
}
|
vendor/sabberworm/php-css-parser/tests/files/-empty.css
ADDED
File without changes
|
vendor/sabberworm/php-css-parser/tests/files/-end-token-2.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
#home .bg-layout { background-image: url(/bundles/main/img/bg1.png?5);};
|
vendor/sabberworm/php-css-parser/tests/files/-end-token.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
/* Test comment
|
vendor/sabberworm/php-css-parser/tests/files/-fault-tolerance.css
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.test1 {
|
2 |
+
//gaga: hello;
|
3 |
+
}
|
4 |
+
|
5 |
+
.test2 {
|
6 |
+
*hello: 1;
|
7 |
+
hello: 2.2;
|
8 |
+
hello: 2000000000000.2;
|
9 |
+
}
|
10 |
+
|
11 |
+
#test {
|
12 |
+
#hello: 1}
|
13 |
+
|
14 |
+
#test2 {
|
15 |
+
help: none;
|
vendor/sabberworm/php-css-parser/tests/files/-tobedone.css
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.some[selectors-may='contain-a-{'] {
|
2 |
+
|
3 |
+
}
|
4 |
+
|
5 |
+
@media only screen and (min-width: 200px) {
|
6 |
+
.test {
|
7 |
+
prop: val;
|
8 |
+
}
|
9 |
+
}
|
vendor/sabberworm/php-css-parser/tests/files/1readme.css
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@charset "utf-8";
|
2 |
+
|
3 |
+
@font-face {
|
4 |
+
font-family: "CrassRoots";
|
5 |
+
src: url("../media/cr.ttf")
|
6 |
+
}
|
7 |
+
|
8 |
+
html, body {
|
9 |
+
font-size: 1.6em
|
10 |
+
}
|
vendor/sabberworm/php-css-parser/tests/files/2readme.css
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#header {
|
2 |
+
margin: 10px 2em 1cm 2%;
|
3 |
+
font-family: Verdana, Helvetica, "Gill Sans", sans-serif;
|
4 |
+
color: red !important;
|
5 |
+
}
|
vendor/sabberworm/php-css-parser/tests/files/atrules.css
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@charset "utf-8";
|
2 |
+
|
3 |
+
@font-face {
|
4 |
+
font-family: "CrassRoots";
|
5 |
+
src: url("../media/cr.ttf")
|
6 |
+
}
|
7 |
+
|
8 |
+
html, body {
|
9 |
+
font-size: -0.6em
|
10 |
+
}
|
11 |
+
|
12 |
+
@keyframes mymove {
|
13 |
+
from { top: 0px; }
|
14 |
+
to { top: 200px; }
|
15 |
+
}
|
16 |
+
|
17 |
+
@-moz-keyframes some-move {
|
18 |
+
from { top: 0px; }
|
19 |
+
to { top: 200px; }
|
20 |
+
}
|
21 |
+
|
22 |
+
@supports ( (perspective: 10px) or (-moz-perspective: 10px) or (-webkit-perspective: 10px) or (-ms-perspective: 10px) or (-o-perspective: 10px) ) {
|
23 |
+
body {
|
24 |
+
font-family: 'Helvetica';
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
@page :pseudo-class {
|
29 |
+
margin:2in;
|
30 |
+
}
|
31 |
+
|
32 |
+
@-moz-document url(http://www.w3.org/),
|
33 |
+
url-prefix(http://www.w3.org/Style/),
|
34 |
+
domain(mozilla.org),
|
35 |
+
regexp("https:.*") {
|
36 |
+
/* CSS rules here apply to:
|
37 |
+
+ The page "http://www.w3.org/".
|
38 |
+
+ Any page whose URL begins with "http://www.w3.org/Style/"
|
39 |
+
+ Any page whose URL's host is "mozilla.org" or ends with
|
40 |
+
".mozilla.org"
|
41 |
+
+ Any page whose URL starts with "https:" */
|
42 |
+
|
43 |
+
/* make the above-mentioned pages really ugly */
|
44 |
+
body { color: purple; background: yellow; }
|
45 |
+
}
|
46 |
+
|
47 |
+
@media screen and (orientation: landscape) {
|
48 |
+
@-ms-viewport {
|
49 |
+
width: 1024px;
|
50 |
+
height: 768px;
|
51 |
+
}
|
52 |
+
/* CSS for landscape layout goes here */
|
53 |
+
}
|
54 |
+
|
55 |
+
@region-style #intro {
|
56 |
+
p { color: blue; }
|
57 |
+
}
|
vendor/sabberworm/php-css-parser/tests/files/case-insensitivity.css
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@CharSet "utf-8";
|
2 |
+
@IMPORT uRL(test.css);
|
3 |
+
|
4 |
+
@MEDIA screen {
|
5 |
+
|
6 |
+
}
|
7 |
+
|
8 |
+
#myid {
|
9 |
+
CaSe: insensitive !imPORTANT;
|
10 |
+
frequency: 30hz;
|
11 |
+
font-size: 1EM;
|
12 |
+
color: RGB(255, 255, 0);
|
13 |
+
color: hSL(40, 40%, 30%);
|
14 |
+
font-Family: Arial; /* The value needs to remain capitalized */
|
15 |
+
}
|
vendor/sabberworm/php-css-parser/tests/files/colortest.css
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#mine {
|
2 |
+
color: red;
|
3 |
+
border-color: rgb(10, 100, 230);
|
4 |
+
border-color: rgba(10, 100, 231, 0.3);
|
5 |
+
outline-color: #222;
|
6 |
+
background-color: #232323;
|
7 |
+
}
|
8 |
+
|
9 |
+
#yours {
|
10 |
+
background-color: hsl(220, 10%, 220%);
|
11 |
+
background-color: hsla(220, 10%, 220%, 0.3);
|
12 |
+
}
|
vendor/sabberworm/php-css-parser/tests/files/comments.css
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Comments Hell.
|
3 |
+
*/
|
4 |
+
@import /* Number 1 */"some/url.css"/* Number 2 */ screen/* Number 3 */;
|
5 |
+
|
6 |
+
.foo, /* Number 4 */ #bar/* Number 5 */ {
|
7 |
+
background-color/* Number 6 */: #000/* Number 7 */;
|
8 |
+
}
|
9 |
+
|
10 |
+
@media /* Number 8 */screen /* Number 9 */{
|
11 |
+
/** Number 10 **/
|
12 |
+
#foo.bar {
|
13 |
+
/** Number 10b **/
|
14 |
+
position: absolute;/**/
|
15 |
+
}
|
16 |
+
}
|
17 |
+
/** Number 11 **/
|
vendor/sabberworm/php-css-parser/tests/files/create-shorthands.css
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
body {
|
2 |
+
font-size: 2em; font-family: Helvetica,Arial,sans-serif; font-weight: bold;
|
3 |
+
border-width: 2px; border-color: #999; border-style: dotted;
|
4 |
+
background-color: #fff; background-image: url('foobar.png'); background-repeat: repeat-y;
|
5 |
+
margin-top: 2px; margin-right: 3px; margin-bottom: 4px; margin-left: 5px;
|
6 |
+
}
|
vendor/sabberworm/php-css-parser/tests/files/docuwiki.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
div.dokuwiki div.ajax_qsearch{position:absolute;right:237px;;width:200px;opacity:0.9;display:none;font-size:80%;line-height:1.2em;border:1px solid #8cacbb;background-color:#f7f9fa;text-align:left;padding:4px;}
|
vendor/sabberworm/php-css-parser/tests/files/expand-shorthands.css
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
body {
|
2 |
+
font: italic 500 14px/1.618 "Trebuchet MS", Georgia, serif;
|
3 |
+
border: 2px solid #f0f;
|
4 |
+
background: #ccc url("/images/foo.png") no-repeat left top;
|
5 |
+
margin: 1em !important;
|
6 |
+
padding: 2px 6px 3px;
|
7 |
+
}
|
vendor/sabberworm/php-css-parser/tests/files/functions.css
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
div.main { background-image: linear-gradient(#000, #fff) }
|
2 |
+
.collapser::before,
|
3 |
+
.collapser::-moz-before,
|
4 |
+
.collapser::-webkit-before {
|
5 |
+
content: "»";
|
6 |
+
font-size: 1.2em;
|
7 |
+
margin-right: .2em;
|
8 |
+
-moz-transition-property: -moz-transform;
|
9 |
+
-moz-transition-duration: .2s;
|
10 |
+
-moz-transform-origin: center 60%;
|
11 |
+
}
|
12 |
+
.collapser.expanded::before,
|
13 |
+
.collapser.expanded::-moz-before,
|
14 |
+
.collapser.expanded::-webkit-before { -moz-transform: rotate(90deg) }
|
15 |
+
.collapser + * {
|
16 |
+
height: 0;
|
17 |
+
overflow: hidden;
|
18 |
+
-moz-transition-property: height;
|
19 |
+
-moz-transition-duration: .3s;
|
20 |
+
}
|
21 |
+
.collapser.expanded + * { height: auto }
|
vendor/sabberworm/php-css-parser/tests/files/ie-hacks.css
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
p {
|
2 |
+
padding-right: .75rem \9;
|
3 |
+
background-image: none \9;
|
4 |
+
color:red\9\0;
|
5 |
+
background-color:red \9 \0;
|
6 |
+
background-color:red \9 \0 !important;
|
7 |
+
content: "red \9\0";
|
8 |
+
content: "red\0abc";
|
9 |
+
}
|
vendor/sabberworm/php-css-parser/tests/files/ie.css
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.nav-thumb-wrapper:hover img, a.activeSlide img {
|
2 |
+
filter: alpha(opacity=100);
|
3 |
+
-moz-opacity: 1;
|
4 |
+
-khtml-opacity: 1;
|
5 |
+
opacity: 1;
|
6 |
+
}
|
vendor/sabberworm/php-css-parser/tests/files/important.css
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
div.rating-cancel,div.star-rating{float:left;width:17px;height:15px;text-indent:-999em;cursor:pointer;display:block;background:transparent;overflow:hidden}
|
2 |
+
div.rating-cancel,div.rating-cancel a{background:url(images/delete.gif) no-repeat 0 -16px}
|
3 |
+
div.star-rating,div.star-rating a{background:url(images/star.gif) no-repeat 0 0px}
|
4 |
+
div.rating-cancel a,div.star-rating a{display:block;width:16px;height:100%;background-position:0 0px;border:0}
|
5 |
+
div.star-rating-on a{background-position:0 -16px!important}
|
6 |
+
div.star-rating-hover a{background-position:0 -32px}
|
7 |
+
div.star-rating-readonly a{cursor:default !important}
|
8 |
+
div.star-rating{background:transparent!important; overflow:hidden!important}
|
vendor/sabberworm/php-css-parser/tests/files/index.php
ADDED
File without changes
|
vendor/sabberworm/php-css-parser/tests/files/inner-color.css
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
test {
|
2 |
+
background: -webkit-gradient(linear, 0 0, 0 bottom, from(#006cad), to(hsl(202, 100%, 49%)));
|
3 |
+
}
|
vendor/sabberworm/php-css-parser/tests/files/line-numbers.css
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@charset "utf-8"; /* line 1 */
|
2 |
+
|
3 |
+
@namespace "http://toto.example.org"; /* line 3 */
|
4 |
+
|
5 |
+
@font-face { /* line 5 */
|
6 |
+
font-family: "CrassRoots";
|
7 |
+
src: url("http://example.com/media/cr.ttf") /* line 7 */
|
8 |
+
}
|
9 |
+
|
10 |
+
|
11 |
+
#header { /* line 11 */
|
12 |
+
margin: 10px 2em 1cm 2%;
|
13 |
+
font-family: Verdana, Helvetica, "Gill Sans", sans-serif;
|
14 |
+
color: red !important;
|
15 |
+
}
|
16 |
+
|
17 |
+
@keyframes mymove { /* line 17 */
|
18 |
+
from { top: 0px; } /* line 18 */
|
19 |
+
|
20 |
+
to { top: 200px; } /* line 20 */
|
21 |
+
}
|
22 |
+
|
23 |
+
@IMPORT uRL(test.css); /* line 23 */
|
24 |
+
|
25 |
+
body {
|
26 |
+
background: #FFFFFF url("http://somesite.com/images/someimage.gif") repeat top center; /* line 25 */
|
27 |
+
color: rgb( /* line 27 */
|
28 |
+
233, /* line 28 */
|
29 |
+
100, /* line 29 */
|
30 |
+
450 /* line 30 */
|
31 |
+
);
|
32 |
+
}
|
vendor/sabberworm/php-css-parser/tests/files/namespaces.css
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* From the spec at http://www.w3.org/TR/css3-namespace/ */
|
2 |
+
|
3 |
+
@namespace toto "http://toto.example.org";
|
4 |
+
@namespace "http://example.com/foo";
|
5 |
+
|
6 |
+
|
7 |
+
/* From an introduction at http://www.blooberry.com/indexdot/css/syntax/atrules/namespace.htm */
|
8 |
+
@namespace foo url("http://www.example.com/");
|
9 |
+
@namespace foo url('http://www.example.com/');
|
10 |
+
|
11 |
+
|
12 |
+
foo|test {
|
13 |
+
gaga: 1;
|
14 |
+
}
|
15 |
+
|
16 |
+
|test {
|
17 |
+
gaga: 2;
|
18 |
+
}
|
vendor/sabberworm/php-css-parser/tests/files/nested.css
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
html {
|
2 |
+
some: -test(val1);
|
3 |
+
}
|
4 |
+
|
5 |
+
html {
|
6 |
+
some-other: -test(val1);
|
7 |
+
}
|
8 |
+
|
9 |
+
@media screen {
|
10 |
+
html {
|
11 |
+
some: -test(val2);
|
12 |
+
}
|
13 |
+
}
|
14 |
+
|
15 |
+
#unrelated {
|
16 |
+
other: yes;
|
17 |
+
}
|
vendor/sabberworm/php-css-parser/tests/files/slashed.css
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
.test {
|
2 |
+
font: 12px/1.5 Verdana, Arial, sans-serif;
|
3 |
+
border-radius: 5px 10px 5px 10px / 10px 5px 10px 5px;
|
4 |
+
}
|
vendor/sabberworm/php-css-parser/tests/files/specificity.css
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#test .help,
|
2 |
+
#file,
|
3 |
+
.help:hover,
|
4 |
+
li.green,
|
5 |
+
ol li::before {
|
6 |
+
font-family: Helvetica;
|
7 |
+
}
|
vendor/sabberworm/php-css-parser/tests/files/unicode.css
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.test-1 { content: "\20"; } /* Same as " " */
|
2 |
+
.test-2 { content: "\E9"; } /* Same as "é" */
|
3 |
+
.test-3 { content: "\0020"; } /* Same as " " */
|
4 |
+
.test-5 { content: "\6C34" } /* Same as "水" */
|
5 |
+
.test-6 { content: "\00A5" } /* Same as "¥" */
|
6 |
+
.test-7 { content: '\a' } /* Same as "\A" (Newline) */
|
7 |
+
.test-8 { content: "\"\22" } /* Same as "\"\"" */
|
8 |
+
.test-9 { content: "\"\27" } /* Same as ""\"\'"" */
|
9 |
+
.test-10 { content: "\'\\" } /* Same as "'\" */
|
10 |
+
.test-11 { content: "\test" } /* Same as "test" */
|
11 |
+
|
12 |
+
.test-4 { content: "\1D11E" } /* Beyond the Basic Multilingual Plane */
|
vendor/sabberworm/php-css-parser/tests/files/url.css
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
body { background: #FFFFFF url("http://somesite.com/images/someimage.gif") repeat top center; }
|
2 |
+
body {
|
3 |
+
background-url: url("http://somesite.com/images/someimage.gif");
|
4 |
+
}
|
vendor/sabberworm/php-css-parser/tests/files/values.css
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#header {
|
2 |
+
margin: 10px 2em 1cm 2%;
|
3 |
+
font-family: Verdana, Helvetica, "Gill Sans", sans-serif;
|
4 |
+
font-size: 10px;
|
5 |
+
color: red !important;
|
6 |
+
background-color: green;
|
7 |
+
background-color: rgba(0,128,0,0.7);
|
8 |
+
frequency: 30Hz;
|
9 |
+
}
|
10 |
+
|
11 |
+
body {
|
12 |
+
color: green;
|
13 |
+
font: 75% "Lucida Grande", "Trebuchet MS", Verdana, sans-serif;
|
14 |
+
}
|
vendor/sabberworm/php-css-parser/tests/files/webkit.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.test { background:-webkit-linear-gradient(top right, white, black)}
|
vendor/sabberworm/php-css-parser/tests/files/whitespace.css
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
.test {
|
2 |
+
background-image : url ( 4px ) ;
|
3 |
+
}
|
vendor/sabberworm/php-css-parser/tests/index.php
ADDED
File without changes
|
vendor/sabberworm/php-css-parser/tests/phpunit.xml
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<phpunit bootstrap="bootstrap.php"></phpunit>
|
vendor/sabberworm/php-css-parser/tests/quickdump.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env php
|
2 |
+
<?php
|
3 |
+
|
4 |
+
require_once(dirname(__FILE__).'/bootstrap.php');
|
5 |
+
|
6 |
+
$sSource = file_get_contents('php://stdin');
|
7 |
+
$oParser = new Sabberworm\CSS\Parser($sSource);
|
8 |
+
|
9 |
+
$oDoc = $oParser->parse();
|
10 |
+
echo "\n".'#### Input'."\n\n```css\n";
|
11 |
+
print $sSource;
|
12 |
+
|
13 |
+
echo "\n```\n\n".'#### Structure (`var_dump()`)'."\n\n```php\n";
|
14 |
+
var_dump($oDoc);
|
15 |
+
|
16 |
+
echo "\n```\n\n".'#### Output (`render()`)'."\n\n```css\n";
|
17 |
+
print $oDoc->render();
|
18 |
+
|
19 |
+
echo "\n```\n";
|
20 |
+
|
vendor/swiftmailer/swiftmailer/composer.json
CHANGED
@@ -18,7 +18,8 @@
|
|
18 |
"php": ">=5.3.3"
|
19 |
},
|
20 |
"require-dev": {
|
21 |
-
"mockery/mockery": "~0.9.1"
|
|
|
22 |
},
|
23 |
"autoload": {
|
24 |
"files": ["lib/swift_required.php"]
|
18 |
"php": ">=5.3.3"
|
19 |
},
|
20 |
"require-dev": {
|
21 |
+
"mockery/mockery": "~0.9.1",
|
22 |
+
"symfony/phpunit-bridge": "~3.2"
|
23 |
},
|
24 |
"autoload": {
|
25 |
"files": ["lib/swift_required.php"]
|
vendor/swiftmailer/swiftmailer/lib/classes/Swift/MailTransport.php
CHANGED
@@ -12,6 +12,8 @@
|
|
12 |
* Sends Messages using the mail() function.
|
13 |
*
|
14 |
* @author Chris Corbyn
|
|
|
|
|
15 |
*/
|
16 |
class Swift_MailTransport extends Swift_Transport_MailTransport
|
17 |
{
|
12 |
* Sends Messages using the mail() function.
|
13 |
*
|
14 |
* @author Chris Corbyn
|
15 |
+
*
|
16 |
+
* @deprecated since 5.4.5 (to be removed in 6.0)
|
17 |
*/
|
18 |
class Swift_MailTransport extends Swift_Transport_MailTransport
|
19 |
{
|
vendor/swiftmailer/swiftmailer/lib/classes/Swift/Message.php
CHANGED
@@ -68,7 +68,7 @@ class Swift_Message extends Swift_Mime_SimpleMessage
|
|
68 |
* @param string $contentType
|
69 |
* @param string $charset
|
70 |
*
|
71 |
-
* @return
|
72 |
*/
|
73 |
public static function newInstance($subject = null, $body = null, $contentType = null, $charset = null)
|
74 |
{
|
@@ -82,7 +82,7 @@ class Swift_Message extends Swift_Mime_SimpleMessage
|
|
82 |
* @param string $contentType
|
83 |
* @param string $charset
|
84 |
*
|
85 |
-
* @return
|
86 |
*/
|
87 |
public function addPart($body, $contentType = null, $charset = null)
|
88 |
{
|
@@ -92,11 +92,11 @@ class Swift_Message extends Swift_Mime_SimpleMessage
|
|
92 |
}
|
93 |
|
94 |
/**
|
95 |
-
*
|
96 |
*
|
97 |
* @param Swift_Signer $signer
|
98 |
*
|
99 |
-
* @return
|
100 |
*/
|
101 |
public function attachSigner(Swift_Signer $signer)
|
102 |
{
|
@@ -114,7 +114,7 @@ class Swift_Message extends Swift_Mime_SimpleMessage
|
|
114 |
*
|
115 |
* @param Swift_Signer $signer
|
116 |
*
|
117 |
-
* @return
|
118 |
*/
|
119 |
public function detachSigner(Swift_Signer $signer)
|
120 |
{
|
@@ -281,11 +281,11 @@ class Swift_Message extends Swift_Mime_SimpleMessage
|
|
281 |
{
|
282 |
parent::__clone();
|
283 |
foreach ($this->bodySigners as $key => $bodySigner) {
|
284 |
-
$this->bodySigners[$key] = clone
|
285 |
}
|
286 |
|
287 |
foreach ($this->headerSigners as $key => $headerSigner) {
|
288 |
-
$this->headerSigners[$key] = clone
|
289 |
}
|
290 |
}
|
291 |
}
|
68 |
* @param string $contentType
|
69 |
* @param string $charset
|
70 |
*
|
71 |
+
* @return $this
|
72 |
*/
|
73 |
public static function newInstance($subject = null, $body = null, $contentType = null, $charset = null)
|
74 |
{
|
82 |
* @param string $contentType
|
83 |
* @param string $charset
|
84 |
*
|
85 |
+
* @return $this
|
86 |
*/
|
87 |
public function addPart($body, $contentType = null, $charset = null)
|
88 |
{
|
92 |
}
|
93 |
|
94 |
/**
|
95 |
+
* Detach a signature handler from a message.
|
96 |
*
|
97 |
* @param Swift_Signer $signer
|
98 |
*
|
99 |
+
* @return $this
|
100 |
*/
|
101 |
public function attachSigner(Swift_Signer $signer)
|
102 |
{
|
114 |
*
|
115 |
* @param Swift_Signer $signer
|
116 |
*
|
117 |
+
* @return $this
|
118 |
*/
|
119 |
public function detachSigner(Swift_Signer $signer)
|
120 |
{
|
281 |
{
|
282 |
parent::__clone();
|
283 |
foreach ($this->bodySigners as $key => $bodySigner) {
|
284 |
+
$this->bodySigners[$key] = clone $bodySigner;
|
285 |
}
|
286 |
|
287 |
foreach ($this->headerSigners as $key => $headerSigner) {
|
288 |
+
$this->headerSigners[$key] = clone $headerSigner;
|
289 |
}
|
290 |
}
|
291 |
}
|
vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php
CHANGED
@@ -298,7 +298,7 @@ class Swift_Mime_Headers_MailboxHeader extends Swift_Mime_Headers_AbstractHeader
|
|
298 |
* Redefine the encoding requirements for mailboxes.
|
299 |
*
|
300 |
* All "specials" must be encoded as the full header value will not be quoted
|
301 |
-
*
|
302 |
* @see RFC 2822 3.2.1
|
303 |
*
|
304 |
* @param string $token
|
298 |
* Redefine the encoding requirements for mailboxes.
|
299 |
*
|
300 |
* All "specials" must be encoded as the full header value will not be quoted
|
301 |
+
*
|
302 |
* @see RFC 2822 3.2.1
|
303 |
*
|
304 |
* @param string $token
|
vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/OpenDKIMHeader.php
CHANGED
@@ -30,11 +30,7 @@ class Swift_Mime_Headers_OpenDKIMHeader implements Swift_Mime_Header
|
|
30 |
private $_fieldName;
|
31 |
|
32 |
/**
|
33 |
-
*
|
34 |
-
*
|
35 |
-
* @param string $name
|
36 |
-
* @param Swift_Mime_HeaderEncoder $encoder
|
37 |
-
* @param Swift_Mime_Grammar $grammar
|
38 |
*/
|
39 |
public function __construct($name)
|
40 |
{
|
30 |
private $_fieldName;
|
31 |
|
32 |
/**
|
33 |
+
* @param string $name
|
|
|
|
|
|
|
|
|
34 |
*/
|
35 |
public function __construct($name)
|
36 |
{
|
vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php
CHANGED
@@ -15,6 +15,12 @@
|
|
15 |
*/
|
16 |
class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime_Message
|
17 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
/**
|
19 |
* Create a new SimpleMessage with $headers, $encoder and $cache.
|
20 |
*
|
@@ -67,7 +73,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime
|
|
67 |
*
|
68 |
* @param string $subject
|
69 |
*
|
70 |
-
* @return
|
71 |
*/
|
72 |
public function setSubject($subject)
|
73 |
{
|
@@ -93,7 +99,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime
|
|
93 |
*
|
94 |
* @param int $date
|
95 |
*
|
96 |
-
* @return
|
97 |
*/
|
98 |
public function setDate($date)
|
99 |
{
|
@@ -119,7 +125,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime
|
|
119 |
*
|
120 |
* @param string $address
|
121 |
*
|
122 |
-
* @return
|
123 |
*/
|
124 |
public function setReturnPath($address)
|
125 |
{
|
@@ -148,7 +154,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime
|
|
148 |
* @param string $address
|
149 |
* @param string $name optional
|
150 |
*
|
151 |
-
* @return
|
152 |
*/
|
153 |
public function setSender($address, $name = null)
|
154 |
{
|
@@ -181,7 +187,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime
|
|
181 |
* @param string $address
|
182 |
* @param string $name optional
|
183 |
*
|
184 |
-
* @return
|
185 |
*/
|
186 |
public function addFrom($address, $name = null)
|
187 |
{
|
@@ -202,7 +208,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime
|
|
202 |
* @param string|array $addresses
|
203 |
* @param string $name optional
|
204 |
*
|
205 |
-
* @return
|
206 |
*/
|
207 |
public function setFrom($addresses, $name = null)
|
208 |
{
|
@@ -235,7 +241,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime
|
|
235 |
* @param string $address
|
236 |
* @param string $name optional
|
237 |
*
|
238 |
-
* @return
|
239 |
*/
|
240 |
public function addReplyTo($address, $name = null)
|
241 |
{
|
@@ -256,7 +262,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime
|
|
256 |
* @param mixed $addresses
|
257 |
* @param string $name optional
|
258 |
*
|
259 |
-
* @return
|
260 |
*/
|
261 |
public function setReplyTo($addresses, $name = null)
|
262 |
{
|
@@ -289,7 +295,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime
|
|
289 |
* @param string $address
|
290 |
* @param string $name optional
|
291 |
*
|
292 |
-
* @return
|
293 |
*/
|
294 |
public function addTo($address, $name = null)
|
295 |
{
|
@@ -311,7 +317,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime
|
|
311 |
* @param mixed $addresses
|
312 |
* @param string $name optional
|
313 |
*
|
314 |
-
* @return
|
315 |
*/
|
316 |
public function setTo($addresses, $name = null)
|
317 |
{
|
@@ -344,7 +350,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime
|
|
344 |
* @param string $address
|
345 |
* @param string $name optional
|
346 |
*
|
347 |
-
* @return
|
348 |
*/
|
349 |
public function addCc($address, $name = null)
|
350 |
{
|
@@ -363,7 +369,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime
|
|
363 |
* @param mixed $addresses
|
364 |
* @param string $name optional
|
365 |
*
|
366 |
-
* @return
|
367 |
*/
|
368 |
public function setCc($addresses, $name = null)
|
369 |
{
|
@@ -396,7 +402,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime
|
|
396 |
* @param string $address
|
397 |
* @param string $name optional
|
398 |
*
|
399 |
-
* @return
|
400 |
*/
|
401 |
public function addBcc($address, $name = null)
|
402 |
{
|
@@ -415,7 +421,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime
|
|
415 |
* @param mixed $addresses
|
416 |
* @param string $name optional
|
417 |
*
|
418 |
-
* @return
|
419 |
*/
|
420 |
public function setBcc($addresses, $name = null)
|
421 |
{
|
@@ -447,16 +453,16 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime
|
|
447 |
*
|
448 |
* @param int $priority
|
449 |
*
|
450 |
-
* @return
|
451 |
*/
|
452 |
public function setPriority($priority)
|
453 |
{
|
454 |
$priorityMap = array(
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
);
|
461 |
$pMapKeys = array_keys($priorityMap);
|
462 |
if ($priority > max($pMapKeys)) {
|
@@ -495,7 +501,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime
|
|
495 |
*
|
496 |
* @param array $addresses
|
497 |
*
|
498 |
-
* @return
|
499 |
*/
|
500 |
public function setReadReceiptTo($addresses)
|
501 |
{
|
@@ -522,7 +528,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime
|
|
522 |
*
|
523 |
* @param Swift_Mime_MimeEntity $entity
|
524 |
*
|
525 |
-
* @return
|
526 |
*/
|
527 |
public function attach(Swift_Mime_MimeEntity $entity)
|
528 |
{
|
@@ -536,7 +542,7 @@ class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime
|
|
536 |
*
|
537 |
* @param Swift_Mime_MimeEntity $entity
|
538 |
*
|
539 |
-
* @return
|
540 |
*/
|
541 |
public function detach(Swift_Mime_MimeEntity $entity)
|
542 |
{
|
15 |
*/
|
16 |
class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Swift_Mime_Message
|
17 |
{
|
18 |
+
const PRIORITY_HIGHEST = 1;
|
19 |
+
const PRIORITY_HIGH = 2;
|
20 |
+
const PRIORITY_NORMAL = 3;
|
21 |
+
const PRIORITY_LOW = 4;
|
22 |
+
const PRIORITY_LOWEST = 5;
|
23 |
+
|
24 |
/**
|
25 |
* Create a new SimpleMessage with $headers, $encoder and $cache.
|
26 |
*
|
73 |
*
|
74 |
* @param string $subject
|
75 |
*
|
76 |
+
* @return $this
|
77 |
*/
|
78 |
public function setSubject($subject)
|
79 |
{
|
99 |
*
|
100 |
* @param int $date
|
101 |
*
|
102 |
+
* @return $this
|
103 |
*/
|
104 |
public function setDate($date)
|
105 |
{
|
125 |
*
|
126 |
* @param string $address
|
127 |
*
|
128 |
+
* @return $this
|
129 |
*/
|
130 |
public function setReturnPath($address)
|
131 |
{
|
154 |
* @param string $address
|
155 |
* @param string $name optional
|
156 |
*
|
157 |
+
* @return $this
|
158 |
*/
|
159 |
public function setSender($address, $name = null)
|
160 |
{
|
187 |
* @param string $address
|
188 |
* @param string $name optional
|
189 |
*
|
190 |
+
* @return $this
|
191 |
*/
|
192 |
public function addFrom($address, $name = null)
|
193 |
{
|
208 |
* @param string|array $addresses
|
209 |
* @param string $name optional
|
210 |
*
|
211 |
+
* @return $this
|
212 |
*/
|
213 |
public function setFrom($addresses, $name = null)
|
214 |
{
|
241 |
* @param string $address
|
242 |
* @param string $name optional
|
243 |
*
|
244 |
+
* @return $this
|
245 |
*/
|
246 |
public function addReplyTo($address, $name = null)
|
247 |
{
|
262 |
* @param mixed $addresses
|
263 |
* @param string $name optional
|
264 |
*
|
265 |
+
* @return $this
|
266 |
*/
|
267 |
public function setReplyTo($addresses, $name = null)
|
268 |
{
|
295 |
* @param string $address
|
296 |
* @param string $name optional
|
297 |
*
|
298 |
+
* @return $this
|
299 |
*/
|
300 |
public function addTo($address, $name = null)
|
301 |
{
|
317 |
* @param mixed $addresses
|
318 |
* @param string $name optional
|
319 |
*
|
320 |
+
* @return $this
|
321 |
*/
|
322 |
public function setTo($addresses, $name = null)
|
323 |
{
|
350 |
* @param string $address
|
351 |
* @param string $name optional
|
352 |
*
|
353 |
+
* @return $this
|
354 |
*/
|
355 |
public function addCc($address, $name = null)
|
356 |
{
|
369 |
* @param mixed $addresses
|
370 |
* @param string $name optional
|
371 |
*
|
372 |
+
* @return $this
|
373 |
*/
|
374 |
public function setCc($addresses, $name = null)
|
375 |
{
|
402 |
* @param string $address
|
403 |
* @param string $name optional
|
404 |
*
|
405 |
+
* @return $this
|
406 |
*/
|
407 |
public function addBcc($address, $name = null)
|
408 |
{
|
421 |
* @param mixed $addresses
|
422 |
* @param string $name optional
|
423 |
*
|
424 |
+
* @return $this
|
425 |
*/
|
426 |
public function setBcc($addresses, $name = null)
|
427 |
{
|
453 |
*
|
454 |
* @param int $priority
|
455 |
*
|
456 |
+
* @return $this
|
457 |
*/
|
458 |
public function setPriority($priority)
|
459 |
{
|
460 |
$priorityMap = array(
|
461 |
+
self::PRIORITY_HIGHEST => 'Highest',
|
462 |
+
self::PRIORITY_HIGH => 'High',
|
463 |
+
self::PRIORITY_NORMAL => 'Normal',
|
464 |
+
self::PRIORITY_LOW => 'Low',
|
465 |
+
self::PRIORITY_LOWEST => 'Lowest',
|
466 |
);
|
467 |
$pMapKeys = array_keys($priorityMap);
|
468 |
if ($priority > max($pMapKeys)) {
|
501 |
*
|
502 |
* @param array $addresses
|
503 |
*
|
504 |
+
* @return $this
|
505 |
*/
|
506 |
public function setReadReceiptTo($addresses)
|
507 |
{
|
528 |
*
|
529 |
* @param Swift_Mime_MimeEntity $entity
|
530 |
*
|
531 |
+
* @return $this
|
532 |
*/
|
533 |
public function attach(Swift_Mime_MimeEntity $entity)
|
534 |
{
|
542 |
*
|
543 |
* @param Swift_Mime_MimeEntity $entity
|
544 |
*
|
545 |
+
* @return $this
|
546 |
*/
|
547 |
public function detach(Swift_Mime_MimeEntity $entity)
|
548 |
{
|
vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php
CHANGED
@@ -161,7 +161,7 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity
|
|
161 |
*
|
162 |
* @param string $type
|
163 |
*
|
164 |
-
* @return
|
165 |
*/
|
166 |
public function setContentType($type)
|
167 |
{
|
@@ -192,7 +192,7 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity
|
|
192 |
*
|
193 |
* @param string $id
|
194 |
*
|
195 |
-
* @return
|
196 |
*/
|
197 |
public function setId($id)
|
198 |
{
|
@@ -223,7 +223,7 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity
|
|
223 |
*
|
224 |
* @param string $description
|
225 |
*
|
226 |
-
* @return
|
227 |
*/
|
228 |
public function setDescription($description)
|
229 |
{
|
@@ -251,7 +251,7 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity
|
|
251 |
*
|
252 |
* @param int $length
|
253 |
*
|
254 |
-
* @return
|
255 |
*/
|
256 |
public function setMaxLineLength($length)
|
257 |
{
|
@@ -276,7 +276,7 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity
|
|
276 |
* @param Swift_Mime_MimeEntity[] $children
|
277 |
* @param int $compoundLevel For internal use only
|
278 |
*
|
279 |
-
* @return
|
280 |
*/
|
281 |
public function setChildren(array $children, $compoundLevel = null)
|
282 |
{
|
@@ -355,7 +355,7 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity
|
|
355 |
* @param mixed $body
|
356 |
* @param string $contentType optional
|
357 |
*
|
358 |
-
* @return
|
359 |
*/
|
360 |
public function setBody($body, $contentType = null)
|
361 |
{
|
@@ -386,7 +386,7 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity
|
|
386 |
*
|
387 |
* @param Swift_Mime_ContentEncoder $encoder
|
388 |
*
|
389 |
-
* @return
|
390 |
*/
|
391 |
public function setEncoder(Swift_Mime_ContentEncoder $encoder)
|
392 |
{
|
@@ -422,7 +422,7 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity
|
|
422 |
*
|
423 |
* @throws Swift_RfcComplianceException
|
424 |
*
|
425 |
-
* @return
|
426 |
*/
|
427 |
public function setBoundary($boundary)
|
428 |
{
|
161 |
*
|
162 |
* @param string $type
|
163 |
*
|
164 |
+
* @return $this
|
165 |
*/
|
166 |
public function setContentType($type)
|
167 |
{
|
192 |
*
|
193 |
* @param string $id
|
194 |
*
|
195 |
+
* @return $this
|
196 |
*/
|
197 |
public function setId($id)
|
198 |
{
|
223 |
*
|
224 |
* @param string $description
|
225 |
*
|
226 |
+
* @return $this
|
227 |
*/
|
228 |
public function setDescription($description)
|
229 |
{
|
251 |
*
|
252 |
* @param int $length
|
253 |
*
|
254 |
+
* @return $this
|
255 |
*/
|
256 |
public function setMaxLineLength($length)
|
257 |
{
|
276 |
* @param Swift_Mime_MimeEntity[] $children
|
277 |
* @param int $compoundLevel For internal use only
|
278 |
*
|
279 |
+
* @return $this
|
280 |
*/
|
281 |
public function setChildren(array $children, $compoundLevel = null)
|
282 |
{
|
355 |
* @param mixed $body
|
356 |
* @param string $contentType optional
|
357 |
*
|
358 |
+
* @return $this
|
359 |
*/
|
360 |
public function setBody($body, $contentType = null)
|
361 |
{
|
386 |
*
|
387 |
* @param Swift_Mime_ContentEncoder $encoder
|
388 |
*
|
389 |
+
* @return $this
|
390 |
*/
|
391 |
public function setEncoder(Swift_Mime_ContentEncoder $encoder)
|
392 |
{
|
422 |
*
|
423 |
* @throws Swift_RfcComplianceException
|
424 |
*
|
425 |
+
* @return $this
|
426 |
*/
|
427 |
public function setBoundary($boundary)
|
428 |
{
|
vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/ThrottlerPlugin.php
CHANGED
@@ -98,16 +98,16 @@ class Swift_Plugins_ThrottlerPlugin extends Swift_Plugins_BandwidthMonitorPlugin
|
|
98 |
$duration = $time - $this->_start;
|
99 |
|
100 |
switch ($this->_mode) {
|
101 |
-
case self::BYTES_PER_MINUTE
|
102 |
$sleep = $this->_throttleBytesPerMinute($duration);
|
103 |
break;
|
104 |
-
case self::MESSAGES_PER_SECOND
|
105 |
$sleep = $this->_throttleMessagesPerSecond($duration);
|
106 |
break;
|
107 |
-
case self::MESSAGES_PER_MINUTE
|
108 |
$sleep = $this->_throttleMessagesPerMinute($duration);
|
109 |
break;
|
110 |
-
default
|
111 |
$sleep = 0;
|
112 |
break;
|
113 |
}
|
98 |
$duration = $time - $this->_start;
|
99 |
|
100 |
switch ($this->_mode) {
|
101 |
+
case self::BYTES_PER_MINUTE:
|
102 |
$sleep = $this->_throttleBytesPerMinute($duration);
|
103 |
break;
|
104 |
+
case self::MESSAGES_PER_SECOND:
|
105 |
$sleep = $this->_throttleMessagesPerSecond($duration);
|
106 |
break;
|
107 |
+
case self::MESSAGES_PER_MINUTE:
|
108 |
$sleep = $this->_throttleMessagesPerMinute($duration);
|
109 |
break;
|
110 |
+
default:
|
111 |
$sleep = 0;
|
112 |
break;
|
113 |
}
|
vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DKIMSigner.php
CHANGED
@@ -432,10 +432,10 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
|
432 |
{
|
433 |
// Init
|
434 |
switch ($this->_hashAlgorithm) {
|
435 |
-
case 'rsa-sha256'
|
436 |
$this->_bodyHashHandler = hash_init('sha256');
|
437 |
break;
|
438 |
-
case 'rsa-sha1'
|
439 |
$this->_bodyHashHandler = hash_init('sha1');
|
440 |
break;
|
441 |
}
|
@@ -567,14 +567,14 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
|
567 |
protected function _addHeader($header, $is_sig = false)
|
568 |
{
|
569 |
switch ($this->_headerCanon) {
|
570 |
-
case 'relaxed'
|
571 |
// Prepare Header and cascade
|
572 |
$exploded = explode(':', $header, 2);
|
573 |
$name = strtolower(trim($exploded[0]));
|
574 |
$value = str_replace("\r\n", '', $exploded[1]);
|
575 |
$value = preg_replace("/[ \t][ \t]+/", ' ', $value);
|
576 |
$header = $name.':'.trim($value).($is_sig ? '' : "\r\n");
|
577 |
-
case 'simple'
|
578 |
// Nothing to do
|
579 |
}
|
580 |
$this->_addToHeaderHash($header);
|
@@ -600,10 +600,10 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
|
600 |
continue;
|
601 |
}
|
602 |
switch ($string[$i]) {
|
603 |
-
case "\r"
|
604 |
$this->_bodyCanonLastChar = "\r";
|
605 |
break;
|
606 |
-
case "\n"
|
607 |
if ($this->_bodyCanonLastChar == "\r") {
|
608 |
if ($method) {
|
609 |
$this->_bodyCanonSpace = false;
|
@@ -619,13 +619,13 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
|
619 |
// todo handle it but should never happen
|
620 |
}
|
621 |
break;
|
622 |
-
case ' '
|
623 |
-
case "\t"
|
624 |
if ($method) {
|
625 |
$this->_bodyCanonSpace = true;
|
626 |
break;
|
627 |
}
|
628 |
-
default
|
629 |
if ($this->_bodyCanonEmptyCounter > 0) {
|
630 |
$canon .= str_repeat("\r\n", $this->_bodyCanonEmptyCounter);
|
631 |
$this->_bodyCanonEmptyCounter = 0;
|
432 |
{
|
433 |
// Init
|
434 |
switch ($this->_hashAlgorithm) {
|
435 |
+
case 'rsa-sha256':
|
436 |
$this->_bodyHashHandler = hash_init('sha256');
|
437 |
break;
|
438 |
+
case 'rsa-sha1':
|
439 |
$this->_bodyHashHandler = hash_init('sha1');
|
440 |
break;
|
441 |
}
|
567 |
protected function _addHeader($header, $is_sig = false)
|
568 |
{
|
569 |
switch ($this->_headerCanon) {
|
570 |
+
case 'relaxed':
|
571 |
// Prepare Header and cascade
|
572 |
$exploded = explode(':', $header, 2);
|
573 |
$name = strtolower(trim($exploded[0]));
|
574 |
$value = str_replace("\r\n", '', $exploded[1]);
|
575 |
$value = preg_replace("/[ \t][ \t]+/", ' ', $value);
|
576 |
$header = $name.':'.trim($value).($is_sig ? '' : "\r\n");
|
577 |
+
case 'simple':
|
578 |
// Nothing to do
|
579 |
}
|
580 |
$this->_addToHeaderHash($header);
|
600 |
continue;
|
601 |
}
|
602 |
switch ($string[$i]) {
|
603 |
+
case "\r":
|
604 |
$this->_bodyCanonLastChar = "\r";
|
605 |
break;
|
606 |
+
case "\n":
|
607 |
if ($this->_bodyCanonLastChar == "\r") {
|
608 |
if ($method) {
|
609 |
$this->_bodyCanonSpace = false;
|
619 |
// todo handle it but should never happen
|
620 |
}
|
621 |
break;
|
622 |
+
case ' ':
|
623 |
+
case "\t":
|
624 |
if ($method) {
|
625 |
$this->_bodyCanonSpace = true;
|
626 |
break;
|
627 |
}
|
628 |
+
default:
|
629 |
if ($this->_bodyCanonEmptyCounter > 0) {
|
630 |
$canon .= str_repeat("\r\n", $this->_bodyCanonEmptyCounter);
|
631 |
$this->_bodyCanonEmptyCounter = 0;
|
vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/DomainKeySigner.php
CHANGED
@@ -413,14 +413,14 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
|
|
413 |
protected function _addHeader($header)
|
414 |
{
|
415 |
switch ($this->_canon) {
|
416 |
-
case 'nofws'
|
417 |
// Prepare Header and cascade
|
418 |
$exploded = explode(':', $header, 2);
|
419 |
$name = strtolower(trim($exploded[0]));
|
420 |
$value = str_replace("\r\n", '', $exploded[1]);
|
421 |
$value = preg_replace("/[ \t][ \t]+/", ' ', $value);
|
422 |
$header = $name.':'.trim($value)."\r\n";
|
423 |
-
case 'simple'
|
424 |
// Nothing to do
|
425 |
}
|
426 |
$this->_addToHash($header);
|
@@ -442,10 +442,10 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
|
|
442 |
continue;
|
443 |
}
|
444 |
switch ($string[$i]) {
|
445 |
-
case "\r"
|
446 |
$this->_bodyCanonLastChar = "\r";
|
447 |
break;
|
448 |
-
case "\n"
|
449 |
if ($this->_bodyCanonLastChar == "\r") {
|
450 |
if ($nofws) {
|
451 |
$this->_bodyCanonSpace = false;
|
@@ -461,14 +461,14 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
|
|
461 |
throw new Swift_SwiftException('Invalid new line sequence in mail found \n without preceding \r');
|
462 |
}
|
463 |
break;
|
464 |
-
case ' '
|
465 |
-
case "\t"
|
466 |
case "\x09": //HTAB
|
467 |
if ($nofws) {
|
468 |
$this->_bodyCanonSpace = true;
|
469 |
break;
|
470 |
}
|
471 |
-
default
|
472 |
if ($this->_bodyCanonEmptyCounter > 0) {
|
473 |
$canon .= str_repeat("\r\n", $this->_bodyCanonEmptyCounter);
|
474 |
$this->_bodyCanonEmptyCounter = 0;
|
@@ -498,7 +498,7 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
|
|
498 |
{
|
499 |
// Init
|
500 |
switch ($this->_hashAlgorithm) {
|
501 |
-
case 'rsa-sha1'
|
502 |
$this->_hashHandler = hash_init('sha1');
|
503 |
break;
|
504 |
}
|
413 |
protected function _addHeader($header)
|
414 |
{
|
415 |
switch ($this->_canon) {
|
416 |
+
case 'nofws':
|
417 |
// Prepare Header and cascade
|
418 |
$exploded = explode(':', $header, 2);
|
419 |
$name = strtolower(trim($exploded[0]));
|
420 |
$value = str_replace("\r\n", '', $exploded[1]);
|
421 |
$value = preg_replace("/[ \t][ \t]+/", ' ', $value);
|
422 |
$header = $name.':'.trim($value)."\r\n";
|
423 |
+
case 'simple':
|
424 |
// Nothing to do
|
425 |
}
|
426 |
$this->_addToHash($header);
|
442 |
continue;
|
443 |
}
|
444 |
switch ($string[$i]) {
|
445 |
+
case "\r":
|
446 |
$this->_bodyCanonLastChar = "\r";
|
447 |
break;
|
448 |
+
case "\n":
|
449 |
if ($this->_bodyCanonLastChar == "\r") {
|
450 |
if ($nofws) {
|
451 |
$this->_bodyCanonSpace = false;
|
461 |
throw new Swift_SwiftException('Invalid new line sequence in mail found \n without preceding \r');
|
462 |
}
|
463 |
break;
|
464 |
+
case ' ':
|
465 |
+
case "\t":
|
466 |
case "\x09": //HTAB
|
467 |
if ($nofws) {
|
468 |
$this->_bodyCanonSpace = true;
|
469 |
break;
|
470 |
}
|
471 |
+
default:
|
472 |
if ($this->_bodyCanonEmptyCounter > 0) {
|
473 |
$canon .= str_repeat("\r\n", $this->_bodyCanonEmptyCounter);
|
474 |
$this->_bodyCanonEmptyCounter = 0;
|
498 |
{
|
499 |
// Init
|
500 |
switch ($this->_hashAlgorithm) {
|
501 |
+
case 'rsa-sha1':
|
502 |
$this->_hashHandler = hash_init('sha1');
|
503 |
break;
|
504 |
}
|
vendor/swiftmailer/swiftmailer/lib/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php
CHANGED
@@ -124,6 +124,7 @@ class Swift_StreamFilters_ByteArrayReplacementFilter implements Swift_StreamFilt
|
|
124 |
|
125 |
$newBuffer = array();
|
126 |
$buf_size = count($buffer);
|
|
|
127 |
for ($i = 0; $i < $buf_size; ++$i) {
|
128 |
$search_pos = $this->_tree;
|
129 |
$last_found = PHP_INT_MAX;
|
124 |
|
125 |
$newBuffer = array();
|
126 |
$buf_size = count($buffer);
|
127 |
+
$last_size = 0;
|
128 |
for ($i = 0; $i < $buf_size; ++$i) {
|
129 |
$search_pos = $this->_tree;
|
130 |
$last_found = PHP_INT_MAX;
|
vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php
CHANGED
@@ -46,7 +46,7 @@ class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Es
|
|
46 |
}
|
47 |
|
48 |
if (!function_exists('bcmul')) {
|
49 |
-
throw new LogicException('The
|
50 |
}
|
51 |
|
52 |
try {
|
46 |
}
|
47 |
|
48 |
if (!function_exists('bcmul')) {
|
49 |
+
throw new LogicException('The BCMath functions must be enabled to use the NTLM authenticator.');
|
50 |
}
|
51 |
|
52 |
try {
|
vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php
CHANGED
@@ -140,7 +140,7 @@ class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTranspo
|
|
140 |
*/
|
141 |
public function setEncryption($encryption)
|
142 |
{
|
143 |
-
$encryption = strtolower($encryption);
|
144 |
if ('tls' == $encryption) {
|
145 |
$this->_params['protocol'] = 'tcp';
|
146 |
$this->_params['tls'] = true;
|
140 |
*/
|
141 |
public function setEncryption($encryption)
|
142 |
{
|
143 |
+
$encryption = strtolower($encryption);
|
144 |
if ('tls' == $encryption) {
|
145 |
$this->_params['protocol'] = 'tcp';
|
146 |
$this->_params['tls'] = true;
|
vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/MailTransport.php
CHANGED
@@ -20,6 +20,8 @@
|
|
20 |
* all-or-nothing result from sending.
|
21 |
*
|
22 |
* @author Chris Corbyn
|
|
|
|
|
23 |
*/
|
24 |
class Swift_Transport_MailTransport implements Swift_Transport
|
25 |
{
|
@@ -40,6 +42,8 @@ class Swift_Transport_MailTransport implements Swift_Transport
|
|
40 |
*/
|
41 |
public function __construct(Swift_Transport_MailInvoker $invoker, Swift_Events_EventDispatcher $eventDispatcher)
|
42 |
{
|
|
|
|
|
43 |
$this->_invoker = $invoker;
|
44 |
$this->_eventDispatcher = $eventDispatcher;
|
45 |
}
|
@@ -238,6 +242,36 @@ class Swift_Transport_MailTransport implements Swift_Transport
|
|
238 |
return $path;
|
239 |
}
|
240 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
/**
|
242 |
* Return php mail extra params to use for invoker->mail.
|
243 |
*
|
@@ -249,7 +283,11 @@ class Swift_Transport_MailTransport implements Swift_Transport
|
|
249 |
private function _formatExtraParams($extraParams, $reversePath)
|
250 |
{
|
251 |
if (false !== strpos($extraParams, '-f%s')) {
|
252 |
-
|
|
|
|
|
|
|
|
|
253 |
}
|
254 |
|
255 |
return !empty($extraParams) ? $extraParams : null;
|
20 |
* all-or-nothing result from sending.
|
21 |
*
|
22 |
* @author Chris Corbyn
|
23 |
+
*
|
24 |
+
* @deprecated since 5.4.5 (to be removed in 6.0)
|
25 |
*/
|
26 |
class Swift_Transport_MailTransport implements Swift_Transport
|
27 |
{
|
42 |
*/
|
43 |
public function __construct(Swift_Transport_MailInvoker $invoker, Swift_Events_EventDispatcher $eventDispatcher)
|
44 |
{
|
45 |
+
@trigger_error(sprintf('The %s class is deprecated since version 5.4.5 and will be removed in 6.0. Use the Sendmail or SMTP transport instead.', __CLASS__), E_USER_DEPRECATED);
|
46 |
+
|
47 |
$this->_invoker = $invoker;
|
48 |
$this->_eventDispatcher = $eventDispatcher;
|
49 |
}
|
242 |
return $path;
|
243 |
}
|
244 |
|
245 |
+
/**
|
246 |
+
* Fix CVE-2016-10074 by disallowing potentially unsafe shell characters.
|
247 |
+
*
|
248 |
+
* Note that escapeshellarg and escapeshellcmd are inadequate for our purposes, especially on Windows.
|
249 |
+
*
|
250 |
+
* @param string $string The string to be validated
|
251 |
+
*
|
252 |
+
* @return bool
|
253 |
+
*/
|
254 |
+
private function _isShellSafe($string)
|
255 |
+
{
|
256 |
+
// Future-proof
|
257 |
+
if (escapeshellcmd($string) !== $string || !in_array(escapeshellarg($string), array("'$string'", "\"$string\""))) {
|
258 |
+
return false;
|
259 |
+
}
|
260 |
+
|
261 |
+
$length = strlen($string);
|
262 |
+
for ($i = 0; $i < $length; ++$i) {
|
263 |
+
$c = $string[$i];
|
264 |
+
// All other characters have a special meaning in at least one common shell, including = and +.
|
265 |
+
// Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here.
|
266 |
+
// Note that this does permit non-Latin alphanumeric characters based on the current locale.
|
267 |
+
if (!ctype_alnum($c) && strpos('@_-.', $c) === false) {
|
268 |
+
return false;
|
269 |
+
}
|
270 |
+
}
|
271 |
+
|
272 |
+
return true;
|
273 |
+
}
|
274 |
+
|
275 |
/**
|
276 |
* Return php mail extra params to use for invoker->mail.
|
277 |
*
|
283 |
private function _formatExtraParams($extraParams, $reversePath)
|
284 |
{
|
285 |
if (false !== strpos($extraParams, '-f%s')) {
|
286 |
+
if (empty($reversePath) || false === $this->_isShellSafe($reversePath)) {
|
287 |
+
$extraParams = str_replace('-f%s', '', $extraParams);
|
288 |
+
} else {
|
289 |
+
$extraParams = sprintf($extraParams, $reversePath);
|
290 |
+
}
|
291 |
}
|
292 |
|
293 |
return !empty($extraParams) ? $extraParams : null;
|
vendor/swiftmailer/swiftmailer/phpunit.xml.dist
CHANGED
@@ -14,6 +14,7 @@
|
|
14 |
<ini name="intl.default_locale" value="en"/>
|
15 |
<ini name="intl.error_level" value="0"/>
|
16 |
<ini name="memory_limit" value="-1"/>
|
|
|
17 |
</php>
|
18 |
|
19 |
<testsuites>
|
@@ -32,6 +33,7 @@
|
|
32 |
</testsuites>
|
33 |
|
34 |
<listeners>
|
35 |
-
<listener class="
|
|
|
36 |
</listeners>
|
37 |
</phpunit>
|
14 |
<ini name="intl.default_locale" value="en"/>
|
15 |
<ini name="intl.error_level" value="0"/>
|
16 |
<ini name="memory_limit" value="-1"/>
|
17 |
+
<ini name="error_reporting" value="-1" />
|
18 |
</php>
|
19 |
|
20 |
<testsuites>
|
33 |
</testsuites>
|
34 |
|
35 |
<listeners>
|
36 |
+
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
|
37 |
+
<listener class="Mockery\Adapter\Phpunit\TestListener" />
|
38 |
</listeners>
|
39 |
</phpunit>
|
vendor/symfony/polyfill-mbstring/Mbstring.php
CHANGED
@@ -15,6 +15,7 @@ namespace Symfony\Polyfill\Mbstring;
|
|
15 |
* Partial mbstring implementation in PHP, iconv based, UTF-8 centric.
|
16 |
*
|
17 |
* Implemented:
|
|
|
18 |
* - mb_convert_encoding - Convert character encoding
|
19 |
* - mb_convert_variables - Convert character code in variable(s)
|
20 |
* - mb_decode_mimeheader - Decode string in MIME header field
|
@@ -25,7 +26,9 @@ namespace Symfony\Polyfill\Mbstring;
|
|
25 |
* - mb_http_output - Set/Get HTTP output character encoding
|
26 |
* - mb_internal_encoding - Set/Get internal character encoding
|
27 |
* - mb_list_encodings - Returns an array of all supported encodings
|
|
|
28 |
* - mb_output_handler - Callback function converts character encoding in output buffer
|
|
|
29 |
* - mb_strlen - Get string length
|
30 |
* - mb_strpos - Find position of first occurrence of string in a string
|
31 |
* - mb_strrpos - Find position of last occurrence of a string in a string
|
@@ -96,7 +99,7 @@ final class Mbstring
|
|
96 |
$fromEncoding = 'Windows-1252';
|
97 |
}
|
98 |
if ('UTF-8' !== $fromEncoding) {
|
99 |
-
$s = iconv($fromEncoding, 'UTF-8', $s);
|
100 |
}
|
101 |
|
102 |
return preg_replace_callback('/[\x80-\xFF]+/', array(__CLASS__, 'html_encoding_callback'), $s);
|
@@ -107,7 +110,7 @@ final class Mbstring
|
|
107 |
$fromEncoding = 'UTF-8';
|
108 |
}
|
109 |
|
110 |
-
return iconv($fromEncoding, $toEncoding, $s);
|
111 |
}
|
112 |
|
113 |
public static function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null)
|
@@ -145,7 +148,7 @@ final class Mbstring
|
|
145 |
if ('UTF-8' === $encoding) {
|
146 |
$encoding = null;
|
147 |
} else {
|
148 |
-
$s = iconv($encoding, 'UTF-8', $s);
|
149 |
}
|
150 |
|
151 |
if (MB_CASE_TITLE == $mode) {
|
@@ -202,7 +205,7 @@ final class Mbstring
|
|
202 |
return $s;
|
203 |
}
|
204 |
|
205 |
-
return iconv('UTF-8', $encoding, $s);
|
206 |
}
|
207 |
|
208 |
public static function mb_internal_encoding($encoding = null)
|
@@ -333,9 +336,13 @@ final class Mbstring
|
|
333 |
|
334 |
public static function mb_strlen($s, $encoding = null)
|
335 |
{
|
336 |
-
$encoding = self::getEncoding($encoding)
|
|
|
|
|
|
|
|
|
337 |
|
338 |
-
return iconv_strlen($s, $encoding);
|
339 |
}
|
340 |
|
341 |
public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null)
|
@@ -510,7 +517,7 @@ final class Mbstring
|
|
510 |
$encoding = self::getEncoding($encoding);
|
511 |
|
512 |
if ('UTF-8' !== $encoding) {
|
513 |
-
$s = iconv($encoding, 'UTF-8', $s);
|
514 |
}
|
515 |
|
516 |
$s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide);
|
@@ -528,6 +535,45 @@ final class Mbstring
|
|
528 |
return $contents;
|
529 |
}
|
530 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
531 |
private static function getSubpart($pos, $part, $haystack, $encoding)
|
532 |
{
|
533 |
if (false === $pos) {
|
15 |
* Partial mbstring implementation in PHP, iconv based, UTF-8 centric.
|
16 |
*
|
17 |
* Implemented:
|
18 |
+
* - mb_chr - Returns a specific character from its Unicode code point
|
19 |
* - mb_convert_encoding - Convert character encoding
|
20 |
* - mb_convert_variables - Convert character code in variable(s)
|
21 |
* - mb_decode_mimeheader - Decode string in MIME header field
|
26 |
* - mb_http_output - Set/Get HTTP output character encoding
|
27 |
* - mb_internal_encoding - Set/Get internal character encoding
|
28 |
* - mb_list_encodings - Returns an array of all supported encodings
|
29 |
+
* - mb_ord - Returns the Unicode code point of a character
|
30 |
* - mb_output_handler - Callback function converts character encoding in output buffer
|
31 |
+
* - mb_scrub - Replaces ill-formed byte sequences with substitute characters
|
32 |
* - mb_strlen - Get string length
|
33 |
* - mb_strpos - Find position of first occurrence of string in a string
|
34 |
* - mb_strrpos - Find position of last occurrence of a string in a string
|
99 |
$fromEncoding = 'Windows-1252';
|
100 |
}
|
101 |
if ('UTF-8' !== $fromEncoding) {
|
102 |
+
$s = iconv($fromEncoding, 'UTF-8//IGNORE', $s);
|
103 |
}
|
104 |
|
105 |
return preg_replace_callback('/[\x80-\xFF]+/', array(__CLASS__, 'html_encoding_callback'), $s);
|
110 |
$fromEncoding = 'UTF-8';
|
111 |
}
|
112 |
|
113 |
+
return iconv($fromEncoding, $toEncoding.'//IGNORE', $s);
|
114 |
}
|
115 |
|
116 |
public static function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null)
|
148 |
if ('UTF-8' === $encoding) {
|
149 |
$encoding = null;
|
150 |
} else {
|
151 |
+
$s = iconv($encoding, 'UTF-8//IGNORE', $s);
|
152 |
}
|
153 |
|
154 |
if (MB_CASE_TITLE == $mode) {
|
205 |
return $s;
|
206 |
}
|
207 |
|
208 |
+
return iconv('UTF-8', $encoding.'//IGNORE', $s);
|
209 |
}
|
210 |
|
211 |
public static function mb_internal_encoding($encoding = null)
|
336 |
|
337 |
public static function mb_strlen($s, $encoding = null)
|
338 |
{
|
339 |
+
switch ($encoding = self::getEncoding($encoding)) {
|
340 |
+
case 'ASCII':
|
341 |
+
case 'CP850':
|
342 |
+
return strlen($s);
|
343 |
+
}
|
344 |
|
345 |
+
return @iconv_strlen($s, $encoding);
|
346 |
}
|
347 |
|
348 |
public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null)
|
517 |
$encoding = self::getEncoding($encoding);
|
518 |
|
519 |
if ('UTF-8' !== $encoding) {
|
520 |
+
$s = iconv($encoding, 'UTF-8//IGNORE', $s);
|
521 |
}
|
522 |
|
523 |
$s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide);
|
535 |
return $contents;
|
536 |
}
|
537 |
|
538 |
+
public static function mb_chr($code, $encoding = null)
|
539 |
+
{
|
540 |
+
if (0x80 > $code %= 0x200000) {
|
541 |
+
$s = chr($code);
|
542 |
+
} elseif (0x800 > $code) {
|
543 |
+
$s = chr(0xC0 | $code >> 6).chr(0x80 | $code & 0x3F);
|
544 |
+
} elseif (0x10000 > $code) {
|
545 |
+
$s = chr(0xE0 | $code >> 12).chr(0x80 | $code >> 6 & 0x3F).chr(0x80 | $code & 0x3F);
|
546 |
+
} else {
|
547 |
+
$s = chr(0xF0 | $code >> 18).chr(0x80 | $code >> 12 & 0x3F).chr(0x80 | $code >> 6 & 0x3F).chr(0x80 | $code & 0x3F);
|
548 |
+
}
|
549 |
+
|
550 |
+
if ('UTF-8' !== $encoding = self::getEncoding($encoding)) {
|
551 |
+
$s = mb_convert_encoding($s, $encoding, 'UTF-8');
|
552 |
+
}
|
553 |
+
|
554 |
+
return $s;
|
555 |
+
}
|
556 |
+
|
557 |
+
public static function mb_ord($s, $encoding = null)
|
558 |
+
{
|
559 |
+
if ('UTF-8' !== $encoding = self::getEncoding($encoding)) {
|
560 |
+
$s = mb_convert_encoding($s, 'UTF-8', $encoding);
|
561 |
+
}
|
562 |
+
|
563 |
+
$code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0;
|
564 |
+
if (0xF0 <= $code) {
|
565 |
+
return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80;
|
566 |
+
}
|
567 |
+
if (0xE0 <= $code) {
|
568 |
+
return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80;
|
569 |
+
}
|
570 |
+
if (0xC0 <= $code) {
|
571 |
+
return (($code - 0xC0) << 6) + $s[2] - 0x80;
|
572 |
+
}
|
573 |
+
|
574 |
+
return $code;
|
575 |
+
}
|
576 |
+
|
577 |
private static function getSubpart($pos, $part, $haystack, $encoding)
|
578 |
{
|
579 |
if (false === $pos) {
|
vendor/symfony/polyfill-mbstring/bootstrap.php
CHANGED
@@ -47,5 +47,10 @@ if (!function_exists('mb_strlen')) {
|
|
47 |
function mb_substr_count($haystack, $needle, $enc = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $enc); }
|
48 |
function mb_output_handler($contents, $status) { return p\Mbstring::mb_output_handler($contents, $status); }
|
49 |
function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); }
|
50 |
-
function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $
|
|
|
|
|
|
|
|
|
|
|
51 |
}
|
47 |
function mb_substr_count($haystack, $needle, $enc = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $enc); }
|
48 |
function mb_output_handler($contents, $status) { return p\Mbstring::mb_output_handler($contents, $status); }
|
49 |
function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); }
|
50 |
+
function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f); }
|
51 |
+
}
|
52 |
+
if (!function_exists('mb_chr')) {
|
53 |
+
function mb_ord($s, $enc = null) { return p\Mbstring::mb_ord($s, $enc); }
|
54 |
+
function mb_chr($code, $enc = null) { return p\Mbstring::mb_chr($code, $enc); }
|
55 |
+
function mb_scrub($s, $enc = null) { $enc = null === $enc ? mb_internal_encoding() : $enc; return mb_convert_encoding($s, $enc, $enc); }
|
56 |
}
|
vendor/symfony/polyfill-mbstring/composer.json
CHANGED
@@ -28,7 +28,7 @@
|
|
28 |
"minimum-stability": "dev",
|
29 |
"extra": {
|
30 |
"branch-alias": {
|
31 |
-
"dev-master": "1.
|
32 |
}
|
33 |
}
|
34 |
}
|
28 |
"minimum-stability": "dev",
|
29 |
"extra": {
|
30 |
"branch-alias": {
|
31 |
+
"dev-master": "1.3-dev"
|
32 |
}
|
33 |
}
|
34 |
}
|
vendor/symfony/translation/Catalogue/TargetOperation.php
CHANGED
@@ -17,7 +17,7 @@ namespace Symfony\Component\Translation\Catalogue;
|
|
17 |
* all = intersection ∪ (target ∖ intersection) = target
|
18 |
* new = all ∖ source = {x: x ∈ target ∧ x ∉ source}
|
19 |
* obsolete = source ∖ all = source ∖ target = {x: x ∈ source ∧ x ∉ target}
|
20 |
-
* Basically, the result contains messages from the target catalogue.
|
21 |
*
|
22 |
* @author Michael Lee <michael.lee@zerustech.com>
|
23 |
*/
|
@@ -34,12 +34,12 @@ class TargetOperation extends AbstractOperation
|
|
34 |
'obsolete' => array(),
|
35 |
);
|
36 |
|
37 |
-
// For 'all' messages, the code can't be simplified as ``$this->messages[$domain]['all'] = $target->all($domain);``,
|
38 |
// because doing so will drop messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback}
|
39 |
//
|
40 |
// For 'new' messages, the code can't be simplied as ``array_diff_assoc($this->target->all($domain), $this->source->all($domain));``
|
41 |
// because doing so will not exclude messages like {x: x ∈ target ∧ x ∉ source.all ∧ x ∈ source.fallback}
|
42 |
-
//
|
43 |
// For 'obsolete' messages, the code can't be simplifed as ``array_diff_assoc($this->source->all($domain), $this->target->all($domain))``
|
44 |
// because doing so will not exclude messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback}
|
45 |
|
17 |
* all = intersection ∪ (target ∖ intersection) = target
|
18 |
* new = all ∖ source = {x: x ∈ target ∧ x ∉ source}
|
19 |
* obsolete = source ∖ all = source ∖ target = {x: x ∈ source ∧ x ∉ target}
|
20 |
+
* Basically, the result contains messages from the target catalogue.
|
21 |
*
|
22 |
* @author Michael Lee <michael.lee@zerustech.com>
|
23 |
*/
|
34 |
'obsolete' => array(),
|
35 |
);
|
36 |
|
37 |
+
// For 'all' messages, the code can't be simplified as ``$this->messages[$domain]['all'] = $target->all($domain);``,
|
38 |
// because doing so will drop messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback}
|
39 |
//
|
40 |
// For 'new' messages, the code can't be simplied as ``array_diff_assoc($this->target->all($domain), $this->source->all($domain));``
|
41 |
// because doing so will not exclude messages like {x: x ∈ target ∧ x ∉ source.all ∧ x ∈ source.fallback}
|
42 |
+
//
|
43 |
// For 'obsolete' messages, the code can't be simplifed as ``array_diff_assoc($this->source->all($domain), $this->target->all($domain))``
|
44 |
// because doing so will not exclude messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback}
|
45 |
|
vendor/symfony/translation/DataCollectorTranslator.php
CHANGED
@@ -88,6 +88,20 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter
|
|
88 |
return $this->translator->getCatalogue($locale);
|
89 |
}
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
/**
|
92 |
* Passes through all unknown calls onto the translator object.
|
93 |
*/
|
88 |
return $this->translator->getCatalogue($locale);
|
89 |
}
|
90 |
|
91 |
+
/**
|
92 |
+
* Gets the fallback locales.
|
93 |
+
*
|
94 |
+
* @return array $locales The fallback locales
|
95 |
+
*/
|
96 |
+
public function getFallbackLocales()
|
97 |
+
{
|
98 |
+
if ($this->translator instanceof Translator) {
|
99 |
+
return $this->translator->getFallbackLocales();
|
100 |
+
}
|
101 |
+
|
102 |
+
return array();
|
103 |
+
}
|
104 |
+
|
105 |
/**
|
106 |
* Passes through all unknown calls onto the translator object.
|
107 |
*/
|
vendor/symfony/translation/Dumper/IcuResFileDumper.php
CHANGED
@@ -44,7 +44,7 @@ class IcuResFileDumper extends FileDumper
|
|
44 |
|
45 |
foreach ($messages->all($domain) as $source => $target) {
|
46 |
$indexes .= pack('v', strlen($data) + 28);
|
47 |
-
$data
|
48 |
}
|
49 |
|
50 |
$data .= $this->writePadding($data);
|
44 |
|
45 |
foreach ($messages->all($domain) as $source => $target) {
|
46 |
$indexes .= pack('v', strlen($data) + 28);
|
47 |
+
$data .= $source."\0";
|
48 |
}
|
49 |
|
50 |
$data .= $this->writePadding($data);
|
vendor/symfony/translation/LoggingTranslator.php
CHANGED
@@ -88,6 +88,20 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface
|
|
88 |
return $this->translator->getCatalogue($locale);
|
89 |
}
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
/**
|
92 |
* Passes through all unknown calls onto the translator object.
|
93 |
*/
|
88 |
return $this->translator->getCatalogue($locale);
|
89 |
}
|
90 |
|
91 |
+
/**
|
92 |
+
* Gets the fallback locales.
|
93 |
+
*
|
94 |
+
* @return array $locales The fallback locales
|
95 |
+
*/
|
96 |
+
public function getFallbackLocales()
|
97 |
+
{
|
98 |
+
if ($this->translator instanceof Translator) {
|
99 |
+
return $this->translator->getFallbackLocales();
|
100 |
+
}
|
101 |
+
|
102 |
+
return array();
|
103 |
+
}
|
104 |
+
|
105 |
/**
|
106 |
* Passes through all unknown calls onto the translator object.
|
107 |
*/
|
vendor/symfony/translation/MessageCatalogue.php
CHANGED
@@ -178,6 +178,10 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
|
|
178 |
if ($c->getLocale() === $catalogue->getLocale()) {
|
179 |
throw new \LogicException(sprintf('Circular reference detected when adding a fallback catalogue for locale "%s".', $catalogue->getLocale()));
|
180 |
}
|
|
|
|
|
|
|
|
|
181 |
} while ($c = $c->parent);
|
182 |
|
183 |
$catalogue->parent = $this;
|
178 |
if ($c->getLocale() === $catalogue->getLocale()) {
|
179 |
throw new \LogicException(sprintf('Circular reference detected when adding a fallback catalogue for locale "%s".', $catalogue->getLocale()));
|
180 |
}
|
181 |
+
|
182 |
+
foreach ($catalogue->getResources() as $resource) {
|
183 |
+
$c->addResource($resource);
|
184 |
+
}
|
185 |
} while ($c = $c->parent);
|
186 |
|
187 |
$catalogue->parent = $this;
|
vendor/symfony/translation/MessageCatalogueInterface.php
CHANGED
@@ -105,7 +105,7 @@ interface MessageCatalogueInterface
|
|
105 |
*
|
106 |
* The two catalogues must have the same locale.
|
107 |
*
|
108 |
-
* @param
|
109 |
*/
|
110 |
public function addCatalogue(MessageCatalogueInterface $catalogue);
|
111 |
|
@@ -115,14 +115,14 @@ interface MessageCatalogueInterface
|
|
115 |
*
|
116 |
* This is used to provide default translations when they do not exist for the current locale.
|
117 |
*
|
118 |
-
* @param
|
119 |
*/
|
120 |
public function addFallbackCatalogue(MessageCatalogueInterface $catalogue);
|
121 |
|
122 |
/**
|
123 |
* Gets the fallback catalogue.
|
124 |
*
|
125 |
-
* @return
|
126 |
*/
|
127 |
public function getFallbackCatalogue();
|
128 |
|
105 |
*
|
106 |
* The two catalogues must have the same locale.
|
107 |
*
|
108 |
+
* @param self $catalogue
|
109 |
*/
|
110 |
public function addCatalogue(MessageCatalogueInterface $catalogue);
|
111 |
|
115 |
*
|
116 |
* This is used to provide default translations when they do not exist for the current locale.
|
117 |
*
|
118 |
+
* @param self $catalogue
|
119 |
*/
|
120 |
public function addFallbackCatalogue(MessageCatalogueInterface $catalogue);
|
121 |
|
122 |
/**
|
123 |
* Gets the fallback catalogue.
|
124 |
*
|
125 |
+
* @return self|null A MessageCatalogueInterface instance or null when no fallback has been set
|
126 |
*/
|
127 |
public function getFallbackCatalogue();
|
128 |
|
vendor/symfony/translation/Translator.php
CHANGED
@@ -159,7 +159,7 @@ class Translator implements TranslatorInterface, TranslatorBagInterface
|
|
159 |
*
|
160 |
* @throws \InvalidArgumentException If a locale contains invalid characters
|
161 |
*
|
162 |
-
* @deprecated since version 2.3, to be removed in 3.0. Use setFallbackLocales() instead
|
163 |
*/
|
164 |
public function setFallbackLocale($locales)
|
165 |
{
|
@@ -380,9 +380,9 @@ EOF
|
|
380 |
$fallbackSuffix = ucfirst(preg_replace($replacementPattern, '_', $fallback));
|
381 |
$currentSuffix = ucfirst(preg_replace($replacementPattern, '_', $current));
|
382 |
|
383 |
-
$fallbackContent .= sprintf(<<<EOF
|
384 |
-
|
385 |
-
|
386 |
|
387 |
EOF
|
388 |
,
|
@@ -424,7 +424,7 @@ EOF
|
|
424 |
|
425 |
foreach ($this->computeFallbackLocales($locale) as $fallback) {
|
426 |
if (!isset($this->catalogues[$fallback])) {
|
427 |
-
$this->
|
428 |
}
|
429 |
|
430 |
$fallbackCatalogue = new MessageCatalogue($fallback, $this->catalogues[$fallback]->all());
|
159 |
*
|
160 |
* @throws \InvalidArgumentException If a locale contains invalid characters
|
161 |
*
|
162 |
+
* @deprecated since version 2.3, to be removed in 3.0. Use setFallbackLocales() instead
|
163 |
*/
|
164 |
public function setFallbackLocale($locales)
|
165 |
{
|
380 |
$fallbackSuffix = ucfirst(preg_replace($replacementPattern, '_', $fallback));
|
381 |
$currentSuffix = ucfirst(preg_replace($replacementPattern, '_', $current));
|
382 |
|
383 |
+
$fallbackContent .= sprintf(<<<'EOF'
|
384 |
+
$catalogue%s = new MessageCatalogue('%s', %s);
|
385 |
+
$catalogue%s->addFallbackCatalogue($catalogue%s);
|
386 |
|
387 |
EOF
|
388 |
,
|
424 |
|
425 |
foreach ($this->computeFallbackLocales($locale) as $fallback) {
|
426 |
if (!isset($this->catalogues[$fallback])) {
|
427 |
+
$this->loadCatalogue($fallback);
|
428 |
}
|
429 |
|
430 |
$fallbackCatalogue = new MessageCatalogue($fallback, $this->catalogues[$fallback]->all());
|
vendor/twig/twig/.php_cs.dist
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
return PhpCsFixer\Config::create()
|
4 |
+
->setRules(array(
|
5 |
+
'@Symfony' => true,
|
6 |
+
'@Symfony:risky' => true,
|
7 |
+
'array_syntax' => array('syntax' => 'long'),
|
8 |
+
'php_unit_fqcn_annotation' => false,
|
9 |
+
'no_unreachable_default_argument_value' => false,
|
10 |
+
'braces' => array('allow_single_line_closure' => true),
|
11 |
+
'heredoc_to_nowdoc' => false,
|
12 |
+
))
|
13 |
+
->setRiskyAllowed(true)
|
14 |
+
->setFinder(PhpCsFixer\Finder::create()->in(__DIR__))
|
15 |
+
;
|
vendor/twig/twig/.travis.yml
CHANGED
@@ -14,12 +14,16 @@ php:
|
|
14 |
- 5.5
|
15 |
- 5.6
|
16 |
- 7.0
|
|
|
17 |
- hhvm
|
18 |
|
19 |
env:
|
20 |
- TWIG_EXT=no
|
21 |
- TWIG_EXT=yes
|
22 |
|
|
|
|
|
|
|
23 |
install:
|
24 |
# Composer is not available on PHP 5.2
|
25 |
- if [ ${TRAVIS_PHP_VERSION:0:3} != "5.2" ]; then travis_retry composer install; fi
|
@@ -34,6 +38,7 @@ matrix:
|
|
34 |
exclude:
|
35 |
- php: hhvm
|
36 |
env: TWIG_EXT=yes
|
37 |
-
allow_failures:
|
38 |
- php: 7.0
|
39 |
env: TWIG_EXT=yes
|
|
|
|
14 |
- 5.5
|
15 |
- 5.6
|
16 |
- 7.0
|
17 |
+
- 7.1
|
18 |
- hhvm
|
19 |
|
20 |
env:
|
21 |
- TWIG_EXT=no
|
22 |
- TWIG_EXT=yes
|
23 |
|
24 |
+
before_install:
|
25 |
+
- if [[ ! $TRAVIS_PHP_VERSION = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi
|
26 |
+
|
27 |
install:
|
28 |
# Composer is not available on PHP 5.2
|
29 |
- if [ ${TRAVIS_PHP_VERSION:0:3} != "5.2" ]; then travis_retry composer install; fi
|
38 |
exclude:
|
39 |
- php: hhvm
|
40 |
env: TWIG_EXT=yes
|
|
|
41 |
- php: 7.0
|
42 |
env: TWIG_EXT=yes
|
43 |
+
- php: 7.1
|
44 |
+
env: TWIG_EXT=yes
|
vendor/twig/twig/composer.json
CHANGED
@@ -30,7 +30,7 @@
|
|
30 |
"php": ">=5.2.7"
|
31 |
},
|
32 |
"require-dev": {
|
33 |
-
"symfony/phpunit-bridge": "~2
|
34 |
"symfony/debug": "~2.7"
|
35 |
},
|
36 |
"autoload": {
|
@@ -40,7 +40,7 @@
|
|
40 |
},
|
41 |
"extra": {
|
42 |
"branch-alias": {
|
43 |
-
"dev-master": "1.
|
44 |
}
|
45 |
}
|
46 |
}
|
30 |
"php": ">=5.2.7"
|
31 |
},
|
32 |
"require-dev": {
|
33 |
+
"symfony/phpunit-bridge": "~3.2",
|
34 |
"symfony/debug": "~2.7"
|
35 |
},
|
36 |
"autoload": {
|
40 |
},
|
41 |
"extra": {
|
42 |
"branch-alias": {
|
43 |
+
"dev-master": "1.31-dev"
|
44 |
}
|
45 |
}
|
46 |
}
|
vendor/twig/twig/ext/twig/php_twig.h
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
#ifndef PHP_TWIG_H
|
16 |
#define PHP_TWIG_H
|
17 |
|
18 |
-
#define PHP_TWIG_VERSION "1.
|
19 |
|
20 |
#include "php.h"
|
21 |
|
15 |
#ifndef PHP_TWIG_H
|
16 |
#define PHP_TWIG_H
|
17 |
|
18 |
+
#define PHP_TWIG_VERSION "1.31.0"
|
19 |
|
20 |
#include "php.h"
|
21 |
|
vendor/twig/twig/ext/twig/twig.c
CHANGED
@@ -31,6 +31,10 @@
|
|
31 |
#define Z_ADDREF_P(pz) (pz)->refcount++
|
32 |
#endif
|
33 |
|
|
|
|
|
|
|
|
|
34 |
#define FREE_DTOR(z) \
|
35 |
zval_dtor(z); \
|
36 |
efree(z);
|
@@ -987,6 +991,7 @@ PHP_FUNCTION(twig_template_get_attributes)
|
|
987 |
char *lcItem = TWIG_STRTOLOWER(item, item_len);
|
988 |
int lcItem_length;
|
989 |
char *method = NULL;
|
|
|
990 |
char *tmp_method_name_get;
|
991 |
char *tmp_method_name_is;
|
992 |
zval *zmethod;
|
@@ -1000,6 +1005,8 @@ PHP_FUNCTION(twig_template_get_attributes)
|
|
1000 |
sprintf(tmp_method_name_is, "is%s", lcItem);
|
1001 |
|
1002 |
tmp_methods = TWIG_GET_ARRAY_ELEMENT(tmp_class, "methods", strlen("methods") TSRMLS_CC);
|
|
|
|
|
1003 |
|
1004 |
if (TWIG_GET_ARRAY_ELEMENT(tmp_methods, lcItem, lcItem_length TSRMLS_CC)) {
|
1005 |
method = item;
|
@@ -1094,34 +1101,115 @@ PHP_FUNCTION(twig_template_get_attributes)
|
|
1094 |
efree(tmp_method_name_get);
|
1095 |
efree(tmp_method_name_is);
|
1096 |
efree(lcItem);
|
1097 |
-
}
|
1098 |
/*
|
1099 |
-
//
|
1100 |
-
// this is not supported but unfortunately heavily used in the Symfony profiler
|
1101 |
if ($object instanceof Twig_TemplateInterface) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1102 |
return $ret === '' ? '' : new Twig_Markup($ret, $this->env->getCharset());
|
1103 |
}
|
1104 |
|
1105 |
return $ret;
|
1106 |
*/
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1117 |
}
|
1118 |
-
return;
|
1119 |
}
|
1120 |
-
}
|
1121 |
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
|
|
1125 |
}
|
|
|
|
|
1126 |
}
|
1127 |
}
|
31 |
#define Z_ADDREF_P(pz) (pz)->refcount++
|
32 |
#endif
|
33 |
|
34 |
+
#ifndef E_USER_DEPRECATED
|
35 |
+
#define E_USER_DEPRECATED (1<<14L)
|
36 |
+
#endif
|
37 |
+
|
38 |
#define FREE_DTOR(z) \
|
39 |
zval_dtor(z); \
|
40 |
efree(z);
|
991 |
char *lcItem = TWIG_STRTOLOWER(item, item_len);
|
992 |
int lcItem_length;
|
993 |
char *method = NULL;
|
994 |
+
char *methodForDeprecation = NULL;
|
995 |
char *tmp_method_name_get;
|
996 |
char *tmp_method_name_is;
|
997 |
zval *zmethod;
|
1005 |
sprintf(tmp_method_name_is, "is%s", lcItem);
|
1006 |
|
1007 |
tmp_methods = TWIG_GET_ARRAY_ELEMENT(tmp_class, "methods", strlen("methods") TSRMLS_CC);
|
1008 |
+
methodForDeprecation = emalloc(item_len + 1);
|
1009 |
+
sprintf(methodForDeprecation, "%s", item);
|
1010 |
|
1011 |
if (TWIG_GET_ARRAY_ELEMENT(tmp_methods, lcItem, lcItem_length TSRMLS_CC)) {
|
1012 |
method = item;
|
1101 |
efree(tmp_method_name_get);
|
1102 |
efree(tmp_method_name_is);
|
1103 |
efree(lcItem);
|
|
|
1104 |
/*
|
1105 |
+
// @deprecated in 1.28
|
|
|
1106 |
if ($object instanceof Twig_TemplateInterface) {
|
1107 |
+
$self = $object->getTemplateName() === $this->getTemplateName();
|
1108 |
+
$message = sprintf('Calling "%s" on template "%s" from template "%s" is deprecated since version 1.28 and won\'t be supported anymore in 2.0.', $item, $object->getTemplateName(), $this->getTemplateName());
|
1109 |
+
if ('renderBlock' === $method || 'displayBlock' === $method) {
|
1110 |
+
$message .= sprintf(' Use block("%s"%s) instead).', $arguments[0], $self ? '' : ', template');
|
1111 |
+
} elseif ('hasBlock' === $method) {
|
1112 |
+
$message .= sprintf(' Use "block("%s"%s) is defined" instead).', $arguments[0], $self ? '' : ', template');
|
1113 |
+
} elseif ('render' === $method || 'display' === $method) {
|
1114 |
+
$message .= sprintf(' Use include("%s") instead).', $object->getTemplateName());
|
1115 |
+
}
|
1116 |
+
@trigger_error($message, E_USER_DEPRECATED);
|
1117 |
+
|
1118 |
return $ret === '' ? '' : new Twig_Markup($ret, $this->env->getCharset());
|
1119 |
}
|
1120 |
|
1121 |
return $ret;
|
1122 |
*/
|
1123 |
+
efree(item);
|
1124 |
+
// ret can be null, if e.g. the called method throws an exception
|
1125 |
+
if (ret) {
|
1126 |
+
if (TWIG_INSTANCE_OF_USERLAND(object, "Twig_TemplateInterface" TSRMLS_CC)) {
|
1127 |
+
int self;
|
1128 |
+
int old_error_reporting;
|
1129 |
+
zval *object_filename;
|
1130 |
+
zval *this_filename;
|
1131 |
+
zval *filename_func;
|
1132 |
+
char *deprecation_message_complement = NULL;
|
1133 |
+
char *deprecation_message = NULL;
|
1134 |
+
|
1135 |
+
MAKE_STD_ZVAL(object_filename);
|
1136 |
+
MAKE_STD_ZVAL(this_filename);
|
1137 |
+
MAKE_STD_ZVAL(filename_func);
|
1138 |
+
|
1139 |
+
// Get templates names
|
1140 |
+
ZVAL_STRINGL(filename_func, "getTemplateName", sizeof("getTemplateName")-1, 1);
|
1141 |
+
call_user_function(EG(function_table), &object, filename_func, object_filename, 0, 0 TSRMLS_CC);
|
1142 |
+
ZVAL_STRINGL(filename_func, "getTemplateName", sizeof("getTemplateName")-1, 1);
|
1143 |
+
call_user_function(EG(function_table), &template, filename_func, this_filename, 0, 0 TSRMLS_CC);
|
1144 |
+
|
1145 |
+
self = (strcmp(Z_STRVAL_P(object_filename), Z_STRVAL_P(this_filename)) == 0);
|
1146 |
+
|
1147 |
+
if (strcmp(methodForDeprecation, "renderBlock") == 0 || strcmp(methodForDeprecation, "displayBlock") == 0) {
|
1148 |
+
zval **arg0;
|
1149 |
+
zend_hash_index_find(HASH_OF(arguments), 0, (void **) &arg0);
|
1150 |
+
asprintf(
|
1151 |
+
&deprecation_message_complement,
|
1152 |
+
" Use block(\"%s\"%s) instead).",
|
1153 |
+
Z_STRVAL_PP(arg0),
|
1154 |
+
self ? "" : ", template"
|
1155 |
+
);
|
1156 |
+
} else if (strcmp(methodForDeprecation, "hasBlock") == 0) {
|
1157 |
+
zval **arg0;
|
1158 |
+
zend_hash_index_find(HASH_OF(arguments), 0, (void **) &arg0);
|
1159 |
+
asprintf(
|
1160 |
+
&deprecation_message_complement,
|
1161 |
+
" Use \"block(\"%s\"%s) is defined\" instead).",
|
1162 |
+
Z_STRVAL_PP(arg0),
|
1163 |
+
self ? "" : ", template"
|
1164 |
+
);
|
1165 |
+
} else if (strcmp(methodForDeprecation, "render") == 0 || strcmp(methodForDeprecation, "display") == 0) {
|
1166 |
+
asprintf(
|
1167 |
+
&deprecation_message_complement,
|
1168 |
+
" Use include(\"%s\") instead).",
|
1169 |
+
Z_STRVAL_P(object_filename)
|
1170 |
+
);
|
1171 |
+
} else {
|
1172 |
+
deprecation_message_complement = (char*)calloc(0, sizeof(char));
|
1173 |
+
}
|
1174 |
+
|
1175 |
+
asprintf(
|
1176 |
+
&deprecation_message,
|
1177 |
+
"Calling \"%s\" on template \"%s\" from template \"%s\" is deprecated since version 1.28 and won't be supported anymore in 2.0.%s",
|
1178 |
+
methodForDeprecation,
|
1179 |
+
Z_STRVAL_P(object_filename),
|
1180 |
+
Z_STRVAL_P(this_filename),
|
1181 |
+
deprecation_message_complement
|
1182 |
+
);
|
1183 |
+
|
1184 |
+
old_error_reporting = EG(error_reporting);
|
1185 |
+
EG(error_reporting) = 0;
|
1186 |
+
zend_error(E_USER_DEPRECATED, "%s", deprecation_message);
|
1187 |
+
EG(error_reporting) = old_error_reporting;
|
1188 |
+
|
1189 |
+
FREE_DTOR(filename_func)
|
1190 |
+
FREE_DTOR(object_filename)
|
1191 |
+
FREE_DTOR(this_filename)
|
1192 |
+
free(deprecation_message);
|
1193 |
+
free(deprecation_message_complement);
|
1194 |
+
|
1195 |
+
if (Z_STRLEN_P(ret) != 0) {
|
1196 |
+
zval *charset = TWIG_CALL_USER_FUNC_ARRAY(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "getCharset", NULL TSRMLS_CC);
|
1197 |
+
TWIG_NEW(return_value, "Twig_Markup", ret, charset TSRMLS_CC);
|
1198 |
+
zval_ptr_dtor(&charset);
|
1199 |
+
if (ret) {
|
1200 |
+
zval_ptr_dtor(&ret);
|
1201 |
+
}
|
1202 |
+
efree(methodForDeprecation);
|
1203 |
+
return;
|
1204 |
}
|
|
|
1205 |
}
|
|
|
1206 |
|
1207 |
+
RETVAL_ZVAL(ret, 1, 0);
|
1208 |
+
if (free_ret) {
|
1209 |
+
zval_ptr_dtor(&ret);
|
1210 |
+
}
|
1211 |
}
|
1212 |
+
|
1213 |
+
efree(methodForDeprecation);
|
1214 |
}
|
1215 |
}
|
vendor/twig/twig/lib/Twig/Autoloader.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -23,7 +23,7 @@ class Twig_Autoloader
|
|
23 |
/**
|
24 |
* Registers Twig_Autoloader as an SPL autoloader.
|
25 |
*
|
26 |
-
* @param bool $prepend
|
27 |
*/
|
28 |
public static function register($prepend = false)
|
29 |
{
|
@@ -39,7 +39,7 @@ class Twig_Autoloader
|
|
39 |
/**
|
40 |
* Handles autoloading of classes.
|
41 |
*
|
42 |
-
* @param string $class
|
43 |
*/
|
44 |
public static function autoload($class)
|
45 |
{
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
23 |
/**
|
24 |
* Registers Twig_Autoloader as an SPL autoloader.
|
25 |
*
|
26 |
+
* @param bool $prepend whether to prepend the autoloader or not
|
27 |
*/
|
28 |
public static function register($prepend = false)
|
29 |
{
|
39 |
/**
|
40 |
* Handles autoloading of classes.
|
41 |
*
|
42 |
+
* @param string $class a class name
|
43 |
*/
|
44 |
public static function autoload($class)
|
45 |
{
|
vendor/twig/twig/lib/Twig/BaseNodeVisitor.php
CHANGED
@@ -16,9 +16,6 @@
|
|
16 |
*/
|
17 |
abstract class Twig_BaseNodeVisitor implements Twig_NodeVisitorInterface
|
18 |
{
|
19 |
-
/**
|
20 |
-
* {@inheritdoc}
|
21 |
-
*/
|
22 |
final public function enterNode(Twig_NodeInterface $node, Twig_Environment $env)
|
23 |
{
|
24 |
if (!$node instanceof Twig_Node) {
|
@@ -28,9 +25,6 @@ abstract class Twig_BaseNodeVisitor implements Twig_NodeVisitorInterface
|
|
28 |
return $this->doEnterNode($node, $env);
|
29 |
}
|
30 |
|
31 |
-
/**
|
32 |
-
* {@inheritdoc}
|
33 |
-
*/
|
34 |
final public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env)
|
35 |
{
|
36 |
if (!$node instanceof Twig_Node) {
|
@@ -43,9 +37,6 @@ abstract class Twig_BaseNodeVisitor implements Twig_NodeVisitorInterface
|
|
43 |
/**
|
44 |
* Called before child nodes are visited.
|
45 |
*
|
46 |
-
* @param Twig_Node $node The node to visit
|
47 |
-
* @param Twig_Environment $env The Twig environment instance
|
48 |
-
*
|
49 |
* @return Twig_Node The modified node
|
50 |
*/
|
51 |
abstract protected function doEnterNode(Twig_Node $node, Twig_Environment $env);
|
@@ -53,9 +44,6 @@ abstract class Twig_BaseNodeVisitor implements Twig_NodeVisitorInterface
|
|
53 |
/**
|
54 |
* Called after child nodes are visited.
|
55 |
*
|
56 |
-
* @param Twig_Node $node The node to visit
|
57 |
-
* @param Twig_Environment $env The Twig environment instance
|
58 |
-
*
|
59 |
* @return Twig_Node|false The modified node or false if the node must be removed
|
60 |
*/
|
61 |
abstract protected function doLeaveNode(Twig_Node $node, Twig_Environment $env);
|
16 |
*/
|
17 |
abstract class Twig_BaseNodeVisitor implements Twig_NodeVisitorInterface
|
18 |
{
|
|
|
|
|
|
|
19 |
final public function enterNode(Twig_NodeInterface $node, Twig_Environment $env)
|
20 |
{
|
21 |
if (!$node instanceof Twig_Node) {
|
25 |
return $this->doEnterNode($node, $env);
|
26 |
}
|
27 |
|
|
|
|
|
|
|
28 |
final public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env)
|
29 |
{
|
30 |
if (!$node instanceof Twig_Node) {
|
37 |
/**
|
38 |
* Called before child nodes are visited.
|
39 |
*
|
|
|
|
|
|
|
40 |
* @return Twig_Node The modified node
|
41 |
*/
|
42 |
abstract protected function doEnterNode(Twig_Node $node, Twig_Environment $env);
|
44 |
/**
|
45 |
* Called after child nodes are visited.
|
46 |
*
|
|
|
|
|
|
|
47 |
* @return Twig_Node|false The modified node or false if the node must be removed
|
48 |
*/
|
49 |
abstract protected function doLeaveNode(Twig_Node $node, Twig_Environment $env);
|
vendor/twig/twig/lib/Twig/Cache/Filesystem.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -31,9 +31,6 @@ class Twig_Cache_Filesystem implements Twig_CacheInterface
|
|
31 |
$this->options = $options;
|
32 |
}
|
33 |
|
34 |
-
/**
|
35 |
-
* {@inheritdoc}
|
36 |
-
*/
|
37 |
public function generateKey($name, $className)
|
38 |
{
|
39 |
$hash = hash('sha256', $className);
|
@@ -41,9 +38,6 @@ class Twig_Cache_Filesystem implements Twig_CacheInterface
|
|
41 |
return $this->directory.$hash[0].$hash[1].'/'.$hash.'.php';
|
42 |
}
|
43 |
|
44 |
-
/**
|
45 |
-
* {@inheritdoc}
|
46 |
-
*/
|
47 |
public function load($key)
|
48 |
{
|
49 |
if (file_exists($key)) {
|
@@ -51,9 +45,6 @@ class Twig_Cache_Filesystem implements Twig_CacheInterface
|
|
51 |
}
|
52 |
}
|
53 |
|
54 |
-
/**
|
55 |
-
* {@inheritdoc}
|
56 |
-
*/
|
57 |
public function write($key, $content)
|
58 |
{
|
59 |
$dir = dirname($key);
|
@@ -84,9 +75,6 @@ class Twig_Cache_Filesystem implements Twig_CacheInterface
|
|
84 |
throw new RuntimeException(sprintf('Failed to write cache file "%s".', $key));
|
85 |
}
|
86 |
|
87 |
-
/**
|
88 |
-
* {@inheritdoc}
|
89 |
-
*/
|
90 |
public function getTimestamp($key)
|
91 |
{
|
92 |
if (!file_exists($key)) {
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
31 |
$this->options = $options;
|
32 |
}
|
33 |
|
|
|
|
|
|
|
34 |
public function generateKey($name, $className)
|
35 |
{
|
36 |
$hash = hash('sha256', $className);
|
38 |
return $this->directory.$hash[0].$hash[1].'/'.$hash.'.php';
|
39 |
}
|
40 |
|
|
|
|
|
|
|
41 |
public function load($key)
|
42 |
{
|
43 |
if (file_exists($key)) {
|
45 |
}
|
46 |
}
|
47 |
|
|
|
|
|
|
|
48 |
public function write($key, $content)
|
49 |
{
|
50 |
$dir = dirname($key);
|
75 |
throw new RuntimeException(sprintf('Failed to write cache file "%s".', $key));
|
76 |
}
|
77 |
|
|
|
|
|
|
|
78 |
public function getTimestamp($key)
|
79 |
{
|
80 |
if (!file_exists($key)) {
|
vendor/twig/twig/lib/Twig/Cache/Null.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -12,35 +12,25 @@
|
|
12 |
/**
|
13 |
* Implements a no-cache strategy.
|
14 |
*
|
|
|
|
|
15 |
* @author Fabien Potencier <fabien@symfony.com>
|
16 |
*/
|
17 |
class Twig_Cache_Null implements Twig_CacheInterface
|
18 |
{
|
19 |
-
/**
|
20 |
-
* {@inheritdoc}
|
21 |
-
*/
|
22 |
public function generateKey($name, $className)
|
23 |
{
|
24 |
return '';
|
25 |
}
|
26 |
|
27 |
-
/**
|
28 |
-
* {@inheritdoc}
|
29 |
-
*/
|
30 |
public function write($key, $content)
|
31 |
{
|
32 |
}
|
33 |
|
34 |
-
/**
|
35 |
-
* {@inheritdoc}
|
36 |
-
*/
|
37 |
public function load($key)
|
38 |
{
|
39 |
}
|
40 |
|
41 |
-
/**
|
42 |
-
* {@inheritdoc}
|
43 |
-
*/
|
44 |
public function getTimestamp($key)
|
45 |
{
|
46 |
return 0;
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
12 |
/**
|
13 |
* Implements a no-cache strategy.
|
14 |
*
|
15 |
+
* @final
|
16 |
+
*
|
17 |
* @author Fabien Potencier <fabien@symfony.com>
|
18 |
*/
|
19 |
class Twig_Cache_Null implements Twig_CacheInterface
|
20 |
{
|
|
|
|
|
|
|
21 |
public function generateKey($name, $className)
|
22 |
{
|
23 |
return '';
|
24 |
}
|
25 |
|
|
|
|
|
|
|
26 |
public function write($key, $content)
|
27 |
{
|
28 |
}
|
29 |
|
|
|
|
|
|
|
30 |
public function load($key)
|
31 |
{
|
32 |
}
|
33 |
|
|
|
|
|
|
|
34 |
public function getTimestamp($key)
|
35 |
{
|
36 |
return 0;
|
vendor/twig/twig/lib/Twig/CacheInterface.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Compiler.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
@@ -26,11 +26,6 @@ class Twig_Compiler implements Twig_CompilerInterface
|
|
26 |
protected $sourceLine;
|
27 |
protected $filename;
|
28 |
|
29 |
-
/**
|
30 |
-
* Constructor.
|
31 |
-
*
|
32 |
-
* @param Twig_Environment $env The twig environment instance
|
33 |
-
*/
|
34 |
public function __construct(Twig_Environment $env)
|
35 |
{
|
36 |
$this->env = $env;
|
@@ -49,7 +44,7 @@ class Twig_Compiler implements Twig_CompilerInterface
|
|
49 |
/**
|
50 |
* Returns the environment instance related to this compiler.
|
51 |
*
|
52 |
-
* @return Twig_Environment
|
53 |
*/
|
54 |
public function getEnvironment()
|
55 |
{
|
@@ -72,7 +67,7 @@ class Twig_Compiler implements Twig_CompilerInterface
|
|
72 |
* @param Twig_NodeInterface $node The node to compile
|
73 |
* @param int $indentation The current indentation
|
74 |
*
|
75 |
-
* @return
|
76 |
*/
|
77 |
public function compile(Twig_NodeInterface $node, $indentation = 0)
|
78 |
{
|
@@ -110,7 +105,7 @@ class Twig_Compiler implements Twig_CompilerInterface
|
|
110 |
*
|
111 |
* @param string $string The string
|
112 |
*
|
113 |
-
* @return
|
114 |
*/
|
115 |
public function raw($string)
|
116 |
{
|
@@ -122,7 +117,7 @@ class Twig_Compiler implements Twig_CompilerInterface
|
|
122 |
/**
|
123 |
* Writes a string to the compiled code by adding indentation.
|
124 |
*
|
125 |
-
* @return
|
126 |
*/
|
127 |
public function write()
|
128 |
{
|
@@ -137,7 +132,7 @@ class Twig_Compiler implements Twig_CompilerInterface
|
|
137 |
/**
|
138 |
* Appends an indentation to the current PHP code after compilation.
|
139 |
*
|
140 |
-
* @return
|
141 |
*
|
142 |
* @deprecated since 1.27 (to be removed in 2.0).
|
143 |
*/
|
@@ -155,7 +150,7 @@ class Twig_Compiler implements Twig_CompilerInterface
|
|
155 |
*
|
156 |
* @param string $value The string
|
157 |
*
|
158 |
-
* @return
|
159 |
*/
|
160 |
public function string($value)
|
161 |
{
|
@@ -169,7 +164,7 @@ class Twig_Compiler implements Twig_CompilerInterface
|
|
169 |
*
|
170 |
* @param mixed $value The value to convert
|
171 |
*
|
172 |
-
* @return
|
173 |
*/
|
174 |
public function repr($value)
|
175 |
{
|
@@ -210,9 +205,7 @@ class Twig_Compiler implements Twig_CompilerInterface
|
|
210 |
/**
|
211 |
* Adds debugging information.
|
212 |
*
|
213 |
-
* @
|
214 |
-
*
|
215 |
-
* @return Twig_Compiler The current compiler instance
|
216 |
*/
|
217 |
public function addDebugInfo(Twig_NodeInterface $node)
|
218 |
{
|
@@ -223,6 +216,8 @@ class Twig_Compiler implements Twig_CompilerInterface
|
|
223 |
// mb_substr_count() replaces substr_count()
|
224 |
// but they have different signatures!
|
225 |
if (((int) ini_get('mbstring.func_overload')) & 2) {
|
|
|
|
|
226 |
// this is much slower than the "right" version
|
227 |
$this->sourceLine += mb_substr_count(mb_substr($this->source, $this->sourceOffset), "\n");
|
228 |
} else {
|
@@ -249,7 +244,7 @@ class Twig_Compiler implements Twig_CompilerInterface
|
|
249 |
*
|
250 |
* @param int $step The number of indentation to add
|
251 |
*
|
252 |
-
* @return
|
253 |
*/
|
254 |
public function indent($step = 1)
|
255 |
{
|
@@ -263,7 +258,7 @@ class Twig_Compiler implements Twig_CompilerInterface
|
|
263 |
*
|
264 |
* @param int $step The number of indentation to remove
|
265 |
*
|
266 |
-
* @return
|
267 |
*
|
268 |
* @throws LogicException When trying to outdent too much so the indentation would become negative
|
269 |
*/
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
26 |
protected $sourceLine;
|
27 |
protected $filename;
|
28 |
|
|
|
|
|
|
|
|
|
|
|
29 |
public function __construct(Twig_Environment $env)
|
30 |
{
|
31 |
$this->env = $env;
|
44 |
/**
|
45 |
* Returns the environment instance related to this compiler.
|
46 |
*
|
47 |
+
* @return Twig_Environment
|
48 |
*/
|
49 |
public function getEnvironment()
|
50 |
{
|
67 |
* @param Twig_NodeInterface $node The node to compile
|
68 |
* @param int $indentation The current indentation
|
69 |
*
|
70 |
+
* @return $this
|
71 |
*/
|
72 |
public function compile(Twig_NodeInterface $node, $indentation = 0)
|
73 |
{
|
105 |
*
|
106 |
* @param string $string The string
|
107 |
*
|
108 |
+
* @return $this
|
109 |
*/
|
110 |
public function raw($string)
|
111 |
{
|
117 |
/**
|
118 |
* Writes a string to the compiled code by adding indentation.
|
119 |
*
|
120 |
+
* @return $this
|
121 |
*/
|
122 |
public function write()
|
123 |
{
|
132 |
/**
|
133 |
* Appends an indentation to the current PHP code after compilation.
|
134 |
*
|
135 |
+
* @return $this
|
136 |
*
|
137 |
* @deprecated since 1.27 (to be removed in 2.0).
|
138 |
*/
|
150 |
*
|
151 |
* @param string $value The string
|
152 |
*
|
153 |
+
* @return $this
|
154 |
*/
|
155 |
public function string($value)
|
156 |
{
|
164 |
*
|
165 |
* @param mixed $value The value to convert
|
166 |
*
|
167 |
+
* @return $this
|
168 |
*/
|
169 |
public function repr($value)
|
170 |
{
|
205 |
/**
|
206 |
* Adds debugging information.
|
207 |
*
|
208 |
+
* @return $this
|
|
|
|
|
209 |
*/
|
210 |
public function addDebugInfo(Twig_NodeInterface $node)
|
211 |
{
|
216 |
// mb_substr_count() replaces substr_count()
|
217 |
// but they have different signatures!
|
218 |
if (((int) ini_get('mbstring.func_overload')) & 2) {
|
219 |
+
@trigger_error('Support for having "mbstring.func_overload" different from 0 is deprecated version 1.29 and will be removed in 2.0.', E_USER_DEPRECATED);
|
220 |
+
|
221 |
// this is much slower than the "right" version
|
222 |
$this->sourceLine += mb_substr_count(mb_substr($this->source, $this->sourceOffset), "\n");
|
223 |
} else {
|
244 |
*
|
245 |
* @param int $step The number of indentation to add
|
246 |
*
|
247 |
+
* @return $this
|
248 |
*/
|
249 |
public function indent($step = 1)
|
250 |
{
|
258 |
*
|
259 |
* @param int $step The number of indentation to remove
|
260 |
*
|
261 |
+
* @return $this
|
262 |
*
|
263 |
* @throws LogicException When trying to outdent too much so the indentation would become negative
|
264 |
*/
|
vendor/twig/twig/lib/Twig/CompilerInterface.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -21,9 +21,7 @@ interface Twig_CompilerInterface
|
|
21 |
/**
|
22 |
* Compiles a node.
|
23 |
*
|
24 |
-
* @
|
25 |
-
*
|
26 |
-
* @return Twig_CompilerInterface The current compiler instance
|
27 |
*/
|
28 |
public function compile(Twig_NodeInterface $node);
|
29 |
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
21 |
/**
|
22 |
* Compiles a node.
|
23 |
*
|
24 |
+
* @return $this
|
|
|
|
|
25 |
*/
|
26 |
public function compile(Twig_NodeInterface $node);
|
27 |
|
vendor/twig/twig/lib/Twig/Environment.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -16,7 +16,12 @@
|
|
16 |
*/
|
17 |
class Twig_Environment
|
18 |
{
|
19 |
-
const VERSION = '1.
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
protected $charset;
|
22 |
protected $loader;
|
@@ -89,7 +94,7 @@ class Twig_Environment
|
|
89 |
* (default to -1 which means that all optimizations are enabled;
|
90 |
* set it to 0 to disable).
|
91 |
*
|
92 |
-
* @param Twig_LoaderInterface $loader
|
93 |
* @param array $options An array of options
|
94 |
*/
|
95 |
public function __construct(Twig_LoaderInterface $loader = null, $options = array())
|
@@ -373,19 +378,48 @@ class Twig_Environment
|
|
373 |
}
|
374 |
|
375 |
/**
|
376 |
-
* Loads a template
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
377 |
*
|
378 |
* @param string $name The template name
|
379 |
* @param int $index The index if it is an embedded template
|
380 |
*
|
381 |
* @return Twig_TemplateInterface A template instance representing the given template name
|
382 |
*
|
383 |
-
* @throws Twig_Error_Loader
|
384 |
-
* @throws
|
|
|
|
|
|
|
385 |
*/
|
386 |
public function loadTemplate($name, $index = null)
|
387 |
{
|
388 |
-
$cls = $this->getTemplateClass($name
|
|
|
|
|
|
|
389 |
|
390 |
if (isset($this->loadedTemplates[$cls])) {
|
391 |
return $this->loadedTemplates[$cls];
|
@@ -395,7 +429,7 @@ class Twig_Environment
|
|
395 |
if ($this->bcGetCacheFilename) {
|
396 |
$key = $this->getCacheFilename($name);
|
397 |
} else {
|
398 |
-
$key = $this->cache->generateKey($name, $
|
399 |
}
|
400 |
|
401 |
if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
|
@@ -416,9 +450,21 @@ class Twig_Environment
|
|
416 |
$this->writeCacheFile($key, $content);
|
417 |
} else {
|
418 |
$this->cache->write($key, $content);
|
|
|
419 |
}
|
420 |
|
421 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
422 |
}
|
423 |
}
|
424 |
|
@@ -563,7 +609,7 @@ class Twig_Environment
|
|
563 |
/**
|
564 |
* Gets the Lexer instance.
|
565 |
*
|
566 |
-
* @return Twig_LexerInterface
|
567 |
*
|
568 |
* @deprecated since 1.25 (to be removed in 2.0)
|
569 |
*/
|
@@ -578,11 +624,6 @@ class Twig_Environment
|
|
578 |
return $this->lexer;
|
579 |
}
|
580 |
|
581 |
-
/**
|
582 |
-
* Sets the Lexer instance.
|
583 |
-
*
|
584 |
-
* @param Twig_LexerInterface $lexer A Twig_LexerInterface instance
|
585 |
-
*/
|
586 |
public function setLexer(Twig_LexerInterface $lexer)
|
587 |
{
|
588 |
$this->lexer = $lexer;
|
@@ -594,7 +635,7 @@ class Twig_Environment
|
|
594 |
* @param string|Twig_Source $source The template source code
|
595 |
* @param string $name The template name (deprecated)
|
596 |
*
|
597 |
-
* @return Twig_TokenStream
|
598 |
*
|
599 |
* @throws Twig_Error_Syntax When the code is syntactically wrong
|
600 |
*/
|
@@ -615,7 +656,7 @@ class Twig_Environment
|
|
615 |
/**
|
616 |
* Gets the Parser instance.
|
617 |
*
|
618 |
-
* @return Twig_ParserInterface
|
619 |
*
|
620 |
* @deprecated since 1.25 (to be removed in 2.0)
|
621 |
*/
|
@@ -630,11 +671,6 @@ class Twig_Environment
|
|
630 |
return $this->parser;
|
631 |
}
|
632 |
|
633 |
-
/**
|
634 |
-
* Sets the Parser instance.
|
635 |
-
*
|
636 |
-
* @param Twig_ParserInterface $parser A Twig_ParserInterface instance
|
637 |
-
*/
|
638 |
public function setParser(Twig_ParserInterface $parser)
|
639 |
{
|
640 |
$this->parser = $parser;
|
@@ -643,9 +679,7 @@ class Twig_Environment
|
|
643 |
/**
|
644 |
* Converts a token stream to a node tree.
|
645 |
*
|
646 |
-
* @
|
647 |
-
*
|
648 |
-
* @return Twig_Node_Module A node tree
|
649 |
*
|
650 |
* @throws Twig_Error_Syntax When the token stream is syntactically or semantically wrong
|
651 |
*/
|
@@ -661,7 +695,7 @@ class Twig_Environment
|
|
661 |
/**
|
662 |
* Gets the Compiler instance.
|
663 |
*
|
664 |
-
* @return Twig_CompilerInterface
|
665 |
*
|
666 |
* @deprecated since 1.25 (to be removed in 2.0)
|
667 |
*/
|
@@ -676,11 +710,6 @@ class Twig_Environment
|
|
676 |
return $this->compiler;
|
677 |
}
|
678 |
|
679 |
-
/**
|
680 |
-
* Sets the Compiler instance.
|
681 |
-
*
|
682 |
-
* @param Twig_CompilerInterface $compiler A Twig_CompilerInterface instance
|
683 |
-
*/
|
684 |
public function setCompiler(Twig_CompilerInterface $compiler)
|
685 |
{
|
686 |
$this->compiler = $compiler;
|
@@ -689,8 +718,6 @@ class Twig_Environment
|
|
689 |
/**
|
690 |
* Compiles a node and returns the PHP code.
|
691 |
*
|
692 |
-
* @param Twig_NodeInterface $node A Twig_NodeInterface instance
|
693 |
-
*
|
694 |
* @return string The compiled PHP source code
|
695 |
*/
|
696 |
public function compile(Twig_NodeInterface $node)
|
@@ -722,18 +749,13 @@ class Twig_Environment
|
|
722 |
try {
|
723 |
return $this->compile($this->parse($this->tokenize($source)));
|
724 |
} catch (Twig_Error $e) {
|
725 |
-
$e->
|
726 |
throw $e;
|
727 |
} catch (Exception $e) {
|
728 |
-
throw new Twig_Error_Syntax(sprintf('An exception has been thrown during the compilation of a template ("%s").', $e->getMessage()), -1, $source
|
729 |
}
|
730 |
}
|
731 |
|
732 |
-
/**
|
733 |
-
* Sets the Loader instance.
|
734 |
-
*
|
735 |
-
* @param Twig_LoaderInterface $loader A Twig_LoaderInterface instance
|
736 |
-
*/
|
737 |
public function setLoader(Twig_LoaderInterface $loader)
|
738 |
{
|
739 |
if (!$loader instanceof Twig_SourceContextLoaderInterface && 0 !== strpos(get_class($loader), 'Mock_Twig_LoaderInterface')) {
|
@@ -746,7 +768,7 @@ class Twig_Environment
|
|
746 |
/**
|
747 |
* Gets the Loader instance.
|
748 |
*
|
749 |
-
* @return Twig_LoaderInterface
|
750 |
*/
|
751 |
public function getLoader()
|
752 |
{
|
@@ -817,7 +839,7 @@ class Twig_Environment
|
|
817 |
return true;
|
818 |
}
|
819 |
|
820 |
-
return isset($this->extensionsByClass[
|
821 |
}
|
822 |
|
823 |
/**
|
@@ -833,7 +855,7 @@ class Twig_Environment
|
|
833 |
*
|
834 |
* @param string $class The extension class name
|
835 |
*
|
836 |
-
* @return Twig_ExtensionInterface
|
837 |
*/
|
838 |
public function getExtension($class)
|
839 |
{
|
@@ -878,11 +900,6 @@ class Twig_Environment
|
|
878 |
throw new Twig_Error_Runtime(sprintf('Unable to load the "%s" runtime.', $class));
|
879 |
}
|
880 |
|
881 |
-
/**
|
882 |
-
* Registers an extension.
|
883 |
-
*
|
884 |
-
* @param Twig_ExtensionInterface $extension A Twig_ExtensionInterface instance
|
885 |
-
*/
|
886 |
public function addExtension(Twig_ExtensionInterface $extension)
|
887 |
{
|
888 |
if ($this->extensionInitialized) {
|
@@ -955,11 +972,6 @@ class Twig_Environment
|
|
955 |
return $this->extensions;
|
956 |
}
|
957 |
|
958 |
-
/**
|
959 |
-
* Registers a Token Parser.
|
960 |
-
*
|
961 |
-
* @param Twig_TokenParserInterface $parser A Twig_TokenParserInterface instance
|
962 |
-
*/
|
963 |
public function addTokenParser(Twig_TokenParserInterface $parser)
|
964 |
{
|
965 |
if ($this->extensionInitialized) {
|
@@ -972,7 +984,7 @@ class Twig_Environment
|
|
972 |
/**
|
973 |
* Gets the registered Token Parsers.
|
974 |
*
|
975 |
-
* @return Twig_TokenParserBrokerInterface
|
976 |
*
|
977 |
* @internal
|
978 |
*/
|
@@ -990,7 +1002,7 @@ class Twig_Environment
|
|
990 |
*
|
991 |
* Be warned that this method cannot return tags defined by Twig_TokenParserBrokerInterface classes.
|
992 |
*
|
993 |
-
* @return Twig_TokenParserInterface[]
|
994 |
*
|
995 |
* @internal
|
996 |
*/
|
@@ -1006,11 +1018,6 @@ class Twig_Environment
|
|
1006 |
return $tags;
|
1007 |
}
|
1008 |
|
1009 |
-
/**
|
1010 |
-
* Registers a Node Visitor.
|
1011 |
-
*
|
1012 |
-
* @param Twig_NodeVisitorInterface $visitor A Twig_NodeVisitorInterface instance
|
1013 |
-
*/
|
1014 |
public function addNodeVisitor(Twig_NodeVisitorInterface $visitor)
|
1015 |
{
|
1016 |
if ($this->extensionInitialized) {
|
@@ -1023,7 +1030,7 @@ class Twig_Environment
|
|
1023 |
/**
|
1024 |
* Gets the registered Node Visitors.
|
1025 |
*
|
1026 |
-
* @return Twig_NodeVisitorInterface[]
|
1027 |
*
|
1028 |
* @internal
|
1029 |
*/
|
@@ -1040,7 +1047,7 @@ class Twig_Environment
|
|
1040 |
* Registers a Filter.
|
1041 |
*
|
1042 |
* @param string|Twig_SimpleFilter $name The filter name or a Twig_SimpleFilter instance
|
1043 |
-
* @param Twig_FilterInterface|Twig_SimpleFilter $filter
|
1044 |
*/
|
1045 |
public function addFilter($name, $filter = null)
|
1046 |
{
|
@@ -1116,7 +1123,7 @@ class Twig_Environment
|
|
1116 |
*
|
1117 |
* Be warned that this method cannot return filters defined with registerUndefinedFilterCallback.
|
1118 |
*
|
1119 |
-
* @return Twig_FilterInterface[]
|
1120 |
*
|
1121 |
* @see registerUndefinedFilterCallback
|
1122 |
*
|
@@ -1160,7 +1167,7 @@ class Twig_Environment
|
|
1160 |
/**
|
1161 |
* Gets the registered Tests.
|
1162 |
*
|
1163 |
-
* @return Twig_TestInterface[]
|
1164 |
*
|
1165 |
* @internal
|
1166 |
*/
|
@@ -1199,7 +1206,7 @@ class Twig_Environment
|
|
1199 |
* Registers a Function.
|
1200 |
*
|
1201 |
* @param string|Twig_SimpleFunction $name The function name or a Twig_SimpleFunction instance
|
1202 |
-
* @param Twig_FunctionInterface|Twig_SimpleFunction $function
|
1203 |
*/
|
1204 |
public function addFunction($name, $function = null)
|
1205 |
{
|
@@ -1275,7 +1282,7 @@ class Twig_Environment
|
|
1275 |
*
|
1276 |
* Be warned that this method cannot return functions defined with registerUndefinedFunctionCallback.
|
1277 |
*
|
1278 |
-
* @return Twig_FunctionInterface[]
|
1279 |
*
|
1280 |
* @see registerUndefinedFunctionCallback
|
1281 |
*
|
@@ -1440,7 +1447,6 @@ class Twig_Environment
|
|
1440 |
return;
|
1441 |
}
|
1442 |
|
1443 |
-
$this->extensionInitialized = true;
|
1444 |
$this->parsers = new Twig_TokenParserBroker(array(), array(), false);
|
1445 |
$this->filters = array();
|
1446 |
$this->functions = array();
|
@@ -1453,6 +1459,8 @@ class Twig_Environment
|
|
1453 |
$this->initExtension($extension);
|
1454 |
}
|
1455 |
$this->initExtension($this->staging);
|
|
|
|
|
1456 |
}
|
1457 |
|
1458 |
/**
|
@@ -1513,8 +1521,12 @@ class Twig_Environment
|
|
1513 |
|
1514 |
// operators
|
1515 |
if ($operators = $extension->getOperators()) {
|
|
|
|
|
|
|
|
|
1516 |
if (2 !== count($operators)) {
|
1517 |
-
throw new InvalidArgumentException(sprintf('"%s::getOperators()"
|
1518 |
}
|
1519 |
|
1520 |
$this->unaryOperators = array_merge($this->unaryOperators, $operators[0]);
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
16 |
*/
|
17 |
class Twig_Environment
|
18 |
{
|
19 |
+
const VERSION = '1.31.0';
|
20 |
+
const VERSION_ID = 13100;
|
21 |
+
const MAJOR_VERSION = 1;
|
22 |
+
const MINOR_VERSION = 31;
|
23 |
+
const RELEASE_VERSION = 0;
|
24 |
+
const EXTRA_VERSION = '';
|
25 |
|
26 |
protected $charset;
|
27 |
protected $loader;
|
94 |
* (default to -1 which means that all optimizations are enabled;
|
95 |
* set it to 0 to disable).
|
96 |
*
|
97 |
+
* @param Twig_LoaderInterface $loader
|
98 |
* @param array $options An array of options
|
99 |
*/
|
100 |
public function __construct(Twig_LoaderInterface $loader = null, $options = array())
|
378 |
}
|
379 |
|
380 |
/**
|
381 |
+
* Loads a template.
|
382 |
+
*
|
383 |
+
* @param string|Twig_TemplateWrapper|Twig_Template $name The template name
|
384 |
+
*
|
385 |
+
* @return Twig_TemplateWrapper
|
386 |
+
*/
|
387 |
+
public function load($name)
|
388 |
+
{
|
389 |
+
if ($name instanceof Twig_TemplateWrapper) {
|
390 |
+
return $name;
|
391 |
+
}
|
392 |
+
|
393 |
+
if ($name instanceof Twig_Template) {
|
394 |
+
return new Twig_TemplateWrapper($this, $name);
|
395 |
+
}
|
396 |
+
|
397 |
+
return new Twig_TemplateWrapper($this, $this->loadTemplate($name));
|
398 |
+
}
|
399 |
+
|
400 |
+
/**
|
401 |
+
* Loads a template internal representation.
|
402 |
+
*
|
403 |
+
* This method is for internal use only and should never be called
|
404 |
+
* directly.
|
405 |
*
|
406 |
* @param string $name The template name
|
407 |
* @param int $index The index if it is an embedded template
|
408 |
*
|
409 |
* @return Twig_TemplateInterface A template instance representing the given template name
|
410 |
*
|
411 |
+
* @throws Twig_Error_Loader When the template cannot be found
|
412 |
+
* @throws Twig_Error_Runtime When a previously generated cache is corrupted
|
413 |
+
* @throws Twig_Error_Syntax When an error occurred during compilation
|
414 |
+
*
|
415 |
+
* @internal
|
416 |
*/
|
417 |
public function loadTemplate($name, $index = null)
|
418 |
{
|
419 |
+
$cls = $mainCls = $this->getTemplateClass($name);
|
420 |
+
if (null !== $index) {
|
421 |
+
$cls .= '_'.$index;
|
422 |
+
}
|
423 |
|
424 |
if (isset($this->loadedTemplates[$cls])) {
|
425 |
return $this->loadedTemplates[$cls];
|
429 |
if ($this->bcGetCacheFilename) {
|
430 |
$key = $this->getCacheFilename($name);
|
431 |
} else {
|
432 |
+
$key = $this->cache->generateKey($name, $mainCls);
|
433 |
}
|
434 |
|
435 |
if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
|
450 |
$this->writeCacheFile($key, $content);
|
451 |
} else {
|
452 |
$this->cache->write($key, $content);
|
453 |
+
$this->cache->load($key);
|
454 |
}
|
455 |
|
456 |
+
if (!class_exists($mainCls, false)) {
|
457 |
+
/* Last line of defense if either $this->bcWriteCacheFile was used,
|
458 |
+
* $this->cache is implemented as a no-op or we have a race condition
|
459 |
+
* where the cache was cleared between the above calls to write to and load from
|
460 |
+
* the cache.
|
461 |
+
*/
|
462 |
+
eval('?>'.$content);
|
463 |
+
}
|
464 |
+
}
|
465 |
+
|
466 |
+
if (!class_exists($cls, false)) {
|
467 |
+
throw new Twig_Error_Runtime(sprintf('Failed to load Twig template "%s", index "%s": cache is corrupted.', $name, $index), -1, $source);
|
468 |
}
|
469 |
}
|
470 |
|
609 |
/**
|
610 |
* Gets the Lexer instance.
|
611 |
*
|
612 |
+
* @return Twig_LexerInterface
|
613 |
*
|
614 |
* @deprecated since 1.25 (to be removed in 2.0)
|
615 |
*/
|
624 |
return $this->lexer;
|
625 |
}
|
626 |
|
|
|
|
|
|
|
|
|
|
|
627 |
public function setLexer(Twig_LexerInterface $lexer)
|
628 |
{
|
629 |
$this->lexer = $lexer;
|
635 |
* @param string|Twig_Source $source The template source code
|
636 |
* @param string $name The template name (deprecated)
|
637 |
*
|
638 |
+
* @return Twig_TokenStream
|
639 |
*
|
640 |
* @throws Twig_Error_Syntax When the code is syntactically wrong
|
641 |
*/
|
656 |
/**
|
657 |
* Gets the Parser instance.
|
658 |
*
|
659 |
+
* @return Twig_ParserInterface
|
660 |
*
|
661 |
* @deprecated since 1.25 (to be removed in 2.0)
|
662 |
*/
|
671 |
return $this->parser;
|
672 |
}
|
673 |
|
|
|
|
|
|
|
|
|
|
|
674 |
public function setParser(Twig_ParserInterface $parser)
|
675 |
{
|
676 |
$this->parser = $parser;
|
679 |
/**
|
680 |
* Converts a token stream to a node tree.
|
681 |
*
|
682 |
+
* @return Twig_Node_Module
|
|
|
|
|
683 |
*
|
684 |
* @throws Twig_Error_Syntax When the token stream is syntactically or semantically wrong
|
685 |
*/
|
695 |
/**
|
696 |
* Gets the Compiler instance.
|
697 |
*
|
698 |
+
* @return Twig_CompilerInterface
|
699 |
*
|
700 |
* @deprecated since 1.25 (to be removed in 2.0)
|
701 |
*/
|
710 |
return $this->compiler;
|
711 |
}
|
712 |
|
|
|
|
|
|
|
|
|
|
|
713 |
public function setCompiler(Twig_CompilerInterface $compiler)
|
714 |
{
|
715 |
$this->compiler = $compiler;
|
718 |
/**
|
719 |
* Compiles a node and returns the PHP code.
|
720 |
*
|
|
|
|
|
721 |
* @return string The compiled PHP source code
|
722 |
*/
|
723 |
public function compile(Twig_NodeInterface $node)
|
749 |
try {
|
750 |
return $this->compile($this->parse($this->tokenize($source)));
|
751 |
} catch (Twig_Error $e) {
|
752 |
+
$e->setSourceContext($source);
|
753 |
throw $e;
|
754 |
} catch (Exception $e) {
|
755 |
+
throw new Twig_Error_Syntax(sprintf('An exception has been thrown during the compilation of a template ("%s").', $e->getMessage()), -1, $source, $e);
|
756 |
}
|
757 |
}
|
758 |
|
|
|
|
|
|
|
|
|
|
|
759 |
public function setLoader(Twig_LoaderInterface $loader)
|
760 |
{
|
761 |
if (!$loader instanceof Twig_SourceContextLoaderInterface && 0 !== strpos(get_class($loader), 'Mock_Twig_LoaderInterface')) {
|
768 |
/**
|
769 |
* Gets the Loader instance.
|
770 |
*
|
771 |
+
* @return Twig_LoaderInterface
|
772 |
*/
|
773 |
public function getLoader()
|
774 |
{
|
839 |
return true;
|
840 |
}
|
841 |
|
842 |
+
return isset($this->extensionsByClass[$class]);
|
843 |
}
|
844 |
|
845 |
/**
|
855 |
*
|
856 |
* @param string $class The extension class name
|
857 |
*
|
858 |
+
* @return Twig_ExtensionInterface
|
859 |
*/
|
860 |
public function getExtension($class)
|
861 |
{
|
900 |
throw new Twig_Error_Runtime(sprintf('Unable to load the "%s" runtime.', $class));
|
901 |
}
|
902 |
|
|
|
|
|
|
|
|
|
|
|
903 |
public function addExtension(Twig_ExtensionInterface $extension)
|
904 |
{
|
905 |
if ($this->extensionInitialized) {
|
972 |
return $this->extensions;
|
973 |
}
|
974 |
|
|
|
|
|
|
|
|
|
|
|
975 |
public function addTokenParser(Twig_TokenParserInterface $parser)
|
976 |
{
|
977 |
if ($this->extensionInitialized) {
|
984 |
/**
|
985 |
* Gets the registered Token Parsers.
|
986 |
*
|
987 |
+
* @return Twig_TokenParserBrokerInterface
|
988 |
*
|
989 |
* @internal
|
990 |
*/
|
1002 |
*
|
1003 |
* Be warned that this method cannot return tags defined by Twig_TokenParserBrokerInterface classes.
|
1004 |
*
|
1005 |
+
* @return Twig_TokenParserInterface[]
|
1006 |
*
|
1007 |
* @internal
|
1008 |
*/
|
1018 |
return $tags;
|
1019 |
}
|
1020 |
|
|
|
|
|
|
|
|
|
|
|
1021 |
public function addNodeVisitor(Twig_NodeVisitorInterface $visitor)
|
1022 |
{
|
1023 |
if ($this->extensionInitialized) {
|
1030 |
/**
|
1031 |
* Gets the registered Node Visitors.
|
1032 |
*
|
1033 |
+
* @return Twig_NodeVisitorInterface[]
|
1034 |
*
|
1035 |
* @internal
|
1036 |
*/
|
1047 |
* Registers a Filter.
|
1048 |
*
|
1049 |
* @param string|Twig_SimpleFilter $name The filter name or a Twig_SimpleFilter instance
|
1050 |
+
* @param Twig_FilterInterface|Twig_SimpleFilter $filter
|
1051 |
*/
|
1052 |
public function addFilter($name, $filter = null)
|
1053 |
{
|
1123 |
*
|
1124 |
* Be warned that this method cannot return filters defined with registerUndefinedFilterCallback.
|
1125 |
*
|
1126 |
+
* @return Twig_FilterInterface[]
|
1127 |
*
|
1128 |
* @see registerUndefinedFilterCallback
|
1129 |
*
|
1167 |
/**
|
1168 |
* Gets the registered Tests.
|
1169 |
*
|
1170 |
+
* @return Twig_TestInterface[]
|
1171 |
*
|
1172 |
* @internal
|
1173 |
*/
|
1206 |
* Registers a Function.
|
1207 |
*
|
1208 |
* @param string|Twig_SimpleFunction $name The function name or a Twig_SimpleFunction instance
|
1209 |
+
* @param Twig_FunctionInterface|Twig_SimpleFunction $function
|
1210 |
*/
|
1211 |
public function addFunction($name, $function = null)
|
1212 |
{
|
1282 |
*
|
1283 |
* Be warned that this method cannot return functions defined with registerUndefinedFunctionCallback.
|
1284 |
*
|
1285 |
+
* @return Twig_FunctionInterface[]
|
1286 |
*
|
1287 |
* @see registerUndefinedFunctionCallback
|
1288 |
*
|
1447 |
return;
|
1448 |
}
|
1449 |
|
|
|
1450 |
$this->parsers = new Twig_TokenParserBroker(array(), array(), false);
|
1451 |
$this->filters = array();
|
1452 |
$this->functions = array();
|
1459 |
$this->initExtension($extension);
|
1460 |
}
|
1461 |
$this->initExtension($this->staging);
|
1462 |
+
// Done at the end only, so that an exception during initialization does not mark the environment as initialized when catching the exception
|
1463 |
+
$this->extensionInitialized = true;
|
1464 |
}
|
1465 |
|
1466 |
/**
|
1521 |
|
1522 |
// operators
|
1523 |
if ($operators = $extension->getOperators()) {
|
1524 |
+
if (!is_array($operators)) {
|
1525 |
+
throw new InvalidArgumentException(sprintf('"%s::getOperators()" must return an array with operators, got "%s".', get_class($extension), is_object($operators) ? get_class($operators) : gettype($operators).(is_resource($operators) ? '' : '#'.$operators)));
|
1526 |
+
}
|
1527 |
+
|
1528 |
if (2 !== count($operators)) {
|
1529 |
+
throw new InvalidArgumentException(sprintf('"%s::getOperators()" must return an array of 2 elements, got %d.', get_class($extension), count($operators)));
|
1530 |
}
|
1531 |
|
1532 |
$this->unaryOperators = array_merge($this->unaryOperators, $operators[0]);
|
vendor/twig/twig/lib/Twig/Error.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -39,6 +39,9 @@ class Twig_Error extends Exception
|
|
39 |
protected $rawMessage;
|
40 |
protected $previous;
|
41 |
|
|
|
|
|
|
|
42 |
/**
|
43 |
* Constructor.
|
44 |
*
|
@@ -51,13 +54,23 @@ class Twig_Error extends Exception
|
|
51 |
*
|
52 |
* By default, automatic guessing is enabled.
|
53 |
*
|
54 |
-
* @param string
|
55 |
-
* @param int
|
56 |
-
* @param string
|
57 |
-
* @param Exception
|
58 |
*/
|
59 |
-
public function __construct($message, $lineno = -1, $
|
60 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
if (PHP_VERSION_ID < 50300) {
|
62 |
$this->previous = $previous;
|
63 |
parent::__construct('');
|
@@ -68,7 +81,7 @@ class Twig_Error extends Exception
|
|
68 |
$this->lineno = $lineno;
|
69 |
$this->filename = $name;
|
70 |
|
71 |
-
if (-1 === $lineno || null === $name) {
|
72 |
$this->guessTemplateInfo();
|
73 |
}
|
74 |
|
@@ -92,11 +105,11 @@ class Twig_Error extends Exception
|
|
92 |
*
|
93 |
* @return string The name
|
94 |
*
|
95 |
-
* @deprecated since 1.27 (to be removed in 2.0). Use
|
96 |
*/
|
97 |
public function getTemplateFile()
|
98 |
{
|
99 |
-
@trigger_error(sprintf('The "%s" method is deprecated since version 1.27 and will be removed in 2.0. Use
|
100 |
|
101 |
return $this->filename;
|
102 |
}
|
@@ -106,11 +119,11 @@ class Twig_Error extends Exception
|
|
106 |
*
|
107 |
* @param string $name The name
|
108 |
*
|
109 |
-
* @deprecated since 1.27 (to be removed in 2.0). Use
|
110 |
*/
|
111 |
public function setTemplateFile($name)
|
112 |
{
|
113 |
-
@trigger_error(sprintf('The "%s" method is deprecated since version 1.27 and will be removed in 2.0. Use
|
114 |
|
115 |
$this->filename = $name;
|
116 |
|
@@ -121,9 +134,13 @@ class Twig_Error extends Exception
|
|
121 |
* Gets the logical name where the error occurred.
|
122 |
*
|
123 |
* @return string The name
|
|
|
|
|
124 |
*/
|
125 |
public function getTemplateName()
|
126 |
{
|
|
|
|
|
127 |
return $this->filename;
|
128 |
}
|
129 |
|
@@ -131,10 +148,15 @@ class Twig_Error extends Exception
|
|
131 |
* Sets the logical name where the error occurred.
|
132 |
*
|
133 |
* @param string $name The name
|
|
|
|
|
134 |
*/
|
135 |
public function setTemplateName($name)
|
136 |
{
|
|
|
|
|
137 |
$this->filename = $name;
|
|
|
138 |
|
139 |
$this->updateRepr();
|
140 |
}
|
@@ -161,6 +183,32 @@ class Twig_Error extends Exception
|
|
161 |
$this->updateRepr();
|
162 |
}
|
163 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
public function guess()
|
165 |
{
|
166 |
$this->guessTemplateInfo();
|
@@ -199,6 +247,13 @@ class Twig_Error extends Exception
|
|
199 |
{
|
200 |
$this->message = $this->rawMessage;
|
201 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
$dot = false;
|
203 |
if ('.' === substr($this->message, -1)) {
|
204 |
$this->message = substr($this->message, 0, -1);
|
@@ -263,6 +318,13 @@ class Twig_Error extends Exception
|
|
263 |
$this->filename = $template->getTemplateName();
|
264 |
}
|
265 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
266 |
if (null === $template || $this->lineno > -1) {
|
267 |
return;
|
268 |
}
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
39 |
protected $rawMessage;
|
40 |
protected $previous;
|
41 |
|
42 |
+
private $sourcePath;
|
43 |
+
private $sourceCode;
|
44 |
+
|
45 |
/**
|
46 |
* Constructor.
|
47 |
*
|
54 |
*
|
55 |
* By default, automatic guessing is enabled.
|
56 |
*
|
57 |
+
* @param string $message The error message
|
58 |
+
* @param int $lineno The template line where the error occurred
|
59 |
+
* @param Twig_Source|string|null $source The source context where the error occurred
|
60 |
+
* @param Exception $previous The previous exception
|
61 |
*/
|
62 |
+
public function __construct($message, $lineno = -1, $source = null, Exception $previous = null)
|
63 |
{
|
64 |
+
if (null === $source) {
|
65 |
+
$name = null;
|
66 |
+
} elseif (!$source instanceof Twig_Source) {
|
67 |
+
// for compat with the Twig C ext., passing the template name as string is accepted
|
68 |
+
$name = $source;
|
69 |
+
} else {
|
70 |
+
$name = $source->getName();
|
71 |
+
$this->sourceCode = $source->getCode();
|
72 |
+
$this->sourcePath = $source->getPath();
|
73 |
+
}
|
74 |
if (PHP_VERSION_ID < 50300) {
|
75 |
$this->previous = $previous;
|
76 |
parent::__construct('');
|
81 |
$this->lineno = $lineno;
|
82 |
$this->filename = $name;
|
83 |
|
84 |
+
if (-1 === $lineno || null === $name || null === $this->sourcePath) {
|
85 |
$this->guessTemplateInfo();
|
86 |
}
|
87 |
|
105 |
*
|
106 |
* @return string The name
|
107 |
*
|
108 |
+
* @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead.
|
109 |
*/
|
110 |
public function getTemplateFile()
|
111 |
{
|
112 |
+
@trigger_error(sprintf('The "%s" method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), E_USER_DEPRECATED);
|
113 |
|
114 |
return $this->filename;
|
115 |
}
|
119 |
*
|
120 |
* @param string $name The name
|
121 |
*
|
122 |
+
* @deprecated since 1.27 (to be removed in 2.0). Use setSourceContext() instead.
|
123 |
*/
|
124 |
public function setTemplateFile($name)
|
125 |
{
|
126 |
+
@trigger_error(sprintf('The "%s" method is deprecated since version 1.27 and will be removed in 2.0. Use setSourceContext() instead.', __METHOD__), E_USER_DEPRECATED);
|
127 |
|
128 |
$this->filename = $name;
|
129 |
|
134 |
* Gets the logical name where the error occurred.
|
135 |
*
|
136 |
* @return string The name
|
137 |
+
*
|
138 |
+
* @deprecated since 1.29 (to be removed in 2.0). Use getSourceContext() instead.
|
139 |
*/
|
140 |
public function getTemplateName()
|
141 |
{
|
142 |
+
@trigger_error(sprintf('The "%s" method is deprecated since version 1.29 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), E_USER_DEPRECATED);
|
143 |
+
|
144 |
return $this->filename;
|
145 |
}
|
146 |
|
148 |
* Sets the logical name where the error occurred.
|
149 |
*
|
150 |
* @param string $name The name
|
151 |
+
*
|
152 |
+
* @deprecated since 1.29 (to be removed in 2.0). Use setSourceContext() instead.
|
153 |
*/
|
154 |
public function setTemplateName($name)
|
155 |
{
|
156 |
+
@trigger_error(sprintf('The "%s" method is deprecated since version 1.29 and will be removed in 2.0. Use setSourceContext() instead.', __METHOD__), E_USER_DEPRECATED);
|
157 |
+
|
158 |
$this->filename = $name;
|
159 |
+
$this->sourceCode = $this->sourcePath = null;
|
160 |
|
161 |
$this->updateRepr();
|
162 |
}
|
183 |
$this->updateRepr();
|
184 |
}
|
185 |
|
186 |
+
/**
|
187 |
+
* Gets the source context of the Twig template where the error occurred.
|
188 |
+
*
|
189 |
+
* @return Twig_Source|null
|
190 |
+
*/
|
191 |
+
public function getSourceContext()
|
192 |
+
{
|
193 |
+
return $this->filename ? new Twig_Source($this->sourceCode, $this->filename, $this->sourcePath) : null;
|
194 |
+
}
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Sets the source context of the Twig template where the error occurred.
|
198 |
+
*/
|
199 |
+
public function setSourceContext(Twig_Source $source = null)
|
200 |
+
{
|
201 |
+
if (null === $source) {
|
202 |
+
$this->sourceCode = $this->filename = $this->sourcePath = null;
|
203 |
+
} else {
|
204 |
+
$this->sourceCode = $source->getCode();
|
205 |
+
$this->filename = $source->getName();
|
206 |
+
$this->sourcePath = $source->getPath();
|
207 |
+
}
|
208 |
+
|
209 |
+
$this->updateRepr();
|
210 |
+
}
|
211 |
+
|
212 |
public function guess()
|
213 |
{
|
214 |
$this->guessTemplateInfo();
|
247 |
{
|
248 |
$this->message = $this->rawMessage;
|
249 |
|
250 |
+
if ($this->sourcePath && $this->lineno > 0) {
|
251 |
+
$this->file = $this->sourcePath;
|
252 |
+
$this->line = $this->lineno;
|
253 |
+
|
254 |
+
return;
|
255 |
+
}
|
256 |
+
|
257 |
$dot = false;
|
258 |
if ('.' === substr($this->message, -1)) {
|
259 |
$this->message = substr($this->message, 0, -1);
|
318 |
$this->filename = $template->getTemplateName();
|
319 |
}
|
320 |
|
321 |
+
// update template path if any
|
322 |
+
if (null !== $template && null === $this->sourcePath) {
|
323 |
+
$src = $template->getSourceContext();
|
324 |
+
$this->sourceCode = $src->getCode();
|
325 |
+
$this->sourcePath = $src->getPath();
|
326 |
+
}
|
327 |
+
|
328 |
if (null === $template || $this->lineno > -1) {
|
329 |
return;
|
330 |
}
|
vendor/twig/twig/lib/Twig/Error/Loader.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -24,8 +24,15 @@
|
|
24 |
*/
|
25 |
class Twig_Error_Loader extends Twig_Error
|
26 |
{
|
27 |
-
public function __construct($message, $lineno = -1, $
|
28 |
{
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
}
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
24 |
*/
|
25 |
class Twig_Error_Loader extends Twig_Error
|
26 |
{
|
27 |
+
public function __construct($message, $lineno = -1, $source = null, Exception $previous = null)
|
28 |
{
|
29 |
+
if (PHP_VERSION_ID < 50300) {
|
30 |
+
$this->previous = $previous;
|
31 |
+
Exception::__construct('');
|
32 |
+
} else {
|
33 |
+
Exception::__construct('', 0, $previous);
|
34 |
+
}
|
35 |
+
$this->appendMessage($message);
|
36 |
+
$this->setTemplateLine(false);
|
37 |
}
|
38 |
}
|
vendor/twig/twig/lib/Twig/Error/Runtime.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Error/Syntax.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/ExpressionParser.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
@@ -33,7 +33,7 @@ class Twig_ExpressionParser
|
|
33 |
|
34 |
private $env;
|
35 |
|
36 |
-
public function __construct(Twig_Parser $parser,
|
37 |
{
|
38 |
$this->parser = $parser;
|
39 |
|
@@ -189,7 +189,7 @@ class Twig_ExpressionParser
|
|
189 |
$negClass = 'Twig_Node_Expression_Unary_Neg';
|
190 |
$posClass = 'Twig_Node_Expression_Unary_Pos';
|
191 |
if (!(in_array($ref->getName(), array($negClass, $posClass)) || $ref->isSubclassOf($negClass) || $ref->isSubclassOf($posClass))) {
|
192 |
-
throw new Twig_Error_Syntax(sprintf('Unexpected unary operator "%s".', $token->getValue()), $token->getLine(), $this->parser->getStream()->getSourceContext()
|
193 |
}
|
194 |
|
195 |
$this->parser->getStream()->next();
|
@@ -205,7 +205,7 @@ class Twig_ExpressionParser
|
|
205 |
} elseif ($token->test(Twig_Token::PUNCTUATION_TYPE, '{')) {
|
206 |
$node = $this->parseHashExpression();
|
207 |
} else {
|
208 |
-
throw new Twig_Error_Syntax(sprintf('Unexpected token "%s" of value "%s".', Twig_Token::typeToEnglish($token->getType()), $token->getValue()), $token->getLine(), $this->parser->getStream()->getSourceContext()
|
209 |
}
|
210 |
}
|
211 |
|
@@ -296,7 +296,7 @@ class Twig_ExpressionParser
|
|
296 |
} else {
|
297 |
$current = $stream->getCurrent();
|
298 |
|
299 |
-
throw new Twig_Error_Syntax(sprintf('A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "%s" of value "%s".', Twig_Token::typeToEnglish($current->getType()), $current->getValue()), $current->getLine(), $stream->getSourceContext()
|
300 |
}
|
301 |
|
302 |
$stream->expect(Twig_Token::PUNCTUATION_TYPE, ':', 'A hash key must be followed by a colon (:)');
|
@@ -335,20 +335,25 @@ class Twig_ExpressionParser
|
|
335 |
case 'parent':
|
336 |
$this->parseArguments();
|
337 |
if (!count($this->parser->getBlockStack())) {
|
338 |
-
throw new Twig_Error_Syntax('Calling "parent" outside a block is forbidden.', $line, $this->parser->getStream()->getSourceContext()
|
339 |
}
|
340 |
|
341 |
if (!$this->parser->getParent() && !$this->parser->hasTraits()) {
|
342 |
-
throw new Twig_Error_Syntax('Calling "parent" on a template that does not extend nor "use" another template is forbidden.', $line, $this->parser->getStream()->getSourceContext()
|
343 |
}
|
344 |
|
345 |
return new Twig_Node_Expression_Parent($this->parser->peekBlockStack(), $line);
|
346 |
case 'block':
|
347 |
-
|
|
|
|
|
|
|
|
|
|
|
348 |
case 'attribute':
|
349 |
$args = $this->parseArguments();
|
350 |
if (count($args) < 2) {
|
351 |
-
throw new Twig_Error_Syntax('The "attribute" function takes at least two arguments (the variable and the attributes).', $line, $this->parser->getStream()->getSourceContext()
|
352 |
}
|
353 |
|
354 |
return new Twig_Node_Expression_GetAttr($args->getNode(0), $args->getNode(1), count($args) > 2 ? $args->getNode(2) : null, Twig_Template::ANY_CALL, $line);
|
@@ -397,18 +402,18 @@ class Twig_ExpressionParser
|
|
397 |
}
|
398 |
}
|
399 |
} else {
|
400 |
-
throw new Twig_Error_Syntax('Expected name or number.', $lineno, $stream->getSourceContext()
|
401 |
}
|
402 |
|
403 |
if ($node instanceof Twig_Node_Expression_Name && null !== $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) {
|
404 |
if (!$arg instanceof Twig_Node_Expression_Constant) {
|
405 |
-
throw new Twig_Error_Syntax(sprintf('Dynamic macro names are not supported (called on "%s").', $node->getAttribute('name')), $token->getLine(), $stream->getSourceContext()
|
406 |
}
|
407 |
|
408 |
$name = $arg->getAttribute('value');
|
409 |
|
410 |
if ($this->parser->isReservedMacroName($name)) {
|
411 |
-
throw new Twig_Error_Syntax(sprintf('"%s" cannot be called as macro as it is a reserved keyword.', $name), $token->getLine(), $stream->getSourceContext()
|
412 |
}
|
413 |
|
414 |
$node = new Twig_Node_Expression_MethodCall($node, 'get'.$name, $arguments, $lineno);
|
@@ -518,7 +523,7 @@ class Twig_ExpressionParser
|
|
518 |
$name = null;
|
519 |
if ($namedArguments && $token = $stream->nextIf(Twig_Token::OPERATOR_TYPE, '=')) {
|
520 |
if (!$value instanceof Twig_Node_Expression_Name) {
|
521 |
-
throw new Twig_Error_Syntax(sprintf('A parameter name must be a string, "%s" given.', get_class($value)), $token->getLine(), $stream->getSourceContext()
|
522 |
}
|
523 |
$name = $value->getAttribute('name');
|
524 |
|
@@ -526,7 +531,7 @@ class Twig_ExpressionParser
|
|
526 |
$value = $this->parsePrimaryExpression();
|
527 |
|
528 |
if (!$this->checkConstantExpression($value)) {
|
529 |
-
throw new Twig_Error_Syntax(sprintf('A default value for an argument must be a constant (a boolean, a string, a number, or an array).'), $token->getLine(), $stream->getSourceContext()
|
530 |
}
|
531 |
} else {
|
532 |
$value = $this->parseExpression();
|
@@ -560,7 +565,7 @@ class Twig_ExpressionParser
|
|
560 |
$token = $stream->expect(Twig_Token::NAME_TYPE, null, 'Only variables can be assigned to');
|
561 |
$value = $token->getValue();
|
562 |
if (in_array(strtolower($value), array('true', 'false', 'none', 'null'))) {
|
563 |
-
throw new Twig_Error_Syntax(sprintf('You cannot assign a value to "%s".', $value), $token->getLine(), $stream->getSourceContext()
|
564 |
}
|
565 |
$targets[] = new Twig_Node_Expression_AssignName($value, $token->getLine());
|
566 |
|
@@ -624,7 +629,7 @@ class Twig_ExpressionParser
|
|
624 |
}
|
625 |
}
|
626 |
|
627 |
-
$e = new Twig_Error_Syntax(sprintf('Unknown "%s" test.', $name), $line, $stream->getSourceContext()
|
628 |
$e->addSuggestions($name, array_keys($this->env->getTests()));
|
629 |
|
630 |
throw $e;
|
@@ -641,7 +646,8 @@ class Twig_ExpressionParser
|
|
641 |
if ($test->getAlternative()) {
|
642 |
$message .= sprintf('. Use "%s" instead', $test->getAlternative());
|
643 |
}
|
644 |
-
$
|
|
|
645 |
|
646 |
@trigger_error($message, E_USER_DEPRECATED);
|
647 |
}
|
@@ -656,7 +662,7 @@ class Twig_ExpressionParser
|
|
656 |
protected function getFunctionNodeClass($name, $line)
|
657 |
{
|
658 |
if (false === $function = $this->env->getFunction($name)) {
|
659 |
-
$e = new Twig_Error_Syntax(sprintf('Unknown "%s" function.', $name), $line, $this->parser->getStream()->getSourceContext()
|
660 |
$e->addSuggestions($name, array_keys($this->env->getFunctions()));
|
661 |
|
662 |
throw $e;
|
@@ -670,7 +676,8 @@ class Twig_ExpressionParser
|
|
670 |
if ($function->getAlternative()) {
|
671 |
$message .= sprintf('. Use "%s" instead', $function->getAlternative());
|
672 |
}
|
673 |
-
$
|
|
|
674 |
|
675 |
@trigger_error($message, E_USER_DEPRECATED);
|
676 |
}
|
@@ -685,7 +692,7 @@ class Twig_ExpressionParser
|
|
685 |
protected function getFilterNodeClass($name, $line)
|
686 |
{
|
687 |
if (false === $filter = $this->env->getFilter($name)) {
|
688 |
-
$e = new Twig_Error_Syntax(sprintf('Unknown "%s" filter.', $name), $line, $this->parser->getStream()->getSourceContext()
|
689 |
$e->addSuggestions($name, array_keys($this->env->getFilters()));
|
690 |
|
691 |
throw $e;
|
@@ -699,7 +706,8 @@ class Twig_ExpressionParser
|
|
699 |
if ($filter->getAlternative()) {
|
700 |
$message .= sprintf('. Use "%s" instead', $filter->getAlternative());
|
701 |
}
|
702 |
-
$
|
|
|
703 |
|
704 |
@trigger_error($message, E_USER_DEPRECATED);
|
705 |
}
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
33 |
|
34 |
private $env;
|
35 |
|
36 |
+
public function __construct(Twig_Parser $parser, $env = null)
|
37 |
{
|
38 |
$this->parser = $parser;
|
39 |
|
189 |
$negClass = 'Twig_Node_Expression_Unary_Neg';
|
190 |
$posClass = 'Twig_Node_Expression_Unary_Pos';
|
191 |
if (!(in_array($ref->getName(), array($negClass, $posClass)) || $ref->isSubclassOf($negClass) || $ref->isSubclassOf($posClass))) {
|
192 |
+
throw new Twig_Error_Syntax(sprintf('Unexpected unary operator "%s".', $token->getValue()), $token->getLine(), $this->parser->getStream()->getSourceContext());
|
193 |
}
|
194 |
|
195 |
$this->parser->getStream()->next();
|
205 |
} elseif ($token->test(Twig_Token::PUNCTUATION_TYPE, '{')) {
|
206 |
$node = $this->parseHashExpression();
|
207 |
} else {
|
208 |
+
throw new Twig_Error_Syntax(sprintf('Unexpected token "%s" of value "%s".', Twig_Token::typeToEnglish($token->getType()), $token->getValue()), $token->getLine(), $this->parser->getStream()->getSourceContext());
|
209 |
}
|
210 |
}
|
211 |
|
296 |
} else {
|
297 |
$current = $stream->getCurrent();
|
298 |
|
299 |
+
throw new Twig_Error_Syntax(sprintf('A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "%s" of value "%s".', Twig_Token::typeToEnglish($current->getType()), $current->getValue()), $current->getLine(), $stream->getSourceContext());
|
300 |
}
|
301 |
|
302 |
$stream->expect(Twig_Token::PUNCTUATION_TYPE, ':', 'A hash key must be followed by a colon (:)');
|
335 |
case 'parent':
|
336 |
$this->parseArguments();
|
337 |
if (!count($this->parser->getBlockStack())) {
|
338 |
+
throw new Twig_Error_Syntax('Calling "parent" outside a block is forbidden.', $line, $this->parser->getStream()->getSourceContext());
|
339 |
}
|
340 |
|
341 |
if (!$this->parser->getParent() && !$this->parser->hasTraits()) {
|
342 |
+
throw new Twig_Error_Syntax('Calling "parent" on a template that does not extend nor "use" another template is forbidden.', $line, $this->parser->getStream()->getSourceContext());
|
343 |
}
|
344 |
|
345 |
return new Twig_Node_Expression_Parent($this->parser->peekBlockStack(), $line);
|
346 |
case 'block':
|
347 |
+
$args = $this->parseArguments();
|
348 |
+
if (count($args) < 1) {
|
349 |
+
throw new Twig_Error_Syntax('The "block" function takes one argument (the block name).', $line, $this->parser->getStream()->getSourceContext());
|
350 |
+
}
|
351 |
+
|
352 |
+
return new Twig_Node_Expression_BlockReference($args->getNode(0), count($args) > 1 ? $args->getNode(1) : null, $line);
|
353 |
case 'attribute':
|
354 |
$args = $this->parseArguments();
|
355 |
if (count($args) < 2) {
|
356 |
+
throw new Twig_Error_Syntax('The "attribute" function takes at least two arguments (the variable and the attributes).', $line, $this->parser->getStream()->getSourceContext());
|
357 |
}
|
358 |
|
359 |
return new Twig_Node_Expression_GetAttr($args->getNode(0), $args->getNode(1), count($args) > 2 ? $args->getNode(2) : null, Twig_Template::ANY_CALL, $line);
|
402 |
}
|
403 |
}
|
404 |
} else {
|
405 |
+
throw new Twig_Error_Syntax('Expected name or number.', $lineno, $stream->getSourceContext());
|
406 |
}
|
407 |
|
408 |
if ($node instanceof Twig_Node_Expression_Name && null !== $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) {
|
409 |
if (!$arg instanceof Twig_Node_Expression_Constant) {
|
410 |
+
throw new Twig_Error_Syntax(sprintf('Dynamic macro names are not supported (called on "%s").', $node->getAttribute('name')), $token->getLine(), $stream->getSourceContext());
|
411 |
}
|
412 |
|
413 |
$name = $arg->getAttribute('value');
|
414 |
|
415 |
if ($this->parser->isReservedMacroName($name)) {
|
416 |
+
throw new Twig_Error_Syntax(sprintf('"%s" cannot be called as macro as it is a reserved keyword.', $name), $token->getLine(), $stream->getSourceContext());
|
417 |
}
|
418 |
|
419 |
$node = new Twig_Node_Expression_MethodCall($node, 'get'.$name, $arguments, $lineno);
|
523 |
$name = null;
|
524 |
if ($namedArguments && $token = $stream->nextIf(Twig_Token::OPERATOR_TYPE, '=')) {
|
525 |
if (!$value instanceof Twig_Node_Expression_Name) {
|
526 |
+
throw new Twig_Error_Syntax(sprintf('A parameter name must be a string, "%s" given.', get_class($value)), $token->getLine(), $stream->getSourceContext());
|
527 |
}
|
528 |
$name = $value->getAttribute('name');
|
529 |
|
531 |
$value = $this->parsePrimaryExpression();
|
532 |
|
533 |
if (!$this->checkConstantExpression($value)) {
|
534 |
+
throw new Twig_Error_Syntax(sprintf('A default value for an argument must be a constant (a boolean, a string, a number, or an array).'), $token->getLine(), $stream->getSourceContext());
|
535 |
}
|
536 |
} else {
|
537 |
$value = $this->parseExpression();
|
565 |
$token = $stream->expect(Twig_Token::NAME_TYPE, null, 'Only variables can be assigned to');
|
566 |
$value = $token->getValue();
|
567 |
if (in_array(strtolower($value), array('true', 'false', 'none', 'null'))) {
|
568 |
+
throw new Twig_Error_Syntax(sprintf('You cannot assign a value to "%s".', $value), $token->getLine(), $stream->getSourceContext());
|
569 |
}
|
570 |
$targets[] = new Twig_Node_Expression_AssignName($value, $token->getLine());
|
571 |
|
629 |
}
|
630 |
}
|
631 |
|
632 |
+
$e = new Twig_Error_Syntax(sprintf('Unknown "%s" test.', $name), $line, $stream->getSourceContext());
|
633 |
$e->addSuggestions($name, array_keys($this->env->getTests()));
|
634 |
|
635 |
throw $e;
|
646 |
if ($test->getAlternative()) {
|
647 |
$message .= sprintf('. Use "%s" instead', $test->getAlternative());
|
648 |
}
|
649 |
+
$src = $stream->getSourceContext();
|
650 |
+
$message .= sprintf(' in %s at line %d.', $src->getPath() ? $src->getPath() : $src->getName(), $stream->getCurrent()->getLine());
|
651 |
|
652 |
@trigger_error($message, E_USER_DEPRECATED);
|
653 |
}
|
662 |
protected function getFunctionNodeClass($name, $line)
|
663 |
{
|
664 |
if (false === $function = $this->env->getFunction($name)) {
|
665 |
+
$e = new Twig_Error_Syntax(sprintf('Unknown "%s" function.', $name), $line, $this->parser->getStream()->getSourceContext());
|
666 |
$e->addSuggestions($name, array_keys($this->env->getFunctions()));
|
667 |
|
668 |
throw $e;
|
676 |
if ($function->getAlternative()) {
|
677 |
$message .= sprintf('. Use "%s" instead', $function->getAlternative());
|
678 |
}
|
679 |
+
$src = $this->parser->getStream()->getSourceContext();
|
680 |
+
$message .= sprintf(' in %s at line %d.', $src->getPath() ? $src->getPath() : $src->getName(), $line);
|
681 |
|
682 |
@trigger_error($message, E_USER_DEPRECATED);
|
683 |
}
|
692 |
protected function getFilterNodeClass($name, $line)
|
693 |
{
|
694 |
if (false === $filter = $this->env->getFilter($name)) {
|
695 |
+
$e = new Twig_Error_Syntax(sprintf('Unknown "%s" filter.', $name), $line, $this->parser->getStream()->getSourceContext());
|
696 |
$e->addSuggestions($name, array_keys($this->env->getFilters()));
|
697 |
|
698 |
throw $e;
|
706 |
if ($filter->getAlternative()) {
|
707 |
$message .= sprintf('. Use "%s" instead', $filter->getAlternative());
|
708 |
}
|
709 |
+
$src = $this->parser->getStream()->getSourceContext();
|
710 |
+
$message .= sprintf(' in %s at line %d.', $src->getPath() ? $src->getPath() : $src->getName(), $line);
|
711 |
|
712 |
@trigger_error($message, E_USER_DEPRECATED);
|
713 |
}
|
vendor/twig/twig/lib/Twig/Extension.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -11,65 +11,43 @@
|
|
11 |
abstract class Twig_Extension implements Twig_ExtensionInterface
|
12 |
{
|
13 |
/**
|
14 |
-
* {@inheritdoc}
|
15 |
-
*
|
16 |
* @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_InitRuntimeInterface instead
|
17 |
*/
|
18 |
public function initRuntime(Twig_Environment $environment)
|
19 |
{
|
20 |
}
|
21 |
|
22 |
-
/**
|
23 |
-
* {@inheritdoc}
|
24 |
-
*/
|
25 |
public function getTokenParsers()
|
26 |
{
|
27 |
return array();
|
28 |
}
|
29 |
|
30 |
-
/**
|
31 |
-
* {@inheritdoc}
|
32 |
-
*/
|
33 |
public function getNodeVisitors()
|
34 |
{
|
35 |
return array();
|
36 |
}
|
37 |
|
38 |
-
/**
|
39 |
-
* {@inheritdoc}
|
40 |
-
*/
|
41 |
public function getFilters()
|
42 |
{
|
43 |
return array();
|
44 |
}
|
45 |
|
46 |
-
/**
|
47 |
-
* {@inheritdoc}
|
48 |
-
*/
|
49 |
public function getTests()
|
50 |
{
|
51 |
return array();
|
52 |
}
|
53 |
|
54 |
-
/**
|
55 |
-
* {@inheritdoc}
|
56 |
-
*/
|
57 |
public function getFunctions()
|
58 |
{
|
59 |
return array();
|
60 |
}
|
61 |
|
62 |
-
/**
|
63 |
-
* {@inheritdoc}
|
64 |
-
*/
|
65 |
public function getOperators()
|
66 |
{
|
67 |
return array();
|
68 |
}
|
69 |
|
70 |
/**
|
71 |
-
* {@inheritdoc}
|
72 |
-
*
|
73 |
* @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_GlobalsInterface instead
|
74 |
*/
|
75 |
public function getGlobals()
|
@@ -78,8 +56,6 @@ abstract class Twig_Extension implements Twig_ExtensionInterface
|
|
78 |
}
|
79 |
|
80 |
/**
|
81 |
-
* {@inheritdoc}
|
82 |
-
*
|
83 |
* @deprecated since 1.26 (to be removed in 2.0), not used anymore internally
|
84 |
*/
|
85 |
public function getName()
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
11 |
abstract class Twig_Extension implements Twig_ExtensionInterface
|
12 |
{
|
13 |
/**
|
|
|
|
|
14 |
* @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_InitRuntimeInterface instead
|
15 |
*/
|
16 |
public function initRuntime(Twig_Environment $environment)
|
17 |
{
|
18 |
}
|
19 |
|
|
|
|
|
|
|
20 |
public function getTokenParsers()
|
21 |
{
|
22 |
return array();
|
23 |
}
|
24 |
|
|
|
|
|
|
|
25 |
public function getNodeVisitors()
|
26 |
{
|
27 |
return array();
|
28 |
}
|
29 |
|
|
|
|
|
|
|
30 |
public function getFilters()
|
31 |
{
|
32 |
return array();
|
33 |
}
|
34 |
|
|
|
|
|
|
|
35 |
public function getTests()
|
36 |
{
|
37 |
return array();
|
38 |
}
|
39 |
|
|
|
|
|
|
|
40 |
public function getFunctions()
|
41 |
{
|
42 |
return array();
|
43 |
}
|
44 |
|
|
|
|
|
|
|
45 |
public function getOperators()
|
46 |
{
|
47 |
return array();
|
48 |
}
|
49 |
|
50 |
/**
|
|
|
|
|
51 |
* @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_GlobalsInterface instead
|
52 |
*/
|
53 |
public function getGlobals()
|
56 |
}
|
57 |
|
58 |
/**
|
|
|
|
|
59 |
* @deprecated since 1.26 (to be removed in 2.0), not used anymore internally
|
60 |
*/
|
61 |
public function getName()
|
vendor/twig/twig/lib/Twig/Extension/Core.php
CHANGED
@@ -8,11 +8,15 @@ if (!defined('ENT_SUBSTITUTE')) {
|
|
8 |
/*
|
9 |
* This file is part of Twig.
|
10 |
*
|
11 |
-
* (c)
|
12 |
*
|
13 |
* For the full copyright and license information, please view the LICENSE
|
14 |
* file that was distributed with this source code.
|
15 |
*/
|
|
|
|
|
|
|
|
|
16 |
class Twig_Extension_Core extends Twig_Extension
|
17 |
{
|
18 |
protected $dateFormats = array('F j, Y H:i', '%d days');
|
@@ -95,9 +99,9 @@ class Twig_Extension_Core extends Twig_Extension
|
|
95 |
/**
|
96 |
* Sets the default format to be used by the number_format filter.
|
97 |
*
|
98 |
-
* @param int $decimal
|
99 |
-
* @param string $decimalPoint
|
100 |
-
* @param string $thousandSep
|
101 |
*/
|
102 |
public function setNumberFormat($decimal, $decimalPoint, $thousandSep)
|
103 |
{
|
@@ -132,6 +136,7 @@ class Twig_Extension_Core extends Twig_Extension
|
|
132 |
new Twig_TokenParser_Flush(),
|
133 |
new Twig_TokenParser_Do(),
|
134 |
new Twig_TokenParser_Embed(),
|
|
|
135 |
);
|
136 |
}
|
137 |
|
@@ -275,7 +280,7 @@ class Twig_Extension_Core extends Twig_Extension
|
|
275 |
/**
|
276 |
* Cycles over a value.
|
277 |
*
|
278 |
-
* @param ArrayAccess|array $values
|
279 |
* @param int $position The cycle position
|
280 |
*
|
281 |
* @return string The next value in the cycle
|
@@ -295,10 +300,10 @@ function twig_cycle($values, $position)
|
|
295 |
* - a random character from a string
|
296 |
* - a random integer between 0 and the integer parameter.
|
297 |
*
|
298 |
-
* @param Twig_Environment
|
299 |
-
* @param Traversable|array|int|string $values The values to pick a random item from
|
300 |
*
|
301 |
-
* @throws Twig_Error_Runtime
|
302 |
*
|
303 |
* @return mixed A random value from the given sequence
|
304 |
*/
|
@@ -355,7 +360,7 @@ function twig_random(Twig_Environment $env, $values = null)
|
|
355 |
* {{ post.published_at|date("m/d/Y") }}
|
356 |
* </pre>
|
357 |
*
|
358 |
-
* @param Twig_Environment $env
|
359 |
* @param DateTime|DateTimeInterface|DateInterval|string $date A date
|
360 |
* @param string|null $format The target format, null to use the default
|
361 |
* @param DateTimeZone|string|null|false $timezone The target timezone, null to use the default, false to leave unchanged
|
@@ -383,7 +388,7 @@ function twig_date_format_filter(Twig_Environment $env, $date, $format = null, $
|
|
383 |
* {{ post.published_at|date_modify("-1day")|date("m/d/Y") }}
|
384 |
* </pre>
|
385 |
*
|
386 |
-
* @param Twig_Environment $env
|
387 |
* @param DateTime|string $date A date
|
388 |
* @param string $modifier A modifier string
|
389 |
*
|
@@ -409,7 +414,7 @@ function twig_date_modify_filter(Twig_Environment $env, $date, $modifier)
|
|
409 |
* {% endif %}
|
410 |
* </pre>
|
411 |
*
|
412 |
-
* @param Twig_Environment $env
|
413 |
* @param DateTime|DateTimeInterface|string|null $date A date
|
414 |
* @param DateTimeZone|string|null|false $timezone The target timezone, null to use the default, false to leave unchanged
|
415 |
*
|
@@ -511,11 +516,11 @@ function twig_round($value, $precision = 0, $method = 'common')
|
|
511 |
* be used. Supplying any of the parameters will override the defaults set in the
|
512 |
* environment object.
|
513 |
*
|
514 |
-
* @param Twig_Environment $env
|
515 |
* @param mixed $number A float/int/string of the number to format
|
516 |
-
* @param int $decimal
|
517 |
-
* @param string $decimalPoint
|
518 |
-
* @param string $thousandSep
|
519 |
*
|
520 |
* @return string The formatted number
|
521 |
*/
|
@@ -561,7 +566,7 @@ if (PHP_VERSION_ID < 50300) {
|
|
561 |
/**
|
562 |
* JSON encodes a variable.
|
563 |
*
|
564 |
-
* @param mixed $value
|
565 |
* @param int $options Not used on PHP 5.2.x
|
566 |
*
|
567 |
* @return mixed The JSON encoded value
|
@@ -580,7 +585,7 @@ if (PHP_VERSION_ID < 50300) {
|
|
580 |
/**
|
581 |
* JSON encodes a variable.
|
582 |
*
|
583 |
-
* @param mixed $value
|
584 |
* @param int $options Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT
|
585 |
*
|
586 |
* @return mixed The JSON encoded value
|
@@ -640,7 +645,7 @@ function twig_array_merge($arr1, $arr2)
|
|
640 |
/**
|
641 |
* Slices a variable.
|
642 |
*
|
643 |
-
* @param Twig_Environment $env
|
644 |
* @param mixed $item A variable
|
645 |
* @param int $start Start of the slice
|
646 |
* @param int $length Size of the slice
|
@@ -651,7 +656,7 @@ function twig_array_merge($arr1, $arr2)
|
|
651 |
function twig_slice(Twig_Environment $env, $item, $start, $length = null, $preserveKeys = false)
|
652 |
{
|
653 |
if ($item instanceof Traversable) {
|
654 |
-
|
655 |
$item = $item->getIterator();
|
656 |
}
|
657 |
|
@@ -682,7 +687,7 @@ function twig_slice(Twig_Environment $env, $item, $start, $length = null, $prese
|
|
682 |
/**
|
683 |
* Returns the first element of the item.
|
684 |
*
|
685 |
-
* @param Twig_Environment $env
|
686 |
* @param mixed $item A variable
|
687 |
*
|
688 |
* @return mixed The first element of the item
|
@@ -697,7 +702,7 @@ function twig_first(Twig_Environment $env, $item)
|
|
697 |
/**
|
698 |
* Returns the last element of the item.
|
699 |
*
|
700 |
-
* @param Twig_Environment $env
|
701 |
* @param mixed $item A variable
|
702 |
*
|
703 |
* @return mixed The last element of the item
|
@@ -753,7 +758,7 @@ function twig_join_filter($value, $glue = '')
|
|
753 |
* {# returns [aa, bb, cc] #}
|
754 |
* </pre>
|
755 |
*
|
756 |
-
* @param Twig_Environment $env
|
757 |
* @param string $value A string
|
758 |
* @param string $delimiter The delimiter
|
759 |
* @param int $limit The limit
|
@@ -820,7 +825,27 @@ function _twig_default_filter($value, $default = '')
|
|
820 |
function twig_get_array_keys_filter($array)
|
821 |
{
|
822 |
if ($array instanceof Traversable) {
|
823 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
824 |
}
|
825 |
|
826 |
if (!is_array($array)) {
|
@@ -833,7 +858,7 @@ function twig_get_array_keys_filter($array)
|
|
833 |
/**
|
834 |
* Reverses a variable.
|
835 |
*
|
836 |
-
* @param Twig_Environment $env
|
837 |
* @param array|Traversable|string $item An array, a Traversable instance, or a string
|
838 |
* @param bool $preserveKeys Whether to preserve key or not
|
839 |
*
|
@@ -900,7 +925,21 @@ function twig_in_filter($value, $compare)
|
|
900 |
} elseif (is_string($compare) && (is_string($value) || is_int($value) || is_float($value))) {
|
901 |
return '' === $value || false !== strpos($compare, (string) $value);
|
902 |
} elseif ($compare instanceof Traversable) {
|
903 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
904 |
}
|
905 |
|
906 |
return false;
|
@@ -909,7 +948,7 @@ function twig_in_filter($value, $compare)
|
|
909 |
/**
|
910 |
* Escapes a string.
|
911 |
*
|
912 |
-
* @param Twig_Environment $env
|
913 |
* @param mixed $string The value to be escaped
|
914 |
* @param string $strategy The escaping strategy
|
915 |
* @param string $charset The charset
|
@@ -990,7 +1029,7 @@ function twig_escape_filter(Twig_Environment $env, $string, $strategy = 'html',
|
|
990 |
$string = twig_convert_encoding($string, 'UTF-8', $charset);
|
991 |
}
|
992 |
|
993 |
-
if (0 == strlen($string) ? false :
|
994 |
throw new Twig_Error_Runtime('The string to escape is not a valid UTF-8 string.');
|
995 |
}
|
996 |
|
@@ -1007,7 +1046,7 @@ function twig_escape_filter(Twig_Environment $env, $string, $strategy = 'html',
|
|
1007 |
$string = twig_convert_encoding($string, 'UTF-8', $charset);
|
1008 |
}
|
1009 |
|
1010 |
-
if (0 == strlen($string) ? false :
|
1011 |
throw new Twig_Error_Runtime('The string to escape is not a valid UTF-8 string.');
|
1012 |
}
|
1013 |
|
@@ -1024,7 +1063,7 @@ function twig_escape_filter(Twig_Environment $env, $string, $strategy = 'html',
|
|
1024 |
$string = twig_convert_encoding($string, 'UTF-8', $charset);
|
1025 |
}
|
1026 |
|
1027 |
-
if (0 == strlen($string) ? false :
|
1028 |
throw new Twig_Error_Runtime('The string to escape is not a valid UTF-8 string.');
|
1029 |
}
|
1030 |
|
@@ -1188,7 +1227,7 @@ if (function_exists('mb_get_info')) {
|
|
1188 |
/**
|
1189 |
* Returns the length of a variable.
|
1190 |
*
|
1191 |
-
* @param Twig_Environment $env
|
1192 |
* @param mixed $thing A variable
|
1193 |
*
|
1194 |
* @return int The length of the value
|
@@ -1201,7 +1240,7 @@ if (function_exists('mb_get_info')) {
|
|
1201 |
/**
|
1202 |
* Converts a string to uppercase.
|
1203 |
*
|
1204 |
-
* @param Twig_Environment $env
|
1205 |
* @param string $string A string
|
1206 |
*
|
1207 |
* @return string The uppercased string
|
@@ -1218,7 +1257,7 @@ if (function_exists('mb_get_info')) {
|
|
1218 |
/**
|
1219 |
* Converts a string to lowercase.
|
1220 |
*
|
1221 |
-
* @param Twig_Environment $env
|
1222 |
* @param string $string A string
|
1223 |
*
|
1224 |
* @return string The lowercased string
|
@@ -1235,7 +1274,7 @@ if (function_exists('mb_get_info')) {
|
|
1235 |
/**
|
1236 |
* Returns a titlecased string.
|
1237 |
*
|
1238 |
-
* @param Twig_Environment $env
|
1239 |
* @param string $string A string
|
1240 |
*
|
1241 |
* @return string The titlecased string
|
@@ -1252,7 +1291,7 @@ if (function_exists('mb_get_info')) {
|
|
1252 |
/**
|
1253 |
* Returns a capitalized string.
|
1254 |
*
|
1255 |
-
* @param Twig_Environment $env
|
1256 |
* @param string $string A string
|
1257 |
*
|
1258 |
* @return string The capitalized string
|
@@ -1271,7 +1310,7 @@ else {
|
|
1271 |
/**
|
1272 |
* Returns the length of a variable.
|
1273 |
*
|
1274 |
-
* @param Twig_Environment $env
|
1275 |
* @param mixed $thing A variable
|
1276 |
*
|
1277 |
* @return int The length of the value
|
@@ -1284,7 +1323,7 @@ else {
|
|
1284 |
/**
|
1285 |
* Returns a titlecased string.
|
1286 |
*
|
1287 |
-
* @param Twig_Environment $env
|
1288 |
* @param string $string A string
|
1289 |
*
|
1290 |
* @return string The titlecased string
|
@@ -1297,7 +1336,7 @@ else {
|
|
1297 |
/**
|
1298 |
* Returns a capitalized string.
|
1299 |
*
|
1300 |
-
* @param Twig_Environment $env
|
1301 |
* @param string $string A string
|
1302 |
*
|
1303 |
* @return string The capitalized string
|
@@ -1401,6 +1440,18 @@ function twig_include(Twig_Environment $env, $context, $template, $variables = a
|
|
1401 |
|
1402 |
throw $e;
|
1403 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1404 |
}
|
1405 |
|
1406 |
if ($isSandboxed && !$alreadySandboxed) {
|
@@ -1452,6 +1503,23 @@ function twig_constant($constant, $object = null)
|
|
1452 |
return constant($constant);
|
1453 |
}
|
1454 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1455 |
/**
|
1456 |
* Batches item.
|
1457 |
*
|
8 |
/*
|
9 |
* This file is part of Twig.
|
10 |
*
|
11 |
+
* (c) Fabien Potencier
|
12 |
*
|
13 |
* For the full copyright and license information, please view the LICENSE
|
14 |
* file that was distributed with this source code.
|
15 |
*/
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @final
|
19 |
+
*/
|
20 |
class Twig_Extension_Core extends Twig_Extension
|
21 |
{
|
22 |
protected $dateFormats = array('F j, Y H:i', '%d days');
|
99 |
/**
|
100 |
* Sets the default format to be used by the number_format filter.
|
101 |
*
|
102 |
+
* @param int $decimal the number of decimal places to use
|
103 |
+
* @param string $decimalPoint the character(s) to use for the decimal point
|
104 |
+
* @param string $thousandSep the character(s) to use for the thousands separator
|
105 |
*/
|
106 |
public function setNumberFormat($decimal, $decimalPoint, $thousandSep)
|
107 |
{
|
136 |
new Twig_TokenParser_Flush(),
|
137 |
new Twig_TokenParser_Do(),
|
138 |
new Twig_TokenParser_Embed(),
|
139 |
+
new Twig_TokenParser_With(),
|
140 |
);
|
141 |
}
|
142 |
|
280 |
/**
|
281 |
* Cycles over a value.
|
282 |
*
|
283 |
+
* @param ArrayAccess|array $values
|
284 |
* @param int $position The cycle position
|
285 |
*
|
286 |
* @return string The next value in the cycle
|
300 |
* - a random character from a string
|
301 |
* - a random integer between 0 and the integer parameter.
|
302 |
*
|
303 |
+
* @param Twig_Environment $env
|
304 |
+
* @param Traversable|array|int|float|string $values The values to pick a random item from
|
305 |
*
|
306 |
+
* @throws Twig_Error_Runtime when $values is an empty array (does not apply to an empty string which is returned as is)
|
307 |
*
|
308 |
* @return mixed A random value from the given sequence
|
309 |
*/
|
360 |
* {{ post.published_at|date("m/d/Y") }}
|
361 |
* </pre>
|
362 |
*
|
363 |
+
* @param Twig_Environment $env
|
364 |
* @param DateTime|DateTimeInterface|DateInterval|string $date A date
|
365 |
* @param string|null $format The target format, null to use the default
|
366 |
* @param DateTimeZone|string|null|false $timezone The target timezone, null to use the default, false to leave unchanged
|
388 |
* {{ post.published_at|date_modify("-1day")|date("m/d/Y") }}
|
389 |
* </pre>
|
390 |
*
|
391 |
+
* @param Twig_Environment $env
|
392 |
* @param DateTime|string $date A date
|
393 |
* @param string $modifier A modifier string
|
394 |
*
|
414 |
* {% endif %}
|
415 |
* </pre>
|
416 |
*
|
417 |
+
* @param Twig_Environment $env
|
418 |
* @param DateTime|DateTimeInterface|string|null $date A date
|
419 |
* @param DateTimeZone|string|null|false $timezone The target timezone, null to use the default, false to leave unchanged
|
420 |
*
|
516 |
* be used. Supplying any of the parameters will override the defaults set in the
|
517 |
* environment object.
|
518 |
*
|
519 |
+
* @param Twig_Environment $env
|
520 |
* @param mixed $number A float/int/string of the number to format
|
521 |
+
* @param int $decimal the number of decimal points to display
|
522 |
+
* @param string $decimalPoint the character(s) to use for the decimal point
|
523 |
+
* @param string $thousandSep the character(s) to use for the thousands separator
|
524 |
*
|
525 |
* @return string The formatted number
|
526 |
*/
|
566 |
/**
|
567 |
* JSON encodes a variable.
|
568 |
*
|
569 |
+
* @param mixed $value the value to encode
|
570 |
* @param int $options Not used on PHP 5.2.x
|
571 |
*
|
572 |
* @return mixed The JSON encoded value
|
585 |
/**
|
586 |
* JSON encodes a variable.
|
587 |
*
|
588 |
+
* @param mixed $value the value to encode
|
589 |
* @param int $options Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT
|
590 |
*
|
591 |
* @return mixed The JSON encoded value
|
645 |
/**
|
646 |
* Slices a variable.
|
647 |
*
|
648 |
+
* @param Twig_Environment $env
|
649 |
* @param mixed $item A variable
|
650 |
* @param int $start Start of the slice
|
651 |
* @param int $length Size of the slice
|
656 |
function twig_slice(Twig_Environment $env, $item, $start, $length = null, $preserveKeys = false)
|
657 |
{
|
658 |
if ($item instanceof Traversable) {
|
659 |
+
while ($item instanceof IteratorAggregate) {
|
660 |
$item = $item->getIterator();
|
661 |
}
|
662 |
|
687 |
/**
|
688 |
* Returns the first element of the item.
|
689 |
*
|
690 |
+
* @param Twig_Environment $env
|
691 |
* @param mixed $item A variable
|
692 |
*
|
693 |
* @return mixed The first element of the item
|
702 |
/**
|
703 |
* Returns the last element of the item.
|
704 |
*
|
705 |
+
* @param Twig_Environment $env
|
706 |
* @param mixed $item A variable
|
707 |
*
|
708 |
* @return mixed The last element of the item
|
758 |
* {# returns [aa, bb, cc] #}
|
759 |
* </pre>
|
760 |
*
|
761 |
+
* @param Twig_Environment $env
|
762 |
* @param string $value A string
|
763 |
* @param string $delimiter The delimiter
|
764 |
* @param int $limit The limit
|
825 |
function twig_get_array_keys_filter($array)
|
826 |
{
|
827 |
if ($array instanceof Traversable) {
|
828 |
+
while ($array instanceof IteratorAggregate) {
|
829 |
+
$array = $array->getIterator();
|
830 |
+
}
|
831 |
+
|
832 |
+
if ($array instanceof Iterator) {
|
833 |
+
$keys = array();
|
834 |
+
$array->rewind();
|
835 |
+
while ($array->valid()) {
|
836 |
+
$keys[] = $array->key();
|
837 |
+
$array->next();
|
838 |
+
}
|
839 |
+
|
840 |
+
return $keys;
|
841 |
+
}
|
842 |
+
|
843 |
+
$keys = array();
|
844 |
+
foreach ($array as $key => $item) {
|
845 |
+
$keys[] = $key;
|
846 |
+
}
|
847 |
+
|
848 |
+
return $keys;
|
849 |
}
|
850 |
|
851 |
if (!is_array($array)) {
|
858 |
/**
|
859 |
* Reverses a variable.
|
860 |
*
|
861 |
+
* @param Twig_Environment $env
|
862 |
* @param array|Traversable|string $item An array, a Traversable instance, or a string
|
863 |
* @param bool $preserveKeys Whether to preserve key or not
|
864 |
*
|
925 |
} elseif (is_string($compare) && (is_string($value) || is_int($value) || is_float($value))) {
|
926 |
return '' === $value || false !== strpos($compare, (string) $value);
|
927 |
} elseif ($compare instanceof Traversable) {
|
928 |
+
if (is_object($value) || is_resource($value)) {
|
929 |
+
foreach ($compare as $item) {
|
930 |
+
if ($item === $value) {
|
931 |
+
return true;
|
932 |
+
}
|
933 |
+
}
|
934 |
+
} else {
|
935 |
+
foreach ($compare as $item) {
|
936 |
+
if ($item == $value) {
|
937 |
+
return true;
|
938 |
+
}
|
939 |
+
}
|
940 |
+
}
|
941 |
+
|
942 |
+
return false;
|
943 |
}
|
944 |
|
945 |
return false;
|
948 |
/**
|
949 |
* Escapes a string.
|
950 |
*
|
951 |
+
* @param Twig_Environment $env
|
952 |
* @param mixed $string The value to be escaped
|
953 |
* @param string $strategy The escaping strategy
|
954 |
* @param string $charset The charset
|
1029 |
$string = twig_convert_encoding($string, 'UTF-8', $charset);
|
1030 |
}
|
1031 |
|
1032 |
+
if (0 == strlen($string) ? false : 1 !== preg_match('/^./su', $string)) {
|
1033 |
throw new Twig_Error_Runtime('The string to escape is not a valid UTF-8 string.');
|
1034 |
}
|
1035 |
|
1046 |
$string = twig_convert_encoding($string, 'UTF-8', $charset);
|
1047 |
}
|
1048 |
|
1049 |
+
if (0 == strlen($string) ? false : 1 !== preg_match('/^./su', $string)) {
|
1050 |
throw new Twig_Error_Runtime('The string to escape is not a valid UTF-8 string.');
|
1051 |
}
|
1052 |
|
1063 |
$string = twig_convert_encoding($string, 'UTF-8', $charset);
|
1064 |
}
|
1065 |
|
1066 |
+
if (0 == strlen($string) ? false : 1 !== preg_match('/^./su', $string)) {
|
1067 |
throw new Twig_Error_Runtime('The string to escape is not a valid UTF-8 string.');
|
1068 |
}
|
1069 |
|
1227 |
/**
|
1228 |
* Returns the length of a variable.
|
1229 |
*
|
1230 |
+
* @param Twig_Environment $env
|
1231 |
* @param mixed $thing A variable
|
1232 |
*
|
1233 |
* @return int The length of the value
|
1240 |
/**
|
1241 |
* Converts a string to uppercase.
|
1242 |
*
|
1243 |
+
* @param Twig_Environment $env
|
1244 |
* @param string $string A string
|
1245 |
*
|
1246 |
* @return string The uppercased string
|
1257 |
/**
|
1258 |
* Converts a string to lowercase.
|
1259 |
*
|
1260 |
+
* @param Twig_Environment $env
|
1261 |
* @param string $string A string
|
1262 |
*
|
1263 |
* @return string The lowercased string
|
1274 |
/**
|
1275 |
* Returns a titlecased string.
|
1276 |
*
|
1277 |
+
* @param Twig_Environment $env
|
1278 |
* @param string $string A string
|
1279 |
*
|
1280 |
* @return string The titlecased string
|
1291 |
/**
|
1292 |
* Returns a capitalized string.
|
1293 |
*
|
1294 |
+
* @param Twig_Environment $env
|
1295 |
* @param string $string A string
|
1296 |
*
|
1297 |
* @return string The capitalized string
|
1310 |
/**
|
1311 |
* Returns the length of a variable.
|
1312 |
*
|
1313 |
+
* @param Twig_Environment $env
|
1314 |
* @param mixed $thing A variable
|
1315 |
*
|
1316 |
* @return int The length of the value
|
1323 |
/**
|
1324 |
* Returns a titlecased string.
|
1325 |
*
|
1326 |
+
* @param Twig_Environment $env
|
1327 |
* @param string $string A string
|
1328 |
*
|
1329 |
* @return string The titlecased string
|
1336 |
/**
|
1337 |
* Returns a capitalized string.
|
1338 |
*
|
1339 |
+
* @param Twig_Environment $env
|
1340 |
* @param string $string A string
|
1341 |
*
|
1342 |
* @return string The capitalized string
|
1440 |
|
1441 |
throw $e;
|
1442 |
}
|
1443 |
+
} catch (Throwable $e) {
|
1444 |
+
if ($isSandboxed && !$alreadySandboxed) {
|
1445 |
+
$sandbox->disableSandbox();
|
1446 |
+
}
|
1447 |
+
|
1448 |
+
throw $e;
|
1449 |
+
} catch (Exception $e) {
|
1450 |
+
if ($isSandboxed && !$alreadySandboxed) {
|
1451 |
+
$sandbox->disableSandbox();
|
1452 |
+
}
|
1453 |
+
|
1454 |
+
throw $e;
|
1455 |
}
|
1456 |
|
1457 |
if ($isSandboxed && !$alreadySandboxed) {
|
1503 |
return constant($constant);
|
1504 |
}
|
1505 |
|
1506 |
+
/**
|
1507 |
+
* Checks if a constant exists.
|
1508 |
+
*
|
1509 |
+
* @param string $constant The name of the constant
|
1510 |
+
* @param null|object $object The object to get the constant from
|
1511 |
+
*
|
1512 |
+
* @return bool
|
1513 |
+
*/
|
1514 |
+
function twig_constant_is_defined($constant, $object = null)
|
1515 |
+
{
|
1516 |
+
if (null !== $object) {
|
1517 |
+
$constant = get_class($object).'::'.$constant;
|
1518 |
+
}
|
1519 |
+
|
1520 |
+
return defined($constant);
|
1521 |
+
}
|
1522 |
+
|
1523 |
/**
|
1524 |
* Batches item.
|
1525 |
*
|
vendor/twig/twig/lib/Twig/Extension/Debug.php
CHANGED
@@ -3,11 +3,15 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
|
|
|
|
|
|
|
|
11 |
class Twig_Extension_Debug extends Twig_Extension
|
12 |
{
|
13 |
public function getFunctions()
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @final
|
14 |
+
*/
|
15 |
class Twig_Extension_Debug extends Twig_Extension
|
16 |
{
|
17 |
public function getFunctions()
|
vendor/twig/twig/lib/Twig/Extension/Escaper.php
CHANGED
@@ -3,18 +3,20 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
|
|
|
|
|
|
|
|
11 |
class Twig_Extension_Escaper extends Twig_Extension
|
12 |
{
|
13 |
protected $defaultStrategy;
|
14 |
|
15 |
/**
|
16 |
-
* Constructor.
|
17 |
-
*
|
18 |
* @param string|false|callable $defaultStrategy An escaping strategy
|
19 |
*
|
20 |
* @see setDefaultStrategy()
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @final
|
14 |
+
*/
|
15 |
class Twig_Extension_Escaper extends Twig_Extension
|
16 |
{
|
17 |
protected $defaultStrategy;
|
18 |
|
19 |
/**
|
|
|
|
|
20 |
* @param string|false|callable $defaultStrategy An escaping strategy
|
21 |
*
|
22 |
* @see setDefaultStrategy()
|
vendor/twig/twig/lib/Twig/Extension/Optimizer.php
CHANGED
@@ -3,11 +3,15 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
|
|
|
|
|
|
|
|
11 |
class Twig_Extension_Optimizer extends Twig_Extension
|
12 |
{
|
13 |
protected $optimizers;
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @final
|
14 |
+
*/
|
15 |
class Twig_Extension_Optimizer extends Twig_Extension
|
16 |
{
|
17 |
protected $optimizers;
|
vendor/twig/twig/lib/Twig/Extension/Profiler.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Extension/Sandbox.php
CHANGED
@@ -3,11 +3,15 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
|
|
|
|
|
|
|
|
11 |
class Twig_Extension_Sandbox extends Twig_Extension
|
12 |
{
|
13 |
protected $sandboxedGlobally;
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @final
|
14 |
+
*/
|
15 |
class Twig_Extension_Sandbox extends Twig_Extension
|
16 |
{
|
17 |
protected $sandboxedGlobally;
|
vendor/twig/twig/lib/Twig/Extension/Staging.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -29,6 +29,10 @@ class Twig_Extension_Staging extends Twig_Extension
|
|
29 |
|
30 |
public function addFunction($name, $function)
|
31 |
{
|
|
|
|
|
|
|
|
|
32 |
$this->functions[$name] = $function;
|
33 |
}
|
34 |
|
@@ -39,6 +43,10 @@ class Twig_Extension_Staging extends Twig_Extension
|
|
39 |
|
40 |
public function addFilter($name, $filter)
|
41 |
{
|
|
|
|
|
|
|
|
|
42 |
$this->filters[$name] = $filter;
|
43 |
}
|
44 |
|
@@ -59,7 +67,11 @@ class Twig_Extension_Staging extends Twig_Extension
|
|
59 |
|
60 |
public function addTokenParser(Twig_TokenParserInterface $parser)
|
61 |
{
|
62 |
-
$this->tokenParsers[]
|
|
|
|
|
|
|
|
|
63 |
}
|
64 |
|
65 |
public function getTokenParsers()
|
@@ -79,6 +91,10 @@ class Twig_Extension_Staging extends Twig_Extension
|
|
79 |
|
80 |
public function addTest($name, $test)
|
81 |
{
|
|
|
|
|
|
|
|
|
82 |
$this->tests[$name] = $test;
|
83 |
}
|
84 |
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
29 |
|
30 |
public function addFunction($name, $function)
|
31 |
{
|
32 |
+
if (isset($this->functions[$name])) {
|
33 |
+
@trigger_error(sprintf('Overriding function "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $name), E_USER_DEPRECATED);
|
34 |
+
}
|
35 |
+
|
36 |
$this->functions[$name] = $function;
|
37 |
}
|
38 |
|
43 |
|
44 |
public function addFilter($name, $filter)
|
45 |
{
|
46 |
+
if (isset($this->filters[$name])) {
|
47 |
+
@trigger_error(sprintf('Overriding filter "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $name), E_USER_DEPRECATED);
|
48 |
+
}
|
49 |
+
|
50 |
$this->filters[$name] = $filter;
|
51 |
}
|
52 |
|
67 |
|
68 |
public function addTokenParser(Twig_TokenParserInterface $parser)
|
69 |
{
|
70 |
+
if (isset($this->tokenParsers[$parser->getTag()])) {
|
71 |
+
@trigger_error(sprintf('Overriding tag "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $parser->getTag()), E_USER_DEPRECATED);
|
72 |
+
}
|
73 |
+
|
74 |
+
$this->tokenParsers[$parser->getTag()] = $parser;
|
75 |
}
|
76 |
|
77 |
public function getTokenParsers()
|
91 |
|
92 |
public function addTest($name, $test)
|
93 |
{
|
94 |
+
if (isset($this->tests[$name])) {
|
95 |
+
@trigger_error(sprintf('Overriding test "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $name), E_USER_DEPRECATED);
|
96 |
+
}
|
97 |
+
|
98 |
$this->tests[$name] = $test;
|
99 |
}
|
100 |
|
vendor/twig/twig/lib/Twig/Extension/StringLoader.php
CHANGED
@@ -3,11 +3,15 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
|
|
|
|
|
|
|
|
11 |
class Twig_Extension_StringLoader extends Twig_Extension
|
12 |
{
|
13 |
public function getFunctions()
|
@@ -33,7 +37,7 @@ class Twig_Extension_StringLoader extends Twig_Extension
|
|
33 |
* @param Twig_Environment $env A Twig_Environment instance
|
34 |
* @param string $template A template as a string or object implementing __toString()
|
35 |
*
|
36 |
-
* @return Twig_Template
|
37 |
*/
|
38 |
function twig_template_from_string(Twig_Environment $env, $template)
|
39 |
{
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @final
|
14 |
+
*/
|
15 |
class Twig_Extension_StringLoader extends Twig_Extension
|
16 |
{
|
17 |
public function getFunctions()
|
37 |
* @param Twig_Environment $env A Twig_Environment instance
|
38 |
* @param string $template A template as a string or object implementing __toString()
|
39 |
*
|
40 |
+
* @return Twig_Template
|
41 |
*/
|
42 |
function twig_template_from_string(Twig_Environment $env, $template)
|
43 |
{
|
vendor/twig/twig/lib/Twig/ExtensionInterface.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -21,8 +21,6 @@ interface Twig_ExtensionInterface
|
|
21 |
*
|
22 |
* This is where you can load some file that contains filter functions for instance.
|
23 |
*
|
24 |
-
* @param Twig_Environment $environment The current Twig_Environment instance
|
25 |
-
*
|
26 |
* @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_InitRuntimeInterface instead
|
27 |
*/
|
28 |
public function initRuntime(Twig_Environment $environment);
|
@@ -37,7 +35,7 @@ interface Twig_ExtensionInterface
|
|
37 |
/**
|
38 |
* Returns the node visitor instances to add to the existing list.
|
39 |
*
|
40 |
-
* @return Twig_NodeVisitorInterface[]
|
41 |
*/
|
42 |
public function getNodeVisitors();
|
43 |
|
@@ -65,7 +63,7 @@ interface Twig_ExtensionInterface
|
|
65 |
/**
|
66 |
* Returns a list of operators to add to the existing list.
|
67 |
*
|
68 |
-
* @return array
|
69 |
*/
|
70 |
public function getOperators();
|
71 |
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
21 |
*
|
22 |
* This is where you can load some file that contains filter functions for instance.
|
23 |
*
|
|
|
|
|
24 |
* @deprecated since 1.23 (to be removed in 2.0), implement Twig_Extension_InitRuntimeInterface instead
|
25 |
*/
|
26 |
public function initRuntime(Twig_Environment $environment);
|
35 |
/**
|
36 |
* Returns the node visitor instances to add to the existing list.
|
37 |
*
|
38 |
+
* @return Twig_NodeVisitorInterface[]
|
39 |
*/
|
40 |
public function getNodeVisitors();
|
41 |
|
63 |
/**
|
64 |
* Returns a list of operators to add to the existing list.
|
65 |
*
|
66 |
+
* @return array<array> First array of unary operators, second array of binary operators
|
67 |
*/
|
68 |
public function getOperators();
|
69 |
|
vendor/twig/twig/lib/Twig/FactoryRuntimeLoader.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of Twig.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Lazy loads the runtime implementations for a Twig element.
|
14 |
+
*
|
15 |
+
* @author Robin Chalas <robin.chalas@gmail.com>
|
16 |
+
*/
|
17 |
+
class Twig_FactoryRuntimeLoader implements Twig_RuntimeLoaderInterface
|
18 |
+
{
|
19 |
+
private $map;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* @param array $map An array where keys are class names and values factory callables
|
23 |
+
*/
|
24 |
+
public function __construct($map = array())
|
25 |
+
{
|
26 |
+
$this->map = $map;
|
27 |
+
}
|
28 |
+
|
29 |
+
public function load($class)
|
30 |
+
{
|
31 |
+
if (isset($this->map[$class])) {
|
32 |
+
$runtimeFactory = $this->map[$class];
|
33 |
+
|
34 |
+
return $runtimeFactory();
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
vendor/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Filter.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Filter/Function.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Filter/Method.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Filter/Node.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/FilterCallableInterface.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/FilterInterface.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Function.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Function/Function.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Arnaud Le Blanc
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Function/Method.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Arnaud Le Blanc
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Function/Node.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/FunctionCallableInterface.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/FunctionInterface.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Arnaud Le Blanc
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Lexer.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
@@ -34,6 +34,8 @@ class Twig_Lexer implements Twig_LexerInterface
|
|
34 |
protected $positions;
|
35 |
protected $currentVarBlockLine;
|
36 |
|
|
|
|
|
37 |
const STATE_DATA = 0;
|
38 |
const STATE_BLOCK = 1;
|
39 |
const STATE_VAR = 2;
|
@@ -73,16 +75,17 @@ class Twig_Lexer implements Twig_LexerInterface
|
|
73 |
);
|
74 |
}
|
75 |
|
76 |
-
/**
|
77 |
-
* {@inheritdoc}
|
78 |
-
*/
|
79 |
public function tokenize($code, $name = null)
|
80 |
{
|
81 |
if (!$code instanceof Twig_Source) {
|
82 |
@trigger_error(sprintf('Passing a string as the $code argument of %s() is deprecated since version 1.27 and will be removed in 2.0. Pass a Twig_Source instance instead.', __METHOD__), E_USER_DEPRECATED);
|
83 |
-
$source = new Twig_Source($code, $name);
|
84 |
} else {
|
85 |
-
$source = $code;
|
|
|
|
|
|
|
|
|
86 |
}
|
87 |
|
88 |
if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) {
|
@@ -92,8 +95,8 @@ class Twig_Lexer implements Twig_LexerInterface
|
|
92 |
$mbEncoding = null;
|
93 |
}
|
94 |
|
95 |
-
$this->code = str_replace(array("\r\n", "\r"), "\n", $source->getCode());
|
96 |
-
$this->filename = $source->getName();
|
97 |
$this->cursor = 0;
|
98 |
$this->lineno = 1;
|
99 |
$this->end = strlen($this->code);
|
@@ -137,14 +140,14 @@ class Twig_Lexer implements Twig_LexerInterface
|
|
137 |
|
138 |
if (!empty($this->brackets)) {
|
139 |
list($expect, $lineno) = array_pop($this->brackets);
|
140 |
-
throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $expect), $lineno, $this->
|
141 |
}
|
142 |
|
143 |
if ($mbEncoding) {
|
144 |
mb_internal_encoding($mbEncoding);
|
145 |
}
|
146 |
|
147 |
-
return new Twig_TokenStream($this->tokens, $source);
|
148 |
}
|
149 |
|
150 |
protected function lexData()
|
@@ -232,7 +235,7 @@ class Twig_Lexer implements Twig_LexerInterface
|
|
232 |
$this->moveCursor($match[0]);
|
233 |
|
234 |
if ($this->cursor >= $this->end) {
|
235 |
-
throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $this->state === self::STATE_BLOCK ? 'block' : 'variable'), $this->currentVarBlockLine, $this->
|
236 |
}
|
237 |
}
|
238 |
|
@@ -264,12 +267,12 @@ class Twig_Lexer implements Twig_LexerInterface
|
|
264 |
// closing bracket
|
265 |
elseif (false !== strpos(')]}', $this->code[$this->cursor])) {
|
266 |
if (empty($this->brackets)) {
|
267 |
-
throw new Twig_Error_Syntax(sprintf('Unexpected "%s".', $this->code[$this->cursor]), $this->lineno, $this->
|
268 |
}
|
269 |
|
270 |
list($expect, $lineno) = array_pop($this->brackets);
|
271 |
if ($this->code[$this->cursor] != strtr($expect, '([{', ')]}')) {
|
272 |
-
throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $expect), $lineno, $this->
|
273 |
}
|
274 |
}
|
275 |
|
@@ -289,7 +292,7 @@ class Twig_Lexer implements Twig_LexerInterface
|
|
289 |
}
|
290 |
// unlexable
|
291 |
else {
|
292 |
-
throw new Twig_Error_Syntax(sprintf('Unexpected character "%s".', $this->code[$this->cursor]), $this->lineno, $this->
|
293 |
}
|
294 |
}
|
295 |
|
@@ -300,7 +303,7 @@ class Twig_Lexer implements Twig_LexerInterface
|
|
300 |
}
|
301 |
|
302 |
if (!preg_match(str_replace('%s', $tag, $this->regexes['lex_raw_data']), $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) {
|
303 |
-
throw new Twig_Error_Syntax(sprintf('Unexpected end of file: Unclosed "%s" block.', $tag), $this->lineno, $this->
|
304 |
}
|
305 |
|
306 |
$text = substr($this->code, $this->cursor, $match[0][1] - $this->cursor);
|
@@ -316,7 +319,7 @@ class Twig_Lexer implements Twig_LexerInterface
|
|
316 |
protected function lexComment()
|
317 |
{
|
318 |
if (!preg_match($this->regexes['lex_comment'], $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) {
|
319 |
-
throw new Twig_Error_Syntax('Unclosed comment.', $this->lineno, $this->
|
320 |
}
|
321 |
|
322 |
$this->moveCursor(substr($this->code, $this->cursor, $match[0][1] - $this->cursor).$match[0][0]);
|
@@ -335,7 +338,7 @@ class Twig_Lexer implements Twig_LexerInterface
|
|
335 |
} elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) {
|
336 |
list($expect, $lineno) = array_pop($this->brackets);
|
337 |
if ($this->code[$this->cursor] != '"') {
|
338 |
-
throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $expect), $lineno, $this->
|
339 |
}
|
340 |
|
341 |
$this->popState();
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
34 |
protected $positions;
|
35 |
protected $currentVarBlockLine;
|
36 |
|
37 |
+
private $source;
|
38 |
+
|
39 |
const STATE_DATA = 0;
|
40 |
const STATE_BLOCK = 1;
|
41 |
const STATE_VAR = 2;
|
75 |
);
|
76 |
}
|
77 |
|
|
|
|
|
|
|
78 |
public function tokenize($code, $name = null)
|
79 |
{
|
80 |
if (!$code instanceof Twig_Source) {
|
81 |
@trigger_error(sprintf('Passing a string as the $code argument of %s() is deprecated since version 1.27 and will be removed in 2.0. Pass a Twig_Source instance instead.', __METHOD__), E_USER_DEPRECATED);
|
82 |
+
$this->source = new Twig_Source($code, $name);
|
83 |
} else {
|
84 |
+
$this->source = $code;
|
85 |
+
}
|
86 |
+
|
87 |
+
if (((int) ini_get('mbstring.func_overload')) & 2) {
|
88 |
+
@trigger_error('Support for having "mbstring.func_overload" different from 0 is deprecated version 1.29 and will be removed in 2.0.', E_USER_DEPRECATED);
|
89 |
}
|
90 |
|
91 |
if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) {
|
95 |
$mbEncoding = null;
|
96 |
}
|
97 |
|
98 |
+
$this->code = str_replace(array("\r\n", "\r"), "\n", $this->source->getCode());
|
99 |
+
$this->filename = $this->source->getName();
|
100 |
$this->cursor = 0;
|
101 |
$this->lineno = 1;
|
102 |
$this->end = strlen($this->code);
|
140 |
|
141 |
if (!empty($this->brackets)) {
|
142 |
list($expect, $lineno) = array_pop($this->brackets);
|
143 |
+
throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $expect), $lineno, $this->source);
|
144 |
}
|
145 |
|
146 |
if ($mbEncoding) {
|
147 |
mb_internal_encoding($mbEncoding);
|
148 |
}
|
149 |
|
150 |
+
return new Twig_TokenStream($this->tokens, $this->source);
|
151 |
}
|
152 |
|
153 |
protected function lexData()
|
235 |
$this->moveCursor($match[0]);
|
236 |
|
237 |
if ($this->cursor >= $this->end) {
|
238 |
+
throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $this->state === self::STATE_BLOCK ? 'block' : 'variable'), $this->currentVarBlockLine, $this->source);
|
239 |
}
|
240 |
}
|
241 |
|
267 |
// closing bracket
|
268 |
elseif (false !== strpos(')]}', $this->code[$this->cursor])) {
|
269 |
if (empty($this->brackets)) {
|
270 |
+
throw new Twig_Error_Syntax(sprintf('Unexpected "%s".', $this->code[$this->cursor]), $this->lineno, $this->source);
|
271 |
}
|
272 |
|
273 |
list($expect, $lineno) = array_pop($this->brackets);
|
274 |
if ($this->code[$this->cursor] != strtr($expect, '([{', ')]}')) {
|
275 |
+
throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $expect), $lineno, $this->source);
|
276 |
}
|
277 |
}
|
278 |
|
292 |
}
|
293 |
// unlexable
|
294 |
else {
|
295 |
+
throw new Twig_Error_Syntax(sprintf('Unexpected character "%s".', $this->code[$this->cursor]), $this->lineno, $this->source);
|
296 |
}
|
297 |
}
|
298 |
|
303 |
}
|
304 |
|
305 |
if (!preg_match(str_replace('%s', $tag, $this->regexes['lex_raw_data']), $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) {
|
306 |
+
throw new Twig_Error_Syntax(sprintf('Unexpected end of file: Unclosed "%s" block.', $tag), $this->lineno, $this->source);
|
307 |
}
|
308 |
|
309 |
$text = substr($this->code, $this->cursor, $match[0][1] - $this->cursor);
|
319 |
protected function lexComment()
|
320 |
{
|
321 |
if (!preg_match($this->regexes['lex_comment'], $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) {
|
322 |
+
throw new Twig_Error_Syntax('Unclosed comment.', $this->lineno, $this->source);
|
323 |
}
|
324 |
|
325 |
$this->moveCursor(substr($this->code, $this->cursor, $match[0][1] - $this->cursor).$match[0][0]);
|
338 |
} elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) {
|
339 |
list($expect, $lineno) = array_pop($this->brackets);
|
340 |
if ($this->code[$this->cursor] != '"') {
|
341 |
+
throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $expect), $lineno, $this->source);
|
342 |
}
|
343 |
|
344 |
$this->popState();
|
vendor/twig/twig/lib/Twig/LexerInterface.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -24,7 +24,7 @@ interface Twig_LexerInterface
|
|
24 |
* @param string|Twig_Source $code The source code
|
25 |
* @param string $name A unique identifier for the source code
|
26 |
*
|
27 |
-
* @return Twig_TokenStream
|
28 |
*
|
29 |
* @throws Twig_Error_Syntax When the code is syntactically wrong
|
30 |
*/
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
24 |
* @param string|Twig_Source $code The source code
|
25 |
* @param string $name A unique identifier for the source code
|
26 |
*
|
27 |
+
* @return Twig_TokenStream
|
28 |
*
|
29 |
* @throws Twig_Error_Syntax When the code is syntactically wrong
|
30 |
*/
|
vendor/twig/twig/lib/Twig/Loader/Array.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -19,6 +19,8 @@
|
|
19 |
*
|
20 |
* This loader should only be used for unit testing.
|
21 |
*
|
|
|
|
|
22 |
* @author Fabien Potencier <fabien@symfony.com>
|
23 |
*/
|
24 |
class Twig_Loader_Array implements Twig_LoaderInterface, Twig_ExistsLoaderInterface, Twig_SourceContextLoaderInterface
|
@@ -26,11 +28,9 @@ class Twig_Loader_Array implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
|
|
26 |
protected $templates = array();
|
27 |
|
28 |
/**
|
29 |
-
* Constructor.
|
30 |
-
*
|
31 |
* @param array $templates An array of templates (keys are the names, and values are the source code)
|
32 |
*/
|
33 |
-
public function __construct(array $templates)
|
34 |
{
|
35 |
$this->templates = $templates;
|
36 |
}
|
@@ -46,9 +46,6 @@ class Twig_Loader_Array implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
|
|
46 |
$this->templates[(string) $name] = $template;
|
47 |
}
|
48 |
|
49 |
-
/**
|
50 |
-
* {@inheritdoc}
|
51 |
-
*/
|
52 |
public function getSource($name)
|
53 |
{
|
54 |
@trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', get_class($this)), E_USER_DEPRECATED);
|
@@ -61,9 +58,6 @@ class Twig_Loader_Array implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
|
|
61 |
return $this->templates[$name];
|
62 |
}
|
63 |
|
64 |
-
/**
|
65 |
-
* {@inheritdoc}
|
66 |
-
*/
|
67 |
public function getSourceContext($name)
|
68 |
{
|
69 |
$name = (string) $name;
|
@@ -74,17 +68,11 @@ class Twig_Loader_Array implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
|
|
74 |
return new Twig_Source($this->templates[$name], $name);
|
75 |
}
|
76 |
|
77 |
-
/**
|
78 |
-
* {@inheritdoc}
|
79 |
-
*/
|
80 |
public function exists($name)
|
81 |
{
|
82 |
return isset($this->templates[(string) $name]);
|
83 |
}
|
84 |
|
85 |
-
/**
|
86 |
-
* {@inheritdoc}
|
87 |
-
*/
|
88 |
public function getCacheKey($name)
|
89 |
{
|
90 |
$name = (string) $name;
|
@@ -95,9 +83,6 @@ class Twig_Loader_Array implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
|
|
95 |
return $this->templates[$name];
|
96 |
}
|
97 |
|
98 |
-
/**
|
99 |
-
* {@inheritdoc}
|
100 |
-
*/
|
101 |
public function isFresh($name, $time)
|
102 |
{
|
103 |
$name = (string) $name;
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
19 |
*
|
20 |
* This loader should only be used for unit testing.
|
21 |
*
|
22 |
+
* @final
|
23 |
+
*
|
24 |
* @author Fabien Potencier <fabien@symfony.com>
|
25 |
*/
|
26 |
class Twig_Loader_Array implements Twig_LoaderInterface, Twig_ExistsLoaderInterface, Twig_SourceContextLoaderInterface
|
28 |
protected $templates = array();
|
29 |
|
30 |
/**
|
|
|
|
|
31 |
* @param array $templates An array of templates (keys are the names, and values are the source code)
|
32 |
*/
|
33 |
+
public function __construct(array $templates = array())
|
34 |
{
|
35 |
$this->templates = $templates;
|
36 |
}
|
46 |
$this->templates[(string) $name] = $template;
|
47 |
}
|
48 |
|
|
|
|
|
|
|
49 |
public function getSource($name)
|
50 |
{
|
51 |
@trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', get_class($this)), E_USER_DEPRECATED);
|
58 |
return $this->templates[$name];
|
59 |
}
|
60 |
|
|
|
|
|
|
|
61 |
public function getSourceContext($name)
|
62 |
{
|
63 |
$name = (string) $name;
|
68 |
return new Twig_Source($this->templates[$name], $name);
|
69 |
}
|
70 |
|
|
|
|
|
|
|
71 |
public function exists($name)
|
72 |
{
|
73 |
return isset($this->templates[(string) $name]);
|
74 |
}
|
75 |
|
|
|
|
|
|
|
76 |
public function getCacheKey($name)
|
77 |
{
|
78 |
$name = (string) $name;
|
83 |
return $this->templates[$name];
|
84 |
}
|
85 |
|
|
|
|
|
|
|
86 |
public function isFresh($name, $time)
|
87 |
{
|
88 |
$name = (string) $name;
|
vendor/twig/twig/lib/Twig/Loader/Chain.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -12,6 +12,8 @@
|
|
12 |
/**
|
13 |
* Loads templates from other loaders.
|
14 |
*
|
|
|
|
|
15 |
* @author Fabien Potencier <fabien@symfony.com>
|
16 |
*/
|
17 |
class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterface, Twig_SourceContextLoaderInterface
|
@@ -20,9 +22,7 @@ class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
|
|
20 |
protected $loaders = array();
|
21 |
|
22 |
/**
|
23 |
-
*
|
24 |
-
*
|
25 |
-
* @param Twig_LoaderInterface[] $loaders An array of loader instances
|
26 |
*/
|
27 |
public function __construct(array $loaders = array())
|
28 |
{
|
@@ -31,20 +31,12 @@ class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
|
|
31 |
}
|
32 |
}
|
33 |
|
34 |
-
/**
|
35 |
-
* Adds a loader instance.
|
36 |
-
*
|
37 |
-
* @param Twig_LoaderInterface $loader A Loader instance
|
38 |
-
*/
|
39 |
public function addLoader(Twig_LoaderInterface $loader)
|
40 |
{
|
41 |
$this->loaders[] = $loader;
|
42 |
$this->hasSourceCache = array();
|
43 |
}
|
44 |
|
45 |
-
/**
|
46 |
-
* {@inheritdoc}
|
47 |
-
*/
|
48 |
public function getSource($name)
|
49 |
{
|
50 |
@trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', get_class($this)), E_USER_DEPRECATED);
|
@@ -65,9 +57,6 @@ class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
|
|
65 |
throw new Twig_Error_Loader(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : ''));
|
66 |
}
|
67 |
|
68 |
-
/**
|
69 |
-
* {@inheritdoc}
|
70 |
-
*/
|
71 |
public function getSourceContext($name)
|
72 |
{
|
73 |
$exceptions = array();
|
@@ -90,9 +79,6 @@ class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
|
|
90 |
throw new Twig_Error_Loader(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : ''));
|
91 |
}
|
92 |
|
93 |
-
/**
|
94 |
-
* {@inheritdoc}
|
95 |
-
*/
|
96 |
public function exists($name)
|
97 |
{
|
98 |
$name = (string) $name;
|
@@ -125,9 +111,6 @@ class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
|
|
125 |
return $this->hasSourceCache[$name] = false;
|
126 |
}
|
127 |
|
128 |
-
/**
|
129 |
-
* {@inheritdoc}
|
130 |
-
*/
|
131 |
public function getCacheKey($name)
|
132 |
{
|
133 |
$exceptions = array();
|
@@ -146,9 +129,6 @@ class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
|
|
146 |
throw new Twig_Error_Loader(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : ''));
|
147 |
}
|
148 |
|
149 |
-
/**
|
150 |
-
* {@inheritdoc}
|
151 |
-
*/
|
152 |
public function isFresh($name, $time)
|
153 |
{
|
154 |
$exceptions = array();
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
12 |
/**
|
13 |
* Loads templates from other loaders.
|
14 |
*
|
15 |
+
* @final
|
16 |
+
*
|
17 |
* @author Fabien Potencier <fabien@symfony.com>
|
18 |
*/
|
19 |
class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterface, Twig_SourceContextLoaderInterface
|
22 |
protected $loaders = array();
|
23 |
|
24 |
/**
|
25 |
+
* @param Twig_LoaderInterface[] $loaders
|
|
|
|
|
26 |
*/
|
27 |
public function __construct(array $loaders = array())
|
28 |
{
|
31 |
}
|
32 |
}
|
33 |
|
|
|
|
|
|
|
|
|
|
|
34 |
public function addLoader(Twig_LoaderInterface $loader)
|
35 |
{
|
36 |
$this->loaders[] = $loader;
|
37 |
$this->hasSourceCache = array();
|
38 |
}
|
39 |
|
|
|
|
|
|
|
40 |
public function getSource($name)
|
41 |
{
|
42 |
@trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', get_class($this)), E_USER_DEPRECATED);
|
57 |
throw new Twig_Error_Loader(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : ''));
|
58 |
}
|
59 |
|
|
|
|
|
|
|
60 |
public function getSourceContext($name)
|
61 |
{
|
62 |
$exceptions = array();
|
79 |
throw new Twig_Error_Loader(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : ''));
|
80 |
}
|
81 |
|
|
|
|
|
|
|
82 |
public function exists($name)
|
83 |
{
|
84 |
$name = (string) $name;
|
111 |
return $this->hasSourceCache[$name] = false;
|
112 |
}
|
113 |
|
|
|
|
|
|
|
114 |
public function getCacheKey($name)
|
115 |
{
|
116 |
$exceptions = array();
|
129 |
throw new Twig_Error_Loader(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : ''));
|
130 |
}
|
131 |
|
|
|
|
|
|
|
132 |
public function isFresh($name, $time)
|
133 |
{
|
134 |
$exceptions = array();
|
vendor/twig/twig/lib/Twig/Loader/Filesystem.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -26,8 +26,6 @@ class Twig_Loader_Filesystem implements Twig_LoaderInterface, Twig_ExistsLoaderI
|
|
26 |
private $rootPath;
|
27 |
|
28 |
/**
|
29 |
-
* Constructor.
|
30 |
-
*
|
31 |
* @param string|array $paths A path or an array of paths where to look for templates
|
32 |
* @param string|null $rootPath The root path common to all relative paths (null for getcwd())
|
33 |
*/
|
@@ -133,9 +131,6 @@ class Twig_Loader_Filesystem implements Twig_LoaderInterface, Twig_ExistsLoaderI
|
|
133 |
}
|
134 |
}
|
135 |
|
136 |
-
/**
|
137 |
-
* {@inheritdoc}
|
138 |
-
*/
|
139 |
public function getSource($name)
|
140 |
{
|
141 |
@trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', get_class($this)), E_USER_DEPRECATED);
|
@@ -143,9 +138,6 @@ class Twig_Loader_Filesystem implements Twig_LoaderInterface, Twig_ExistsLoaderI
|
|
143 |
return file_get_contents($this->findTemplate($name));
|
144 |
}
|
145 |
|
146 |
-
/**
|
147 |
-
* {@inheritdoc}
|
148 |
-
*/
|
149 |
public function getSourceContext($name)
|
150 |
{
|
151 |
$path = $this->findTemplate($name);
|
@@ -153,9 +145,6 @@ class Twig_Loader_Filesystem implements Twig_LoaderInterface, Twig_ExistsLoaderI
|
|
153 |
return new Twig_Source(file_get_contents($path), $name, $path);
|
154 |
}
|
155 |
|
156 |
-
/**
|
157 |
-
* {@inheritdoc}
|
158 |
-
*/
|
159 |
public function getCacheKey($name)
|
160 |
{
|
161 |
$path = $this->findTemplate($name);
|
@@ -167,9 +156,6 @@ class Twig_Loader_Filesystem implements Twig_LoaderInterface, Twig_ExistsLoaderI
|
|
167 |
return $path;
|
168 |
}
|
169 |
|
170 |
-
/**
|
171 |
-
* {@inheritdoc}
|
172 |
-
*/
|
173 |
public function exists($name)
|
174 |
{
|
175 |
$name = $this->normalizeName($name);
|
@@ -187,9 +173,6 @@ class Twig_Loader_Filesystem implements Twig_LoaderInterface, Twig_ExistsLoaderI
|
|
187 |
}
|
188 |
}
|
189 |
|
190 |
-
/**
|
191 |
-
* {@inheritdoc}
|
192 |
-
*/
|
193 |
public function isFresh($name, $time)
|
194 |
{
|
195 |
return filemtime($this->findTemplate($name)) <= $time;
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
26 |
private $rootPath;
|
27 |
|
28 |
/**
|
|
|
|
|
29 |
* @param string|array $paths A path or an array of paths where to look for templates
|
30 |
* @param string|null $rootPath The root path common to all relative paths (null for getcwd())
|
31 |
*/
|
131 |
}
|
132 |
}
|
133 |
|
|
|
|
|
|
|
134 |
public function getSource($name)
|
135 |
{
|
136 |
@trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', get_class($this)), E_USER_DEPRECATED);
|
138 |
return file_get_contents($this->findTemplate($name));
|
139 |
}
|
140 |
|
|
|
|
|
|
|
141 |
public function getSourceContext($name)
|
142 |
{
|
143 |
$path = $this->findTemplate($name);
|
145 |
return new Twig_Source(file_get_contents($path), $name, $path);
|
146 |
}
|
147 |
|
|
|
|
|
|
|
148 |
public function getCacheKey($name)
|
149 |
{
|
150 |
$path = $this->findTemplate($name);
|
156 |
return $path;
|
157 |
}
|
158 |
|
|
|
|
|
|
|
159 |
public function exists($name)
|
160 |
{
|
161 |
$name = $this->normalizeName($name);
|
173 |
}
|
174 |
}
|
175 |
|
|
|
|
|
|
|
176 |
public function isFresh($name, $time)
|
177 |
{
|
178 |
return filemtime($this->findTemplate($name)) <= $time;
|
vendor/twig/twig/lib/Twig/Loader/String.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -29,9 +29,6 @@
|
|
29 |
*/
|
30 |
class Twig_Loader_String implements Twig_LoaderInterface, Twig_ExistsLoaderInterface, Twig_SourceContextLoaderInterface
|
31 |
{
|
32 |
-
/**
|
33 |
-
* {@inheritdoc}
|
34 |
-
*/
|
35 |
public function getSource($name)
|
36 |
{
|
37 |
@trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', get_class($this)), E_USER_DEPRECATED);
|
@@ -39,33 +36,21 @@ class Twig_Loader_String implements Twig_LoaderInterface, Twig_ExistsLoaderInter
|
|
39 |
return $name;
|
40 |
}
|
41 |
|
42 |
-
/**
|
43 |
-
* {@inheritdoc}
|
44 |
-
*/
|
45 |
public function getSourceContext($name)
|
46 |
{
|
47 |
return new Twig_Source($name, $name);
|
48 |
}
|
49 |
|
50 |
-
/**
|
51 |
-
* {@inheritdoc}
|
52 |
-
*/
|
53 |
public function exists($name)
|
54 |
{
|
55 |
return true;
|
56 |
}
|
57 |
|
58 |
-
/**
|
59 |
-
* {@inheritdoc}
|
60 |
-
*/
|
61 |
public function getCacheKey($name)
|
62 |
{
|
63 |
return $name;
|
64 |
}
|
65 |
|
66 |
-
/**
|
67 |
-
* {@inheritdoc}
|
68 |
-
*/
|
69 |
public function isFresh($name, $time)
|
70 |
{
|
71 |
return true;
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
29 |
*/
|
30 |
class Twig_Loader_String implements Twig_LoaderInterface, Twig_ExistsLoaderInterface, Twig_SourceContextLoaderInterface
|
31 |
{
|
|
|
|
|
|
|
32 |
public function getSource($name)
|
33 |
{
|
34 |
@trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', get_class($this)), E_USER_DEPRECATED);
|
36 |
return $name;
|
37 |
}
|
38 |
|
|
|
|
|
|
|
39 |
public function getSourceContext($name)
|
40 |
{
|
41 |
return new Twig_Source($name, $name);
|
42 |
}
|
43 |
|
|
|
|
|
|
|
44 |
public function exists($name)
|
45 |
{
|
46 |
return true;
|
47 |
}
|
48 |
|
|
|
|
|
|
|
49 |
public function getCacheKey($name)
|
50 |
{
|
51 |
return $name;
|
52 |
}
|
53 |
|
|
|
|
|
|
|
54 |
public function isFresh($name, $time)
|
55 |
{
|
56 |
return true;
|
vendor/twig/twig/lib/Twig/LoaderInterface.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Markup.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
@@ -128,7 +128,7 @@ class Twig_Node implements Twig_NodeInterface
|
|
128 |
*/
|
129 |
public function getLine()
|
130 |
{
|
131 |
-
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use
|
132 |
|
133 |
return $this->lineno;
|
134 |
}
|
@@ -139,11 +139,7 @@ class Twig_Node implements Twig_NodeInterface
|
|
139 |
}
|
140 |
|
141 |
/**
|
142 |
-
*
|
143 |
-
*
|
144 |
-
* @param string $name The attribute name
|
145 |
-
*
|
146 |
-
* @return bool true if the attribute is defined, false otherwise
|
147 |
*/
|
148 |
public function hasAttribute($name)
|
149 |
{
|
@@ -151,10 +147,6 @@ class Twig_Node implements Twig_NodeInterface
|
|
151 |
}
|
152 |
|
153 |
/**
|
154 |
-
* Gets an attribute value by name.
|
155 |
-
*
|
156 |
-
* @param string $name
|
157 |
-
*
|
158 |
* @return mixed
|
159 |
*/
|
160 |
public function getAttribute($name)
|
@@ -167,8 +159,6 @@ class Twig_Node implements Twig_NodeInterface
|
|
167 |
}
|
168 |
|
169 |
/**
|
170 |
-
* Sets an attribute by name to a value.
|
171 |
-
*
|
172 |
* @param string $name
|
173 |
* @param mixed $value
|
174 |
*/
|
@@ -177,21 +167,12 @@ class Twig_Node implements Twig_NodeInterface
|
|
177 |
$this->attributes[$name] = $value;
|
178 |
}
|
179 |
|
180 |
-
/**
|
181 |
-
* Removes an attribute by name.
|
182 |
-
*
|
183 |
-
* @param string $name
|
184 |
-
*/
|
185 |
public function removeAttribute($name)
|
186 |
{
|
187 |
unset($this->attributes[$name]);
|
188 |
}
|
189 |
|
190 |
/**
|
191 |
-
* Returns true if the node with the given name exists.
|
192 |
-
*
|
193 |
-
* @param string $name
|
194 |
-
*
|
195 |
* @return bool
|
196 |
*/
|
197 |
public function hasNode($name)
|
@@ -200,10 +181,6 @@ class Twig_Node implements Twig_NodeInterface
|
|
200 |
}
|
201 |
|
202 |
/**
|
203 |
-
* Gets a node by name.
|
204 |
-
*
|
205 |
-
* @param string $name
|
206 |
-
*
|
207 |
* @return Twig_Node
|
208 |
*/
|
209 |
public function getNode($name)
|
@@ -215,12 +192,6 @@ class Twig_Node implements Twig_NodeInterface
|
|
215 |
return $this->nodes[$name];
|
216 |
}
|
217 |
|
218 |
-
/**
|
219 |
-
* Sets a node.
|
220 |
-
*
|
221 |
-
* @param string $name
|
222 |
-
* @param Twig_Node $node
|
223 |
-
*/
|
224 |
public function setNode($name, $node = null)
|
225 |
{
|
226 |
if (!$node instanceof Twig_NodeInterface) {
|
@@ -230,11 +201,6 @@ class Twig_Node implements Twig_NodeInterface
|
|
230 |
$this->nodes[$name] = $node;
|
231 |
}
|
232 |
|
233 |
-
/**
|
234 |
-
* Removes a node by name.
|
235 |
-
*
|
236 |
-
* @param string $name
|
237 |
-
*/
|
238 |
public function removeNode($name)
|
239 |
{
|
240 |
unset($this->nodes[$name]);
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
128 |
*/
|
129 |
public function getLine()
|
130 |
{
|
131 |
+
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getTemplateLine() instead.', E_USER_DEPRECATED);
|
132 |
|
133 |
return $this->lineno;
|
134 |
}
|
139 |
}
|
140 |
|
141 |
/**
|
142 |
+
* @return bool
|
|
|
|
|
|
|
|
|
143 |
*/
|
144 |
public function hasAttribute($name)
|
145 |
{
|
147 |
}
|
148 |
|
149 |
/**
|
|
|
|
|
|
|
|
|
150 |
* @return mixed
|
151 |
*/
|
152 |
public function getAttribute($name)
|
159 |
}
|
160 |
|
161 |
/**
|
|
|
|
|
162 |
* @param string $name
|
163 |
* @param mixed $value
|
164 |
*/
|
167 |
$this->attributes[$name] = $value;
|
168 |
}
|
169 |
|
|
|
|
|
|
|
|
|
|
|
170 |
public function removeAttribute($name)
|
171 |
{
|
172 |
unset($this->attributes[$name]);
|
173 |
}
|
174 |
|
175 |
/**
|
|
|
|
|
|
|
|
|
176 |
* @return bool
|
177 |
*/
|
178 |
public function hasNode($name)
|
181 |
}
|
182 |
|
183 |
/**
|
|
|
|
|
|
|
|
|
184 |
* @return Twig_Node
|
185 |
*/
|
186 |
public function getNode($name)
|
192 |
return $this->nodes[$name];
|
193 |
}
|
194 |
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
public function setNode($name, $node = null)
|
196 |
{
|
197 |
if (!$node instanceof Twig_NodeInterface) {
|
201 |
$this->nodes[$name] = $node;
|
202 |
}
|
203 |
|
|
|
|
|
|
|
|
|
|
|
204 |
public function removeNode($name)
|
205 |
{
|
206 |
unset($this->nodes[$name]);
|
vendor/twig/twig/lib/Twig/Node/AutoEscape.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Block.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/BlockReference.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Body.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/CheckSecurity.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -56,7 +56,7 @@ class Twig_Node_CheckSecurity extends Twig_Node
|
|
56 |
->outdent()
|
57 |
->write("} catch (Twig_Sandbox_SecurityError \$e) {\n")
|
58 |
->indent()
|
59 |
-
->write("\$e->
|
60 |
->write("if (\$e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset(\$tags[\$e->getTagName()])) {\n")
|
61 |
->indent()
|
62 |
->write("\$e->setTemplateLine(\$tags[\$e->getTagName()]);\n")
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
56 |
->outdent()
|
57 |
->write("} catch (Twig_Sandbox_SecurityError \$e) {\n")
|
58 |
->indent()
|
59 |
+
->write("\$e->setSourceContext(\$this->getSourceContext());\n\n")
|
60 |
->write("if (\$e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset(\$tags[\$e->getTagName()])) {\n")
|
61 |
->indent()
|
62 |
->write("\$e->setTemplateLine(\$tags[\$e->getTagName()]);\n")
|
vendor/twig/twig/lib/Twig/Node/Do.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Embed.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Array.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -43,7 +43,7 @@ class Twig_Node_Expression_Array extends Twig_Node_Expression
|
|
43 |
foreach ($this->getKeyValuePairs() as $pair) {
|
44 |
// we compare the string representation of the keys
|
45 |
// to avoid comparing the line numbers which are not relevant here.
|
46 |
-
if ((string) $key
|
47 |
return true;
|
48 |
}
|
49 |
}
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
43 |
foreach ($this->getKeyValuePairs() as $pair) {
|
44 |
// we compare the string representation of the keys
|
45 |
// to avoid comparing the line numbers which are not relevant here.
|
46 |
+
if ((string) $key === (string) $pair['key']) {
|
47 |
return true;
|
48 |
}
|
49 |
}
|
vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -12,6 +12,10 @@ class Twig_Node_Expression_Binary_Power extends Twig_Node_Expression_Binary
|
|
12 |
{
|
13 |
public function compile(Twig_Compiler $compiler)
|
14 |
{
|
|
|
|
|
|
|
|
|
15 |
$compiler
|
16 |
->raw('pow(')
|
17 |
->subcompile($this->getNode('left'))
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
12 |
{
|
13 |
public function compile(Twig_Compiler $compiler)
|
14 |
{
|
15 |
+
if (PHP_VERSION_ID >= 50600) {
|
16 |
+
return parent::compile($compiler);
|
17 |
+
}
|
18 |
+
|
19 |
$compiler
|
20 |
->raw('pow(')
|
21 |
->subcompile($this->getNode('left'))
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
@@ -17,30 +17,75 @@
|
|
17 |
*/
|
18 |
class Twig_Node_Expression_BlockReference extends Twig_Node_Expression
|
19 |
{
|
20 |
-
|
|
|
|
|
|
|
21 |
{
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
24 |
|
25 |
public function compile(Twig_Compiler $compiler)
|
26 |
{
|
27 |
-
if ($this->getAttribute('
|
28 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
}
|
|
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
->subcompile($this->getNode('name'))
|
36 |
-
->raw(", \$context, \$blocks);\n")
|
37 |
-
;
|
38 |
} else {
|
39 |
$compiler
|
40 |
-
->
|
41 |
-
->subcompile($this->getNode('
|
42 |
-
->raw(',
|
|
|
|
|
|
|
|
|
43 |
;
|
44 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
}
|
46 |
}
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
17 |
*/
|
18 |
class Twig_Node_Expression_BlockReference extends Twig_Node_Expression
|
19 |
{
|
20 |
+
/**
|
21 |
+
* @param Twig_Node|null $template
|
22 |
+
*/
|
23 |
+
public function __construct(Twig_NodeInterface $name, $template = null, $lineno, $tag = null)
|
24 |
{
|
25 |
+
if (is_bool($template)) {
|
26 |
+
@trigger_error(sprintf('The %s method "$asString" argument is deprecated since version 1.28 and will be removed in 2.0.', __METHOD__), E_USER_DEPRECATED);
|
27 |
+
|
28 |
+
$template = null;
|
29 |
+
}
|
30 |
+
|
31 |
+
$nodes = array('name' => $name);
|
32 |
+
if (null !== $template) {
|
33 |
+
$nodes['template'] = $template;
|
34 |
+
}
|
35 |
+
|
36 |
+
parent::__construct($nodes, array('is_defined_test' => false, 'output' => false), $lineno, $tag);
|
37 |
}
|
38 |
|
39 |
public function compile(Twig_Compiler $compiler)
|
40 |
{
|
41 |
+
if ($this->getAttribute('is_defined_test')) {
|
42 |
+
$this->compileTemplateCall($compiler, 'hasBlock');
|
43 |
+
} else {
|
44 |
+
if ($this->getAttribute('output')) {
|
45 |
+
$compiler->addDebugInfo($this);
|
46 |
+
|
47 |
+
$this
|
48 |
+
->compileTemplateCall($compiler, 'displayBlock')
|
49 |
+
->raw(";\n");
|
50 |
+
} else {
|
51 |
+
$this->compileTemplateCall($compiler, 'renderBlock');
|
52 |
+
}
|
53 |
}
|
54 |
+
}
|
55 |
|
56 |
+
private function compileTemplateCall(Twig_Compiler $compiler, $method)
|
57 |
+
{
|
58 |
+
if (!$this->hasNode('template')) {
|
59 |
+
$compiler->write('$this');
|
|
|
|
|
|
|
60 |
} else {
|
61 |
$compiler
|
62 |
+
->write('$this->loadTemplate(')
|
63 |
+
->subcompile($this->getNode('template'))
|
64 |
+
->raw(', ')
|
65 |
+
->repr($this->getTemplateName())
|
66 |
+
->raw(', ')
|
67 |
+
->repr($this->getTemplateLine())
|
68 |
+
->raw(')')
|
69 |
;
|
70 |
}
|
71 |
+
|
72 |
+
$compiler->raw(sprintf('->%s', $method));
|
73 |
+
$this->compileBlockArguments($compiler);
|
74 |
+
|
75 |
+
return $compiler;
|
76 |
+
}
|
77 |
+
|
78 |
+
private function compileBlockArguments(Twig_Compiler $compiler)
|
79 |
+
{
|
80 |
+
$compiler
|
81 |
+
->raw('(')
|
82 |
+
->subcompile($this->getNode('name'))
|
83 |
+
->raw(', $context');
|
84 |
+
|
85 |
+
if (!$this->hasNode('template')) {
|
86 |
+
$compiler->raw(', $blocks');
|
87 |
+
}
|
88 |
+
|
89 |
+
return $compiler->raw(')');
|
90 |
}
|
91 |
}
|
vendor/twig/twig/lib/Twig/Node/Expression/Call.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -146,7 +146,7 @@ abstract class Twig_Node_Expression_Call extends Twig_Node_Expression
|
|
146 |
throw new Twig_Error_Syntax(sprintf('Argument "%s" is defined twice for %s "%s".', $name, $callType, $callName));
|
147 |
}
|
148 |
|
149 |
-
if (
|
150 |
throw new Twig_Error_Syntax(sprintf(
|
151 |
'Argument "%s" could not be assigned for %s "%s(%s)" because it is mapped to an internal PHP function which cannot determine default value for optional argument%s "%s".',
|
152 |
$name, $callType, $callName, implode(', ', $names), count($missingArguments) > 1 ? 's' : '', implode('", "', $missingArguments))
|
@@ -218,7 +218,7 @@ abstract class Twig_Node_Expression_Call extends Twig_Node_Expression
|
|
218 |
|
219 |
private function getCallableParameters($callable, $isVariadic)
|
220 |
{
|
221 |
-
list($r
|
222 |
if (null === $r) {
|
223 |
return array();
|
224 |
}
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
146 |
throw new Twig_Error_Syntax(sprintf('Argument "%s" is defined twice for %s "%s".', $name, $callType, $callName));
|
147 |
}
|
148 |
|
149 |
+
if (count($missingArguments)) {
|
150 |
throw new Twig_Error_Syntax(sprintf(
|
151 |
'Argument "%s" could not be assigned for %s "%s(%s)" because it is mapped to an internal PHP function which cannot determine default value for optional argument%s "%s".',
|
152 |
$name, $callType, $callName, implode(', ', $names), count($missingArguments) > 1 ? 's' : '', implode('", "', $missingArguments))
|
218 |
|
219 |
private function getCallableParameters($callable, $isVariadic)
|
220 |
{
|
221 |
+
list($r) = $this->reflectCallable($callable);
|
222 |
if (null === $r) {
|
223 |
return array();
|
224 |
}
|
vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Constant.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Filter.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Function.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -12,7 +12,7 @@ class Twig_Node_Expression_Function extends Twig_Node_Expression_Call
|
|
12 |
{
|
13 |
public function __construct($name, Twig_NodeInterface $arguments, $lineno)
|
14 |
{
|
15 |
-
parent::__construct(array('arguments' => $arguments), array('name' => $name), $lineno);
|
16 |
}
|
17 |
|
18 |
public function compile(Twig_Compiler $compiler)
|
@@ -27,7 +27,12 @@ class Twig_Node_Expression_Function extends Twig_Node_Expression_Call
|
|
27 |
$this->setAttribute('needs_context', $function->needsContext());
|
28 |
$this->setAttribute('arguments', $function->getArguments());
|
29 |
if ($function instanceof Twig_FunctionCallableInterface || $function instanceof Twig_SimpleFunction) {
|
30 |
-
$
|
|
|
|
|
|
|
|
|
|
|
31 |
}
|
32 |
if ($function instanceof Twig_SimpleFunction) {
|
33 |
$this->setAttribute('is_variadic', $function->isVariadic());
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
12 |
{
|
13 |
public function __construct($name, Twig_NodeInterface $arguments, $lineno)
|
14 |
{
|
15 |
+
parent::__construct(array('arguments' => $arguments), array('name' => $name, 'is_defined_test' => false), $lineno);
|
16 |
}
|
17 |
|
18 |
public function compile(Twig_Compiler $compiler)
|
27 |
$this->setAttribute('needs_context', $function->needsContext());
|
28 |
$this->setAttribute('arguments', $function->getArguments());
|
29 |
if ($function instanceof Twig_FunctionCallableInterface || $function instanceof Twig_SimpleFunction) {
|
30 |
+
$callable = $function->getCallable();
|
31 |
+
if ('constant' === $name && $this->getAttribute('is_defined_test')) {
|
32 |
+
$callable = 'twig_constant_is_defined';
|
33 |
+
}
|
34 |
+
|
35 |
+
$this->setAttribute('callable', $callable);
|
36 |
}
|
37 |
if ($function instanceof Twig_SimpleFunction) {
|
38 |
$this->setAttribute('is_variadic', $function->isVariadic());
|
vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
@@ -23,6 +23,10 @@ class Twig_Node_Expression_GetAttr extends Twig_Node_Expression
|
|
23 |
|
24 |
public function compile(Twig_Compiler $compiler)
|
25 |
{
|
|
|
|
|
|
|
|
|
26 |
if (function_exists('twig_template_get_attributes') && !$this->getAttribute('disable_c_ext')) {
|
27 |
$compiler->raw('twig_template_get_attributes($this, ');
|
28 |
} else {
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
23 |
|
24 |
public function compile(Twig_Compiler $compiler)
|
25 |
{
|
26 |
+
if ($this->getAttribute('disable_c_ext')) {
|
27 |
+
@trigger_error(sprintf('Using the "disable_c_ext" attribute on %s is deprecated since version 1.30 and will be removed in 2.0.', __CLASS__), E_USER_DEPRECATED);
|
28 |
+
}
|
29 |
+
|
30 |
if (function_exists('twig_template_get_attributes') && !$this->getAttribute('disable_c_ext')) {
|
31 |
$compiler->raw('twig_template_get_attributes($this, ');
|
32 |
} else {
|
vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Name.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
@@ -43,10 +43,20 @@ class Twig_Node_Expression_Name extends Twig_Node_Expression
|
|
43 |
->raw(']')
|
44 |
;
|
45 |
} else {
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
// PHP 5.4 ternary operator performance was optimized
|
51 |
$compiler
|
52 |
->raw('(isset($context[')
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
43 |
->raw(']')
|
44 |
;
|
45 |
} else {
|
46 |
+
if (PHP_VERSION_ID >= 70000) {
|
47 |
+
// use PHP 7 null coalescing operator
|
48 |
+
$compiler
|
49 |
+
->raw('($context[')
|
50 |
+
->string($name)
|
51 |
+
->raw('] ?? ')
|
52 |
+
;
|
53 |
+
|
54 |
+
if ($this->getAttribute('ignore_strict_check') || !$compiler->getEnvironment()->isStrictVariables()) {
|
55 |
+
$compiler->raw('null)');
|
56 |
+
} else {
|
57 |
+
$compiler->raw('$this->getContext($context, ')->string($name)->raw('))');
|
58 |
+
}
|
59 |
+
} elseif (PHP_VERSION_ID >= 50400) {
|
60 |
// PHP 5.4 ternary operator performance was optimized
|
61 |
$compiler
|
62 |
->raw('(isset($context[')
|
vendor/twig/twig/lib/Twig/Node/Expression/NullCoalesce.php
CHANGED
@@ -20,4 +20,27 @@ class Twig_Node_Expression_NullCoalesce extends Twig_Node_Expression_Conditional
|
|
20 |
|
21 |
parent::__construct($test, $left, $right, $lineno);
|
22 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
20 |
|
21 |
parent::__construct($test, $left, $right, $lineno);
|
22 |
}
|
23 |
+
|
24 |
+
public function compile(Twig_Compiler $compiler)
|
25 |
+
{
|
26 |
+
/*
|
27 |
+
* This optimizes only one case. PHP 7 also supports more complex expressions
|
28 |
+
* that can return null. So, for instance, if log is defined, log("foo") ?? "..." works,
|
29 |
+
* but log($a["foo"]) ?? "..." does not if $a["foo"] is not defined. More advanced
|
30 |
+
* cases might be implemented as an optimizer node visitor, but has not been done
|
31 |
+
* as benefits are probably not worth the added complexity.
|
32 |
+
*/
|
33 |
+
if (PHP_VERSION_ID >= 70000 && $this->getNode('expr2') instanceof Twig_Node_Expression_Name) {
|
34 |
+
$this->getNode('expr2')->setAttribute('always_defined', true);
|
35 |
+
$compiler
|
36 |
+
->raw('((')
|
37 |
+
->subcompile($this->getNode('expr2'))
|
38 |
+
->raw(') ?? (')
|
39 |
+
->subcompile($this->getNode('expr3'))
|
40 |
+
->raw('))')
|
41 |
+
;
|
42 |
+
} else {
|
43 |
+
parent::compile($compiler);
|
44 |
+
}
|
45 |
+
}
|
46 |
}
|
vendor/twig/twig/lib/Twig/Node/Expression/Parent.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/TempName.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Test.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -29,8 +29,11 @@ class Twig_Node_Expression_Test_Defined extends Twig_Node_Expression_Test
|
|
29 |
$node->setAttribute('is_defined_test', true);
|
30 |
} elseif ($node instanceof Twig_Node_Expression_GetAttr) {
|
31 |
$node->setAttribute('is_defined_test', true);
|
32 |
-
|
33 |
$this->changeIgnoreStrictCheck($node);
|
|
|
|
|
|
|
|
|
34 |
} elseif ($node instanceof Twig_Node_Expression_Constant || $node instanceof Twig_Node_Expression_Array) {
|
35 |
$node = new Twig_Node_Expression_Constant(true, $node->getTemplateLine());
|
36 |
} else {
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
29 |
$node->setAttribute('is_defined_test', true);
|
30 |
} elseif ($node instanceof Twig_Node_Expression_GetAttr) {
|
31 |
$node->setAttribute('is_defined_test', true);
|
|
|
32 |
$this->changeIgnoreStrictCheck($node);
|
33 |
+
} elseif ($node instanceof Twig_Node_Expression_BlockReference) {
|
34 |
+
$node->setAttribute('is_defined_test', true);
|
35 |
+
} elseif ($node instanceof Twig_Node_Expression_Function && 'constant' === $node->getAttribute('name')) {
|
36 |
+
$node->setAttribute('is_defined_test', true);
|
37 |
} elseif ($node instanceof Twig_Node_Expression_Constant || $node instanceof Twig_Node_Expression_Array) {
|
38 |
$node = new Twig_Node_Expression_Constant(true, $node->getTemplateLine());
|
39 |
} else {
|
vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Unary.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Flush.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/For.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/ForLoop.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/If.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Import.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Include.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Macro.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Module.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Print.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Sandbox.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -36,11 +36,9 @@ class Twig_Node_SandboxedPrint extends Twig_Node_Print
|
|
36 |
*
|
37 |
* This is mostly needed when another visitor adds filters (like the escaper one).
|
38 |
*
|
39 |
-
* @param Twig_Node $node A Node
|
40 |
-
*
|
41 |
* @return Twig_Node
|
42 |
*/
|
43 |
-
protected function removeNodeFilter($node)
|
44 |
{
|
45 |
if ($node instanceof Twig_Node_Expression_Filter) {
|
46 |
return $this->removeNodeFilter($node->getNode('node'));
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
36 |
*
|
37 |
* This is mostly needed when another visitor adds filters (like the escaper one).
|
38 |
*
|
|
|
|
|
39 |
* @return Twig_Node
|
40 |
*/
|
41 |
+
protected function removeNodeFilter(Twig_Node $node)
|
42 |
{
|
43 |
if ($node instanceof Twig_Node_Expression_Filter) {
|
44 |
return $this->removeNodeFilter($node->getNode('node'));
|
vendor/twig/twig/lib/Twig/Node/Set.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -14,7 +14,7 @@
|
|
14 |
*
|
15 |
* @author Fabien Potencier <fabien@symfony.com>
|
16 |
*/
|
17 |
-
class Twig_Node_Set extends Twig_Node
|
18 |
{
|
19 |
public function __construct($capture, Twig_NodeInterface $names, Twig_NodeInterface $values, $lineno, $tag = null)
|
20 |
{
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
14 |
*
|
15 |
* @author Fabien Potencier <fabien@symfony.com>
|
16 |
*/
|
17 |
+
class Twig_Node_Set extends Twig_Node implements Twig_NodeCaptureInterface
|
18 |
{
|
19 |
public function __construct($capture, Twig_NodeInterface $names, Twig_NodeInterface $values, $lineno, $tag = null)
|
20 |
{
|
vendor/twig/twig/lib/Twig/Node/SetTemp.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Spaceless.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/Text.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Node/With.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of Twig.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Represents a nested "with" scope.
|
14 |
+
*
|
15 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
16 |
+
*/
|
17 |
+
class Twig_Node_With extends Twig_Node
|
18 |
+
{
|
19 |
+
public function __construct(Twig_Node $body, Twig_Node $variables = null, $only = false, $lineno, $tag = null)
|
20 |
+
{
|
21 |
+
$nodes = array('body' => $body);
|
22 |
+
if (null !== $variables) {
|
23 |
+
$nodes['variables'] = $variables;
|
24 |
+
}
|
25 |
+
|
26 |
+
parent::__construct($nodes, array('only' => (bool) $only), $lineno, $tag);
|
27 |
+
}
|
28 |
+
|
29 |
+
public function compile(Twig_Compiler $compiler)
|
30 |
+
{
|
31 |
+
$compiler->addDebugInfo($this);
|
32 |
+
|
33 |
+
if ($this->hasNode('variables')) {
|
34 |
+
$varsName = $compiler->getVarName();
|
35 |
+
$compiler
|
36 |
+
->write(sprintf('$%s = ', $varsName))
|
37 |
+
->subcompile($this->getNode('variables'))
|
38 |
+
->raw(";\n")
|
39 |
+
->write(sprintf("if (!is_array(\$%s)) {\n", $varsName))
|
40 |
+
->indent()
|
41 |
+
->write("throw new Twig_Error_Runtime('Variables passed to the \"with\" tag must be a hash.');\n")
|
42 |
+
->outdent()
|
43 |
+
->write("}\n")
|
44 |
+
;
|
45 |
+
|
46 |
+
if ($this->getAttribute('only')) {
|
47 |
+
$compiler->write("\$context = array('_parent' => \$context);\n");
|
48 |
+
} else {
|
49 |
+
$compiler->write("\$context['_parent'] = \$context;\n");
|
50 |
+
}
|
51 |
+
|
52 |
+
$compiler->write(sprintf("\$context = array_merge(\$context, \$%s);\n", $varsName));
|
53 |
+
} else {
|
54 |
+
$compiler->write("\$context['_parent'] = \$context;\n");
|
55 |
+
}
|
56 |
+
|
57 |
+
$compiler
|
58 |
+
->subcompile($this->getNode('body'))
|
59 |
+
->write("\$context = \$context['_parent'];\n")
|
60 |
+
;
|
61 |
+
}
|
62 |
+
}
|
vendor/twig/twig/lib/Twig/NodeCaptureInterface.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of Twig.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Represents a node that captures any nested displayable nodes.
|
14 |
+
*
|
15 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
16 |
+
*/
|
17 |
+
interface Twig_NodeCaptureInterface
|
18 |
+
{
|
19 |
+
}
|
vendor/twig/twig/lib/Twig/NodeInterface.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -20,8 +20,6 @@ interface Twig_NodeInterface extends Countable, IteratorAggregate
|
|
20 |
{
|
21 |
/**
|
22 |
* Compiles the node to PHP.
|
23 |
-
*
|
24 |
-
* @param Twig_Compiler $compiler A Twig_Compiler instance
|
25 |
*/
|
26 |
public function compile(Twig_Compiler $compiler);
|
27 |
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
20 |
{
|
21 |
/**
|
22 |
* Compiles the node to PHP.
|
|
|
|
|
23 |
*/
|
24 |
public function compile(Twig_Compiler $compiler);
|
25 |
|
vendor/twig/twig/lib/Twig/NodeOutputInterface.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/NodeTraverser.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -14,6 +14,8 @@
|
|
14 |
*
|
15 |
* It visits all nodes and their children and calls the given visitor for each.
|
16 |
*
|
|
|
|
|
17 |
* @author Fabien Potencier <fabien@symfony.com>
|
18 |
*/
|
19 |
class Twig_NodeTraverser
|
@@ -22,10 +24,8 @@ class Twig_NodeTraverser
|
|
22 |
protected $visitors = array();
|
23 |
|
24 |
/**
|
25 |
-
*
|
26 |
-
*
|
27 |
-
* @param Twig_Environment $env A Twig_Environment instance
|
28 |
-
* @param Twig_NodeVisitorInterface[] $visitors An array of Twig_NodeVisitorInterface instances
|
29 |
*/
|
30 |
public function __construct(Twig_Environment $env, array $visitors = array())
|
31 |
{
|
@@ -35,11 +35,6 @@ class Twig_NodeTraverser
|
|
35 |
}
|
36 |
}
|
37 |
|
38 |
-
/**
|
39 |
-
* Adds a visitor.
|
40 |
-
*
|
41 |
-
* @param Twig_NodeVisitorInterface $visitor A Twig_NodeVisitorInterface instance
|
42 |
-
*/
|
43 |
public function addVisitor(Twig_NodeVisitorInterface $visitor)
|
44 |
{
|
45 |
if (!isset($this->visitors[$visitor->getPriority()])) {
|
@@ -52,8 +47,6 @@ class Twig_NodeTraverser
|
|
52 |
/**
|
53 |
* Traverses a node and calls the registered visitors.
|
54 |
*
|
55 |
-
* @param Twig_NodeInterface $node A Twig_NodeInterface instance
|
56 |
-
*
|
57 |
* @return Twig_NodeInterface
|
58 |
*/
|
59 |
public function traverse(Twig_NodeInterface $node)
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
14 |
*
|
15 |
* It visits all nodes and their children and calls the given visitor for each.
|
16 |
*
|
17 |
+
* @final
|
18 |
+
*
|
19 |
* @author Fabien Potencier <fabien@symfony.com>
|
20 |
*/
|
21 |
class Twig_NodeTraverser
|
24 |
protected $visitors = array();
|
25 |
|
26 |
/**
|
27 |
+
* @param Twig_Environment $env
|
28 |
+
* @param Twig_NodeVisitorInterface[] $visitors
|
|
|
|
|
29 |
*/
|
30 |
public function __construct(Twig_Environment $env, array $visitors = array())
|
31 |
{
|
35 |
}
|
36 |
}
|
37 |
|
|
|
|
|
|
|
|
|
|
|
38 |
public function addVisitor(Twig_NodeVisitorInterface $visitor)
|
39 |
{
|
40 |
if (!isset($this->visitors[$visitor->getPriority()])) {
|
47 |
/**
|
48 |
* Traverses a node and calls the registered visitors.
|
49 |
*
|
|
|
|
|
50 |
* @return Twig_NodeInterface
|
51 |
*/
|
52 |
public function traverse(Twig_NodeInterface $node)
|
vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -12,6 +12,8 @@
|
|
12 |
/**
|
13 |
* Twig_NodeVisitor_Escaper implements output escaping.
|
14 |
*
|
|
|
|
|
15 |
* @author Fabien Potencier <fabien@symfony.com>
|
16 |
*/
|
17 |
class Twig_NodeVisitor_Escaper extends Twig_BaseNodeVisitor
|
@@ -28,9 +30,6 @@ class Twig_NodeVisitor_Escaper extends Twig_BaseNodeVisitor
|
|
28 |
$this->safeAnalysis = new Twig_NodeVisitor_SafeAnalysis();
|
29 |
}
|
30 |
|
31 |
-
/**
|
32 |
-
* {@inheritdoc}
|
33 |
-
*/
|
34 |
protected function doEnterNode(Twig_Node $node, Twig_Environment $env)
|
35 |
{
|
36 |
if ($node instanceof Twig_Node_Module) {
|
@@ -50,9 +49,6 @@ class Twig_NodeVisitor_Escaper extends Twig_BaseNodeVisitor
|
|
50 |
return $node;
|
51 |
}
|
52 |
|
53 |
-
/**
|
54 |
-
* {@inheritdoc}
|
55 |
-
*/
|
56 |
protected function doLeaveNode(Twig_Node $node, Twig_Environment $env)
|
57 |
{
|
58 |
if ($node instanceof Twig_Node_Module) {
|
@@ -149,9 +145,6 @@ class Twig_NodeVisitor_Escaper extends Twig_BaseNodeVisitor
|
|
149 |
return new Twig_Node_Expression_Filter($node, $name, $args, $line);
|
150 |
}
|
151 |
|
152 |
-
/**
|
153 |
-
* {@inheritdoc}
|
154 |
-
*/
|
155 |
public function getPriority()
|
156 |
{
|
157 |
return 0;
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
12 |
/**
|
13 |
* Twig_NodeVisitor_Escaper implements output escaping.
|
14 |
*
|
15 |
+
* @final
|
16 |
+
*
|
17 |
* @author Fabien Potencier <fabien@symfony.com>
|
18 |
*/
|
19 |
class Twig_NodeVisitor_Escaper extends Twig_BaseNodeVisitor
|
30 |
$this->safeAnalysis = new Twig_NodeVisitor_SafeAnalysis();
|
31 |
}
|
32 |
|
|
|
|
|
|
|
33 |
protected function doEnterNode(Twig_Node $node, Twig_Environment $env)
|
34 |
{
|
35 |
if ($node instanceof Twig_Node_Module) {
|
49 |
return $node;
|
50 |
}
|
51 |
|
|
|
|
|
|
|
52 |
protected function doLeaveNode(Twig_Node $node, Twig_Environment $env)
|
53 |
{
|
54 |
if ($node instanceof Twig_Node_Module) {
|
145 |
return new Twig_Node_Expression_Filter($node, $name, $args, $line);
|
146 |
}
|
147 |
|
|
|
|
|
|
|
148 |
public function getPriority()
|
149 |
{
|
150 |
return 0;
|
vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -17,6 +17,8 @@
|
|
17 |
* You can configure which optimizations you want to activate via the
|
18 |
* optimizer mode.
|
19 |
*
|
|
|
|
|
20 |
* @author Fabien Potencier <fabien@symfony.com>
|
21 |
*/
|
22 |
class Twig_NodeVisitor_Optimizer extends Twig_BaseNodeVisitor
|
@@ -34,8 +36,6 @@ class Twig_NodeVisitor_Optimizer extends Twig_BaseNodeVisitor
|
|
34 |
protected $inABody = false;
|
35 |
|
36 |
/**
|
37 |
-
* Constructor.
|
38 |
-
*
|
39 |
* @param int $optimizers The optimizer mode
|
40 |
*/
|
41 |
public function __construct($optimizers = -1)
|
@@ -47,9 +47,6 @@ class Twig_NodeVisitor_Optimizer extends Twig_BaseNodeVisitor
|
|
47 |
$this->optimizers = $optimizers;
|
48 |
}
|
49 |
|
50 |
-
/**
|
51 |
-
* {@inheritdoc}
|
52 |
-
*/
|
53 |
protected function doEnterNode(Twig_Node $node, Twig_Environment $env)
|
54 |
{
|
55 |
if (self::OPTIMIZE_FOR === (self::OPTIMIZE_FOR & $this->optimizers)) {
|
@@ -73,9 +70,6 @@ class Twig_NodeVisitor_Optimizer extends Twig_BaseNodeVisitor
|
|
73 |
return $node;
|
74 |
}
|
75 |
|
76 |
-
/**
|
77 |
-
* {@inheritdoc}
|
78 |
-
*/
|
79 |
protected function doLeaveNode(Twig_Node $node, Twig_Environment $env)
|
80 |
{
|
81 |
$expression = $node instanceof Twig_Node_Expression;
|
@@ -127,9 +121,6 @@ class Twig_NodeVisitor_Optimizer extends Twig_BaseNodeVisitor
|
|
127 |
*
|
128 |
* * "echo $this->render(Parent)Block()" with "$this->display(Parent)Block()"
|
129 |
*
|
130 |
-
* @param Twig_NodeInterface $node A Node
|
131 |
-
* @param Twig_Environment $env The current Twig environment
|
132 |
-
*
|
133 |
* @return Twig_NodeInterface
|
134 |
*/
|
135 |
protected function optimizePrintNode(Twig_NodeInterface $node, Twig_Environment $env)
|
@@ -138,13 +129,14 @@ class Twig_NodeVisitor_Optimizer extends Twig_BaseNodeVisitor
|
|
138 |
return $node;
|
139 |
}
|
140 |
|
|
|
141 |
if (
|
142 |
-
$
|
143 |
-
$
|
144 |
) {
|
145 |
-
$
|
146 |
|
147 |
-
return $
|
148 |
}
|
149 |
|
150 |
return $node;
|
@@ -153,9 +145,6 @@ class Twig_NodeVisitor_Optimizer extends Twig_BaseNodeVisitor
|
|
153 |
/**
|
154 |
* Removes "raw" filters.
|
155 |
*
|
156 |
-
* @param Twig_NodeInterface $node A Node
|
157 |
-
* @param Twig_Environment $env The current Twig environment
|
158 |
-
*
|
159 |
* @return Twig_NodeInterface
|
160 |
*/
|
161 |
protected function optimizeRawFilter(Twig_NodeInterface $node, Twig_Environment $env)
|
@@ -169,9 +158,6 @@ class Twig_NodeVisitor_Optimizer extends Twig_BaseNodeVisitor
|
|
169 |
|
170 |
/**
|
171 |
* Optimizes "for" tag by removing the "loop" variable creation whenever possible.
|
172 |
-
*
|
173 |
-
* @param Twig_NodeInterface $node A Node
|
174 |
-
* @param Twig_Environment $env The current Twig environment
|
175 |
*/
|
176 |
protected function enterOptimizeFor(Twig_NodeInterface $node, Twig_Environment $env)
|
177 |
{
|
@@ -236,9 +222,6 @@ class Twig_NodeVisitor_Optimizer extends Twig_BaseNodeVisitor
|
|
236 |
|
237 |
/**
|
238 |
* Optimizes "for" tag by removing the "loop" variable creation whenever possible.
|
239 |
-
*
|
240 |
-
* @param Twig_NodeInterface $node A Node
|
241 |
-
* @param Twig_Environment $env The current Twig environment
|
242 |
*/
|
243 |
protected function leaveOptimizeFor(Twig_NodeInterface $node, Twig_Environment $env)
|
244 |
{
|
@@ -261,9 +244,6 @@ class Twig_NodeVisitor_Optimizer extends Twig_BaseNodeVisitor
|
|
261 |
}
|
262 |
}
|
263 |
|
264 |
-
/**
|
265 |
-
* {@inheritdoc}
|
266 |
-
*/
|
267 |
public function getPriority()
|
268 |
{
|
269 |
return 255;
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
17 |
* You can configure which optimizations you want to activate via the
|
18 |
* optimizer mode.
|
19 |
*
|
20 |
+
* @final
|
21 |
+
*
|
22 |
* @author Fabien Potencier <fabien@symfony.com>
|
23 |
*/
|
24 |
class Twig_NodeVisitor_Optimizer extends Twig_BaseNodeVisitor
|
36 |
protected $inABody = false;
|
37 |
|
38 |
/**
|
|
|
|
|
39 |
* @param int $optimizers The optimizer mode
|
40 |
*/
|
41 |
public function __construct($optimizers = -1)
|
47 |
$this->optimizers = $optimizers;
|
48 |
}
|
49 |
|
|
|
|
|
|
|
50 |
protected function doEnterNode(Twig_Node $node, Twig_Environment $env)
|
51 |
{
|
52 |
if (self::OPTIMIZE_FOR === (self::OPTIMIZE_FOR & $this->optimizers)) {
|
70 |
return $node;
|
71 |
}
|
72 |
|
|
|
|
|
|
|
73 |
protected function doLeaveNode(Twig_Node $node, Twig_Environment $env)
|
74 |
{
|
75 |
$expression = $node instanceof Twig_Node_Expression;
|
121 |
*
|
122 |
* * "echo $this->render(Parent)Block()" with "$this->display(Parent)Block()"
|
123 |
*
|
|
|
|
|
|
|
124 |
* @return Twig_NodeInterface
|
125 |
*/
|
126 |
protected function optimizePrintNode(Twig_NodeInterface $node, Twig_Environment $env)
|
129 |
return $node;
|
130 |
}
|
131 |
|
132 |
+
$exprNode = $node->getNode('expr');
|
133 |
if (
|
134 |
+
$exprNode instanceof Twig_Node_Expression_BlockReference ||
|
135 |
+
$exprNode instanceof Twig_Node_Expression_Parent
|
136 |
) {
|
137 |
+
$exprNode->setAttribute('output', true);
|
138 |
|
139 |
+
return $exprNode;
|
140 |
}
|
141 |
|
142 |
return $node;
|
145 |
/**
|
146 |
* Removes "raw" filters.
|
147 |
*
|
|
|
|
|
|
|
148 |
* @return Twig_NodeInterface
|
149 |
*/
|
150 |
protected function optimizeRawFilter(Twig_NodeInterface $node, Twig_Environment $env)
|
158 |
|
159 |
/**
|
160 |
* Optimizes "for" tag by removing the "loop" variable creation whenever possible.
|
|
|
|
|
|
|
161 |
*/
|
162 |
protected function enterOptimizeFor(Twig_NodeInterface $node, Twig_Environment $env)
|
163 |
{
|
222 |
|
223 |
/**
|
224 |
* Optimizes "for" tag by removing the "loop" variable creation whenever possible.
|
|
|
|
|
|
|
225 |
*/
|
226 |
protected function leaveOptimizeFor(Twig_NodeInterface $node, Twig_Environment $env)
|
227 |
{
|
244 |
}
|
245 |
}
|
246 |
|
|
|
|
|
|
|
247 |
public function getPriority()
|
248 |
{
|
249 |
return 255;
|
vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php
CHANGED
@@ -9,6 +9,9 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
12 |
class Twig_NodeVisitor_SafeAnalysis extends Twig_BaseNodeVisitor
|
13 |
{
|
14 |
protected $data = array();
|
@@ -57,17 +60,11 @@ class Twig_NodeVisitor_SafeAnalysis extends Twig_BaseNodeVisitor
|
|
57 |
);
|
58 |
}
|
59 |
|
60 |
-
/**
|
61 |
-
* {@inheritdoc}
|
62 |
-
*/
|
63 |
protected function doEnterNode(Twig_Node $node, Twig_Environment $env)
|
64 |
{
|
65 |
return $node;
|
66 |
}
|
67 |
|
68 |
-
/**
|
69 |
-
* {@inheritdoc}
|
70 |
-
*/
|
71 |
protected function doLeaveNode(Twig_Node $node, Twig_Environment $env)
|
72 |
{
|
73 |
if ($node instanceof Twig_Node_Expression_Constant) {
|
@@ -144,9 +141,6 @@ class Twig_NodeVisitor_SafeAnalysis extends Twig_BaseNodeVisitor
|
|
144 |
return array_intersect($a, $b);
|
145 |
}
|
146 |
|
147 |
-
/**
|
148 |
-
* {@inheritdoc}
|
149 |
-
*/
|
150 |
public function getPriority()
|
151 |
{
|
152 |
return 0;
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
+
/**
|
13 |
+
* @final
|
14 |
+
*/
|
15 |
class Twig_NodeVisitor_SafeAnalysis extends Twig_BaseNodeVisitor
|
16 |
{
|
17 |
protected $data = array();
|
60 |
);
|
61 |
}
|
62 |
|
|
|
|
|
|
|
63 |
protected function doEnterNode(Twig_Node $node, Twig_Environment $env)
|
64 |
{
|
65 |
return $node;
|
66 |
}
|
67 |
|
|
|
|
|
|
|
68 |
protected function doLeaveNode(Twig_Node $node, Twig_Environment $env)
|
69 |
{
|
70 |
if ($node instanceof Twig_Node_Expression_Constant) {
|
141 |
return array_intersect($a, $b);
|
142 |
}
|
143 |
|
|
|
|
|
|
|
144 |
public function getPriority()
|
145 |
{
|
146 |
return 0;
|
vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -12,6 +12,8 @@
|
|
12 |
/**
|
13 |
* Twig_NodeVisitor_Sandbox implements sandboxing.
|
14 |
*
|
|
|
|
|
15 |
* @author Fabien Potencier <fabien@symfony.com>
|
16 |
*/
|
17 |
class Twig_NodeVisitor_Sandbox extends Twig_BaseNodeVisitor
|
@@ -21,9 +23,6 @@ class Twig_NodeVisitor_Sandbox extends Twig_BaseNodeVisitor
|
|
21 |
protected $filters;
|
22 |
protected $functions;
|
23 |
|
24 |
-
/**
|
25 |
-
* {@inheritdoc}
|
26 |
-
*/
|
27 |
protected function doEnterNode(Twig_Node $node, Twig_Environment $env)
|
28 |
{
|
29 |
if ($node instanceof Twig_Node_Module) {
|
@@ -58,9 +57,6 @@ class Twig_NodeVisitor_Sandbox extends Twig_BaseNodeVisitor
|
|
58 |
return $node;
|
59 |
}
|
60 |
|
61 |
-
/**
|
62 |
-
* {@inheritdoc}
|
63 |
-
*/
|
64 |
protected function doLeaveNode(Twig_Node $node, Twig_Environment $env)
|
65 |
{
|
66 |
if ($node instanceof Twig_Node_Module) {
|
@@ -72,9 +68,6 @@ class Twig_NodeVisitor_Sandbox extends Twig_BaseNodeVisitor
|
|
72 |
return $node;
|
73 |
}
|
74 |
|
75 |
-
/**
|
76 |
-
* {@inheritdoc}
|
77 |
-
*/
|
78 |
public function getPriority()
|
79 |
{
|
80 |
return 0;
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
12 |
/**
|
13 |
* Twig_NodeVisitor_Sandbox implements sandboxing.
|
14 |
*
|
15 |
+
* @final
|
16 |
+
*
|
17 |
* @author Fabien Potencier <fabien@symfony.com>
|
18 |
*/
|
19 |
class Twig_NodeVisitor_Sandbox extends Twig_BaseNodeVisitor
|
23 |
protected $filters;
|
24 |
protected $functions;
|
25 |
|
|
|
|
|
|
|
26 |
protected function doEnterNode(Twig_Node $node, Twig_Environment $env)
|
27 |
{
|
28 |
if ($node instanceof Twig_Node_Module) {
|
57 |
return $node;
|
58 |
}
|
59 |
|
|
|
|
|
|
|
60 |
protected function doLeaveNode(Twig_Node $node, Twig_Environment $env)
|
61 |
{
|
62 |
if ($node instanceof Twig_Node_Module) {
|
68 |
return $node;
|
69 |
}
|
70 |
|
|
|
|
|
|
|
71 |
public function getPriority()
|
72 |
{
|
73 |
return 0;
|
vendor/twig/twig/lib/Twig/NodeVisitorInterface.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -19,9 +19,6 @@ interface Twig_NodeVisitorInterface
|
|
19 |
/**
|
20 |
* Called before child nodes are visited.
|
21 |
*
|
22 |
-
* @param Twig_NodeInterface $node The node to visit
|
23 |
-
* @param Twig_Environment $env The Twig environment instance
|
24 |
-
*
|
25 |
* @return Twig_NodeInterface The modified node
|
26 |
*/
|
27 |
public function enterNode(Twig_NodeInterface $node, Twig_Environment $env);
|
@@ -29,9 +26,6 @@ interface Twig_NodeVisitorInterface
|
|
29 |
/**
|
30 |
* Called after child nodes are visited.
|
31 |
*
|
32 |
-
* @param Twig_NodeInterface $node The node to visit
|
33 |
-
* @param Twig_Environment $env The Twig environment instance
|
34 |
-
*
|
35 |
* @return Twig_NodeInterface|false The modified node or false if the node must be removed
|
36 |
*/
|
37 |
public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env);
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
19 |
/**
|
20 |
* Called before child nodes are visited.
|
21 |
*
|
|
|
|
|
|
|
22 |
* @return Twig_NodeInterface The modified node
|
23 |
*/
|
24 |
public function enterNode(Twig_NodeInterface $node, Twig_Environment $env);
|
26 |
/**
|
27 |
* Called after child nodes are visited.
|
28 |
*
|
|
|
|
|
|
|
29 |
* @return Twig_NodeInterface|false The modified node or false if the node must be removed
|
30 |
*/
|
31 |
public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env);
|
vendor/twig/twig/lib/Twig/Parser.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
@@ -32,11 +32,6 @@ class Twig_Parser implements Twig_ParserInterface
|
|
32 |
protected $traits;
|
33 |
protected $embeddedTemplates = array();
|
34 |
|
35 |
-
/**
|
36 |
-
* Constructor.
|
37 |
-
*
|
38 |
-
* @param Twig_Environment $env A Twig_Environment instance
|
39 |
-
*/
|
40 |
public function __construct(Twig_Environment $env)
|
41 |
{
|
42 |
$this->env = $env;
|
@@ -67,9 +62,6 @@ class Twig_Parser implements Twig_ParserInterface
|
|
67 |
return $this->stream->getSourceContext()->getName();
|
68 |
}
|
69 |
|
70 |
-
/**
|
71 |
-
* {@inheritdoc}
|
72 |
-
*/
|
73 |
public function parse(Twig_TokenStream $stream, $test = null, $dropNeedle = false)
|
74 |
{
|
75 |
// push all variables into the stack to keep the current state of the parser
|
@@ -114,8 +106,8 @@ class Twig_Parser implements Twig_ParserInterface
|
|
114 |
$body = new Twig_Node();
|
115 |
}
|
116 |
} catch (Twig_Error_Syntax $e) {
|
117 |
-
if (!$e->
|
118 |
-
$e->
|
119 |
}
|
120 |
|
121 |
if (!$e->getTemplateLine()) {
|
@@ -162,7 +154,7 @@ class Twig_Parser implements Twig_ParserInterface
|
|
162 |
$token = $this->getCurrentToken();
|
163 |
|
164 |
if ($token->getType() !== Twig_Token::NAME_TYPE) {
|
165 |
-
throw new Twig_Error_Syntax('A block must start with a tag name.', $token->getLine(), $this->stream->getSourceContext()
|
166 |
}
|
167 |
|
168 |
if (null !== $test && call_user_func($test, $token)) {
|
@@ -180,13 +172,13 @@ class Twig_Parser implements Twig_ParserInterface
|
|
180 |
$subparser = $this->handlers->getTokenParser($token->getValue());
|
181 |
if (null === $subparser) {
|
182 |
if (null !== $test) {
|
183 |
-
$e = new Twig_Error_Syntax(sprintf('Unexpected "%s" tag', $token->getValue()), $token->getLine(), $this->stream->getSourceContext()
|
184 |
|
185 |
if (is_array($test) && isset($test[0]) && $test[0] instanceof Twig_TokenParserInterface) {
|
186 |
$e->appendMessage(sprintf(' (expecting closing tag for the "%s" tag defined near line %s).', $test[0]->getTag(), $lineno));
|
187 |
}
|
188 |
} else {
|
189 |
-
$e = new Twig_Error_Syntax(sprintf('Unknown "%s" tag.', $token->getValue()), $token->getLine(), $this->stream->getSourceContext()
|
190 |
$e->addSuggestions($token->getValue(), array_keys($this->env->getTags()));
|
191 |
}
|
192 |
|
@@ -202,7 +194,7 @@ class Twig_Parser implements Twig_ParserInterface
|
|
202 |
break;
|
203 |
|
204 |
default:
|
205 |
-
throw new Twig_Error_Syntax('Lexer or parser ended up in unsupported state.',
|
206 |
}
|
207 |
}
|
208 |
|
@@ -276,7 +268,7 @@ class Twig_Parser implements Twig_ParserInterface
|
|
276 |
public function setMacro($name, Twig_Node_Macro $node)
|
277 |
{
|
278 |
if ($this->isReservedMacroName($name)) {
|
279 |
-
throw new Twig_Error_Syntax(sprintf('"%s" cannot be used as a macro name as it is a reserved keyword.', $name), $node->getTemplateLine(), $this->stream->getSourceContext()
|
280 |
}
|
281 |
|
282 |
$this->macros[$name] = $node;
|
@@ -346,9 +338,7 @@ class Twig_Parser implements Twig_ParserInterface
|
|
346 |
}
|
347 |
|
348 |
/**
|
349 |
-
*
|
350 |
-
*
|
351 |
-
* @return Twig_ExpressionParser The expression parser
|
352 |
*/
|
353 |
public function getExpressionParser()
|
354 |
{
|
@@ -366,9 +356,7 @@ class Twig_Parser implements Twig_ParserInterface
|
|
366 |
}
|
367 |
|
368 |
/**
|
369 |
-
*
|
370 |
-
*
|
371 |
-
* @return Twig_TokenStream The token stream
|
372 |
*/
|
373 |
public function getStream()
|
374 |
{
|
@@ -376,9 +364,7 @@ class Twig_Parser implements Twig_ParserInterface
|
|
376 |
}
|
377 |
|
378 |
/**
|
379 |
-
*
|
380 |
-
*
|
381 |
-
* @return Twig_Token The current token
|
382 |
*/
|
383 |
public function getCurrentToken()
|
384 |
{
|
@@ -394,14 +380,14 @@ class Twig_Parser implements Twig_ParserInterface
|
|
394 |
(!$node instanceof Twig_Node_Text && !$node instanceof Twig_Node_BlockReference && $node instanceof Twig_NodeOutputInterface)
|
395 |
) {
|
396 |
if (false !== strpos((string) $node, chr(0xEF).chr(0xBB).chr(0xBF))) {
|
397 |
-
throw new Twig_Error_Syntax('A template that extends another one cannot start with a byte order mark (BOM); it must be removed.', $node->getTemplateLine(), $this->stream->getSourceContext()
|
398 |
}
|
399 |
|
400 |
-
throw new Twig_Error_Syntax('A template that extends another one cannot include contents outside Twig blocks. Did you forget to put the contents inside a {% block %} tag?', $node->getTemplateLine(), $this->stream->getSourceContext()
|
401 |
}
|
402 |
|
403 |
-
// bypass
|
404 |
-
if ($node instanceof
|
405 |
return $node;
|
406 |
}
|
407 |
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
32 |
protected $traits;
|
33 |
protected $embeddedTemplates = array();
|
34 |
|
|
|
|
|
|
|
|
|
|
|
35 |
public function __construct(Twig_Environment $env)
|
36 |
{
|
37 |
$this->env = $env;
|
62 |
return $this->stream->getSourceContext()->getName();
|
63 |
}
|
64 |
|
|
|
|
|
|
|
65 |
public function parse(Twig_TokenStream $stream, $test = null, $dropNeedle = false)
|
66 |
{
|
67 |
// push all variables into the stack to keep the current state of the parser
|
106 |
$body = new Twig_Node();
|
107 |
}
|
108 |
} catch (Twig_Error_Syntax $e) {
|
109 |
+
if (!$e->getSourceContext()) {
|
110 |
+
$e->setSourceContext($this->stream->getSourceContext());
|
111 |
}
|
112 |
|
113 |
if (!$e->getTemplateLine()) {
|
154 |
$token = $this->getCurrentToken();
|
155 |
|
156 |
if ($token->getType() !== Twig_Token::NAME_TYPE) {
|
157 |
+
throw new Twig_Error_Syntax('A block must start with a tag name.', $token->getLine(), $this->stream->getSourceContext());
|
158 |
}
|
159 |
|
160 |
if (null !== $test && call_user_func($test, $token)) {
|
172 |
$subparser = $this->handlers->getTokenParser($token->getValue());
|
173 |
if (null === $subparser) {
|
174 |
if (null !== $test) {
|
175 |
+
$e = new Twig_Error_Syntax(sprintf('Unexpected "%s" tag', $token->getValue()), $token->getLine(), $this->stream->getSourceContext());
|
176 |
|
177 |
if (is_array($test) && isset($test[0]) && $test[0] instanceof Twig_TokenParserInterface) {
|
178 |
$e->appendMessage(sprintf(' (expecting closing tag for the "%s" tag defined near line %s).', $test[0]->getTag(), $lineno));
|
179 |
}
|
180 |
} else {
|
181 |
+
$e = new Twig_Error_Syntax(sprintf('Unknown "%s" tag.', $token->getValue()), $token->getLine(), $this->stream->getSourceContext());
|
182 |
$e->addSuggestions($token->getValue(), array_keys($this->env->getTags()));
|
183 |
}
|
184 |
|
194 |
break;
|
195 |
|
196 |
default:
|
197 |
+
throw new Twig_Error_Syntax('Lexer or parser ended up in unsupported state.', $this->getCurrentToken()->getLine(), $this->stream->getSourceContext());
|
198 |
}
|
199 |
}
|
200 |
|
268 |
public function setMacro($name, Twig_Node_Macro $node)
|
269 |
{
|
270 |
if ($this->isReservedMacroName($name)) {
|
271 |
+
throw new Twig_Error_Syntax(sprintf('"%s" cannot be used as a macro name as it is a reserved keyword.', $name), $node->getTemplateLine(), $this->stream->getSourceContext());
|
272 |
}
|
273 |
|
274 |
$this->macros[$name] = $node;
|
338 |
}
|
339 |
|
340 |
/**
|
341 |
+
* @return Twig_ExpressionParser
|
|
|
|
|
342 |
*/
|
343 |
public function getExpressionParser()
|
344 |
{
|
356 |
}
|
357 |
|
358 |
/**
|
359 |
+
* @return Twig_TokenStream
|
|
|
|
|
360 |
*/
|
361 |
public function getStream()
|
362 |
{
|
364 |
}
|
365 |
|
366 |
/**
|
367 |
+
* @return Twig_Token
|
|
|
|
|
368 |
*/
|
369 |
public function getCurrentToken()
|
370 |
{
|
380 |
(!$node instanceof Twig_Node_Text && !$node instanceof Twig_Node_BlockReference && $node instanceof Twig_NodeOutputInterface)
|
381 |
) {
|
382 |
if (false !== strpos((string) $node, chr(0xEF).chr(0xBB).chr(0xBF))) {
|
383 |
+
throw new Twig_Error_Syntax('A template that extends another one cannot start with a byte order mark (BOM); it must be removed.', $node->getTemplateLine(), $this->stream->getSourceContext());
|
384 |
}
|
385 |
|
386 |
+
throw new Twig_Error_Syntax('A template that extends another one cannot include contents outside Twig blocks. Did you forget to put the contents inside a {% block %} tag?', $node->getTemplateLine(), $this->stream->getSourceContext());
|
387 |
}
|
388 |
|
389 |
+
// bypass nodes that will "capture" the output
|
390 |
+
if ($node instanceof Twig_NodeCaptureInterface) {
|
391 |
return $node;
|
392 |
}
|
393 |
|
vendor/twig/twig/lib/Twig/ParserInterface.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -21,9 +21,7 @@ interface Twig_ParserInterface
|
|
21 |
/**
|
22 |
* Converts a token stream to a node tree.
|
23 |
*
|
24 |
-
* @
|
25 |
-
*
|
26 |
-
* @return Twig_Node_Module A node tree
|
27 |
*
|
28 |
* @throws Twig_Error_Syntax When the token stream is syntactically or semantically wrong
|
29 |
*/
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
21 |
/**
|
22 |
* Converts a token stream to a node tree.
|
23 |
*
|
24 |
+
* @return Twig_Node_Module
|
|
|
|
|
25 |
*
|
26 |
* @throws Twig_Error_Syntax When the token stream is syntactically or semantically wrong
|
27 |
*/
|
vendor/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -11,6 +11,8 @@
|
|
11 |
|
12 |
/**
|
13 |
* @author Fabien Potencier <fabien@symfony.com>
|
|
|
|
|
14 |
*/
|
15 |
class Twig_Profiler_Dumper_Blackfire
|
16 |
{
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
11 |
|
12 |
/**
|
13 |
* @author Fabien Potencier <fabien@symfony.com>
|
14 |
+
*
|
15 |
+
* @final
|
16 |
*/
|
17 |
class Twig_Profiler_Dumper_Blackfire
|
18 |
{
|
vendor/twig/twig/lib/Twig/Profiler/Dumper/Html.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -11,6 +11,8 @@
|
|
11 |
|
12 |
/**
|
13 |
* @author Fabien Potencier <fabien@symfony.com>
|
|
|
|
|
14 |
*/
|
15 |
class Twig_Profiler_Dumper_Html extends Twig_Profiler_Dumper_Text
|
16 |
{
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
11 |
|
12 |
/**
|
13 |
* @author Fabien Potencier <fabien@symfony.com>
|
14 |
+
*
|
15 |
+
* @final
|
16 |
*/
|
17 |
class Twig_Profiler_Dumper_Html extends Twig_Profiler_Dumper_Text
|
18 |
{
|
vendor/twig/twig/lib/Twig/Profiler/Dumper/Text.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -11,6 +11,8 @@
|
|
11 |
|
12 |
/**
|
13 |
* @author Fabien Potencier <fabien@symfony.com>
|
|
|
|
|
14 |
*/
|
15 |
class Twig_Profiler_Dumper_Text
|
16 |
{
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
11 |
|
12 |
/**
|
13 |
* @author Fabien Potencier <fabien@symfony.com>
|
14 |
+
*
|
15 |
+
* @final
|
16 |
*/
|
17 |
class Twig_Profiler_Dumper_Text
|
18 |
{
|
vendor/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -21,9 +21,6 @@ class Twig_Profiler_Node_EnterProfile extends Twig_Node
|
|
21 |
parent::__construct(array(), array('extension_name' => $extensionName, 'name' => $name, 'type' => $type, 'var_name' => $varName));
|
22 |
}
|
23 |
|
24 |
-
/**
|
25 |
-
* {@inheritdoc}
|
26 |
-
*/
|
27 |
public function compile(Twig_Compiler $compiler)
|
28 |
{
|
29 |
$compiler
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
21 |
parent::__construct(array(), array('extension_name' => $extensionName, 'name' => $name, 'type' => $type, 'var_name' => $varName));
|
22 |
}
|
23 |
|
|
|
|
|
|
|
24 |
public function compile(Twig_Compiler $compiler)
|
25 |
{
|
26 |
$compiler
|
vendor/twig/twig/lib/Twig/Profiler/Node/LeaveProfile.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -21,9 +21,6 @@ class Twig_Profiler_Node_LeaveProfile extends Twig_Node
|
|
21 |
parent::__construct(array(), array('var_name' => $varName));
|
22 |
}
|
23 |
|
24 |
-
/**
|
25 |
-
* {@inheritdoc}
|
26 |
-
*/
|
27 |
public function compile(Twig_Compiler $compiler)
|
28 |
{
|
29 |
$compiler
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
21 |
parent::__construct(array(), array('var_name' => $varName));
|
22 |
}
|
23 |
|
|
|
|
|
|
|
24 |
public function compile(Twig_Compiler $compiler)
|
25 |
{
|
26 |
$compiler
|
vendor/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -11,6 +11,8 @@
|
|
11 |
|
12 |
/**
|
13 |
* @author Fabien Potencier <fabien@symfony.com>
|
|
|
|
|
14 |
*/
|
15 |
class Twig_Profiler_NodeVisitor_Profiler extends Twig_BaseNodeVisitor
|
16 |
{
|
@@ -21,17 +23,11 @@ class Twig_Profiler_NodeVisitor_Profiler extends Twig_BaseNodeVisitor
|
|
21 |
$this->extensionName = $extensionName;
|
22 |
}
|
23 |
|
24 |
-
/**
|
25 |
-
* {@inheritdoc}
|
26 |
-
*/
|
27 |
protected function doEnterNode(Twig_Node $node, Twig_Environment $env)
|
28 |
{
|
29 |
return $node;
|
30 |
}
|
31 |
|
32 |
-
/**
|
33 |
-
* {@inheritdoc}
|
34 |
-
*/
|
35 |
protected function doLeaveNode(Twig_Node $node, Twig_Environment $env)
|
36 |
{
|
37 |
if ($node instanceof Twig_Node_Module) {
|
@@ -41,14 +37,14 @@ class Twig_Profiler_NodeVisitor_Profiler extends Twig_BaseNodeVisitor
|
|
41 |
} elseif ($node instanceof Twig_Node_Block) {
|
42 |
$varName = $this->getVarName();
|
43 |
$node->setNode('body', new Twig_Node_Body(array(
|
44 |
-
new Twig_Profiler_Node_EnterProfile($this->extensionName, Twig_Profiler_Profile::BLOCK, $node->
|
45 |
$node->getNode('body'),
|
46 |
new Twig_Profiler_Node_LeaveProfile($varName),
|
47 |
)));
|
48 |
} elseif ($node instanceof Twig_Node_Macro) {
|
49 |
$varName = $this->getVarName();
|
50 |
$node->setNode('body', new Twig_Node_Body(array(
|
51 |
-
new Twig_Profiler_Node_EnterProfile($this->extensionName, Twig_Profiler_Profile::MACRO, $node->
|
52 |
$node->getNode('body'),
|
53 |
new Twig_Profiler_Node_LeaveProfile($varName),
|
54 |
)));
|
@@ -62,9 +58,6 @@ class Twig_Profiler_NodeVisitor_Profiler extends Twig_BaseNodeVisitor
|
|
62 |
return sprintf('__internal_%s', hash('sha256', uniqid(mt_rand(), true), false));
|
63 |
}
|
64 |
|
65 |
-
/**
|
66 |
-
* {@inheritdoc}
|
67 |
-
*/
|
68 |
public function getPriority()
|
69 |
{
|
70 |
return 0;
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
11 |
|
12 |
/**
|
13 |
* @author Fabien Potencier <fabien@symfony.com>
|
14 |
+
*
|
15 |
+
* @final
|
16 |
*/
|
17 |
class Twig_Profiler_NodeVisitor_Profiler extends Twig_BaseNodeVisitor
|
18 |
{
|
23 |
$this->extensionName = $extensionName;
|
24 |
}
|
25 |
|
|
|
|
|
|
|
26 |
protected function doEnterNode(Twig_Node $node, Twig_Environment $env)
|
27 |
{
|
28 |
return $node;
|
29 |
}
|
30 |
|
|
|
|
|
|
|
31 |
protected function doLeaveNode(Twig_Node $node, Twig_Environment $env)
|
32 |
{
|
33 |
if ($node instanceof Twig_Node_Module) {
|
37 |
} elseif ($node instanceof Twig_Node_Block) {
|
38 |
$varName = $this->getVarName();
|
39 |
$node->setNode('body', new Twig_Node_Body(array(
|
40 |
+
new Twig_Profiler_Node_EnterProfile($this->extensionName, Twig_Profiler_Profile::BLOCK, $node->getAttribute('name'), $varName),
|
41 |
$node->getNode('body'),
|
42 |
new Twig_Profiler_Node_LeaveProfile($varName),
|
43 |
)));
|
44 |
} elseif ($node instanceof Twig_Node_Macro) {
|
45 |
$varName = $this->getVarName();
|
46 |
$node->setNode('body', new Twig_Node_Body(array(
|
47 |
+
new Twig_Profiler_Node_EnterProfile($this->extensionName, Twig_Profiler_Profile::MACRO, $node->getAttribute('name'), $varName),
|
48 |
$node->getNode('body'),
|
49 |
new Twig_Profiler_Node_LeaveProfile($varName),
|
50 |
)));
|
58 |
return sprintf('__internal_%s', hash('sha256', uniqid(mt_rand(), true), false));
|
59 |
}
|
60 |
|
|
|
|
|
|
|
61 |
public function getPriority()
|
62 |
{
|
63 |
return 0;
|
vendor/twig/twig/lib/Twig/Profiler/Profile.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -11,6 +11,8 @@
|
|
11 |
|
12 |
/**
|
13 |
* @author Fabien Potencier <fabien@symfony.com>
|
|
|
|
|
14 |
*/
|
15 |
class Twig_Profiler_Profile implements IteratorAggregate, Serializable
|
16 |
{
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
11 |
|
12 |
/**
|
13 |
* @author Fabien Potencier <fabien@symfony.com>
|
14 |
+
*
|
15 |
+
* @final
|
16 |
*/
|
17 |
class Twig_Profiler_Profile implements IteratorAggregate, Serializable
|
18 |
{
|
vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedMethodError.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedPropertyError.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -12,6 +12,8 @@
|
|
12 |
/**
|
13 |
* Represents a security policy which need to be enforced when sandbox mode is enabled.
|
14 |
*
|
|
|
|
|
15 |
* @author Fabien Potencier <fabien@symfony.com>
|
16 |
*/
|
17 |
class Twig_Sandbox_SecurityPolicy implements Twig_Sandbox_SecurityPolicyInterface
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
12 |
/**
|
13 |
* Represents a security policy which need to be enforced when sandbox mode is enabled.
|
14 |
*
|
15 |
+
* @final
|
16 |
+
*
|
17 |
* @author Fabien Potencier <fabien@symfony.com>
|
18 |
*/
|
19 |
class Twig_Sandbox_SecurityPolicy implements Twig_Sandbox_SecurityPolicyInterface
|
vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/SimpleFilter.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -12,6 +12,8 @@
|
|
12 |
/**
|
13 |
* Represents a template filter.
|
14 |
*
|
|
|
|
|
15 |
* @author Fabien Potencier <fabien@symfony.com>
|
16 |
*/
|
17 |
class Twig_SimpleFilter
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
12 |
/**
|
13 |
* Represents a template filter.
|
14 |
*
|
15 |
+
* @final
|
16 |
+
*
|
17 |
* @author Fabien Potencier <fabien@symfony.com>
|
18 |
*/
|
19 |
class Twig_SimpleFilter
|
vendor/twig/twig/lib/Twig/SimpleFunction.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -12,6 +12,8 @@
|
|
12 |
/**
|
13 |
* Represents a template function.
|
14 |
*
|
|
|
|
|
15 |
* @author Fabien Potencier <fabien@symfony.com>
|
16 |
*/
|
17 |
class Twig_SimpleFunction
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
12 |
/**
|
13 |
* Represents a template function.
|
14 |
*
|
15 |
+
* @final
|
16 |
+
*
|
17 |
* @author Fabien Potencier <fabien@symfony.com>
|
18 |
*/
|
19 |
class Twig_SimpleFunction
|
vendor/twig/twig/lib/Twig/SimpleTest.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -12,6 +12,8 @@
|
|
12 |
/**
|
13 |
* Represents a template test.
|
14 |
*
|
|
|
|
|
15 |
* @author Fabien Potencier <fabien@symfony.com>
|
16 |
*/
|
17 |
class Twig_SimpleTest
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
12 |
/**
|
13 |
* Represents a template test.
|
14 |
*
|
15 |
+
* @final
|
16 |
+
*
|
17 |
* @author Fabien Potencier <fabien@symfony.com>
|
18 |
*/
|
19 |
class Twig_SimpleTest
|
vendor/twig/twig/lib/Twig/Source.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -12,6 +12,8 @@
|
|
12 |
/**
|
13 |
* Holds information about a non-compiled Twig template.
|
14 |
*
|
|
|
|
|
15 |
* @author Fabien Potencier <fabien@symfony.com>
|
16 |
*/
|
17 |
class Twig_Source
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
12 |
/**
|
13 |
* Holds information about a non-compiled Twig template.
|
14 |
*
|
15 |
+
* @final
|
16 |
+
*
|
17 |
* @author Fabien Potencier <fabien@symfony.com>
|
18 |
*/
|
19 |
class Twig_Source
|
vendor/twig/twig/lib/Twig/SourceContextLoaderInterface.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Template.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
@@ -13,10 +13,19 @@
|
|
13 |
/**
|
14 |
* Default base class for compiled templates.
|
15 |
*
|
|
|
|
|
|
|
|
|
16 |
* @author Fabien Potencier <fabien@symfony.com>
|
|
|
|
|
17 |
*/
|
18 |
abstract class Twig_Template implements Twig_TemplateInterface
|
19 |
{
|
|
|
|
|
|
|
20 |
protected static $cache = array();
|
21 |
|
22 |
protected $parent;
|
@@ -25,16 +34,19 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
25 |
protected $blocks = array();
|
26 |
protected $traits = array();
|
27 |
|
28 |
-
/**
|
29 |
-
* Constructor.
|
30 |
-
*
|
31 |
-
* @param Twig_Environment $env A Twig_Environment instance
|
32 |
-
*/
|
33 |
public function __construct(Twig_Environment $env)
|
34 |
{
|
35 |
$this->env = $env;
|
36 |
}
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
/**
|
39 |
* Returns the template name.
|
40 |
*
|
@@ -121,7 +133,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
121 |
$this->parents[$parent] = $this->loadTemplate($parent);
|
122 |
}
|
123 |
} catch (Twig_Error_Loader $e) {
|
124 |
-
$e->
|
125 |
$e->guess();
|
126 |
|
127 |
throw $e;
|
@@ -161,7 +173,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
161 |
} elseif (false !== $parent = $this->getParent($context)) {
|
162 |
$parent->displayBlock($name, $context, $blocks, false);
|
163 |
} else {
|
164 |
-
throw new Twig_Error_Runtime(sprintf('The template has no parent and no traits defining the "%s" block.', $name), -1, $this->
|
165 |
}
|
166 |
}
|
167 |
|
@@ -193,17 +205,17 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
193 |
$block = null;
|
194 |
}
|
195 |
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
}
|
201 |
|
|
|
202 |
try {
|
203 |
$template->$block($context, $blocks);
|
204 |
} catch (Twig_Error $e) {
|
205 |
-
if (!$e->
|
206 |
-
$e->
|
207 |
}
|
208 |
|
209 |
// this is mostly useful for Twig_Error_Loader exceptions
|
@@ -215,10 +227,12 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
215 |
|
216 |
throw $e;
|
217 |
} catch (Exception $e) {
|
218 |
-
throw new Twig_Error_Runtime(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->
|
219 |
}
|
220 |
} elseif (false !== $parent = $this->getParent($context)) {
|
221 |
$parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false);
|
|
|
|
|
222 |
}
|
223 |
}
|
224 |
|
@@ -268,44 +282,70 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
268 |
}
|
269 |
|
270 |
/**
|
271 |
-
* Returns whether a block exists or not.
|
272 |
*
|
273 |
-
* This method
|
274 |
-
*
|
275 |
-
*
|
276 |
-
* This method does only return blocks defined in the current template
|
277 |
-
* or defined in "used" traits.
|
278 |
*
|
279 |
-
*
|
280 |
-
*
|
281 |
-
* current
|
282 |
-
*
|
283 |
-
* @param string $name The block name
|
284 |
*
|
285 |
* @return bool true if the block exists, false otherwise
|
286 |
*
|
287 |
* @internal
|
288 |
*/
|
289 |
-
public function hasBlock($name)
|
290 |
{
|
291 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
292 |
}
|
293 |
|
294 |
/**
|
295 |
-
* Returns all block names.
|
296 |
*
|
297 |
-
* This method
|
298 |
-
*
|
299 |
*
|
300 |
-
* @
|
|
|
301 |
*
|
302 |
-
* @
|
303 |
*
|
304 |
* @internal
|
305 |
*/
|
306 |
-
public function getBlockNames()
|
307 |
{
|
308 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
309 |
}
|
310 |
|
311 |
protected function loadTemplate($template, $templateName = null, $line = null, $index = null)
|
@@ -319,10 +359,14 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
319 |
return $template;
|
320 |
}
|
321 |
|
|
|
|
|
|
|
|
|
322 |
return $this->env->loadTemplate($template, $index);
|
323 |
} catch (Twig_Error $e) {
|
324 |
-
if (!$e->
|
325 |
-
$e->
|
326 |
}
|
327 |
|
328 |
if ($e->getTemplateLine()) {
|
@@ -347,8 +391,6 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
347 |
*
|
348 |
* @return array An array of blocks
|
349 |
*
|
350 |
-
* @see hasBlock
|
351 |
-
*
|
352 |
* @internal
|
353 |
*/
|
354 |
public function getBlocks()
|
@@ -356,17 +398,11 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
356 |
return $this->blocks;
|
357 |
}
|
358 |
|
359 |
-
/**
|
360 |
-
* {@inheritdoc}
|
361 |
-
*/
|
362 |
public function display(array $context, array $blocks = array())
|
363 |
{
|
364 |
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
|
365 |
}
|
366 |
|
367 |
-
/**
|
368 |
-
* {@inheritdoc}
|
369 |
-
*/
|
370 |
public function render(array $context)
|
371 |
{
|
372 |
$level = ob_get_level();
|
@@ -395,8 +431,8 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
395 |
try {
|
396 |
$this->doDisplay($context, $blocks);
|
397 |
} catch (Twig_Error $e) {
|
398 |
-
if (!$e->
|
399 |
-
$e->
|
400 |
}
|
401 |
|
402 |
// this is mostly useful for Twig_Error_Loader exceptions
|
@@ -408,7 +444,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
408 |
|
409 |
throw $e;
|
410 |
} catch (Exception $e) {
|
411 |
-
throw new Twig_Error_Runtime(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->
|
412 |
}
|
413 |
}
|
414 |
|
@@ -448,7 +484,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
448 |
return;
|
449 |
}
|
450 |
|
451 |
-
throw new Twig_Error_Runtime(sprintf('Variable "%s" does not exist.', $item), -1, $this->
|
452 |
}
|
453 |
|
454 |
return $context[$item];
|
@@ -467,6 +503,8 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
467 |
* @return mixed The attribute value, or a Boolean when $isDefinedTest is true, or null when the attribute is not set and $ignoreStrictCheck is true
|
468 |
*
|
469 |
* @throws Twig_Error_Runtime if the attribute does not exist and Twig is running in strict mode and $isDefinedTest is false
|
|
|
|
|
470 |
*/
|
471 |
protected function getAttribute($object, $item, array $arguments = array(), $type = self::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false)
|
472 |
{
|
@@ -474,7 +512,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
474 |
if (self::METHOD_CALL !== $type) {
|
475 |
$arrayItem = is_bool($item) || is_float($item) ? (int) $item : $item;
|
476 |
|
477 |
-
if ((is_array($object) && array_key_exists($arrayItem, $object))
|
478 |
|| ($object instanceof ArrayAccess && isset($object[$arrayItem]))
|
479 |
) {
|
480 |
if ($isDefinedTest) {
|
@@ -515,7 +553,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
515 |
$message = sprintf('Impossible to access an attribute ("%s") on a %s variable ("%s").', $item, gettype($object), $object);
|
516 |
}
|
517 |
|
518 |
-
throw new Twig_Error_Runtime($message, -1, $this->
|
519 |
}
|
520 |
}
|
521 |
|
@@ -534,7 +572,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
534 |
$message = sprintf('Impossible to invoke a method ("%s") on a %s variable ("%s").', $item, gettype($object), $object);
|
535 |
}
|
536 |
|
537 |
-
throw new Twig_Error_Runtime($message, -1, $this->
|
538 |
}
|
539 |
|
540 |
// object property
|
@@ -555,37 +593,57 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
555 |
$class = get_class($object);
|
556 |
|
557 |
// object method
|
558 |
-
if (!isset(self::$cache[$class]
|
559 |
// get_class_methods returns all methods accessible in the scope, but we only want public ones to be accessible in templates
|
560 |
if ($object instanceof self) {
|
561 |
$ref = new ReflectionClass($class);
|
562 |
$methods = array();
|
563 |
|
564 |
foreach ($ref->getMethods(ReflectionMethod::IS_PUBLIC) as $refMethod) {
|
565 |
-
$methodName = strtolower($refMethod->name);
|
566 |
-
|
567 |
// Accessing the environment from templates is forbidden to prevent untrusted changes to the environment
|
568 |
-
if ('getenvironment' !== $
|
569 |
-
$methods[
|
570 |
}
|
571 |
}
|
572 |
-
|
573 |
-
self::$cache[$class]['methods'] = $methods;
|
574 |
} else {
|
575 |
-
|
576 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
577 |
}
|
578 |
|
579 |
$call = false;
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
$method = 'is'.$item;
|
587 |
-
} elseif (isset(self::$cache[$class]['methods']['__call'])) {
|
588 |
-
$method = (string) $item;
|
589 |
$call = true;
|
590 |
} else {
|
591 |
if ($isDefinedTest) {
|
@@ -596,7 +654,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
596 |
return;
|
597 |
}
|
598 |
|
599 |
-
throw new Twig_Error_Runtime(sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()"/"is%1$s()" or "__call()" exist and have public access in class "%2$s".', $item,
|
600 |
}
|
601 |
|
602 |
if ($isDefinedTest) {
|
@@ -610,7 +668,11 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
610 |
// Some objects throw exceptions when they have __call, and the method we try
|
611 |
// to call is not supported. If ignoreStrictCheck is true, we should return null.
|
612 |
try {
|
613 |
-
|
|
|
|
|
|
|
|
|
614 |
} catch (BadMethodCallException $e) {
|
615 |
if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) {
|
616 |
return;
|
@@ -618,9 +680,19 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|
618 |
throw $e;
|
619 |
}
|
620 |
|
621 |
-
//
|
622 |
-
// this is not supported but unfortunately heavily used in the Symfony profiler
|
623 |
if ($object instanceof Twig_TemplateInterface) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
624 |
return $ret === '' ? '' : new Twig_Markup($ret, $this->env->getCharset());
|
625 |
}
|
626 |
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
13 |
/**
|
14 |
* Default base class for compiled templates.
|
15 |
*
|
16 |
+
* This class is an implementation detail of how template compilation currently
|
17 |
+
* works, which might change. It should never be used directly. Use $twig->load()
|
18 |
+
* instead, which returns an instance of Twig_TemplateWrapper.
|
19 |
+
*
|
20 |
* @author Fabien Potencier <fabien@symfony.com>
|
21 |
+
*
|
22 |
+
* @internal
|
23 |
*/
|
24 |
abstract class Twig_Template implements Twig_TemplateInterface
|
25 |
{
|
26 |
+
/**
|
27 |
+
* @internal
|
28 |
+
*/
|
29 |
protected static $cache = array();
|
30 |
|
31 |
protected $parent;
|
34 |
protected $blocks = array();
|
35 |
protected $traits = array();
|
36 |
|
|
|
|
|
|
|
|
|
|
|
37 |
public function __construct(Twig_Environment $env)
|
38 |
{
|
39 |
$this->env = $env;
|
40 |
}
|
41 |
|
42 |
+
/**
|
43 |
+
* @internal this method will be removed in 2.0 and is only used internally to provide an upgrade path from 1.x to 2.0
|
44 |
+
*/
|
45 |
+
public function __toString()
|
46 |
+
{
|
47 |
+
return $this->getTemplateName();
|
48 |
+
}
|
49 |
+
|
50 |
/**
|
51 |
* Returns the template name.
|
52 |
*
|
133 |
$this->parents[$parent] = $this->loadTemplate($parent);
|
134 |
}
|
135 |
} catch (Twig_Error_Loader $e) {
|
136 |
+
$e->setSourceContext(null);
|
137 |
$e->guess();
|
138 |
|
139 |
throw $e;
|
173 |
} elseif (false !== $parent = $this->getParent($context)) {
|
174 |
$parent->displayBlock($name, $context, $blocks, false);
|
175 |
} else {
|
176 |
+
throw new Twig_Error_Runtime(sprintf('The template has no parent and no traits defining the "%s" block.', $name), -1, $this->getSourceContext());
|
177 |
}
|
178 |
}
|
179 |
|
205 |
$block = null;
|
206 |
}
|
207 |
|
208 |
+
// avoid RCEs when sandbox is enabled
|
209 |
+
if (null !== $template && !$template instanceof self) {
|
210 |
+
throw new LogicException('A block must be a method on a Twig_Template instance.');
|
211 |
+
}
|
|
|
212 |
|
213 |
+
if (null !== $template) {
|
214 |
try {
|
215 |
$template->$block($context, $blocks);
|
216 |
} catch (Twig_Error $e) {
|
217 |
+
if (!$e->getSourceContext()) {
|
218 |
+
$e->setSourceContext($template->getSourceContext());
|
219 |
}
|
220 |
|
221 |
// this is mostly useful for Twig_Error_Loader exceptions
|
227 |
|
228 |
throw $e;
|
229 |
} catch (Exception $e) {
|
230 |
+
throw new Twig_Error_Runtime(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e);
|
231 |
}
|
232 |
} elseif (false !== $parent = $this->getParent($context)) {
|
233 |
$parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false);
|
234 |
+
} else {
|
235 |
+
@trigger_error(sprintf('Silent display of undefined block "%s" in template "%s" is deprecated since version 1.29 and will throw an exception in 2.0. Use the "block(\'%s\') is defined" expression to test for block existence.', $name, $this->getTemplateName(), $name), E_USER_DEPRECATED);
|
236 |
}
|
237 |
}
|
238 |
|
282 |
}
|
283 |
|
284 |
/**
|
285 |
+
* Returns whether a block exists or not in the current context of the template.
|
286 |
*
|
287 |
+
* This method checks blocks defined in the current template
|
288 |
+
* or defined in "used" traits or defined in parent templates.
|
|
|
|
|
|
|
289 |
*
|
290 |
+
* @param string $name The block name
|
291 |
+
* @param array $context The context
|
292 |
+
* @param array $blocks The current set of blocks
|
|
|
|
|
293 |
*
|
294 |
* @return bool true if the block exists, false otherwise
|
295 |
*
|
296 |
* @internal
|
297 |
*/
|
298 |
+
public function hasBlock($name, array $context = null, array $blocks = array())
|
299 |
{
|
300 |
+
if (null === $context) {
|
301 |
+
@trigger_error('The '.__METHOD__.' method is internal and should never be called; calling it directly is deprecated since version 1.28 and won\'t be possible anymore in 2.0.', E_USER_DEPRECATED);
|
302 |
+
|
303 |
+
return isset($this->blocks[(string) $name]);
|
304 |
+
}
|
305 |
+
|
306 |
+
if (isset($blocks[$name])) {
|
307 |
+
return $blocks[$name][0] instanceof self;
|
308 |
+
}
|
309 |
+
|
310 |
+
if (isset($this->blocks[$name])) {
|
311 |
+
return true;
|
312 |
+
}
|
313 |
+
|
314 |
+
if (false !== $parent = $this->getParent($context)) {
|
315 |
+
return $parent->hasBlock($name, $context);
|
316 |
+
}
|
317 |
+
|
318 |
+
return false;
|
319 |
}
|
320 |
|
321 |
/**
|
322 |
+
* Returns all block names in the current context of the template.
|
323 |
*
|
324 |
+
* This method checks blocks defined in the current template
|
325 |
+
* or defined in "used" traits or defined in parent templates.
|
326 |
*
|
327 |
+
* @param array $context The context
|
328 |
+
* @param array $blocks The current set of blocks
|
329 |
*
|
330 |
+
* @return array An array of block names
|
331 |
*
|
332 |
* @internal
|
333 |
*/
|
334 |
+
public function getBlockNames(array $context = null, array $blocks = array())
|
335 |
{
|
336 |
+
if (null === $context) {
|
337 |
+
@trigger_error('The '.__METHOD__.' method is internal and should never be called; calling it directly is deprecated since version 1.28 and won\'t be possible anymore in 2.0.', E_USER_DEPRECATED);
|
338 |
+
|
339 |
+
return array_keys($this->blocks);
|
340 |
+
}
|
341 |
+
|
342 |
+
$names = array_merge(array_keys($blocks), array_keys($this->blocks));
|
343 |
+
|
344 |
+
if (false !== $parent = $this->getParent($context)) {
|
345 |
+
$names = array_merge($names, $parent->getBlockNames($context));
|
346 |
+
}
|
347 |
+
|
348 |
+
return array_unique($names);
|
349 |
}
|
350 |
|
351 |
protected function loadTemplate($template, $templateName = null, $line = null, $index = null)
|
359 |
return $template;
|
360 |
}
|
361 |
|
362 |
+
if ($template instanceof Twig_TemplateWrapper) {
|
363 |
+
return $template;
|
364 |
+
}
|
365 |
+
|
366 |
return $this->env->loadTemplate($template, $index);
|
367 |
} catch (Twig_Error $e) {
|
368 |
+
if (!$e->getSourceContext()) {
|
369 |
+
$e->setSourceContext($templateName ? new Twig_Source('', $templateName) : $this->getSourceContext());
|
370 |
}
|
371 |
|
372 |
if ($e->getTemplateLine()) {
|
391 |
*
|
392 |
* @return array An array of blocks
|
393 |
*
|
|
|
|
|
394 |
* @internal
|
395 |
*/
|
396 |
public function getBlocks()
|
398 |
return $this->blocks;
|
399 |
}
|
400 |
|
|
|
|
|
|
|
401 |
public function display(array $context, array $blocks = array())
|
402 |
{
|
403 |
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
|
404 |
}
|
405 |
|
|
|
|
|
|
|
406 |
public function render(array $context)
|
407 |
{
|
408 |
$level = ob_get_level();
|
431 |
try {
|
432 |
$this->doDisplay($context, $blocks);
|
433 |
} catch (Twig_Error $e) {
|
434 |
+
if (!$e->getSourceContext()) {
|
435 |
+
$e->setSourceContext($this->getSourceContext());
|
436 |
}
|
437 |
|
438 |
// this is mostly useful for Twig_Error_Loader exceptions
|
444 |
|
445 |
throw $e;
|
446 |
} catch (Exception $e) {
|
447 |
+
throw new Twig_Error_Runtime(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
|
448 |
}
|
449 |
}
|
450 |
|
484 |
return;
|
485 |
}
|
486 |
|
487 |
+
throw new Twig_Error_Runtime(sprintf('Variable "%s" does not exist.', $item), -1, $this->getSourceContext());
|
488 |
}
|
489 |
|
490 |
return $context[$item];
|
503 |
* @return mixed The attribute value, or a Boolean when $isDefinedTest is true, or null when the attribute is not set and $ignoreStrictCheck is true
|
504 |
*
|
505 |
* @throws Twig_Error_Runtime if the attribute does not exist and Twig is running in strict mode and $isDefinedTest is false
|
506 |
+
*
|
507 |
+
* @internal
|
508 |
*/
|
509 |
protected function getAttribute($object, $item, array $arguments = array(), $type = self::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false)
|
510 |
{
|
512 |
if (self::METHOD_CALL !== $type) {
|
513 |
$arrayItem = is_bool($item) || is_float($item) ? (int) $item : $item;
|
514 |
|
515 |
+
if ((is_array($object) && (isset($object[$arrayItem]) || array_key_exists($arrayItem, $object)))
|
516 |
|| ($object instanceof ArrayAccess && isset($object[$arrayItem]))
|
517 |
) {
|
518 |
if ($isDefinedTest) {
|
553 |
$message = sprintf('Impossible to access an attribute ("%s") on a %s variable ("%s").', $item, gettype($object), $object);
|
554 |
}
|
555 |
|
556 |
+
throw new Twig_Error_Runtime($message, -1, $this->getSourceContext());
|
557 |
}
|
558 |
}
|
559 |
|
572 |
$message = sprintf('Impossible to invoke a method ("%s") on a %s variable ("%s").', $item, gettype($object), $object);
|
573 |
}
|
574 |
|
575 |
+
throw new Twig_Error_Runtime($message, -1, $this->getSourceContext());
|
576 |
}
|
577 |
|
578 |
// object property
|
593 |
$class = get_class($object);
|
594 |
|
595 |
// object method
|
596 |
+
if (!isset(self::$cache[$class])) {
|
597 |
// get_class_methods returns all methods accessible in the scope, but we only want public ones to be accessible in templates
|
598 |
if ($object instanceof self) {
|
599 |
$ref = new ReflectionClass($class);
|
600 |
$methods = array();
|
601 |
|
602 |
foreach ($ref->getMethods(ReflectionMethod::IS_PUBLIC) as $refMethod) {
|
|
|
|
|
603 |
// Accessing the environment from templates is forbidden to prevent untrusted changes to the environment
|
604 |
+
if ('getenvironment' !== strtolower($refMethod->name)) {
|
605 |
+
$methods[] = $refMethod->name;
|
606 |
}
|
607 |
}
|
|
|
|
|
608 |
} else {
|
609 |
+
$methods = get_class_methods($object);
|
610 |
}
|
611 |
+
// sort values to have consistent behavior, so that "get" methods win precedence over "is" methods
|
612 |
+
sort($methods);
|
613 |
+
|
614 |
+
$cache = array();
|
615 |
+
|
616 |
+
foreach ($methods as $method) {
|
617 |
+
$cache[$method] = $method;
|
618 |
+
$cache[$lcName = strtolower($method)] = $method;
|
619 |
+
|
620 |
+
if ('g' === $lcName[0] && 0 === strpos($lcName, 'get')) {
|
621 |
+
$name = substr($method, 3);
|
622 |
+
$lcName = substr($lcName, 3);
|
623 |
+
} elseif ('i' === $lcName[0] && 0 === strpos($lcName, 'is')) {
|
624 |
+
$name = substr($method, 2);
|
625 |
+
$lcName = substr($lcName, 2);
|
626 |
+
} else {
|
627 |
+
continue;
|
628 |
+
}
|
629 |
+
|
630 |
+
if (!isset($cache[$name])) {
|
631 |
+
$cache[$name] = $method;
|
632 |
+
}
|
633 |
+
if (!isset($cache[$lcName])) {
|
634 |
+
$cache[$lcName] = $method;
|
635 |
+
}
|
636 |
+
}
|
637 |
+
self::$cache[$class] = $cache;
|
638 |
}
|
639 |
|
640 |
$call = false;
|
641 |
+
if (isset(self::$cache[$class][$item])) {
|
642 |
+
$method = self::$cache[$class][$item];
|
643 |
+
} elseif (isset(self::$cache[$class][$lcItem = strtolower($item)])) {
|
644 |
+
$method = self::$cache[$class][$lcItem];
|
645 |
+
} elseif (isset(self::$cache[$class]['__call'])) {
|
646 |
+
$method = $item;
|
|
|
|
|
|
|
647 |
$call = true;
|
648 |
} else {
|
649 |
if ($isDefinedTest) {
|
654 |
return;
|
655 |
}
|
656 |
|
657 |
+
throw new Twig_Error_Runtime(sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()"/"is%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, $class), -1, $this->getSourceContext());
|
658 |
}
|
659 |
|
660 |
if ($isDefinedTest) {
|
668 |
// Some objects throw exceptions when they have __call, and the method we try
|
669 |
// to call is not supported. If ignoreStrictCheck is true, we should return null.
|
670 |
try {
|
671 |
+
if (!$arguments) {
|
672 |
+
$ret = $object->$method();
|
673 |
+
} else {
|
674 |
+
$ret = call_user_func_array(array($object, $method), $arguments);
|
675 |
+
}
|
676 |
} catch (BadMethodCallException $e) {
|
677 |
if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) {
|
678 |
return;
|
680 |
throw $e;
|
681 |
}
|
682 |
|
683 |
+
// @deprecated in 1.28
|
|
|
684 |
if ($object instanceof Twig_TemplateInterface) {
|
685 |
+
$self = $object->getTemplateName() === $this->getTemplateName();
|
686 |
+
$message = sprintf('Calling "%s" on template "%s" from template "%s" is deprecated since version 1.28 and won\'t be supported anymore in 2.0.', $item, $object->getTemplateName(), $this->getTemplateName());
|
687 |
+
if ('renderBlock' === $method || 'displayBlock' === $method) {
|
688 |
+
$message .= sprintf(' Use block("%s"%s) instead).', $arguments[0], $self ? '' : ', template');
|
689 |
+
} elseif ('hasBlock' === $method) {
|
690 |
+
$message .= sprintf(' Use "block("%s"%s) is defined" instead).', $arguments[0], $self ? '' : ', template');
|
691 |
+
} elseif ('render' === $method || 'display' === $method) {
|
692 |
+
$message .= sprintf(' Use include("%s") instead).', $object->getTemplateName());
|
693 |
+
}
|
694 |
+
@trigger_error($message, E_USER_DEPRECATED);
|
695 |
+
|
696 |
return $ret === '' ? '' : new Twig_Markup($ret, $this->env->getCharset());
|
697 |
}
|
698 |
|
vendor/twig/twig/lib/Twig/TemplateInterface.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -42,7 +42,7 @@ interface Twig_TemplateInterface
|
|
42 |
/**
|
43 |
* Returns the bound environment for this template.
|
44 |
*
|
45 |
-
* @return Twig_Environment
|
46 |
*/
|
47 |
public function getEnvironment();
|
48 |
}
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
42 |
/**
|
43 |
* Returns the bound environment for this template.
|
44 |
*
|
45 |
+
* @return Twig_Environment
|
46 |
*/
|
47 |
public function getEnvironment();
|
48 |
}
|
vendor/twig/twig/lib/Twig/TemplateWrapper.php
ADDED
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of Twig.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Exposes a template to userland.
|
14 |
+
*
|
15 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
16 |
+
*/
|
17 |
+
final class Twig_TemplateWrapper
|
18 |
+
{
|
19 |
+
private $env;
|
20 |
+
private $template;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* This method is for internal use only and should never be called
|
24 |
+
* directly (use Twig_Environment::load() instead).
|
25 |
+
*
|
26 |
+
* @internal
|
27 |
+
*/
|
28 |
+
public function __construct(Twig_Environment $env, Twig_Template $template)
|
29 |
+
{
|
30 |
+
$this->env = $env;
|
31 |
+
$this->template = $template;
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Renders the template.
|
36 |
+
*
|
37 |
+
* @param array $context An array of parameters to pass to the template
|
38 |
+
*
|
39 |
+
* @return string The rendered template
|
40 |
+
*/
|
41 |
+
public function render($context = array())
|
42 |
+
{
|
43 |
+
return $this->template->render($context);
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Displays the template.
|
48 |
+
*
|
49 |
+
* @param array $context An array of parameters to pass to the template
|
50 |
+
*/
|
51 |
+
public function display($context = array())
|
52 |
+
{
|
53 |
+
$this->template->display($context);
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Checks if a block is defined.
|
58 |
+
*
|
59 |
+
* @param string $name The block name
|
60 |
+
* @param array $context An array of parameters to pass to the template
|
61 |
+
*
|
62 |
+
* @return bool
|
63 |
+
*/
|
64 |
+
public function hasBlock($name, $context = array())
|
65 |
+
{
|
66 |
+
return $this->template->hasBlock($name, $context);
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Returns defined block names in the template.
|
71 |
+
*
|
72 |
+
* @param array $context An array of parameters to pass to the template
|
73 |
+
*
|
74 |
+
* @return string[] An array of defined template block names
|
75 |
+
*/
|
76 |
+
public function getBlockNames($context = array())
|
77 |
+
{
|
78 |
+
return $this->template->getBlockNames($context);
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Renders a template block.
|
83 |
+
*
|
84 |
+
* @param string $name The block name to render
|
85 |
+
* @param array $context An array of parameters to pass to the template
|
86 |
+
*
|
87 |
+
* @return string The rendered block
|
88 |
+
*/
|
89 |
+
public function renderBlock($name, $context = array())
|
90 |
+
{
|
91 |
+
$context = $this->env->mergeGlobals($context);
|
92 |
+
$level = ob_get_level();
|
93 |
+
ob_start();
|
94 |
+
try {
|
95 |
+
$this->template->displayBlock($name, $context);
|
96 |
+
} catch (Exception $e) {
|
97 |
+
while (ob_get_level() > $level) {
|
98 |
+
ob_end_clean();
|
99 |
+
}
|
100 |
+
|
101 |
+
throw $e;
|
102 |
+
} catch (Throwable $e) {
|
103 |
+
while (ob_get_level() > $level) {
|
104 |
+
ob_end_clean();
|
105 |
+
}
|
106 |
+
|
107 |
+
throw $e;
|
108 |
+
}
|
109 |
+
|
110 |
+
return ob_get_clean();
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Displays a template block.
|
115 |
+
*
|
116 |
+
* @param string $name The block name to render
|
117 |
+
* @param array $context An array of parameters to pass to the template
|
118 |
+
*/
|
119 |
+
public function displayBlock($name, $context = array())
|
120 |
+
{
|
121 |
+
$this->template->displayBlock($name, $this->env->mergeGlobals($context));
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* @return Twig_Source
|
126 |
+
*/
|
127 |
+
public function getSourceContext()
|
128 |
+
{
|
129 |
+
return $this->template->getSourceContext();
|
130 |
+
}
|
131 |
+
}
|
vendor/twig/twig/lib/Twig/Test.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Test/Function.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -173,12 +173,6 @@ abstract class Twig_Test_IntegrationTestCase extends PHPUnit_Framework_TestCase
|
|
173 |
return;
|
174 |
}
|
175 |
|
176 |
-
if ($e instanceof Twig_Error_Syntax) {
|
177 |
-
$e->setTemplateName($file);
|
178 |
-
|
179 |
-
throw $e;
|
180 |
-
}
|
181 |
-
|
182 |
throw new Twig_Error(sprintf('%s: %s', get_class($e), $e->getMessage()), -1, $file, $e);
|
183 |
}
|
184 |
|
@@ -191,11 +185,7 @@ abstract class Twig_Test_IntegrationTestCase extends PHPUnit_Framework_TestCase
|
|
191 |
return;
|
192 |
}
|
193 |
|
194 |
-
|
195 |
-
$e->setTemplateName($file);
|
196 |
-
} else {
|
197 |
-
$e = new Twig_Error(sprintf('%s: %s', get_class($e), $e->getMessage()), -1, $file, $e);
|
198 |
-
}
|
199 |
|
200 |
$output = trim(sprintf('%s: %s', get_class($e), $e->getMessage()));
|
201 |
}
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
173 |
return;
|
174 |
}
|
175 |
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
throw new Twig_Error(sprintf('%s: %s', get_class($e), $e->getMessage()), -1, $file, $e);
|
177 |
}
|
178 |
|
185 |
return;
|
186 |
}
|
187 |
|
188 |
+
$e = new Twig_Error(sprintf('%s: %s', get_class($e), $e->getMessage()), -1, $file, $e);
|
|
|
|
|
|
|
|
|
189 |
|
190 |
$output = trim(sprintf('%s: %s', get_class($e), $e->getMessage()));
|
191 |
}
|
vendor/twig/twig/lib/Twig/Test/Method.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Test/Node.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Test/NodeTestCase.php
CHANGED
@@ -46,6 +46,10 @@ abstract class Twig_Test_NodeTestCase extends PHPUnit_Framework_TestCase
|
|
46 |
{
|
47 |
$line = $line > 0 ? "// line {$line}\n" : '';
|
48 |
|
|
|
|
|
|
|
|
|
49 |
if (PHP_VERSION_ID >= 50400) {
|
50 |
return sprintf('%s(isset($context["%s"]) ? $context["%s"] : null)', $line, $name, $name);
|
51 |
}
|
46 |
{
|
47 |
$line = $line > 0 ? "// line {$line}\n" : '';
|
48 |
|
49 |
+
if (PHP_VERSION_ID >= 70000) {
|
50 |
+
return sprintf('%s($context["%s"] ?? null)', $line, $name, $name);
|
51 |
+
}
|
52 |
+
|
53 |
if (PHP_VERSION_ID >= 50400) {
|
54 |
return sprintf('%s(isset($context["%s"]) ? $context["%s"] : null)', $line, $name, $name);
|
55 |
}
|
vendor/twig/twig/lib/Twig/TestCallableInterface.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/TestInterface.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
vendor/twig/twig/lib/Twig/Token.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
@@ -14,6 +14,8 @@
|
|
14 |
* Represents a Token.
|
15 |
*
|
16 |
* @author Fabien Potencier <fabien@symfony.com>
|
|
|
|
|
17 |
*/
|
18 |
class Twig_Token
|
19 |
{
|
@@ -36,8 +38,6 @@ class Twig_Token
|
|
36 |
const INTERPOLATION_END_TYPE = 11;
|
37 |
|
38 |
/**
|
39 |
-
* Constructor.
|
40 |
-
*
|
41 |
* @param int $type The type of the token
|
42 |
* @param string $value The token value
|
43 |
* @param int $lineno The line position in the source
|
@@ -49,11 +49,6 @@ class Twig_Token
|
|
49 |
$this->lineno = $lineno;
|
50 |
}
|
51 |
|
52 |
-
/**
|
53 |
-
* Returns a string representation of the token.
|
54 |
-
*
|
55 |
-
* @return string A string representation of the token
|
56 |
-
*/
|
57 |
public function __toString()
|
58 |
{
|
59 |
return sprintf('%s(%s)', self::typeToString($this->type, true), $this->value);
|
@@ -63,9 +58,9 @@ class Twig_Token
|
|
63 |
* Tests the current token for a type and/or a value.
|
64 |
*
|
65 |
* Parameters may be:
|
66 |
-
*
|
67 |
-
*
|
68 |
-
*
|
69 |
*
|
70 |
* @param array|int $type The type to test
|
71 |
* @param array|string|null $values The token value
|
@@ -87,9 +82,7 @@ class Twig_Token
|
|
87 |
}
|
88 |
|
89 |
/**
|
90 |
-
*
|
91 |
-
*
|
92 |
-
* @return int The source line
|
93 |
*/
|
94 |
public function getLine()
|
95 |
{
|
@@ -97,9 +90,7 @@ class Twig_Token
|
|
97 |
}
|
98 |
|
99 |
/**
|
100 |
-
*
|
101 |
-
*
|
102 |
-
* @return int The token type
|
103 |
*/
|
104 |
public function getType()
|
105 |
{
|
@@ -107,9 +98,7 @@ class Twig_Token
|
|
107 |
}
|
108 |
|
109 |
/**
|
110 |
-
*
|
111 |
-
*
|
112 |
-
* @return string The token value
|
113 |
*/
|
114 |
public function getValue()
|
115 |
{
|
@@ -174,7 +163,7 @@ class Twig_Token
|
|
174 |
}
|
175 |
|
176 |
/**
|
177 |
-
* Returns the
|
178 |
*
|
179 |
* @param int $type The type as an integer
|
180 |
*
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
14 |
* Represents a Token.
|
15 |
*
|
16 |
* @author Fabien Potencier <fabien@symfony.com>
|
17 |
+
*
|
18 |
+
* @final
|
19 |
*/
|
20 |
class Twig_Token
|
21 |
{
|
38 |
const INTERPOLATION_END_TYPE = 11;
|
39 |
|
40 |
/**
|
|
|
|
|
41 |
* @param int $type The type of the token
|
42 |
* @param string $value The token value
|
43 |
* @param int $lineno The line position in the source
|
49 |
$this->lineno = $lineno;
|
50 |
}
|
51 |
|
|
|
|
|
|
|
|
|
|
|
52 |
public function __toString()
|
53 |
{
|
54 |
return sprintf('%s(%s)', self::typeToString($this->type, true), $this->value);
|
58 |
* Tests the current token for a type and/or a value.
|
59 |
*
|
60 |
* Parameters may be:
|
61 |
+
* * just type
|
62 |
+
* * type and value (or array of possible values)
|
63 |
+
* * just value (or array of possible values) (NAME_TYPE is used as type)
|
64 |
*
|
65 |
* @param array|int $type The type to test
|
66 |
* @param array|string|null $values The token value
|
82 |
}
|
83 |
|
84 |
/**
|
85 |
+
* @return int
|
|
|
|
|
86 |
*/
|
87 |
public function getLine()
|
88 |
{
|
90 |
}
|
91 |
|
92 |
/**
|
93 |
+
* @return int
|
|
|
|
|
94 |
*/
|
95 |
public function getType()
|
96 |
{
|
98 |
}
|
99 |
|
100 |
/**
|
101 |
+
* @return string
|
|
|
|
|
102 |
*/
|
103 |
public function getValue()
|
104 |
{
|
163 |
}
|
164 |
|
165 |
/**
|
166 |
+
* Returns the English representation of a given type.
|
167 |
*
|
168 |
* @param int $type The type as an integer
|
169 |
*
|
vendor/twig/twig/lib/Twig/TokenParser.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -23,8 +23,6 @@ abstract class Twig_TokenParser implements Twig_TokenParserInterface
|
|
23 |
|
24 |
/**
|
25 |
* Sets the parser associated with this token parser.
|
26 |
-
*
|
27 |
-
* @param Twig_Parser $parser A Twig_Parser instance
|
28 |
*/
|
29 |
public function setParser(Twig_Parser $parser)
|
30 |
{
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
23 |
|
24 |
/**
|
25 |
* Sets the parser associated with this token parser.
|
|
|
|
|
26 |
*/
|
27 |
public function setParser(Twig_Parser $parser)
|
28 |
{
|
vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -26,6 +26,8 @@
|
|
26 |
* using the js escaping strategy
|
27 |
* {% endautoescape %}
|
28 |
* </pre>
|
|
|
|
|
29 |
*/
|
30 |
class Twig_TokenParser_AutoEscape extends Twig_TokenParser
|
31 |
{
|
@@ -39,7 +41,7 @@ class Twig_TokenParser_AutoEscape extends Twig_TokenParser
|
|
39 |
} else {
|
40 |
$expr = $this->parser->getExpressionParser()->parseExpression();
|
41 |
if (!$expr instanceof Twig_Node_Expression_Constant) {
|
42 |
-
throw new Twig_Error_Syntax('An escaping strategy must be a string or a bool.', $stream->getCurrent()->getLine(), $stream->getSourceContext()
|
43 |
}
|
44 |
$value = $expr->getAttribute('value');
|
45 |
|
@@ -53,7 +55,7 @@ class Twig_TokenParser_AutoEscape extends Twig_TokenParser
|
|
53 |
@trigger_error('Using the autoescape tag with "true" or "false" before the strategy name is deprecated since version 1.21.', E_USER_DEPRECATED);
|
54 |
|
55 |
if (false === $value) {
|
56 |
-
throw new Twig_Error_Syntax('Unexpected escaping strategy as you set autoescaping to false.', $stream->getCurrent()->getLine(), $stream->getSourceContext()
|
57 |
}
|
58 |
|
59 |
$value = $stream->next()->getValue();
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
26 |
* using the js escaping strategy
|
27 |
* {% endautoescape %}
|
28 |
* </pre>
|
29 |
+
*
|
30 |
+
* @final
|
31 |
*/
|
32 |
class Twig_TokenParser_AutoEscape extends Twig_TokenParser
|
33 |
{
|
41 |
} else {
|
42 |
$expr = $this->parser->getExpressionParser()->parseExpression();
|
43 |
if (!$expr instanceof Twig_Node_Expression_Constant) {
|
44 |
+
throw new Twig_Error_Syntax('An escaping strategy must be a string or a bool.', $stream->getCurrent()->getLine(), $stream->getSourceContext());
|
45 |
}
|
46 |
$value = $expr->getAttribute('value');
|
47 |
|
55 |
@trigger_error('Using the autoescape tag with "true" or "false" before the strategy name is deprecated since version 1.21.', E_USER_DEPRECATED);
|
56 |
|
57 |
if (false === $value) {
|
58 |
+
throw new Twig_Error_Syntax('Unexpected escaping strategy as you set autoescaping to false.', $stream->getCurrent()->getLine(), $stream->getSourceContext());
|
59 |
}
|
60 |
|
61 |
$value = $stream->next()->getValue();
|
vendor/twig/twig/lib/Twig/TokenParser/Block.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
@@ -19,6 +19,8 @@
|
|
19 |
* <title>{% block title %}{% endblock %} - My Webpage</title>
|
20 |
* {% endblock %}
|
21 |
* </pre>
|
|
|
|
|
22 |
*/
|
23 |
class Twig_TokenParser_Block extends Twig_TokenParser
|
24 |
{
|
@@ -28,7 +30,7 @@ class Twig_TokenParser_Block extends Twig_TokenParser
|
|
28 |
$stream = $this->parser->getStream();
|
29 |
$name = $stream->expect(Twig_Token::NAME_TYPE)->getValue();
|
30 |
if ($this->parser->hasBlock($name)) {
|
31 |
-
throw new Twig_Error_Syntax(sprintf("The block '%s' has already been defined line %d.", $name, $this->parser->getBlock($name)->getTemplateLine()), $stream->getCurrent()->getLine(), $stream->getSourceContext()
|
32 |
}
|
33 |
$this->parser->setBlock($name, $block = new Twig_Node_Block($name, new Twig_Node(array()), $lineno));
|
34 |
$this->parser->pushLocalScope();
|
@@ -40,7 +42,7 @@ class Twig_TokenParser_Block extends Twig_TokenParser
|
|
40 |
$value = $token->getValue();
|
41 |
|
42 |
if ($value != $name) {
|
43 |
-
throw new Twig_Error_Syntax(sprintf('Expected endblock for block "%s" (but "%s" given).', $name, $value), $stream->getCurrent()->getLine(), $stream->getSourceContext()
|
44 |
}
|
45 |
}
|
46 |
} else {
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
19 |
* <title>{% block title %}{% endblock %} - My Webpage</title>
|
20 |
* {% endblock %}
|
21 |
* </pre>
|
22 |
+
*
|
23 |
+
* @final
|
24 |
*/
|
25 |
class Twig_TokenParser_Block extends Twig_TokenParser
|
26 |
{
|
30 |
$stream = $this->parser->getStream();
|
31 |
$name = $stream->expect(Twig_Token::NAME_TYPE)->getValue();
|
32 |
if ($this->parser->hasBlock($name)) {
|
33 |
+
throw new Twig_Error_Syntax(sprintf("The block '%s' has already been defined line %d.", $name, $this->parser->getBlock($name)->getTemplateLine()), $stream->getCurrent()->getLine(), $stream->getSourceContext());
|
34 |
}
|
35 |
$this->parser->setBlock($name, $block = new Twig_Node_Block($name, new Twig_Node(array()), $lineno));
|
36 |
$this->parser->pushLocalScope();
|
42 |
$value = $token->getValue();
|
43 |
|
44 |
if ($value != $name) {
|
45 |
+
throw new Twig_Error_Syntax(sprintf('Expected endblock for block "%s" (but "%s" given).', $name, $value), $stream->getCurrent()->getLine(), $stream->getSourceContext());
|
46 |
}
|
47 |
}
|
48 |
} else {
|
vendor/twig/twig/lib/Twig/TokenParser/Do.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -11,6 +11,8 @@
|
|
11 |
|
12 |
/**
|
13 |
* Evaluates an expression, discarding the returned value.
|
|
|
|
|
14 |
*/
|
15 |
class Twig_TokenParser_Do extends Twig_TokenParser
|
16 |
{
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
11 |
|
12 |
/**
|
13 |
* Evaluates an expression, discarding the returned value.
|
14 |
+
*
|
15 |
+
* @final
|
16 |
*/
|
17 |
class Twig_TokenParser_Do extends Twig_TokenParser
|
18 |
{
|
vendor/twig/twig/lib/Twig/TokenParser/Embed.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -11,6 +11,8 @@
|
|
11 |
|
12 |
/**
|
13 |
* Embeds a template.
|
|
|
|
|
14 |
*/
|
15 |
class Twig_TokenParser_Embed extends Twig_TokenParser_Include
|
16 |
{
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
11 |
|
12 |
/**
|
13 |
* Embeds a template.
|
14 |
+
*
|
15 |
+
* @final
|
16 |
*/
|
17 |
class Twig_TokenParser_Embed extends Twig_TokenParser_Include
|
18 |
{
|
vendor/twig/twig/lib/Twig/TokenParser/Extends.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
@@ -16,6 +16,8 @@
|
|
16 |
* <pre>
|
17 |
* {% extends "base.html" %}
|
18 |
* </pre>
|
|
|
|
|
19 |
*/
|
20 |
class Twig_TokenParser_Extends extends Twig_TokenParser
|
21 |
{
|
@@ -24,11 +26,11 @@ class Twig_TokenParser_Extends extends Twig_TokenParser
|
|
24 |
$stream = $this->parser->getStream();
|
25 |
|
26 |
if (!$this->parser->isMainScope()) {
|
27 |
-
throw new Twig_Error_Syntax('Cannot extend from a block.', $token->getLine(), $stream->getSourceContext()
|
28 |
}
|
29 |
|
30 |
if (null !== $this->parser->getParent()) {
|
31 |
-
throw new Twig_Error_Syntax('Multiple extends tags are forbidden.', $token->getLine(), $stream->getSourceContext()
|
32 |
}
|
33 |
$this->parser->setParent($this->parser->getExpressionParser()->parseExpression());
|
34 |
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
16 |
* <pre>
|
17 |
* {% extends "base.html" %}
|
18 |
* </pre>
|
19 |
+
*
|
20 |
+
* @final
|
21 |
*/
|
22 |
class Twig_TokenParser_Extends extends Twig_TokenParser
|
23 |
{
|
26 |
$stream = $this->parser->getStream();
|
27 |
|
28 |
if (!$this->parser->isMainScope()) {
|
29 |
+
throw new Twig_Error_Syntax('Cannot extend from a block.', $token->getLine(), $stream->getSourceContext());
|
30 |
}
|
31 |
|
32 |
if (null !== $this->parser->getParent()) {
|
33 |
+
throw new Twig_Error_Syntax('Multiple extends tags are forbidden.', $token->getLine(), $stream->getSourceContext());
|
34 |
}
|
35 |
$this->parser->setParent($this->parser->getExpressionParser()->parseExpression());
|
36 |
|
vendor/twig/twig/lib/Twig/TokenParser/Filter.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -17,13 +17,15 @@
|
|
17 |
* This text becomes uppercase
|
18 |
* {% endfilter %}
|
19 |
* </pre>
|
|
|
|
|
20 |
*/
|
21 |
class Twig_TokenParser_Filter extends Twig_TokenParser
|
22 |
{
|
23 |
public function parse(Twig_Token $token)
|
24 |
{
|
25 |
$name = $this->parser->getVarName();
|
26 |
-
$ref = new Twig_Node_Expression_BlockReference(new Twig_Node_Expression_Constant($name, $token->getLine()),
|
27 |
|
28 |
$filter = $this->parser->getExpressionParser()->parseFilterExpressionRaw($ref, $this->getTag());
|
29 |
$this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
17 |
* This text becomes uppercase
|
18 |
* {% endfilter %}
|
19 |
* </pre>
|
20 |
+
*
|
21 |
+
* @final
|
22 |
*/
|
23 |
class Twig_TokenParser_Filter extends Twig_TokenParser
|
24 |
{
|
25 |
public function parse(Twig_Token $token)
|
26 |
{
|
27 |
$name = $this->parser->getVarName();
|
28 |
+
$ref = new Twig_Node_Expression_BlockReference(new Twig_Node_Expression_Constant($name, $token->getLine()), null, $token->getLine(), $this->getTag());
|
29 |
|
30 |
$filter = $this->parser->getExpressionParser()->parseFilterExpressionRaw($ref, $this->getTag());
|
31 |
$this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
|
vendor/twig/twig/lib/Twig/TokenParser/Flush.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -13,6 +13,8 @@
|
|
13 |
* Flushes the output to the client.
|
14 |
*
|
15 |
* @see flush()
|
|
|
|
|
16 |
*/
|
17 |
class Twig_TokenParser_Flush extends Twig_TokenParser
|
18 |
{
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
13 |
* Flushes the output to the client.
|
14 |
*
|
15 |
* @see flush()
|
16 |
+
*
|
17 |
+
* @final
|
18 |
*/
|
19 |
class Twig_TokenParser_Flush extends Twig_TokenParser
|
20 |
{
|
vendor/twig/twig/lib/Twig/TokenParser/For.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
@@ -20,6 +20,8 @@
|
|
20 |
* {% endfor %}
|
21 |
* </ul>
|
22 |
* </pre>
|
|
|
|
|
23 |
*/
|
24 |
class Twig_TokenParser_For extends Twig_TokenParser
|
25 |
{
|
@@ -79,7 +81,7 @@ class Twig_TokenParser_For extends Twig_TokenParser
|
|
79 |
protected function checkLoopUsageCondition(Twig_TokenStream $stream, Twig_NodeInterface $node)
|
80 |
{
|
81 |
if ($node instanceof Twig_Node_Expression_GetAttr && $node->getNode('node') instanceof Twig_Node_Expression_Name && 'loop' == $node->getNode('node')->getAttribute('name')) {
|
82 |
-
throw new Twig_Error_Syntax('The "loop" variable cannot be used in a looping condition.', $node->getTemplateLine(), $stream->getSourceContext()
|
83 |
}
|
84 |
|
85 |
foreach ($node as $n) {
|
@@ -98,7 +100,7 @@ class Twig_TokenParser_For extends Twig_TokenParser
|
|
98 |
if ($node instanceof Twig_Node_Expression_GetAttr && $node->getNode('node') instanceof Twig_Node_Expression_Name && 'loop' == $node->getNode('node')->getAttribute('name')) {
|
99 |
$attribute = $node->getNode('attribute');
|
100 |
if ($attribute instanceof Twig_Node_Expression_Constant && in_array($attribute->getAttribute('value'), array('length', 'revindex0', 'revindex', 'last'))) {
|
101 |
-
throw new Twig_Error_Syntax(sprintf('The "loop.%s" variable is not defined when looping with a condition.', $attribute->getAttribute('value')), $node->getTemplateLine(), $stream->getSourceContext()
|
102 |
}
|
103 |
}
|
104 |
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
20 |
* {% endfor %}
|
21 |
* </ul>
|
22 |
* </pre>
|
23 |
+
*
|
24 |
+
* @final
|
25 |
*/
|
26 |
class Twig_TokenParser_For extends Twig_TokenParser
|
27 |
{
|
81 |
protected function checkLoopUsageCondition(Twig_TokenStream $stream, Twig_NodeInterface $node)
|
82 |
{
|
83 |
if ($node instanceof Twig_Node_Expression_GetAttr && $node->getNode('node') instanceof Twig_Node_Expression_Name && 'loop' == $node->getNode('node')->getAttribute('name')) {
|
84 |
+
throw new Twig_Error_Syntax('The "loop" variable cannot be used in a looping condition.', $node->getTemplateLine(), $stream->getSourceContext());
|
85 |
}
|
86 |
|
87 |
foreach ($node as $n) {
|
100 |
if ($node instanceof Twig_Node_Expression_GetAttr && $node->getNode('node') instanceof Twig_Node_Expression_Name && 'loop' == $node->getNode('node')->getAttribute('name')) {
|
101 |
$attribute = $node->getNode('attribute');
|
102 |
if ($attribute instanceof Twig_Node_Expression_Constant && in_array($attribute->getAttribute('value'), array('length', 'revindex0', 'revindex', 'last'))) {
|
103 |
+
throw new Twig_Error_Syntax(sprintf('The "loop.%s" variable is not defined when looping with a condition.', $attribute->getAttribute('value')), $node->getTemplateLine(), $stream->getSourceContext());
|
104 |
}
|
105 |
}
|
106 |
|
vendor/twig/twig/lib/Twig/TokenParser/From.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -15,6 +15,8 @@
|
|
15 |
* <pre>
|
16 |
* {% from 'forms.html' import forms %}
|
17 |
* </pre>
|
|
|
|
|
18 |
*/
|
19 |
class Twig_TokenParser_From extends Twig_TokenParser
|
20 |
{
|
@@ -46,7 +48,7 @@ class Twig_TokenParser_From extends Twig_TokenParser
|
|
46 |
|
47 |
foreach ($targets as $name => $alias) {
|
48 |
if ($this->parser->isReservedMacroName($name)) {
|
49 |
-
throw new Twig_Error_Syntax(sprintf('"%s" cannot be an imported macro as it is a reserved keyword.', $name), $token->getLine(), $stream->getSourceContext()
|
50 |
}
|
51 |
|
52 |
$this->parser->addImportedSymbol('function', $alias, 'get'.$name, $node->getNode('var'));
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
15 |
* <pre>
|
16 |
* {% from 'forms.html' import forms %}
|
17 |
* </pre>
|
18 |
+
*
|
19 |
+
* @final
|
20 |
*/
|
21 |
class Twig_TokenParser_From extends Twig_TokenParser
|
22 |
{
|
48 |
|
49 |
foreach ($targets as $name => $alias) {
|
50 |
if ($this->parser->isReservedMacroName($name)) {
|
51 |
+
throw new Twig_Error_Syntax(sprintf('"%s" cannot be an imported macro as it is a reserved keyword.', $name), $token->getLine(), $stream->getSourceContext());
|
52 |
}
|
53 |
|
54 |
$this->parser->addImportedSymbol('function', $alias, 'get'.$name, $node->getNode('var'));
|
vendor/twig/twig/lib/Twig/TokenParser/If.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
@@ -22,6 +22,8 @@
|
|
22 |
* </ul>
|
23 |
* {% endif %}
|
24 |
* </pre>
|
|
|
|
|
25 |
*/
|
26 |
class Twig_TokenParser_If extends Twig_TokenParser
|
27 |
{
|
@@ -56,7 +58,7 @@ class Twig_TokenParser_If extends Twig_TokenParser
|
|
56 |
break;
|
57 |
|
58 |
default:
|
59 |
-
throw new Twig_Error_Syntax(sprintf('Unexpected end of template. Twig was looking for the following tags "else", "elseif", or "endif" to close the "if" block started at line %d).', $lineno), $stream->getCurrent()->getLine(), $stream->getSourceContext()
|
60 |
}
|
61 |
}
|
62 |
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
22 |
* </ul>
|
23 |
* {% endif %}
|
24 |
* </pre>
|
25 |
+
*
|
26 |
+
* @final
|
27 |
*/
|
28 |
class Twig_TokenParser_If extends Twig_TokenParser
|
29 |
{
|
58 |
break;
|
59 |
|
60 |
default:
|
61 |
+
throw new Twig_Error_Syntax(sprintf('Unexpected end of template. Twig was looking for the following tags "else", "elseif", or "endif" to close the "if" block started at line %d).', $lineno), $stream->getCurrent()->getLine(), $stream->getSourceContext());
|
62 |
}
|
63 |
}
|
64 |
|
vendor/twig/twig/lib/Twig/TokenParser/Import.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -15,6 +15,8 @@
|
|
15 |
* <pre>
|
16 |
* {% import 'forms.html' as forms %}
|
17 |
* </pre>
|
|
|
|
|
18 |
*/
|
19 |
class Twig_TokenParser_Import extends Twig_TokenParser
|
20 |
{
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
15 |
* <pre>
|
16 |
* {% import 'forms.html' as forms %}
|
17 |
* </pre>
|
18 |
+
*
|
19 |
+
* @final
|
20 |
*/
|
21 |
class Twig_TokenParser_Import extends Twig_TokenParser
|
22 |
{
|
vendor/twig/twig/lib/Twig/TokenParser/Include.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
@@ -18,6 +18,8 @@
|
|
18 |
* Body
|
19 |
* {% include 'footer.html' %}
|
20 |
* </pre>
|
|
|
|
|
21 |
*/
|
22 |
class Twig_TokenParser_Include extends Twig_TokenParser
|
23 |
{
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
18 |
* Body
|
19 |
* {% include 'footer.html' %}
|
20 |
* </pre>
|
21 |
+
*
|
22 |
+
* @final
|
23 |
*/
|
24 |
class Twig_TokenParser_Include extends Twig_TokenParser
|
25 |
{
|
vendor/twig/twig/lib/Twig/TokenParser/Macro.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -17,6 +17,8 @@
|
|
17 |
* <input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value|e }}" size="{{ size|default(20) }}" />
|
18 |
* {% endmacro %}
|
19 |
* </pre>
|
|
|
|
|
20 |
*/
|
21 |
class Twig_TokenParser_Macro extends Twig_TokenParser
|
22 |
{
|
@@ -35,7 +37,7 @@ class Twig_TokenParser_Macro extends Twig_TokenParser
|
|
35 |
$value = $token->getValue();
|
36 |
|
37 |
if ($value != $name) {
|
38 |
-
throw new Twig_Error_Syntax(sprintf('Expected endmacro for macro "%s" (but "%s" given).', $name, $value), $stream->getCurrent()->getLine(), $stream->getSourceContext()
|
39 |
}
|
40 |
}
|
41 |
$this->parser->popLocalScope();
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
17 |
* <input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value|e }}" size="{{ size|default(20) }}" />
|
18 |
* {% endmacro %}
|
19 |
* </pre>
|
20 |
+
*
|
21 |
+
* @final
|
22 |
*/
|
23 |
class Twig_TokenParser_Macro extends Twig_TokenParser
|
24 |
{
|
37 |
$value = $token->getValue();
|
38 |
|
39 |
if ($value != $name) {
|
40 |
+
throw new Twig_Error_Syntax(sprintf('Expected endmacro for macro "%s" (but "%s" given).', $name, $value), $stream->getCurrent()->getLine(), $stream->getSourceContext());
|
41 |
}
|
42 |
}
|
43 |
$this->parser->popLocalScope();
|
vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -19,6 +19,8 @@
|
|
19 |
* </pre>
|
20 |
*
|
21 |
* @see http://www.twig-project.org/doc/api.html#sandbox-extension for details
|
|
|
|
|
22 |
*/
|
23 |
class Twig_TokenParser_Sandbox extends Twig_TokenParser
|
24 |
{
|
@@ -37,7 +39,7 @@ class Twig_TokenParser_Sandbox extends Twig_TokenParser
|
|
37 |
}
|
38 |
|
39 |
if (!$node instanceof Twig_Node_Include) {
|
40 |
-
throw new Twig_Error_Syntax('Only "include" tags are allowed within a "sandbox" section.', $node->getTemplateLine(), $stream->getSourceContext()
|
41 |
}
|
42 |
}
|
43 |
}
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
19 |
* </pre>
|
20 |
*
|
21 |
* @see http://www.twig-project.org/doc/api.html#sandbox-extension for details
|
22 |
+
*
|
23 |
+
* @final
|
24 |
*/
|
25 |
class Twig_TokenParser_Sandbox extends Twig_TokenParser
|
26 |
{
|
39 |
}
|
40 |
|
41 |
if (!$node instanceof Twig_Node_Include) {
|
42 |
+
throw new Twig_Error_Syntax('Only "include" tags are allowed within a "sandbox" section.', $node->getTemplateLine(), $stream->getSourceContext());
|
43 |
}
|
44 |
}
|
45 |
}
|
vendor/twig/twig/lib/Twig/TokenParser/Set.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -25,6 +25,8 @@
|
|
25 |
*
|
26 |
* {% set foo %}Some content{% endset %}
|
27 |
* </pre>
|
|
|
|
|
28 |
*/
|
29 |
class Twig_TokenParser_Set extends Twig_TokenParser
|
30 |
{
|
@@ -41,13 +43,13 @@ class Twig_TokenParser_Set extends Twig_TokenParser
|
|
41 |
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
42 |
|
43 |
if (count($names) !== count($values)) {
|
44 |
-
throw new Twig_Error_Syntax('When using set, you must have the same number of variables and assignments.', $stream->getCurrent()->getLine(), $stream->getSourceContext()
|
45 |
}
|
46 |
} else {
|
47 |
$capture = true;
|
48 |
|
49 |
if (count($names) > 1) {
|
50 |
-
throw new Twig_Error_Syntax('When using set with a block, you cannot have a multi-target.', $stream->getCurrent()->getLine(), $stream->getSourceContext()
|
51 |
}
|
52 |
|
53 |
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
25 |
*
|
26 |
* {% set foo %}Some content{% endset %}
|
27 |
* </pre>
|
28 |
+
*
|
29 |
+
* @final
|
30 |
*/
|
31 |
class Twig_TokenParser_Set extends Twig_TokenParser
|
32 |
{
|
43 |
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
44 |
|
45 |
if (count($names) !== count($values)) {
|
46 |
+
throw new Twig_Error_Syntax('When using set, you must have the same number of variables and assignments.', $stream->getCurrent()->getLine(), $stream->getSourceContext());
|
47 |
}
|
48 |
} else {
|
49 |
$capture = true;
|
50 |
|
51 |
if (count($names) > 1) {
|
52 |
+
throw new Twig_Error_Syntax('When using set with a block, you cannot have a multi-target.', $stream->getCurrent()->getLine(), $stream->getSourceContext());
|
53 |
}
|
54 |
|
55 |
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -21,6 +21,8 @@
|
|
21 |
*
|
22 |
* {# output will be <div><strong>foo</strong></div> #}
|
23 |
* </pre>
|
|
|
|
|
24 |
*/
|
25 |
class Twig_TokenParser_Spaceless extends Twig_TokenParser
|
26 |
{
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
21 |
*
|
22 |
* {# output will be <div><strong>foo</strong></div> #}
|
23 |
* </pre>
|
24 |
+
*
|
25 |
+
* @final
|
26 |
*/
|
27 |
class Twig_TokenParser_Spaceless extends Twig_TokenParser
|
28 |
{
|
vendor/twig/twig/lib/Twig/TokenParser/Use.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -22,6 +22,8 @@
|
|
22 |
* </pre>
|
23 |
*
|
24 |
* @see http://www.twig-project.org/doc/templates.html#horizontal-reuse for details.
|
|
|
|
|
25 |
*/
|
26 |
class Twig_TokenParser_Use extends Twig_TokenParser
|
27 |
{
|
@@ -31,7 +33,7 @@ class Twig_TokenParser_Use extends Twig_TokenParser
|
|
31 |
$stream = $this->parser->getStream();
|
32 |
|
33 |
if (!$template instanceof Twig_Node_Expression_Constant) {
|
34 |
-
throw new Twig_Error_Syntax('The template references in a "use" statement must be a string.', $stream->getCurrent()->getLine(), $stream->getSourceContext()
|
35 |
}
|
36 |
|
37 |
$targets = array();
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
22 |
* </pre>
|
23 |
*
|
24 |
* @see http://www.twig-project.org/doc/templates.html#horizontal-reuse for details.
|
25 |
+
*
|
26 |
+
* @final
|
27 |
*/
|
28 |
class Twig_TokenParser_Use extends Twig_TokenParser
|
29 |
{
|
33 |
$stream = $this->parser->getStream();
|
34 |
|
35 |
if (!$template instanceof Twig_Node_Expression_Constant) {
|
36 |
+
throw new Twig_Error_Syntax('The template references in a "use" statement must be a string.', $stream->getCurrent()->getLine(), $stream->getSourceContext());
|
37 |
}
|
38 |
|
39 |
$targets = array();
|
vendor/twig/twig/lib/Twig/TokenParser/With.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of Twig.
|
5 |
+
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Creates a nested scope.
|
14 |
+
*
|
15 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
16 |
+
*
|
17 |
+
* @final
|
18 |
+
*/
|
19 |
+
class Twig_TokenParser_With extends Twig_TokenParser
|
20 |
+
{
|
21 |
+
public function parse(Twig_Token $token)
|
22 |
+
{
|
23 |
+
$stream = $this->parser->getStream();
|
24 |
+
|
25 |
+
$variables = null;
|
26 |
+
$only = false;
|
27 |
+
if (!$stream->test(Twig_Token::BLOCK_END_TYPE)) {
|
28 |
+
$variables = $this->parser->getExpressionParser()->parseExpression();
|
29 |
+
$only = $stream->nextIf(Twig_Token::NAME_TYPE, 'only');
|
30 |
+
}
|
31 |
+
|
32 |
+
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
33 |
+
|
34 |
+
$body = $this->parser->subparse(array($this, 'decideWithEnd'), true);
|
35 |
+
|
36 |
+
$stream->expect(Twig_Token::BLOCK_END_TYPE);
|
37 |
+
|
38 |
+
return new Twig_Node_With($body, $variables, $only, $token->getLine(), $this->getTag());
|
39 |
+
}
|
40 |
+
|
41 |
+
public function decideWithEnd(Twig_Token $token)
|
42 |
+
{
|
43 |
+
return $token->test('endwith');
|
44 |
+
}
|
45 |
+
|
46 |
+
public function getTag()
|
47 |
+
{
|
48 |
+
return 'with';
|
49 |
+
}
|
50 |
+
}
|
vendor/twig/twig/lib/Twig/TokenParserBroker.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
@@ -24,8 +24,6 @@ class Twig_TokenParserBroker implements Twig_TokenParserBrokerInterface
|
|
24 |
protected $brokers = array();
|
25 |
|
26 |
/**
|
27 |
-
* Constructor.
|
28 |
-
*
|
29 |
* @param array|Traversable $parsers A Traversable of Twig_TokenParserInterface instances
|
30 |
* @param array|Traversable $brokers A Traversable of Twig_TokenParserBrokerInterface instances
|
31 |
* @param bool $triggerDeprecationError
|
@@ -50,21 +48,11 @@ class Twig_TokenParserBroker implements Twig_TokenParserBrokerInterface
|
|
50 |
}
|
51 |
}
|
52 |
|
53 |
-
/**
|
54 |
-
* Adds a TokenParser.
|
55 |
-
*
|
56 |
-
* @param Twig_TokenParserInterface $parser A Twig_TokenParserInterface instance
|
57 |
-
*/
|
58 |
public function addTokenParser(Twig_TokenParserInterface $parser)
|
59 |
{
|
60 |
$this->parsers[$parser->getTag()] = $parser;
|
61 |
}
|
62 |
|
63 |
-
/**
|
64 |
-
* Removes a TokenParser.
|
65 |
-
*
|
66 |
-
* @param Twig_TokenParserInterface $parser A Twig_TokenParserInterface instance
|
67 |
-
*/
|
68 |
public function removeTokenParser(Twig_TokenParserInterface $parser)
|
69 |
{
|
70 |
$name = $parser->getTag();
|
@@ -73,21 +61,11 @@ class Twig_TokenParserBroker implements Twig_TokenParserBrokerInterface
|
|
73 |
}
|
74 |
}
|
75 |
|
76 |
-
/**
|
77 |
-
* Adds a TokenParserBroker.
|
78 |
-
*
|
79 |
-
* @param Twig_TokenParserBroker $broker A Twig_TokenParserBroker instance
|
80 |
-
*/
|
81 |
public function addTokenParserBroker(Twig_TokenParserBroker $broker)
|
82 |
{
|
83 |
$this->brokers[] = $broker;
|
84 |
}
|
85 |
|
86 |
-
/**
|
87 |
-
* Removes a TokenParserBroker.
|
88 |
-
*
|
89 |
-
* @param Twig_TokenParserBroker $broker A Twig_TokenParserBroker instance
|
90 |
-
*/
|
91 |
public function removeTokenParserBroker(Twig_TokenParserBroker $broker)
|
92 |
{
|
93 |
if (false !== $pos = array_search($broker, $this->brokers)) {
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Arnaud Le Blanc
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
24 |
protected $brokers = array();
|
25 |
|
26 |
/**
|
|
|
|
|
27 |
* @param array|Traversable $parsers A Traversable of Twig_TokenParserInterface instances
|
28 |
* @param array|Traversable $brokers A Traversable of Twig_TokenParserBrokerInterface instances
|
29 |
* @param bool $triggerDeprecationError
|
48 |
}
|
49 |
}
|
50 |
|
|
|
|
|
|
|
|
|
|
|
51 |
public function addTokenParser(Twig_TokenParserInterface $parser)
|
52 |
{
|
53 |
$this->parsers[$parser->getTag()] = $parser;
|
54 |
}
|
55 |
|
|
|
|
|
|
|
|
|
|
|
56 |
public function removeTokenParser(Twig_TokenParserInterface $parser)
|
57 |
{
|
58 |
$name = $parser->getTag();
|
61 |
}
|
62 |
}
|
63 |
|
|
|
|
|
|
|
|
|
|
|
64 |
public function addTokenParserBroker(Twig_TokenParserBroker $broker)
|
65 |
{
|
66 |
$this->brokers[] = $broker;
|
67 |
}
|
68 |
|
|
|
|
|
|
|
|
|
|
|
69 |
public function removeTokenParserBroker(Twig_TokenParserBroker $broker)
|
70 |
{
|
71 |
if (false !== $pos = array_search($broker, $this->brokers)) {
|
vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
@@ -26,14 +26,12 @@ interface Twig_TokenParserBrokerInterface
|
|
26 |
*
|
27 |
* @param string $tag A tag name
|
28 |
*
|
29 |
-
* @return null
|
30 |
*/
|
31 |
public function getTokenParser($tag);
|
32 |
|
33 |
/**
|
34 |
* Calls Twig_TokenParserInterface::setParser on all parsers the implementation knows of.
|
35 |
-
*
|
36 |
-
* @param Twig_ParserInterface $parser A Twig_ParserInterface interface
|
37 |
*/
|
38 |
public function setParser(Twig_ParserInterface $parser);
|
39 |
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Arnaud Le Blanc
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
26 |
*
|
27 |
* @param string $tag A tag name
|
28 |
*
|
29 |
+
* @return Twig_TokenParserInterface|null A Twig_TokenParserInterface or null if no suitable TokenParser was found
|
30 |
*/
|
31 |
public function getTokenParser($tag);
|
32 |
|
33 |
/**
|
34 |
* Calls Twig_TokenParserInterface::setParser on all parsers the implementation knows of.
|
|
|
|
|
35 |
*/
|
36 |
public function setParser(Twig_ParserInterface $parser);
|
37 |
|
vendor/twig/twig/lib/Twig/TokenParserInterface.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
@@ -18,17 +18,13 @@ interface Twig_TokenParserInterface
|
|
18 |
{
|
19 |
/**
|
20 |
* Sets the parser associated with this token parser.
|
21 |
-
*
|
22 |
-
* @param Twig_Parser $parser A Twig_Parser instance
|
23 |
*/
|
24 |
public function setParser(Twig_Parser $parser);
|
25 |
|
26 |
/**
|
27 |
* Parses a token and returns a node.
|
28 |
*
|
29 |
-
* @
|
30 |
-
*
|
31 |
-
* @return Twig_NodeInterface A Twig_NodeInterface instance
|
32 |
*
|
33 |
* @throws Twig_Error_Syntax
|
34 |
*/
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
18 |
{
|
19 |
/**
|
20 |
* Sets the parser associated with this token parser.
|
|
|
|
|
21 |
*/
|
22 |
public function setParser(Twig_Parser $parser);
|
23 |
|
24 |
/**
|
25 |
* Parses a token and returns a node.
|
26 |
*
|
27 |
+
* @return Twig_NodeInterface
|
|
|
|
|
28 |
*
|
29 |
* @throws Twig_Error_Syntax
|
30 |
*/
|
vendor/twig/twig/lib/Twig/TokenStream.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
-
* (c)
|
7 |
-
* (c)
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
@@ -13,6 +13,8 @@
|
|
13 |
/**
|
14 |
* Represents a token stream.
|
15 |
*
|
|
|
|
|
16 |
* @author Fabien Potencier <fabien@symfony.com>
|
17 |
*/
|
18 |
class Twig_TokenStream
|
@@ -24,8 +26,6 @@ class Twig_TokenStream
|
|
24 |
private $source;
|
25 |
|
26 |
/**
|
27 |
-
* Constructor.
|
28 |
-
*
|
29 |
* @param array $tokens An array of tokens
|
30 |
* @param string|null $name The name of the template which tokens are associated with
|
31 |
* @param string|null $source The source code associated with the tokens
|
@@ -47,11 +47,6 @@ class Twig_TokenStream
|
|
47 |
$this->filename = $this->source->getName();
|
48 |
}
|
49 |
|
50 |
-
/**
|
51 |
-
* Returns a string representation of the token stream.
|
52 |
-
*
|
53 |
-
* @return string
|
54 |
-
*/
|
55 |
public function __toString()
|
56 |
{
|
57 |
return implode("\n", $this->tokens);
|
@@ -70,7 +65,7 @@ class Twig_TokenStream
|
|
70 |
public function next()
|
71 |
{
|
72 |
if (!isset($this->tokens[++$this->current])) {
|
73 |
-
throw new Twig_Error_Syntax('Unexpected end of template.', $this->tokens[$this->current - 1]->getLine(), $this->source
|
74 |
}
|
75 |
|
76 |
return $this->tokens[$this->current - 1];
|
@@ -103,7 +98,7 @@ class Twig_TokenStream
|
|
103 |
Twig_Token::typeToEnglish($token->getType()), $token->getValue(),
|
104 |
Twig_Token::typeToEnglish($type), $value ? sprintf(' with value "%s"', $value) : ''),
|
105 |
$line,
|
106 |
-
$this->source
|
107 |
);
|
108 |
}
|
109 |
$this->next();
|
@@ -121,7 +116,7 @@ class Twig_TokenStream
|
|
121 |
public function look($number = 1)
|
122 |
{
|
123 |
if (!isset($this->tokens[$this->current + $number])) {
|
124 |
-
throw new Twig_Error_Syntax('Unexpected end of template.', $this->tokens[$this->current + $number - 1]->getLine(), $this->source
|
125 |
}
|
126 |
|
127 |
return $this->tokens[$this->current + $number];
|
@@ -148,8 +143,6 @@ class Twig_TokenStream
|
|
148 |
}
|
149 |
|
150 |
/**
|
151 |
-
* Gets the current token.
|
152 |
-
*
|
153 |
* @return Twig_Token
|
154 |
*/
|
155 |
public function getCurrent()
|
3 |
/*
|
4 |
* This file is part of Twig.
|
5 |
*
|
6 |
+
* (c) Fabien Potencier
|
7 |
+
* (c) Armin Ronacher
|
8 |
*
|
9 |
* For the full copyright and license information, please view the LICENSE
|
10 |
* file that was distributed with this source code.
|
13 |
/**
|
14 |
* Represents a token stream.
|
15 |
*
|
16 |
+
* @final
|
17 |
+
*
|
18 |
* @author Fabien Potencier <fabien@symfony.com>
|
19 |
*/
|
20 |
class Twig_TokenStream
|
26 |
private $source;
|
27 |
|
28 |
/**
|
|
|
|
|
29 |
* @param array $tokens An array of tokens
|
30 |
* @param string|null $name The name of the template which tokens are associated with
|
31 |
* @param string|null $source The source code associated with the tokens
|
47 |
$this->filename = $this->source->getName();
|
48 |
}
|
49 |
|
|
|
|
|
|
|
|
|
|
|
50 |
public function __toString()
|
51 |
{
|
52 |
return implode("\n", $this->tokens);
|
65 |
public function next()
|
66 |
{
|
67 |
if (!isset($this->tokens[++$this->current])) {
|
68 |
+
throw new Twig_Error_Syntax('Unexpected end of template.', $this->tokens[$this->current - 1]->getLine(), $this->source);
|
69 |
}
|
70 |
|
71 |
return $this->tokens[$this->current - 1];
|
98 |
Twig_Token::typeToEnglish($token->getType()), $token->getValue(),
|
99 |
Twig_Token::typeToEnglish($type), $value ? sprintf(' with value "%s"', $value) : ''),
|
100 |
$line,
|
101 |
+
$this->source
|
102 |
);
|
103 |
}
|
104 |
$this->next();
|
116 |
public function look($number = 1)
|
117 |
{
|
118 |
if (!isset($this->tokens[$this->current + $number])) {
|
119 |
+
throw new Twig_Error_Syntax('Unexpected end of template.', $this->tokens[$this->current + $number - 1]->getLine(), $this->source);
|
120 |
}
|
121 |
|
122 |
return $this->tokens[$this->current + $number];
|
143 |
}
|
144 |
|
145 |
/**
|
|
|
|
|
146 |
* @return Twig_Token
|
147 |
*/
|
148 |
public function getCurrent()
|
vendor/twig/twig/lib/Twig/Util/DeprecationCollector.php
CHANGED
@@ -11,6 +11,8 @@
|
|
11 |
|
12 |
/**
|
13 |
* @author Fabien Potencier <fabien@symfony.com>
|
|
|
|
|
14 |
*/
|
15 |
class Twig_Util_DeprecationCollector
|
16 |
{
|
@@ -28,7 +30,7 @@ class Twig_Util_DeprecationCollector
|
|
28 |
* @param string $dir A directory where templates are stored
|
29 |
* @param string $ext Limit the loaded templates by extension
|
30 |
*
|
31 |
-
* @return array
|
32 |
*/
|
33 |
public function collectDir($dir, $ext = '.twig')
|
34 |
{
|
@@ -46,7 +48,7 @@ class Twig_Util_DeprecationCollector
|
|
46 |
*
|
47 |
* @param Iterator $iterator An iterator of templates (where keys are template names and values the contents of the template)
|
48 |
*
|
49 |
-
* @return array
|
50 |
*/
|
51 |
public function collect(Iterator $iterator)
|
52 |
{
|
11 |
|
12 |
/**
|
13 |
* @author Fabien Potencier <fabien@symfony.com>
|
14 |
+
*
|
15 |
+
* @final
|
16 |
*/
|
17 |
class Twig_Util_DeprecationCollector
|
18 |
{
|
30 |
* @param string $dir A directory where templates are stored
|
31 |
* @param string $ext Limit the loaded templates by extension
|
32 |
*
|
33 |
+
* @return array An array of deprecations
|
34 |
*/
|
35 |
public function collectDir($dir, $ext = '.twig')
|
36 |
{
|
48 |
*
|
49 |
* @param Iterator $iterator An iterator of templates (where keys are template names and values the contents of the template)
|
50 |
*
|
51 |
+
* @return array An array of deprecations
|
52 |
*/
|
53 |
public function collect(Iterator $iterator)
|
54 |
{
|
vendor/twig/twig/phpunit.xml.dist
CHANGED
@@ -17,6 +17,14 @@
|
|
17 |
</testsuite>
|
18 |
</testsuites>
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
<filter>
|
21 |
<whitelist>
|
22 |
<directory suffix=".php">./lib/Twig/</directory>
|
17 |
</testsuite>
|
18 |
</testsuites>
|
19 |
|
20 |
+
<php>
|
21 |
+
<ini name="error_reporting" value="-1" />
|
22 |
+
</php>
|
23 |
+
|
24 |
+
<listeners>
|
25 |
+
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
|
26 |
+
</listeners>
|
27 |
+
|
28 |
<filter>
|
29 |
<whitelist>
|
30 |
<directory suffix=".php">./lib/Twig/</directory>
|
views/settings/basics.html
CHANGED
@@ -272,7 +272,7 @@
|
|
272 |
<p class="description">
|
273 |
<%= __('When your subscribers click the "Unsubscribe" link, they will be directed to this page.') %>
|
274 |
<br />
|
275 |
-
<%= __('If you want to use a custom Unsubscribe page, simply paste this shortcode on to a WordPress page: [
|
276 |
</p>
|
277 |
</th>
|
278 |
<td>
|
272 |
<p class="description">
|
273 |
<%= __('When your subscribers click the "Unsubscribe" link, they will be directed to this page.') %>
|
274 |
<br />
|
275 |
+
<%= __('If you want to use a custom Unsubscribe page, simply paste this shortcode on to a WordPress page: [mailpoet_manage text="Manage your subscription"]') %>
|
276 |
</p>
|
277 |
</th>
|
278 |
<td>
|