Changeset 2591401
- Timestamp:
- 08/31/2021 10:16:19 AM (4 years ago)
- Location:
- wubtitle
- Files:
-
- 20 edited
- 1 copied
-
tags/1.2.3 (copied) (copied from wubtitle/trunk)
-
tags/1.2.3/includes/Core/Sources/YouTube.php (modified) (2 diffs)
-
tags/1.2.3/output.log (modified) (4 diffs)
-
tags/1.2.3/readme.txt (modified) (2 diffs)
-
tags/1.2.3/vendor/autoload.php (modified) (1 diff)
-
tags/1.2.3/vendor/composer/ClassLoader.php (modified) (2 diffs)
-
tags/1.2.3/vendor/composer/InstalledVersions.php (modified) (2 diffs)
-
tags/1.2.3/vendor/composer/autoload_real.php (modified) (3 diffs)
-
tags/1.2.3/vendor/composer/autoload_static.php (modified) (2 diffs)
-
tags/1.2.3/vendor/composer/installed.php (modified) (1 diff)
-
tags/1.2.3/wubtitle.php (modified) (2 diffs)
-
trunk/includes/Core/Sources/YouTube.php (modified) (2 diffs)
-
trunk/output.log (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/ClassLoader.php (modified) (2 diffs)
-
trunk/vendor/composer/InstalledVersions.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_real.php (modified) (3 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (1 diff)
-
trunk/wubtitle.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wubtitle/tags/1.2.3/includes/Core/Sources/YouTube.php
r2539088 r2591401 86 86 } 87 87 $id_video = $query_params['v']; 88 $get_info_url = "https://www.youtube.com/get_video_info?html5=1&video_id=$id_video"; 89 90 $file_info = array(); 91 92 $response = wp_remote_get( 88 $get_info_url = 'https://www.youtube.com/youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8'; 89 90 $body = array( 91 'context' => array( 92 'client' => array( 93 'hl' => 'en', 94 'clientName' => 'WEB', 95 'clientVersion' => '2.20210721.00.00', 96 'clientFormFactor' => 'UNKNOWN_FORM_FACTOR', 97 'clientScreen' => 'WATCH', 98 'mainAppWebInfo' => array( 99 'graftUrl' => "/watch?v=$id_video", 100 ), 101 ), 102 'user' => array( 103 'lockedSafetyMode' => false, 104 ), 105 'request' => array( 106 'useSsl' => true, 107 'internalExperimentFlags' => array(), 108 'consistencyTokenJars' => array(), 109 ), 110 ), 111 'videoId' => $id_video, 112 'playbackContext' => array( 113 'contentPlaybackContext' => array( 114 'vis' => 0, 115 'splay' => false, 116 'autoCaptionsDefaultOn' => false, 117 'autonavState' => 'STATE_NONE', 118 'html5Preference' => 'HTML5_PREF_WANTS', 119 'lactMilliseconds' => '-1', 120 ), 121 ), 122 'racyCheckOk' => false, 123 'contentCheckOk' => false, 124 ); 125 126 $response = wp_remote_post( 93 127 $get_info_url, 94 128 array( 95 'headers' => array( 'Accept-Language' => get_locale() ), 129 'headers' => array( 130 'Accept-Language' => get_locale(), 131 'Content-Type' => 'application/json; charset=utf-8', 132 ), 133 'body' => wp_json_encode( $body ), 96 134 ) 97 135 ); 98 $file = wp_remote_retrieve_body( $response ); 99 100 parse_str( $file, $file_info ); 101 if ( 'fail' === $file_info['status'] ) { 136 $response_body = json_decode( wp_remote_retrieve_body( $response ) ); 137 if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { 102 138 return array( 103 139 'success' => false, … … 105 141 ); 106 142 } 107 $title_video = json_decode( $file_info['player_response'] )->videoDetails->title; 108 $languages = json_decode( $file_info['player_response'] )->captions->playerCaptionsTracklistRenderer->captionTracks; 109 $video_info = array( 143 // phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 144 // warning camel case. 145 $title_video = $response_body->videoDetails->title; 146 // phpcs:enable 147 $languages = $response_body->captions->playerCaptionsTracklistRenderer->captionTracks; 148 $video_info = array( 110 149 'success' => true, 111 150 'source' => 'youtube', -
wubtitle/tags/1.2.3/output.log
r2539088 r2591401 6 6 Login Succeeded 7 7 Pulling docker.pkg.github.com/ctmobi/wubtitle-wordpress-plugin/php-actions_composer_wubtitle-wordpress-plugin:php-7.4-build2 8 WARNING: ⚠️ Failed to pull manifest by the resolved digest. This registry does not9 appear to conform to the distribution registry specification; falling back to10 pull by tag. This fallback is DEPRECATED, and will be removed in a future11 release. Please contact admins of https://docker.pkg.github.com. ⚠️12 13 8 php-7.4-build2: Pulling from ctmobi/wubtitle-wordpress-plugin/php-actions_composer_wubtitle-wordpress-plugin 14 9 596ba82af5aa: Pulling fs layer … … 22 17 9356474b59db: Pulling fs layer 23 18 e9cab5988275: Pulling fs layer 24 64889fa545ec: Waiting25 f807504c7162: Waiting26 19 3950d3df66cb: Waiting 27 20 09a3aba4cdc0: Waiting … … 29 22 9356474b59db: Waiting 30 23 e9cab5988275: Waiting 24 64889fa545ec: Waiting 25 f807504c7162: Waiting 31 26 2ab8440e5667: Verifying Checksum 32 27 2ab8440e5667: Download complete 33 af74f285bb27: Verifying Checksum28 596ba82af5aa: Verifying Checksum 34 29 af74f285bb27: Download complete 35 30 64889fa545ec: Verifying Checksum 36 31 64889fa545ec: Download complete 37 596ba82af5aa: Download complete38 32 596ba82af5aa: Pull complete 39 f807504c7162: Verifying Checksum40 f807504c7162: Download complete41 33 3950d3df66cb: Verifying Checksum 42 34 3950d3df66cb: Download complete 43 35 af74f285bb27: Pull complete 36 f807504c7162: Verifying Checksum 37 f807504c7162: Download complete 44 38 177ad834d54f: Verifying Checksum 45 39 177ad834d54f: Download complete 46 9356474b59db: Verifying Checksum 40 2ab8440e5667: Pull complete 41 09a3aba4cdc0: Verifying Checksum 42 09a3aba4cdc0: Download complete 43 64889fa545ec: Pull complete 47 44 9356474b59db: Download complete 48 2ab8440e5667: Pull complete49 64889fa545ec: Pull complete50 09a3aba4cdc0: Download complete51 45 f807504c7162: Pull complete 52 3950d3df66cb: Pull complete53 46 e9cab5988275: Verifying Checksum 54 47 e9cab5988275: Download complete 48 3950d3df66cb: Pull complete 55 49 09a3aba4cdc0: Pull complete 56 50 177ad834d54f: Pull complete 57 51 9356474b59db: Pull complete 58 52 e9cab5988275: Pull complete 59 Digest: sha256: 51432a0d68befb440ce8e54c001e213ec6c2f861b7dd21205588a985455428ae53 Digest: sha256:9b36491c20827f119921f86ecf0a31842822e17e1d04e11f289aad18ffef7a03 60 54 Status: Downloaded newer image for docker.pkg.github.com/ctmobi/wubtitle-wordpress-plugin/php-actions_composer_wubtitle-wordpress-plugin:php-7.4-build2 61 55 docker.pkg.github.com/ctmobi/wubtitle-wordpress-plugin/php-actions_composer_wubtitle-wordpress-plugin:php-7.4-build2 … … 70 64 Login Succeeded 71 65 Pulling docker.pkg.github.com/ctmobi/wubtitle-wordpress-plugin/php-actions_composer_wubtitle-wordpress-plugin:php-7.4-build2 72 WARNING: ⚠️ Failed to pull manifest by the resolved digest. This registry does not73 appear to conform to the distribution registry specification; falling back to74 pull by tag. This fallback is DEPRECATED, and will be removed in a future75 release. Please contact admins of https://docker.pkg.github.com. ⚠️76 77 66 php-7.4-build2: Pulling from ctmobi/wubtitle-wordpress-plugin/php-actions_composer_wubtitle-wordpress-plugin 78 Digest: sha256: 51432a0d68befb440ce8e54c001e213ec6c2f861b7dd21205588a985455428ae67 Digest: sha256:9b36491c20827f119921f86ecf0a31842822e17e1d04e11f289aad18ffef7a03 79 68 Status: Image is up to date for docker.pkg.github.com/ctmobi/wubtitle-wordpress-plugin/php-actions_composer_wubtitle-wordpress-plugin:php-7.4-build2 80 69 docker.pkg.github.com/ctmobi/wubtitle-wordpress-plugin/php-actions_composer_wubtitle-wordpress-plugin:php-7.4-build2 -
wubtitle/tags/1.2.3/readme.txt
r2539088 r2591401 4 4 Tags: subtitle, subtitles, video, Transcription, SEO, speech-to-text, video to text, Youtube to text, Vimeo, Vimeo to text, Youtube, Youtube Transcription, Vimeo Transcription 5 5 Requires at least: 5.3 6 Tested up to: 5. 66 Tested up to: 5.8 7 7 Stable tag: trunk 8 8 Requires PHP: 7.2 … … 96 96 == Changelog == 97 97 98 = 1.2.3 = 99 Release Date: August 31th, 2021 100 101 Enhancements: 102 * Added support to Wordpress 5.8 103 104 Bugfixes: 105 106 * Stability improvements 107 * Fix support for youtube transcribe 108 98 109 = 1.2.2 = 99 110 Release Date: May 28th, 2021 -
wubtitle/tags/1.2.3/vendor/autoload.php
r2539088 r2591401 5 5 require_once __DIR__ . '/composer/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit 16b1f7c2422ac449a30efbe496bd2d31::getLoader();7 return ComposerAutoloaderInitbea5ab2a1dc7db4ea7d25159db746463::getLoader(); -
wubtitle/tags/1.2.3/vendor/composer/ClassLoader.php
r2539088 r2591401 339 339 * 340 340 * @param string $class The name of the class 341 * @return bool|null True if loaded, null otherwise341 * @return true|null True if loaded, null otherwise 342 342 */ 343 343 public function loadClass($class) … … 348 348 return true; 349 349 } 350 351 return null; 350 352 } 351 353 -
wubtitle/tags/1.2.3/vendor/composer/InstalledVersions.php
r2539088 r2591401 1 1 <?php 2 2 3 4 5 6 7 8 9 10 11 3 /* 4 * This file is part of Composer. 5 * 6 * (c) Nils Adermann <[email protected]> 7 * Jordi Boggiano <[email protected]> 8 * 9 * For the full copyright and license information, please view the LICENSE 10 * file that was distributed with this source code. 11 */ 12 12 13 13 namespace Composer; … … 16 16 use Composer\Semver\VersionParser; 17 17 18 19 20 21 22 23 24 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 it's presence, you can require `composer-runtime-api ^2.0` 24 */ 25 25 class InstalledVersions 26 26 { 27 private static $installed = array ( 28 'root' => 29 array ( 30 'pretty_version' => '1.2.2', 31 'version' => '1.2.2.0', 32 'aliases' => 33 array ( 34 ), 35 'reference' => '550d9da72e6bd33736cfeca114ccfb2f2f4390e6', 36 'name' => 'ctmobi/wubtitle', 37 ), 38 'versions' => 39 array ( 40 'ctmobi/wubtitle' => 41 array ( 42 'pretty_version' => '1.2.2', 43 'version' => '1.2.2.0', 44 'aliases' => 45 array ( 46 ), 47 'reference' => '550d9da72e6bd33736cfeca114ccfb2f2f4390e6', 48 ), 49 'firebase/php-jwt' => 50 array ( 51 'pretty_version' => 'v5.2.1', 52 'version' => '5.2.1.0', 53 'aliases' => 54 array ( 55 ), 56 'reference' => 'f42c9110abe98dd6cfe9053c49bc86acc70b2d23', 57 ), 58 ), 59 ); 60 private static $canGetVendors; 61 private static $installedByVendor = array(); 62 63 64 65 66 67 68 69 public static function getInstalledPackages() 70 { 71 $packages = array(); 72 foreach (self::getInstalled() as $installed) { 73 $packages[] = array_keys($installed['versions']); 27 private static $installed; 28 private static $canGetVendors; 29 private static $installedByVendor = array(); 30 31 /** 32 * Returns a list of all package names which are present, either by being installed, replaced or provided 33 * 34 * @return string[] 35 * @psalm-return list<string> 36 */ 37 public static function getInstalledPackages() 38 { 39 $packages = array(); 40 foreach (self::getInstalled() as $installed) { 41 $packages[] = array_keys($installed['versions']); 42 } 43 44 if (1 === \count($packages)) { 45 return $packages[0]; 46 } 47 48 return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); 49 } 50 51 /** 52 * Returns a list of all package names with a specific type e.g. 'library' 53 * 54 * @param string $type 55 * @return string[] 56 * @psalm-return list<string> 57 */ 58 public static function getInstalledPackagesByType($type) 59 { 60 $packagesByType = array(); 61 62 foreach (self::getInstalled() as $installed) { 63 foreach ($installed['versions'] as $name => $package) { 64 if (isset($package['type']) && $package['type'] === $type) { 65 $packagesByType[] = $name; 66 } 67 } 68 } 69 70 return $packagesByType; 71 } 72 73 /** 74 * Checks whether the given package is installed 75 * 76 * This also returns true if the package name is provided or replaced by another package 77 * 78 * @param string $packageName 79 * @param bool $includeDevRequirements 80 * @return bool 81 */ 82 public static function isInstalled($packageName, $includeDevRequirements = true) 83 { 84 foreach (self::getInstalled() as $installed) { 85 if (isset($installed['versions'][$packageName])) { 86 return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); 87 } 88 } 89 90 return false; 91 } 92 93 /** 94 * Checks whether the given package satisfies a version constraint 95 * 96 * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: 97 * 98 * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') 99 * 100 * @param VersionParser $parser Install composer/semver to have access to this class and functionality 101 * @param string $packageName 102 * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package 103 * @return bool 104 */ 105 public static function satisfies(VersionParser $parser, $packageName, $constraint) 106 { 107 $constraint = $parser->parseConstraints($constraint); 108 $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); 109 110 return $provided->matches($constraint); 111 } 112 113 /** 114 * Returns a version constraint representing all the range(s) which are installed for a given package 115 * 116 * It is easier to use this via isInstalled() with the $constraint argument if you need to check 117 * whether a given version of a package is installed, and not just whether it exists 118 * 119 * @param string $packageName 120 * @return string Version constraint usable with composer/semver 121 */ 122 public static function getVersionRanges($packageName) 123 { 124 foreach (self::getInstalled() as $installed) { 125 if (!isset($installed['versions'][$packageName])) { 126 continue; 127 } 128 129 $ranges = array(); 130 if (isset($installed['versions'][$packageName]['pretty_version'])) { 131 $ranges[] = $installed['versions'][$packageName]['pretty_version']; 132 } 133 if (array_key_exists('aliases', $installed['versions'][$packageName])) { 134 $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); 135 } 136 if (array_key_exists('replaced', $installed['versions'][$packageName])) { 137 $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); 138 } 139 if (array_key_exists('provided', $installed['versions'][$packageName])) { 140 $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); 141 } 142 143 return implode(' || ', $ranges); 144 } 145 146 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 147 } 148 149 /** 150 * @param string $packageName 151 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present 152 */ 153 public static function getVersion($packageName) 154 { 155 foreach (self::getInstalled() as $installed) { 156 if (!isset($installed['versions'][$packageName])) { 157 continue; 158 } 159 160 if (!isset($installed['versions'][$packageName]['version'])) { 161 return null; 162 } 163 164 return $installed['versions'][$packageName]['version']; 165 } 166 167 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 168 } 169 170 /** 171 * @param string $packageName 172 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present 173 */ 174 public static function getPrettyVersion($packageName) 175 { 176 foreach (self::getInstalled() as $installed) { 177 if (!isset($installed['versions'][$packageName])) { 178 continue; 179 } 180 181 if (!isset($installed['versions'][$packageName]['pretty_version'])) { 182 return null; 183 } 184 185 return $installed['versions'][$packageName]['pretty_version']; 186 } 187 188 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 189 } 190 191 /** 192 * @param string $packageName 193 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference 194 */ 195 public static function getReference($packageName) 196 { 197 foreach (self::getInstalled() as $installed) { 198 if (!isset($installed['versions'][$packageName])) { 199 continue; 200 } 201 202 if (!isset($installed['versions'][$packageName]['reference'])) { 203 return null; 204 } 205 206 return $installed['versions'][$packageName]['reference']; 207 } 208 209 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 210 } 211 212 /** 213 * @param string $packageName 214 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. 215 */ 216 public static function getInstallPath($packageName) 217 { 218 foreach (self::getInstalled() as $installed) { 219 if (!isset($installed['versions'][$packageName])) { 220 continue; 221 } 222 223 return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; 224 } 225 226 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 227 } 228 229 /** 230 * @return array 231 * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string} 232 */ 233 public static function getRootPackage() 234 { 235 $installed = self::getInstalled(); 236 237 return $installed[0]['root']; 238 } 239 240 /** 241 * Returns the raw installed.php data for custom implementations 242 * 243 * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. 244 * @return array[] 245 * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} 246 */ 247 public static function getRawData() 248 { 249 @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); 250 251 if (null === self::$installed) { 252 // only require the installed.php file if this file is loaded from its dumped location, 253 // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 254 if (substr(__DIR__, -8, 1) !== 'C') { 255 self::$installed = include __DIR__ . '/installed.php'; 256 } else { 257 self::$installed = array(); 258 } 259 } 260 261 return self::$installed; 262 } 263 264 /** 265 * Returns the raw data of all installed.php which are currently loaded for custom implementations 266 * 267 * @return array[] 268 * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}> 269 */ 270 public static function getAllRawData() 271 { 272 return self::getInstalled(); 273 } 274 275 /** 276 * Lets you reload the static array from another file 277 * 278 * This is only useful for complex integrations in which a project needs to use 279 * this class but then also needs to execute another project's autoloader in process, 280 * and wants to ensure both projects have access to their version of installed.php. 281 * 282 * A typical case would be PHPUnit, where it would need to make sure it reads all 283 * the data it needs from this class, then call reload() with 284 * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure 285 * the project in which it runs can then also use this class safely, without 286 * interference between PHPUnit's dependencies and the project's dependencies. 287 * 288 * @param array[] $data A vendor/composer/installed.php data set 289 * @return void 290 * 291 * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data 292 */ 293 public static function reload($data) 294 { 295 self::$installed = $data; 296 self::$installedByVendor = array(); 297 } 298 299 /** 300 * @return array[] 301 * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}> 302 */ 303 private static function getInstalled() 304 { 305 if (null === self::$canGetVendors) { 306 self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); 307 } 308 309 $installed = array(); 310 311 if (self::$canGetVendors) { 312 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 313 if (isset(self::$installedByVendor[$vendorDir])) { 314 $installed[] = self::$installedByVendor[$vendorDir]; 315 } elseif (is_file($vendorDir.'/composer/installed.php')) { 316 $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; 317 if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { 318 self::$installed = $installed[count($installed) - 1]; 319 } 320 } 321 } 322 } 323 324 if (null === self::$installed) { 325 // only require the installed.php file if this file is loaded from its dumped location, 326 // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 327 if (substr(__DIR__, -8, 1) !== 'C') { 328 self::$installed = require __DIR__ . '/installed.php'; 329 } else { 330 self::$installed = array(); 331 } 332 } 333 $installed[] = self::$installed; 334 335 return $installed; 336 } 74 337 } 75 76 if (1 === \count($packages)) {77 return $packages[0];78 }79 80 return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));81 }82 83 84 85 86 87 88 89 90 91 public static function isInstalled($packageName)92 {93 foreach (self::getInstalled() as $installed) {94 if (isset($installed['versions'][$packageName])) {95 return true;96 }97 }98 99 return false;100 }101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 public static function satisfies(VersionParser $parser, $packageName, $constraint)116 {117 $constraint = $parser->parseConstraints($constraint);118 $provided = $parser->parseConstraints(self::getVersionRanges($packageName));119 120 return $provided->matches($constraint);121 }122 123 124 125 126 127 128 129 130 131 132 public static function getVersionRanges($packageName)133 {134 foreach (self::getInstalled() as $installed) {135 if (!isset($installed['versions'][$packageName])) {136 continue;137 }138 139 $ranges = array();140 if (isset($installed['versions'][$packageName]['pretty_version'])) {141 $ranges[] = $installed['versions'][$packageName]['pretty_version'];142 }143 if (array_key_exists('aliases', $installed['versions'][$packageName])) {144 $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);145 }146 if (array_key_exists('replaced', $installed['versions'][$packageName])) {147 $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);148 }149 if (array_key_exists('provided', $installed['versions'][$packageName])) {150 $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);151 }152 153 return implode(' || ', $ranges);154 }155 156 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');157 }158 159 160 161 162 163 public static function getVersion($packageName)164 {165 foreach (self::getInstalled() as $installed) {166 if (!isset($installed['versions'][$packageName])) {167 continue;168 }169 170 if (!isset($installed['versions'][$packageName]['version'])) {171 return null;172 }173 174 return $installed['versions'][$packageName]['version'];175 }176 177 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');178 }179 180 181 182 183 184 public static function getPrettyVersion($packageName)185 {186 foreach (self::getInstalled() as $installed) {187 if (!isset($installed['versions'][$packageName])) {188 continue;189 }190 191 if (!isset($installed['versions'][$packageName]['pretty_version'])) {192 return null;193 }194 195 return $installed['versions'][$packageName]['pretty_version'];196 }197 198 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');199 }200 201 202 203 204 205 public static function getReference($packageName)206 {207 foreach (self::getInstalled() as $installed) {208 if (!isset($installed['versions'][$packageName])) {209 continue;210 }211 212 if (!isset($installed['versions'][$packageName]['reference'])) {213 return null;214 }215 216 return $installed['versions'][$packageName]['reference'];217 }218 219 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');220 }221 222 223 224 225 226 public static function getRootPackage()227 {228 $installed = self::getInstalled();229 230 return $installed[0]['root'];231 }232 233 234 235 236 237 238 239 240 public static function getRawData()241 {242 @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);243 244 return self::$installed;245 }246 247 248 249 250 251 252 253 public static function getAllRawData()254 {255 return self::getInstalled();256 }257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 public static function reload($data)277 {278 self::$installed = $data;279 self::$installedByVendor = array();280 }281 282 283 284 285 286 private static function getInstalled()287 {288 if (null === self::$canGetVendors) {289 self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');290 }291 292 $installed = array();293 294 if (self::$canGetVendors) {295 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {296 if (isset(self::$installedByVendor[$vendorDir])) {297 $installed[] = self::$installedByVendor[$vendorDir];298 } elseif (is_file($vendorDir.'/composer/installed.php')) {299 $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';300 }301 }302 }303 304 $installed[] = self::$installed;305 306 return $installed;307 }308 } -
wubtitle/tags/1.2.3/vendor/composer/autoload_real.php
r2539088 r2591401 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 16b1f7c2422ac449a30efbe496bd2d315 class ComposerAutoloaderInitbea5ab2a1dc7db4ea7d25159db746463 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit 16b1f7c2422ac449a30efbe496bd2d31', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInitbea5ab2a1dc7db4ea7d25159db746463', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); 29 spl_autoload_unregister(array('ComposerAutoloaderInit 16b1f7c2422ac449a30efbe496bd2d31', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInitbea5ab2a1dc7db4ea7d25159db746463', 'loadClassLoader')); 30 30 31 31 $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); … … 33 33 require __DIR__ . '/autoload_static.php'; 34 34 35 call_user_func(\Composer\Autoload\ComposerStaticInit 16b1f7c2422ac449a30efbe496bd2d31::getInitializer($loader));35 call_user_func(\Composer\Autoload\ComposerStaticInitbea5ab2a1dc7db4ea7d25159db746463::getInitializer($loader)); 36 36 } else { 37 37 $map = require __DIR__ . '/autoload_namespaces.php'; -
wubtitle/tags/1.2.3/vendor/composer/autoload_static.php
r2539088 r2591401 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 16b1f7c2422ac449a30efbe496bd2d317 class ComposerStaticInitbea5ab2a1dc7db4ea7d25159db746463 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 36 36 { 37 37 return \Closure::bind(function () use ($loader) { 38 $loader->prefixLengthsPsr4 = ComposerStaticInit 16b1f7c2422ac449a30efbe496bd2d31::$prefixLengthsPsr4;39 $loader->prefixDirsPsr4 = ComposerStaticInit 16b1f7c2422ac449a30efbe496bd2d31::$prefixDirsPsr4;40 $loader->classMap = ComposerStaticInit 16b1f7c2422ac449a30efbe496bd2d31::$classMap;38 $loader->prefixLengthsPsr4 = ComposerStaticInitbea5ab2a1dc7db4ea7d25159db746463::$prefixLengthsPsr4; 39 $loader->prefixDirsPsr4 = ComposerStaticInitbea5ab2a1dc7db4ea7d25159db746463::$prefixDirsPsr4; 40 $loader->classMap = ComposerStaticInitbea5ab2a1dc7db4ea7d25159db746463::$classMap; 41 41 42 42 }, null, ClassLoader::class); -
wubtitle/tags/1.2.3/vendor/composer/installed.php
r2539088 r2591401 1 <?php return array ( 2 'root' => 3 array ( 4 'pretty_version' => '1.2.2', 5 'version' => '1.2.2.0', 6 'aliases' => 7 array ( 1 <?php return array( 2 'root' => array( 3 'pretty_version' => '1.2.3', 4 'version' => '1.2.3.0', 5 'type' => 'project', 6 'install_path' => __DIR__ . '/../../', 7 'aliases' => array(), 8 'reference' => 'be401e9e166c7b7fbfe40fed97b9f803dc6e49ea', 9 'name' => 'ctmobi/wubtitle', 10 'dev' => false, 8 11 ), 9 'reference' => '550d9da72e6bd33736cfeca114ccfb2f2f4390e6', 10 'name' => 'ctmobi/wubtitle', 11 ), 12 'versions' => 13 array ( 14 'ctmobi/wubtitle' => 15 array ( 16 'pretty_version' => '1.2.2', 17 'version' => '1.2.2.0', 18 'aliases' => 19 array ( 20 ), 21 'reference' => '550d9da72e6bd33736cfeca114ccfb2f2f4390e6', 12 'versions' => array( 13 'ctmobi/wubtitle' => array( 14 'pretty_version' => '1.2.3', 15 'version' => '1.2.3.0', 16 'type' => 'project', 17 'install_path' => __DIR__ . '/../../', 18 'aliases' => array(), 19 'reference' => 'be401e9e166c7b7fbfe40fed97b9f803dc6e49ea', 20 'dev_requirement' => false, 21 ), 22 'firebase/php-jwt' => array( 23 'pretty_version' => 'v5.2.1', 24 'version' => '5.2.1.0', 25 'type' => 'library', 26 'install_path' => __DIR__ . '/../firebase/php-jwt', 27 'aliases' => array(), 28 'reference' => 'f42c9110abe98dd6cfe9053c49bc86acc70b2d23', 29 'dev_requirement' => false, 30 ), 22 31 ), 23 'firebase/php-jwt' =>24 array (25 'pretty_version' => 'v5.2.1',26 'version' => '5.2.1.0',27 'aliases' =>28 array (29 ),30 'reference' => 'f42c9110abe98dd6cfe9053c49bc86acc70b2d23',31 ),32 ),33 32 ); -
wubtitle/tags/1.2.3/wubtitle.php
r2539088 r2591401 8 8 * Text Domain: wubtitle 9 9 * Domain Path: /languages 10 * Version: 1.2. 210 * Version: 1.2.3 11 11 * 12 12 * @package Wubtitle … … 22 22 define( 'WUBTITLE_URL', plugin_dir_url( __FILE__ ) ); 23 23 define( 'WUBTITLE_NAME', dirname( plugin_basename( __FILE__ ) ) ); 24 define( 'WUBTITLE_VER', '1.2. 2' );24 define( 'WUBTITLE_VER', '1.2.3' ); 25 25 $endpoint = 'https://api.wubtitle.com/'; 26 26 if ( defined( 'WP_WUBTITLE_ENV' ) && 'development' === WP_WUBTITLE_ENV ) { -
wubtitle/trunk/includes/Core/Sources/YouTube.php
r2539088 r2591401 86 86 } 87 87 $id_video = $query_params['v']; 88 $get_info_url = "https://www.youtube.com/get_video_info?html5=1&video_id=$id_video"; 89 90 $file_info = array(); 91 92 $response = wp_remote_get( 88 $get_info_url = 'https://www.youtube.com/youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8'; 89 90 $body = array( 91 'context' => array( 92 'client' => array( 93 'hl' => 'en', 94 'clientName' => 'WEB', 95 'clientVersion' => '2.20210721.00.00', 96 'clientFormFactor' => 'UNKNOWN_FORM_FACTOR', 97 'clientScreen' => 'WATCH', 98 'mainAppWebInfo' => array( 99 'graftUrl' => "/watch?v=$id_video", 100 ), 101 ), 102 'user' => array( 103 'lockedSafetyMode' => false, 104 ), 105 'request' => array( 106 'useSsl' => true, 107 'internalExperimentFlags' => array(), 108 'consistencyTokenJars' => array(), 109 ), 110 ), 111 'videoId' => $id_video, 112 'playbackContext' => array( 113 'contentPlaybackContext' => array( 114 'vis' => 0, 115 'splay' => false, 116 'autoCaptionsDefaultOn' => false, 117 'autonavState' => 'STATE_NONE', 118 'html5Preference' => 'HTML5_PREF_WANTS', 119 'lactMilliseconds' => '-1', 120 ), 121 ), 122 'racyCheckOk' => false, 123 'contentCheckOk' => false, 124 ); 125 126 $response = wp_remote_post( 93 127 $get_info_url, 94 128 array( 95 'headers' => array( 'Accept-Language' => get_locale() ), 129 'headers' => array( 130 'Accept-Language' => get_locale(), 131 'Content-Type' => 'application/json; charset=utf-8', 132 ), 133 'body' => wp_json_encode( $body ), 96 134 ) 97 135 ); 98 $file = wp_remote_retrieve_body( $response ); 99 100 parse_str( $file, $file_info ); 101 if ( 'fail' === $file_info['status'] ) { 136 $response_body = json_decode( wp_remote_retrieve_body( $response ) ); 137 if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { 102 138 return array( 103 139 'success' => false, … … 105 141 ); 106 142 } 107 $title_video = json_decode( $file_info['player_response'] )->videoDetails->title; 108 $languages = json_decode( $file_info['player_response'] )->captions->playerCaptionsTracklistRenderer->captionTracks; 109 $video_info = array( 143 // phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 144 // warning camel case. 145 $title_video = $response_body->videoDetails->title; 146 // phpcs:enable 147 $languages = $response_body->captions->playerCaptionsTracklistRenderer->captionTracks; 148 $video_info = array( 110 149 'success' => true, 111 150 'source' => 'youtube', -
wubtitle/trunk/output.log
r2539088 r2591401 6 6 Login Succeeded 7 7 Pulling docker.pkg.github.com/ctmobi/wubtitle-wordpress-plugin/php-actions_composer_wubtitle-wordpress-plugin:php-7.4-build2 8 WARNING: ⚠️ Failed to pull manifest by the resolved digest. This registry does not9 appear to conform to the distribution registry specification; falling back to10 pull by tag. This fallback is DEPRECATED, and will be removed in a future11 release. Please contact admins of https://docker.pkg.github.com. ⚠️12 13 8 php-7.4-build2: Pulling from ctmobi/wubtitle-wordpress-plugin/php-actions_composer_wubtitle-wordpress-plugin 14 9 596ba82af5aa: Pulling fs layer … … 22 17 9356474b59db: Pulling fs layer 23 18 e9cab5988275: Pulling fs layer 24 64889fa545ec: Waiting25 f807504c7162: Waiting26 19 3950d3df66cb: Waiting 27 20 09a3aba4cdc0: Waiting … … 29 22 9356474b59db: Waiting 30 23 e9cab5988275: Waiting 24 64889fa545ec: Waiting 25 f807504c7162: Waiting 31 26 2ab8440e5667: Verifying Checksum 32 27 2ab8440e5667: Download complete 33 af74f285bb27: Verifying Checksum28 596ba82af5aa: Verifying Checksum 34 29 af74f285bb27: Download complete 35 30 64889fa545ec: Verifying Checksum 36 31 64889fa545ec: Download complete 37 596ba82af5aa: Download complete38 32 596ba82af5aa: Pull complete 39 f807504c7162: Verifying Checksum40 f807504c7162: Download complete41 33 3950d3df66cb: Verifying Checksum 42 34 3950d3df66cb: Download complete 43 35 af74f285bb27: Pull complete 36 f807504c7162: Verifying Checksum 37 f807504c7162: Download complete 44 38 177ad834d54f: Verifying Checksum 45 39 177ad834d54f: Download complete 46 9356474b59db: Verifying Checksum 40 2ab8440e5667: Pull complete 41 09a3aba4cdc0: Verifying Checksum 42 09a3aba4cdc0: Download complete 43 64889fa545ec: Pull complete 47 44 9356474b59db: Download complete 48 2ab8440e5667: Pull complete49 64889fa545ec: Pull complete50 09a3aba4cdc0: Download complete51 45 f807504c7162: Pull complete 52 3950d3df66cb: Pull complete53 46 e9cab5988275: Verifying Checksum 54 47 e9cab5988275: Download complete 48 3950d3df66cb: Pull complete 55 49 09a3aba4cdc0: Pull complete 56 50 177ad834d54f: Pull complete 57 51 9356474b59db: Pull complete 58 52 e9cab5988275: Pull complete 59 Digest: sha256: 51432a0d68befb440ce8e54c001e213ec6c2f861b7dd21205588a985455428ae53 Digest: sha256:9b36491c20827f119921f86ecf0a31842822e17e1d04e11f289aad18ffef7a03 60 54 Status: Downloaded newer image for docker.pkg.github.com/ctmobi/wubtitle-wordpress-plugin/php-actions_composer_wubtitle-wordpress-plugin:php-7.4-build2 61 55 docker.pkg.github.com/ctmobi/wubtitle-wordpress-plugin/php-actions_composer_wubtitle-wordpress-plugin:php-7.4-build2 … … 70 64 Login Succeeded 71 65 Pulling docker.pkg.github.com/ctmobi/wubtitle-wordpress-plugin/php-actions_composer_wubtitle-wordpress-plugin:php-7.4-build2 72 WARNING: ⚠️ Failed to pull manifest by the resolved digest. This registry does not73 appear to conform to the distribution registry specification; falling back to74 pull by tag. This fallback is DEPRECATED, and will be removed in a future75 release. Please contact admins of https://docker.pkg.github.com. ⚠️76 77 66 php-7.4-build2: Pulling from ctmobi/wubtitle-wordpress-plugin/php-actions_composer_wubtitle-wordpress-plugin 78 Digest: sha256: 51432a0d68befb440ce8e54c001e213ec6c2f861b7dd21205588a985455428ae67 Digest: sha256:9b36491c20827f119921f86ecf0a31842822e17e1d04e11f289aad18ffef7a03 79 68 Status: Image is up to date for docker.pkg.github.com/ctmobi/wubtitle-wordpress-plugin/php-actions_composer_wubtitle-wordpress-plugin:php-7.4-build2 80 69 docker.pkg.github.com/ctmobi/wubtitle-wordpress-plugin/php-actions_composer_wubtitle-wordpress-plugin:php-7.4-build2 -
wubtitle/trunk/readme.txt
r2539088 r2591401 4 4 Tags: subtitle, subtitles, video, Transcription, SEO, speech-to-text, video to text, Youtube to text, Vimeo, Vimeo to text, Youtube, Youtube Transcription, Vimeo Transcription 5 5 Requires at least: 5.3 6 Tested up to: 5. 66 Tested up to: 5.8 7 7 Stable tag: trunk 8 8 Requires PHP: 7.2 … … 96 96 == Changelog == 97 97 98 = 1.2.3 = 99 Release Date: August 31th, 2021 100 101 Enhancements: 102 * Added support to Wordpress 5.8 103 104 Bugfixes: 105 106 * Stability improvements 107 * Fix support for youtube transcribe 108 98 109 = 1.2.2 = 99 110 Release Date: May 28th, 2021 -
wubtitle/trunk/vendor/autoload.php
r2539088 r2591401 5 5 require_once __DIR__ . '/composer/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit 16b1f7c2422ac449a30efbe496bd2d31::getLoader();7 return ComposerAutoloaderInitbea5ab2a1dc7db4ea7d25159db746463::getLoader(); -
wubtitle/trunk/vendor/composer/ClassLoader.php
r2539088 r2591401 339 339 * 340 340 * @param string $class The name of the class 341 * @return bool|null True if loaded, null otherwise341 * @return true|null True if loaded, null otherwise 342 342 */ 343 343 public function loadClass($class) … … 348 348 return true; 349 349 } 350 351 return null; 350 352 } 351 353 -
wubtitle/trunk/vendor/composer/InstalledVersions.php
r2539088 r2591401 1 1 <?php 2 2 3 4 5 6 7 8 9 10 11 3 /* 4 * This file is part of Composer. 5 * 6 * (c) Nils Adermann <[email protected]> 7 * Jordi Boggiano <[email protected]> 8 * 9 * For the full copyright and license information, please view the LICENSE 10 * file that was distributed with this source code. 11 */ 12 12 13 13 namespace Composer; … … 16 16 use Composer\Semver\VersionParser; 17 17 18 19 20 21 22 23 24 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 it's presence, you can require `composer-runtime-api ^2.0` 24 */ 25 25 class InstalledVersions 26 26 { 27 private static $installed = array ( 28 'root' => 29 array ( 30 'pretty_version' => '1.2.2', 31 'version' => '1.2.2.0', 32 'aliases' => 33 array ( 34 ), 35 'reference' => '550d9da72e6bd33736cfeca114ccfb2f2f4390e6', 36 'name' => 'ctmobi/wubtitle', 37 ), 38 'versions' => 39 array ( 40 'ctmobi/wubtitle' => 41 array ( 42 'pretty_version' => '1.2.2', 43 'version' => '1.2.2.0', 44 'aliases' => 45 array ( 46 ), 47 'reference' => '550d9da72e6bd33736cfeca114ccfb2f2f4390e6', 48 ), 49 'firebase/php-jwt' => 50 array ( 51 'pretty_version' => 'v5.2.1', 52 'version' => '5.2.1.0', 53 'aliases' => 54 array ( 55 ), 56 'reference' => 'f42c9110abe98dd6cfe9053c49bc86acc70b2d23', 57 ), 58 ), 59 ); 60 private static $canGetVendors; 61 private static $installedByVendor = array(); 62 63 64 65 66 67 68 69 public static function getInstalledPackages() 70 { 71 $packages = array(); 72 foreach (self::getInstalled() as $installed) { 73 $packages[] = array_keys($installed['versions']); 27 private static $installed; 28 private static $canGetVendors; 29 private static $installedByVendor = array(); 30 31 /** 32 * Returns a list of all package names which are present, either by being installed, replaced or provided 33 * 34 * @return string[] 35 * @psalm-return list<string> 36 */ 37 public static function getInstalledPackages() 38 { 39 $packages = array(); 40 foreach (self::getInstalled() as $installed) { 41 $packages[] = array_keys($installed['versions']); 42 } 43 44 if (1 === \count($packages)) { 45 return $packages[0]; 46 } 47 48 return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); 49 } 50 51 /** 52 * Returns a list of all package names with a specific type e.g. 'library' 53 * 54 * @param string $type 55 * @return string[] 56 * @psalm-return list<string> 57 */ 58 public static function getInstalledPackagesByType($type) 59 { 60 $packagesByType = array(); 61 62 foreach (self::getInstalled() as $installed) { 63 foreach ($installed['versions'] as $name => $package) { 64 if (isset($package['type']) && $package['type'] === $type) { 65 $packagesByType[] = $name; 66 } 67 } 68 } 69 70 return $packagesByType; 71 } 72 73 /** 74 * Checks whether the given package is installed 75 * 76 * This also returns true if the package name is provided or replaced by another package 77 * 78 * @param string $packageName 79 * @param bool $includeDevRequirements 80 * @return bool 81 */ 82 public static function isInstalled($packageName, $includeDevRequirements = true) 83 { 84 foreach (self::getInstalled() as $installed) { 85 if (isset($installed['versions'][$packageName])) { 86 return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); 87 } 88 } 89 90 return false; 91 } 92 93 /** 94 * Checks whether the given package satisfies a version constraint 95 * 96 * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: 97 * 98 * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') 99 * 100 * @param VersionParser $parser Install composer/semver to have access to this class and functionality 101 * @param string $packageName 102 * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package 103 * @return bool 104 */ 105 public static function satisfies(VersionParser $parser, $packageName, $constraint) 106 { 107 $constraint = $parser->parseConstraints($constraint); 108 $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); 109 110 return $provided->matches($constraint); 111 } 112 113 /** 114 * Returns a version constraint representing all the range(s) which are installed for a given package 115 * 116 * It is easier to use this via isInstalled() with the $constraint argument if you need to check 117 * whether a given version of a package is installed, and not just whether it exists 118 * 119 * @param string $packageName 120 * @return string Version constraint usable with composer/semver 121 */ 122 public static function getVersionRanges($packageName) 123 { 124 foreach (self::getInstalled() as $installed) { 125 if (!isset($installed['versions'][$packageName])) { 126 continue; 127 } 128 129 $ranges = array(); 130 if (isset($installed['versions'][$packageName]['pretty_version'])) { 131 $ranges[] = $installed['versions'][$packageName]['pretty_version']; 132 } 133 if (array_key_exists('aliases', $installed['versions'][$packageName])) { 134 $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); 135 } 136 if (array_key_exists('replaced', $installed['versions'][$packageName])) { 137 $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); 138 } 139 if (array_key_exists('provided', $installed['versions'][$packageName])) { 140 $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); 141 } 142 143 return implode(' || ', $ranges); 144 } 145 146 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 147 } 148 149 /** 150 * @param string $packageName 151 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present 152 */ 153 public static function getVersion($packageName) 154 { 155 foreach (self::getInstalled() as $installed) { 156 if (!isset($installed['versions'][$packageName])) { 157 continue; 158 } 159 160 if (!isset($installed['versions'][$packageName]['version'])) { 161 return null; 162 } 163 164 return $installed['versions'][$packageName]['version']; 165 } 166 167 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 168 } 169 170 /** 171 * @param string $packageName 172 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present 173 */ 174 public static function getPrettyVersion($packageName) 175 { 176 foreach (self::getInstalled() as $installed) { 177 if (!isset($installed['versions'][$packageName])) { 178 continue; 179 } 180 181 if (!isset($installed['versions'][$packageName]['pretty_version'])) { 182 return null; 183 } 184 185 return $installed['versions'][$packageName]['pretty_version']; 186 } 187 188 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 189 } 190 191 /** 192 * @param string $packageName 193 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference 194 */ 195 public static function getReference($packageName) 196 { 197 foreach (self::getInstalled() as $installed) { 198 if (!isset($installed['versions'][$packageName])) { 199 continue; 200 } 201 202 if (!isset($installed['versions'][$packageName]['reference'])) { 203 return null; 204 } 205 206 return $installed['versions'][$packageName]['reference']; 207 } 208 209 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 210 } 211 212 /** 213 * @param string $packageName 214 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. 215 */ 216 public static function getInstallPath($packageName) 217 { 218 foreach (self::getInstalled() as $installed) { 219 if (!isset($installed['versions'][$packageName])) { 220 continue; 221 } 222 223 return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; 224 } 225 226 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 227 } 228 229 /** 230 * @return array 231 * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string} 232 */ 233 public static function getRootPackage() 234 { 235 $installed = self::getInstalled(); 236 237 return $installed[0]['root']; 238 } 239 240 /** 241 * Returns the raw installed.php data for custom implementations 242 * 243 * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. 244 * @return array[] 245 * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} 246 */ 247 public static function getRawData() 248 { 249 @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); 250 251 if (null === self::$installed) { 252 // only require the installed.php file if this file is loaded from its dumped location, 253 // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 254 if (substr(__DIR__, -8, 1) !== 'C') { 255 self::$installed = include __DIR__ . '/installed.php'; 256 } else { 257 self::$installed = array(); 258 } 259 } 260 261 return self::$installed; 262 } 263 264 /** 265 * Returns the raw data of all installed.php which are currently loaded for custom implementations 266 * 267 * @return array[] 268 * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}> 269 */ 270 public static function getAllRawData() 271 { 272 return self::getInstalled(); 273 } 274 275 /** 276 * Lets you reload the static array from another file 277 * 278 * This is only useful for complex integrations in which a project needs to use 279 * this class but then also needs to execute another project's autoloader in process, 280 * and wants to ensure both projects have access to their version of installed.php. 281 * 282 * A typical case would be PHPUnit, where it would need to make sure it reads all 283 * the data it needs from this class, then call reload() with 284 * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure 285 * the project in which it runs can then also use this class safely, without 286 * interference between PHPUnit's dependencies and the project's dependencies. 287 * 288 * @param array[] $data A vendor/composer/installed.php data set 289 * @return void 290 * 291 * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data 292 */ 293 public static function reload($data) 294 { 295 self::$installed = $data; 296 self::$installedByVendor = array(); 297 } 298 299 /** 300 * @return array[] 301 * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}> 302 */ 303 private static function getInstalled() 304 { 305 if (null === self::$canGetVendors) { 306 self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); 307 } 308 309 $installed = array(); 310 311 if (self::$canGetVendors) { 312 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 313 if (isset(self::$installedByVendor[$vendorDir])) { 314 $installed[] = self::$installedByVendor[$vendorDir]; 315 } elseif (is_file($vendorDir.'/composer/installed.php')) { 316 $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; 317 if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { 318 self::$installed = $installed[count($installed) - 1]; 319 } 320 } 321 } 322 } 323 324 if (null === self::$installed) { 325 // only require the installed.php file if this file is loaded from its dumped location, 326 // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 327 if (substr(__DIR__, -8, 1) !== 'C') { 328 self::$installed = require __DIR__ . '/installed.php'; 329 } else { 330 self::$installed = array(); 331 } 332 } 333 $installed[] = self::$installed; 334 335 return $installed; 336 } 74 337 } 75 76 if (1 === \count($packages)) {77 return $packages[0];78 }79 80 return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));81 }82 83 84 85 86 87 88 89 90 91 public static function isInstalled($packageName)92 {93 foreach (self::getInstalled() as $installed) {94 if (isset($installed['versions'][$packageName])) {95 return true;96 }97 }98 99 return false;100 }101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 public static function satisfies(VersionParser $parser, $packageName, $constraint)116 {117 $constraint = $parser->parseConstraints($constraint);118 $provided = $parser->parseConstraints(self::getVersionRanges($packageName));119 120 return $provided->matches($constraint);121 }122 123 124 125 126 127 128 129 130 131 132 public static function getVersionRanges($packageName)133 {134 foreach (self::getInstalled() as $installed) {135 if (!isset($installed['versions'][$packageName])) {136 continue;137 }138 139 $ranges = array();140 if (isset($installed['versions'][$packageName]['pretty_version'])) {141 $ranges[] = $installed['versions'][$packageName]['pretty_version'];142 }143 if (array_key_exists('aliases', $installed['versions'][$packageName])) {144 $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);145 }146 if (array_key_exists('replaced', $installed['versions'][$packageName])) {147 $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);148 }149 if (array_key_exists('provided', $installed['versions'][$packageName])) {150 $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);151 }152 153 return implode(' || ', $ranges);154 }155 156 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');157 }158 159 160 161 162 163 public static function getVersion($packageName)164 {165 foreach (self::getInstalled() as $installed) {166 if (!isset($installed['versions'][$packageName])) {167 continue;168 }169 170 if (!isset($installed['versions'][$packageName]['version'])) {171 return null;172 }173 174 return $installed['versions'][$packageName]['version'];175 }176 177 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');178 }179 180 181 182 183 184 public static function getPrettyVersion($packageName)185 {186 foreach (self::getInstalled() as $installed) {187 if (!isset($installed['versions'][$packageName])) {188 continue;189 }190 191 if (!isset($installed['versions'][$packageName]['pretty_version'])) {192 return null;193 }194 195 return $installed['versions'][$packageName]['pretty_version'];196 }197 198 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');199 }200 201 202 203 204 205 public static function getReference($packageName)206 {207 foreach (self::getInstalled() as $installed) {208 if (!isset($installed['versions'][$packageName])) {209 continue;210 }211 212 if (!isset($installed['versions'][$packageName]['reference'])) {213 return null;214 }215 216 return $installed['versions'][$packageName]['reference'];217 }218 219 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');220 }221 222 223 224 225 226 public static function getRootPackage()227 {228 $installed = self::getInstalled();229 230 return $installed[0]['root'];231 }232 233 234 235 236 237 238 239 240 public static function getRawData()241 {242 @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);243 244 return self::$installed;245 }246 247 248 249 250 251 252 253 public static function getAllRawData()254 {255 return self::getInstalled();256 }257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 public static function reload($data)277 {278 self::$installed = $data;279 self::$installedByVendor = array();280 }281 282 283 284 285 286 private static function getInstalled()287 {288 if (null === self::$canGetVendors) {289 self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');290 }291 292 $installed = array();293 294 if (self::$canGetVendors) {295 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {296 if (isset(self::$installedByVendor[$vendorDir])) {297 $installed[] = self::$installedByVendor[$vendorDir];298 } elseif (is_file($vendorDir.'/composer/installed.php')) {299 $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';300 }301 }302 }303 304 $installed[] = self::$installed;305 306 return $installed;307 }308 } -
wubtitle/trunk/vendor/composer/autoload_real.php
r2539088 r2591401 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 16b1f7c2422ac449a30efbe496bd2d315 class ComposerAutoloaderInitbea5ab2a1dc7db4ea7d25159db746463 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit 16b1f7c2422ac449a30efbe496bd2d31', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInitbea5ab2a1dc7db4ea7d25159db746463', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); 29 spl_autoload_unregister(array('ComposerAutoloaderInit 16b1f7c2422ac449a30efbe496bd2d31', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInitbea5ab2a1dc7db4ea7d25159db746463', 'loadClassLoader')); 30 30 31 31 $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); … … 33 33 require __DIR__ . '/autoload_static.php'; 34 34 35 call_user_func(\Composer\Autoload\ComposerStaticInit 16b1f7c2422ac449a30efbe496bd2d31::getInitializer($loader));35 call_user_func(\Composer\Autoload\ComposerStaticInitbea5ab2a1dc7db4ea7d25159db746463::getInitializer($loader)); 36 36 } else { 37 37 $map = require __DIR__ . '/autoload_namespaces.php'; -
wubtitle/trunk/vendor/composer/autoload_static.php
r2539088 r2591401 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 16b1f7c2422ac449a30efbe496bd2d317 class ComposerStaticInitbea5ab2a1dc7db4ea7d25159db746463 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 36 36 { 37 37 return \Closure::bind(function () use ($loader) { 38 $loader->prefixLengthsPsr4 = ComposerStaticInit 16b1f7c2422ac449a30efbe496bd2d31::$prefixLengthsPsr4;39 $loader->prefixDirsPsr4 = ComposerStaticInit 16b1f7c2422ac449a30efbe496bd2d31::$prefixDirsPsr4;40 $loader->classMap = ComposerStaticInit 16b1f7c2422ac449a30efbe496bd2d31::$classMap;38 $loader->prefixLengthsPsr4 = ComposerStaticInitbea5ab2a1dc7db4ea7d25159db746463::$prefixLengthsPsr4; 39 $loader->prefixDirsPsr4 = ComposerStaticInitbea5ab2a1dc7db4ea7d25159db746463::$prefixDirsPsr4; 40 $loader->classMap = ComposerStaticInitbea5ab2a1dc7db4ea7d25159db746463::$classMap; 41 41 42 42 }, null, ClassLoader::class); -
wubtitle/trunk/vendor/composer/installed.php
r2539088 r2591401 1 <?php return array ( 2 'root' => 3 array ( 4 'pretty_version' => '1.2.2', 5 'version' => '1.2.2.0', 6 'aliases' => 7 array ( 1 <?php return array( 2 'root' => array( 3 'pretty_version' => '1.2.3', 4 'version' => '1.2.3.0', 5 'type' => 'project', 6 'install_path' => __DIR__ . '/../../', 7 'aliases' => array(), 8 'reference' => 'be401e9e166c7b7fbfe40fed97b9f803dc6e49ea', 9 'name' => 'ctmobi/wubtitle', 10 'dev' => false, 8 11 ), 9 'reference' => '550d9da72e6bd33736cfeca114ccfb2f2f4390e6', 10 'name' => 'ctmobi/wubtitle', 11 ), 12 'versions' => 13 array ( 14 'ctmobi/wubtitle' => 15 array ( 16 'pretty_version' => '1.2.2', 17 'version' => '1.2.2.0', 18 'aliases' => 19 array ( 20 ), 21 'reference' => '550d9da72e6bd33736cfeca114ccfb2f2f4390e6', 12 'versions' => array( 13 'ctmobi/wubtitle' => array( 14 'pretty_version' => '1.2.3', 15 'version' => '1.2.3.0', 16 'type' => 'project', 17 'install_path' => __DIR__ . '/../../', 18 'aliases' => array(), 19 'reference' => 'be401e9e166c7b7fbfe40fed97b9f803dc6e49ea', 20 'dev_requirement' => false, 21 ), 22 'firebase/php-jwt' => array( 23 'pretty_version' => 'v5.2.1', 24 'version' => '5.2.1.0', 25 'type' => 'library', 26 'install_path' => __DIR__ . '/../firebase/php-jwt', 27 'aliases' => array(), 28 'reference' => 'f42c9110abe98dd6cfe9053c49bc86acc70b2d23', 29 'dev_requirement' => false, 30 ), 22 31 ), 23 'firebase/php-jwt' =>24 array (25 'pretty_version' => 'v5.2.1',26 'version' => '5.2.1.0',27 'aliases' =>28 array (29 ),30 'reference' => 'f42c9110abe98dd6cfe9053c49bc86acc70b2d23',31 ),32 ),33 32 ); -
wubtitle/trunk/wubtitle.php
r2539088 r2591401 8 8 * Text Domain: wubtitle 9 9 * Domain Path: /languages 10 * Version: 1.2. 210 * Version: 1.2.3 11 11 * 12 12 * @package Wubtitle … … 22 22 define( 'WUBTITLE_URL', plugin_dir_url( __FILE__ ) ); 23 23 define( 'WUBTITLE_NAME', dirname( plugin_basename( __FILE__ ) ) ); 24 define( 'WUBTITLE_VER', '1.2. 2' );24 define( 'WUBTITLE_VER', '1.2.3' ); 25 25 $endpoint = 'https://api.wubtitle.com/'; 26 26 if ( defined( 'WP_WUBTITLE_ENV' ) && 'development' === WP_WUBTITLE_ENV ) {
Note: See TracChangeset
for help on using the changeset viewer.