PluginProbe
Hostinger Tools / 3.0.78
Hostinger Tools v3.0.78
3.0.78 3.0.77 3.0.76 3.0.75 3.0.74 3.0.73 3.0.72 3.0.71 3.0.70 3.0.69 3.0.68 3.0.67 3.0.66 1.8.1 1.8.2 1.8.3 1.9.1 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 All 109 releases
← All changes | vendor/automattic/jetpack-autoloader/src/AutoloadGenerator.php +5 -39 3.0.75 → 3.0.78 View file →
@@ -20,9 +20,9 @@
20 20 * Class AutoloadGenerator.
21 21 */
22 22 class AutoloadGenerator {
23 23
24 - const VERSION = '5.0.22';
24 + const VERSION = '5.0.23';
25 25
26 26 /**
27 27 * IO object.
28 28 *
@@ -115,46 +115,12 @@
115 115 krsort( $psr0 );
116 116 krsort( $psr4 );
117 117
118 118 return array(
119 - 'psr-0' => $psr0,
120 - 'psr-4' => $psr4,
121 - 'classmap' => $classmap,
122 - 'files' => $files,
123 - 'exclude-from-classmap' => $this->parseExcludeFromClassmap( $mainPackage ),
124 - );
125 - }
126 -
127 - /**
128 - * Builds the classmap exclusion patterns from the root package's
129 - * `exclude-from-classmap` autoload config.
130 - *
131 - * Composer honors `exclude-from-classmap` when building its own classmap, but
132 - * this generator never passed it through, so the Jetpack classmap could not
133 - * exclude anything. Only the root package is honored, matching how Composer
134 - * treats the root's excludes as applying to the whole generated classmap.
135 - *
136 - * @param PackageInterface $mainPackage Main package instance.
137 - *
138 - * @return string[] Regex fragments (consumed by AutoloadProcessor) matching paths to exclude.
139 - */
140 - protected function parseExcludeFromClassmap( PackageInterface $mainPackage ) {
141 - $autoload = $mainPackage->getAutoload();
142 - if ( empty( $autoload['exclude-from-classmap'] ) || ! is_array( $autoload['exclude-from-classmap'] ) ) {
143 - return array();
144 - }
145 -
146 - return array_map(
147 - function ( $path ) {
148 - // Mirror Composer's classmap-exclusion semantics: escape the path,
149 - // then re-enable `*`/`**` as single-/multi-segment wildcards.
150 - // `{` is the delimiter AutoloadProcessor wraps these fragments in.
151 - $pattern = preg_quote( trim( strtr( $path, '\\', '/' ), '/' ), '{' );
152 - $pattern = str_replace( '\\*\\*', '.+?', $pattern );
153 - $pattern = str_replace( '\\*', '[^/]+?', $pattern );
154 - return $pattern;
155 - },
156 - $autoload['exclude-from-classmap']
119 + 'psr-0' => $psr0,
120 + 'psr-4' => $psr4,
121 + 'classmap' => $classmap,
122 + 'files' => $files,
157 123 );
158 124 }
159 125
160 126 /**