Plugin Directory

Changeset 2843576


Ignore:
Timestamp:
01/04/2023 05:26:43 PM (3 years ago)
Author:
FlorianBrinkmann
Message:

Update to version 8.1.1 from GitHub

Location:
lazy-loading-responsive-images
Files:
28 edited
1 copied

Legend:

Unmodified
Added
Removed
  • lazy-loading-responsive-images/tags/8.1.1/js/build/functions.asset.php

    r2490389 r2843576  
    1 <?php return array('dependencies' => array('wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-polyfill'), 'version' => '90972edff99c4323ad9e62bce64479aa');
     1<?php return array('dependencies' => array('wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '978f3655d6093f212c9a');
  • lazy-loading-responsive-images/tags/8.1.1/js/build/functions.js

    r2490389 r2843576  
    1 !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.components},function(e,t){e.exports=window.wp.editPost},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.plugins},function(e,t){e.exports=window.wp.i18n},function(e,t,n){"use strict";n.r(t);var r=n(2),o=n.n(r),i=n(0),c=n(3),u=n(4),a=n(5),l=n(1),p=n(6),s=n(7);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b=Object(a.compose)([Object(l.withSelect)((function(e){return{meta:(0,e("core/editor").getEditedPostAttribute)("meta")}})),Object(l.withDispatch)((function(e,t){var n=t.meta,r=e("core/editor").editPost;return{updateMeta:function(e){r({meta:d(d({},n),e)})}}}))])((function(e){var t=e.meta,n=e.updateMeta,r=t.lazy_load_responsive_images_disabled;return Object(i.createElement)(u.PluginPostStatusInfo,{className:"lazy-loader-plugin"},Object(i.createElement)("div",null,Object(i.createElement)(c.CheckboxControl,{label:Object(s.__)("Disable Lazy Loader","lazy-loading-responsive-images"),checked:r,onChange:function(e){n({lazy_load_responsive_images_disabled:e||0})}})))}));Object(p.registerPlugin)("lazy-loader-gutenberg",{render:b})}]);
     1(()=>{"use strict";const e=window.wp.element,t=window.wp.components,o=window.wp.editPost,a=window.wp.compose,n=window.wp.data,i=window.wp.plugins,s=window.wp.i18n,l=(0,a.compose)([(0,n.withSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor");return{meta:t("meta")}})),(0,n.withDispatch)(((e,t)=>{let{meta:o}=t;const{editPost:a}=e("core/editor");return{updateMeta(e){a({meta:{...o,...e}})}}}))])((a=>{let{meta:n,updateMeta:i}=a;const l=n.lazy_load_responsive_images_disabled;return(0,e.createElement)(o.PluginPostStatusInfo,{className:"lazy-loader-plugin"},(0,e.createElement)("div",null,(0,e.createElement)(t.CheckboxControl,{label:(0,s.__)("Disable Lazy Loader","lazy-loading-responsive-images"),checked:l,onChange:e=>{i({lazy_load_responsive_images_disabled:e||0})}})))}));(0,i.registerPlugin)("lazy-loader-gutenberg",{render:l})})();
  • lazy-loading-responsive-images/tags/8.1.1/lazy-load-responsive-images.php

    r2505151 r2843576  
    1010 * Plugin URI:  https://florianbrinkmann.com/en/3350/responsive-images-and-lazy-loading-in-wordpress/
    1111 * Description: Lazy loading plugin that supports images, iFrames, video and audio elements and uses lazysizes.js. With manual modification of the markup it is also possible to lazy load background images, scripts, and styles.
    12  * Version:     8.1.0
     12 * Version:     8.1.1
    1313 * Author:      Florian Brinkmann
    1414 * Author URI:  https://florianbrinkmann.com/en/
  • lazy-loading-responsive-images/tags/8.1.1/readme.txt

    r2757274 r2843576  
    44Tags: lazysizes, lazy loading, performance, images
    55Requires at least: 4.9.8
    6 Tested up to: 6.0
    7 Stable tag: 8.1.0
     6Tested up to: 6.1
     7Stable tag: 8.1.1
    88Requires PHP: 7.0
    99
     
    105105== Changelog ==
    106106
     107= 8.1.1 – 20.12.2022 =
     108
     109Tested with WordPress 6.1.
     110
     111**Fixed**
     112
     113- Disable lazy loading in TranslatePress editor.
     114
    107115= 8.1.0 – 29.03.2021 =
    108116
  • lazy-loading-responsive-images/tags/8.1.1/src/Helpers.php

    r2499170 r2843576  
    151151        }
    152152
     153        // Check for TranslatePress editor.
     154        if ( isset( $_REQUEST['trp-edit-translation'] ) ) {
     155            return false;
     156        }
     157
    153158        return true;
    154159    }
  • lazy-loading-responsive-images/tags/8.1.1/vendor/autoload.php

    r2505151 r2843576  
    33// autoload.php @generated by Composer
    44
     5if (PHP_VERSION_ID < 50600) {
     6    if (!headers_sent()) {
     7        header('HTTP/1.1 500 Internal Server Error');
     8    }
     9    $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
     10    if (!ini_get('display_errors')) {
     11        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
     12            fwrite(STDERR, $err);
     13        } elseif (!headers_sent()) {
     14            echo $err;
     15        }
     16    }
     17    trigger_error(
     18        $err,
     19        E_USER_ERROR
     20    );
     21}
     22
    523require_once __DIR__ . '/composer/autoload_real.php';
    624
    7 return ComposerAutoloaderInit1b2cab1f0f7acf7923a366b31a1bde65::getLoader();
     25return ComposerAutoloaderInit992eca56574b9f1c8fe962b958c076b3::getLoader();
  • lazy-loading-responsive-images/tags/8.1.1/vendor/composer/ClassLoader.php

    r2489768 r2843576  
    4343class ClassLoader
    4444{
     45    /** @var \Closure(string):void */
     46    private static $includeFile;
     47
     48    /** @var ?string */
    4549    private $vendorDir;
    4650
    4751    // PSR-4
     52    /**
     53     * @var array[]
     54     * @psalm-var array<string, array<string, int>>
     55     */
    4856    private $prefixLengthsPsr4 = array();
     57    /**
     58     * @var array[]
     59     * @psalm-var array<string, array<int, string>>
     60     */
    4961    private $prefixDirsPsr4 = array();
     62    /**
     63     * @var array[]
     64     * @psalm-var array<string, string>
     65     */
    5066    private $fallbackDirsPsr4 = array();
    5167
    5268    // PSR-0
     69    /**
     70     * @var array[]
     71     * @psalm-var array<string, array<string, string[]>>
     72     */
    5373    private $prefixesPsr0 = array();
     74    /**
     75     * @var array[]
     76     * @psalm-var array<string, string>
     77     */
    5478    private $fallbackDirsPsr0 = array();
    5579
     80    /** @var bool */
    5681    private $useIncludePath = false;
     82
     83    /**
     84     * @var string[]
     85     * @psalm-var array<string, string>
     86     */
    5787    private $classMap = array();
     88
     89    /** @var bool */
    5890    private $classMapAuthoritative = false;
     91
     92    /**
     93     * @var bool[]
     94     * @psalm-var array<string, bool>
     95     */
    5996    private $missingClasses = array();
     97
     98    /** @var ?string */
    6099    private $apcuPrefix;
    61100
     101    /**
     102     * @var self[]
     103     */
    62104    private static $registeredLoaders = array();
    63105
     106    /**
     107     * @param ?string $vendorDir
     108     */
    64109    public function __construct($vendorDir = null)
    65110    {
    66111        $this->vendorDir = $vendorDir;
    67     }
    68 
     112        self::initializeIncludeClosure();
     113    }
     114
     115    /**
     116     * @return string[]
     117     */
    69118    public function getPrefixes()
    70119    {
     
    76125    }
    77126
     127    /**
     128     * @return array[]
     129     * @psalm-return array<string, array<int, string>>
     130     */
    78131    public function getPrefixesPsr4()
    79132    {
     
    81134    }
    82135
     136    /**
     137     * @return array[]
     138     * @psalm-return array<string, string>
     139     */
    83140    public function getFallbackDirs()
    84141    {
     
    86143    }
    87144
     145    /**
     146     * @return array[]
     147     * @psalm-return array<string, string>
     148     */
    88149    public function getFallbackDirsPsr4()
    89150    {
     
    91152    }
    92153
     154    /**
     155     * @return string[] Array of classname => path
     156     * @psalm-return array<string, string>
     157     */
    93158    public function getClassMap()
    94159    {
     
    97162
    98163    /**
    99      * @param array $classMap Class to filename map
     164     * @param string[] $classMap Class to filename map
     165     * @psalm-param array<string, string> $classMap
     166     *
     167     * @return void
    100168     */
    101169    public function addClassMap(array $classMap)
     
    112180     * appending or prepending to the ones previously set for this prefix.
    113181     *
    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
     182     * @param string          $prefix  The prefix
     183     * @param string[]|string $paths   The PSR-0 root directories
     184     * @param bool            $prepend Whether to prepend the directories
     185     *
     186     * @return void
    117187     */
    118188    public function add($prefix, $paths, $prepend = false)
     
    157227     * appending or prepending to the ones previously set for this namespace.
    158228     *
    159      * @param string       $prefix  The prefix/namespace, with trailing '\\'
    160      * @param array|string $paths   The PSR-4 base directories
    161      * @param bool         $prepend Whether to prepend the directories
     229     * @param string          $prefix  The prefix/namespace, with trailing '\\'
     230     * @param string[]|string $paths   The PSR-4 base directories
     231     * @param bool            $prepend Whether to prepend the directories
    162232     *
    163233     * @throws \InvalidArgumentException
     234     *
     235     * @return void
    164236     */
    165237    public function addPsr4($prefix, $paths, $prepend = false)
     
    205277     * replacing any others previously set for this prefix.
    206278     *
    207      * @param string       $prefix The prefix
    208      * @param array|string $paths  The PSR-0 base directories
     279     * @param string          $prefix The prefix
     280     * @param string[]|string $paths  The PSR-0 base directories
     281     *
     282     * @return void
    209283     */
    210284    public function set($prefix, $paths)
     
    221295     * replacing any others previously set for this namespace.
    222296     *
    223      * @param string       $prefix The prefix/namespace, with trailing '\\'
    224      * @param array|string $paths  The PSR-4 base directories
     297     * @param string          $prefix The prefix/namespace, with trailing '\\'
     298     * @param string[]|string $paths  The PSR-4 base directories
    225299     *
    226300     * @throws \InvalidArgumentException
     301     *
     302     * @return void
    227303     */
    228304    public function setPsr4($prefix, $paths)
     
    244320     *
    245321     * @param bool $useIncludePath
     322     *
     323     * @return void
    246324     */
    247325    public function setUseIncludePath($useIncludePath)
     
    266344     *
    267345     * @param bool $classMapAuthoritative
     346     *
     347     * @return void
    268348     */
    269349    public function setClassMapAuthoritative($classMapAuthoritative)
     
    286366     *
    287367     * @param string|null $apcuPrefix
     368     *
     369     * @return void
    288370     */
    289371    public function setApcuPrefix($apcuPrefix)
     
    306388     *
    307389     * @param bool $prepend Whether to prepend the autoloader or not
     390     *
     391     * @return void
    308392     */
    309393    public function register($prepend = false)
     
    325409    /**
    326410     * Unregisters this instance as an autoloader.
     411     *
     412     * @return void
    327413     */
    328414    public function unregister()
     
    339425     *
    340426     * @param  string    $class The name of the class
    341      * @return bool|null True if loaded, null otherwise
     427     * @return true|null True if loaded, null otherwise
    342428     */
    343429    public function loadClass($class)
    344430    {
    345431        if ($file = $this->findFile($class)) {
    346             includeFile($file);
     432            (self::$includeFile)($file);
    347433
    348434            return true;
    349435        }
     436
     437        return null;
    350438    }
    351439
     
    402490    }
    403491
     492    /**
     493     * @param  string       $class
     494     * @param  string       $ext
     495     * @return string|false
     496     */
    404497    private function findFileWithExtension($class, $ext)
    405498    {
     
    467560        return false;
    468561    }
     562
     563    private static function initializeIncludeClosure(): void
     564    {
     565        if (self::$includeFile !== null) {
     566            return;
     567        }
     568
     569        /**
     570         * Scope isolated include.
     571         *
     572         * Prevents access to $this/self from included files.
     573         *
     574         * @param  string $file
     575         * @return void
     576         */
     577        self::$includeFile = static function($file) {
     578            include $file;
     579        };
     580    }
    469581}
    470 
    471 /**
    472  * Scope isolated include.
    473  *
    474  * Prevents access to $this/self from included files.
    475  */
    476 function includeFile($file)
    477 {
    478     include $file;
    479 }
  • lazy-loading-responsive-images/tags/8.1.1/vendor/composer/InstalledVersions.php

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

    r2412362 r2843576  
    33// autoload_classmap.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • lazy-loading-responsive-images/tags/8.1.1/vendor/composer/autoload_namespaces.php

    r1775159 r2843576  
    33// autoload_namespaces.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • lazy-loading-responsive-images/tags/8.1.1/vendor/composer/autoload_psr4.php

    r2236239 r2843576  
    33// autoload_psr4.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • lazy-loading-responsive-images/tags/8.1.1/vendor/composer/autoload_real.php

    r2505151 r2843576  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit1b2cab1f0f7acf7923a366b31a1bde65
     5class ComposerAutoloaderInit992eca56574b9f1c8fe962b958c076b3
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit1b2cab1f0f7acf7923a366b31a1bde65', 'loadClassLoader'), true, true);
    28         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit1b2cab1f0f7acf7923a366b31a1bde65', 'loadClassLoader'));
     27        spl_autoload_register(array('ComposerAutoloaderInit992eca56574b9f1c8fe962b958c076b3', 'loadClassLoader'), true, true);
     28        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit992eca56574b9f1c8fe962b958c076b3', 'loadClassLoader'));
    3030
    31         $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
    32         if ($useStaticLoader) {
    33             require __DIR__ . '/autoload_static.php';
    34 
    35             call_user_func(\Composer\Autoload\ComposerStaticInit1b2cab1f0f7acf7923a366b31a1bde65::getInitializer($loader));
    36         } else {
    37             $map = require __DIR__ . '/autoload_namespaces.php';
    38             foreach ($map as $namespace => $path) {
    39                 $loader->set($namespace, $path);
    40             }
    41 
    42             $map = require __DIR__ . '/autoload_psr4.php';
    43             foreach ($map as $namespace => $path) {
    44                 $loader->setPsr4($namespace, $path);
    45             }
    46 
    47             $classMap = require __DIR__ . '/autoload_classmap.php';
    48             if ($classMap) {
    49                 $loader->addClassMap($classMap);
    50             }
    51         }
     31        require __DIR__ . '/autoload_static.php';
     32        call_user_func(\Composer\Autoload\ComposerStaticInit992eca56574b9f1c8fe962b958c076b3::getInitializer($loader));
    5233
    5334        $loader->register(true);
  • lazy-loading-responsive-images/tags/8.1.1/vendor/composer/autoload_static.php

    r2505151 r2843576  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit1b2cab1f0f7acf7923a366b31a1bde65
     7class ComposerStaticInit992eca56574b9f1c8fe962b958c076b3
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    5959    {
    6060        return \Closure::bind(function () use ($loader) {
    61             $loader->prefixLengthsPsr4 = ComposerStaticInit1b2cab1f0f7acf7923a366b31a1bde65::$prefixLengthsPsr4;
    62             $loader->prefixDirsPsr4 = ComposerStaticInit1b2cab1f0f7acf7923a366b31a1bde65::$prefixDirsPsr4;
    63             $loader->classMap = ComposerStaticInit1b2cab1f0f7acf7923a366b31a1bde65::$classMap;
     61            $loader->prefixLengthsPsr4 = ComposerStaticInit992eca56574b9f1c8fe962b958c076b3::$prefixLengthsPsr4;
     62            $loader->prefixDirsPsr4 = ComposerStaticInit992eca56574b9f1c8fe962b958c076b3::$prefixDirsPsr4;
     63            $loader->classMap = ComposerStaticInit992eca56574b9f1c8fe962b958c076b3::$classMap;
    6464
    6565        }, null, ClassLoader::class);
  • lazy-loading-responsive-images/tags/8.1.1/vendor/composer/installed.php

    r2505151 r2843576  
    1 <?php return array (
    2   'root' =>
    3   array (
    4     'pretty_version' => 'v8.1.0',
    5     'version' => '8.1.0.0',
    6     'aliases' =>
    7     array (
     1<?php return array(
     2    'root' => array(
     3        'name' => 'florianbrinkmann/lazy-loading-responsive-images',
     4        'pretty_version' => 'v8.1.1',
     5        'version' => '8.1.1.0',
     6        'reference' => '35f8dc96cbf8528f0d89478d3fd5377af01c3692',
     7        'type' => 'wordpress-plugin',
     8        'install_path' => __DIR__ . '/../../',
     9        'aliases' => array(),
     10        'dev' => false,
    811    ),
    9     'reference' => '744ec50b1b65984a98a003301a7a64fdbbd6172f',
    10     'name' => 'florianbrinkmann/lazy-loading-responsive-images',
    11   ),
    12   'versions' =>
    13   array (
    14     'florianbrinkmann/lazy-loading-responsive-images' =>
    15     array (
    16       'pretty_version' => 'v8.1.0',
    17       'version' => '8.1.0.0',
    18       'aliases' =>
    19       array (
    20       ),
    21       'reference' => '744ec50b1b65984a98a003301a7a64fdbbd6172f',
     12    'versions' => array(
     13        'florianbrinkmann/lazy-loading-responsive-images' => array(
     14            'pretty_version' => 'v8.1.1',
     15            'version' => '8.1.1.0',
     16            'reference' => '35f8dc96cbf8528f0d89478d3fd5377af01c3692',
     17            'type' => 'wordpress-plugin',
     18            'install_path' => __DIR__ . '/../../',
     19            'aliases' => array(),
     20            'dev_requirement' => false,
     21        ),
     22        'masterminds/html5' => array(
     23            'pretty_version' => '2.7.4',
     24            'version' => '2.7.4.0',
     25            'reference' => '9227822783c75406cfe400984b2f095cdf03d417',
     26            'type' => 'library',
     27            'install_path' => __DIR__ . '/../masterminds/html5',
     28            'aliases' => array(),
     29            'dev_requirement' => false,
     30        ),
    2231    ),
    23     'masterminds/html5' =>
    24     array (
    25       'pretty_version' => '2.7.4',
    26       'version' => '2.7.4.0',
    27       'aliases' =>
    28       array (
    29       ),
    30       'reference' => '9227822783c75406cfe400984b2f095cdf03d417',
    31     ),
    32   ),
    3332);
  • lazy-loading-responsive-images/trunk/js/build/functions.asset.php

    r2490389 r2843576  
    1 <?php return array('dependencies' => array('wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-polyfill'), 'version' => '90972edff99c4323ad9e62bce64479aa');
     1<?php return array('dependencies' => array('wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '978f3655d6093f212c9a');
  • lazy-loading-responsive-images/trunk/js/build/functions.js

    r2490389 r2843576  
    1 !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.components},function(e,t){e.exports=window.wp.editPost},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.plugins},function(e,t){e.exports=window.wp.i18n},function(e,t,n){"use strict";n.r(t);var r=n(2),o=n.n(r),i=n(0),c=n(3),u=n(4),a=n(5),l=n(1),p=n(6),s=n(7);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b=Object(a.compose)([Object(l.withSelect)((function(e){return{meta:(0,e("core/editor").getEditedPostAttribute)("meta")}})),Object(l.withDispatch)((function(e,t){var n=t.meta,r=e("core/editor").editPost;return{updateMeta:function(e){r({meta:d(d({},n),e)})}}}))])((function(e){var t=e.meta,n=e.updateMeta,r=t.lazy_load_responsive_images_disabled;return Object(i.createElement)(u.PluginPostStatusInfo,{className:"lazy-loader-plugin"},Object(i.createElement)("div",null,Object(i.createElement)(c.CheckboxControl,{label:Object(s.__)("Disable Lazy Loader","lazy-loading-responsive-images"),checked:r,onChange:function(e){n({lazy_load_responsive_images_disabled:e||0})}})))}));Object(p.registerPlugin)("lazy-loader-gutenberg",{render:b})}]);
     1(()=>{"use strict";const e=window.wp.element,t=window.wp.components,o=window.wp.editPost,a=window.wp.compose,n=window.wp.data,i=window.wp.plugins,s=window.wp.i18n,l=(0,a.compose)([(0,n.withSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor");return{meta:t("meta")}})),(0,n.withDispatch)(((e,t)=>{let{meta:o}=t;const{editPost:a}=e("core/editor");return{updateMeta(e){a({meta:{...o,...e}})}}}))])((a=>{let{meta:n,updateMeta:i}=a;const l=n.lazy_load_responsive_images_disabled;return(0,e.createElement)(o.PluginPostStatusInfo,{className:"lazy-loader-plugin"},(0,e.createElement)("div",null,(0,e.createElement)(t.CheckboxControl,{label:(0,s.__)("Disable Lazy Loader","lazy-loading-responsive-images"),checked:l,onChange:e=>{i({lazy_load_responsive_images_disabled:e||0})}})))}));(0,i.registerPlugin)("lazy-loader-gutenberg",{render:l})})();
  • lazy-loading-responsive-images/trunk/lazy-load-responsive-images.php

    r2505151 r2843576  
    1010 * Plugin URI:  https://florianbrinkmann.com/en/3350/responsive-images-and-lazy-loading-in-wordpress/
    1111 * Description: Lazy loading plugin that supports images, iFrames, video and audio elements and uses lazysizes.js. With manual modification of the markup it is also possible to lazy load background images, scripts, and styles.
    12  * Version:     8.1.0
     12 * Version:     8.1.1
    1313 * Author:      Florian Brinkmann
    1414 * Author URI:  https://florianbrinkmann.com/en/
  • lazy-loading-responsive-images/trunk/readme.txt

    r2757274 r2843576  
    44Tags: lazysizes, lazy loading, performance, images
    55Requires at least: 4.9.8
    6 Tested up to: 6.0
    7 Stable tag: 8.1.0
     6Tested up to: 6.1
     7Stable tag: 8.1.1
    88Requires PHP: 7.0
    99
     
    105105== Changelog ==
    106106
     107= 8.1.1 – 20.12.2022 =
     108
     109Tested with WordPress 6.1.
     110
     111**Fixed**
     112
     113- Disable lazy loading in TranslatePress editor.
     114
    107115= 8.1.0 – 29.03.2021 =
    108116
  • lazy-loading-responsive-images/trunk/src/Helpers.php

    r2499170 r2843576  
    151151        }
    152152
     153        // Check for TranslatePress editor.
     154        if ( isset( $_REQUEST['trp-edit-translation'] ) ) {
     155            return false;
     156        }
     157
    153158        return true;
    154159    }
  • lazy-loading-responsive-images/trunk/vendor/autoload.php

    r2505151 r2843576  
    33// autoload.php @generated by Composer
    44
     5if (PHP_VERSION_ID < 50600) {
     6    if (!headers_sent()) {
     7        header('HTTP/1.1 500 Internal Server Error');
     8    }
     9    $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
     10    if (!ini_get('display_errors')) {
     11        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
     12            fwrite(STDERR, $err);
     13        } elseif (!headers_sent()) {
     14            echo $err;
     15        }
     16    }
     17    trigger_error(
     18        $err,
     19        E_USER_ERROR
     20    );
     21}
     22
    523require_once __DIR__ . '/composer/autoload_real.php';
    624
    7 return ComposerAutoloaderInit1b2cab1f0f7acf7923a366b31a1bde65::getLoader();
     25return ComposerAutoloaderInit992eca56574b9f1c8fe962b958c076b3::getLoader();
  • lazy-loading-responsive-images/trunk/vendor/composer/ClassLoader.php

    r2489768 r2843576  
    4343class ClassLoader
    4444{
     45    /** @var \Closure(string):void */
     46    private static $includeFile;
     47
     48    /** @var ?string */
    4549    private $vendorDir;
    4650
    4751    // PSR-4
     52    /**
     53     * @var array[]
     54     * @psalm-var array<string, array<string, int>>
     55     */
    4856    private $prefixLengthsPsr4 = array();
     57    /**
     58     * @var array[]
     59     * @psalm-var array<string, array<int, string>>
     60     */
    4961    private $prefixDirsPsr4 = array();
     62    /**
     63     * @var array[]
     64     * @psalm-var array<string, string>
     65     */
    5066    private $fallbackDirsPsr4 = array();
    5167
    5268    // PSR-0
     69    /**
     70     * @var array[]
     71     * @psalm-var array<string, array<string, string[]>>
     72     */
    5373    private $prefixesPsr0 = array();
     74    /**
     75     * @var array[]
     76     * @psalm-var array<string, string>
     77     */
    5478    private $fallbackDirsPsr0 = array();
    5579
     80    /** @var bool */
    5681    private $useIncludePath = false;
     82
     83    /**
     84     * @var string[]
     85     * @psalm-var array<string, string>
     86     */
    5787    private $classMap = array();
     88
     89    /** @var bool */
    5890    private $classMapAuthoritative = false;
     91
     92    /**
     93     * @var bool[]
     94     * @psalm-var array<string, bool>
     95     */
    5996    private $missingClasses = array();
     97
     98    /** @var ?string */
    6099    private $apcuPrefix;
    61100
     101    /**
     102     * @var self[]
     103     */
    62104    private static $registeredLoaders = array();
    63105
     106    /**
     107     * @param ?string $vendorDir
     108     */
    64109    public function __construct($vendorDir = null)
    65110    {
    66111        $this->vendorDir = $vendorDir;
    67     }
    68 
     112        self::initializeIncludeClosure();
     113    }
     114
     115    /**
     116     * @return string[]
     117     */
    69118    public function getPrefixes()
    70119    {
     
    76125    }
    77126
     127    /**
     128     * @return array[]
     129     * @psalm-return array<string, array<int, string>>
     130     */
    78131    public function getPrefixesPsr4()
    79132    {
     
    81134    }
    82135
     136    /**
     137     * @return array[]
     138     * @psalm-return array<string, string>
     139     */
    83140    public function getFallbackDirs()
    84141    {
     
    86143    }
    87144
     145    /**
     146     * @return array[]
     147     * @psalm-return array<string, string>
     148     */
    88149    public function getFallbackDirsPsr4()
    89150    {
     
    91152    }
    92153
     154    /**
     155     * @return string[] Array of classname => path
     156     * @psalm-return array<string, string>
     157     */
    93158    public function getClassMap()
    94159    {
     
    97162
    98163    /**
    99      * @param array $classMap Class to filename map
     164     * @param string[] $classMap Class to filename map
     165     * @psalm-param array<string, string> $classMap
     166     *
     167     * @return void
    100168     */
    101169    public function addClassMap(array $classMap)
     
    112180     * appending or prepending to the ones previously set for this prefix.
    113181     *
    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
     182     * @param string          $prefix  The prefix
     183     * @param string[]|string $paths   The PSR-0 root directories
     184     * @param bool            $prepend Whether to prepend the directories
     185     *
     186     * @return void
    117187     */
    118188    public function add($prefix, $paths, $prepend = false)
     
    157227     * appending or prepending to the ones previously set for this namespace.
    158228     *
    159      * @param string       $prefix  The prefix/namespace, with trailing '\\'
    160      * @param array|string $paths   The PSR-4 base directories
    161      * @param bool         $prepend Whether to prepend the directories
     229     * @param string          $prefix  The prefix/namespace, with trailing '\\'
     230     * @param string[]|string $paths   The PSR-4 base directories
     231     * @param bool            $prepend Whether to prepend the directories
    162232     *
    163233     * @throws \InvalidArgumentException
     234     *
     235     * @return void
    164236     */
    165237    public function addPsr4($prefix, $paths, $prepend = false)
     
    205277     * replacing any others previously set for this prefix.
    206278     *
    207      * @param string       $prefix The prefix
    208      * @param array|string $paths  The PSR-0 base directories
     279     * @param string          $prefix The prefix
     280     * @param string[]|string $paths  The PSR-0 base directories
     281     *
     282     * @return void
    209283     */
    210284    public function set($prefix, $paths)
     
    221295     * replacing any others previously set for this namespace.
    222296     *
    223      * @param string       $prefix The prefix/namespace, with trailing '\\'
    224      * @param array|string $paths  The PSR-4 base directories
     297     * @param string          $prefix The prefix/namespace, with trailing '\\'
     298     * @param string[]|string $paths  The PSR-4 base directories
    225299     *
    226300     * @throws \InvalidArgumentException
     301     *
     302     * @return void
    227303     */
    228304    public function setPsr4($prefix, $paths)
     
    244320     *
    245321     * @param bool $useIncludePath
     322     *
     323     * @return void
    246324     */
    247325    public function setUseIncludePath($useIncludePath)
     
    266344     *
    267345     * @param bool $classMapAuthoritative
     346     *
     347     * @return void
    268348     */
    269349    public function setClassMapAuthoritative($classMapAuthoritative)
     
    286366     *
    287367     * @param string|null $apcuPrefix
     368     *
     369     * @return void
    288370     */
    289371    public function setApcuPrefix($apcuPrefix)
     
    306388     *
    307389     * @param bool $prepend Whether to prepend the autoloader or not
     390     *
     391     * @return void
    308392     */
    309393    public function register($prepend = false)
     
    325409    /**
    326410     * Unregisters this instance as an autoloader.
     411     *
     412     * @return void
    327413     */
    328414    public function unregister()
     
    339425     *
    340426     * @param  string    $class The name of the class
    341      * @return bool|null True if loaded, null otherwise
     427     * @return true|null True if loaded, null otherwise
    342428     */
    343429    public function loadClass($class)
    344430    {
    345431        if ($file = $this->findFile($class)) {
    346             includeFile($file);
     432            (self::$includeFile)($file);
    347433
    348434            return true;
    349435        }
     436
     437        return null;
    350438    }
    351439
     
    402490    }
    403491
     492    /**
     493     * @param  string       $class
     494     * @param  string       $ext
     495     * @return string|false
     496     */
    404497    private function findFileWithExtension($class, $ext)
    405498    {
     
    467560        return false;
    468561    }
     562
     563    private static function initializeIncludeClosure(): void
     564    {
     565        if (self::$includeFile !== null) {
     566            return;
     567        }
     568
     569        /**
     570         * Scope isolated include.
     571         *
     572         * Prevents access to $this/self from included files.
     573         *
     574         * @param  string $file
     575         * @return void
     576         */
     577        self::$includeFile = static function($file) {
     578            include $file;
     579        };
     580    }
    469581}
    470 
    471 /**
    472  * Scope isolated include.
    473  *
    474  * Prevents access to $this/self from included files.
    475  */
    476 function includeFile($file)
    477 {
    478     include $file;
    479 }
  • lazy-loading-responsive-images/trunk/vendor/composer/InstalledVersions.php

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

    r2412362 r2843576  
    33// autoload_classmap.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • lazy-loading-responsive-images/trunk/vendor/composer/autoload_namespaces.php

    r1775159 r2843576  
    33// autoload_namespaces.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • lazy-loading-responsive-images/trunk/vendor/composer/autoload_psr4.php

    r2236239 r2843576  
    33// autoload_psr4.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • lazy-loading-responsive-images/trunk/vendor/composer/autoload_real.php

    r2505151 r2843576  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit1b2cab1f0f7acf7923a366b31a1bde65
     5class ComposerAutoloaderInit992eca56574b9f1c8fe962b958c076b3
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit1b2cab1f0f7acf7923a366b31a1bde65', 'loadClassLoader'), true, true);
    28         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit1b2cab1f0f7acf7923a366b31a1bde65', 'loadClassLoader'));
     27        spl_autoload_register(array('ComposerAutoloaderInit992eca56574b9f1c8fe962b958c076b3', 'loadClassLoader'), true, true);
     28        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit992eca56574b9f1c8fe962b958c076b3', 'loadClassLoader'));
    3030
    31         $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
    32         if ($useStaticLoader) {
    33             require __DIR__ . '/autoload_static.php';
    34 
    35             call_user_func(\Composer\Autoload\ComposerStaticInit1b2cab1f0f7acf7923a366b31a1bde65::getInitializer($loader));
    36         } else {
    37             $map = require __DIR__ . '/autoload_namespaces.php';
    38             foreach ($map as $namespace => $path) {
    39                 $loader->set($namespace, $path);
    40             }
    41 
    42             $map = require __DIR__ . '/autoload_psr4.php';
    43             foreach ($map as $namespace => $path) {
    44                 $loader->setPsr4($namespace, $path);
    45             }
    46 
    47             $classMap = require __DIR__ . '/autoload_classmap.php';
    48             if ($classMap) {
    49                 $loader->addClassMap($classMap);
    50             }
    51         }
     31        require __DIR__ . '/autoload_static.php';
     32        call_user_func(\Composer\Autoload\ComposerStaticInit992eca56574b9f1c8fe962b958c076b3::getInitializer($loader));
    5233
    5334        $loader->register(true);
  • lazy-loading-responsive-images/trunk/vendor/composer/autoload_static.php

    r2505151 r2843576  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit1b2cab1f0f7acf7923a366b31a1bde65
     7class ComposerStaticInit992eca56574b9f1c8fe962b958c076b3
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    5959    {
    6060        return \Closure::bind(function () use ($loader) {
    61             $loader->prefixLengthsPsr4 = ComposerStaticInit1b2cab1f0f7acf7923a366b31a1bde65::$prefixLengthsPsr4;
    62             $loader->prefixDirsPsr4 = ComposerStaticInit1b2cab1f0f7acf7923a366b31a1bde65::$prefixDirsPsr4;
    63             $loader->classMap = ComposerStaticInit1b2cab1f0f7acf7923a366b31a1bde65::$classMap;
     61            $loader->prefixLengthsPsr4 = ComposerStaticInit992eca56574b9f1c8fe962b958c076b3::$prefixLengthsPsr4;
     62            $loader->prefixDirsPsr4 = ComposerStaticInit992eca56574b9f1c8fe962b958c076b3::$prefixDirsPsr4;
     63            $loader->classMap = ComposerStaticInit992eca56574b9f1c8fe962b958c076b3::$classMap;
    6464
    6565        }, null, ClassLoader::class);
  • lazy-loading-responsive-images/trunk/vendor/composer/installed.php

    r2505151 r2843576  
    1 <?php return array (
    2   'root' =>
    3   array (
    4     'pretty_version' => 'v8.1.0',
    5     'version' => '8.1.0.0',
    6     'aliases' =>
    7     array (
     1<?php return array(
     2    'root' => array(
     3        'name' => 'florianbrinkmann/lazy-loading-responsive-images',
     4        'pretty_version' => 'v8.1.1',
     5        'version' => '8.1.1.0',
     6        'reference' => '35f8dc96cbf8528f0d89478d3fd5377af01c3692',
     7        'type' => 'wordpress-plugin',
     8        'install_path' => __DIR__ . '/../../',
     9        'aliases' => array(),
     10        'dev' => false,
    811    ),
    9     'reference' => '744ec50b1b65984a98a003301a7a64fdbbd6172f',
    10     'name' => 'florianbrinkmann/lazy-loading-responsive-images',
    11   ),
    12   'versions' =>
    13   array (
    14     'florianbrinkmann/lazy-loading-responsive-images' =>
    15     array (
    16       'pretty_version' => 'v8.1.0',
    17       'version' => '8.1.0.0',
    18       'aliases' =>
    19       array (
    20       ),
    21       'reference' => '744ec50b1b65984a98a003301a7a64fdbbd6172f',
     12    'versions' => array(
     13        'florianbrinkmann/lazy-loading-responsive-images' => array(
     14            'pretty_version' => 'v8.1.1',
     15            'version' => '8.1.1.0',
     16            'reference' => '35f8dc96cbf8528f0d89478d3fd5377af01c3692',
     17            'type' => 'wordpress-plugin',
     18            'install_path' => __DIR__ . '/../../',
     19            'aliases' => array(),
     20            'dev_requirement' => false,
     21        ),
     22        'masterminds/html5' => array(
     23            'pretty_version' => '2.7.4',
     24            'version' => '2.7.4.0',
     25            'reference' => '9227822783c75406cfe400984b2f095cdf03d417',
     26            'type' => 'library',
     27            'install_path' => __DIR__ . '/../masterminds/html5',
     28            'aliases' => array(),
     29            'dev_requirement' => false,
     30        ),
    2231    ),
    23     'masterminds/html5' =>
    24     array (
    25       'pretty_version' => '2.7.4',
    26       'version' => '2.7.4.0',
    27       'aliases' =>
    28       array (
    29       ),
    30       'reference' => '9227822783c75406cfe400984b2f095cdf03d417',
    31     ),
    32   ),
    3332);
Note: See TracChangeset for help on using the changeset viewer.