Plugin Directory

Changeset 2746632

Timestamp:
06/22/2022 07:24:01 PM (2 years ago)
Author:
jarednova
Message:

Update to 1.19.2

Location:
timber-library/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • timber-library/trunk/README.md

    r2616192 r2746632  
    1515[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/timber/timber.svg?style=flat-square)](https://scrutinizer-ci.com/g/timber/timber/?branch=master)
    1616[![Latest Stable Version](https://img.shields.io/packagist/v/timber/timber.svg?style=flat-square)](https://packagist.org/packages/timber/timber)
    17 [![WordPress Download Count](https://img.shields.io/wordpress/plugin/dt/timber-library.svg?style=flat-square)](https://wordpress.org/plugins/timber-library/)
    1817[![WordPress Rating](https://img.shields.io/wordpress/plugin/r/timber-library.svg?style=flat-square)](https://wordpress.org/support/plugin/timber-library/reviews/)
    1918
     
    119118* [**CSS Tricks**](https://css-tricks.com/timber-and-twig-reignited-my-love-for-wordpress/) introduction to Timber by [@tjFogarty](https://github.com/tjFogarty)
    120119* [**Twig for Timber Cheatsheet**](http://notlaura.com/the-twig-for-timber-cheatsheet/) by [@laras126](https://github.com/laras126)
     120
    121121* [**TutsPlus**](http://code.tutsplus.com/articles/kick-start-wordpress-development-with-twig-introduction--cms-24781) A guide to getting started by [@ahmadawais](https://github.com/ahmadawais)
    122122
  • timber-library/trunk/vendor/autoload.php

    r2616191 r2746632  
    55require_once __DIR__ . '/composer/autoload_real.php';
    66
    7 return ComposerAutoloaderInit88b27880b72a8f9d46918e01e89ec929::getLoader();
     7return ComposerAutoloaderInit::getLoader();
  • timber-library/trunk/vendor/composer/ClassLoader.php

    r2616191 r2746632  
    4343class ClassLoader
    4444{
    45     /** @var ?string */
    4645    private $vendorDir;
    4746
    4847    // PSR-4
    49     /**
    50      * @var array[]
    51      * @psalm-var array<string, array<string, int>>
    52      */
    5348    private $prefixLengthsPsr4 = array();
    54     /**
    55      * @var array[]
    56      * @psalm-var array<string, array<int, string>>
    57      */
    5849    private $prefixDirsPsr4 = array();
    59     /**
    60      * @var array[]
    61      * @psalm-var array<string, string>
    62      */
    6350    private $fallbackDirsPsr4 = array();
    6451
    6552    // PSR-0
    66     /**
    67      * @var array[]
    68      * @psalm-var array<string, array<string, string[]>>
    69      */
    7053    private $prefixesPsr0 = array();
    71     /**
    72      * @var array[]
    73      * @psalm-var array<string, string>
    74      */
    7554    private $fallbackDirsPsr0 = array();
    7655
    77     /** @var bool */
    7856    private $useIncludePath = false;
    79 
    80     /**
    81      * @var string[]
    82      * @psalm-var array<string, string>
    83      */
    8457    private $classMap = array();
    85 
    86     /** @var bool */
    8758    private $classMapAuthoritative = false;
    88 
    89     /**
    90      * @var bool[]
    91      * @psalm-var array<string, bool>
    92      */
    9359    private $missingClasses = array();
    94 
    95     /** @var ?string */
    9660    private $apcuPrefix;
    9761
    98     /**
    99      * @var self[]
    100      */
    10162    private static $registeredLoaders = array();
    10263
    103     /**
    104      * @param ?string $vendorDir
    105      */
    10664    public function __construct($vendorDir = null)
    10765    {
     
    10967    }
    11068
    111     /**
    112      * @return string[]
    113      */
    11469    public function getPrefixes()
    11570    {
     
    12176    }
    12277
    123     /**
    124      * @return array[]
    125      * @psalm-return array<string, array<int, string>>
    126      */
    12778    public function getPrefixesPsr4()
    12879    {
     
    13081    }
    13182
    132     /**
    133      * @return array[]
    134      * @psalm-return array<string, string>
    135      */
    13683    public function getFallbackDirs()
    13784    {
     
    13986    }
    14087
    141     /**
    142      * @return array[]
    143      * @psalm-return array<string, string>
    144      */
    14588    public function getFallbackDirsPsr4()
    14689    {
     
    14891    }
    14992
    150     /**
    151      * @return string[] Array of classname => path
    152      * @psalm-var array<string, string>
    153      */
    15493    public function getClassMap()
    15594    {
     
    15897
    15998    /**
    160      * @param string[] $classMap Class to filename map
    161      * @psalm-param array<string, string> $classMap
    162      *
    163      * @return void
     99     * @param array $classMap Class to filename map
    164100     */
    165101    public function addClassMap(array $classMap)
     
    176112     * appending or prepending to the ones previously set for this prefix.
    177113     *
    178      * @param string          $prefix  The prefix
    179      * @param string[]|string $paths   The PSR-0 root directories
    180      * @param bool            $prepend Whether to prepend the directories
    181      *
    182      * @return void
     114     * @param string       $prefix  The prefix
     115     * @param array|string $paths   The PSR-0 root directories
     116     * @param bool         $prepend Whether to prepend the directories
    183117     */
    184118    public function add($prefix, $paths, $prepend = false)
     
    223157     * appending or prepending to the ones previously set for this namespace.
    224158     *
    225      * @param string          $prefix  The prefix/namespace, with trailing '\\'
    226      * @param string[]|string $paths   The PSR-4 base directories
    227      * @param bool            $prepend Whether to prepend the directories
     159     * @param string       $prefix  The prefix/namespace, with trailing '\\'
     160     * @param |string $paths   The PSR-4 base directories
     161     * @param bool         $prepend Whether to prepend the directories
    228162     *
    229163     * @throws \InvalidArgumentException
    230      *
    231      * @return void
    232164     */
    233165    public function addPsr4($prefix, $paths, $prepend = false)
     
    273205     * replacing any others previously set for this prefix.
    274206     *
    275      * @param string          $prefix The prefix
    276      * @param string[]|string $paths  The PSR-0 base directories
    277      *
    278      * @return void
     207     * @param string       $prefix The prefix
     208     * @param array|string $paths  The PSR-0 base directories
    279209     */
    280210    public function set($prefix, $paths)
     
    291221     * replacing any others previously set for this namespace.
    292222     *
    293      * @param string          $prefix The prefix/namespace, with trailing '\\'
    294      * @param string[]|string $paths  The PSR-4 base directories
     223     * @param string       $prefix The prefix/namespace, with trailing '\\'
     224     * @param |string $paths  The PSR-4 base directories
    295225     *
    296226     * @throws \InvalidArgumentException
    297      *
    298      * @return void
    299227     */
    300228    public function setPsr4($prefix, $paths)
     
    316244     *
    317245     * @param bool $useIncludePath
    318      *
    319      * @return void
    320246     */
    321247    public function setUseIncludePath($useIncludePath)
     
    340266     *
    341267     * @param bool $classMapAuthoritative
    342      *
    343      * @return void
    344268     */
    345269    public function setClassMapAuthoritative($classMapAuthoritative)
     
    362286     *
    363287     * @param string|null $apcuPrefix
    364      *
    365      * @return void
    366288     */
    367289    public function setApcuPrefix($apcuPrefix)
     
    384306     *
    385307     * @param bool $prepend Whether to prepend the autoloader or not
    386      *
    387      * @return void
    388308     */
    389309    public function register($prepend = false)
     
    405325    /**
    406326     * Unregisters this instance as an autoloader.
    407      *
    408      * @return void
    409327     */
    410328    public function unregister()
     
    421339     *
    422340     * @param  string    $class The name of the class
    423      * @return true|null True if loaded, null otherwise
     341     * @return |null True if loaded, null otherwise
    424342     */
    425343    public function loadClass($class)
     
    430348            return true;
    431349        }
    432 
    433         return null;
    434350    }
    435351
     
    486402    }
    487403
    488     /**
    489      * @param  string       $class
    490      * @param  string       $ext
    491      * @return string|false
    492      */
    493404    private function findFileWithExtension($class, $ext)
    494405    {
     
    562473 *
    563474 * Prevents access to $this/self from included files.
    564  *
    565  * @param  string $file
    566  * @return void
    567  * @private
    568475 */
    569476function includeFile($file)
  • timber-library/trunk/vendor/composer/InstalledVersions.php

    r2616194 r2746632  
    11<?php
    22
    3 /*
    4  * This file is part of Composer.
    5  *
    6  * (c) Nils Adermann <naderman@naderman.de>
    7  *     Jordi Boggiano <j.boggiano@seld.be>
    8  *
    9  * For the full copyright and license information, please view the LICENSE
    10  * file that was distributed with this source code.
    11  */
     3
     4
     5
     6
     7
     8
     9
     10
     11
    1212
    1313namespace Composer;
     
    1616use Composer\Semver\VersionParser;
    1717
    18 /**
    19  * This class is copied in every Composer installed project and available to all
    20  *
    21  * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
    22  *
    23  * To require its presence, you can require `composer-runtime-api ^2.0`
    24  */
     18
     19
     20
     21
     22
    2523class InstalledVersions
    2624{
    27     private static $installed;
    28     private static $canGetVendors;
    29     private static $installedByVendor = array();
    30 
    31     /**
    32      * Returns a list of all package names which are present, either by being installed, replaced or provided
    33      *
    34      * @return string[]
    35      * @psalm-return list<string>
    36      */
    37     public static function getInstalledPackages()
    38     {
    39         $packages = array();
    40         foreach (self::getInstalled() as $installed) {
    41             $packages[] = array_keys($installed['versions']);
    42         }
    43 
    44         if (1 === \count($packages)) {
    45             return $packages[0];
    46         }
    47 
    48         return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
    49     }
    50 
    51     /**
    52      * Returns a list of all package names with a specific type e.g. 'library'
    53      *
    54      * @param  string   $type
    55      * @return string[]
    56      * @psalm-return list<string>
    57      */
    58     public static function getInstalledPackagesByType($type)
    59     {
    60         $packagesByType = array();
    61 
    62         foreach (self::getInstalled() as $installed) {
    63             foreach ($installed['versions'] as $name => $package) {
    64                 if (isset($package['type']) && $package['type'] === $type) {
    65                     $packagesByType[] = $name;
    66                 }
    67             }
    68         }
    69 
    70         return $packagesByType;
    71     }
    72 
    73     /**
    74      * Checks whether the given package is installed
    75      *
    76      * This also returns true if the package name is provided or replaced by another package
    77      *
    78      * @param  string $packageName
    79      * @param  bool   $includeDevRequirements
    80      * @return bool
    81      */
    82     public static function isInstalled($packageName, $includeDevRequirements = true)
    83     {
    84         foreach (self::getInstalled() as $installed) {
    85             if (isset($installed['versions'][$packageName])) {
    86                 return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
    87             }
    88         }
    89 
    90         return false;
    91     }
    92 
    93     /**
    94      * Checks whether the given package satisfies a version constraint
    95      *
    96      * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
    97      *
    98      *   Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
    99      *
    100      * @param  VersionParser $parser      Install composer/semver to have access to this class and functionality
    101      * @param  string        $packageName
    102      * @param  string|null   $constraint  A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
    103      * @return bool
    104      */
    105     public static function satisfies(VersionParser $parser, $packageName, $constraint)
    106     {
    107         $constraint = $parser->parseConstraints($constraint);
    108         $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
    109 
    110         return $provided->matches($constraint);
    111     }
    112 
    113     /**
    114      * Returns a version constraint representing all the range(s) which are installed for a given package
    115      *
    116      * It is easier to use this via isInstalled() with the $constraint argument if you need to check
    117      * whether a given version of a package is installed, and not just whether it exists
    118      *
    119      * @param  string $packageName
    120      * @return string Version constraint usable with composer/semver
    121      */
    122     public static function getVersionRanges($packageName)
    123     {
    124         foreach (self::getInstalled() as $installed) {
    125             if (!isset($installed['versions'][$packageName])) {
    126                 continue;
    127             }
    128 
    129             $ranges = array();
    130             if (isset($installed['versions'][$packageName]['pretty_version'])) {
    131                 $ranges[] = $installed['versions'][$packageName]['pretty_version'];
    132             }
    133             if (array_key_exists('aliases', $installed['versions'][$packageName])) {
    134                 $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
    135             }
    136             if (array_key_exists('replaced', $installed['versions'][$packageName])) {
    137                 $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
    138             }
    139             if (array_key_exists('provided', $installed['versions'][$packageName])) {
    140                 $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
    141             }
    142 
    143             return implode(' || ', $ranges);
    144         }
    145 
    146         throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    147     }
    148 
    149     /**
    150      * @param  string      $packageName
    151      * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
    152      */
    153     public static function getVersion($packageName)
    154     {
    155         foreach (self::getInstalled() as $installed) {
    156             if (!isset($installed['versions'][$packageName])) {
    157                 continue;
    158             }
    159 
    160             if (!isset($installed['versions'][$packageName]['version'])) {
    161                 return null;
    162             }
    163 
    164             return $installed['versions'][$packageName]['version'];
    165         }
    166 
    167         throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    168     }
    169 
    170     /**
    171      * @param  string      $packageName
    172      * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
    173      */
    174     public static function getPrettyVersion($packageName)
    175     {
    176         foreach (self::getInstalled() as $installed) {
    177             if (!isset($installed['versions'][$packageName])) {
    178                 continue;
    179             }
    180 
    181             if (!isset($installed['versions'][$packageName]['pretty_version'])) {
    182                 return null;
    183             }
    184 
    185             return $installed['versions'][$packageName]['pretty_version'];
    186         }
    187 
    188         throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    189     }
    190 
    191     /**
    192      * @param  string      $packageName
    193      * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
    194      */
    195     public static function getReference($packageName)
    196     {
    197         foreach (self::getInstalled() as $installed) {
    198             if (!isset($installed['versions'][$packageName])) {
    199                 continue;
    200             }
    201 
    202             if (!isset($installed['versions'][$packageName]['reference'])) {
    203                 return null;
    204             }
    205 
    206             return $installed['versions'][$packageName]['reference'];
    207         }
    208 
    209         throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    210     }
    211 
    212     /**
    213      * @param  string      $packageName
    214      * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
    215      */
    216     public static function getInstallPath($packageName)
    217     {
    218         foreach (self::getInstalled() as $installed) {
    219             if (!isset($installed['versions'][$packageName])) {
    220                 continue;
    221             }
    222 
    223             return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
    224         }
    225 
    226         throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    227     }
    228 
    229     /**
    230      * @return array
    231      * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
    232      */
    233     public static function getRootPackage()
    234     {
    235         $installed = self::getInstalled();
    236 
    237         return $installed[0]['root'];
    238     }
    239 
    240     /**
    241      * Returns the raw installed.php data for custom implementations
    242      *
    243      * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
    244      * @return array[]
    245      * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
    246      */
    247     public static function getRawData()
    248     {
    249         @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
    250 
    251         if (null === self::$installed) {
    252             // only require the installed.php file if this file is loaded from its dumped location,
    253             // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
    254             if (substr(__DIR__, -8, 1) !== 'C') {
    255                 self::$installed = include __DIR__ . '/installed.php';
    256             } else {
    257                 self::$installed = array();
    258             }
    259         }
    260 
    261         return self::$installed;
    262     }
    263 
    264     /**
    265      * Returns the raw data of all installed.php which are currently loaded for custom implementations
    266      *
    267      * @return array[]
    268      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
    269      */
    270     public static function getAllRawData()
    271     {
    272         return self::getInstalled();
    273     }
    274 
    275     /**
    276      * Lets you reload the static array from another file
    277      *
    278      * This is only useful for complex integrations in which a project needs to use
    279      * this class but then also needs to execute another project's autoloader in process,
    280      * and wants to ensure both projects have access to their version of installed.php.
    281      *
    282      * A typical case would be PHPUnit, where it would need to make sure it reads all
    283      * the data it needs from this class, then call reload() with
    284      * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
    285      * the project in which it runs can then also use this class safely, without
    286      * interference between PHPUnit's dependencies and the project's dependencies.
    287      *
    288      * @param  array[] $data A vendor/composer/installed.php data set
    289      * @return void
    290      *
    291      * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
    292      */
    293     public static function reload($data)
    294     {
    295         self::$installed = $data;
    296         self::$installedByVendor = array();
    297     }
    298 
    299     /**
    300      * @return array[]
    301      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
    302      */
    303     private static function getInstalled()
    304     {
    305         if (null === self::$canGetVendors) {
    306             self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
    307         }
    308 
    309         $installed = array();
    310 
    311         if (self::$canGetVendors) {
    312             foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
    313                 if (isset(self::$installedByVendor[$vendorDir])) {
    314                     $installed[] = self::$installedByVendor[$vendorDir];
    315                 } elseif (is_file($vendorDir.'/composer/installed.php')) {
    316                     $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
    317                     if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
    318                         self::$installed = $installed[count($installed) - 1];
    319                     }
    320                 }
    321             }
    322         }
    323 
    324         if (null === self::$installed) {
    325             // only require the installed.php file if this file is loaded from its dumped location,
    326             // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
    327             if (substr(__DIR__, -8, 1) !== 'C') {
    328                 self::$installed = require __DIR__ . '/installed.php';
    329             } else {
    330                 self::$installed = array();
    331             }
    332         }
    333         $installed[] = self::$installed;
    334 
    335         return $installed;
    336     }
    337 }
     25private static $installed = array (
     26  'root' =>
     27  array (
     28    'pretty_version' => 'dev-master',
     29    'version' => 'dev-master',
     30    'aliases' =>
     31    array (
     32    ),
     33    'reference' => '218b45e5256e93fd9e7f36c388dca2a6660c8921',
     34    'name' => 'timber/timber',
     35  ),
     36  'versions' =>
     37  array (
     38    'altorouter/altorouter' =>
     39    array (
     40      'pretty_version' => '2.0.2',
     41      'version' => '2.0.2.0',
     42      'aliases' =>
     43      array (
     44      ),
     45      'reference' => 'f6fede4f94ced7c22ba63a9b8af0bf2dc38e3cb2',
     46    ),
     47    'composer/installers' =>
     48    array (
     49      'pretty_version' => 'v1.12.0',
     50      'version' => '1.12.0.0',
     51      'aliases' =>
     52      array (
     53      ),
     54      'reference' => 'd20a64ed3c94748397ff5973488761b22f6d3f19',
     55    ),
     56    'roundcube/plugin-installer' =>
     57    array (
     58      'replaced' =>
     59      array (
     60        0 => '*',
     61      ),
     62    ),
     63    'shama/baton' =>
     64    array (
     65      'replaced' =>
     66      array (
     67        0 => '*',
     68      ),
     69    ),
     70    'symfony/polyfill-ctype' =>
     71    array (
     72      'pretty_version' => 'v1.19.0',
     73      'version' => '1.19.0.0',
     74      'aliases' =>
     75      array (
     76      ),
     77      'reference' => 'aed596913b70fae57be53d86faa2e9ef85a2297b',
     78    ),
     79    'timber/timber' =>
     80    array (
     81      'pretty_version' => 'dev-master',
     82      'version' => 'dev-master',
     83      'aliases' =>
     84      array (
     85      ),
     86      'reference' => '218b45e5256e93fd9e7f36c388dca2a6660c8921',
     87    ),
     88    'twig/cache-extension' =>
     89    array (
     90      'pretty_version' => 'v1.5.0',
     91      'version' => '1.5.0.0',
     92      'aliases' =>
     93      array (
     94      ),
     95      'reference' => '2c243643f59132194458bd03c745b079bbb12e78',
     96    ),
     97    'twig/twig' =>
     98    array (
     99      'pretty_version' => 'v1.42.5',
     100      'version' => '1.42.5.0',
     101      'aliases' =>
     102      array (
     103      ),
     104      'reference' => '87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e',
     105    ),
     106    'upstatement/routes' =>
     107    array (
     108      'pretty_version' => '0.8.1',
     109      'version' => '0.8.1.0',
     110      'aliases' =>
     111      array (
     112      ),
     113      'reference' => '02eb866668f5478d794547aa79e73dd92a989ad9',
     114    ),
     115  ),
     116);
     117private static $canGetVendors;
     118private static $installedByVendor = array();
     119
     120
     121
     122
     123
     124
     125
     126public static function getInstalledPackages()
     127{
     128$packages = array();
     129foreach (self::getInstalled() as $installed) {
     130$packages[] = array_keys($installed['versions']);
     131}
     132
     133
     134if (1 === \count($packages)) {
     135return $packages[0];
     136}
     137
     138return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
     139}
     140
     141
     142
     143
     144
     145
     146
     147
     148
     149public static function isInstalled($packageName)
     150{
     151foreach (self::getInstalled() as $installed) {
     152if (isset($installed['versions'][$packageName])) {
     153return true;
     154}
     155}
     156
     157return false;
     158}
     159
     160
     161
     162
     163
     164
     165
     166
     167
     168
     169
     170
     171
     172
     173public static function satisfies(VersionParser $parser, $packageName, $constraint)
     174{
     175$constraint = $parser->parseConstraints($constraint);
     176$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
     177
     178return $provided->matches($constraint);
     179}
     180
     181
     182
     183
     184
     185
     186
     187
     188
     189
     190public static function getVersionRanges($packageName)
     191{
     192foreach (self::getInstalled() as $installed) {
     193if (!isset($installed['versions'][$packageName])) {
     194continue;
     195}
     196
     197$ranges = array();
     198if (isset($installed['versions'][$packageName]['pretty_version'])) {
     199$ranges[] = $installed['versions'][$packageName]['pretty_version'];
     200}
     201if (array_key_exists('aliases', $installed['versions'][$packageName])) {
     202$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
     203}
     204if (array_key_exists('replaced', $installed['versions'][$packageName])) {
     205$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
     206}
     207if (array_key_exists('provided', $installed['versions'][$packageName])) {
     208$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
     209}
     210
     211return implode(' || ', $ranges);
     212}
     213
     214throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
     215}
     216
     217
     218
     219
     220
     221public static function getVersion($packageName)
     222{
     223foreach (self::getInstalled() as $installed) {
     224if (!isset($installed['versions'][$packageName])) {
     225continue;
     226}
     227
     228if (!isset($installed['versions'][$packageName]['version'])) {
     229return null;
     230}
     231
     232return $installed['versions'][$packageName]['version'];
     233}
     234
     235throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
     236}
     237
     238
     239
     240
     241
     242public static function getPrettyVersion($packageName)
     243{
     244foreach (self::getInstalled() as $installed) {
     245if (!isset($installed['versions'][$packageName])) {
     246continue;
     247}
     248
     249if (!isset($installed['versions'][$packageName]['pretty_version'])) {
     250return null;
     251}
     252
     253return $installed['versions'][$packageName]['pretty_version'];
     254}
     255
     256throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
     257}
     258
     259
     260
     261
     262
     263public static function getReference($packageName)
     264{
     265foreach (self::getInstalled() as $installed) {
     266if (!isset($installed['versions'][$packageName])) {
     267continue;
     268}
     269
     270if (!isset($installed['versions'][$packageName]['reference'])) {
     271return null;
     272}
     273
     274return $installed['versions'][$packageName]['reference'];
     275}
     276
     277throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
     278}
     279
     280
     281
     282
     283
     284public static function getRootPackage()
     285{
     286$installed = self::getInstalled();
     287
     288return $installed[0]['root'];
     289}
     290
     291
     292
     293
     294
     295
     296
     297public static function getRawData()
     298{
     299return self::$installed;
     300}
     301
     302
     303
     304
     305
     306
     307
     308
     309
     310
     311
     312
     313
     314
     315
     316
     317
     318
     319
     320public static function reload($data)
     321{
     322self::$installed = $data;
     323self::$installedByVendor = array();
     324}
     325
     326
     327
     328
     329private static function getInstalled()
     330{
     331if (null === self::$canGetVendors) {
     332self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
     333}
     334
     335$installed = array();
     336
     337if (self::$canGetVendors) {
     338foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     339if (isset(self::$installedByVendor[$vendorDir])) {
     340$installed[] = self::$installedByVendor[$vendorDir];
     341} elseif (is_file($vendorDir.'/composer/installed.php')) {
     342$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
     343}
     344}
     345}
     346
     347$installed[] = self::$installed;
     348
     349return $installed;
     350}
     351}
  • timber-library/trunk/vendor/composer/autoload_real.php

    r2616191 r2746632  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit88b27880b72a8f9d46918e01e89ec929
     5class ComposerAutoloaderInit
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit88b27880b72a8f9d46918e01e89ec929', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit88b27880b72a8f9d46918e01e89ec929', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit', 'loadClassLoader'));
    3030
    3131        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
     
    3333            require __DIR__ . '/autoload_static.php';
    3434
    35             call_user_func(\Composer\Autoload\ComposerStaticInit88b27880b72a8f9d46918e01e89ec929::getInitializer($loader));
     35            call_user_func(\Composer\Autoload\ComposerStaticInit::getInitializer($loader));
    3636        } else {
    3737            $map = require __DIR__ . '/autoload_namespaces.php';
     
    5454
    5555        if ($useStaticLoader) {
    56             $includeFiles = Composer\Autoload\ComposerStaticInit88b27880b72a8f9d46918e01e89ec929::$files;
     56            $includeFiles = Composer\Autoload\ComposerStaticInit::$files;
    5757        } else {
    5858            $includeFiles = require __DIR__ . '/autoload_files.php';
    5959        }
    6060        foreach ($includeFiles as $fileIdentifier => $file) {
    61             composerRequire88b27880b72a8f9d46918e01e89ec929($fileIdentifier, $file);
     61            composerRequire($fileIdentifier, $file);
    6262        }
    6363
     
    6666}
    6767
    68 function composerRequire88b27880b72a8f9d46918e01e89ec929($fileIdentifier, $file)
     68function composerRequire($fileIdentifier, $file)
    6969{
    7070    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • timber-library/trunk/vendor/composer/autoload_static.php

    r2616191 r2746632  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit88b27880b72a8f9d46918e01e89ec929
     7class ComposerStaticInit
    88{
    99    public static $files = array (
     
    626626    {
    627627        return \Closure::bind(function () use ($loader) {
    628             $loader->prefixLengthsPsr4 = ComposerStaticInit88b27880b72a8f9d46918e01e89ec929::$prefixLengthsPsr4;
    629             $loader->prefixDirsPsr4 = ComposerStaticInit88b27880b72a8f9d46918e01e89ec929::$prefixDirsPsr4;
    630             $loader->fallbackDirsPsr4 = ComposerStaticInit88b27880b72a8f9d46918e01e89ec929::$fallbackDirsPsr4;
    631             $loader->prefixesPsr0 = ComposerStaticInit88b27880b72a8f9d46918e01e89ec929::$prefixesPsr0;
    632             $loader->classMap = ComposerStaticInit88b27880b72a8f9d46918e01e89ec929::$classMap;
     628            $loader->prefixLengthsPsr4 = ComposerStaticInit::$prefixLengthsPsr4;
     629            $loader->prefixDirsPsr4 = ComposerStaticInit::$prefixDirsPsr4;
     630            $loader->fallbackDirsPsr4 = ComposerStaticInit::$fallbackDirsPsr4;
     631            $loader->prefixesPsr0 = ComposerStaticInit::$prefixesPsr0;
     632            $loader->classMap = ComposerStaticInit::$classMap;
    633633
    634634        }, null, ClassLoader::class);
  • timber-library/trunk/vendor/composer/installed.json

    r2616191 r2746632  
    252252            "installation-source": "dist",
    253253            "autoload": {
     254
     255
     256
    254257                "psr-4": {
    255258                    "Symfony\\Polyfill\\Ctype\\": ""
    256                 },
    257                 "files": [
    258                     "bootstrap.php"
    259                 ]
     259                }
    260260            },
    261261            "notification-url": "https://packagist.org/downloads/",
  • timber-library/trunk/vendor/composer/installed.php

    r2616194 r2746632  
    1 <?php return array(
    2     'root' => array(
    3         'pretty_version' => '1.19.1.x-dev',
    4         'version' => '1.19.1.9999999-dev',
    5         'type' => 'library',
    6         'install_path' => __DIR__ . '/../../',
    7         'aliases' => array(),
    8         'reference' => '3e213fbd3587eb36adec2d5a081824c4722a0acf',
    9         'name' => 'timber/timber',
    10         'dev' => false,
     1<?php return array (
     2  'root' =>
     3  array (
     4    'pretty_version' => 'dev-master',
     5    'version' => 'dev-master',
     6    'aliases' =>
     7    array (
    118    ),
    12     'versions' => array(
    13         'altorouter/altorouter' => array(
    14             'pretty_version' => '2.0.2',
    15             'version' => '2.0.2.0',
    16             'type' => 'library',
    17             'install_path' => __DIR__ . '/../altorouter/altorouter',
    18             'aliases' => array(),
    19             'reference' => 'f6fede4f94ced7c22ba63a9b8af0bf2dc38e3cb2',
    20             'dev_requirement' => false,
    21         ),
    22         'composer/installers' => array(
    23             'pretty_version' => 'v1.12.0',
    24             'version' => '1.12.0.0',
    25             'type' => 'composer-plugin',
    26             'install_path' => __DIR__ . '/./installers',
    27             'aliases' => array(),
    28             'reference' => 'd20a64ed3c94748397ff5973488761b22f6d3f19',
    29             'dev_requirement' => false,
    30         ),
    31         'roundcube/plugin-installer' => array(
    32             'dev_requirement' => false,
    33             'replaced' => array(
    34                 0 => '*',
    35             ),
    36         ),
    37         'shama/baton' => array(
    38             'dev_requirement' => false,
    39             'replaced' => array(
    40                 0 => '*',
    41             ),
    42         ),
    43         'symfony/polyfill-ctype' => array(
    44             'pretty_version' => 'v1.19.0',
    45             'version' => '1.19.0.0',
    46             'type' => 'library',
    47             'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
    48             'aliases' => array(),
    49             'reference' => 'aed596913b70fae57be53d86faa2e9ef85a2297b',
    50             'dev_requirement' => false,
    51         ),
    52         'timber/timber' => array(
    53             'pretty_version' => '1.19.1.x-dev',
    54             'version' => '1.19.1.9999999-dev',
    55             'type' => 'library',
    56             'install_path' => __DIR__ . '/../../',
    57             'aliases' => array(),
    58             'reference' => '3e213fbd3587eb36adec2d5a081824c4722a0acf',
    59             'dev_requirement' => false,
    60         ),
    61         'twig/cache-extension' => array(
    62             'pretty_version' => 'v1.5.0',
    63             'version' => '1.5.0.0',
    64             'type' => 'library',
    65             'install_path' => __DIR__ . '/../twig/cache-extension',
    66             'aliases' => array(),
    67             'reference' => '2c243643f59132194458bd03c745b079bbb12e78',
    68             'dev_requirement' => false,
    69         ),
    70         'twig/twig' => array(
    71             'pretty_version' => 'v1.42.5',
    72             'version' => '1.42.5.0',
    73             'type' => 'library',
    74             'install_path' => __DIR__ . '/../twig/twig',
    75             'aliases' => array(),
    76             'reference' => '87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e',
    77             'dev_requirement' => false,
    78         ),
    79         'upstatement/routes' => array(
    80             'pretty_version' => '0.8.1',
    81             'version' => '0.8.1.0',
    82             'type' => 'library',
    83             'install_path' => __DIR__ . '/../upstatement/routes',
    84             'aliases' => array(),
    85             'reference' => '02eb866668f5478d794547aa79e73dd92a989ad9',
    86             'dev_requirement' => false,
    87         ),
     9    'reference' => '218b45e5256e93fd9e7f36c388dca2a6660c8921',
     10    'name' => 'timber/timber',
     11  ),
     12  'versions' =>
     13  array (
     14    'altorouter/altorouter' =>
     15    array (
     16      'pretty_version' => '2.0.2',
     17      'version' => '2.0.2.0',
     18      'aliases' =>
     19      array (
     20      ),
     21      'reference' => 'f6fede4f94ced7c22ba63a9b8af0bf2dc38e3cb2',
    8822    ),
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
    8992);
Note: See TracChangeset for help on using the changeset viewer.