Plugin Directory

Changeset 1083683


Ignore:
Timestamp:
02/06/2015 10:09:43 AM (11 years ago)
Author:
AdEntify
Message:

1.0.3

Location:
adentify
Files:
28 added
49 edited

Legend:

Unmodified
Added
Removed
  • adentify/trunk/adentify.php

    r1069203 r1083683  
    44 * Plugin URI: http://wordpress.adentify.com
    55 * Description: A brief description of the Plugin.
    6  * Version: 1.0.2
     6 * Version: 1.0.3
    77 * Author: ValYouAd
    88 * Author URI: http://www.valyouad.com
     
    5151define( 'ADENTIFY_API_REFRESH_TOKEN', 'api_refresh_token');
    5252define( 'ADENTIFY_API_EXPIRES_TIMESTAMP', 'api_expires_timestamp');
    53 define( 'PLUGIN_VERSION', '1.0.2');
     53define( 'PLUGIN_VERSION', '1.0.3');
    5454define( 'ADENTIFY_SQL_TABLE_PHOTOS', 'adentify_photos');
    5555
     
    125125    $productProvidersId = array();
    126126
    127     //fill the settings array with the user's providers
     127    // fill the settings array with the user's providers
    128128    $productProviders = APIManager::getInstance()->getProductProviders();
    129129    if (!empty($productProviders))
     
    165165    }
    166166
     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
    167174    echo Twig::render('adentify.settings.html.twig', $settings);
    168175}
     
    177184        'AdEntify'
    178185    );
     186
    179187    echo Twig::render('admin\modals\upload.modal.html.twig', array(
    180188        'photos' => DBManager::getInstance()->getPhotos(),
  • adentify/trunk/composer.lock

    r1069180 r1083683  
    179179        {
    180180            "name": "twig/twig",
    181             "version": "v1.17.0",
     181            "version": "v1.18.0",
    182182            "source": {
    183183                "type": "git",
    184184                "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",
    191191                "shasum": ""
    192192            },
     
    197197            "extra": {
    198198                "branch-alias": {
    199                     "dev-master": "1.17-dev"
     199                    "dev-master": "1.18-dev"
    200200                }
    201201            },
     
    232232                "templating"
    233233            ],
    234             "time": "2015-01-14 10:15:49"
     234            "time": "2015-01-25 17:32:08"
    235235        }
    236236    ],
  • adentify/trunk/public/APIManager.php

    r1062077 r1083683  
    275275                update_option(ADENTIFY_API_REFRESH_TOKEN, $json->refresh_token);
    276276                update_option(ADENTIFY_API_EXPIRES_TIMESTAMP, strtotime(sprintf('+%s second', $json->expires_in)));
     277                return true;
    277278            } else
    278279                return false;
     
    325326            'response_type' => 'code'
    326327        )));
     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        }
    327339    }
    328340
  • adentify/trunk/public/DBManager.php

    r1051693 r1083683  
    4242    }
    4343
     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
    4481    public function getPhotos()
    4582    {
  • adentify/trunk/readme.txt

    r1069180 r1083683  
    44Tags: tags, photos, photo, monetize, images
    55Requires at least: 3.0.1
    6 Tested up to: 3.4
    7 Stable tag: 1.0.2
     6Tested up to: 4.1
     7Stable tag: 1.0.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2222
    2323What a difference a tag makes?
    24 ? 100x Engagement
    25 ? 10x Click-through rates
    26 ? 5x Conversion
     24- 100x Engagement
     25- 10x Click-through rates
     26- 5x Conversion
    2727
    2828Sign 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.
     
    4747== Screenshots ==
    4848
    49 1. Tag your photo with products, people or placs
     491. Tag your photo with products, people or places
    50502. Plugin's settings
    51513. Enjoy tags!
     524. Get analytics!
    5253
    5354== Changelog ==
     
    6061* Fix tags visibility in media library
    6162* 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  
    55require_once __DIR__ . '/composer' . '/autoload_real.php';
    66
    7 return ComposerAutoloaderInite491e20965111888db47f8663238b757::getLoader();
     7return ComposerAutoloaderInita2ae486784e465ad5ab19817aabb6cc2::getLoader();
  • adentify/trunk/vendor/composer/ClassLoader.php

    r1069180 r1083683  
    5454    private $useIncludePath = false;
    5555    private $classMap = array();
     56
     57    private $classMapAuthoritative = false;
    5658
    5759    public function getPrefixes()
     
    250252
    251253    /**
     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    /**
    252275     * Registers this instance as an autoloader.
    253276     *
     
    299322        if (isset($this->classMap[$class])) {
    300323            return $this->classMap[$class];
     324        }
     325        if ($this->classMapAuthoritative) {
     326            return false;
    301327        }
    302328
  • adentify/trunk/vendor/composer/autoload_real.php

    r1069180 r1083683  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInite491e20965111888db47f8663238b757
     5class ComposerAutoloaderInita2ae486784e465ad5ab19817aabb6cc2
    66{
    77    private static $loader;
     
    2020        }
    2121
    22         spl_autoload_register(array('ComposerAutoloaderInite491e20965111888db47f8663238b757', 'loadClassLoader'), true, true);
     22        spl_autoload_register(array('ComposerAutoloaderInita2ae486784e465ad5ab19817aabb6cc2', 'loadClassLoader'), true, true);
    2323        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
    24         spl_autoload_unregister(array('ComposerAutoloaderInite491e20965111888db47f8663238b757', 'loadClassLoader'));
     24        spl_autoload_unregister(array('ComposerAutoloaderInita2ae486784e465ad5ab19817aabb6cc2', 'loadClassLoader'));
    2525
    2626        $map = require __DIR__ . '/autoload_namespaces.php';
     
    4343        $includeFiles = require __DIR__ . '/autoload_files.php';
    4444        foreach ($includeFiles as $file) {
    45             composerRequiree491e20965111888db47f8663238b757($file);
     45            composerRequirea2ae486784e465ad5ab19817aabb6cc2($file);
    4646        }
    4747
     
    5050}
    5151
    52 function composerRequiree491e20965111888db47f8663238b757($file)
     52function composerRequirea2ae486784e465ad5ab19817aabb6cc2($file)
    5353{
    5454    require $file;
  • adentify/trunk/vendor/composer/installed.json

    r1069180 r1083683  
    124124    {
    125125        "name": "twig/twig",
    126         "version": "v1.17.0",
    127         "version_normalized": "1.17.0.0",
     126        "version": "v1.18.0",
     127        "version_normalized": "1.18.0.0",
    128128        "source": {
    129129            "type": "git",
    130130            "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",
    137137            "shasum": ""
    138138        },
     
    140140            "php": ">=5.2.4"
    141141        },
    142         "time": "2015-01-14 10:15:49",
    143         "type": "library",
    144         "extra": {
    145             "branch-alias": {
    146                 "dev-master": "1.17-dev"
     142        "time": "2015-01-25 17:32:08",
     143        "type": "library",
     144        "extra": {
     145            "branch-alias": {
     146                "dev-master": "1.18-dev"
    147147            }
    148148        },
  • adentify/trunk/vendor/twig/twig/.gitignore

    r1051693 r1083683  
     1/build
     2/composer.lock
    13/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
    19* 1.17.0 (2015-01-14)
    210
  • adentify/trunk/vendor/twig/twig/composer.json

    r1069180 r1083683  
    3737    "extra": {
    3838        "branch-alias": {
    39             "dev-master": "1.17-dev"
     39            "dev-master": "1.18-dev"
    4040        }
    4141    }
  • adentify/trunk/vendor/twig/twig/doc/advanced.rst

    r1069180 r1083683  
    282282objects are 'red'::
    283283
    284     $twig = new Twig_Environment($loader)
     284    $twig = new Twig_Environment($loader);
    285285    $test = new Twig_SimpleTest('red', function ($value) {
    286286        if (isset($value->color) && $value->color == 'red') {
     
    300300This is used by many of the tests built into Twig::
    301301
    302     $twig = new Twig_Environment($loader)
     302    $twig = new Twig_Environment($loader);
    303303    $test = new Twig_SimpleTest(
    304304        'odd',
  • adentify/trunk/vendor/twig/twig/doc/api.rst

    r1069180 r1083683  
    286286  environment, making it safe to evaluate untrusted code.
    287287
     288* *Twig_Extension_Profiler*: Enabled the built-in Twig profiler (as of Twig
     289  1.18).
     290
    288291* *Twig_Extension_Optimizer*: Optimizes the node tree before compilation.
    289292
     
    453456
    454457    $sandbox = new Twig_Extension_Sandbox($policy, true);
     458
     459Profiler Extension
     460~~~~~~~~~~~~~~~~~~
     461
     462.. versionadded:: 1.18
     463    The Profile extension was added in Twig 1.18.
     464
     465The ``profiler`` extension enables a profiler for Twig templates; it should
     466only 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
     474A profile contains information about time and memory consumption for template,
     475block, and macro executions.
     476
     477You can also dump the data in a `Blackfire.io <https://blackfire.io/>`_
     478compatible format::
     479
     480    $dumper = new Twig_Profiler_Dumper_Blackfire();
     481    file_put_contents('/path/to/profile.prof', $dumper->dump($profile));
     482
     483Upload 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
    455489
    456490Optimizer Extension
  • adentify/trunk/vendor/twig/twig/doc/filters/batch.rst

    r1051693 r1083683  
    66
    77The ``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 fill
     8given number of items. A second parameter can be provided and used to fill in
    99missing items:
    1010
  • adentify/trunk/vendor/twig/twig/ext/twig/php_twig.h

    r1069180 r1083683  
    1616#define PHP_TWIG_H
    1717
    18 #define PHP_TWIG_VERSION "1.17.0"
     18#define PHP_TWIG_VERSION "1.18.0"
    1919
    2020#include "php.h"
  • adentify/trunk/vendor/twig/twig/lib/Twig/Autoloader.php

    r1051693 r1083683  
    2020     * Registers Twig_Autoloader as an SPL autoloader.
    2121     *
    22      * @param bool    $prepend Whether to prepend the autoloader or not.
     22     * @param bool $prepend Whether to prepend the autoloader or not.
    2323     */
    2424    public static function register($prepend = false)
  • adentify/trunk/vendor/twig/twig/lib/Twig/Compiler.php

    r1051693 r1083683  
    232232    public function getDebugInfo()
    233233    {
     234        ksort($this->debugInfo);
     235
    234236        return $this->debugInfo;
    235237    }
     
    238240     * Indents the generated code.
    239241     *
    240      * @param int     $step The number of indentation to add
     242     * @param int $step The number of indentation to add
    241243     *
    242244     * @return Twig_Compiler The current compiler instance
     
    252254     * Outdents the generated code.
    253255     *
    254      * @param int     $step The number of indentation to remove
     256     * @param int $step The number of indentation to remove
    255257     *
    256258     * @return Twig_Compiler The current compiler instance
  • adentify/trunk/vendor/twig/twig/lib/Twig/Environment.php

    r1069180 r1083683  
    1717class Twig_Environment
    1818{
    19     const VERSION = '1.17.0';
     19    const VERSION = '1.18.0';
    2020
    2121    protected $charset;
     
    156156     * Checks if debug mode is enabled.
    157157     *
    158      * @return bool    true if debug mode is enabled, false otherwise
     158     * @return bool true if debug mode is enabled, false otherwise
    159159     */
    160160    public function isDebug()
     
    182182     * Checks if the auto_reload option is enabled.
    183183     *
    184      * @return bool    true if auto_reload is enabled, false otherwise
     184     * @return bool true if auto_reload is enabled, false otherwise
    185185     */
    186186    public function isAutoReload()
     
    208208     * Checks if the strict_variables option is enabled.
    209209     *
    210      * @return bool    true if strict_variables is enabled, false otherwise
     210     * @return bool true if strict_variables is enabled, false otherwise
    211211     */
    212212    public function isStrictVariables()
     
    257257     * Gets the template class associated with the given string.
    258258     *
    259      * @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
     259     * @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
    261261     *
    262262     * @return string The template class name
     
    312312     * Loads a template by name.
    313313     *
    314      * @param string  $name  The template name
    315      * @param int     $index The index if it is an embedded template
     314     * @param string $name  The template name
     315     * @param int    $index The index if it is an embedded template
    316316     *
    317317     * @return Twig_TemplateInterface A template instance representing the given template name
     
    348348
    349349    /**
     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    /**
    350385     * Returns true if the template is still fresh.
    351386     *
     
    354389     * not changed.
    355390     *
    356      * @param string    $name The template name
    357      * @param int       $time The last modification time of the cached template
    358      *
    359      * @return bool    true if the template is fresh, false otherwise
     391     * @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
    360395     */
    361396    public function isTemplateFresh($name, $time)
     
    628663     * @param string $name The extension name
    629664     *
    630      * @return bool    Whether the extension is registered or not
     665     * @return bool Whether the extension is registered or not
    631666     */
    632667    public function hasExtension($name)
  • adentify/trunk/vendor/twig/twig/lib/Twig/Error.php

    r1051693 r1083683  
    112112     * Gets the template line where the error occurred.
    113113     *
    114      * @return int     The template line
     114     * @return int The template line
    115115     */
    116116    public function getTemplateLine()
     
    122122     * Sets the template line where the error occurred.
    123123     *
    124      * @param int     $lineno The template line
     124     * @param int $lineno The template line
    125125     */
    126126    public function setTemplateLine($lineno)
  • adentify/trunk/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php

    r1051693 r1083683  
    2424     * @param string $name The name of the template to check if we can load
    2525     *
    26      * @return bool    If the template source code is handled by this loader or not
     26     * @return bool If the template source code is handled by this loader or not
    2727     */
    2828    public function exists($name);
  • adentify/trunk/vendor/twig/twig/lib/Twig/ExpressionParser.php

    r1069180 r1083683  
    467467     * Parses arguments.
    468468     *
    469      * @param bool    $namedArguments Whether to allow named arguments or not
    470      * @param bool    $definition     Whether we are parsing arguments for a function definition
     469     * @param bool $namedArguments Whether to allow named arguments or not
     470     * @param bool $definition     Whether we are parsing arguments for a function definition
    471471     */
    472472    public function parseArguments($namedArguments = false, $definition = false)
  • adentify/trunk/vendor/twig/twig/lib/Twig/Extension/Core.php

    r1069180 r1083683  
    9696     * Sets the default format to be used by the number_format filter.
    9797     *
    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.
    101101     */
    102102    public function setNumberFormat($decimal, $decimalPoint, $thousandSep)
     
    622622     * JSON encodes a variable.
    623623     *
    624      * @param mixed   $value   The value to encode.
    625      * @param int     $options Not used on PHP 5.2.x
     624     * @param mixed $value   The value to encode.
     625     * @param int   $options Not used on PHP 5.2.x
    626626     *
    627627     * @return mixed The JSON encoded value
     
    641641     * JSON encodes a variable.
    642642     *
    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_OBJECT
     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_OBJECT
    645645     *
    646646     * @return mixed The JSON encoded value
     
    12171217     * characters where a named entity does not exist.
    12181218     */
    1219 
    12201219    return sprintf('&#x%s;', $hex);
    12211220}
     
    12291228     * @param mixed            $thing A variable
    12301229     *
    1231      * @return int     The length of the value
     1230     * @return int The length of the value
    12321231     */
    12331232    function twig_length_filter(Twig_Environment $env, $thing)
     
    13131312     * @param mixed            $thing A variable
    13141313     *
    1315      * @return int     The length of the value
     1314     * @return int The length of the value
    13161315     */
    13171316    function twig_length_filter(Twig_Environment $env, $thing)
  • adentify/trunk/vendor/twig/twig/lib/Twig/Extension/StringLoader.php

    r1051693 r1083683  
    4444function twig_template_from_string(Twig_Environment $env, $template)
    4545{
    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);
    6447}
  • adentify/trunk/vendor/twig/twig/lib/Twig/Lexer.php

    r1051693 r1083683  
    318318            $this->moveCursor($match[0]);
    319319            $this->pushState(self::STATE_INTERPOLATION);
    320 
    321320        } elseif (preg_match(self::REGEX_DQ_STRING_PART, $this->code, $match, null, $this->cursor) && strlen($match[0]) > 0) {
    322321            $this->pushToken(Twig_Token::STRING_TYPE, stripcslashes($match[0]));
    323322            $this->moveCursor($match[0]);
    324 
    325323        } elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) {
    326324            list($expect, $lineno) = array_pop($this->brackets);
  • adentify/trunk/vendor/twig/twig/lib/Twig/Loader/Filesystem.php

    r1051693 r1083683  
    184184
    185185        foreach ($this->paths[$namespace] as $path) {
     186            if (false !== $realpath = realpath($path.'/'.$shortname)) {
     187                return $this->cache[$name] = $realpath;
     188            }
    186189            if (is_file($path.'/'.$shortname)) {
    187190                return $this->cache[$name] = $path.'/'.$shortname;
  • adentify/trunk/vendor/twig/twig/lib/Twig/LoaderInterface.php

    r1051693 r1083683  
    4545     * @param timestamp $time The last modification time of the cached template
    4646     *
    47      * @return bool    true if the template is fresh, false otherwise
     47     * @return bool true if the template is fresh, false otherwise
    4848     *
    4949     * @throws Twig_Error_Loader When $name is not found
  • adentify/trunk/vendor/twig/twig/lib/Twig/Node.php

    r1051693 r1083683  
    2929     * The attributes are automatically made available as array items ($this['name']).
    3030     *
    31      * @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
     31     * @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
    3535     */
    3636    public function __construct(array $nodes = array(), array $attributes = array(), $lineno = 0, $tag = null)
     
    125125     * @param  string  The attribute name
    126126     *
    127      * @return bool    true if the attribute is defined, false otherwise
     127     * @return bool true if the attribute is defined, false otherwise
    128128     */
    129129    public function hasAttribute($name)
     
    174174     * @param  string  The node name
    175175     *
    176      * @return bool    true if the node with the given name exists, false otherwise
     176     * @return bool true if the node with the given name exists, false otherwise
    177177     */
    178178    public function hasNode($name)
  • adentify/trunk/vendor/twig/twig/lib/Twig/Node/Expression/Call.php

    r1069180 r1083683  
    9191    protected function getArguments($callable, $arguments)
    9292    {
     93        $callType = $this->getAttribute('type');
     94        $callName = $this->getAttribute('name');
     95
    9396        $parameters = array();
    9497        $named = false;
     
    98101                $name = $this->normalizeName($name);
    99102            } 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));
    101104            }
    102105
     
    109112
    110113        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));
    112115        }
    113116
     
    140143        $arguments = array();
    141144        $names = array();
     145        $missingArguments = array();
     146        $optionalArguments = array();
    142147        $pos = 0;
    143148        foreach ($definition as $param) {
     
    146151            if (array_key_exists($name, $parameters)) {
    147152                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);
    151164                $arguments[] = $parameters[$name];
    152165                unset($parameters[$name]);
     166                $optionalArguments = array();
    153167            } elseif (array_key_exists($pos, $parameters)) {
     168                $arguments = array_merge($arguments, $optionalArguments);
    154169                $arguments[] = $parameters[$pos];
    155170                unset($parameters[$pos]);
     171                $optionalArguments = array();
    156172                ++$pos;
    157173            } elseif ($param->isDefaultValueAvailable()) {
    158                 $arguments[] = new Twig_Node_Expression_Constant($param->getDefaultValue(), -1);
     174                $optionalArguments[] = new Twig_Node_Expression_Constant($param->getDefaultValue(), -1);
    159175            } elseif ($param->isOptional()) {
    160                 break;
     176                if (empty($parameters)) {
     177                    break;
     178                } else {
     179                    $missingArguments[] = $name;
     180                }
    161181            } 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));
    163183            }
    164184        }
    165185
    166186        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
    167195            throw new Twig_Error_Syntax(sprintf(
    168196                '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);
    171199        }
    172200
  • adentify/trunk/vendor/twig/twig/lib/Twig/Node/Expression/Name.php

    r1051693 r1083683  
    2626    {
    2727        $name = $this->getAttribute('name');
     28
     29        $compiler->addDebugInfo($this);
    2830
    2931        if ($this->getAttribute('is_defined_test')) {
  • adentify/trunk/vendor/twig/twig/lib/Twig/Node/Module.php

    r1069180 r1083683  
    1414 * Represents a module node.
    1515 *
     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 *
    1620 * @author Fabien Potencier <fabien@symfony.com>
    1721 */
     
    2125    {
    2226        // 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);
    2443    }
    2544
     
    5170        $this->compileClassHeader($compiler);
    5271
    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        ) {
    5480            $this->compileConstructor($compiler);
    5581        }
     
    5783        $this->compileGetParent($compiler);
    5884
    59         $this->compileDisplayHeader($compiler);
    60 
    61         $this->compileDisplayBody($compiler);
    62 
    63         $this->compileDisplayFooter($compiler);
     85        $this->compileDisplay($compiler);
    6486
    6587        $compiler->subcompile($this->getNode('blocks'));
     
    90112
    91113        if ($parent instanceof Twig_Node_Expression_Constant) {
    92             $compiler->subcompile($this->getNode('parent'));
     114            $compiler->subcompile($parent);
    93115        } else {
    94116            $compiler
    95117                ->raw("\$this->env->resolveTemplate(")
    96                 ->subcompile($this->getNode('parent'))
     118                ->subcompile($parent)
    97119                ->raw(")")
    98120            ;
     
    104126            ->write("}\n\n")
    105127        ;
    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         }
    121128    }
    122129
     
    139146            ->write("public function __construct(Twig_Environment \$env)\n", "{\n")
    140147            ->indent()
     148            ->subcompile($this->getNode('constructor_start'))
    141149            ->write("parent::__construct(\$env);\n\n")
    142150        ;
     
    151159                ->indent()
    152160                ->write("\$this->parent = \$this->env->loadTemplate(")
    153                 ->subcompile($this->getNode('parent'))
     161                ->subcompile($parent)
    154162                ->raw(");\n")
    155163                ->outdent()
     
    263271            ->write(");\n")
    264272            ->outdent()
     273            ->subcompile($this->getNode('constructor_end'))
    265274            ->write("}\n\n")
    266275        ;
    267276    }
    268277
    269     protected function compileDisplayHeader(Twig_Compiler $compiler)
     278    protected function compileDisplay(Twig_Compiler $compiler)
    270279    {
    271280        $compiler
    272281            ->write("protected function doDisplay(array \$context, array \$blocks = array())\n", "{\n")
    273282            ->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'))
    280299            ->outdent()
    281300            ->write("}\n\n")
     
    286305    {
    287306        $compiler
     307            ->subcompile($this->getNode('class_end'))
    288308            ->outdent()
    289309            ->write("}\n")
  • adentify/trunk/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php

    r1069180 r1083683  
    3737     * Constructor.
    3838     *
    39      * @param int     $optimizers The optimizer mode
     39     * @param int $optimizers The optimizer mode
    4040     */
    4141    public function __construct($optimizers = -1)
  • adentify/trunk/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php

    r1051693 r1083683  
    7777            $this->inAModule = false;
    7878
    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'))));
    8080        }
    8181
  • adentify/trunk/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php

    r1051693 r1083683  
    4242     * Priority should be between -10 and 10 (0 is the default).
    4343     *
    44      * @return int     The priority level
     44     * @return int The priority level
    4545     */
    4646    public function getPriority();
  • adentify/trunk/vendor/twig/twig/lib/Twig/Template.php

    r1069180 r1083683  
    130130     * directly.
    131131     *
    132      * @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
     132     * @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
    136136     */
    137137    public function displayBlock($name, array $context, array $blocks = array(), $useBlocks = true)
     
    189189     * directly.
    190190     *
    191      * @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
     191     * @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
    195195     *
    196196     * @return string The rendered block
     
    219219     * @param string $name The block name
    220220     *
    221      * @return bool    true if the block exists, false otherwise
     221     * @return bool true if the block exists, false otherwise
    222222     */
    223223    public function hasBlock($name)
     
    325325     * the way to get a variable value.
    326326     *
    327      * @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
     327     * @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
    330330     *
    331331     * @return The content of the context variable
     
    349349     * Returns the attribute value for a given array/object.
    350350     *
    351      * @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
     351     * @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
    357357     *
    358358     * @return mixed The attribute value, or a Boolean when $isDefinedTest is true, or null when the attribute is not set and $ignoreStrictCheck is true
     
    489489        return $ret;
    490490    }
    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     }
    499491}
  • adentify/trunk/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php

    r1051693 r1083683  
    124124            if (false !== $exception) {
    125125                list($class, ) = explode(':', $exception);
    126                 $this->assertThat(NULL, new PHPUnit_Framework_Constraint_Exception($class));
     126                $this->assertThat(null, new PHPUnit_Framework_Constraint_Exception($class));
    127127            }
    128128
  • adentify/trunk/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php

    r1051693 r1083683  
    3939    }
    4040
    41     protected function getVariableGetter($name)
     41    protected function getVariableGetter($name, $line = false)
    4242    {
     43        $line = $line > 0 ? "// line {$line}\n" : '';
     44
    4345        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);
    4547        }
    4648
    47         return sprintf('$this->getContext($context, "%s")', $name);
     49        return sprintf('%s$this->getContext($context, "%s")', $line, $name);
    4850    }
    4951
  • adentify/trunk/vendor/twig/twig/lib/Twig/Token.php

    r1051693 r1083683  
    3939     * Constructor.
    4040     *
    41      * @param int     $type   The type of the token
    42      * @param string  $value  The token value
    43      * @param int     $lineno The line position in the source
     41     * @param int    $type   The type of the token
     42     * @param string $value  The token value
     43     * @param int    $lineno The line position in the source
    4444     */
    4545    public function __construct($type, $value, $lineno)
     
    9090     * Gets the line.
    9191     *
    92      * @return int     The source line
     92     * @return int The source line
    9393     */
    9494    public function getLine()
     
    100100     * Gets the token type.
    101101     *
    102      * @return int     The token type
     102     * @return int The token type
    103103     */
    104104    public function getType()
     
    120120     * Returns the constant representation (internal) of a given type.
    121121     *
    122      * @param int     $type  The type as an integer
    123      * @param bool    $short Whether to return a short representation or not
     122     * @param int  $type  The type as an integer
     123     * @param bool $short Whether to return a short representation or not
    124124     *
    125125     * @return string The string representation
     
    177177     * Returns the english representation of a given type.
    178178     *
    179      * @param int     $type The type as an integer
     179     * @param int $type The type as an integer
    180180     *
    181181     * @return string The string representation
  • adentify/trunk/vendor/twig/twig/lib/Twig/TokenStream.php

    r1051693 r1083683  
    102102     * Looks at the next token.
    103103     *
    104      * @param int     $number
     104     * @param int $number
    105105     *
    106106     * @return Twig_Token
  • adentify/trunk/vendor/twig/twig/test/Twig/Tests/ErrorTest.php

    r1069197 r1083683  
    113113                        {{ parent() }}
    114114                    {% endblock %}",
    115                     'base' => '{% block content %}{{ foo.bar }}{% endblock %}'
     115                    'base' => '{% block content %}{{ foo.bar }}{% endblock %}',
    116116                ),
    117117                'base', 1,
     
    128128                        {{ foo.bar }}
    129129                    {% endblock %}",
    130                     'base' => '{% block content %}{% endblock %}'
     130                    'base' => '{% block content %}{% endblock %}',
    131131                ),
    132132                'index', 3,
  • adentify/trunk/vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php

    r1069197 r1083683  
    3333            array('{% set 1 + 2 = "foo" %}'),
    3434            array('{% set "bar" = "foo" %}'),
    35             array('{% set %}{% endset %}')
     35            array('{% set %}{% endset %}'),
    3636        );
    3737    }
     
    191191                    new Twig_Node_Expression_Constant(' baz', 1),
    192192                    1
    193                 )
     193                ),
    194194            ),
    195195
  • adentify/trunk/vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php

    r1069197 r1083683  
    6161        $loader->addPath($basePath.'/normal_ter');
    6262        $loader->prependPath($basePath.'/normal_final');
     63        $loader->prependPath($basePath.'/named/../named_quater', 'named');
    6364        $loader->prependPath($basePath.'/named_final', 'named');
    6465
     
    7172        $this->assertEquals(array(
    7273            $basePath.'/named_final',
     74            $basePath.'/named/../named_quater',
    7375            $basePath.'/named',
    7476            $basePath.'/named_bis',
     
    7678        ), $loader->getPaths('named'));
    7779
     80        $this->assertEquals(
     81            $basePath.'/named_quater/named_absolute.html',
     82            $loader->getCacheKey('@named/named_absolute.html')
     83        );
    7884        $this->assertEquals("path (final)\n", $loader->getSource('index.html'));
    7985        $this->assertEquals("path (final)\n", $loader->getSource('@__main__/index.html'));
  • adentify/trunk/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php

    r1069197 r1083683  
    2121            'debug'      => true,
    2222            'cache'      => false,
    23             'autoescape' => false
     23            'autoescape' => false,
    2424        ));
    2525
  • adentify/trunk/vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php

    r1069197 r1083683  
    5757        $node->getArguments('date', array('Y-m-d', 'timestamp' => null, 'unknown1' => '', 'unknown2' => ''));
    5858    }
     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    }
    5984}
    6085
  • adentify/trunk/vendor/twig/twig/test/Twig/Tests/Node/Expression/FilterTest.php

    r1069197 r1083683  
    7575    /**
    7676     * @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.
    7878     */
    7979    public function testCompileWithWrongNamedArgumentName()
  • adentify/trunk/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php

    r1069197 r1083683  
    3535        $args = new Twig_Node_Expression_Array(array(), 1);
    3636        $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)));
    3838
    3939        $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)));
    4141
    4242        $args = new Twig_Node_Expression_Array(array(), 1);
     
    4444        $args->addElement(new Twig_Node_Expression_Constant('bar', 1));
    4545        $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')));
    4747
    4848        return $tests;
  • adentify/trunk/vendor/twig/twig/test/Twig/Tests/Node/Expression/NameTest.php

    r1069197 r1083683  
    2929
    3030        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"),
    3535        );
    3636    }
  • adentify/trunk/vendor/twig/twig/test/Twig/Tests/TemplateTest.php

    r1069197 r1083683  
    311311                // properties cannot be numbers
    312312                if (($testObject[0] instanceof stdClass || $testObject[0] instanceof Twig_TemplatePropertyObject) && is_numeric($test[2])) {
    313                      continue;
     313                    continue;
    314314                }
    315315
     
    348348        }
    349349
    350         $methodAndPropObject = new Twig_TemplateMethodAndPropObject;
     350        $methodAndPropObject = new Twig_TemplateMethodAndPropObject();
    351351
    352352        // additional method tests
     
    397397        parent::__construct($env);
    398398        $this->useExtGetAttribute = $useExtGetAttribute;
    399         Twig_Template::clearCache();
     399        self::$cache = array();
    400400    }
    401401
  • adentify/trunk/vendor/twig/twig/test/Twig/Tests/escapingTest.php

    r1069197 r1083683  
    77 * @license   http://framework.zend.com/license/new-bsd New BSD License
    88 */
    9 
    109class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase
    1110{
     
    1817        '<'     => '&lt;',
    1918        '>'     => '&gt;',
    20         '&'     => '&amp;'
     19        '&'     => '&amp;',
    2120    );
    2221
     
    228227     * Convert a Unicode Codepoint to a literal UTF-8 character.
    229228     *
    230      * @param int $codepoint Unicode codepoint in hex notation
     229     * @param  int    $codepoint Unicode codepoint in hex notation
    231230     * @return string UTF-8 literal string
    232231     */
     
    257256    {
    258257        $immune = array(',', '.', '_'); // Exceptions to escaping ranges
    259         for ($chr=0; $chr < 0xFF; $chr++) {
     258        for ($chr = 0; $chr < 0xFF; $chr++) {
    260259            if ($chr >= 0x30 && $chr <= 0x39
    261260            || $chr >= 0x41 && $chr <= 0x5A
     
    280279    {
    281280        $immune = array(',', '.', '-', '_'); // Exceptions to escaping ranges
    282         for ($chr=0; $chr < 0xFF; $chr++) {
     281        for ($chr = 0; $chr < 0xFF; $chr++) {
    283282            if ($chr >= 0x30 && $chr <= 0x39
    284283            || $chr >= 0x41 && $chr <= 0x5A
     
    303302    {
    304303        // CSS has no exceptions to escaping ranges
    305         for ($chr=0; $chr < 0xFF; $chr++) {
     304        for ($chr = 0; $chr < 0xFF; $chr++) {
    306305            if ($chr >= 0x30 && $chr <= 0x39
    307306            || $chr >= 0x41 && $chr <= 0x5A
Note: See TracChangeset for help on using the changeset viewer.