Changeset 2928639
- Timestamp:
- 06/20/2023 01:27:22 PM (3 years ago)
- Location:
- on-demand-revalidation
- Files:
-
- 16 edited
- 1 copied
-
tags/1.1.2 (copied) (copied from on-demand-revalidation/trunk)
-
tags/1.1.2/on-demand-revalidation.php (modified) (1 diff)
-
tags/1.1.2/readme.txt (modified) (2 diffs)
-
tags/1.1.2/src/Revalidation.php (modified) (1 diff)
-
tags/1.1.2/vendor/autoload.php (modified) (1 diff)
-
tags/1.1.2/vendor/composer/ClassLoader.php (modified) (24 diffs)
-
tags/1.1.2/vendor/composer/autoload_real.php (modified) (2 diffs)
-
tags/1.1.2/vendor/composer/autoload_static.php (modified) (2 diffs)
-
tags/1.1.2/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/on-demand-revalidation.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/Revalidation.php (modified) (1 diff)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/ClassLoader.php (modified) (24 diffs)
-
trunk/vendor/composer/autoload_real.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
on-demand-revalidation/tags/1.1.2/on-demand-revalidation.php
r2922642 r2928639 7 7 * GitHub Plugin URI: https://github.com/gdidentity/on-demand-revalidation 8 8 * Description: Next.js On-Demand Revalidation on the post update, revalidate specific paths on the post update. 9 * Version: 1.1. 19 * Version: 1.1.2 10 10 * Author: GD IDENTITY 11 11 * Author URI: https://gdidentity.sk -
on-demand-revalidation/tags/1.1.2/readme.txt
r2922642 r2928639 4 4 Requires at least: 4.7 5 5 Tested up to: 6.2.2 6 Stable tag: 1.1. 16 Stable tag: 1.1.2 7 7 Requires PHP: 5.6 8 8 License: GPL-3 … … 25 25 26 26 == Changelog == 27 = 1.1.2 = 28 - fix: reduce unnecessary revalidations from @humet 29 27 30 = 1.1.1 = 28 31 - Allow custom taxonomies revalidation from @humet -
on-demand-revalidation/tags/1.1.2/src/Revalidation.php
r2851867 r2928639 10 10 11 11 public static function init() { 12 add_action('wp_insert_post', function ( $post_ID, $post, $update ) { 13 if ( wp_is_post_revision( $post_ID ) ) { 14 return; 15 } 16 12 add_action( 'save_post', [ self::class, 'handleSavePost' ], 10, 2 ); 13 add_action( 'transition_post_status', [ self::class, 'handleTransitionPostStatus' ], 10, 3 ); 14 add_action( 'on_demand_revalidation_on_post_update', [ self::class, 'revalidate' ], 10, 1 ); 15 } 16 17 public static function handleSavePost( $post_id, $post ) { 18 $excluded_statuses = [ 'auto-draft', 'inherit', 'draft', 'trash' ]; 19 20 if ( isset( $post->post_status ) && in_array( $post->post_status, $excluded_statuses, true ) ) { 21 return; 22 } 23 24 if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { 25 return; 26 } 27 28 if ( false !== wp_is_post_revision( $post_id ) ) { 29 return; 30 } 31 32 self::revalidatePost( $post ); 33 } 34 35 public static function handleTransitionPostStatus( $new_status, $old_status, $post ) { 36 if ( ( ( 'draft' !== $old_status && 'trash' !== $old_status ) && 'trash' === $new_status ) || 37 ( 'publish' === $old_status && 'draft' === $new_status ) ) { 17 38 self::revalidatePost( $post ); 18 }, 10, 3); 19 20 add_action('transition_post_status', function ( $new_status, $old_status, $post ) { 21 self::revalidatePost( $post ); 22 }, 10, 3); 23 24 add_action('on_demand_revalidation_on_post_update', function ( $post ) { 25 self::revalidate( $post ); 26 }, 10, 1); 27 } 39 } 40 } 28 41 29 42 static function revalidatePost( $post ) { -
on-demand-revalidation/tags/1.1.2/vendor/autoload.php
r2922642 r2928639 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInit 27ececded4adebc28426c7875ebb1660::getLoader();25 return ComposerAutoloaderInitd7ab5d2bc8c647041a63d77dcae26203::getLoader(); -
on-demand-revalidation/tags/1.1.2/vendor/composer/ClassLoader.php
r2863031 r2928639 46 46 private static $includeFile; 47 47 48 /** @var ?string*/48 /** @var string|null */ 49 49 private $vendorDir; 50 50 51 51 // PSR-4 52 52 /** 53 * @var array[] 54 * @psalm-var array<string, array<string, int>> 53 * @var array<string, array<string, int>> 55 54 */ 56 55 private $prefixLengthsPsr4 = array(); 57 56 /** 58 * @var array[] 59 * @psalm-var array<string, array<int, string>> 57 * @var array<string, list<string>> 60 58 */ 61 59 private $prefixDirsPsr4 = array(); 62 60 /** 63 * @var array[] 64 * @psalm-var array<string, string> 61 * @var list<string> 65 62 */ 66 63 private $fallbackDirsPsr4 = array(); … … 68 65 // PSR-0 69 66 /** 70 * @var array[] 71 * @psalm-var array<string, array<string, string[]>> 67 * List of PSR-0 prefixes 68 * 69 * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) 70 * 71 * @var array<string, array<string, list<string>>> 72 72 */ 73 73 private $prefixesPsr0 = array(); 74 74 /** 75 * @var array[] 76 * @psalm-var array<string, string> 75 * @var list<string> 77 76 */ 78 77 private $fallbackDirsPsr0 = array(); … … 82 81 83 82 /** 84 * @var string[] 85 * @psalm-var array<string, string> 83 * @var array<string, string> 86 84 */ 87 85 private $classMap = array(); … … 91 89 92 90 /** 93 * @var bool[] 94 * @psalm-var array<string, bool> 91 * @var array<string, bool> 95 92 */ 96 93 private $missingClasses = array(); 97 94 98 /** @var ?string*/95 /** @var string|null */ 99 96 private $apcuPrefix; 100 97 101 98 /** 102 * @var self[]99 * @var array<string, self> 103 100 */ 104 101 private static $registeredLoaders = array(); 105 102 106 103 /** 107 * @param ?string$vendorDir104 * @param string|null $vendorDir 108 105 */ 109 106 public function __construct($vendorDir = null) … … 114 111 115 112 /** 116 * @return string[]113 * @return array<string, list<string>> 117 114 */ 118 115 public function getPrefixes() … … 126 123 127 124 /** 128 * @return array[] 129 * @psalm-return array<string, array<int, string>> 125 * @return array<string, list<string>> 130 126 */ 131 127 public function getPrefixesPsr4() … … 135 131 136 132 /** 137 * @return array[] 138 * @psalm-return array<string, string> 133 * @return list<string> 139 134 */ 140 135 public function getFallbackDirs() … … 144 139 145 140 /** 146 * @return array[] 147 * @psalm-return array<string, string> 141 * @return list<string> 148 142 */ 149 143 public function getFallbackDirsPsr4() … … 153 147 154 148 /** 155 * @return string[] Array of classname => path 156 * @psalm-return array<string, string> 149 * @return array<string, string> Array of classname => path 157 150 */ 158 151 public function getClassMap() … … 162 155 163 156 /** 164 * @param string[] $classMap Class to filename map 165 * @psalm-param array<string, string> $classMap 157 * @param array<string, string> $classMap Class to filename map 166 158 * 167 159 * @return void … … 180 172 * appending or prepending to the ones previously set for this prefix. 181 173 * 182 * @param string $prefix The prefix183 * @param string[]|string $paths The PSR-0 root directories184 * @param bool $prepend Whether to prepend the directories174 * @param string $prefix The prefix 175 * @param list<string>|string $paths The PSR-0 root directories 176 * @param bool $prepend Whether to prepend the directories 185 177 * 186 178 * @return void … … 188 180 public function add($prefix, $paths, $prepend = false) 189 181 { 182 $paths = (array) $paths; 190 183 if (!$prefix) { 191 184 if ($prepend) { 192 185 $this->fallbackDirsPsr0 = array_merge( 193 (array)$paths,186 $paths, 194 187 $this->fallbackDirsPsr0 195 188 ); … … 197 190 $this->fallbackDirsPsr0 = array_merge( 198 191 $this->fallbackDirsPsr0, 199 (array)$paths192 $paths 200 193 ); 201 194 } … … 206 199 $first = $prefix[0]; 207 200 if (!isset($this->prefixesPsr0[$first][$prefix])) { 208 $this->prefixesPsr0[$first][$prefix] = (array)$paths;201 $this->prefixesPsr0[$first][$prefix] = $paths; 209 202 210 203 return; … … 212 205 if ($prepend) { 213 206 $this->prefixesPsr0[$first][$prefix] = array_merge( 214 (array)$paths,207 $paths, 215 208 $this->prefixesPsr0[$first][$prefix] 216 209 ); … … 218 211 $this->prefixesPsr0[$first][$prefix] = array_merge( 219 212 $this->prefixesPsr0[$first][$prefix], 220 (array)$paths213 $paths 221 214 ); 222 215 } … … 227 220 * appending or prepending to the ones previously set for this namespace. 228 221 * 229 * @param string $prefix The prefix/namespace, with trailing '\\'230 * @param string[]|string $paths The PSR-4 base directories231 * @param bool $prepend Whether to prepend the directories222 * @param string $prefix The prefix/namespace, with trailing '\\' 223 * @param list<string>|string $paths The PSR-4 base directories 224 * @param bool $prepend Whether to prepend the directories 232 225 * 233 226 * @throws \InvalidArgumentException … … 237 230 public function addPsr4($prefix, $paths, $prepend = false) 238 231 { 232 $paths = (array) $paths; 239 233 if (!$prefix) { 240 234 // Register directories for the root namespace. 241 235 if ($prepend) { 242 236 $this->fallbackDirsPsr4 = array_merge( 243 (array)$paths,237 $paths, 244 238 $this->fallbackDirsPsr4 245 239 ); … … 247 241 $this->fallbackDirsPsr4 = array_merge( 248 242 $this->fallbackDirsPsr4, 249 (array)$paths243 $paths 250 244 ); 251 245 } … … 257 251 } 258 252 $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; 259 $this->prefixDirsPsr4[$prefix] = (array)$paths;253 $this->prefixDirsPsr4[$prefix] = $paths; 260 254 } elseif ($prepend) { 261 255 // Prepend directories for an already registered namespace. 262 256 $this->prefixDirsPsr4[$prefix] = array_merge( 263 (array)$paths,257 $paths, 264 258 $this->prefixDirsPsr4[$prefix] 265 259 ); … … 268 262 $this->prefixDirsPsr4[$prefix] = array_merge( 269 263 $this->prefixDirsPsr4[$prefix], 270 (array)$paths264 $paths 271 265 ); 272 266 } … … 277 271 * replacing any others previously set for this prefix. 278 272 * 279 * @param string $prefix The prefix280 * @param string[]|string $paths The PSR-0 base directories273 * @param string $prefix The prefix 274 * @param list<string>|string $paths The PSR-0 base directories 281 275 * 282 276 * @return void … … 295 289 * replacing any others previously set for this namespace. 296 290 * 297 * @param string $prefix The prefix/namespace, with trailing '\\'298 * @param string[]|string $paths The PSR-4 base directories291 * @param string $prefix The prefix/namespace, with trailing '\\' 292 * @param list<string>|string $paths The PSR-4 base directories 299 293 * 300 294 * @throws \InvalidArgumentException … … 482 476 483 477 /** 484 * Returns the currently registered loaders indexed by their corresponding vendor directories.485 * 486 * @return self[]478 * Returns the currently registered loaders keyed by their corresponding vendor directories. 479 * 480 * @return array<string, self> 487 481 */ 488 482 public static function getRegisteredLoaders() -
on-demand-revalidation/tags/1.1.2/vendor/composer/autoload_real.php
r2922642 r2928639 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 27ececded4adebc28426c7875ebb16605 class ComposerAutoloaderInitd7ab5d2bc8c647041a63d77dcae26203 6 6 { 7 7 private static $loader; … … 23 23 } 24 24 25 spl_autoload_register(array('ComposerAutoloaderInit 27ececded4adebc28426c7875ebb1660', 'loadClassLoader'), true, true);25 spl_autoload_register(array('ComposerAutoloaderInitd7ab5d2bc8c647041a63d77dcae26203', 'loadClassLoader'), true, true); 26 26 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 27 spl_autoload_unregister(array('ComposerAutoloaderInit 27ececded4adebc28426c7875ebb1660', 'loadClassLoader'));27 spl_autoload_unregister(array('ComposerAutoloaderInitd7ab5d2bc8c647041a63d77dcae26203', 'loadClassLoader')); 28 28 29 29 require __DIR__ . '/autoload_static.php'; 30 call_user_func(\Composer\Autoload\ComposerStaticInit 27ececded4adebc28426c7875ebb1660::getInitializer($loader));30 call_user_func(\Composer\Autoload\ComposerStaticInitd7ab5d2bc8c647041a63d77dcae26203::getInitializer($loader)); 31 31 32 32 $loader->register(true); -
on-demand-revalidation/tags/1.1.2/vendor/composer/autoload_static.php
r2922642 r2928639 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 27ececded4adebc28426c7875ebb16607 class ComposerStaticInitd7ab5d2bc8c647041a63d77dcae26203 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 32 32 { 33 33 return \Closure::bind(function () use ($loader) { 34 $loader->prefixLengthsPsr4 = ComposerStaticInit 27ececded4adebc28426c7875ebb1660::$prefixLengthsPsr4;35 $loader->prefixDirsPsr4 = ComposerStaticInit 27ececded4adebc28426c7875ebb1660::$prefixDirsPsr4;36 $loader->classMap = ComposerStaticInit 27ececded4adebc28426c7875ebb1660::$classMap;34 $loader->prefixLengthsPsr4 = ComposerStaticInitd7ab5d2bc8c647041a63d77dcae26203::$prefixLengthsPsr4; 35 $loader->prefixDirsPsr4 = ComposerStaticInitd7ab5d2bc8c647041a63d77dcae26203::$prefixDirsPsr4; 36 $loader->classMap = ComposerStaticInitd7ab5d2bc8c647041a63d77dcae26203::$classMap; 37 37 38 38 }, null, ClassLoader::class); -
on-demand-revalidation/tags/1.1.2/vendor/composer/installed.php
r2922642 r2928639 2 2 'root' => array( 3 3 'name' => 'gdidentity/on-demand-revalidation', 4 'pretty_version' => '1.1. 1',5 'version' => '1.1. 1.0',6 'reference' => ' eb84797d467da04b93044aa1943ae07c6842711b',4 'pretty_version' => '1.1.2', 5 'version' => '1.1.2.0', 6 'reference' => '574563b39a6787b43b6d99cc5df0cf8739ad3c33', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'gdidentity/on-demand-revalidation' => array( 14 'pretty_version' => '1.1. 1',15 'version' => '1.1. 1.0',16 'reference' => ' eb84797d467da04b93044aa1943ae07c6842711b',14 'pretty_version' => '1.1.2', 15 'version' => '1.1.2.0', 16 'reference' => '574563b39a6787b43b6d99cc5df0cf8739ad3c33', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../', -
on-demand-revalidation/trunk/on-demand-revalidation.php
r2922642 r2928639 7 7 * GitHub Plugin URI: https://github.com/gdidentity/on-demand-revalidation 8 8 * Description: Next.js On-Demand Revalidation on the post update, revalidate specific paths on the post update. 9 * Version: 1.1. 19 * Version: 1.1.2 10 10 * Author: GD IDENTITY 11 11 * Author URI: https://gdidentity.sk -
on-demand-revalidation/trunk/readme.txt
r2922642 r2928639 4 4 Requires at least: 4.7 5 5 Tested up to: 6.2.2 6 Stable tag: 1.1. 16 Stable tag: 1.1.2 7 7 Requires PHP: 5.6 8 8 License: GPL-3 … … 25 25 26 26 == Changelog == 27 = 1.1.2 = 28 - fix: reduce unnecessary revalidations from @humet 29 27 30 = 1.1.1 = 28 31 - Allow custom taxonomies revalidation from @humet -
on-demand-revalidation/trunk/src/Revalidation.php
r2851867 r2928639 10 10 11 11 public static function init() { 12 add_action('wp_insert_post', function ( $post_ID, $post, $update ) { 13 if ( wp_is_post_revision( $post_ID ) ) { 14 return; 15 } 16 12 add_action( 'save_post', [ self::class, 'handleSavePost' ], 10, 2 ); 13 add_action( 'transition_post_status', [ self::class, 'handleTransitionPostStatus' ], 10, 3 ); 14 add_action( 'on_demand_revalidation_on_post_update', [ self::class, 'revalidate' ], 10, 1 ); 15 } 16 17 public static function handleSavePost( $post_id, $post ) { 18 $excluded_statuses = [ 'auto-draft', 'inherit', 'draft', 'trash' ]; 19 20 if ( isset( $post->post_status ) && in_array( $post->post_status, $excluded_statuses, true ) ) { 21 return; 22 } 23 24 if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { 25 return; 26 } 27 28 if ( false !== wp_is_post_revision( $post_id ) ) { 29 return; 30 } 31 32 self::revalidatePost( $post ); 33 } 34 35 public static function handleTransitionPostStatus( $new_status, $old_status, $post ) { 36 if ( ( ( 'draft' !== $old_status && 'trash' !== $old_status ) && 'trash' === $new_status ) || 37 ( 'publish' === $old_status && 'draft' === $new_status ) ) { 17 38 self::revalidatePost( $post ); 18 }, 10, 3); 19 20 add_action('transition_post_status', function ( $new_status, $old_status, $post ) { 21 self::revalidatePost( $post ); 22 }, 10, 3); 23 24 add_action('on_demand_revalidation_on_post_update', function ( $post ) { 25 self::revalidate( $post ); 26 }, 10, 1); 27 } 39 } 40 } 28 41 29 42 static function revalidatePost( $post ) { -
on-demand-revalidation/trunk/vendor/autoload.php
r2922642 r2928639 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInit 27ececded4adebc28426c7875ebb1660::getLoader();25 return ComposerAutoloaderInitd7ab5d2bc8c647041a63d77dcae26203::getLoader(); -
on-demand-revalidation/trunk/vendor/composer/ClassLoader.php
r2863031 r2928639 46 46 private static $includeFile; 47 47 48 /** @var ?string*/48 /** @var string|null */ 49 49 private $vendorDir; 50 50 51 51 // PSR-4 52 52 /** 53 * @var array[] 54 * @psalm-var array<string, array<string, int>> 53 * @var array<string, array<string, int>> 55 54 */ 56 55 private $prefixLengthsPsr4 = array(); 57 56 /** 58 * @var array[] 59 * @psalm-var array<string, array<int, string>> 57 * @var array<string, list<string>> 60 58 */ 61 59 private $prefixDirsPsr4 = array(); 62 60 /** 63 * @var array[] 64 * @psalm-var array<string, string> 61 * @var list<string> 65 62 */ 66 63 private $fallbackDirsPsr4 = array(); … … 68 65 // PSR-0 69 66 /** 70 * @var array[] 71 * @psalm-var array<string, array<string, string[]>> 67 * List of PSR-0 prefixes 68 * 69 * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) 70 * 71 * @var array<string, array<string, list<string>>> 72 72 */ 73 73 private $prefixesPsr0 = array(); 74 74 /** 75 * @var array[] 76 * @psalm-var array<string, string> 75 * @var list<string> 77 76 */ 78 77 private $fallbackDirsPsr0 = array(); … … 82 81 83 82 /** 84 * @var string[] 85 * @psalm-var array<string, string> 83 * @var array<string, string> 86 84 */ 87 85 private $classMap = array(); … … 91 89 92 90 /** 93 * @var bool[] 94 * @psalm-var array<string, bool> 91 * @var array<string, bool> 95 92 */ 96 93 private $missingClasses = array(); 97 94 98 /** @var ?string*/95 /** @var string|null */ 99 96 private $apcuPrefix; 100 97 101 98 /** 102 * @var self[]99 * @var array<string, self> 103 100 */ 104 101 private static $registeredLoaders = array(); 105 102 106 103 /** 107 * @param ?string$vendorDir104 * @param string|null $vendorDir 108 105 */ 109 106 public function __construct($vendorDir = null) … … 114 111 115 112 /** 116 * @return string[]113 * @return array<string, list<string>> 117 114 */ 118 115 public function getPrefixes() … … 126 123 127 124 /** 128 * @return array[] 129 * @psalm-return array<string, array<int, string>> 125 * @return array<string, list<string>> 130 126 */ 131 127 public function getPrefixesPsr4() … … 135 131 136 132 /** 137 * @return array[] 138 * @psalm-return array<string, string> 133 * @return list<string> 139 134 */ 140 135 public function getFallbackDirs() … … 144 139 145 140 /** 146 * @return array[] 147 * @psalm-return array<string, string> 141 * @return list<string> 148 142 */ 149 143 public function getFallbackDirsPsr4() … … 153 147 154 148 /** 155 * @return string[] Array of classname => path 156 * @psalm-return array<string, string> 149 * @return array<string, string> Array of classname => path 157 150 */ 158 151 public function getClassMap() … … 162 155 163 156 /** 164 * @param string[] $classMap Class to filename map 165 * @psalm-param array<string, string> $classMap 157 * @param array<string, string> $classMap Class to filename map 166 158 * 167 159 * @return void … … 180 172 * appending or prepending to the ones previously set for this prefix. 181 173 * 182 * @param string $prefix The prefix183 * @param string[]|string $paths The PSR-0 root directories184 * @param bool $prepend Whether to prepend the directories174 * @param string $prefix The prefix 175 * @param list<string>|string $paths The PSR-0 root directories 176 * @param bool $prepend Whether to prepend the directories 185 177 * 186 178 * @return void … … 188 180 public function add($prefix, $paths, $prepend = false) 189 181 { 182 $paths = (array) $paths; 190 183 if (!$prefix) { 191 184 if ($prepend) { 192 185 $this->fallbackDirsPsr0 = array_merge( 193 (array)$paths,186 $paths, 194 187 $this->fallbackDirsPsr0 195 188 ); … … 197 190 $this->fallbackDirsPsr0 = array_merge( 198 191 $this->fallbackDirsPsr0, 199 (array)$paths192 $paths 200 193 ); 201 194 } … … 206 199 $first = $prefix[0]; 207 200 if (!isset($this->prefixesPsr0[$first][$prefix])) { 208 $this->prefixesPsr0[$first][$prefix] = (array)$paths;201 $this->prefixesPsr0[$first][$prefix] = $paths; 209 202 210 203 return; … … 212 205 if ($prepend) { 213 206 $this->prefixesPsr0[$first][$prefix] = array_merge( 214 (array)$paths,207 $paths, 215 208 $this->prefixesPsr0[$first][$prefix] 216 209 ); … … 218 211 $this->prefixesPsr0[$first][$prefix] = array_merge( 219 212 $this->prefixesPsr0[$first][$prefix], 220 (array)$paths213 $paths 221 214 ); 222 215 } … … 227 220 * appending or prepending to the ones previously set for this namespace. 228 221 * 229 * @param string $prefix The prefix/namespace, with trailing '\\'230 * @param string[]|string $paths The PSR-4 base directories231 * @param bool $prepend Whether to prepend the directories222 * @param string $prefix The prefix/namespace, with trailing '\\' 223 * @param list<string>|string $paths The PSR-4 base directories 224 * @param bool $prepend Whether to prepend the directories 232 225 * 233 226 * @throws \InvalidArgumentException … … 237 230 public function addPsr4($prefix, $paths, $prepend = false) 238 231 { 232 $paths = (array) $paths; 239 233 if (!$prefix) { 240 234 // Register directories for the root namespace. 241 235 if ($prepend) { 242 236 $this->fallbackDirsPsr4 = array_merge( 243 (array)$paths,237 $paths, 244 238 $this->fallbackDirsPsr4 245 239 ); … … 247 241 $this->fallbackDirsPsr4 = array_merge( 248 242 $this->fallbackDirsPsr4, 249 (array)$paths243 $paths 250 244 ); 251 245 } … … 257 251 } 258 252 $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; 259 $this->prefixDirsPsr4[$prefix] = (array)$paths;253 $this->prefixDirsPsr4[$prefix] = $paths; 260 254 } elseif ($prepend) { 261 255 // Prepend directories for an already registered namespace. 262 256 $this->prefixDirsPsr4[$prefix] = array_merge( 263 (array)$paths,257 $paths, 264 258 $this->prefixDirsPsr4[$prefix] 265 259 ); … … 268 262 $this->prefixDirsPsr4[$prefix] = array_merge( 269 263 $this->prefixDirsPsr4[$prefix], 270 (array)$paths264 $paths 271 265 ); 272 266 } … … 277 271 * replacing any others previously set for this prefix. 278 272 * 279 * @param string $prefix The prefix280 * @param string[]|string $paths The PSR-0 base directories273 * @param string $prefix The prefix 274 * @param list<string>|string $paths The PSR-0 base directories 281 275 * 282 276 * @return void … … 295 289 * replacing any others previously set for this namespace. 296 290 * 297 * @param string $prefix The prefix/namespace, with trailing '\\'298 * @param string[]|string $paths The PSR-4 base directories291 * @param string $prefix The prefix/namespace, with trailing '\\' 292 * @param list<string>|string $paths The PSR-4 base directories 299 293 * 300 294 * @throws \InvalidArgumentException … … 482 476 483 477 /** 484 * Returns the currently registered loaders indexed by their corresponding vendor directories.485 * 486 * @return self[]478 * Returns the currently registered loaders keyed by their corresponding vendor directories. 479 * 480 * @return array<string, self> 487 481 */ 488 482 public static function getRegisteredLoaders() -
on-demand-revalidation/trunk/vendor/composer/autoload_real.php
r2922642 r2928639 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 27ececded4adebc28426c7875ebb16605 class ComposerAutoloaderInitd7ab5d2bc8c647041a63d77dcae26203 6 6 { 7 7 private static $loader; … … 23 23 } 24 24 25 spl_autoload_register(array('ComposerAutoloaderInit 27ececded4adebc28426c7875ebb1660', 'loadClassLoader'), true, true);25 spl_autoload_register(array('ComposerAutoloaderInitd7ab5d2bc8c647041a63d77dcae26203', 'loadClassLoader'), true, true); 26 26 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 27 spl_autoload_unregister(array('ComposerAutoloaderInit 27ececded4adebc28426c7875ebb1660', 'loadClassLoader'));27 spl_autoload_unregister(array('ComposerAutoloaderInitd7ab5d2bc8c647041a63d77dcae26203', 'loadClassLoader')); 28 28 29 29 require __DIR__ . '/autoload_static.php'; 30 call_user_func(\Composer\Autoload\ComposerStaticInit 27ececded4adebc28426c7875ebb1660::getInitializer($loader));30 call_user_func(\Composer\Autoload\ComposerStaticInitd7ab5d2bc8c647041a63d77dcae26203::getInitializer($loader)); 31 31 32 32 $loader->register(true); -
on-demand-revalidation/trunk/vendor/composer/autoload_static.php
r2922642 r2928639 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 27ececded4adebc28426c7875ebb16607 class ComposerStaticInitd7ab5d2bc8c647041a63d77dcae26203 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 32 32 { 33 33 return \Closure::bind(function () use ($loader) { 34 $loader->prefixLengthsPsr4 = ComposerStaticInit 27ececded4adebc28426c7875ebb1660::$prefixLengthsPsr4;35 $loader->prefixDirsPsr4 = ComposerStaticInit 27ececded4adebc28426c7875ebb1660::$prefixDirsPsr4;36 $loader->classMap = ComposerStaticInit 27ececded4adebc28426c7875ebb1660::$classMap;34 $loader->prefixLengthsPsr4 = ComposerStaticInitd7ab5d2bc8c647041a63d77dcae26203::$prefixLengthsPsr4; 35 $loader->prefixDirsPsr4 = ComposerStaticInitd7ab5d2bc8c647041a63d77dcae26203::$prefixDirsPsr4; 36 $loader->classMap = ComposerStaticInitd7ab5d2bc8c647041a63d77dcae26203::$classMap; 37 37 38 38 }, null, ClassLoader::class); -
on-demand-revalidation/trunk/vendor/composer/installed.php
r2922642 r2928639 2 2 'root' => array( 3 3 'name' => 'gdidentity/on-demand-revalidation', 4 'pretty_version' => '1.1. 1',5 'version' => '1.1. 1.0',6 'reference' => ' eb84797d467da04b93044aa1943ae07c6842711b',4 'pretty_version' => '1.1.2', 5 'version' => '1.1.2.0', 6 'reference' => '574563b39a6787b43b6d99cc5df0cf8739ad3c33', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'gdidentity/on-demand-revalidation' => array( 14 'pretty_version' => '1.1. 1',15 'version' => '1.1. 1.0',16 'reference' => ' eb84797d467da04b93044aa1943ae07c6842711b',14 'pretty_version' => '1.1.2', 15 'version' => '1.1.2.0', 16 'reference' => '574563b39a6787b43b6d99cc5df0cf8739ad3c33', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.