├── www ├── cache │ └── .gitkeep ├── content │ └── .gitkeep ├── .htaccess ├── themes │ └── default │ │ ├── login.html │ │ ├── detail.html │ │ ├── img │ │ ├── padlock.svg │ │ ├── user.svg │ │ └── camera.svg │ │ ├── template.twig │ │ └── gallery.html └── index.php ├── vendor ├── twig │ └── twig │ │ ├── .gitignore │ │ ├── .editorconfig │ │ ├── lib │ │ └── Twig │ │ │ ├── Node │ │ │ ├── Body.php │ │ │ ├── Expression │ │ │ │ ├── Binary │ │ │ │ │ ├── Equal.php │ │ │ │ │ ├── Less.php │ │ │ │ │ ├── Greater.php │ │ │ │ │ ├── LessEqual.php │ │ │ │ │ ├── NotEqual.php │ │ │ │ │ ├── GreaterEqual.php │ │ │ │ │ ├── Add.php │ │ │ │ │ ├── And.php │ │ │ │ │ ├── Div.php │ │ │ │ │ ├── Mod.php │ │ │ │ │ ├── Mul.php │ │ │ │ │ ├── Or.php │ │ │ │ │ ├── Sub.php │ │ │ │ │ ├── Concat.php │ │ │ │ │ ├── BitwiseOr.php │ │ │ │ │ ├── BitwiseAnd.php │ │ │ │ │ ├── BitwiseXor.php │ │ │ │ │ ├── Matches.php │ │ │ │ │ ├── StartsWith.php │ │ │ │ │ ├── FloorDiv.php │ │ │ │ │ ├── EndsWith.php │ │ │ │ │ ├── Power.php │ │ │ │ │ ├── In.php │ │ │ │ │ ├── Range.php │ │ │ │ │ └── NotIn.php │ │ │ │ ├── Unary │ │ │ │ │ ├── Neg.php │ │ │ │ │ ├── Not.php │ │ │ │ │ └── Pos.php │ │ │ │ ├── Constant.php │ │ │ │ ├── TempName.php │ │ │ │ ├── AssignName.php │ │ │ │ ├── Test │ │ │ │ │ ├── Null.php │ │ │ │ │ ├── Odd.php │ │ │ │ │ ├── Even.php │ │ │ │ │ ├── Sameas.php │ │ │ │ │ ├── Divisibleby.php │ │ │ │ │ ├── Constant.php │ │ │ │ │ └── Defined.php │ │ │ │ ├── Unary.php │ │ │ │ ├── ExtensionReference.php │ │ │ │ ├── Conditional.php │ │ │ │ ├── Test.php │ │ │ │ ├── Binary.php │ │ │ │ ├── MethodCall.php │ │ │ │ ├── Function.php │ │ │ │ ├── Parent.php │ │ │ │ ├── Filter.php │ │ │ │ ├── BlockReference.php │ │ │ │ ├── Filter │ │ │ │ │ └── Default.php │ │ │ │ ├── GetAttr.php │ │ │ │ └── Array.php │ │ │ ├── Expression.php │ │ │ ├── Flush.php │ │ │ ├── SetTemp.php │ │ │ ├── Do.php │ │ │ ├── Text.php │ │ │ ├── BlockReference.php │ │ │ ├── Print.php │ │ │ ├── AutoEscape.php │ │ │ ├── Spaceless.php │ │ │ ├── Block.php │ │ │ ├── Embed.php │ │ │ ├── Sandbox.php │ │ │ ├── Import.php │ │ │ ├── ForLoop.php │ │ │ ├── SandboxedPrint.php │ │ │ ├── If.php │ │ │ ├── SandboxedModule.php │ │ │ └── Macro.php │ │ │ ├── NodeOutputInterface.php │ │ │ ├── Sandbox │ │ │ ├── SecurityError.php │ │ │ └── SecurityPolicyInterface.php │ │ │ ├── Error │ │ │ ├── Runtime.php │ │ │ ├── Syntax.php │ │ │ └── Loader.php │ │ │ ├── TestCallableInterface.php │ │ │ ├── FilterCallableInterface.php │ │ │ ├── FunctionCallableInterface.php │ │ │ ├── TestInterface.php │ │ │ ├── NodeInterface.php │ │ │ ├── TokenParser.php │ │ │ ├── ExistsLoaderInterface.php │ │ │ ├── Extension │ │ │ ├── Optimizer.php │ │ │ ├── StringLoader.php │ │ │ ├── Debug.php │ │ │ └── Staging.php │ │ │ ├── Test │ │ │ ├── Node.php │ │ │ ├── Function.php │ │ │ ├── Method.php │ │ │ └── NodeTestCase.php │ │ │ ├── ParserInterface.php │ │ │ ├── Test.php │ │ │ ├── Filter │ │ │ ├── Node.php │ │ │ ├── Function.php │ │ │ └── Method.php │ │ │ ├── LexerInterface.php │ │ │ ├── Function │ │ │ ├── Node.php │ │ │ ├── Function.php │ │ │ └── Method.php │ │ │ ├── Markup.php │ │ │ ├── CompilerInterface.php │ │ │ ├── FunctionInterface.php │ │ │ ├── FilterInterface.php │ │ │ ├── TokenParser │ │ │ ├── Flush.php │ │ │ ├── Do.php │ │ │ ├── Import.php │ │ │ ├── Extends.php │ │ │ ├── Spaceless.php │ │ │ ├── Filter.php │ │ │ ├── From.php │ │ │ ├── Include.php │ │ │ ├── Embed.php │ │ │ ├── Sandbox.php │ │ │ ├── Macro.php │ │ │ ├── Use.php │ │ │ ├── Set.php │ │ │ ├── Block.php │ │ │ └── AutoEscape.php │ │ │ ├── SimpleTest.php │ │ │ ├── TokenParserInterface.php │ │ │ ├── Autoloader.php │ │ │ ├── TemplateInterface.php │ │ │ ├── TokenParserBrokerInterface.php │ │ │ ├── NodeVisitorInterface.php │ │ │ ├── LoaderInterface.php │ │ │ ├── Loader │ │ │ ├── String.php │ │ │ └── Array.php │ │ │ ├── Function.php │ │ │ ├── Filter.php │ │ │ ├── SimpleFunction.php │ │ │ ├── ExtensionInterface.php │ │ │ ├── SimpleFilter.php │ │ │ ├── Extension.php │ │ │ ├── NodeTraverser.php │ │ │ └── NodeVisitor │ │ │ └── Sandbox.php │ │ ├── .travis.yml │ │ ├── README.rst │ │ ├── phpunit.xml.dist │ │ ├── composer.json │ │ └── LICENSE ├── bramus │ └── router │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── tests │ │ └── bootstrap.php │ │ ├── demo │ │ ├── .htaccess │ │ └── index.php │ │ ├── phpunit.xml.dist │ │ ├── composer.json │ │ └── LICENSE ├── composer │ ├── autoload_psr4.php │ ├── autoload_classmap.php │ ├── autoload_namespaces.php │ └── autoload_real.php └── autoload.php ├── .gitignore ├── .editorconfig ├── composer.json ├── changelog.txt ├── README.md ├── core └── controller.php ├── bootstrap.php ├── LICENSE.md ├── conf └── config.php └── app └── controllers ├── auth.php └── thumbnail.php /www/cache/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /www/content/.gitkeep: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | -------------------------------------------------------------------------------- /vendor/twig/twig/.gitignore: -------------------------------------------------------------------------------- 1 | /ext/twig/autom4te.cache/ 2 | 3 | -------------------------------------------------------------------------------- /vendor/bramus/router/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | composer.lock 3 | vendor/ 4 | tests-report/ -------------------------------------------------------------------------------- /vendor/bramus/router/.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | php: 3 | - "5.5" 4 | - "5.4" 5 | - "5.3" -------------------------------------------------------------------------------- /vendor/bramus/router/tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine On 3 | RewriteCond %{REQUEST_FILENAME} !-f 4 | RewriteCond %{REQUEST_FILENAME} !-d 5 | RewriteRule . index.php [L] 6 | 7 | 8 | # Prevent file browsing 9 | Options -Indexes -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /vendor/twig/twig/.editorconfig: -------------------------------------------------------------------------------- 1 | ; top-most EditorConfig file 2 | root = true 3 | 4 | ; Unix-style newlines 5 | [*] 6 | end_of_line = LF 7 | 8 | [*.php] 9 | indent_style = space 10 | indent_size = 4 11 | 12 | [*.test] 13 | indent_style = space 14 | indent_size = 4 15 | 16 | [*.rst] 17 | indent_style = space 18 | indent_size = 4 19 | -------------------------------------------------------------------------------- /vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/twig/twig/lib'), 10 | 'Bramus' => array($vendorDir . '/bramus/router/src'), 11 | ); 12 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Body.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | class Twig_Node_Body extends Twig_Node 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jbleuzen/picturo", 3 | "description": "A simple flat file photo gallery", 4 | "authors": [ 5 | { 6 | "name": "Johan BLEUZEN", 7 | "homepage": "http://www.johanbleuzen.fr", 8 | "role": "Developer" 9 | } 10 | ], 11 | "license": "MIT", 12 | "config": { 13 | "preferred-install": "dist" 14 | }, 15 | "require": { 16 | "twig/twig": "1.*", 17 | "bramus/router": "dev-master" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/NodeOutputInterface.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | interface Twig_NodeOutputInterface 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /changelog.txt: -------------------------------------------------------------------------------- 1 | *** Picturo Changelog *** 2 | 3 | 2013.11.08 - version 0.3.0 4 | * Better composer configration 5 | * Refactoring : Creating basic controllers 6 | * Updating default configuration 7 | * Bugfix on default theme 8 | 9 | 2013.09.21 - version 0.2.0 10 | * Adding a thumbnail service 11 | 12 | 2013.09.19 - version 0.1.0 13 | * Refactoring : Using a new router 14 | * Cleaning some urls 15 | * Fixing bugs 16 | 17 | 2013.09.01 - version 0.0.1 18 | * Initial release 19 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php: -------------------------------------------------------------------------------- 1 | raw('=='); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php: -------------------------------------------------------------------------------- 1 | raw('<'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | class Twig_Sandbox_SecurityError extends Twig_Error 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php: -------------------------------------------------------------------------------- 1 | raw('>'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Picturo 2 | ==== 3 | 4 | Picturo is a stupidly simple, blazing fast, flat file photo gallery. 5 | 6 | [Documentation](http://jbleuzen.github.io/Picturo/) — [Demo](http://picturo.johanbleuzen.fr) (user : admin - pass : admin) 7 | 8 | If you have trouble with Picturo, please use the [Issue page](https://github.com/jbleuzen/Picturo/issues). 9 | 10 | Picturo was inspired by [Pico](https://github.com/gilbitron/Pico). 11 | 12 | TODO : 13 | 14 | * Responsive theme 15 | * Add settings 16 | * Support GIF, PNG 17 | -------------------------------------------------------------------------------- /core/controller.php: -------------------------------------------------------------------------------- 1 | app = $app; 11 | } 12 | 13 | protected function getParam($name) { 14 | if(isset($_GET[$name]) && ! empty($_GET[$name])) { 15 | return $_GET[$name]; 16 | } 17 | } 18 | 19 | protected function getPost($name) { 20 | if(isset($_POST[$name]) && ! empty($_POST[$name])) { 21 | return $_POST[$name]; 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Error/Runtime.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | class Twig_Error_Runtime extends Twig_Error 19 | { 20 | } 21 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php: -------------------------------------------------------------------------------- 1 | raw('<='); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php: -------------------------------------------------------------------------------- 1 | raw('!='); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php: -------------------------------------------------------------------------------- 1 | raw('>='); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php: -------------------------------------------------------------------------------- 1 | raw('-'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php: -------------------------------------------------------------------------------- 1 | raw('!'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php: -------------------------------------------------------------------------------- 1 | raw('+'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | abstract class Twig_Node_Expression extends Twig_Node 19 | { 20 | } 21 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php: -------------------------------------------------------------------------------- 1 | raw('+'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php: -------------------------------------------------------------------------------- 1 | raw('&&'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php: -------------------------------------------------------------------------------- 1 | raw('/'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php: -------------------------------------------------------------------------------- 1 | raw('%'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php: -------------------------------------------------------------------------------- 1 | raw('*'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php: -------------------------------------------------------------------------------- 1 | raw('||'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php: -------------------------------------------------------------------------------- 1 | raw('-'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php: -------------------------------------------------------------------------------- 1 | raw('.'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Error/Syntax.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | class Twig_Error_Syntax extends Twig_Error 19 | { 20 | } 21 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php: -------------------------------------------------------------------------------- 1 | raw('|'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/twig/twig/.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.2 5 | - 5.3 6 | - 5.4 7 | - 5.5 8 | - hhvm 9 | 10 | env: 11 | - TWIG_EXT=no 12 | - TWIG_EXT=yes 13 | 14 | before_script: 15 | - if [ "$TWIG_EXT" == "yes" ]; then sh -c "cd ext/twig && phpize && ./configure --enable-twig && make && sudo make install"; fi 16 | - if [ "$TWIG_EXT" == "yes" ]; then echo "extension=twig.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi 17 | 18 | matrix: 19 | exclude: 20 | - php: hhvm 21 | env: TWIG_EXT=yes 22 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php: -------------------------------------------------------------------------------- 1 | raw('&'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php: -------------------------------------------------------------------------------- 1 | raw('^'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/twig/twig/README.rst: -------------------------------------------------------------------------------- 1 | Twig, the flexible, fast, and secure template language for PHP 2 | ============================================================== 3 | 4 | Twig is a template language for PHP, released under the new BSD license (code 5 | and documentation). 6 | 7 | Twig uses a syntax similar to the Django and Jinja template languages which 8 | inspired the Twig runtime environment. 9 | 10 | More Information 11 | ---------------- 12 | 13 | Read the `documentation`_ for more information. 14 | 15 | .. _documentation: http://twig.sensiolabs.org/documentation 16 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TestCallableInterface.php: -------------------------------------------------------------------------------- 1 | 16 | * @deprecated since 1.12 (to be removed in 2.0) 17 | */ 18 | interface Twig_TestCallableInterface 19 | { 20 | public function getCallable(); 21 | } 22 | -------------------------------------------------------------------------------- /vendor/bramus/router/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | tests/ 7 | 8 | 9 | 10 | 11 | src/ 12 | 13 | 14 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/FilterCallableInterface.php: -------------------------------------------------------------------------------- 1 | 18 | * @deprecated since 1.12 (to be removed in 2.0) 19 | */ 20 | interface Twig_FilterCallableInterface 21 | { 22 | public function getCallable(); 23 | } 24 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/FunctionCallableInterface.php: -------------------------------------------------------------------------------- 1 | 18 | * @deprecated since 1.12 (to be removed in 2.0) 19 | */ 20 | interface Twig_FunctionCallableInterface 21 | { 22 | public function getCallable(); 23 | } 24 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TestInterface.php: -------------------------------------------------------------------------------- 1 | 16 | * @deprecated since 1.12 (to be removed in 2.0) 17 | */ 18 | interface Twig_TestInterface 19 | { 20 | /** 21 | * Compiles a test. 22 | * 23 | * @return string The PHP code for the test 24 | */ 25 | public function compile(); 26 | } 27 | -------------------------------------------------------------------------------- /vendor/bramus/router/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bramus/router", 3 | "description": "A lightweight and simple object oriented PHP Router", 4 | "keywords": ["router", "routing"], 5 | "homepage": "https://github.com/bramus/router", 6 | "type": "library", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Bram(us) Van Damme", 11 | "email": "bramus@bram.us", 12 | "homepage": "http://www.bram.us" 13 | } 14 | ], 15 | "require": { 16 | "php": ">=5.3.0" 17 | }, 18 | "require-dev": { 19 | "phpunit/phpunit": "3.7.x", 20 | "phpunit/php-code-coverage": "1.3.*@dev" 21 | }, 22 | "autoload": { 23 | "psr-0": {"Bramus": "src/"} 24 | } 25 | } -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Constant.php: -------------------------------------------------------------------------------- 1 | $value), $lineno); 17 | } 18 | 19 | public function compile(Twig_Compiler $compiler) 20 | { 21 | $compiler->repr($this->getAttribute('value')); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /www/themes/default/login.html: -------------------------------------------------------------------------------- 1 | {% extends "template.twig" %} 2 | 3 | {% block title %}Login{% endblock %} 4 | 5 | {% block bodyClass %}login{% endblock %} 6 | 7 | {% block content %} 8 |
9 | {% if login_error %} 10 |

{{ login_error }}

11 | {% endif %} 12 |

13 | 14 |

15 |

16 | 17 |

18 | 19 |
20 | {% endblock %} 21 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | interface Twig_Sandbox_SecurityPolicyInterface 18 | { 19 | public function checkSecurity($tags, $filters, $functions); 20 | 21 | public function checkMethodAllowed($obj, $method); 22 | 23 | public function checkPropertyAllowed($obj, $method); 24 | } 25 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/TempName.php: -------------------------------------------------------------------------------- 1 | $name), $lineno); 16 | } 17 | 18 | public function compile(Twig_Compiler $compiler) 19 | { 20 | $compiler 21 | ->raw('$_') 22 | ->raw($this->getAttribute('name')) 23 | ->raw('_') 24 | ; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php: -------------------------------------------------------------------------------- 1 | raw('$context[') 24 | ->string($this->getAttribute('name')) 25 | ->raw(']') 26 | ; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/twig/twig/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 16 | ./test/Twig/ 17 | 18 | 19 | 20 | 21 | 22 | ./lib/Twig/ 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php: -------------------------------------------------------------------------------- 1 | 16 | * {{ var is none }} 17 | * 18 | * 19 | * @author Fabien Potencier 20 | */ 21 | class Twig_Node_Expression_Test_Null extends Twig_Node_Expression_Test 22 | { 23 | public function compile(Twig_Compiler $compiler) 24 | { 25 | $compiler 26 | ->raw('(null === ') 27 | ->subcompile($this->getNode('node')) 28 | ->raw(')') 29 | ; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php: -------------------------------------------------------------------------------- 1 | 16 | * {{ var is odd }} 17 | * 18 | * 19 | * @author Fabien Potencier 20 | */ 21 | class Twig_Node_Expression_Test_Odd extends Twig_Node_Expression_Test 22 | { 23 | public function compile(Twig_Compiler $compiler) 24 | { 25 | $compiler 26 | ->raw('(') 27 | ->subcompile($this->getNode('node')) 28 | ->raw(' % 2 == 1') 29 | ->raw(')') 30 | ; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php: -------------------------------------------------------------------------------- 1 | 16 | * {{ var is even }} 17 | * 18 | * 19 | * @author Fabien Potencier 20 | */ 21 | class Twig_Node_Expression_Test_Even extends Twig_Node_Expression_Test 22 | { 23 | public function compile(Twig_Compiler $compiler) 24 | { 25 | $compiler 26 | ->raw('(') 27 | ->subcompile($this->getNode('node')) 28 | ->raw(' % 2 == 0') 29 | ->raw(')') 30 | ; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/NodeInterface.php: -------------------------------------------------------------------------------- 1 | 16 | * 17 | * @deprecated since 1.12 (to be removed in 3.0) 18 | */ 19 | interface Twig_NodeInterface extends Countable, IteratorAggregate 20 | { 21 | /** 22 | * Compiles the node to PHP. 23 | * 24 | * @param Twig_Compiler A Twig_Compiler instance 25 | */ 26 | public function compile(Twig_Compiler $compiler); 27 | 28 | public function getLine(); 29 | 30 | public function getNodeTag(); 31 | } 32 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php: -------------------------------------------------------------------------------- 1 | raw('preg_match(') 17 | ->subcompile($this->getNode('right')) 18 | ->raw(', ') 19 | ->subcompile($this->getNode('left')) 20 | ->raw(')') 21 | ; 22 | } 23 | 24 | public function operator(Twig_Compiler $compiler) 25 | { 26 | return $compiler->raw(''); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php: -------------------------------------------------------------------------------- 1 | raw('(0 === strpos(') 17 | ->subcompile($this->getNode('left')) 18 | ->raw(', ') 19 | ->subcompile($this->getNode('right')) 20 | ->raw('))') 21 | ; 22 | } 23 | 24 | public function operator(Twig_Compiler $compiler) 25 | { 26 | return $compiler->raw(''); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TokenParser.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | abstract class Twig_TokenParser implements Twig_TokenParserInterface 18 | { 19 | /** 20 | * @var Twig_Parser 21 | */ 22 | protected $parser; 23 | 24 | /** 25 | * Sets the parser associated with this token parser 26 | * 27 | * @param $parser A Twig_Parser instance 28 | */ 29 | public function setParser(Twig_Parser $parser) 30 | { 31 | $this->parser = $parser; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php: -------------------------------------------------------------------------------- 1 | raw('intval(floor('); 21 | parent::compile($compiler); 22 | $compiler->raw('))'); 23 | } 24 | 25 | public function operator(Twig_Compiler $compiler) 26 | { 27 | return $compiler->raw('/'); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /bootstrap.php: -------------------------------------------------------------------------------- 1 | 16 | * 17 | * @deprecated since 1.12 (to be removed in 3.0) 18 | */ 19 | interface Twig_ExistsLoaderInterface 20 | { 21 | /** 22 | * Check if we have the source code of a template, given its name. 23 | * 24 | * @param string $name The name of the template to check if we can load 25 | * 26 | * @return bool If the template source code is handled by this loader or not 27 | */ 28 | public function exists($name); 29 | } 30 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Extension/Optimizer.php: -------------------------------------------------------------------------------- 1 | optimizers = $optimizers; 18 | } 19 | 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getNodeVisitors() 24 | { 25 | return array(new Twig_NodeVisitor_Optimizer($this->optimizers)); 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function getName() 32 | { 33 | return 'optimizer'; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | class Twig_Node_Expression_Test_Sameas extends Twig_Node_Expression_Test 18 | { 19 | public function compile(Twig_Compiler $compiler) 20 | { 21 | $compiler 22 | ->raw('(') 23 | ->subcompile($this->getNode('node')) 24 | ->raw(' === ') 25 | ->subcompile($this->getNode('arguments')->getNode(0)) 26 | ->raw(')') 27 | ; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /www/themes/default/detail.html: -------------------------------------------------------------------------------- 1 | {% extends "template.twig" %} 2 | 3 | {% block title %}Gallery{% endblock %} 4 | 5 | {% block bodyClass %}gallery{% endblock %} 6 | 7 | {% block content %} 8 | {%if breadcrumb %} 9 | 19 | {% endif %} 20 |
21 | {% if image_previous_url != base_url ~ "/" %} 22 | 23 | {% endif %} 24 | {% if image_next_url != base_url ~ "/" %} 25 | 26 | {% endif %} 27 | 28 |
29 | {% endblock %} 30 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Test/Node.php: -------------------------------------------------------------------------------- 1 | 16 | * @deprecated since 1.12 (to be removed in 2.0) 17 | */ 18 | class Twig_Test_Node extends Twig_Test 19 | { 20 | protected $class; 21 | 22 | public function __construct($class, array $options = array()) 23 | { 24 | parent::__construct($options); 25 | 26 | $this->class = $class; 27 | } 28 | 29 | public function getClass() 30 | { 31 | return $this->class; 32 | } 33 | 34 | public function compile() 35 | { 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Test/Function.php: -------------------------------------------------------------------------------- 1 | 16 | * @deprecated since 1.12 (to be removed in 2.0) 17 | */ 18 | class Twig_Test_Function extends Twig_Test 19 | { 20 | protected $function; 21 | 22 | public function __construct($function, array $options = array()) 23 | { 24 | $options['callable'] = $function; 25 | 26 | parent::__construct($options); 27 | 28 | $this->function = $function; 29 | } 30 | 31 | public function compile() 32 | { 33 | return $this->function; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/ParserInterface.php: -------------------------------------------------------------------------------- 1 | 16 | * 17 | * @deprecated since 1.12 (to be removed in 3.0) 18 | */ 19 | interface Twig_ParserInterface 20 | { 21 | /** 22 | * Converts a token stream to a node tree. 23 | * 24 | * @param Twig_TokenStream $stream A token stream instance 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 | */ 30 | public function parse(Twig_TokenStream $stream); 31 | } 32 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Flush.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | class Twig_Node_Flush extends Twig_Node 18 | { 19 | public function __construct($lineno, $tag) 20 | { 21 | parent::__construct(array(), array(), $lineno, $tag); 22 | } 23 | 24 | /** 25 | * Compiles the node to PHP. 26 | * 27 | * @param Twig_Compiler A Twig_Compiler instance 28 | */ 29 | public function compile(Twig_Compiler $compiler) 30 | { 31 | $compiler 32 | ->addDebugInfo($this) 33 | ->write("flush();\n") 34 | ; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Unary.php: -------------------------------------------------------------------------------- 1 | $node), array(), $lineno); 17 | } 18 | 19 | public function compile(Twig_Compiler $compiler) 20 | { 21 | $compiler->raw('('); 22 | $this->operator($compiler); 23 | $compiler 24 | ->subcompile($this->getNode('node')) 25 | ->raw(')') 26 | ; 27 | } 28 | 29 | abstract public function operator(Twig_Compiler $compiler); 30 | } 31 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Test.php: -------------------------------------------------------------------------------- 1 | 16 | * @deprecated since 1.12 (to be removed in 2.0) 17 | */ 18 | abstract class Twig_Test implements Twig_TestInterface, Twig_TestCallableInterface 19 | { 20 | protected $options; 21 | protected $arguments = array(); 22 | 23 | public function __construct(array $options = array()) 24 | { 25 | $this->options = array_merge(array( 26 | 'callable' => null, 27 | ), $options); 28 | } 29 | 30 | public function getCallable() 31 | { 32 | return $this->options['callable']; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Filter/Node.php: -------------------------------------------------------------------------------- 1 | 18 | * @deprecated since 1.12 (to be removed in 2.0) 19 | */ 20 | class Twig_Filter_Node extends Twig_Filter 21 | { 22 | protected $class; 23 | 24 | public function __construct($class, array $options = array()) 25 | { 26 | parent::__construct($options); 27 | 28 | $this->class = $class; 29 | } 30 | 31 | public function getClass() 32 | { 33 | return $this->class; 34 | } 35 | 36 | public function compile() 37 | { 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/LexerInterface.php: -------------------------------------------------------------------------------- 1 | 16 | * 17 | * @deprecated since 1.12 (to be removed in 3.0) 18 | */ 19 | interface Twig_LexerInterface 20 | { 21 | /** 22 | * Tokenizes a source code. 23 | * 24 | * @param string $code The source code 25 | * @param string $filename A unique identifier for the source code 26 | * 27 | * @return Twig_TokenStream A token stream instance 28 | * 29 | * @throws Twig_Error_Syntax When the code is syntactically wrong 30 | */ 31 | public function tokenize($code, $filename = null); 32 | } 33 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php: -------------------------------------------------------------------------------- 1 | raw('(0 === substr_compare(') 17 | ->subcompile($this->getNode('left')) 18 | ->raw(', ') 19 | ->subcompile($this->getNode('right')) 20 | ->raw(', -strlen(') 21 | ->subcompile($this->getNode('right')) 22 | ->raw(')))') 23 | ; 24 | } 25 | 26 | public function operator(Twig_Compiler $compiler) 27 | { 28 | return $compiler->raw(''); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Function/Node.php: -------------------------------------------------------------------------------- 1 | 18 | * @deprecated since 1.12 (to be removed in 2.0) 19 | */ 20 | class Twig_Function_Node extends Twig_Function 21 | { 22 | protected $class; 23 | 24 | public function __construct($class, array $options = array()) 25 | { 26 | parent::__construct($options); 27 | 28 | $this->class = $class; 29 | } 30 | 31 | public function getClass() 32 | { 33 | return $this->class; 34 | } 35 | 36 | public function compile() 37 | { 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php: -------------------------------------------------------------------------------- 1 | 16 | * {% if loop.index is divisible by(3) %} 17 | * 18 | * 19 | * @author Fabien Potencier 20 | */ 21 | class Twig_Node_Expression_Test_Divisibleby extends Twig_Node_Expression_Test 22 | { 23 | public function compile(Twig_Compiler $compiler) 24 | { 25 | $compiler 26 | ->raw('(0 == ') 27 | ->subcompile($this->getNode('node')) 28 | ->raw(' % ') 29 | ->subcompile($this->getNode('arguments')->getNode(0)) 30 | ->raw(')') 31 | ; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Filter/Function.php: -------------------------------------------------------------------------------- 1 | 18 | * @deprecated since 1.12 (to be removed in 2.0) 19 | */ 20 | class Twig_Filter_Function extends Twig_Filter 21 | { 22 | protected $function; 23 | 24 | public function __construct($function, array $options = array()) 25 | { 26 | $options['callable'] = $function; 27 | 28 | parent::__construct($options); 29 | 30 | $this->function = $function; 31 | } 32 | 33 | public function compile() 34 | { 35 | return $this->function; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Markup.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | class Twig_Markup implements Countable 18 | { 19 | protected $content; 20 | protected $charset; 21 | 22 | public function __construct($content, $charset) 23 | { 24 | $this->content = (string) $content; 25 | $this->charset = $charset; 26 | } 27 | 28 | public function __toString() 29 | { 30 | return $this->content; 31 | } 32 | 33 | public function count() 34 | { 35 | return function_exists('mb_get_info') ? mb_strlen($this->content, $this->charset) : strlen($this->content); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php: -------------------------------------------------------------------------------- 1 | raw('pow(') 22 | ->subcompile($this->getNode('left')) 23 | ->raw(', ') 24 | ->subcompile($this->getNode('right')) 25 | ->raw(')') 26 | ; 27 | } 28 | 29 | public function operator(Twig_Compiler $compiler) 30 | { 31 | return $compiler->raw('**'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php: -------------------------------------------------------------------------------- 1 | raw('twig_in_filter(') 22 | ->subcompile($this->getNode('left')) 23 | ->raw(', ') 24 | ->subcompile($this->getNode('right')) 25 | ->raw(')') 26 | ; 27 | } 28 | 29 | public function operator(Twig_Compiler $compiler) 30 | { 31 | return $compiler->raw('in'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php: -------------------------------------------------------------------------------- 1 | raw('range(') 22 | ->subcompile($this->getNode('left')) 23 | ->raw(', ') 24 | ->subcompile($this->getNode('right')) 25 | ->raw(')') 26 | ; 27 | } 28 | 29 | public function operator(Twig_Compiler $compiler) 30 | { 31 | return $compiler->raw('..'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php: -------------------------------------------------------------------------------- 1 | raw('!twig_in_filter(') 22 | ->subcompile($this->getNode('left')) 23 | ->raw(', ') 24 | ->subcompile($this->getNode('right')) 25 | ->raw(')') 26 | ; 27 | } 28 | 29 | public function operator(Twig_Compiler $compiler) 30 | { 31 | return $compiler->raw('not in'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/CompilerInterface.php: -------------------------------------------------------------------------------- 1 | 16 | * 17 | * @deprecated since 1.12 (to be removed in 3.0) 18 | */ 19 | interface Twig_CompilerInterface 20 | { 21 | /** 22 | * Compiles a node. 23 | * 24 | * @param Twig_NodeInterface $node The node to compile 25 | * 26 | * @return Twig_CompilerInterface The current compiler instance 27 | */ 28 | public function compile(Twig_NodeInterface $node); 29 | 30 | /** 31 | * Gets the current PHP code after compilation. 32 | * 33 | * @return string The PHP code 34 | */ 35 | public function getSource(); 36 | } 37 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Function/Function.php: -------------------------------------------------------------------------------- 1 | 19 | * @deprecated since 1.12 (to be removed in 2.0) 20 | */ 21 | class Twig_Function_Function extends Twig_Function 22 | { 23 | protected $function; 24 | 25 | public function __construct($function, array $options = array()) 26 | { 27 | $options['callable'] = $function; 28 | 29 | parent::__construct($options); 30 | 31 | $this->function = $function; 32 | } 33 | 34 | public function compile() 35 | { 36 | return $this->function; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | class Twig_Node_Expression_ExtensionReference extends Twig_Node_Expression 18 | { 19 | public function __construct($name, $lineno, $tag = null) 20 | { 21 | parent::__construct(array(), array('name' => $name), $lineno, $tag); 22 | } 23 | 24 | /** 25 | * Compiles the node to PHP. 26 | * 27 | * @param Twig_Compiler A Twig_Compiler instance 28 | */ 29 | public function compile(Twig_Compiler $compiler) 30 | { 31 | $compiler->raw(sprintf("\$this->env->getExtension('%s')", $this->getAttribute('name'))); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/FunctionInterface.php: -------------------------------------------------------------------------------- 1 | 19 | * @deprecated since 1.12 (to be removed in 2.0) 20 | */ 21 | interface Twig_FunctionInterface 22 | { 23 | /** 24 | * Compiles a function. 25 | * 26 | * @return string The PHP code for the function 27 | */ 28 | public function compile(); 29 | 30 | public function needsEnvironment(); 31 | 32 | public function needsContext(); 33 | 34 | public function getSafe(Twig_Node $filterArgs); 35 | 36 | public function setArguments($arguments); 37 | 38 | public function getArguments(); 39 | } 40 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/SetTemp.php: -------------------------------------------------------------------------------- 1 | $name), $lineno); 17 | } 18 | 19 | public function compile(Twig_Compiler $compiler) 20 | { 21 | $name = $this->getAttribute('name'); 22 | $compiler 23 | ->addDebugInfo($this) 24 | ->write('if (isset($context[') 25 | ->string($name) 26 | ->raw('])) { $_') 27 | ->raw($name) 28 | ->raw('_ = $context[') 29 | ->repr($name) 30 | ->raw(']; } else { $_') 31 | ->raw($name) 32 | ->raw("_ = null; }\n") 33 | ; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Do.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | class Twig_Node_Do extends Twig_Node 18 | { 19 | public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null) 20 | { 21 | parent::__construct(array('expr' => $expr), array(), $lineno, $tag); 22 | } 23 | 24 | /** 25 | * Compiles the node to PHP. 26 | * 27 | * @param Twig_Compiler A Twig_Compiler instance 28 | */ 29 | public function compile(Twig_Compiler $compiler) 30 | { 31 | $compiler 32 | ->addDebugInfo($this) 33 | ->write('') 34 | ->subcompile($this->getNode('expr')) 35 | ->raw(";\n") 36 | ; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /www/themes/default/img/padlock.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | Slice 1 4 | Created with Sketch (http://www.bohemiancoding.com/sketch) 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/FilterInterface.php: -------------------------------------------------------------------------------- 1 | 18 | * @deprecated since 1.12 (to be removed in 2.0) 19 | */ 20 | interface Twig_FilterInterface 21 | { 22 | /** 23 | * Compiles a filter. 24 | * 25 | * @return string The PHP code for the filter 26 | */ 27 | public function compile(); 28 | 29 | public function needsEnvironment(); 30 | 31 | public function needsContext(); 32 | 33 | public function getSafe(Twig_Node $filterArgs); 34 | 35 | public function getPreservesSafety(); 36 | 37 | public function getPreEscape(); 38 | 39 | public function setArguments($arguments); 40 | 41 | public function getArguments(); 42 | } 43 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Text.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | class Twig_Node_Text extends Twig_Node implements Twig_NodeOutputInterface 19 | { 20 | public function __construct($data, $lineno) 21 | { 22 | parent::__construct(array(), array('data' => $data), $lineno); 23 | } 24 | 25 | /** 26 | * Compiles the node to PHP. 27 | * 28 | * @param Twig_Compiler A Twig_Compiler instance 29 | */ 30 | public function compile(Twig_Compiler $compiler) 31 | { 32 | $compiler 33 | ->addDebugInfo($this) 34 | ->write('echo ') 35 | ->string($this->getAttribute('data')) 36 | ->raw(";\n") 37 | ; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php: -------------------------------------------------------------------------------- 1 | $expr1, 'expr2' => $expr2, 'expr3' => $expr3), array(), $lineno); 17 | } 18 | 19 | public function compile(Twig_Compiler $compiler) 20 | { 21 | $compiler 22 | ->raw('((') 23 | ->subcompile($this->getNode('expr1')) 24 | ->raw(') ? (') 25 | ->subcompile($this->getNode('expr2')) 26 | ->raw(') : (') 27 | ->subcompile($this->getNode('expr3')) 28 | ->raw('))') 29 | ; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Test/Method.php: -------------------------------------------------------------------------------- 1 | 16 | * @deprecated since 1.12 (to be removed in 2.0) 17 | */ 18 | class Twig_Test_Method extends Twig_Test 19 | { 20 | protected $extension; 21 | protected $method; 22 | 23 | public function __construct(Twig_ExtensionInterface $extension, $method, array $options = array()) 24 | { 25 | $options['callable'] = array($extension, $method); 26 | 27 | parent::__construct($options); 28 | 29 | $this->extension = $extension; 30 | $this->method = $method; 31 | } 32 | 33 | public function compile() 34 | { 35 | return sprintf('$this->env->getExtension(\'%s\')->%s', $this->extension->getName(), $this->method); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Error/Loader.php: -------------------------------------------------------------------------------- 1 | 24 | */ 25 | class Twig_Error_Loader extends Twig_Error 26 | { 27 | public function __construct($message, $lineno = -1, $filename = null, Exception $previous = null) 28 | { 29 | parent::__construct($message, false, false, $previous); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/BlockReference.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | class Twig_Node_BlockReference extends Twig_Node implements Twig_NodeOutputInterface 19 | { 20 | public function __construct($name, $lineno, $tag = null) 21 | { 22 | parent::__construct(array(), array('name' => $name), $lineno, $tag); 23 | } 24 | 25 | /** 26 | * Compiles the node to PHP. 27 | * 28 | * @param Twig_Compiler A Twig_Compiler instance 29 | */ 30 | public function compile(Twig_Compiler $compiler) 31 | { 32 | $compiler 33 | ->addDebugInfo($this) 34 | ->write(sprintf("\$this->displayBlock('%s', \$context, \$blocks);\n", $this->getAttribute('name'))) 35 | ; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TokenParser/Flush.php: -------------------------------------------------------------------------------- 1 | parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); 29 | 30 | return new Twig_Node_Flush($token->getLine(), $this->getTag()); 31 | } 32 | 33 | /** 34 | * Gets the tag name associated with this token parser. 35 | * 36 | * @return string The tag name 37 | */ 38 | public function getTag() 39 | { 40 | return 'flush'; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Filter/Method.php: -------------------------------------------------------------------------------- 1 | 18 | * @deprecated since 1.12 (to be removed in 2.0) 19 | */ 20 | class Twig_Filter_Method extends Twig_Filter 21 | { 22 | protected $extension; 23 | protected $method; 24 | 25 | public function __construct(Twig_ExtensionInterface $extension, $method, array $options = array()) 26 | { 27 | $options['callable'] = array($extension, $method); 28 | 29 | parent::__construct($options); 30 | 31 | $this->extension = $extension; 32 | $this->method = $method; 33 | } 34 | 35 | public function compile() 36 | { 37 | return sprintf('$this->env->getExtension(\'%s\')->%s', $this->extension->getName(), $this->method); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Print.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | class Twig_Node_Print extends Twig_Node implements Twig_NodeOutputInterface 19 | { 20 | public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null) 21 | { 22 | parent::__construct(array('expr' => $expr), array(), $lineno, $tag); 23 | } 24 | 25 | /** 26 | * Compiles the node to PHP. 27 | * 28 | * @param Twig_Compiler A Twig_Compiler instance 29 | */ 30 | public function compile(Twig_Compiler $compiler) 31 | { 32 | $compiler 33 | ->addDebugInfo($this) 34 | ->write('echo ') 35 | ->subcompile($this->getNode('expr')) 36 | ->raw(";\n") 37 | ; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/AutoEscape.php: -------------------------------------------------------------------------------- 1 | 22 | */ 23 | class Twig_Node_AutoEscape extends Twig_Node 24 | { 25 | public function __construct($value, Twig_NodeInterface $body, $lineno, $tag = 'autoescape') 26 | { 27 | parent::__construct(array('body' => $body), array('value' => $value), $lineno, $tag); 28 | } 29 | 30 | /** 31 | * Compiles the node to PHP. 32 | * 33 | * @param Twig_Compiler A Twig_Compiler instance 34 | */ 35 | public function compile(Twig_Compiler $compiler) 36 | { 37 | $compiler->subcompile($this->getNode('body')); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/SimpleTest.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | class Twig_SimpleTest 18 | { 19 | protected $name; 20 | protected $callable; 21 | protected $options; 22 | 23 | public function __construct($name, $callable, array $options = array()) 24 | { 25 | $this->name = $name; 26 | $this->callable = $callable; 27 | $this->options = array_merge(array( 28 | 'node_class' => 'Twig_Node_Expression_Test', 29 | ), $options); 30 | } 31 | 32 | public function getName() 33 | { 34 | return $this->name; 35 | } 36 | 37 | public function getCallable() 38 | { 39 | return $this->callable; 40 | } 41 | 42 | public function getNodeClass() 43 | { 44 | return $this->options['node_class']; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 JohanBleuzen 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Function/Method.php: -------------------------------------------------------------------------------- 1 | 19 | * @deprecated since 1.12 (to be removed in 2.0) 20 | */ 21 | class Twig_Function_Method extends Twig_Function 22 | { 23 | protected $extension; 24 | protected $method; 25 | 26 | public function __construct(Twig_ExtensionInterface $extension, $method, array $options = array()) 27 | { 28 | $options['callable'] = array($extension, $method); 29 | 30 | parent::__construct($options); 31 | 32 | $this->extension = $extension; 33 | $this->method = $method; 34 | } 35 | 36 | public function compile() 37 | { 38 | return sprintf('$this->env->getExtension(\'%s\')->%s', $this->extension->getName(), $this->method); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /conf/config.php: -------------------------------------------------------------------------------- 1 | false, // To enable Twig caching change this to CACHE_DIR 12 | 'autoescape' => false, // Autoescape Twig vars 13 | 'debug' => false // Enable Twig debug 14 | ); 15 | $config['items_per_page'] = 15; 16 | 17 | // Un-comment to make your gallery private 18 | 19 | $config['private'] = true; 20 | $config['private_pass']['admin'] = 'd033e22ae348aeb5660fc2140aec35850c4da997'; 21 | 22 | // To add a custom config setting: 23 | 24 | $config['custom_setting'] = 'Hello'; // Can be accessed by {{ config.custom_setting }} in a theme 25 | 26 | */ 27 | 28 | $config['private'] = true; 29 | $config['private_pass']['admin'] = 'd033e22ae348aeb5660fc2140aec35850c4da997'; 30 | $config['private_pass']['toto'] = 'd033e22ae348aeb5660fc2140aec35850c4da997'; 31 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Spaceless.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | class Twig_Node_Spaceless extends Twig_Node 20 | { 21 | public function __construct(Twig_NodeInterface $body, $lineno, $tag = 'spaceless') 22 | { 23 | parent::__construct(array('body' => $body), array(), $lineno, $tag); 24 | } 25 | 26 | /** 27 | * Compiles the node to PHP. 28 | * 29 | * @param Twig_Compiler A Twig_Compiler instance 30 | */ 31 | public function compile(Twig_Compiler $compiler) 32 | { 33 | $compiler 34 | ->addDebugInfo($this) 35 | ->write("ob_start();\n") 36 | ->subcompile($this->getNode('body')) 37 | ->write("echo trim(preg_replace('/>\s+<', ob_get_clean()));\n") 38 | ; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/bramus/router/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Bram(us) Van Damme - http://www.bram.us/ 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TokenParserInterface.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | interface Twig_TokenParserInterface 18 | { 19 | /** 20 | * Sets the parser associated with this token parser 21 | * 22 | * @param $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 | * @param Twig_Token $token A Twig_Token instance 30 | * 31 | * @return Twig_NodeInterface A Twig_NodeInterface instance 32 | * 33 | * @throws Twig_Error_Syntax 34 | */ 35 | public function parse(Twig_Token $token); 36 | 37 | /** 38 | * Gets the tag name associated with this token parser. 39 | * 40 | * @return string The tag name 41 | */ 42 | public function getTag(); 43 | } 44 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TokenParser/Do.php: -------------------------------------------------------------------------------- 1 | parser->getExpressionParser()->parseExpression(); 27 | 28 | $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); 29 | 30 | return new Twig_Node_Do($expr, $token->getLine(), $this->getTag()); 31 | } 32 | 33 | /** 34 | * Gets the tag name associated with this token parser. 35 | * 36 | * @return string The tag name 37 | */ 38 | public function getTag() 39 | { 40 | return 'do'; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Test.php: -------------------------------------------------------------------------------- 1 | $node, 'arguments' => $arguments), array('name' => $name), $lineno); 16 | } 17 | 18 | public function compile(Twig_Compiler $compiler) 19 | { 20 | $name = $this->getAttribute('name'); 21 | $test = $compiler->getEnvironment()->getTest($name); 22 | 23 | $this->setAttribute('name', $name); 24 | $this->setAttribute('type', 'test'); 25 | $this->setAttribute('thing', $test); 26 | if ($test instanceof Twig_TestCallableInterface || $test instanceof Twig_SimpleTest) { 27 | $this->setAttribute('callable', $test->getCallable()); 28 | } 29 | 30 | $this->compileCallable($compiler); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Binary.php: -------------------------------------------------------------------------------- 1 | $left, 'right' => $right), array(), $lineno); 17 | } 18 | 19 | /** 20 | * Compiles the node to PHP. 21 | * 22 | * @param Twig_Compiler A Twig_Compiler instance 23 | */ 24 | public function compile(Twig_Compiler $compiler) 25 | { 26 | $compiler 27 | ->raw('(') 28 | ->subcompile($this->getNode('left')) 29 | ->raw(' ') 30 | ; 31 | $this->operator($compiler); 32 | $compiler 33 | ->raw(' ') 34 | ->subcompile($this->getNode('right')) 35 | ->raw(')') 36 | ; 37 | } 38 | 39 | abstract public function operator(Twig_Compiler $compiler); 40 | } 41 | -------------------------------------------------------------------------------- /www/themes/default/img/user.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | Slice 1 4 | Created with Sketch (http://www.bohemiancoding.com/sketch) 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /vendor/twig/twig/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "twig/twig", 3 | "type": "library", 4 | "description": "Twig, the flexible, fast, and secure template language for PHP", 5 | "keywords": ["templating"], 6 | "homepage": "http://twig.sensiolabs.org", 7 | "license": "BSD-3-Clause", 8 | "authors": [ 9 | { 10 | "name": "Fabien Potencier", 11 | "email": "fabien@symfony.com", 12 | "homepage": "http://fabien.potencier.org", 13 | "role": "Lead Developer" 14 | }, 15 | { 16 | "name": "Twig Team", 17 | "homepage": "https://github.com/fabpot/Twig/graphs/contributors", 18 | "role": "Contributors" 19 | }, 20 | { 21 | "name": "Armin Ronacher", 22 | "email": "armin.ronacher@active-4.com", 23 | "role": "Project Founder" 24 | } 25 | ], 26 | "support": { 27 | "forum": "https://groups.google.com/forum/#!forum/twig-users" 28 | }, 29 | "require": { 30 | "php": ">=5.2.4" 31 | }, 32 | "autoload": { 33 | "psr-0" : { 34 | "Twig_" : "lib/" 35 | } 36 | }, 37 | "extra": { 38 | "branch-alias": { 39 | "dev-master": "1.16-dev" 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Block.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | class Twig_Node_Block extends Twig_Node 19 | { 20 | public function __construct($name, Twig_NodeInterface $body, $lineno, $tag = null) 21 | { 22 | parent::__construct(array('body' => $body), array('name' => $name), $lineno, $tag); 23 | } 24 | 25 | /** 26 | * Compiles the node to PHP. 27 | * 28 | * @param Twig_Compiler A Twig_Compiler instance 29 | */ 30 | public function compile(Twig_Compiler $compiler) 31 | { 32 | $compiler 33 | ->addDebugInfo($this) 34 | ->write(sprintf("public function block_%s(\$context, array \$blocks = array())\n", $this->getAttribute('name')), "{\n") 35 | ->indent() 36 | ; 37 | 38 | $compiler 39 | ->subcompile($this->getNode('body')) 40 | ->outdent() 41 | ->write("}\n\n") 42 | ; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Embed.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | class Twig_Node_Embed extends Twig_Node_Include 18 | { 19 | // we don't inject the module to avoid node visitors to traverse it twice (as it will be already visited in the main module) 20 | public function __construct($filename, $index, Twig_Node_Expression $variables = null, $only = false, $ignoreMissing = false, $lineno, $tag = null) 21 | { 22 | parent::__construct(new Twig_Node_Expression_Constant('not_used', $lineno), $variables, $only, $ignoreMissing, $lineno, $tag); 23 | 24 | $this->setAttribute('filename', $filename); 25 | $this->setAttribute('index', $index); 26 | } 27 | 28 | protected function addGetTemplate(Twig_Compiler $compiler) 29 | { 30 | $compiler 31 | ->write("\$this->env->loadTemplate(") 32 | ->string($this->getAttribute('filename')) 33 | ->raw(', ') 34 | ->string($this->getAttribute('index')) 35 | ->raw(")") 36 | ; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php: -------------------------------------------------------------------------------- 1 | 16 | * {% if post.status is constant('Post::PUBLISHED') %} 17 | * the status attribute is exactly the same as Post::PUBLISHED 18 | * {% endif %} 19 | * 20 | * 21 | * @author Fabien Potencier 22 | */ 23 | class Twig_Node_Expression_Test_Constant extends Twig_Node_Expression_Test 24 | { 25 | public function compile(Twig_Compiler $compiler) 26 | { 27 | $compiler 28 | ->raw('(') 29 | ->subcompile($this->getNode('node')) 30 | ->raw(' === constant(') 31 | ; 32 | 33 | if ($this->getNode('arguments')->hasNode(1)) { 34 | $compiler 35 | ->raw('get_class(') 36 | ->subcompile($this->getNode('arguments')->getNode(1)) 37 | ->raw(')."::".') 38 | ; 39 | } 40 | 41 | $compiler 42 | ->subcompile($this->getNode('arguments')->getNode(0)) 43 | ->raw('))') 44 | ; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Autoloader.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | class Twig_Autoloader 18 | { 19 | /** 20 | * Registers Twig_Autoloader as an SPL autoloader. 21 | * 22 | * @param bool $prepend Whether to prepend the autoloader or not. 23 | */ 24 | public static function register($prepend = false) 25 | { 26 | if (version_compare(phpversion(), '5.3.0', '>=')) { 27 | spl_autoload_register(array(__CLASS__, 'autoload'), true, $prepend); 28 | } else { 29 | spl_autoload_register(array(__CLASS__, 'autoload')); 30 | } 31 | } 32 | 33 | /** 34 | * Handles autoloading of classes. 35 | * 36 | * @param string $class A class name. 37 | */ 38 | public static function autoload($class) 39 | { 40 | if (0 !== strpos($class, 'Twig')) { 41 | return; 42 | } 43 | 44 | if (is_file($file = dirname(__FILE__).'/../'.str_replace(array('_', "\0"), array('/', ''), $class).'.php')) { 45 | require $file; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php: -------------------------------------------------------------------------------- 1 | $node, 'arguments' => $arguments), array('method' => $method, 'safe' => false), $lineno); 16 | 17 | if ($node instanceof Twig_Node_Expression_Name) { 18 | $node->setAttribute('always_defined', true); 19 | } 20 | } 21 | 22 | public function compile(Twig_Compiler $compiler) 23 | { 24 | $compiler 25 | ->subcompile($this->getNode('node')) 26 | ->raw('->') 27 | ->raw($this->getAttribute('method')) 28 | ->raw('(') 29 | ; 30 | $first = true; 31 | foreach ($this->getNode('arguments')->getKeyValuePairs() as $pair) { 32 | if (!$first) { 33 | $compiler->raw(', '); 34 | } 35 | $first = false; 36 | 37 | $compiler->subcompile($pair['value']); 38 | } 39 | $compiler->raw(')'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Function.php: -------------------------------------------------------------------------------- 1 | $arguments), array('name' => $name), $lineno); 16 | } 17 | 18 | public function compile(Twig_Compiler $compiler) 19 | { 20 | $name = $this->getAttribute('name'); 21 | $function = $compiler->getEnvironment()->getFunction($name); 22 | 23 | $this->setAttribute('name', $name); 24 | $this->setAttribute('type', 'function'); 25 | $this->setAttribute('thing', $function); 26 | $this->setAttribute('needs_environment', $function->needsEnvironment()); 27 | $this->setAttribute('needs_context', $function->needsContext()); 28 | $this->setAttribute('arguments', $function->getArguments()); 29 | if ($function instanceof Twig_FunctionCallableInterface || $function instanceof Twig_SimpleFunction) { 30 | $this->setAttribute('callable', $function->getCallable()); 31 | } 32 | 33 | $this->compileCallable($compiler); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Parent.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | class Twig_Node_Expression_Parent extends Twig_Node_Expression 19 | { 20 | public function __construct($name, $lineno, $tag = null) 21 | { 22 | parent::__construct(array(), array('output' => false, 'name' => $name), $lineno, $tag); 23 | } 24 | 25 | /** 26 | * Compiles the node to PHP. 27 | * 28 | * @param Twig_Compiler A Twig_Compiler instance 29 | */ 30 | public function compile(Twig_Compiler $compiler) 31 | { 32 | if ($this->getAttribute('output')) { 33 | $compiler 34 | ->addDebugInfo($this) 35 | ->write("\$this->displayParentBlock(") 36 | ->string($this->getAttribute('name')) 37 | ->raw(", \$context, \$blocks);\n") 38 | ; 39 | } else { 40 | $compiler 41 | ->raw("\$this->renderParentBlock(") 42 | ->string($this->getAttribute('name')) 43 | ->raw(", \$context, \$blocks)") 44 | ; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /www/themes/default/template.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {% block title %}{% endblock %} - {{ site_title }} 9 | 10 | 11 | {% if view != "login" %} 12 |
13 |
14 |

{{ site_title }}

15 | {% if username != "" %} 16 | 20 | {% endif %} 21 |
22 |
23 | {% endif %} 24 | 25 |
26 | {% block content %}{% endblock %} 27 |
28 | 29 | {% if view != "login" %} 30 | 35 | {% endif %} 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /app/controllers/auth.php: -------------------------------------------------------------------------------- 1 | app->getConfig()['private'] === true) { 13 | // If already logged in will be redirectec to '/' 14 | if( ! isset($_SESSION['username']) || $_SESSION['username'] == "") { 15 | $this->app->renderView('login', array()); 16 | } 17 | } 18 | $this->app->redirect ('/'); 19 | } 20 | 21 | public function logout() { 22 | if(isset($_SESSION['username'])) { 23 | session_destroy(); 24 | $this->app->redirect('/login'); 25 | } else { 26 | $this->app->redirect('/'); 27 | } 28 | } 29 | 30 | public function authenticate() { 31 | global $config; 32 | 33 | $postUsername = $this->getPost('username'); 34 | $postPassword = $this->getPost('password'); 35 | if(isset($postUsername) && isset($postPassword)) { 36 | if(isset($this->app->getConfig()['private_pass'][$postUsername]) == true && $this->app->getConfig()['private_pass'][$postUsername] == sha1($postPassword)) { 37 | $_SESSION['username'] = $postUsername; 38 | $this->app->redirect('/'); 39 | } 40 | $view_vars['login_error'] = 'Invalid login'; 41 | $view_vars['login_username'] = $postUsername; 42 | 43 | $this->app->renderView('login', $view_vars); 44 | } 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Sandbox.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | class Twig_Node_Sandbox extends Twig_Node 18 | { 19 | public function __construct(Twig_NodeInterface $body, $lineno, $tag = null) 20 | { 21 | parent::__construct(array('body' => $body), array(), $lineno, $tag); 22 | } 23 | 24 | /** 25 | * Compiles the node to PHP. 26 | * 27 | * @param Twig_Compiler A Twig_Compiler instance 28 | */ 29 | public function compile(Twig_Compiler $compiler) 30 | { 31 | $compiler 32 | ->addDebugInfo($this) 33 | ->write("\$sandbox = \$this->env->getExtension('sandbox');\n") 34 | ->write("if (!\$alreadySandboxed = \$sandbox->isSandboxed()) {\n") 35 | ->indent() 36 | ->write("\$sandbox->enableSandbox();\n") 37 | ->outdent() 38 | ->write("}\n") 39 | ->subcompile($this->getNode('body')) 40 | ->write("if (!\$alreadySandboxed) {\n") 41 | ->indent() 42 | ->write("\$sandbox->disableSandbox();\n") 43 | ->outdent() 44 | ->write("}\n") 45 | ; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TemplateInterface.php: -------------------------------------------------------------------------------- 1 | 16 | * 17 | * @deprecated since 1.12 (to be removed in 3.0) 18 | */ 19 | interface Twig_TemplateInterface 20 | { 21 | const ANY_CALL = 'any'; 22 | const ARRAY_CALL = 'array'; 23 | const METHOD_CALL = 'method'; 24 | 25 | /** 26 | * Renders the template with the given context and returns it as string. 27 | * 28 | * @param array $context An array of parameters to pass to the template 29 | * 30 | * @return string The rendered template 31 | */ 32 | public function render(array $context); 33 | 34 | /** 35 | * Displays the template with the given context. 36 | * 37 | * @param array $context An array of parameters to pass to the template 38 | * @param array $blocks An array of blocks to pass to the template 39 | */ 40 | public function display(array $context, array $blocks = array()); 41 | 42 | /** 43 | * Returns the bound environment for this template. 44 | * 45 | * @return Twig_Environment The current environment 46 | */ 47 | public function getEnvironment(); 48 | } 49 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php: -------------------------------------------------------------------------------- 1 | 19 | * @deprecated since 1.12 (to be removed in 2.0) 20 | */ 21 | interface Twig_TokenParserBrokerInterface 22 | { 23 | /** 24 | * Gets a TokenParser suitable for a tag. 25 | * 26 | * @param string $tag A tag name 27 | * 28 | * @return null|Twig_TokenParserInterface A Twig_TokenParserInterface or null if no suitable TokenParser was found 29 | */ 30 | public function getTokenParser($tag); 31 | 32 | /** 33 | * Calls Twig_TokenParserInterface::setParser on all parsers the implementation knows of. 34 | * 35 | * @param Twig_ParserInterface $parser A Twig_ParserInterface interface 36 | */ 37 | public function setParser(Twig_ParserInterface $parser); 38 | 39 | /** 40 | * Gets the Twig_ParserInterface. 41 | * 42 | * @return null|Twig_ParserInterface A Twig_ParserInterface instance or null 43 | */ 44 | public function getParser(); 45 | } 46 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Import.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | class Twig_Node_Import extends Twig_Node 18 | { 19 | public function __construct(Twig_Node_Expression $expr, Twig_Node_Expression $var, $lineno, $tag = null) 20 | { 21 | parent::__construct(array('expr' => $expr, 'var' => $var), array(), $lineno, $tag); 22 | } 23 | 24 | /** 25 | * Compiles the node to PHP. 26 | * 27 | * @param Twig_Compiler A Twig_Compiler instance 28 | */ 29 | public function compile(Twig_Compiler $compiler) 30 | { 31 | $compiler 32 | ->addDebugInfo($this) 33 | ->write('') 34 | ->subcompile($this->getNode('var')) 35 | ->raw(' = ') 36 | ; 37 | 38 | if ($this->getNode('expr') instanceof Twig_Node_Expression_Name && '_self' === $this->getNode('expr')->getAttribute('name')) { 39 | $compiler->raw("\$this"); 40 | } else { 41 | $compiler 42 | ->raw('$this->env->loadTemplate(') 43 | ->subcompile($this->getNode('expr')) 44 | ->raw(")") 45 | ; 46 | } 47 | 48 | $compiler->raw(";\n"); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TokenParser/Import.php: -------------------------------------------------------------------------------- 1 | 16 | * {% import 'forms.html' as forms %} 17 | * 18 | */ 19 | class Twig_TokenParser_Import extends Twig_TokenParser 20 | { 21 | /** 22 | * Parses a token and returns a node. 23 | * 24 | * @param Twig_Token $token A Twig_Token instance 25 | * 26 | * @return Twig_NodeInterface A Twig_NodeInterface instance 27 | */ 28 | public function parse(Twig_Token $token) 29 | { 30 | $macro = $this->parser->getExpressionParser()->parseExpression(); 31 | $this->parser->getStream()->expect('as'); 32 | $var = new Twig_Node_Expression_AssignName($this->parser->getStream()->expect(Twig_Token::NAME_TYPE)->getValue(), $token->getLine()); 33 | $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); 34 | 35 | $this->parser->addImportedSymbol('template', $var->getAttribute('name')); 36 | 37 | return new Twig_Node_Import($macro, $var, $token->getLine(), $this->getTag()); 38 | } 39 | 40 | /** 41 | * Gets the tag name associated with this token parser. 42 | * 43 | * @return string The tag name 44 | */ 45 | public function getTag() 46 | { 47 | return 'import'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Filter.php: -------------------------------------------------------------------------------- 1 | $node, 'filter' => $filterName, 'arguments' => $arguments), array(), $lineno, $tag); 17 | } 18 | 19 | public function compile(Twig_Compiler $compiler) 20 | { 21 | $name = $this->getNode('filter')->getAttribute('value'); 22 | $filter = $compiler->getEnvironment()->getFilter($name); 23 | 24 | $this->setAttribute('name', $name); 25 | $this->setAttribute('type', 'filter'); 26 | $this->setAttribute('thing', $filter); 27 | $this->setAttribute('needs_environment', $filter->needsEnvironment()); 28 | $this->setAttribute('needs_context', $filter->needsContext()); 29 | $this->setAttribute('arguments', $filter->getArguments()); 30 | if ($filter instanceof Twig_FilterCallableInterface || $filter instanceof Twig_SimpleFilter) { 31 | $this->setAttribute('callable', $filter->getCallable()); 32 | } 33 | 34 | $this->compileCallable($compiler); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/NodeVisitorInterface.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | interface Twig_NodeVisitorInterface 18 | { 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); 28 | 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); 38 | 39 | /** 40 | * Returns the priority for this visitor. 41 | * 42 | * Priority should be between -10 and 10 (0 is the default). 43 | * 44 | * @return int The priority level 45 | */ 46 | public function getPriority(); 47 | } 48 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/LoaderInterface.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | interface Twig_LoaderInterface 18 | { 19 | /** 20 | * Gets the source code of a template, given its name. 21 | * 22 | * @param string $name The name of the template to load 23 | * 24 | * @return string The template source code 25 | * 26 | * @throws Twig_Error_Loader When $name is not found 27 | */ 28 | public function getSource($name); 29 | 30 | /** 31 | * Gets the cache key to use for the cache for a given template name. 32 | * 33 | * @param string $name The name of the template to load 34 | * 35 | * @return string The cache key 36 | * 37 | * @throws Twig_Error_Loader When $name is not found 38 | */ 39 | public function getCacheKey($name); 40 | 41 | /** 42 | * Returns true if the template is still fresh. 43 | * 44 | * @param string $name The template name 45 | * @param timestamp $time The last modification time of the cached template 46 | * 47 | * @return bool true if the template is fresh, false otherwise 48 | * 49 | * @throws Twig_Error_Loader When $name is not found 50 | */ 51 | public function isFresh($name, $time); 52 | } 53 | -------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | $path) { 31 | $loader->set($namespace, $path); 32 | } 33 | 34 | $map = require __DIR__ . '/autoload_psr4.php'; 35 | foreach ($map as $namespace => $path) { 36 | $loader->setPsr4($namespace, $path); 37 | } 38 | 39 | $classMap = require __DIR__ . '/autoload_classmap.php'; 40 | if ($classMap) { 41 | $loader->addClassMap($classMap); 42 | } 43 | 44 | $loader->register(true); 45 | 46 | return $loader; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TokenParser/Extends.php: -------------------------------------------------------------------------------- 1 | 17 | * {% extends "base.html" %} 18 | * 19 | */ 20 | class Twig_TokenParser_Extends extends Twig_TokenParser 21 | { 22 | /** 23 | * Parses a token and returns a node. 24 | * 25 | * @param Twig_Token $token A Twig_Token instance 26 | * 27 | * @return Twig_NodeInterface A Twig_NodeInterface instance 28 | */ 29 | public function parse(Twig_Token $token) 30 | { 31 | if (!$this->parser->isMainScope()) { 32 | throw new Twig_Error_Syntax('Cannot extend from a block', $token->getLine(), $this->parser->getFilename()); 33 | } 34 | 35 | if (null !== $this->parser->getParent()) { 36 | throw new Twig_Error_Syntax('Multiple extends tags are forbidden', $token->getLine(), $this->parser->getFilename()); 37 | } 38 | $this->parser->setParent($this->parser->getExpressionParser()->parseExpression()); 39 | 40 | $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); 41 | } 42 | 43 | /** 44 | * Gets the tag name associated with this token parser. 45 | * 46 | * @return string The tag name 47 | */ 48 | public function getTag() 49 | { 50 | return 'extends'; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Loader/String.php: -------------------------------------------------------------------------------- 1 | 25 | */ 26 | class Twig_Loader_String implements Twig_LoaderInterface, Twig_ExistsLoaderInterface 27 | { 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function getSource($name) 32 | { 33 | return $name; 34 | } 35 | 36 | /** 37 | * {@inheritdoc} 38 | */ 39 | public function exists($name) 40 | { 41 | return true; 42 | } 43 | 44 | /** 45 | * {@inheritdoc} 46 | */ 47 | public function getCacheKey($name) 48 | { 49 | return $name; 50 | } 51 | 52 | /** 53 | * {@inheritdoc} 54 | */ 55 | public function isFresh($name, $time) 56 | { 57 | return true; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /vendor/twig/twig/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2014 by the Twig Team. 2 | 3 | Some rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above 13 | copyright notice, this list of conditions and the following 14 | disclaimer in the documentation and/or other materials provided 15 | with the distribution. 16 | 17 | * The names of the contributors may not be used to endorse or 18 | promote products derived from this software without specific 19 | prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | class Twig_Node_Expression_BlockReference extends Twig_Node_Expression 19 | { 20 | public function __construct(Twig_NodeInterface $name, $asString = false, $lineno, $tag = null) 21 | { 22 | parent::__construct(array('name' => $name), array('as_string' => $asString, 'output' => false), $lineno, $tag); 23 | } 24 | 25 | /** 26 | * Compiles the node to PHP. 27 | * 28 | * @param Twig_Compiler A Twig_Compiler instance 29 | */ 30 | public function compile(Twig_Compiler $compiler) 31 | { 32 | if ($this->getAttribute('as_string')) { 33 | $compiler->raw('(string) '); 34 | } 35 | 36 | if ($this->getAttribute('output')) { 37 | $compiler 38 | ->addDebugInfo($this) 39 | ->write("\$this->displayBlock(") 40 | ->subcompile($this->getNode('name')) 41 | ->raw(", \$context, \$blocks);\n") 42 | ; 43 | } else { 44 | $compiler 45 | ->raw("\$this->renderBlock(") 46 | ->subcompile($this->getNode('name')) 47 | ->raw(", \$context, \$blocks)") 48 | ; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php: -------------------------------------------------------------------------------- 1 | 16 | * {% spaceless %} 17 | *
18 | * foo 19 | *
20 | * {% endspaceless %} 21 | * 22 | * {# output will be
foo
#} 23 | * 24 | */ 25 | class Twig_TokenParser_Spaceless extends Twig_TokenParser 26 | { 27 | /** 28 | * Parses a token and returns a node. 29 | * 30 | * @param Twig_Token $token A Twig_Token instance 31 | * 32 | * @return Twig_NodeInterface A Twig_NodeInterface instance 33 | */ 34 | public function parse(Twig_Token $token) 35 | { 36 | $lineno = $token->getLine(); 37 | 38 | $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); 39 | $body = $this->parser->subparse(array($this, 'decideSpacelessEnd'), true); 40 | $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); 41 | 42 | return new Twig_Node_Spaceless($body, $lineno, $this->getTag()); 43 | } 44 | 45 | public function decideSpacelessEnd(Twig_Token $token) 46 | { 47 | return $token->test('endspaceless'); 48 | } 49 | 50 | /** 51 | * Gets the tag name associated with this token parser. 52 | * 53 | * @return string The tag name 54 | */ 55 | public function getTag() 56 | { 57 | return 'spaceless'; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Extension/StringLoader.php: -------------------------------------------------------------------------------- 1 | true)), 20 | ); 21 | } 22 | 23 | /** 24 | * {@inheritdoc} 25 | */ 26 | public function getName() 27 | { 28 | return 'string_loader'; 29 | } 30 | } 31 | 32 | /** 33 | * Loads a template from a string. 34 | * 35 | *
36 |  * {{ include(template_from_string("Hello {{ name }}")) }}
37 |  * 
38 | * 39 | * @param Twig_Environment $env A Twig_Environment instance 40 | * @param string $template A template as a string 41 | * 42 | * @return Twig_Template A Twig_Template instance 43 | */ 44 | function twig_template_from_string(Twig_Environment $env, $template) 45 | { 46 | $name = sprintf('__string_template__%s', hash('sha256', uniqid(mt_rand(), true), false)); 47 | 48 | $loader = new Twig_Loader_Chain(array( 49 | new Twig_Loader_Array(array($name => $template)), 50 | $current = $env->getLoader(), 51 | )); 52 | 53 | $env->setLoader($loader); 54 | try { 55 | $template = $env->loadTemplate($name); 56 | } catch (Exception $e) { 57 | $env->setLoader($current); 58 | 59 | throw $e; 60 | } 61 | $env->setLoader($current); 62 | 63 | return $template; 64 | } 65 | -------------------------------------------------------------------------------- /www/index.php: -------------------------------------------------------------------------------- 1 | before('GET|POST', '/.*', function() use ($app) { 16 | global $config; 17 | 18 | if ($config['private'] == true && !isset($_SESSION['username']) && ! preg_match("@/login@", $_SERVER["REQUEST_URI"])) { 19 | $app->redirect('/login'); 20 | } 21 | }); 22 | 23 | $router->get('/login', function() use ($app) { 24 | $controller = new \App\Controllers\Auth($app); 25 | $controller->login(); 26 | }); 27 | 28 | $router->post('/login', function() use ($app) { 29 | $controller = new \App\Controllers\Auth($app); 30 | $controller->authenticate(); 31 | }); 32 | 33 | $router->get('/logout', function() use ($app) { 34 | $controller = new \App\Controllers\Auth($app); 35 | $controller->logout(); 36 | }); 37 | 38 | $router->get('/thumbnail/(\d+)x(\d+)/(.*)', function($width, $height, $path) use ($app) { 39 | $controller = new \App\Controllers\Thumbnail($app, $width, $height, $path); 40 | $controller->serve(); 41 | }); 42 | 43 | $router->get('/(.*)\.(.*)$', function($path, $extension) use ($app) { 44 | $controller = new \App\Controllers\Picturo($app); 45 | $controller->displayPicture($path, $extension); 46 | }); 47 | 48 | $router->get('/(.*)/page([0-9]*)', function($path, $page = 1) use ($app) { 49 | $controller = new \App\Controllers\Picturo($app); 50 | $controller->displayFolder($path, $page); 51 | }); 52 | 53 | $router->get('/(.*)', function($path) use ($app) { 54 | $controller = new \App\Controllers\Picturo($app); 55 | $controller->displayFolder($path, 1); 56 | }); 57 | 58 | $router->run(); 59 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php: -------------------------------------------------------------------------------- 1 | 16 | * {{ var.foo|default('foo item on var is not defined') }} 17 | * 18 | * 19 | * @author Fabien Potencier 20 | */ 21 | class Twig_Node_Expression_Filter_Default extends Twig_Node_Expression_Filter 22 | { 23 | public function __construct(Twig_NodeInterface $node, Twig_Node_Expression_Constant $filterName, Twig_NodeInterface $arguments, $lineno, $tag = null) 24 | { 25 | $default = new Twig_Node_Expression_Filter($node, new Twig_Node_Expression_Constant('default', $node->getLine()), $arguments, $node->getLine()); 26 | 27 | if ('default' === $filterName->getAttribute('value') && ($node instanceof Twig_Node_Expression_Name || $node instanceof Twig_Node_Expression_GetAttr)) { 28 | $test = new Twig_Node_Expression_Test_Defined(clone $node, 'defined', new Twig_Node(), $node->getLine()); 29 | $false = count($arguments) ? $arguments->getNode(0) : new Twig_Node_Expression_Constant('', $node->getLine()); 30 | 31 | $node = new Twig_Node_Expression_Conditional($test, $default, $false, $node->getLine()); 32 | } else { 33 | $node = $default; 34 | } 35 | 36 | parent::__construct($node, $filterName, $arguments, $lineno, $tag); 37 | } 38 | 39 | public function compile(Twig_Compiler $compiler) 40 | { 41 | $compiler->subcompile($this->getNode('node')); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Test/NodeTestCase.php: -------------------------------------------------------------------------------- 1 | assertNodeCompilation($source, $node, $environment); 21 | } 22 | 23 | public function assertNodeCompilation($source, Twig_Node $node, Twig_Environment $environment = null) 24 | { 25 | $compiler = $this->getCompiler($environment); 26 | $compiler->compile($node); 27 | 28 | $this->assertEquals($source, trim($compiler->getSource())); 29 | } 30 | 31 | protected function getCompiler(Twig_Environment $environment = null) 32 | { 33 | return new Twig_Compiler(null === $environment ? $this->getEnvironment() : $environment); 34 | } 35 | 36 | protected function getEnvironment() 37 | { 38 | return new Twig_Environment(); 39 | } 40 | 41 | protected function getVariableGetter($name) 42 | { 43 | if (version_compare(phpversion(), '5.4.0RC1', '>=')) { 44 | return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name); 45 | } 46 | 47 | return sprintf('$this->getContext($context, "%s")', $name); 48 | } 49 | 50 | protected function getAttributeGetter() 51 | { 52 | if (function_exists('twig_template_get_attributes')) { 53 | return 'twig_template_get_attributes($this, '; 54 | } 55 | 56 | return '$this->getAttribute('; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php: -------------------------------------------------------------------------------- 1 | 16 | * {# defined works with variable names and variable attributes #} 17 | * {% if foo is defined %} 18 | * {# ... #} 19 | * {% endif %} 20 | * 21 | * 22 | * @author Fabien Potencier 23 | */ 24 | class Twig_Node_Expression_Test_Defined extends Twig_Node_Expression_Test 25 | { 26 | public function __construct(Twig_NodeInterface $node, $name, Twig_NodeInterface $arguments = null, $lineno) 27 | { 28 | parent::__construct($node, $name, $arguments, $lineno); 29 | 30 | if ($node instanceof Twig_Node_Expression_Name) { 31 | $node->setAttribute('is_defined_test', true); 32 | } elseif ($node instanceof Twig_Node_Expression_GetAttr) { 33 | $node->setAttribute('is_defined_test', true); 34 | 35 | $this->changeIgnoreStrictCheck($node); 36 | } else { 37 | throw new Twig_Error_Syntax('The "defined" test only works with simple variables', $this->getLine()); 38 | } 39 | } 40 | 41 | protected function changeIgnoreStrictCheck(Twig_Node_Expression_GetAttr $node) 42 | { 43 | $node->setAttribute('ignore_strict_check', true); 44 | 45 | if ($node->getNode('node') instanceof Twig_Node_Expression_GetAttr) { 46 | $this->changeIgnoreStrictCheck($node->getNode('node')); 47 | } 48 | } 49 | 50 | public function compile(Twig_Compiler $compiler) 51 | { 52 | $compiler->subcompile($this->getNode('node')); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/ForLoop.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | class Twig_Node_ForLoop extends Twig_Node 18 | { 19 | public function __construct($lineno, $tag = null) 20 | { 21 | parent::__construct(array(), array('with_loop' => false, 'ifexpr' => false, 'else' => false), $lineno, $tag); 22 | } 23 | 24 | /** 25 | * Compiles the node to PHP. 26 | * 27 | * @param Twig_Compiler A Twig_Compiler instance 28 | */ 29 | public function compile(Twig_Compiler $compiler) 30 | { 31 | if ($this->getAttribute('else')) { 32 | $compiler->write("\$context['_iterated'] = true;\n"); 33 | } 34 | 35 | if ($this->getAttribute('with_loop')) { 36 | $compiler 37 | ->write("++\$context['loop']['index0'];\n") 38 | ->write("++\$context['loop']['index'];\n") 39 | ->write("\$context['loop']['first'] = false;\n") 40 | ; 41 | 42 | if (!$this->getAttribute('ifexpr')) { 43 | $compiler 44 | ->write("if (isset(\$context['loop']['length'])) {\n") 45 | ->indent() 46 | ->write("--\$context['loop']['revindex0'];\n") 47 | ->write("--\$context['loop']['revindex'];\n") 48 | ->write("\$context['loop']['last'] = 0 === \$context['loop']['revindex0'];\n") 49 | ->outdent() 50 | ->write("}\n") 51 | ; 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php: -------------------------------------------------------------------------------- 1 | 21 | */ 22 | class Twig_Node_SandboxedPrint extends Twig_Node_Print 23 | { 24 | public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null) 25 | { 26 | parent::__construct($expr, $lineno, $tag); 27 | } 28 | 29 | /** 30 | * Compiles the node to PHP. 31 | * 32 | * @param Twig_Compiler A Twig_Compiler instance 33 | */ 34 | public function compile(Twig_Compiler $compiler) 35 | { 36 | $compiler 37 | ->addDebugInfo($this) 38 | ->write('echo $this->env->getExtension(\'sandbox\')->ensureToStringAllowed(') 39 | ->subcompile($this->getNode('expr')) 40 | ->raw(");\n") 41 | ; 42 | } 43 | 44 | /** 45 | * Removes node filters. 46 | * 47 | * This is mostly needed when another visitor adds filters (like the escaper one). 48 | * 49 | * @param Twig_Node $node A Node 50 | */ 51 | protected function removeNodeFilter($node) 52 | { 53 | if ($node instanceof Twig_Node_Expression_Filter) { 54 | return $this->removeNodeFilter($node->getNode('node')); 55 | } 56 | 57 | return $node; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /www/themes/default/gallery.html: -------------------------------------------------------------------------------- 1 | {% extends "template.twig" %} 2 | 3 | {% block title %}Gallery{% endblock %} 4 | 5 | {% block bodyClass %}gallery{% endblock %} 6 | 7 | {% block content %} 8 |
9 |
10 | {%if breadcrumb %} 11 | 21 | {% endif %} 22 | {% if folders %} 23 |
24 | {% for folder in folders%} 25 | 31 | {% endfor %} 32 |
33 | {% endif %} 34 |
35 | {% for image in images %} 36 | 41 | {% endfor %} 42 |
43 | 44 | {% if page_count > 1 %} 45 |
    46 | {% for i in 1..page_count %} 47 | {% if current_page + 1 == i %} 48 |
  • {{ i }}
  • 49 | {% else %} 50 | {% if i == 1 %} 51 |
  • {{ i }}
  • 52 | {% else %} 53 |
  • {{ i }}
  • 54 | {% endif %} 55 | {% endif %} 56 | {% endfor %} 57 |
58 | {% endif %} 59 |
60 |
61 | 62 | {% endblock %} 63 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Function.php: -------------------------------------------------------------------------------- 1 | 18 | * @deprecated since 1.12 (to be removed in 2.0) 19 | */ 20 | abstract class Twig_Function implements Twig_FunctionInterface, Twig_FunctionCallableInterface 21 | { 22 | protected $options; 23 | protected $arguments = array(); 24 | 25 | public function __construct(array $options = array()) 26 | { 27 | $this->options = array_merge(array( 28 | 'needs_environment' => false, 29 | 'needs_context' => false, 30 | 'callable' => null, 31 | ), $options); 32 | } 33 | 34 | public function setArguments($arguments) 35 | { 36 | $this->arguments = $arguments; 37 | } 38 | 39 | public function getArguments() 40 | { 41 | return $this->arguments; 42 | } 43 | 44 | public function needsEnvironment() 45 | { 46 | return $this->options['needs_environment']; 47 | } 48 | 49 | public function needsContext() 50 | { 51 | return $this->options['needs_context']; 52 | } 53 | 54 | public function getSafe(Twig_Node $functionArgs) 55 | { 56 | if (isset($this->options['is_safe'])) { 57 | return $this->options['is_safe']; 58 | } 59 | 60 | if (isset($this->options['is_safe_callback'])) { 61 | return call_user_func($this->options['is_safe_callback'], $functionArgs); 62 | } 63 | 64 | return array(); 65 | } 66 | 67 | public function getCallable() 68 | { 69 | return $this->options['callable']; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TokenParser/Filter.php: -------------------------------------------------------------------------------- 1 | 16 | * {% filter upper %} 17 | * This text becomes uppercase 18 | * {% endfilter %} 19 | * 20 | */ 21 | class Twig_TokenParser_Filter extends Twig_TokenParser 22 | { 23 | /** 24 | * Parses a token and returns a node. 25 | * 26 | * @param Twig_Token $token A Twig_Token instance 27 | * 28 | * @return Twig_NodeInterface A Twig_NodeInterface instance 29 | */ 30 | public function parse(Twig_Token $token) 31 | { 32 | $name = $this->parser->getVarName(); 33 | $ref = new Twig_Node_Expression_BlockReference(new Twig_Node_Expression_Constant($name, $token->getLine()), true, $token->getLine(), $this->getTag()); 34 | 35 | $filter = $this->parser->getExpressionParser()->parseFilterExpressionRaw($ref, $this->getTag()); 36 | $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); 37 | 38 | $body = $this->parser->subparse(array($this, 'decideBlockEnd'), true); 39 | $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); 40 | 41 | $block = new Twig_Node_Block($name, $body, $token->getLine()); 42 | $this->parser->setBlock($name, $block); 43 | 44 | return new Twig_Node_Print($filter, $token->getLine(), $this->getTag()); 45 | } 46 | 47 | public function decideBlockEnd(Twig_Token $token) 48 | { 49 | return $token->test('endfilter'); 50 | } 51 | 52 | /** 53 | * Gets the tag name associated with this token parser. 54 | * 55 | * @return string The tag name 56 | */ 57 | public function getTag() 58 | { 59 | return 'filter'; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/If.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | class Twig_Node_If extends Twig_Node 19 | { 20 | public function __construct(Twig_NodeInterface $tests, Twig_NodeInterface $else = null, $lineno, $tag = null) 21 | { 22 | parent::__construct(array('tests' => $tests, 'else' => $else), array(), $lineno, $tag); 23 | } 24 | 25 | /** 26 | * Compiles the node to PHP. 27 | * 28 | * @param Twig_Compiler A Twig_Compiler instance 29 | */ 30 | public function compile(Twig_Compiler $compiler) 31 | { 32 | $compiler->addDebugInfo($this); 33 | for ($i = 0, $count = count($this->getNode('tests')); $i < $count; $i += 2) { 34 | if ($i > 0) { 35 | $compiler 36 | ->outdent() 37 | ->write("} elseif (") 38 | ; 39 | } else { 40 | $compiler 41 | ->write('if (') 42 | ; 43 | } 44 | 45 | $compiler 46 | ->subcompile($this->getNode('tests')->getNode($i)) 47 | ->raw(") {\n") 48 | ->indent() 49 | ->subcompile($this->getNode('tests')->getNode($i + 1)) 50 | ; 51 | } 52 | 53 | if ($this->hasNode('else') && null !== $this->getNode('else')) { 54 | $compiler 55 | ->outdent() 56 | ->write("} else {\n") 57 | ->indent() 58 | ->subcompile($this->getNode('else')) 59 | ; 60 | } 61 | 62 | $compiler 63 | ->outdent() 64 | ->write("}\n"); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TokenParser/From.php: -------------------------------------------------------------------------------- 1 | 16 | * {% from 'forms.html' import forms %} 17 | * 18 | */ 19 | class Twig_TokenParser_From extends Twig_TokenParser 20 | { 21 | /** 22 | * Parses a token and returns a node. 23 | * 24 | * @param Twig_Token $token A Twig_Token instance 25 | * 26 | * @return Twig_NodeInterface A Twig_NodeInterface instance 27 | */ 28 | public function parse(Twig_Token $token) 29 | { 30 | $macro = $this->parser->getExpressionParser()->parseExpression(); 31 | $stream = $this->parser->getStream(); 32 | $stream->expect('import'); 33 | 34 | $targets = array(); 35 | do { 36 | $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); 37 | 38 | $alias = $name; 39 | if ($stream->nextIf('as')) { 40 | $alias = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); 41 | } 42 | 43 | $targets[$name] = $alias; 44 | 45 | if (!$stream->nextIf(Twig_Token::PUNCTUATION_TYPE, ',')) { 46 | break; 47 | } 48 | } while (true); 49 | 50 | $stream->expect(Twig_Token::BLOCK_END_TYPE); 51 | 52 | $node = new Twig_Node_Import($macro, new Twig_Node_Expression_AssignName($this->parser->getVarName(), $token->getLine()), $token->getLine(), $this->getTag()); 53 | 54 | foreach ($targets as $name => $alias) { 55 | $this->parser->addImportedSymbol('function', $alias, 'get'.$name, $node->getNode('var')); 56 | } 57 | 58 | return $node; 59 | } 60 | 61 | /** 62 | * Gets the tag name associated with this token parser. 63 | * 64 | * @return string The tag name 65 | */ 66 | public function getTag() 67 | { 68 | return 'from'; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TokenParser/Include.php: -------------------------------------------------------------------------------- 1 | 17 | * {% include 'header.html' %} 18 | * Body 19 | * {% include 'footer.html' %} 20 | * 21 | */ 22 | class Twig_TokenParser_Include extends Twig_TokenParser 23 | { 24 | /** 25 | * Parses a token and returns a node. 26 | * 27 | * @param Twig_Token $token A Twig_Token instance 28 | * 29 | * @return Twig_NodeInterface A Twig_NodeInterface instance 30 | */ 31 | public function parse(Twig_Token $token) 32 | { 33 | $expr = $this->parser->getExpressionParser()->parseExpression(); 34 | 35 | list($variables, $only, $ignoreMissing) = $this->parseArguments(); 36 | 37 | return new Twig_Node_Include($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag()); 38 | } 39 | 40 | protected function parseArguments() 41 | { 42 | $stream = $this->parser->getStream(); 43 | 44 | $ignoreMissing = false; 45 | if ($stream->nextIf(Twig_Token::NAME_TYPE, 'ignore')) { 46 | $stream->expect(Twig_Token::NAME_TYPE, 'missing'); 47 | 48 | $ignoreMissing = true; 49 | } 50 | 51 | $variables = null; 52 | if ($stream->nextIf(Twig_Token::NAME_TYPE, 'with')) { 53 | $variables = $this->parser->getExpressionParser()->parseExpression(); 54 | } 55 | 56 | $only = false; 57 | if ($stream->nextIf(Twig_Token::NAME_TYPE, 'only')) { 58 | $only = true; 59 | } 60 | 61 | $stream->expect(Twig_Token::BLOCK_END_TYPE); 62 | 63 | return array($variables, $only, $ignoreMissing); 64 | } 65 | 66 | /** 67 | * Gets the tag name associated with this token parser. 68 | * 69 | * @return string The tag name 70 | */ 71 | public function getTag() 72 | { 73 | return 'include'; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Filter.php: -------------------------------------------------------------------------------- 1 | 18 | * @deprecated since 1.12 (to be removed in 2.0) 19 | */ 20 | abstract class Twig_Filter implements Twig_FilterInterface, Twig_FilterCallableInterface 21 | { 22 | protected $options; 23 | protected $arguments = array(); 24 | 25 | public function __construct(array $options = array()) 26 | { 27 | $this->options = array_merge(array( 28 | 'needs_environment' => false, 29 | 'needs_context' => false, 30 | 'pre_escape' => null, 31 | 'preserves_safety' => null, 32 | 'callable' => null, 33 | ), $options); 34 | } 35 | 36 | public function setArguments($arguments) 37 | { 38 | $this->arguments = $arguments; 39 | } 40 | 41 | public function getArguments() 42 | { 43 | return $this->arguments; 44 | } 45 | 46 | public function needsEnvironment() 47 | { 48 | return $this->options['needs_environment']; 49 | } 50 | 51 | public function needsContext() 52 | { 53 | return $this->options['needs_context']; 54 | } 55 | 56 | public function getSafe(Twig_Node $filterArgs) 57 | { 58 | if (isset($this->options['is_safe'])) { 59 | return $this->options['is_safe']; 60 | } 61 | 62 | if (isset($this->options['is_safe_callback'])) { 63 | return call_user_func($this->options['is_safe_callback'], $filterArgs); 64 | } 65 | } 66 | 67 | public function getPreservesSafety() 68 | { 69 | return $this->options['preserves_safety']; 70 | } 71 | 72 | public function getPreEscape() 73 | { 74 | return $this->options['pre_escape']; 75 | } 76 | 77 | public function getCallable() 78 | { 79 | return $this->options['callable']; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TokenParser/Embed.php: -------------------------------------------------------------------------------- 1 | parser->getStream(); 27 | 28 | $parent = $this->parser->getExpressionParser()->parseExpression(); 29 | 30 | list($variables, $only, $ignoreMissing) = $this->parseArguments(); 31 | 32 | // inject a fake parent to make the parent() function work 33 | $stream->injectTokens(array( 34 | new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', $token->getLine()), 35 | new Twig_Token(Twig_Token::NAME_TYPE, 'extends', $token->getLine()), 36 | new Twig_Token(Twig_Token::STRING_TYPE, '__parent__', $token->getLine()), 37 | new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', $token->getLine()), 38 | )); 39 | 40 | $module = $this->parser->parse($stream, array($this, 'decideBlockEnd'), true); 41 | 42 | // override the parent with the correct one 43 | $module->setNode('parent', $parent); 44 | 45 | $this->parser->embedTemplate($module); 46 | 47 | $stream->expect(Twig_Token::BLOCK_END_TYPE); 48 | 49 | return new Twig_Node_Embed($module->getAttribute('filename'), $module->getAttribute('index'), $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag()); 50 | } 51 | 52 | public function decideBlockEnd(Twig_Token $token) 53 | { 54 | return $token->test('endembed'); 55 | } 56 | 57 | /** 58 | * Gets the tag name associated with this token parser. 59 | * 60 | * @return string The tag name 61 | */ 62 | public function getTag() 63 | { 64 | return 'embed'; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/SimpleFunction.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | class Twig_SimpleFunction 18 | { 19 | protected $name; 20 | protected $callable; 21 | protected $options; 22 | protected $arguments = array(); 23 | 24 | public function __construct($name, $callable, array $options = array()) 25 | { 26 | $this->name = $name; 27 | $this->callable = $callable; 28 | $this->options = array_merge(array( 29 | 'needs_environment' => false, 30 | 'needs_context' => false, 31 | 'is_safe' => null, 32 | 'is_safe_callback' => null, 33 | 'node_class' => 'Twig_Node_Expression_Function', 34 | ), $options); 35 | } 36 | 37 | public function getName() 38 | { 39 | return $this->name; 40 | } 41 | 42 | public function getCallable() 43 | { 44 | return $this->callable; 45 | } 46 | 47 | public function getNodeClass() 48 | { 49 | return $this->options['node_class']; 50 | } 51 | 52 | public function setArguments($arguments) 53 | { 54 | $this->arguments = $arguments; 55 | } 56 | 57 | public function getArguments() 58 | { 59 | return $this->arguments; 60 | } 61 | 62 | public function needsEnvironment() 63 | { 64 | return $this->options['needs_environment']; 65 | } 66 | 67 | public function needsContext() 68 | { 69 | return $this->options['needs_context']; 70 | } 71 | 72 | public function getSafe(Twig_Node $functionArgs) 73 | { 74 | if (null !== $this->options['is_safe']) { 75 | return $this->options['is_safe']; 76 | } 77 | 78 | if (null !== $this->options['is_safe_callback']) { 79 | return call_user_func($this->options['is_safe_callback'], $functionArgs); 80 | } 81 | 82 | return array(); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php: -------------------------------------------------------------------------------- 1 | 16 | * {% sandbox %} 17 | * {% include 'user.html' %} 18 | * {% endsandbox %} 19 | * 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 | { 25 | /** 26 | * Parses a token and returns a node. 27 | * 28 | * @param Twig_Token $token A Twig_Token instance 29 | * 30 | * @return Twig_NodeInterface A Twig_NodeInterface instance 31 | */ 32 | public function parse(Twig_Token $token) 33 | { 34 | $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); 35 | $body = $this->parser->subparse(array($this, 'decideBlockEnd'), true); 36 | $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); 37 | 38 | // in a sandbox tag, only include tags are allowed 39 | if (!$body instanceof Twig_Node_Include) { 40 | foreach ($body as $node) { 41 | if ($node instanceof Twig_Node_Text && ctype_space($node->getAttribute('data'))) { 42 | continue; 43 | } 44 | 45 | if (!$node instanceof Twig_Node_Include) { 46 | throw new Twig_Error_Syntax('Only "include" tags are allowed within a "sandbox" section', $node->getLine(), $this->parser->getFilename()); 47 | } 48 | } 49 | } 50 | 51 | return new Twig_Node_Sandbox($body, $token->getLine(), $this->getTag()); 52 | } 53 | 54 | public function decideBlockEnd(Twig_Token $token) 55 | { 56 | return $token->test('endsandbox'); 57 | } 58 | 59 | /** 60 | * Gets the tag name associated with this token parser. 61 | * 62 | * @return string The tag name 63 | */ 64 | public function getTag() 65 | { 66 | return 'sandbox'; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/SandboxedModule.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | class Twig_Node_SandboxedModule extends Twig_Node_Module 19 | { 20 | protected $usedFilters; 21 | protected $usedTags; 22 | protected $usedFunctions; 23 | 24 | public function __construct(Twig_Node_Module $node, array $usedFilters, array $usedTags, array $usedFunctions) 25 | { 26 | parent::__construct($node->getNode('body'), $node->getNode('parent'), $node->getNode('blocks'), $node->getNode('macros'), $node->getNode('traits'), $node->getAttribute('embedded_templates'), $node->getAttribute('filename')); 27 | 28 | $this->setAttribute('index', $node->getAttribute('index')); 29 | 30 | $this->usedFilters = $usedFilters; 31 | $this->usedTags = $usedTags; 32 | $this->usedFunctions = $usedFunctions; 33 | } 34 | 35 | protected function compileDisplayBody(Twig_Compiler $compiler) 36 | { 37 | $compiler->write("\$this->checkSecurity();\n"); 38 | 39 | parent::compileDisplayBody($compiler); 40 | } 41 | 42 | protected function compileDisplayFooter(Twig_Compiler $compiler) 43 | { 44 | parent::compileDisplayFooter($compiler); 45 | 46 | $compiler 47 | ->write("protected function checkSecurity()\n", "{\n") 48 | ->indent() 49 | ->write("\$this->env->getExtension('sandbox')->checkSecurity(\n") 50 | ->indent() 51 | ->write(!$this->usedTags ? "array(),\n" : "array('".implode('\', \'', $this->usedTags)."'),\n") 52 | ->write(!$this->usedFilters ? "array(),\n" : "array('".implode('\', \'', $this->usedFilters)."'),\n") 53 | ->write(!$this->usedFunctions ? "array()\n" : "array('".implode('\', \'', $this->usedFunctions)."')\n") 54 | ->outdent() 55 | ->write(");\n") 56 | ->outdent() 57 | ->write("}\n\n") 58 | ; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Extension/Debug.php: -------------------------------------------------------------------------------- 1 | $isDumpOutputHtmlSafe ? array('html') : array(), 'needs_context' => true, 'needs_environment' => true)), 32 | ); 33 | } 34 | 35 | /** 36 | * Returns the name of the extension. 37 | * 38 | * @return string The extension name 39 | */ 40 | public function getName() 41 | { 42 | return 'debug'; 43 | } 44 | } 45 | 46 | function twig_var_dump(Twig_Environment $env, $context) 47 | { 48 | if (!$env->isDebug()) { 49 | return; 50 | } 51 | 52 | ob_start(); 53 | 54 | $count = func_num_args(); 55 | if (2 === $count) { 56 | $vars = array(); 57 | foreach ($context as $key => $value) { 58 | if (!$value instanceof Twig_Template) { 59 | $vars[$key] = $value; 60 | } 61 | } 62 | 63 | var_dump($vars); 64 | } else { 65 | for ($i = 2; $i < $count; $i++) { 66 | var_dump(func_get_arg($i)); 67 | } 68 | } 69 | 70 | return ob_get_clean(); 71 | } 72 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TokenParser/Macro.php: -------------------------------------------------------------------------------- 1 | 16 | * {% macro input(name, value, type, size) %} 17 | * 18 | * {% endmacro %} 19 | * 20 | */ 21 | class Twig_TokenParser_Macro extends Twig_TokenParser 22 | { 23 | /** 24 | * Parses a token and returns a node. 25 | * 26 | * @param Twig_Token $token A Twig_Token instance 27 | * 28 | * @return Twig_NodeInterface A Twig_NodeInterface instance 29 | */ 30 | public function parse(Twig_Token $token) 31 | { 32 | $lineno = $token->getLine(); 33 | $stream = $this->parser->getStream(); 34 | $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); 35 | 36 | $arguments = $this->parser->getExpressionParser()->parseArguments(true, true); 37 | 38 | $stream->expect(Twig_Token::BLOCK_END_TYPE); 39 | $this->parser->pushLocalScope(); 40 | $body = $this->parser->subparse(array($this, 'decideBlockEnd'), true); 41 | if ($token = $stream->nextIf(Twig_Token::NAME_TYPE)) { 42 | $value = $token->getValue(); 43 | 44 | if ($value != $name) { 45 | throw new Twig_Error_Syntax(sprintf("Expected endmacro for macro '$name' (but %s given)", $value), $stream->getCurrent()->getLine(), $stream->getFilename()); 46 | } 47 | } 48 | $this->parser->popLocalScope(); 49 | $stream->expect(Twig_Token::BLOCK_END_TYPE); 50 | 51 | $this->parser->setMacro($name, new Twig_Node_Macro($name, new Twig_Node_Body(array($body)), $arguments, $lineno, $this->getTag())); 52 | } 53 | 54 | public function decideBlockEnd(Twig_Token $token) 55 | { 56 | return $token->test('endmacro'); 57 | } 58 | 59 | /** 60 | * Gets the tag name associated with this token parser. 61 | * 62 | * @return string The tag name 63 | */ 64 | public function getTag() 65 | { 66 | return 'macro'; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /www/themes/default/img/camera.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | Untitled 4 4 | Created with Sketch (http://www.bohemiancoding.com/sketch) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/ExtensionInterface.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | interface Twig_ExtensionInterface 18 | { 19 | /** 20 | * Initializes the runtime environment. 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 | public function initRuntime(Twig_Environment $environment); 27 | 28 | /** 29 | * Returns the token parser instances to add to the existing list. 30 | * 31 | * @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances 32 | */ 33 | public function getTokenParsers(); 34 | 35 | /** 36 | * Returns the node visitor instances to add to the existing list. 37 | * 38 | * @return Twig_NodeVisitorInterface[] An array of Twig_NodeVisitorInterface instances 39 | */ 40 | public function getNodeVisitors(); 41 | 42 | /** 43 | * Returns a list of filters to add to the existing list. 44 | * 45 | * @return array An array of filters 46 | */ 47 | public function getFilters(); 48 | 49 | /** 50 | * Returns a list of tests to add to the existing list. 51 | * 52 | * @return array An array of tests 53 | */ 54 | public function getTests(); 55 | 56 | /** 57 | * Returns a list of functions to add to the existing list. 58 | * 59 | * @return array An array of functions 60 | */ 61 | public function getFunctions(); 62 | 63 | /** 64 | * Returns a list of operators to add to the existing list. 65 | * 66 | * @return array An array of operators 67 | */ 68 | public function getOperators(); 69 | 70 | /** 71 | * Returns a list of global variables to add to the existing list. 72 | * 73 | * @return array An array of global variables 74 | */ 75 | public function getGlobals(); 76 | 77 | /** 78 | * Returns the name of the extension. 79 | * 80 | * @return string The extension name 81 | */ 82 | public function getName(); 83 | } 84 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php: -------------------------------------------------------------------------------- 1 | $node, 'attribute' => $attribute, 'arguments' => $arguments), array('type' => $type, 'is_defined_test' => false, 'ignore_strict_check' => false, 'disable_c_ext' => false), $lineno); 17 | } 18 | 19 | public function compile(Twig_Compiler $compiler) 20 | { 21 | if (function_exists('twig_template_get_attributes') && !$this->getAttribute('disable_c_ext')) { 22 | $compiler->raw('twig_template_get_attributes($this, '); 23 | } else { 24 | $compiler->raw('$this->getAttribute('); 25 | } 26 | 27 | if ($this->getAttribute('ignore_strict_check')) { 28 | $this->getNode('node')->setAttribute('ignore_strict_check', true); 29 | } 30 | 31 | $compiler->subcompile($this->getNode('node')); 32 | 33 | $compiler->raw(', ')->subcompile($this->getNode('attribute')); 34 | 35 | if (count($this->getNode('arguments')) || Twig_Template::ANY_CALL !== $this->getAttribute('type') || $this->getAttribute('is_defined_test') || $this->getAttribute('ignore_strict_check')) { 36 | $compiler->raw(', ')->subcompile($this->getNode('arguments')); 37 | 38 | if (Twig_Template::ANY_CALL !== $this->getAttribute('type') || $this->getAttribute('is_defined_test') || $this->getAttribute('ignore_strict_check')) { 39 | $compiler->raw(', ')->repr($this->getAttribute('type')); 40 | } 41 | 42 | if ($this->getAttribute('is_defined_test') || $this->getAttribute('ignore_strict_check')) { 43 | $compiler->raw(', '.($this->getAttribute('is_defined_test') ? 'true' : 'false')); 44 | } 45 | 46 | if ($this->getAttribute('ignore_strict_check')) { 47 | $compiler->raw(', '.($this->getAttribute('ignore_strict_check') ? 'true' : 'false')); 48 | } 49 | } 50 | 51 | $compiler->raw(')'); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TokenParser/Use.php: -------------------------------------------------------------------------------- 1 | 16 | * {% extends "base.html" %} 17 | * 18 | * {% use "blocks.html" %} 19 | * 20 | * {% block title %}{% endblock %} 21 | * {% block content %}{% endblock %} 22 | * 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 | { 28 | /** 29 | * Parses a token and returns a node. 30 | * 31 | * @param Twig_Token $token A Twig_Token instance 32 | * 33 | * @return Twig_NodeInterface A Twig_NodeInterface instance 34 | */ 35 | public function parse(Twig_Token $token) 36 | { 37 | $template = $this->parser->getExpressionParser()->parseExpression(); 38 | $stream = $this->parser->getStream(); 39 | 40 | if (!$template instanceof Twig_Node_Expression_Constant) { 41 | throw new Twig_Error_Syntax('The template references in a "use" statement must be a string.', $stream->getCurrent()->getLine(), $stream->getFilename()); 42 | } 43 | 44 | $targets = array(); 45 | if ($stream->nextIf('with')) { 46 | do { 47 | $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); 48 | 49 | $alias = $name; 50 | if ($stream->nextIf('as')) { 51 | $alias = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); 52 | } 53 | 54 | $targets[$name] = new Twig_Node_Expression_Constant($alias, -1); 55 | 56 | if (!$stream->nextIf(Twig_Token::PUNCTUATION_TYPE, ',')) { 57 | break; 58 | } 59 | } while (true); 60 | } 61 | 62 | $stream->expect(Twig_Token::BLOCK_END_TYPE); 63 | 64 | $this->parser->addTrait(new Twig_Node(array('template' => $template, 'targets' => new Twig_Node($targets)))); 65 | } 66 | 67 | /** 68 | * Gets the tag name associated with this token parser. 69 | * 70 | * @return string The tag name 71 | */ 72 | public function getTag() 73 | { 74 | return 'use'; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/SimpleFilter.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | class Twig_SimpleFilter 18 | { 19 | protected $name; 20 | protected $callable; 21 | protected $options; 22 | protected $arguments = array(); 23 | 24 | public function __construct($name, $callable, array $options = array()) 25 | { 26 | $this->name = $name; 27 | $this->callable = $callable; 28 | $this->options = array_merge(array( 29 | 'needs_environment' => false, 30 | 'needs_context' => false, 31 | 'is_safe' => null, 32 | 'is_safe_callback' => null, 33 | 'pre_escape' => null, 34 | 'preserves_safety' => null, 35 | 'node_class' => 'Twig_Node_Expression_Filter', 36 | ), $options); 37 | } 38 | 39 | public function getName() 40 | { 41 | return $this->name; 42 | } 43 | 44 | public function getCallable() 45 | { 46 | return $this->callable; 47 | } 48 | 49 | public function getNodeClass() 50 | { 51 | return $this->options['node_class']; 52 | } 53 | 54 | public function setArguments($arguments) 55 | { 56 | $this->arguments = $arguments; 57 | } 58 | 59 | public function getArguments() 60 | { 61 | return $this->arguments; 62 | } 63 | 64 | public function needsEnvironment() 65 | { 66 | return $this->options['needs_environment']; 67 | } 68 | 69 | public function needsContext() 70 | { 71 | return $this->options['needs_context']; 72 | } 73 | 74 | public function getSafe(Twig_Node $filterArgs) 75 | { 76 | if (null !== $this->options['is_safe']) { 77 | return $this->options['is_safe']; 78 | } 79 | 80 | if (null !== $this->options['is_safe_callback']) { 81 | return call_user_func($this->options['is_safe_callback'], $filterArgs); 82 | } 83 | } 84 | 85 | public function getPreservesSafety() 86 | { 87 | return $this->options['preserves_safety']; 88 | } 89 | 90 | public function getPreEscape() 91 | { 92 | return $this->options['pre_escape']; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Extension.php: -------------------------------------------------------------------------------- 1 | 16 | * {% set foo = 'foo' %} 17 | * 18 | * {% set foo = [1, 2] %} 19 | * 20 | * {% set foo = {'foo': 'bar'} %} 21 | * 22 | * {% set foo = 'foo' ~ 'bar' %} 23 | * 24 | * {% set foo, bar = 'foo', 'bar' %} 25 | * 26 | * {% set foo %}Some content{% endset %} 27 | * 28 | */ 29 | class Twig_TokenParser_Set extends Twig_TokenParser 30 | { 31 | /** 32 | * Parses a token and returns a node. 33 | * 34 | * @param Twig_Token $token A Twig_Token instance 35 | * 36 | * @return Twig_NodeInterface A Twig_NodeInterface instance 37 | */ 38 | public function parse(Twig_Token $token) 39 | { 40 | $lineno = $token->getLine(); 41 | $stream = $this->parser->getStream(); 42 | $names = $this->parser->getExpressionParser()->parseAssignmentExpression(); 43 | 44 | $capture = false; 45 | if ($stream->nextIf(Twig_Token::OPERATOR_TYPE, '=')) { 46 | $values = $this->parser->getExpressionParser()->parseMultitargetExpression(); 47 | 48 | $stream->expect(Twig_Token::BLOCK_END_TYPE); 49 | 50 | if (count($names) !== count($values)) { 51 | throw new Twig_Error_Syntax("When using set, you must have the same number of variables and assignments.", $stream->getCurrent()->getLine(), $stream->getFilename()); 52 | } 53 | } else { 54 | $capture = true; 55 | 56 | if (count($names) > 1) { 57 | throw new Twig_Error_Syntax("When using set with a block, you cannot have a multi-target.", $stream->getCurrent()->getLine(), $stream->getFilename()); 58 | } 59 | 60 | $stream->expect(Twig_Token::BLOCK_END_TYPE); 61 | 62 | $values = $this->parser->subparse(array($this, 'decideBlockEnd'), true); 63 | $stream->expect(Twig_Token::BLOCK_END_TYPE); 64 | } 65 | 66 | return new Twig_Node_Set($capture, $names, $values, $lineno, $this->getTag()); 67 | } 68 | 69 | public function decideBlockEnd(Twig_Token $token) 70 | { 71 | return $token->test('endset'); 72 | } 73 | 74 | /** 75 | * Gets the tag name associated with this token parser. 76 | * 77 | * @return string The tag name 78 | */ 79 | public function getTag() 80 | { 81 | return 'set'; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Extension/Staging.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | class Twig_Extension_Staging extends Twig_Extension 20 | { 21 | protected $functions = array(); 22 | protected $filters = array(); 23 | protected $visitors = array(); 24 | protected $tokenParsers = array(); 25 | protected $globals = array(); 26 | protected $tests = array(); 27 | 28 | public function addFunction($name, $function) 29 | { 30 | $this->functions[$name] = $function; 31 | } 32 | 33 | /** 34 | * {@inheritdoc} 35 | */ 36 | public function getFunctions() 37 | { 38 | return $this->functions; 39 | } 40 | 41 | public function addFilter($name, $filter) 42 | { 43 | $this->filters[$name] = $filter; 44 | } 45 | 46 | /** 47 | * {@inheritdoc} 48 | */ 49 | public function getFilters() 50 | { 51 | return $this->filters; 52 | } 53 | 54 | public function addNodeVisitor(Twig_NodeVisitorInterface $visitor) 55 | { 56 | $this->visitors[] = $visitor; 57 | } 58 | 59 | /** 60 | * {@inheritdoc} 61 | */ 62 | public function getNodeVisitors() 63 | { 64 | return $this->visitors; 65 | } 66 | 67 | public function addTokenParser(Twig_TokenParserInterface $parser) 68 | { 69 | $this->tokenParsers[] = $parser; 70 | } 71 | 72 | /** 73 | * {@inheritdoc} 74 | */ 75 | public function getTokenParsers() 76 | { 77 | return $this->tokenParsers; 78 | } 79 | 80 | public function addGlobal($name, $value) 81 | { 82 | $this->globals[$name] = $value; 83 | } 84 | 85 | /** 86 | * {@inheritdoc} 87 | */ 88 | public function getGlobals() 89 | { 90 | return $this->globals; 91 | } 92 | 93 | public function addTest($name, $test) 94 | { 95 | $this->tests[$name] = $test; 96 | } 97 | 98 | /** 99 | * {@inheritdoc} 100 | */ 101 | public function getTests() 102 | { 103 | return $this->tests; 104 | } 105 | 106 | /** 107 | * {@inheritdoc} 108 | */ 109 | public function getName() 110 | { 111 | return 'staging'; 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /app/controllers/thumbnail.php: -------------------------------------------------------------------------------- 1 | width = $width; 19 | $this->height = $height; 20 | $this->path = urldecode($path); 21 | 22 | $this->cache_path = CACHE_DIR . "/" . $width . "x" . $height . "/" . $path; 23 | 24 | // Check cache folder configuration 25 | if(file_exists(CACHE_DIR) && is_writable(CACHE_DIR)) { 26 | if(!file_exists(dirname($this->cache_path))) 27 | mkdir(dirname($this->cache_path), 0777, true); 28 | } else { 29 | echo "

Error

Cache folder does not exist or is not writable

"; 30 | } 31 | } 32 | 33 | public function serve() { 34 | if(!$this->exist()) { 35 | $this->generate(CONTENT_DIR . $this->path, $this->cache_path,$this->width, $this->height); 36 | } 37 | header("Content-Type: " . mime_content_type($this->cache_path)); 38 | header('Content-Length: ' . filesize($this->cache_path)); 39 | echo file_get_contents($this->cache_path); 40 | } 41 | 42 | 43 | private function generate($src, $dest, $thumb_w = 164, $thumb_h = 164) { 44 | $ext = pathinfo($src, PATHINFO_EXTENSION); 45 | if($ext == "jpg" || $ext == "jpeg") { 46 | $srcimg = imagecreatefromjpeg($src); 47 | } 48 | if($ext == "png") { 49 | $srcimg = imagecreatefrompng($src); 50 | } 51 | $src_w = imagesx($srcimg); 52 | $src_h = imagesy($srcimg); 53 | $src_ratio = $src_w/$src_h; 54 | if (1 > $src_ratio) { 55 | $new_h = $thumb_w/$src_ratio; 56 | $new_w = $thumb_w; 57 | } else { 58 | $new_w = $thumb_h*$src_ratio; 59 | $new_h = $thumb_h; 60 | } 61 | $x_mid = $new_w/2; 62 | $y_mid = $new_h/2; 63 | $newpic = imagecreatetruecolor(round($new_w), round($new_h)); 64 | imagecopyresampled($newpic, $srcimg, 0, 0, 0, 0, $new_w, $new_h, $src_w, $src_h); 65 | $final = imagecreatetruecolor($thumb_w, $thumb_h); 66 | imagecopyresampled($final, $newpic, 0, 0, ($x_mid-($thumb_w/2)), ($y_mid-($thumb_h/2)), $thumb_w, $thumb_h, $thumb_w, $thumb_h); 67 | imagedestroy($newpic); 68 | imagedestroy($srcimg); 69 | 70 | if($ext == "jpg" || $ext == "jpeg") { 71 | imagejpeg($final, $dest, 80); //again, assuming jpeg, 80% quality 72 | } 73 | if($ext == "png") { 74 | imagepng($final, $dest, 0); //again, assuming jpeg, 80% quality 75 | } 76 | } 77 | 78 | 79 | private function exist() { 80 | return file_exists($this->cache_path); 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Expression/Array.php: -------------------------------------------------------------------------------- 1 | index = -1; 20 | foreach ($this->getKeyValuePairs() as $pair) { 21 | if ($pair['key'] instanceof Twig_Node_Expression_Constant && ctype_digit((string) $pair['key']->getAttribute('value')) && $pair['key']->getAttribute('value') > $this->index) { 22 | $this->index = $pair['key']->getAttribute('value'); 23 | } 24 | } 25 | } 26 | 27 | public function getKeyValuePairs() 28 | { 29 | $pairs = array(); 30 | 31 | foreach (array_chunk($this->nodes, 2) as $pair) { 32 | $pairs[] = array( 33 | 'key' => $pair[0], 34 | 'value' => $pair[1], 35 | ); 36 | } 37 | 38 | return $pairs; 39 | } 40 | 41 | public function hasElement(Twig_Node_Expression $key) 42 | { 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 | } 50 | 51 | return false; 52 | } 53 | 54 | public function addElement(Twig_Node_Expression $value, Twig_Node_Expression $key = null) 55 | { 56 | if (null === $key) { 57 | $key = new Twig_Node_Expression_Constant(++$this->index, $value->getLine()); 58 | } 59 | 60 | array_push($this->nodes, $key, $value); 61 | } 62 | 63 | /** 64 | * Compiles the node to PHP. 65 | * 66 | * @param Twig_Compiler A Twig_Compiler instance 67 | */ 68 | public function compile(Twig_Compiler $compiler) 69 | { 70 | $compiler->raw('array('); 71 | $first = true; 72 | foreach ($this->getKeyValuePairs() as $pair) { 73 | if (!$first) { 74 | $compiler->raw(', '); 75 | } 76 | $first = false; 77 | 78 | $compiler 79 | ->subcompile($pair['key']) 80 | ->raw(' => ') 81 | ->subcompile($pair['value']) 82 | ; 83 | } 84 | $compiler->raw(')'); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/NodeTraverser.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | class Twig_NodeTraverser 20 | { 21 | protected $env; 22 | protected $visitors; 23 | 24 | /** 25 | * Constructor. 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 | { 32 | $this->env = $env; 33 | $this->visitors = array(); 34 | foreach ($visitors as $visitor) { 35 | $this->addVisitor($visitor); 36 | } 37 | } 38 | 39 | /** 40 | * Adds a visitor. 41 | * 42 | * @param Twig_NodeVisitorInterface $visitor A Twig_NodeVisitorInterface instance 43 | */ 44 | public function addVisitor(Twig_NodeVisitorInterface $visitor) 45 | { 46 | if (!isset($this->visitors[$visitor->getPriority()])) { 47 | $this->visitors[$visitor->getPriority()] = array(); 48 | } 49 | 50 | $this->visitors[$visitor->getPriority()][] = $visitor; 51 | } 52 | 53 | /** 54 | * Traverses a node and calls the registered visitors. 55 | * 56 | * @param Twig_NodeInterface $node A Twig_NodeInterface instance 57 | */ 58 | public function traverse(Twig_NodeInterface $node) 59 | { 60 | ksort($this->visitors); 61 | foreach ($this->visitors as $visitors) { 62 | foreach ($visitors as $visitor) { 63 | $node = $this->traverseForVisitor($visitor, $node); 64 | } 65 | } 66 | 67 | return $node; 68 | } 69 | 70 | protected function traverseForVisitor(Twig_NodeVisitorInterface $visitor, Twig_NodeInterface $node = null) 71 | { 72 | if (null === $node) { 73 | return; 74 | } 75 | 76 | $node = $visitor->enterNode($node, $this->env); 77 | 78 | foreach ($node as $k => $n) { 79 | if (false !== $n = $this->traverseForVisitor($visitor, $n)) { 80 | $node->setNode($k, $n); 81 | } else { 82 | $node->removeNode($k); 83 | } 84 | } 85 | 86 | return $visitor->leaveNode($node, $this->env); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Loader/Array.php: -------------------------------------------------------------------------------- 1 | 21 | */ 22 | class Twig_Loader_Array implements Twig_LoaderInterface, Twig_ExistsLoaderInterface 23 | { 24 | protected $templates = array(); 25 | 26 | /** 27 | * Constructor. 28 | * 29 | * @param array $templates An array of templates (keys are the names, and values are the source code) 30 | * 31 | * @see Twig_Loader 32 | */ 33 | public function __construct(array $templates) 34 | { 35 | $this->templates = $templates; 36 | } 37 | 38 | /** 39 | * Adds or overrides a template. 40 | * 41 | * @param string $name The template name 42 | * @param string $template The template source 43 | */ 44 | public function setTemplate($name, $template) 45 | { 46 | $this->templates[(string) $name] = $template; 47 | } 48 | 49 | /** 50 | * {@inheritdoc} 51 | */ 52 | public function getSource($name) 53 | { 54 | $name = (string) $name; 55 | if (!isset($this->templates[$name])) { 56 | throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); 57 | } 58 | 59 | return $this->templates[$name]; 60 | } 61 | 62 | /** 63 | * {@inheritdoc} 64 | */ 65 | public function exists($name) 66 | { 67 | return isset($this->templates[(string) $name]); 68 | } 69 | 70 | /** 71 | * {@inheritdoc} 72 | */ 73 | public function getCacheKey($name) 74 | { 75 | $name = (string) $name; 76 | if (!isset($this->templates[$name])) { 77 | throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); 78 | } 79 | 80 | return $this->templates[$name]; 81 | } 82 | 83 | /** 84 | * {@inheritdoc} 85 | */ 86 | public function isFresh($name, $time) 87 | { 88 | $name = (string) $name; 89 | if (!isset($this->templates[$name])) { 90 | throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name)); 91 | } 92 | 93 | return true; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TokenParser/Block.php: -------------------------------------------------------------------------------- 1 | 17 | * {% block head %} 18 | * 19 | * {% block title %}{% endblock %} - My Webpage 20 | * {% endblock %} 21 | * 22 | */ 23 | class Twig_TokenParser_Block extends Twig_TokenParser 24 | { 25 | /** 26 | * Parses a token and returns a node. 27 | * 28 | * @param Twig_Token $token A Twig_Token instance 29 | * 30 | * @return Twig_NodeInterface A Twig_NodeInterface instance 31 | */ 32 | public function parse(Twig_Token $token) 33 | { 34 | $lineno = $token->getLine(); 35 | $stream = $this->parser->getStream(); 36 | $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); 37 | if ($this->parser->hasBlock($name)) { 38 | throw new Twig_Error_Syntax(sprintf("The block '$name' has already been defined line %d", $this->parser->getBlock($name)->getLine()), $stream->getCurrent()->getLine(), $stream->getFilename()); 39 | } 40 | $this->parser->setBlock($name, $block = new Twig_Node_Block($name, new Twig_Node(array()), $lineno)); 41 | $this->parser->pushLocalScope(); 42 | $this->parser->pushBlockStack($name); 43 | 44 | if ($stream->nextIf(Twig_Token::BLOCK_END_TYPE)) { 45 | $body = $this->parser->subparse(array($this, 'decideBlockEnd'), true); 46 | if ($token = $stream->nextIf(Twig_Token::NAME_TYPE)) { 47 | $value = $token->getValue(); 48 | 49 | if ($value != $name) { 50 | throw new Twig_Error_Syntax(sprintf("Expected endblock for block '$name' (but %s given)", $value), $stream->getCurrent()->getLine(), $stream->getFilename()); 51 | } 52 | } 53 | } else { 54 | $body = new Twig_Node(array( 55 | new Twig_Node_Print($this->parser->getExpressionParser()->parseExpression(), $lineno), 56 | )); 57 | } 58 | $stream->expect(Twig_Token::BLOCK_END_TYPE); 59 | 60 | $block->setNode('body', $body); 61 | $this->parser->popBlockStack(); 62 | $this->parser->popLocalScope(); 63 | 64 | return new Twig_Node_BlockReference($name, $lineno, $this->getTag()); 65 | } 66 | 67 | public function decideBlockEnd(Twig_Token $token) 68 | { 69 | return $token->test('endblock'); 70 | } 71 | 72 | /** 73 | * Gets the tag name associated with this token parser. 74 | * 75 | * @return string The tag name 76 | */ 77 | public function getTag() 78 | { 79 | return 'block'; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | class Twig_NodeVisitor_Sandbox implements Twig_NodeVisitorInterface 18 | { 19 | protected $inAModule = false; 20 | protected $tags; 21 | protected $filters; 22 | protected $functions; 23 | 24 | /** 25 | * Called before child nodes are visited. 26 | * 27 | * @param Twig_NodeInterface $node The node to visit 28 | * @param Twig_Environment $env The Twig environment instance 29 | * 30 | * @return Twig_NodeInterface The modified node 31 | */ 32 | public function enterNode(Twig_NodeInterface $node, Twig_Environment $env) 33 | { 34 | if ($node instanceof Twig_Node_Module) { 35 | $this->inAModule = true; 36 | $this->tags = array(); 37 | $this->filters = array(); 38 | $this->functions = array(); 39 | 40 | return $node; 41 | } elseif ($this->inAModule) { 42 | // look for tags 43 | if ($node->getNodeTag()) { 44 | $this->tags[] = $node->getNodeTag(); 45 | } 46 | 47 | // look for filters 48 | if ($node instanceof Twig_Node_Expression_Filter) { 49 | $this->filters[] = $node->getNode('filter')->getAttribute('value'); 50 | } 51 | 52 | // look for functions 53 | if ($node instanceof Twig_Node_Expression_Function) { 54 | $this->functions[] = $node->getAttribute('name'); 55 | } 56 | 57 | // wrap print to check __toString() calls 58 | if ($node instanceof Twig_Node_Print) { 59 | return new Twig_Node_SandboxedPrint($node->getNode('expr'), $node->getLine(), $node->getNodeTag()); 60 | } 61 | } 62 | 63 | return $node; 64 | } 65 | 66 | /** 67 | * Called after child nodes are visited. 68 | * 69 | * @param Twig_NodeInterface $node The node to visit 70 | * @param Twig_Environment $env The Twig environment instance 71 | * 72 | * @return Twig_NodeInterface The modified node 73 | */ 74 | public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env) 75 | { 76 | if ($node instanceof Twig_Node_Module) { 77 | $this->inAModule = false; 78 | 79 | return new Twig_Node_SandboxedModule($node, array_unique($this->filters), array_unique($this->tags), array_unique($this->functions)); 80 | } 81 | 82 | return $node; 83 | } 84 | 85 | /** 86 | * {@inheritdoc} 87 | */ 88 | public function getPriority() 89 | { 90 | return 0; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php: -------------------------------------------------------------------------------- 1 | 16 | * {% autoescape true %} 17 | * Everything will be automatically escaped in this block 18 | * {% endautoescape %} 19 | * 20 | * {% autoescape false %} 21 | * Everything will be outputed as is in this block 22 | * {% endautoescape %} 23 | * 24 | * {% autoescape true js %} 25 | * Everything will be automatically escaped in this block 26 | * using the js escaping strategy 27 | * {% endautoescape %} 28 | * 29 | */ 30 | class Twig_TokenParser_AutoEscape extends Twig_TokenParser 31 | { 32 | /** 33 | * Parses a token and returns a node. 34 | * 35 | * @param Twig_Token $token A Twig_Token instance 36 | * 37 | * @return Twig_NodeInterface A Twig_NodeInterface instance 38 | */ 39 | public function parse(Twig_Token $token) 40 | { 41 | $lineno = $token->getLine(); 42 | $stream = $this->parser->getStream(); 43 | 44 | if ($stream->test(Twig_Token::BLOCK_END_TYPE)) { 45 | $value = 'html'; 46 | } else { 47 | $expr = $this->parser->getExpressionParser()->parseExpression(); 48 | if (!$expr instanceof Twig_Node_Expression_Constant) { 49 | throw new Twig_Error_Syntax('An escaping strategy must be a string or a Boolean.', $stream->getCurrent()->getLine(), $stream->getFilename()); 50 | } 51 | $value = $expr->getAttribute('value'); 52 | 53 | $compat = true === $value || false === $value; 54 | 55 | if (true === $value) { 56 | $value = 'html'; 57 | } 58 | 59 | if ($compat && $stream->test(Twig_Token::NAME_TYPE)) { 60 | if (false === $value) { 61 | throw new Twig_Error_Syntax('Unexpected escaping strategy as you set autoescaping to false.', $stream->getCurrent()->getLine(), $stream->getFilename()); 62 | } 63 | 64 | $value = $stream->next()->getValue(); 65 | } 66 | } 67 | 68 | $stream->expect(Twig_Token::BLOCK_END_TYPE); 69 | $body = $this->parser->subparse(array($this, 'decideBlockEnd'), true); 70 | $stream->expect(Twig_Token::BLOCK_END_TYPE); 71 | 72 | return new Twig_Node_AutoEscape($value, $body, $lineno, $this->getTag()); 73 | } 74 | 75 | public function decideBlockEnd(Twig_Token $token) 76 | { 77 | return $token->test('endautoescape'); 78 | } 79 | 80 | /** 81 | * Gets the tag name associated with this token parser. 82 | * 83 | * @return string The tag name 84 | */ 85 | public function getTag() 86 | { 87 | return 'autoescape'; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /vendor/bramus/router/demo/index.php: -------------------------------------------------------------------------------- 1 | set404(function() { 18 | header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found'); 19 | echo '404, route not found!'; 20 | }); 21 | 22 | // Before Router Middleware 23 | $router->before('GET', '/.*', function() { 24 | header('X-Powered-By: bramus/router'); 25 | }); 26 | 27 | // Static route: / (homepage) 28 | $router->get('/', function() { 29 | echo '

bramus/router

Try these routes:

  • /hello/name
  • /blog
  • /blog/year
  • /blog/year/month
  • /blog/year/month/day
  • /movies
  • /movies/id
'; 30 | }); 31 | 32 | // Static route: /hello 33 | $router->get('/hello', function() { 34 | echo '

bramus/router

Visit /hello/name to get your Hello World mojo on!

'; 35 | }); 36 | 37 | // Dynamic route: /hello/name 38 | $router->get('/hello/(\w+)', function($name) { 39 | echo 'Hello ' . htmlentities($name); 40 | }); 41 | 42 | // Dynamic route: /ohai/name/in/parts 43 | $router->get('/ohai/(.*)', function($url) { 44 | echo 'Ohai ' . htmlentities($url); 45 | }); 46 | 47 | // Dynamic route with (successive) optional subpatterns: /blog(/year(/month(/day(/slug)))) 48 | $router->get('/blog(/\d{4}(/\d{2}(/\d{2}(/[a-z0-9_-]+)?)?)?)?', function($year = null, $month = null, $day = null, $slug = null) { 49 | if (!$year) { echo 'Blog overview'; return; } 50 | if (!$month) { echo 'Blog year overview (' . $year . ')'; return; } 51 | if (!$day) { echo 'Blog month overview (' . $year . '-' . $month . ')'; return; } 52 | if (!$slug) { echo 'Blog day overview (' . $year . '-' . $month . '-' . $day . ')'; return; } 53 | echo 'Blogpost ' . htmlentities($slug) . ' detail (' . $year . '-' . $month . '-' . $day . ')'; 54 | }); 55 | 56 | // Subrouting 57 | $router->mount('/movies', function() use ($router) { 58 | 59 | // will result in '/movies' 60 | $router->get('/', function() { 61 | echo 'movies overview'; 62 | }); 63 | 64 | // will result in '/movies' 65 | $router->post('/', function() { 66 | echo 'add movie'; 67 | }); 68 | 69 | // will result in '/movies/id' 70 | $router->get('/(\d+)', function($id) { 71 | echo 'movie id ' . htmlentities($id); 72 | }); 73 | 74 | // will result in '/movies/id' 75 | $router->put('/(\d+)', function($id) { 76 | echo 'Update movie id ' . htmlentities($id); 77 | }); 78 | 79 | }); 80 | 81 | // Thunderbirds are go! 82 | $router->run(); 83 | 84 | // EOF -------------------------------------------------------------------------------- /vendor/twig/twig/lib/Twig/Node/Macro.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | class Twig_Node_Macro extends Twig_Node 18 | { 19 | public function __construct($name, Twig_NodeInterface $body, Twig_NodeInterface $arguments, $lineno, $tag = null) 20 | { 21 | parent::__construct(array('body' => $body, 'arguments' => $arguments), array('name' => $name), $lineno, $tag); 22 | } 23 | 24 | /** 25 | * Compiles the node to PHP. 26 | * 27 | * @param Twig_Compiler A Twig_Compiler instance 28 | */ 29 | public function compile(Twig_Compiler $compiler) 30 | { 31 | $compiler 32 | ->addDebugInfo($this) 33 | ->write(sprintf("public function get%s(", $this->getAttribute('name'))) 34 | ; 35 | 36 | $count = count($this->getNode('arguments')); 37 | $pos = 0; 38 | foreach ($this->getNode('arguments') as $name => $default) { 39 | $compiler 40 | ->raw('$_'.$name.' = ') 41 | ->subcompile($default) 42 | ; 43 | 44 | if (++$pos < $count) { 45 | $compiler->raw(', '); 46 | } 47 | } 48 | 49 | $compiler 50 | ->raw(")\n") 51 | ->write("{\n") 52 | ->indent() 53 | ; 54 | 55 | if (!count($this->getNode('arguments'))) { 56 | $compiler->write("\$context = \$this->env->getGlobals();\n\n"); 57 | } else { 58 | $compiler 59 | ->write("\$context = \$this->env->mergeGlobals(array(\n") 60 | ->indent() 61 | ; 62 | 63 | foreach ($this->getNode('arguments') as $name => $default) { 64 | $compiler 65 | ->write('') 66 | ->string($name) 67 | ->raw(' => $_'.$name) 68 | ->raw(",\n") 69 | ; 70 | } 71 | 72 | $compiler 73 | ->outdent() 74 | ->write("));\n\n") 75 | ; 76 | } 77 | 78 | $compiler 79 | ->write("\$blocks = array();\n\n") 80 | ->write("ob_start();\n") 81 | ->write("try {\n") 82 | ->indent() 83 | ->subcompile($this->getNode('body')) 84 | ->outdent() 85 | ->write("} catch (Exception \$e) {\n") 86 | ->indent() 87 | ->write("ob_end_clean();\n\n") 88 | ->write("throw \$e;\n") 89 | ->outdent() 90 | ->write("}\n\n") 91 | ->write("return ('' === \$tmp = ob_get_clean()) ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset());\n") 92 | ->outdent() 93 | ->write("}\n\n") 94 | ; 95 | } 96 | } 97 | --------------------------------------------------------------------------------