Changeset 1083683
- Timestamp:
- 02/06/2015 10:09:43 AM (11 years ago)
- Location:
- adentify
- Files:
-
- 28 added
- 49 edited
-
assets/screenshot-4.png (added)
-
trunk/adentify.php (modified) (5 diffs)
-
trunk/composer.lock (modified) (3 diffs)
-
trunk/public/APIManager.php (modified) (2 diffs)
-
trunk/public/DBManager.php (modified) (1 diff)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/ClassLoader.php (modified) (3 diffs)
-
trunk/vendor/composer/autoload_real.php (modified) (4 diffs)
-
trunk/vendor/composer/installed.json (modified) (2 diffs)
-
trunk/vendor/twig/twig/.gitignore (modified) (1 diff)
-
trunk/vendor/twig/twig/CHANGELOG (modified) (1 diff)
-
trunk/vendor/twig/twig/composer.json (modified) (1 diff)
-
trunk/vendor/twig/twig/doc/advanced.rst (modified) (2 diffs)
-
trunk/vendor/twig/twig/doc/api.rst (modified) (2 diffs)
-
trunk/vendor/twig/twig/doc/filters/batch.rst (modified) (1 diff)
-
trunk/vendor/twig/twig/ext/twig/php_twig.h (modified) (1 diff)
-
trunk/vendor/twig/twig/lib/Twig/Autoloader.php (modified) (1 diff)
-
trunk/vendor/twig/twig/lib/Twig/Compiler.php (modified) (3 diffs)
-
trunk/vendor/twig/twig/lib/Twig/Environment.php (modified) (9 diffs)
-
trunk/vendor/twig/twig/lib/Twig/Error.php (modified) (2 diffs)
-
trunk/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php (modified) (1 diff)
-
trunk/vendor/twig/twig/lib/Twig/ExpressionParser.php (modified) (1 diff)
-
trunk/vendor/twig/twig/lib/Twig/Extension/Core.php (modified) (6 diffs)
-
trunk/vendor/twig/twig/lib/Twig/Extension/Profiler.php (added)
-
trunk/vendor/twig/twig/lib/Twig/Extension/StringLoader.php (modified) (1 diff)
-
trunk/vendor/twig/twig/lib/Twig/Lexer.php (modified) (1 diff)
-
trunk/vendor/twig/twig/lib/Twig/Loader/Filesystem.php (modified) (1 diff)
-
trunk/vendor/twig/twig/lib/Twig/LoaderInterface.php (modified) (1 diff)
-
trunk/vendor/twig/twig/lib/Twig/Node.php (modified) (3 diffs)
-
trunk/vendor/twig/twig/lib/Twig/Node/CheckSecurity.php (added)
-
trunk/vendor/twig/twig/lib/Twig/Node/Expression/Call.php (modified) (5 diffs)
-
trunk/vendor/twig/twig/lib/Twig/Node/Expression/Name.php (modified) (1 diff)
-
trunk/vendor/twig/twig/lib/Twig/Node/Module.php (modified) (10 diffs)
-
trunk/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php (modified) (1 diff)
-
trunk/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php (modified) (1 diff)
-
trunk/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php (modified) (1 diff)
-
trunk/vendor/twig/twig/lib/Twig/Profiler (added)
-
trunk/vendor/twig/twig/lib/Twig/Profiler/Dumper (added)
-
trunk/vendor/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php (added)
-
trunk/vendor/twig/twig/lib/Twig/Profiler/Dumper/Html.php (added)
-
trunk/vendor/twig/twig/lib/Twig/Profiler/Dumper/Text.php (added)
-
trunk/vendor/twig/twig/lib/Twig/Profiler/Node (added)
-
trunk/vendor/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php (added)
-
trunk/vendor/twig/twig/lib/Twig/Profiler/Node/LeaveProfile.php (added)
-
trunk/vendor/twig/twig/lib/Twig/Profiler/NodeVisitor (added)
-
trunk/vendor/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php (added)
-
trunk/vendor/twig/twig/lib/Twig/Profiler/Profile.php (added)
-
trunk/vendor/twig/twig/lib/Twig/Template.php (modified) (6 diffs)
-
trunk/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php (modified) (1 diff)
-
trunk/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php (modified) (1 diff)
-
trunk/vendor/twig/twig/lib/Twig/Token.php (modified) (5 diffs)
-
trunk/vendor/twig/twig/lib/Twig/TokenStream.php (modified) (1 diff)
-
trunk/vendor/twig/twig/test/Twig/Tests/ErrorTest.php (modified) (2 diffs)
-
trunk/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php (modified) (2 diffs)
-
trunk/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable.test (added)
-
trunk/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_array_with_undefined_variable_again.test (added)
-
trunk/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_undefined_variable.test (added)
-
trunk/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_function_with_unknown_argument.test (added)
-
trunk/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/multiline_tag_with_undefined_variable.test (added)
-
trunk/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php (modified) (3 diffs)
-
trunk/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_quater (added)
-
trunk/vendor/twig/twig/test/Twig/Tests/Loader/Fixtures/named_quater/named_absolute.html (added)
-
trunk/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php (modified) (1 diff)
-
trunk/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php (modified) (1 diff)
-
trunk/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php (modified) (1 diff)
-
trunk/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php (modified) (2 diffs)
-
trunk/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php (modified) (1 diff)
-
trunk/vendor/twig/twig/test/Twig/Tests/Profiler (added)
-
trunk/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper (added)
-
trunk/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php (added)
-
trunk/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/BlackfireTest.php (added)
-
trunk/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/HtmlTest.php (added)
-
trunk/vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/TextTest.php (added)
-
trunk/vendor/twig/twig/test/Twig/Tests/Profiler/ProfileTest.php (added)
-
trunk/vendor/twig/twig/test/Twig/Tests/TemplateTest.php (modified) (3 diffs)
-
trunk/vendor/twig/twig/test/Twig/Tests/escapingTest.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
adentify/trunk/adentify.php
r1069203 r1083683 4 4 * Plugin URI: http://wordpress.adentify.com 5 5 * Description: A brief description of the Plugin. 6 * Version: 1.0. 26 * Version: 1.0.3 7 7 * Author: ValYouAd 8 8 * Author URI: http://www.valyouad.com … … 51 51 define( 'ADENTIFY_API_REFRESH_TOKEN', 'api_refresh_token'); 52 52 define( 'ADENTIFY_API_EXPIRES_TIMESTAMP', 'api_expires_timestamp'); 53 define( 'PLUGIN_VERSION', '1.0. 2');53 define( 'PLUGIN_VERSION', '1.0.3'); 54 54 define( 'ADENTIFY_SQL_TABLE_PHOTOS', 'adentify_photos'); 55 55 … … 125 125 $productProvidersId = array(); 126 126 127 // fill the settings array with the user's providers127 // fill the settings array with the user's providers 128 128 $productProviders = APIManager::getInstance()->getProductProviders(); 129 129 if (!empty($productProviders)) … … 165 165 } 166 166 167 if (APIManager::getInstance()->isAccesTokenValid()) { 168 $photos = APIManager::getInstance()->getPhotos(); 169 if ($photos && property_exists($photos, 'data')) { 170 DBManager::getInstance()->insertPhotos($photos->data); 171 } 172 } 173 167 174 echo Twig::render('adentify.settings.html.twig', $settings); 168 175 } … … 177 184 'AdEntify' 178 185 ); 186 179 187 echo Twig::render('admin\modals\upload.modal.html.twig', array( 180 188 'photos' => DBManager::getInstance()->getPhotos(), -
adentify/trunk/composer.lock
r1069180 r1083683 179 179 { 180 180 "name": "twig/twig", 181 "version": "v1.1 7.0",181 "version": "v1.18.0", 182 182 "source": { 183 183 "type": "git", 184 184 "url": "https://github.com/twigphp/Twig.git", 185 "reference": " 2493970fa4d587eca73f77e6d8bd48a8bdd4c608"186 }, 187 "dist": { 188 "type": "zip", 189 "url": "https://api.github.com/repos/twigphp/Twig/zipball/ 2493970fa4d587eca73f77e6d8bd48a8bdd4c608",190 "reference": " 2493970fa4d587eca73f77e6d8bd48a8bdd4c608",185 "reference": "4cf7464348e7f9893a93f7096a90b73722be99cf" 186 }, 187 "dist": { 188 "type": "zip", 189 "url": "https://api.github.com/repos/twigphp/Twig/zipball/4cf7464348e7f9893a93f7096a90b73722be99cf", 190 "reference": "4cf7464348e7f9893a93f7096a90b73722be99cf", 191 191 "shasum": "" 192 192 }, … … 197 197 "extra": { 198 198 "branch-alias": { 199 "dev-master": "1.1 7-dev"199 "dev-master": "1.18-dev" 200 200 } 201 201 }, … … 232 232 "templating" 233 233 ], 234 "time": "2015-01- 14 10:15:49"234 "time": "2015-01-25 17:32:08" 235 235 } 236 236 ], -
adentify/trunk/public/APIManager.php
r1062077 r1083683 275 275 update_option(ADENTIFY_API_REFRESH_TOKEN, $json->refresh_token); 276 276 update_option(ADENTIFY_API_EXPIRES_TIMESTAMP, strtotime(sprintf('+%s second', $json->expires_in))); 277 return true; 277 278 } else 278 279 return false; … … 325 326 'response_type' => 'code' 326 327 ))); 328 } 329 330 public function getPhotos() 331 { 332 $response = $this->getAction(sprintf('user/current')); 333 $user = json_decode($response); 334 if ($user) { 335 return json_decode($this->getAction(sprintf('users/%s/photos?limit=300', $user->id))); 336 } else { 337 return null; 338 } 327 339 } 328 340 -
adentify/trunk/public/DBManager.php
r1051693 r1083683 42 42 } 43 43 44 /** 45 * Insert photos in wordpress table 46 * 47 * @param $photos 48 */ 49 public function insertPhotos($photos) { 50 global $wpdb; 51 52 $table_name = $wpdb->prefix . ADENTIFY_SQL_TABLE_PHOTOS; 53 54 $ids = array(); 55 foreach($photos as $photo) 56 $ids[] = $photo->id; 57 58 $ids = implode(',', $ids); 59 60 $alreadyAddedPhotos = $wpdb->get_results("SELECT adentify_photo_id FROM $table_name WHERE adentify_photo_id IN($ids)"); 61 foreach($alreadyAddedPhotos as &$photo) 62 $photo = $photo->adentify_photo_id; 63 64 foreach($photos as $photo) { 65 if (in_array((string)$photo->id, $alreadyAddedPhotos)) 66 continue; 67 68 if (property_exists($photo, 'small_url') && $photo->small_url) { 69 $wpdb->insert( 70 $table_name, 71 array( 72 'time' => current_time( 'mysql' ), 73 'adentify_photo_id' => $photo->id, 74 'thumb_url' => $photo->small_url 75 ) 76 ); 77 } 78 } 79 } 80 44 81 public function getPhotos() 45 82 { -
adentify/trunk/readme.txt
r1069180 r1083683 4 4 Tags: tags, photos, photo, monetize, images 5 5 Requires at least: 3.0.1 6 Tested up to: 3.47 Stable tag: 1.0. 26 Tested up to: 4.1 7 Stable tag: 1.0.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 22 22 23 23 What a difference a tag makes? 24 ?100x Engagement25 ?10x Click-through rates26 ?5x Conversion24 - 100x Engagement 25 - 10x Click-through rates 26 - 5x Conversion 27 27 28 28 Sign up on AdEntify and install this plugin so you can start adding key pieces of information (brands, products, places, affiliate links and people) directly to your images with discreet and customizable tags. AdEntify monetizes your visual content by providing you access to thousands of products, brands and over 10,000 merchant links. The best part is that it can be seamlessly integrated into your platform and it?s super easy to use. … … 47 47 == Screenshots == 48 48 49 1. Tag your photo with products, people or plac s49 1. Tag your photo with products, people or places 50 50 2. Plugin's settings 51 51 3. Enjoy tags! 52 4. Get analytics! 52 53 53 54 == Changelog == … … 60 61 * Fix tags visibility in media library 61 62 * Vendors updates 63 = 1.0.3 = 64 * Add synchronization of AdEntify's account photos 65 * Add new screenshot of analytics 66 * Vendors updates -
adentify/trunk/vendor/autoload.php
r1069180 r1083683 5 5 require_once __DIR__ . '/composer' . '/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit e491e20965111888db47f8663238b757::getLoader();7 return ComposerAutoloaderInita2ae486784e465ad5ab19817aabb6cc2::getLoader(); -
adentify/trunk/vendor/composer/ClassLoader.php
r1069180 r1083683 54 54 private $useIncludePath = false; 55 55 private $classMap = array(); 56 57 private $classMapAuthoritative = false; 56 58 57 59 public function getPrefixes() … … 250 252 251 253 /** 254 * Turns off searching the prefix and fallback directories for classes 255 * that have not been registered with the class map. 256 * 257 * @param bool $classMapAuthoritative 258 */ 259 public function setClassMapAuthoritative($classMapAuthoritative) 260 { 261 $this->classMapAuthoritative = $classMapAuthoritative; 262 } 263 264 /** 265 * Should class lookup fail if not found in the current class map? 266 * 267 * @return bool 268 */ 269 public function isClassMapAuthoritative() 270 { 271 return $this->classMapAuthoritative; 272 } 273 274 /** 252 275 * Registers this instance as an autoloader. 253 276 * … … 299 322 if (isset($this->classMap[$class])) { 300 323 return $this->classMap[$class]; 324 } 325 if ($this->classMapAuthoritative) { 326 return false; 301 327 } 302 328 -
adentify/trunk/vendor/composer/autoload_real.php
r1069180 r1083683 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit e491e20965111888db47f8663238b7575 class ComposerAutoloaderInita2ae486784e465ad5ab19817aabb6cc2 6 6 { 7 7 private static $loader; … … 20 20 } 21 21 22 spl_autoload_register(array('ComposerAutoloaderInit e491e20965111888db47f8663238b757', 'loadClassLoader'), true, true);22 spl_autoload_register(array('ComposerAutoloaderInita2ae486784e465ad5ab19817aabb6cc2', 'loadClassLoader'), true, true); 23 23 self::$loader = $loader = new \Composer\Autoload\ClassLoader(); 24 spl_autoload_unregister(array('ComposerAutoloaderInit e491e20965111888db47f8663238b757', 'loadClassLoader'));24 spl_autoload_unregister(array('ComposerAutoloaderInita2ae486784e465ad5ab19817aabb6cc2', 'loadClassLoader')); 25 25 26 26 $map = require __DIR__ . '/autoload_namespaces.php'; … … 43 43 $includeFiles = require __DIR__ . '/autoload_files.php'; 44 44 foreach ($includeFiles as $file) { 45 composerRequire e491e20965111888db47f8663238b757($file);45 composerRequirea2ae486784e465ad5ab19817aabb6cc2($file); 46 46 } 47 47 … … 50 50 } 51 51 52 function composerRequire e491e20965111888db47f8663238b757($file)52 function composerRequirea2ae486784e465ad5ab19817aabb6cc2($file) 53 53 { 54 54 require $file; -
adentify/trunk/vendor/composer/installed.json
r1069180 r1083683 124 124 { 125 125 "name": "twig/twig", 126 "version": "v1.1 7.0",127 "version_normalized": "1.1 7.0.0",126 "version": "v1.18.0", 127 "version_normalized": "1.18.0.0", 128 128 "source": { 129 129 "type": "git", 130 130 "url": "https://github.com/twigphp/Twig.git", 131 "reference": " 2493970fa4d587eca73f77e6d8bd48a8bdd4c608"132 }, 133 "dist": { 134 "type": "zip", 135 "url": "https://api.github.com/repos/twigphp/Twig/zipball/ 2493970fa4d587eca73f77e6d8bd48a8bdd4c608",136 "reference": " 2493970fa4d587eca73f77e6d8bd48a8bdd4c608",131 "reference": "4cf7464348e7f9893a93f7096a90b73722be99cf" 132 }, 133 "dist": { 134 "type": "zip", 135 "url": "https://api.github.com/repos/twigphp/Twig/zipball/4cf7464348e7f9893a93f7096a90b73722be99cf", 136 "reference": "4cf7464348e7f9893a93f7096a90b73722be99cf", 137 137 "shasum": "" 138 138 }, … … 140 140 "php": ">=5.2.4" 141 141 }, 142 "time": "2015-01- 14 10:15:49",143 "type": "library", 144 "extra": { 145 "branch-alias": { 146 "dev-master": "1.1 7-dev"142 "time": "2015-01-25 17:32:08", 143 "type": "library", 144 "extra": { 145 "branch-alias": { 146 "dev-master": "1.18-dev" 147 147 } 148 148 }, -
adentify/trunk/vendor/twig/twig/.gitignore
r1051693 r1083683 1 /build 2 /composer.lock 1 3 /ext/twig/autom4te.cache/ 2 4 /phpunit.xml 5 /vendor -
adentify/trunk/vendor/twig/twig/CHANGELOG
r1069180 r1083683 1 * 1.18.0 (2015-XX-XX) 2 3 * fixed some error messages where the line was wrong (unknown variables or argument names) 4 * added a new way to customize the main Module node (via empty nodes) 5 * added Twig_Environment::createTemplate() to create a template from a string 6 * added a profiler 7 * fixed filesystem loader cache when different file paths are used for the same template 8 1 9 * 1.17.0 (2015-01-14) 2 10 -
adentify/trunk/vendor/twig/twig/composer.json
r1069180 r1083683 37 37 "extra": { 38 38 "branch-alias": { 39 "dev-master": "1.1 7-dev"39 "dev-master": "1.18-dev" 40 40 } 41 41 } -
adentify/trunk/vendor/twig/twig/doc/advanced.rst
r1069180 r1083683 282 282 objects are 'red':: 283 283 284 $twig = new Twig_Environment($loader) 284 $twig = new Twig_Environment($loader); 285 285 $test = new Twig_SimpleTest('red', function ($value) { 286 286 if (isset($value->color) && $value->color == 'red') { … … 300 300 This is used by many of the tests built into Twig:: 301 301 302 $twig = new Twig_Environment($loader) 302 $twig = new Twig_Environment($loader); 303 303 $test = new Twig_SimpleTest( 304 304 'odd', -
adentify/trunk/vendor/twig/twig/doc/api.rst
r1069180 r1083683 286 286 environment, making it safe to evaluate untrusted code. 287 287 288 * *Twig_Extension_Profiler*: Enabled the built-in Twig profiler (as of Twig 289 1.18). 290 288 291 * *Twig_Extension_Optimizer*: Optimizes the node tree before compilation. 289 292 … … 453 456 454 457 $sandbox = new Twig_Extension_Sandbox($policy, true); 458 459 Profiler Extension 460 ~~~~~~~~~~~~~~~~~~ 461 462 .. versionadded:: 1.18 463 The Profile extension was added in Twig 1.18. 464 465 The ``profiler`` extension enables a profiler for Twig templates; it should 466 only be used on your development machines as it adds some overhead:: 467 468 $profile = new Twig_Profiler_Profile(); 469 $twig->addExtension(new Twig_Extension_Profiler($profile)); 470 471 $dumper = new Twig_Profiler_Dumper_Text(); 472 echo $dumper->dump($profile); 473 474 A profile contains information about time and memory consumption for template, 475 block, and macro executions. 476 477 You can also dump the data in a `Blackfire.io <https://blackfire.io/>`_ 478 compatible format:: 479 480 $dumper = new Twig_Profiler_Dumper_Blackfire(); 481 file_put_contents('/path/to/profile.prof', $dumper->dump($profile)); 482 483 Upload the profile to visualize it (create a `free account 484 <https://blackfire.io/signup>`_ first): 485 486 .. code-block:: sh 487 488 blackfire --slot=7 upload /path/to/profile.prof 455 489 456 490 Optimizer Extension -
adentify/trunk/vendor/twig/twig/doc/filters/batch.rst
r1051693 r1083683 6 6 7 7 The ``batch`` filter "batches" items by returning a list of lists with the 8 given number of items. If you provide a second parameter, it is used to fill8 given number of items. A second parameter can be provided and used to fill in 9 9 missing items: 10 10 -
adentify/trunk/vendor/twig/twig/ext/twig/php_twig.h
r1069180 r1083683 16 16 #define PHP_TWIG_H 17 17 18 #define PHP_TWIG_VERSION "1.1 7.0"18 #define PHP_TWIG_VERSION "1.18.0" 19 19 20 20 #include "php.h" -
adentify/trunk/vendor/twig/twig/lib/Twig/Autoloader.php
r1051693 r1083683 20 20 * Registers Twig_Autoloader as an SPL autoloader. 21 21 * 22 * @param bool $prepend Whether to prepend the autoloader or not.22 * @param bool $prepend Whether to prepend the autoloader or not. 23 23 */ 24 24 public static function register($prepend = false) -
adentify/trunk/vendor/twig/twig/lib/Twig/Compiler.php
r1051693 r1083683 232 232 public function getDebugInfo() 233 233 { 234 ksort($this->debugInfo); 235 234 236 return $this->debugInfo; 235 237 } … … 238 240 * Indents the generated code. 239 241 * 240 * @param int $step The number of indentation to add242 * @param int $step The number of indentation to add 241 243 * 242 244 * @return Twig_Compiler The current compiler instance … … 252 254 * Outdents the generated code. 253 255 * 254 * @param int $step The number of indentation to remove256 * @param int $step The number of indentation to remove 255 257 * 256 258 * @return Twig_Compiler The current compiler instance -
adentify/trunk/vendor/twig/twig/lib/Twig/Environment.php
r1069180 r1083683 17 17 class Twig_Environment 18 18 { 19 const VERSION = '1.1 7.0';19 const VERSION = '1.18.0'; 20 20 21 21 protected $charset; … … 156 156 * Checks if debug mode is enabled. 157 157 * 158 * @return bool true if debug mode is enabled, false otherwise158 * @return bool true if debug mode is enabled, false otherwise 159 159 */ 160 160 public function isDebug() … … 182 182 * Checks if the auto_reload option is enabled. 183 183 * 184 * @return bool true if auto_reload is enabled, false otherwise184 * @return bool true if auto_reload is enabled, false otherwise 185 185 */ 186 186 public function isAutoReload() … … 208 208 * Checks if the strict_variables option is enabled. 209 209 * 210 * @return bool true if strict_variables is enabled, false otherwise210 * @return bool true if strict_variables is enabled, false otherwise 211 211 */ 212 212 public function isStrictVariables() … … 257 257 * Gets the template class associated with the given string. 258 258 * 259 * @param string $name The name for which to calculate the template class name260 * @param int $index The index if it is an embedded template259 * @param string $name The name for which to calculate the template class name 260 * @param int $index The index if it is an embedded template 261 261 * 262 262 * @return string The template class name … … 312 312 * Loads a template by name. 313 313 * 314 * @param string $name The template name315 * @param int $index The index if it is an embedded template314 * @param string $name The template name 315 * @param int $index The index if it is an embedded template 316 316 * 317 317 * @return Twig_TemplateInterface A template instance representing the given template name … … 348 348 349 349 /** 350 * Creates a template from source. 351 * 352 * This method should not be used as a generic way to load templates. 353 * 354 * @param string $name The template name 355 * @param int $index The index if it is an embedded template 356 * 357 * @return Twig_Template A template instance representing the given template name 358 * 359 * @throws Twig_Error_Loader When the template cannot be found 360 * @throws Twig_Error_Syntax When an error occurred during compilation 361 */ 362 public function createTemplate($template) 363 { 364 $name = sprintf('__string_template__%s', hash('sha256', uniqid(mt_rand(), true), false)); 365 366 $loader = new Twig_Loader_Chain(array( 367 new Twig_Loader_Array(array($name => $template)), 368 $current = $this->getLoader(), 369 )); 370 371 $this->setLoader($loader); 372 try { 373 $template = $this->loadTemplate($name); 374 } catch (Exception $e) { 375 $this->setLoader($current); 376 377 throw $e; 378 } 379 $this->setLoader($current); 380 381 return $template; 382 } 383 384 /** 350 385 * Returns true if the template is still fresh. 351 386 * … … 354 389 * not changed. 355 390 * 356 * @param string $name The template name357 * @param int $time The last modification time of the cached template358 * 359 * @return bool true if the template is fresh, false otherwise391 * @param string $name The template name 392 * @param int $time The last modification time of the cached template 393 * 394 * @return bool true if the template is fresh, false otherwise 360 395 */ 361 396 public function isTemplateFresh($name, $time) … … 628 663 * @param string $name The extension name 629 664 * 630 * @return bool Whether the extension is registered or not665 * @return bool Whether the extension is registered or not 631 666 */ 632 667 public function hasExtension($name) -
adentify/trunk/vendor/twig/twig/lib/Twig/Error.php
r1051693 r1083683 112 112 * Gets the template line where the error occurred. 113 113 * 114 * @return int The template line114 * @return int The template line 115 115 */ 116 116 public function getTemplateLine() … … 122 122 * Sets the template line where the error occurred. 123 123 * 124 * @param int $lineno The template line124 * @param int $lineno The template line 125 125 */ 126 126 public function setTemplateLine($lineno) -
adentify/trunk/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php
r1051693 r1083683 24 24 * @param string $name The name of the template to check if we can load 25 25 * 26 * @return bool If the template source code is handled by this loader or not26 * @return bool If the template source code is handled by this loader or not 27 27 */ 28 28 public function exists($name); -
adentify/trunk/vendor/twig/twig/lib/Twig/ExpressionParser.php
r1069180 r1083683 467 467 * Parses arguments. 468 468 * 469 * @param bool $namedArguments Whether to allow named arguments or not470 * @param bool $definition Whether we are parsing arguments for a function definition469 * @param bool $namedArguments Whether to allow named arguments or not 470 * @param bool $definition Whether we are parsing arguments for a function definition 471 471 */ 472 472 public function parseArguments($namedArguments = false, $definition = false) -
adentify/trunk/vendor/twig/twig/lib/Twig/Extension/Core.php
r1069180 r1083683 96 96 * Sets the default format to be used by the number_format filter. 97 97 * 98 * @param int $decimal The number of decimal places to use.99 * @param string $decimalPoint The character(s) to use for the decimal point.100 * @param string $thousandSep The character(s) to use for the thousands separator.98 * @param int $decimal The number of decimal places to use. 99 * @param string $decimalPoint The character(s) to use for the decimal point. 100 * @param string $thousandSep The character(s) to use for the thousands separator. 101 101 */ 102 102 public function setNumberFormat($decimal, $decimalPoint, $thousandSep) … … 622 622 * JSON encodes a variable. 623 623 * 624 * @param mixed $value The value to encode.625 * @param int $options Not used on PHP 5.2.x624 * @param mixed $value The value to encode. 625 * @param int $options Not used on PHP 5.2.x 626 626 * 627 627 * @return mixed The JSON encoded value … … 641 641 * JSON encodes a variable. 642 642 * 643 * @param mixed $value The value to encode.644 * @param int $options Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT643 * @param mixed $value The value to encode. 644 * @param int $options Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT 645 645 * 646 646 * @return mixed The JSON encoded value … … 1217 1217 * characters where a named entity does not exist. 1218 1218 */ 1219 1220 1219 return sprintf('&#x%s;', $hex); 1221 1220 } … … 1229 1228 * @param mixed $thing A variable 1230 1229 * 1231 * @return int The length of the value1230 * @return int The length of the value 1232 1231 */ 1233 1232 function twig_length_filter(Twig_Environment $env, $thing) … … 1313 1312 * @param mixed $thing A variable 1314 1313 * 1315 * @return int The length of the value1314 * @return int The length of the value 1316 1315 */ 1317 1316 function twig_length_filter(Twig_Environment $env, $thing) -
adentify/trunk/vendor/twig/twig/lib/Twig/Extension/StringLoader.php
r1051693 r1083683 44 44 function twig_template_from_string(Twig_Environment $env, $template) 45 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; 46 return $env->createTemplate($template); 64 47 } -
adentify/trunk/vendor/twig/twig/lib/Twig/Lexer.php
r1051693 r1083683 318 318 $this->moveCursor($match[0]); 319 319 $this->pushState(self::STATE_INTERPOLATION); 320 321 320 } elseif (preg_match(self::REGEX_DQ_STRING_PART, $this->code, $match, null, $this->cursor) && strlen($match[0]) > 0) { 322 321 $this->pushToken(Twig_Token::STRING_TYPE, stripcslashes($match[0])); 323 322 $this->moveCursor($match[0]); 324 325 323 } elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) { 326 324 list($expect, $lineno) = array_pop($this->brackets); -
adentify/trunk/vendor/twig/twig/lib/Twig/Loader/Filesystem.php
r1051693 r1083683 184 184 185 185 foreach ($this->paths[$namespace] as $path) { 186 if (false !== $realpath = realpath($path.'/'.$shortname)) { 187 return $this->cache[$name] = $realpath; 188 } 186 189 if (is_file($path.'/'.$shortname)) { 187 190 return $this->cache[$name] = $path.'/'.$shortname; -
adentify/trunk/vendor/twig/twig/lib/Twig/LoaderInterface.php
r1051693 r1083683 45 45 * @param timestamp $time The last modification time of the cached template 46 46 * 47 * @return bool true if the template is fresh, false otherwise47 * @return bool true if the template is fresh, false otherwise 48 48 * 49 49 * @throws Twig_Error_Loader When $name is not found -
adentify/trunk/vendor/twig/twig/lib/Twig/Node.php
r1051693 r1083683 29 29 * The attributes are automatically made available as array items ($this['name']). 30 30 * 31 * @param array $nodes An array of named nodes32 * @param array $attributes An array of attributes (should not be nodes)33 * @param int $lineno The line number34 * @param string $tag The tag name associated with the Node31 * @param array $nodes An array of named nodes 32 * @param array $attributes An array of attributes (should not be nodes) 33 * @param int $lineno The line number 34 * @param string $tag The tag name associated with the Node 35 35 */ 36 36 public function __construct(array $nodes = array(), array $attributes = array(), $lineno = 0, $tag = null) … … 125 125 * @param string The attribute name 126 126 * 127 * @return bool true if the attribute is defined, false otherwise127 * @return bool true if the attribute is defined, false otherwise 128 128 */ 129 129 public function hasAttribute($name) … … 174 174 * @param string The node name 175 175 * 176 * @return bool true if the node with the given name exists, false otherwise176 * @return bool true if the node with the given name exists, false otherwise 177 177 */ 178 178 public function hasNode($name) -
adentify/trunk/vendor/twig/twig/lib/Twig/Node/Expression/Call.php
r1069180 r1083683 91 91 protected function getArguments($callable, $arguments) 92 92 { 93 $callType = $this->getAttribute('type'); 94 $callName = $this->getAttribute('name'); 95 93 96 $parameters = array(); 94 97 $named = false; … … 98 101 $name = $this->normalizeName($name); 99 102 } elseif ($named) { 100 throw new Twig_Error_Syntax(sprintf('Positional arguments cannot be used after named arguments for %s "%s".', $ this->getAttribute('type'), $this->getAttribute('name')));103 throw new Twig_Error_Syntax(sprintf('Positional arguments cannot be used after named arguments for %s "%s".', $callType, $callName)); 101 104 } 102 105 … … 109 112 110 113 if (!$callable) { 111 throw new LogicException(sprintf('Named arguments are not supported for %s "%s".', $ this->getAttribute('type'), $this->getAttribute('name')));114 throw new LogicException(sprintf('Named arguments are not supported for %s "%s".', $callType, $callName)); 112 115 } 113 116 … … 140 143 $arguments = array(); 141 144 $names = array(); 145 $missingArguments = array(); 146 $optionalArguments = array(); 142 147 $pos = 0; 143 148 foreach ($definition as $param) { … … 146 151 if (array_key_exists($name, $parameters)) { 147 152 if (array_key_exists($pos, $parameters)) { 148 throw new Twig_Error_Syntax(sprintf('Argument "%s" is defined twice for %s "%s".', $name, $this->getAttribute('type'), $this->getAttribute('name'))); 149 } 150 153 throw new Twig_Error_Syntax(sprintf('Argument "%s" is defined twice for %s "%s".', $name, $callType, $callName)); 154 } 155 156 if (!empty($missingArguments)) { 157 throw new Twig_Error_Syntax(sprintf( 158 'Argument "%s" could not be assigned for %s "%s(%s)" because it is mapped to an internal PHP function which cannot determine default value for optional argument%s "%s".', 159 $name, $callType, $callName, implode(', ', $names), count($missingArguments) > 1 ? 's' : '', implode('", "', $missingArguments)) 160 ); 161 } 162 163 $arguments = array_merge($arguments, $optionalArguments); 151 164 $arguments[] = $parameters[$name]; 152 165 unset($parameters[$name]); 166 $optionalArguments = array(); 153 167 } elseif (array_key_exists($pos, $parameters)) { 168 $arguments = array_merge($arguments, $optionalArguments); 154 169 $arguments[] = $parameters[$pos]; 155 170 unset($parameters[$pos]); 171 $optionalArguments = array(); 156 172 ++$pos; 157 173 } elseif ($param->isDefaultValueAvailable()) { 158 $ arguments[] = new Twig_Node_Expression_Constant($param->getDefaultValue(), -1);174 $optionalArguments[] = new Twig_Node_Expression_Constant($param->getDefaultValue(), -1); 159 175 } elseif ($param->isOptional()) { 160 break; 176 if (empty($parameters)) { 177 break; 178 } else { 179 $missingArguments[] = $name; 180 } 161 181 } else { 162 throw new Twig_Error_Syntax(sprintf('Value for argument "%s" is required for %s "%s".', $name, $ this->getAttribute('type'), $this->getAttribute('name')));182 throw new Twig_Error_Syntax(sprintf('Value for argument "%s" is required for %s "%s".', $name, $callType, $callName)); 163 183 } 164 184 } 165 185 166 186 if (!empty($parameters)) { 187 $unknownParameter = null; 188 foreach ($parameters as $parameter) { 189 if ($parameter instanceof Twig_Node) { 190 $unknownParameter = $parameter; 191 break; 192 } 193 } 194 167 195 throw new Twig_Error_Syntax(sprintf( 168 196 'Unknown argument%s "%s" for %s "%s(%s)".', 169 count($parameters) > 1 ? 's' : '', implode('", "', array_keys($parameters)), $ this->getAttribute('type'), $this->getAttribute('name'), implode(', ', $names)170 ) );197 count($parameters) > 1 ? 's' : '', implode('", "', array_keys($parameters)), $callType, $callName, implode(', ', $names) 198 ), $unknownParameter ? $unknownParameter->getLine() : -1); 171 199 } 172 200 -
adentify/trunk/vendor/twig/twig/lib/Twig/Node/Expression/Name.php
r1051693 r1083683 26 26 { 27 27 $name = $this->getAttribute('name'); 28 29 $compiler->addDebugInfo($this); 28 30 29 31 if ($this->getAttribute('is_defined_test')) { -
adentify/trunk/vendor/twig/twig/lib/Twig/Node/Module.php
r1069180 r1083683 14 14 * Represents a module node. 15 15 * 16 * Consider this class as being final. If you need to customize the behavior of 17 * the generated class, consider adding nodes to the following nodes: display_start, 18 * display_end, constructor_start, constructor_end, and class_end. 19 * 16 20 * @author Fabien Potencier <fabien@symfony.com> 17 21 */ … … 21 25 { 22 26 // embedded templates are set as attributes so that they are only visited once by the visitors 23 parent::__construct(array('parent' => $parent, 'body' => $body, 'blocks' => $blocks, 'macros' => $macros, 'traits' => $traits), array('filename' => $filename, 'index' => null, 'embedded_templates' => $embeddedTemplates), 1); 27 parent::__construct(array( 28 'parent' => $parent, 29 'body' => $body, 30 'blocks' => $blocks, 31 'macros' => $macros, 32 'traits' => $traits, 33 'display_start' => new Twig_Node(), 34 'display_end' => new Twig_Node(), 35 'constructor_start' => new Twig_Node(), 36 'constructor_end' => new Twig_Node(), 37 'class_end' => new Twig_Node(), 38 ), array( 39 'filename' => $filename, 40 'index' => null, 41 'embedded_templates' => $embeddedTemplates, 42 ), 1); 24 43 } 25 44 … … 51 70 $this->compileClassHeader($compiler); 52 71 53 if (count($this->getNode('blocks')) || count($this->getNode('traits')) || null === $this->getNode('parent') || $this->getNode('parent') instanceof Twig_Node_Expression_Constant) { 72 if ( 73 count($this->getNode('blocks')) 74 || count($this->getNode('traits')) 75 || null === $this->getNode('parent') 76 || $this->getNode('parent') instanceof Twig_Node_Expression_Constant 77 || count($this->getNode('constructor_start')) 78 || count($this->getNode('constructor_end')) 79 ) { 54 80 $this->compileConstructor($compiler); 55 81 } … … 57 83 $this->compileGetParent($compiler); 58 84 59 $this->compileDisplayHeader($compiler); 60 61 $this->compileDisplayBody($compiler); 62 63 $this->compileDisplayFooter($compiler); 85 $this->compileDisplay($compiler); 64 86 65 87 $compiler->subcompile($this->getNode('blocks')); … … 90 112 91 113 if ($parent instanceof Twig_Node_Expression_Constant) { 92 $compiler->subcompile($ this->getNode('parent'));114 $compiler->subcompile($parent); 93 115 } else { 94 116 $compiler 95 117 ->raw("\$this->env->resolveTemplate(") 96 ->subcompile($ this->getNode('parent'))118 ->subcompile($parent) 97 119 ->raw(")") 98 120 ; … … 104 126 ->write("}\n\n") 105 127 ; 106 }107 108 protected function compileDisplayBody(Twig_Compiler $compiler)109 {110 $compiler->subcompile($this->getNode('body'));111 112 if (null !== $parent = $this->getNode('parent')) {113 $compiler->addDebugInfo($parent);114 if ($parent instanceof Twig_Node_Expression_Constant) {115 $compiler->write("\$this->parent");116 } else {117 $compiler->write("\$this->getParent(\$context)");118 }119 $compiler->raw("->display(\$context, array_merge(\$this->blocks, \$blocks));\n");120 }121 128 } 122 129 … … 139 146 ->write("public function __construct(Twig_Environment \$env)\n", "{\n") 140 147 ->indent() 148 ->subcompile($this->getNode('constructor_start')) 141 149 ->write("parent::__construct(\$env);\n\n") 142 150 ; … … 151 159 ->indent() 152 160 ->write("\$this->parent = \$this->env->loadTemplate(") 153 ->subcompile($ this->getNode('parent'))161 ->subcompile($parent) 154 162 ->raw(");\n") 155 163 ->outdent() … … 263 271 ->write(");\n") 264 272 ->outdent() 273 ->subcompile($this->getNode('constructor_end')) 265 274 ->write("}\n\n") 266 275 ; 267 276 } 268 277 269 protected function compileDisplay Header(Twig_Compiler $compiler)278 protected function compileDisplay(Twig_Compiler $compiler) 270 279 { 271 280 $compiler 272 281 ->write("protected function doDisplay(array \$context, array \$blocks = array())\n", "{\n") 273 282 ->indent() 274 ; 275 } 276 277 protected function compileDisplayFooter(Twig_Compiler $compiler) 278 { 279 $compiler 283 ->subcompile($this->getNode('display_start')) 284 ->subcompile($this->getNode('body')) 285 ; 286 287 if (null !== $parent = $this->getNode('parent')) { 288 $compiler->addDebugInfo($parent); 289 if ($parent instanceof Twig_Node_Expression_Constant) { 290 $compiler->write("\$this->parent"); 291 } else { 292 $compiler->write("\$this->getParent(\$context)"); 293 } 294 $compiler->raw("->display(\$context, array_merge(\$this->blocks, \$blocks));\n"); 295 } 296 297 $compiler 298 ->subcompile($this->getNode('display_end')) 280 299 ->outdent() 281 300 ->write("}\n\n") … … 286 305 { 287 306 $compiler 307 ->subcompile($this->getNode('class_end')) 288 308 ->outdent() 289 309 ->write("}\n") -
adentify/trunk/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php
r1069180 r1083683 37 37 * Constructor. 38 38 * 39 * @param int $optimizers The optimizer mode39 * @param int $optimizers The optimizer mode 40 40 */ 41 41 public function __construct($optimizers = -1) -
adentify/trunk/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php
r1051693 r1083683 77 77 $this->inAModule = false; 78 78 79 return new Twig_Node_SandboxedModule($node, $this->filters, $this->tags, $this->functions);79 $node->setNode('display_start', new Twig_Node(array(new Twig_Node_CheckSecurity($this->filters, $this->tags, $this->functions), $node->getNode('display_start')))); 80 80 } 81 81 -
adentify/trunk/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php
r1051693 r1083683 42 42 * Priority should be between -10 and 10 (0 is the default). 43 43 * 44 * @return int The priority level44 * @return int The priority level 45 45 */ 46 46 public function getPriority(); -
adentify/trunk/vendor/twig/twig/lib/Twig/Template.php
r1069180 r1083683 130 130 * directly. 131 131 * 132 * @param string $name The block name to display133 * @param array $context The context134 * @param array $blocks The current set of blocks135 * @param bool $useBlocks Whether to use the current set of blocks132 * @param string $name The block name to display 133 * @param array $context The context 134 * @param array $blocks The current set of blocks 135 * @param bool $useBlocks Whether to use the current set of blocks 136 136 */ 137 137 public function displayBlock($name, array $context, array $blocks = array(), $useBlocks = true) … … 189 189 * directly. 190 190 * 191 * @param string $name The block name to render192 * @param array $context The context193 * @param array $blocks The current set of blocks194 * @param bool $useBlocks Whether to use the current set of blocks191 * @param string $name The block name to render 192 * @param array $context The context 193 * @param array $blocks The current set of blocks 194 * @param bool $useBlocks Whether to use the current set of blocks 195 195 * 196 196 * @return string The rendered block … … 219 219 * @param string $name The block name 220 220 * 221 * @return bool true if the block exists, false otherwise221 * @return bool true if the block exists, false otherwise 222 222 */ 223 223 public function hasBlock($name) … … 325 325 * the way to get a variable value. 326 326 * 327 * @param array $context The context328 * @param string $item The variable to return from the context329 * @param bool $ignoreStrictCheck Whether to ignore the strict variable check or not327 * @param array $context The context 328 * @param string $item The variable to return from the context 329 * @param bool $ignoreStrictCheck Whether to ignore the strict variable check or not 330 330 * 331 331 * @return The content of the context variable … … 349 349 * Returns the attribute value for a given array/object. 350 350 * 351 * @param mixed $object The object or array from where to get the item352 * @param mixed $item The item to get from the array or object353 * @param array $arguments An array of arguments to pass if the item is an object method354 * @param string $type The type of attribute (@see Twig_Template constants)355 * @param bool $isDefinedTest Whether this is only a defined check356 * @param bool $ignoreStrictCheck Whether to ignore the strict attribute check or not351 * @param mixed $object The object or array from where to get the item 352 * @param mixed $item The item to get from the array or object 353 * @param array $arguments An array of arguments to pass if the item is an object method 354 * @param string $type The type of attribute (@see Twig_Template constants) 355 * @param bool $isDefinedTest Whether this is only a defined check 356 * @param bool $ignoreStrictCheck Whether to ignore the strict attribute check or not 357 357 * 358 358 * @return mixed The attribute value, or a Boolean when $isDefinedTest is true, or null when the attribute is not set and $ignoreStrictCheck is true … … 489 489 return $ret; 490 490 } 491 492 /**493 * This method is only useful when testing Twig. Do not use it.494 */495 public static function clearCache()496 {497 self::$cache = array();498 }499 491 } -
adentify/trunk/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php
r1051693 r1083683 124 124 if (false !== $exception) { 125 125 list($class, ) = explode(':', $exception); 126 $this->assertThat( NULL, new PHPUnit_Framework_Constraint_Exception($class));126 $this->assertThat(null, new PHPUnit_Framework_Constraint_Exception($class)); 127 127 } 128 128 -
adentify/trunk/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php
r1051693 r1083683 39 39 } 40 40 41 protected function getVariableGetter($name )41 protected function getVariableGetter($name, $line = false) 42 42 { 43 $line = $line > 0 ? "// line {$line}\n" : ''; 44 43 45 if (version_compare(phpversion(), '5.4.0RC1', '>=')) { 44 return sprintf(' (isset($context["%s"]) ? $context["%s"] : null)', $name, $name);46 return sprintf('%s(isset($context["%s"]) ? $context["%s"] : null)', $line, $name, $name); 45 47 } 46 48 47 return sprintf(' $this->getContext($context, "%s")', $name);49 return sprintf('%s$this->getContext($context, "%s")', $line, $name); 48 50 } 49 51 -
adentify/trunk/vendor/twig/twig/lib/Twig/Token.php
r1051693 r1083683 39 39 * Constructor. 40 40 * 41 * @param int $type The type of the token42 * @param string $value The token value43 * @param int $lineno The line position in the source41 * @param int $type The type of the token 42 * @param string $value The token value 43 * @param int $lineno The line position in the source 44 44 */ 45 45 public function __construct($type, $value, $lineno) … … 90 90 * Gets the line. 91 91 * 92 * @return int The source line92 * @return int The source line 93 93 */ 94 94 public function getLine() … … 100 100 * Gets the token type. 101 101 * 102 * @return int The token type102 * @return int The token type 103 103 */ 104 104 public function getType() … … 120 120 * Returns the constant representation (internal) of a given type. 121 121 * 122 * @param int $type The type as an integer123 * @param bool $short Whether to return a short representation or not122 * @param int $type The type as an integer 123 * @param bool $short Whether to return a short representation or not 124 124 * 125 125 * @return string The string representation … … 177 177 * Returns the english representation of a given type. 178 178 * 179 * @param int $type The type as an integer179 * @param int $type The type as an integer 180 180 * 181 181 * @return string The string representation -
adentify/trunk/vendor/twig/twig/lib/Twig/TokenStream.php
r1051693 r1083683 102 102 * Looks at the next token. 103 103 * 104 * @param int $number104 * @param int $number 105 105 * 106 106 * @return Twig_Token -
adentify/trunk/vendor/twig/twig/test/Twig/Tests/ErrorTest.php
r1069197 r1083683 113 113 {{ parent() }} 114 114 {% endblock %}", 115 'base' => '{% block content %}{{ foo.bar }}{% endblock %}' 115 'base' => '{% block content %}{{ foo.bar }}{% endblock %}', 116 116 ), 117 117 'base', 1, … … 128 128 {{ foo.bar }} 129 129 {% endblock %}", 130 'base' => '{% block content %}{% endblock %}' 130 'base' => '{% block content %}{% endblock %}', 131 131 ), 132 132 'index', 3, -
adentify/trunk/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php
r1069197 r1083683 33 33 array('{% set 1 + 2 = "foo" %}'), 34 34 array('{% set "bar" = "foo" %}'), 35 array('{% set %}{% endset %}') 35 array('{% set %}{% endset %}'), 36 36 ); 37 37 } … … 191 191 new Twig_Node_Expression_Constant(' baz', 1), 192 192 1 193 ) 193 ), 194 194 ), 195 195 -
adentify/trunk/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php
r1069197 r1083683 61 61 $loader->addPath($basePath.'/normal_ter'); 62 62 $loader->prependPath($basePath.'/normal_final'); 63 $loader->prependPath($basePath.'/named/../named_quater', 'named'); 63 64 $loader->prependPath($basePath.'/named_final', 'named'); 64 65 … … 71 72 $this->assertEquals(array( 72 73 $basePath.'/named_final', 74 $basePath.'/named/../named_quater', 73 75 $basePath.'/named', 74 76 $basePath.'/named_bis', … … 76 78 ), $loader->getPaths('named')); 77 79 80 $this->assertEquals( 81 $basePath.'/named_quater/named_absolute.html', 82 $loader->getCacheKey('@named/named_absolute.html') 83 ); 78 84 $this->assertEquals("path (final)\n", $loader->getSource('index.html')); 79 85 $this->assertEquals("path (final)\n", $loader->getSource('@__main__/index.html')); -
adentify/trunk/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php
r1069197 r1083683 21 21 'debug' => true, 22 22 'cache' => false, 23 'autoescape' => false 23 'autoescape' => false, 24 24 )); 25 25 -
adentify/trunk/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php
r1069197 r1083683 57 57 $node->getArguments('date', array('Y-m-d', 'timestamp' => null, 'unknown1' => '', 'unknown2' => '')); 58 58 } 59 60 /** 61 * @expectedException Twig_Error_Syntax 62 * @expectedExceptionMessage Argument "case_sensitivity" could not be assigned for function "substr_compare(main_str, str, offset, length, case_sensitivity)" because it is mapped to an internal PHP function which cannot determine default value for optional argument "length". 63 */ 64 public function testResolveArgumentsWithMissingValueForOptionalArgument() 65 { 66 if (defined('HHVM_VERSION')) { 67 $this->markTestSkipped('Skip under HHVM as the behavior is not the same as plain PHP (which is an edge case anyway)'); 68 } 69 70 $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'substr_compare')); 71 $node->getArguments('substr_compare', array('abcd', 'bc', 'offset' => 1, 'case_sensitivity' => true)); 72 } 73 74 public function testResolveArgumentsOnlyNecessaryArgumentsForCustomFunction() 75 { 76 $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'custom_function')); 77 78 $this->assertEquals(array('arg1'), $node->getArguments(array($this, 'customFunction'), array('arg1' => 'arg1'))); 79 } 80 81 public function customFunction($arg1, $arg2 = 'default', $arg3 = array()) 82 { 83 } 59 84 } 60 85 -
adentify/trunk/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php
r1069197 r1083683 75 75 /** 76 76 * @expectedException Twig_Error_Syntax 77 * @expectedExceptionMessage Unknown argument "foobar" for filter "date(format, timezone)" .77 * @expectedExceptionMessage Unknown argument "foobar" for filter "date(format, timezone)" at line 1. 78 78 */ 79 79 public function testCompileWithWrongNamedArgumentName() -
adentify/trunk/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php
r1069197 r1083683 35 35 $args = new Twig_Node_Expression_Array(array(), 1); 36 36 $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_Template::ANY_CALL, 1); 37 $tests[] = array($node, sprintf('%s%s, "bar", array())', $this->getAttributeGetter(), $this->getVariableGetter('foo' )));37 $tests[] = array($node, sprintf('%s%s, "bar", array())', $this->getAttributeGetter(), $this->getVariableGetter('foo', 1))); 38 38 39 39 $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_Template::ARRAY_CALL, 1); 40 $tests[] = array($node, sprintf('%s%s, "bar", array(), "array")', $this->getAttributeGetter(), $this->getVariableGetter('foo' )));40 $tests[] = array($node, sprintf('%s%s, "bar", array(), "array")', $this->getAttributeGetter(), $this->getVariableGetter('foo', 1))); 41 41 42 42 $args = new Twig_Node_Expression_Array(array(), 1); … … 44 44 $args->addElement(new Twig_Node_Expression_Constant('bar', 1)); 45 45 $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_Template::METHOD_CALL, 1); 46 $tests[] = array($node, sprintf('%s%s, "bar", array(0 => %s, 1 => "bar"), "method")', $this->getAttributeGetter(), $this->getVariableGetter('foo' ), $this->getVariableGetter('foo')));46 $tests[] = array($node, sprintf('%s%s, "bar", array(0 => %s, 1 => "bar"), "method")', $this->getAttributeGetter(), $this->getVariableGetter('foo', 1), $this->getVariableGetter('foo'))); 47 47 48 48 return $tests; -
adentify/trunk/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php
r1069197 r1083683 29 29 30 30 return array( 31 version_compare(PHP_VERSION, '5.4.0') >= 0 ? array($node, '(isset($context["foo"]) ? $context["foo"] : $this->getContext($context, "foo"))', $env) : array($node, '$this->getContext($context, "foo")', $env),32 array($node, $this->getVariableGetter('foo' ), $env1),33 array($self, '$this'),34 array($context, '$context'),31 array($node, "// line 1\n".(version_compare(PHP_VERSION, '5.4.0') >= 0 ? '(isset($context["foo"]) ? $context["foo"] : $this->getContext($context, "foo"))' : '$this->getContext($context, "foo")'), $env), 32 array($node, $this->getVariableGetter('foo', 1), $env1), 33 array($self, "// line 1\n\$this"), 34 array($context, "// line 1\n\$context"), 35 35 ); 36 36 } -
adentify/trunk/vendor/twig/twig/test/Twig/Tests/TemplateTest.php
r1069197 r1083683 311 311 // properties cannot be numbers 312 312 if (($testObject[0] instanceof stdClass || $testObject[0] instanceof Twig_TemplatePropertyObject) && is_numeric($test[2])) { 313 continue;313 continue; 314 314 } 315 315 … … 348 348 } 349 349 350 $methodAndPropObject = new Twig_TemplateMethodAndPropObject ;350 $methodAndPropObject = new Twig_TemplateMethodAndPropObject(); 351 351 352 352 // additional method tests … … 397 397 parent::__construct($env); 398 398 $this->useExtGetAttribute = $useExtGetAttribute; 399 Twig_Template::clearCache();399 self::$cache = array(); 400 400 } 401 401 -
adentify/trunk/vendor/twig/twig/test/Twig/Tests/escapingTest.php
r1069197 r1083683 7 7 * @license http://framework.zend.com/license/new-bsd New BSD License 8 8 */ 9 10 9 class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase 11 10 { … … 18 17 '<' => '<', 19 18 '>' => '>', 20 '&' => '&' 19 '&' => '&', 21 20 ); 22 21 … … 228 227 * Convert a Unicode Codepoint to a literal UTF-8 character. 229 228 * 230 * @param int$codepoint Unicode codepoint in hex notation229 * @param int $codepoint Unicode codepoint in hex notation 231 230 * @return string UTF-8 literal string 232 231 */ … … 257 256 { 258 257 $immune = array(',', '.', '_'); // Exceptions to escaping ranges 259 for ($chr =0; $chr < 0xFF; $chr++) {258 for ($chr = 0; $chr < 0xFF; $chr++) { 260 259 if ($chr >= 0x30 && $chr <= 0x39 261 260 || $chr >= 0x41 && $chr <= 0x5A … … 280 279 { 281 280 $immune = array(',', '.', '-', '_'); // Exceptions to escaping ranges 282 for ($chr =0; $chr < 0xFF; $chr++) {281 for ($chr = 0; $chr < 0xFF; $chr++) { 283 282 if ($chr >= 0x30 && $chr <= 0x39 284 283 || $chr >= 0x41 && $chr <= 0x5A … … 303 302 { 304 303 // CSS has no exceptions to escaping ranges 305 for ($chr =0; $chr < 0xFF; $chr++) {304 for ($chr = 0; $chr < 0xFF; $chr++) { 306 305 if ($chr >= 0x30 && $chr <= 0x39 307 306 || $chr >= 0x41 && $chr <= 0x5A
Note: See TracChangeset
for help on using the changeset viewer.