Changeset 3293356
- Timestamp:
- 05/14/2025 02:18:29 PM (9 months ago)
- Location:
- spinupwp/trunk
- Files:
-
- 16 edited
-
drop-ins/object-cache.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
-
spinupwp.php (modified) (1 diff)
-
src/AdminNotices.php (modified) (1 diff)
-
src/Cache.php (modified) (8 diffs)
-
src/Cli/CacheCommands.php (modified) (3 diffs)
-
vendor/autoload.php (modified) (1 diff)
-
vendor/composer/ClassLoader.php (modified) (26 diffs)
-
vendor/composer/InstalledVersions.php (modified) (10 diffs)
-
vendor/composer/autoload_classmap.php (modified) (2 diffs)
-
vendor/composer/autoload_files.php (modified) (1 diff)
-
vendor/composer/autoload_namespaces.php (modified) (1 diff)
-
vendor/composer/autoload_psr4.php (modified) (1 diff)
-
vendor/composer/autoload_real.php (modified) (2 diffs)
-
vendor/composer/autoload_static.php (modified) (1 diff)
-
vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
spinupwp/trunk/drop-ins/object-cache.php
r3029656 r3293356 4 4 Plugin URI: http://wordpress.org/plugins/spinupwp/ 5 5 Description: A persistent object cache backend powered by Redis. Supports Predis, PhpRedis, HHVM, replication, clustering and WP-CLI. 6 Version: 1. 5.16 Version: 1.8.0 7 7 Author: SpinupWP 8 8 Author URI: https://spinupwp.com/ … … 634 634 'host' => '127.0.0.1', 635 635 'port' => 6379, 636 'database' => 0,636 'database' => getenv('SPINUPWP_CACHE_DB') ?? 0, 637 637 'timeout' => 5, 638 638 'read_timeout' => 5, … … 653 653 ]; 654 654 655 656 if ( getenv( 'SPINUPWP_CACHE_USERNAME' ) && getenv( 'SPINUPWP_CACHE_PASSWORD' ) ) { 657 $parameters['password'] = [getenv( 'SPINUPWP_CACHE_USERNAME' ), getenv( 'SPINUPWP_CACHE_PASSWORD' )]; 658 } 659 655 660 foreach ( $settings as $setting ) { 656 661 $constant = sprintf( 'WP_REDIS_%s', strtoupper( $setting ) ); … … 736 741 737 742 if ( isset( $parameters['password'] ) ) { 743 738 744 $args['password'] = $parameters['password']; 745 739 746 $this->redis->auth( $parameters['password'] ); 740 747 } -
spinupwp/trunk/readme.txt
r3192083 r3293356 3 3 Tags: cache, caching, performance 4 4 Requires at least: 4.7 5 Tested up to: 6. 75 Tested up to: 6.8 6 6 Requires PHP: 7.1 7 Stable tag: 1. 7.17 Stable tag: 1.8.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 87 87 == Changelog == 88 88 89 = 1.8.0 (2025-05-13) = 90 * New: Support for Redis ACL and separate Redis databases 91 * Improvement: Register cache command when page cache disabled 92 * Bug Fix: Purge URLs with and without trailing slash 93 * Bug Fix: Replace for FILTER_SANITIZE_STRING which is now deprecated 94 * Bug Fix: Fix "load_text_domain" notice 95 89 96 = 1.7.1 (2024-06-03) = 90 97 * Bug Fix: Magic Login not working when WordPress installed in a subdirectory. -
spinupwp/trunk/spinupwp.php
r3111769 r3293356 5 5 Description: SpinupWP helper plugin. 6 6 Author: SpinupWP 7 Version: 1. 7.17 Version: 1.8.0 8 8 Network: True 9 9 Text Domain: spinupwp -
spinupwp/trunk/src/AdminNotices.php
r2774192 r3293356 52 52 } 53 53 54 $notice = filter_var( $_POST['notice'], FILTER_SANITIZE_STRING ); 54 $notice = isset( $_POST['notice'] ) ? sanitize_text_field( $_POST['notice'] ) : ''; 55 56 if ( empty( $notice ) ) { 57 wp_die( - 1, 400 ); 58 } 55 59 56 60 update_site_option( "spinupwp_{$notice}_notice_dismissed", true ); -
spinupwp/trunk/src/Cache.php
r3029656 r3293356 39 39 $this->set_cache_path(); 40 40 41 if ( $this->is_object_cache_enabled() && $this->is_page_cache_enabled() ) { 42 $this->admin_bar->add_item( __( 'Purge All Caches', 'spinupwp' ), 'purge-all' ); 43 } 44 45 if ( $this->is_object_cache_enabled() ) { 46 $this->admin_bar->add_item( __( 'Purge Object Cache', 'spinupwp' ), 'purge-object' ); 47 } 48 49 if ( $this->is_page_cache_enabled() ) { 50 $this->admin_bar->add_item( __( 'Purge Page Cache', 'spinupwp' ), 'purge-page' ); 51 $this->cli->register_command( 'spinupwp cache', CacheCommands::class ); 52 } 53 54 if ( $this->is_page_cache_enabled() && ! is_admin() ) { 55 $this->admin_bar->add_item( __( 'Purge this URL', 'spinupwp' ), 'purge-url' ); 56 } 57 41 $this->cli->register_command( 'spinupwp cache', CacheCommands::class ); 42 43 add_action( 'init', array( $this, 'register_admin_bar_menu_items' ) ); 58 44 add_action( 'spinupwp_purge_object_cache', array( $this, 'purge_object_cache' ) ); 59 45 add_action( 'spinupwp_purge_page_cache', array( $this, 'purge_page_cache' ) ); … … 68 54 } 69 55 56 /** 57 * Register cache purge menu items in the admin bar. 58 * 59 * @return void 60 */ 61 public function register_admin_bar_menu_items() { 62 if ( $this->is_object_cache_enabled() && $this->is_page_cache_enabled() ) { 63 $this->admin_bar->add_item( __( 'Purge All Caches', 'spinupwp' ), 'purge-all' ); 64 } 65 66 if ( $this->is_object_cache_enabled() ) { 67 $this->admin_bar->add_item( __( 'Purge Object Cache', 'spinupwp' ), 'purge-object' ); 68 } 69 70 if ( $this->is_page_cache_enabled() ) { 71 $this->admin_bar->add_item( __( 'Purge Page Cache', 'spinupwp' ), 'purge-page' ); 72 } 73 74 if ( $this->is_page_cache_enabled() && ! is_admin() ) { 75 $this->admin_bar->add_item( __( 'Purge this URL', 'spinupwp' ), 'purge-url' ); 76 } 77 } 78 70 79 71 80 /** … … 89 98 if ( 'purge-all' === $action ) { 90 99 $purge_object_cache = $this->purge_object_cache(); 91 $purge_page_cache = $this->purge_page_cache();92 100 $purge_page_cache = $this->purge_page_cache(); 101 93 102 $purge = $purge_object_cache && $purge_page_cache; 94 103 $type = 'all'; … … 104 113 $type = 'page'; 105 114 } 106 115 107 116 if ( 'purge-url' === $action ) { 108 $url = $_SERVER['HTTP_REFERER'];109 $purge = $this->purge_url( $url);117 $url = $_SERVER['HTTP_REFERER']; 118 $purge = $this->purge_url( $url ); 110 119 $type = 'url'; 111 120 } … … 303 312 public function purge_url( $url ) { 304 313 $cache_paths = $this->get_cache_paths_for_url( $url ); 305 314 306 315 $all_deleted = true; 307 foreach ( $cache_paths as $path) {308 $deleted = $this->delete( $path );316 foreach ( $cache_paths as $path ) { 317 $deleted = $this->delete( $path ); 309 318 do_action( 'spinupwp_url_purged', $url, $deleted ); 310 319 $all_deleted &= $deleted; 311 320 } 312 321 313 322 return $all_deleted; 314 323 } … … 316 325 /** 317 326 * Gets the cache file paths for a given URL. 318 * 327 * 319 328 * Must be using the default Nginx cache options (levels=1:2) 320 329 * https://www.digitalocean.com/community/tutorials/how-to-setup-fastcgi-caching-with-nginx-on-your-vps#purging-the-cache … … 326 335 private function get_cache_paths_for_url( $url ) { 327 336 $cache_keys = $this->get_cache_keys_for_url( $url ); 328 337 329 338 $cache_paths = array(); 330 foreach ( $cache_keys as $key) {331 $hashed_key = md5($key);332 $path = substr( $hashed_key, - 1 ) . '/' . substr( $hashed_key, - 3, 2 ) . '/' . $hashed_key;339 foreach ( $cache_keys as $key ) { 340 $hashed_key = md5( $key ); 341 $path = substr( $hashed_key, - 1 ) . '/' . substr( $hashed_key, - 3, 2 ) . '/' . $hashed_key; 333 342 $cache_paths[] = trailingslashit( $this->cache_path ) . $path; 334 343 } 335 344 336 345 return $cache_paths; 337 346 } … … 349 358 */ 350 359 private function get_cache_keys_for_url( $url ) { 351 // Default cache key 352 $parsed_url = parse_url( trailingslashit( $url ) ); 353 $cache_keys = array($parsed_url['scheme'] . 'GET' . $parsed_url['host'] . $parsed_url['path']); 360 $parsed_url = parse_url( $url ); 361 362 $cache_keys = array( 363 $parsed_url['scheme'] . 'GET' . $parsed_url['host'] . trailingslashit( $parsed_url['path'] ), 364 $parsed_url['scheme'] . 'GET' . $parsed_url['host'] . untrailingslashit( $parsed_url['path'] ), 365 ); 354 366 355 367 // Allow the cache keys to be modified 356 $cache_keys = apply_filters( 'spinupwp_cache_keys_for_url', $cache_keys, $url);357 368 $cache_keys = apply_filters( 'spinupwp_cache_keys_for_url', $cache_keys, $url ); 369 358 370 return $cache_keys; 359 371 } -
spinupwp/trunk/src/Cli/CacheCommands.php
r2774192 r3293356 25 25 */ 26 26 public function purge_site() { 27 if ( ! spinupwp()->cache->is_page_cache_enabled() ) { 28 WP_CLI::error( __( 'The page cache is not enabled.', 'spinupwp' ) ); 29 } 30 27 31 if ( spinupwp()->cache->purge_page_cache() ) { 28 32 WP_CLI::success( __( 'The page cache was purged.', 'spinupwp' ) ); … … 47 51 */ 48 52 public function purge_post( $args ) { 53 if ( ! spinupwp()->cache->is_page_cache_enabled() ) { 54 WP_CLI::error( __( 'The page cache is not enabled.', 'spinupwp' ) ); 55 } 56 49 57 $post = get_post( $args[0] ); 50 58 … … 77 85 */ 78 86 public function purge_url( $args ) { 87 if ( ! spinupwp()->cache->is_page_cache_enabled() ) { 88 WP_CLI::error( __( 'The page cache is not enabled.', 'spinupwp' ) ); 89 } 90 79 91 if ( spinupwp()->cache->purge_url( $args[0] ) ) { 80 92 WP_CLI::success( __( 'URL purged from the page cache.', 'spinupwp' ) ); -
spinupwp/trunk/vendor/autoload.php
r2089375 r3293356 3 3 // autoload.php @generated by Composer 4 4 5 if (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 throw new RuntimeException($err); 18 } 19 5 20 require_once __DIR__ . '/composer/autoload_real.php'; 6 21 -
spinupwp/trunk/vendor/composer/ClassLoader.php
r2671502 r3293356 43 43 class ClassLoader 44 44 { 45 /** @var \Closure(string):void */ 46 private static $includeFile; 47 48 /** @var string|null */ 45 49 private $vendorDir; 46 50 47 51 // PSR-4 52 /** 53 * @var array<string, array<string, int>> 54 */ 48 55 private $prefixLengthsPsr4 = array(); 56 /** 57 * @var array<string, list<string>> 58 */ 49 59 private $prefixDirsPsr4 = array(); 60 /** 61 * @var list<string> 62 */ 50 63 private $fallbackDirsPsr4 = array(); 51 64 52 65 // PSR-0 66 /** 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 */ 53 73 private $prefixesPsr0 = array(); 74 /** 75 * @var list<string> 76 */ 54 77 private $fallbackDirsPsr0 = array(); 55 78 79 /** @var bool */ 56 80 private $useIncludePath = false; 81 82 /** 83 * @var array<string, string> 84 */ 57 85 private $classMap = array(); 86 87 /** @var bool */ 58 88 private $classMapAuthoritative = false; 89 90 /** 91 * @var array<string, bool> 92 */ 59 93 private $missingClasses = array(); 94 95 /** @var string|null */ 60 96 private $apcuPrefix; 61 97 98 /** 99 * @var array<string, self> 100 */ 62 101 private static $registeredLoaders = array(); 63 102 103 /** 104 * @param string|null $vendorDir 105 */ 64 106 public function __construct($vendorDir = null) 65 107 { 66 108 $this->vendorDir = $vendorDir; 67 } 68 109 self::initializeIncludeClosure(); 110 } 111 112 /** 113 * @return array<string, list<string>> 114 */ 69 115 public function getPrefixes() 70 116 { … … 76 122 } 77 123 124 /** 125 * @return array<string, list<string>> 126 */ 78 127 public function getPrefixesPsr4() 79 128 { … … 81 130 } 82 131 132 /** 133 * @return list<string> 134 */ 83 135 public function getFallbackDirs() 84 136 { … … 86 138 } 87 139 140 /** 141 * @return list<string> 142 */ 88 143 public function getFallbackDirsPsr4() 89 144 { … … 91 146 } 92 147 148 /** 149 * @return array<string, string> Array of classname => path 150 */ 93 151 public function getClassMap() 94 152 { … … 97 155 98 156 /** 99 * @param array $classMap Class to filename map 157 * @param array<string, string> $classMap Class to filename map 158 * 159 * @return void 100 160 */ 101 161 public function addClassMap(array $classMap) … … 112 172 * appending or prepending to the ones previously set for this prefix. 113 173 * 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 174 * @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 177 * 178 * @return void 117 179 */ 118 180 public function add($prefix, $paths, $prepend = false) 119 181 { 182 $paths = (array) $paths; 120 183 if (!$prefix) { 121 184 if ($prepend) { 122 185 $this->fallbackDirsPsr0 = array_merge( 123 (array)$paths,186 $paths, 124 187 $this->fallbackDirsPsr0 125 188 ); … … 127 190 $this->fallbackDirsPsr0 = array_merge( 128 191 $this->fallbackDirsPsr0, 129 (array)$paths192 $paths 130 193 ); 131 194 } … … 136 199 $first = $prefix[0]; 137 200 if (!isset($this->prefixesPsr0[$first][$prefix])) { 138 $this->prefixesPsr0[$first][$prefix] = (array)$paths;201 $this->prefixesPsr0[$first][$prefix] = $paths; 139 202 140 203 return; … … 142 205 if ($prepend) { 143 206 $this->prefixesPsr0[$first][$prefix] = array_merge( 144 (array)$paths,207 $paths, 145 208 $this->prefixesPsr0[$first][$prefix] 146 209 ); … … 148 211 $this->prefixesPsr0[$first][$prefix] = array_merge( 149 212 $this->prefixesPsr0[$first][$prefix], 150 (array)$paths213 $paths 151 214 ); 152 215 } … … 157 220 * appending or prepending to the ones previously set for this namespace. 158 221 * 159 * @param string $prefix The prefix/namespace, with trailing '\\'160 * @param array|string $paths The PSR-4 base directories161 * @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 162 225 * 163 226 * @throws \InvalidArgumentException 227 * 228 * @return void 164 229 */ 165 230 public function addPsr4($prefix, $paths, $prepend = false) 166 231 { 232 $paths = (array) $paths; 167 233 if (!$prefix) { 168 234 // Register directories for the root namespace. 169 235 if ($prepend) { 170 236 $this->fallbackDirsPsr4 = array_merge( 171 (array)$paths,237 $paths, 172 238 $this->fallbackDirsPsr4 173 239 ); … … 175 241 $this->fallbackDirsPsr4 = array_merge( 176 242 $this->fallbackDirsPsr4, 177 (array)$paths243 $paths 178 244 ); 179 245 } … … 185 251 } 186 252 $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; 187 $this->prefixDirsPsr4[$prefix] = (array)$paths;253 $this->prefixDirsPsr4[$prefix] = $paths; 188 254 } elseif ($prepend) { 189 255 // Prepend directories for an already registered namespace. 190 256 $this->prefixDirsPsr4[$prefix] = array_merge( 191 (array)$paths,257 $paths, 192 258 $this->prefixDirsPsr4[$prefix] 193 259 ); … … 196 262 $this->prefixDirsPsr4[$prefix] = array_merge( 197 263 $this->prefixDirsPsr4[$prefix], 198 (array)$paths264 $paths 199 265 ); 200 266 } … … 205 271 * replacing any others previously set for this prefix. 206 272 * 207 * @param string $prefix The prefix 208 * @param array|string $paths The PSR-0 base directories 273 * @param string $prefix The prefix 274 * @param list<string>|string $paths The PSR-0 base directories 275 * 276 * @return void 209 277 */ 210 278 public function set($prefix, $paths) … … 221 289 * replacing any others previously set for this namespace. 222 290 * 223 * @param string $prefix The prefix/namespace, with trailing '\\'224 * @param array|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 225 293 * 226 294 * @throws \InvalidArgumentException 295 * 296 * @return void 227 297 */ 228 298 public function setPsr4($prefix, $paths) … … 244 314 * 245 315 * @param bool $useIncludePath 316 * 317 * @return void 246 318 */ 247 319 public function setUseIncludePath($useIncludePath) … … 266 338 * 267 339 * @param bool $classMapAuthoritative 340 * 341 * @return void 268 342 */ 269 343 public function setClassMapAuthoritative($classMapAuthoritative) … … 286 360 * 287 361 * @param string|null $apcuPrefix 362 * 363 * @return void 288 364 */ 289 365 public function setApcuPrefix($apcuPrefix) … … 306 382 * 307 383 * @param bool $prepend Whether to prepend the autoloader or not 384 * 385 * @return void 308 386 */ 309 387 public function register($prepend = false) … … 325 403 /** 326 404 * Unregisters this instance as an autoloader. 405 * 406 * @return void 327 407 */ 328 408 public function unregister() … … 344 424 { 345 425 if ($file = $this->findFile($class)) { 346 includeFile($file); 426 $includeFile = self::$includeFile; 427 $includeFile($file); 347 428 348 429 return true; … … 395 476 396 477 /** 397 * Returns the currently registered loaders indexed by their corresponding vendor directories.398 * 399 * @return self[]478 * Returns the currently registered loaders keyed by their corresponding vendor directories. 479 * 480 * @return array<string, self> 400 481 */ 401 482 public static function getRegisteredLoaders() … … 404 485 } 405 486 487 /** 488 * @param string $class 489 * @param string $ext 490 * @return string|false 491 */ 406 492 private function findFileWithExtension($class, $ext) 407 493 { … … 469 555 return false; 470 556 } 557 558 /** 559 * @return void 560 */ 561 private static function initializeIncludeClosure() 562 { 563 if (self::$includeFile !== null) { 564 return; 565 } 566 567 /** 568 * Scope isolated include. 569 * 570 * Prevents access to $this/self from included files. 571 * 572 * @param string $file 573 * @return void 574 */ 575 self::$includeFile = \Closure::bind(static function($file) { 576 include $file; 577 }, null, null); 578 } 471 579 } 472 473 /**474 * Scope isolated include.475 *476 * Prevents access to $this/self from included files.477 */478 function includeFile($file)479 {480 include $file;481 } -
spinupwp/trunk/vendor/composer/InstalledVersions.php
r2671502 r3293356 21 21 * See also https://getcomposer.org/doc/07-runtime.md#installed-versions 22 22 * 23 * To require it's presence, you can require `composer-runtime-api ^2.0` 23 * To require its presence, you can require `composer-runtime-api ^2.0` 24 * 25 * @final 24 26 */ 25 27 class InstalledVersions 26 28 { 29 /** 30 * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to 31 * @internal 32 */ 33 private static $selfDir = null; 34 35 /** 36 * @var mixed[]|null 37 * @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 38 */ 27 39 private static $installed; 40 41 /** 42 * @var bool 43 */ 44 private static $installedIsLocalDir; 45 46 /** 47 * @var bool|null 48 */ 28 49 private static $canGetVendors; 50 51 /** 52 * @var array[] 53 * @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[]}>}> 54 */ 29 55 private static $installedByVendor = array(); 30 56 … … 84 110 foreach (self::getInstalled() as $installed) { 85 111 if (isset($installed['versions'][$packageName])) { 86 return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);112 return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; 87 113 } 88 114 } … … 105 131 public static function satisfies(VersionParser $parser, $packageName, $constraint) 106 132 { 107 $constraint = $parser->parseConstraints( $constraint);133 $constraint = $parser->parseConstraints((string) $constraint); 108 134 $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); 109 135 … … 229 255 /** 230 256 * @return array 231 * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}257 * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} 232 258 */ 233 259 public static function getRootPackage() … … 243 269 * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. 244 270 * @return array[] 245 * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}271 * @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[]}>} 246 272 */ 247 273 public static function getRawData() … … 266 292 * 267 293 * @return array[] 268 * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>294 * @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[]}>}> 269 295 */ 270 296 public static function getAllRawData() … … 289 315 * @return void 290 316 * 291 * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data317 * @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 292 318 */ 293 319 public static function reload($data) … … 295 321 self::$installed = $data; 296 322 self::$installedByVendor = array(); 323 324 // when using reload, we disable the duplicate protection to ensure that self::$installed data is 325 // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not, 326 // so we have to assume it does not, and that may result in duplicate data being returned when listing 327 // all installed packages for example 328 self::$installedIsLocalDir = false; 329 } 330 331 /** 332 * @return string 333 */ 334 private static function getSelfDir() 335 { 336 if (self::$selfDir === null) { 337 self::$selfDir = strtr(__DIR__, '\\', '/'); 338 } 339 340 return self::$selfDir; 297 341 } 298 342 299 343 /** 300 344 * @return array[] 301 * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>345 * @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[]}>}> 302 346 */ 303 347 private static function getInstalled() … … 308 352 309 353 $installed = array(); 354 $copiedLocalDir = false; 310 355 311 356 if (self::$canGetVendors) { 357 $selfDir = self::getSelfDir(); 312 358 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 359 $vendorDir = strtr($vendorDir, '\\', '/'); 313 360 if (isset(self::$installedByVendor[$vendorDir])) { 314 361 $installed[] = self::$installedByVendor[$vendorDir]; 315 362 } elseif (is_file($vendorDir.'/composer/installed.php')) { 316 $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; 317 if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { 318 self::$installed = $installed[count($installed) - 1]; 363 /** @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[]}>} $required */ 364 $required = require $vendorDir.'/composer/installed.php'; 365 self::$installedByVendor[$vendorDir] = $required; 366 $installed[] = $required; 367 if (self::$installed === null && $vendorDir.'/composer' === $selfDir) { 368 self::$installed = $required; 369 self::$installedIsLocalDir = true; 319 370 } 371 } 372 if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) { 373 $copiedLocalDir = true; 320 374 } 321 375 } … … 326 380 // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 327 381 if (substr(__DIR__, -8, 1) !== 'C') { 328 self::$installed = require __DIR__ . '/installed.php'; 382 /** @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[]}>} $required */ 383 $required = require __DIR__ . '/installed.php'; 384 self::$installed = $required; 329 385 } else { 330 386 self::$installed = array(); 331 387 } 332 388 } 333 $installed[] = self::$installed; 389 390 if (self::$installed !== array() && !$copiedLocalDir) { 391 $installed[] = self::$installed; 392 } 334 393 335 394 return $installed; -
spinupwp/trunk/vendor/composer/autoload_classmap.php
r2812614 r3293356 3 3 // autoload_classmap.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 … … 16 16 'SpinupWp\\Compatibility' => $baseDir . '/src/Compatibility.php', 17 17 'SpinupWp\\Compatibility\\ElementorPlugin' => $baseDir . '/src/Compatibility/ElementorPlugin.php', 18 'SpinupWp\\MagicLogin' => $baseDir . '/src/MagicLogin.php', 18 19 'SpinupWp\\Plugin' => $baseDir . '/src/Plugin.php', 19 20 'SpinupWp\\SiteHealth' => $baseDir . '/src/SiteHealth.php', -
spinupwp/trunk/vendor/composer/autoload_files.php
r2741497 r3293356 3 3 // autoload_files.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
spinupwp/trunk/vendor/composer/autoload_namespaces.php
r2089375 r3293356 3 3 // autoload_namespaces.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
spinupwp/trunk/vendor/composer/autoload_psr4.php
r2774202 r3293356 3 3 // autoload_psr4.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
spinupwp/trunk/vendor/composer/autoload_real.php
r2671502 r3293356 26 26 27 27 spl_autoload_register(array('ComposerAutoloaderInita5abb26a347fc40977ca46c39480b5aa', 'loadClassLoader'), true, true); 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname( \dirname(__FILE__)));28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 29 spl_autoload_unregister(array('ComposerAutoloaderInita5abb26a347fc40977ca46c39480b5aa', 'loadClassLoader')); 30 30 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\ComposerStaticInita5abb26a347fc40977ca46c39480b5aa::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\ComposerStaticInita5abb26a347fc40977ca46c39480b5aa::getInitializer($loader)); 52 33 53 34 $loader->register(true); 54 35 55 if ($useStaticLoader) { 56 $includeFiles = Composer\Autoload\ComposerStaticInita5abb26a347fc40977ca46c39480b5aa::$files; 57 } else { 58 $includeFiles = require __DIR__ . '/autoload_files.php'; 59 } 60 foreach ($includeFiles as $fileIdentifier => $file) { 61 composerRequirea5abb26a347fc40977ca46c39480b5aa($fileIdentifier, $file); 36 $filesToLoad = \Composer\Autoload\ComposerStaticInita5abb26a347fc40977ca46c39480b5aa::$files; 37 $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { 38 if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { 39 $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; 40 41 require $file; 42 } 43 }, null, null); 44 foreach ($filesToLoad as $fileIdentifier => $file) { 45 $requireFile($fileIdentifier, $file); 62 46 } 63 47 … … 65 49 } 66 50 } 67 68 function composerRequirea5abb26a347fc40977ca46c39480b5aa($fileIdentifier, $file)69 {70 if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {71 require $file;72 73 $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;74 }75 } -
spinupwp/trunk/vendor/composer/autoload_static.php
r2812614 r3293356 35 35 'SpinupWp\\Compatibility' => __DIR__ . '/../..' . '/src/Compatibility.php', 36 36 'SpinupWp\\Compatibility\\ElementorPlugin' => __DIR__ . '/../..' . '/src/Compatibility/ElementorPlugin.php', 37 'SpinupWp\\MagicLogin' => __DIR__ . '/../..' . '/src/MagicLogin.php', 37 38 'SpinupWp\\Plugin' => __DIR__ . '/../..' . '/src/Plugin.php', 38 39 'SpinupWp\\SiteHealth' => __DIR__ . '/../..' . '/src/SiteHealth.php', -
spinupwp/trunk/vendor/composer/installed.php
r2812614 r3293356 1 1 <?php return array( 2 2 'root' => array( 3 'name' => 'spinupwp/spinupwp-plugin', 3 4 'pretty_version' => 'trunk', 4 5 'version' => 'dev-trunk', 6 'reference' => null, 5 7 'type' => 'wordpress-plugin', 6 8 'install_path' => __DIR__ . '/../../', 7 9 'aliases' => array(), 8 'reference' => NULL,9 'name' => 'spinupwp/spinupwp-plugin',10 10 'dev' => false, 11 11 ), … … 14 14 'pretty_version' => 'trunk', 15 15 'version' => 'dev-trunk', 16 'reference' => null, 16 17 'type' => 'wordpress-plugin', 17 18 'install_path' => __DIR__ . '/../../', 18 19 'aliases' => array(), 19 'reference' => NULL,20 20 'dev_requirement' => false, 21 21 ),
Note: See TracChangeset
for help on using the changeset viewer.