mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-05 19:41:44 +08:00
[更新]Composer组件升级
This commit is contained in:
parent
b5372a8377
commit
6845016d8e
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -4,4 +4,4 @@
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit59af68441ce8f025170b30378685dd2f::getLoader();
|
||||
return ComposerAutoloaderInit14c73d9b1e5753bdff3c064df55184de::getLoader();
|
||||
|
46
vendor/composer/ClassLoader.php
vendored
46
vendor/composer/ClassLoader.php
vendored
@ -55,6 +55,7 @@ class ClassLoader
|
||||
private $classMap = array();
|
||||
private $classMapAuthoritative = false;
|
||||
private $missingClasses = array();
|
||||
private $apcuPrefix;
|
||||
|
||||
public function getPrefixes()
|
||||
{
|
||||
@ -271,6 +272,26 @@ class ClassLoader
|
||||
return $this->classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||
*
|
||||
* @param string|null $apcuPrefix
|
||||
*/
|
||||
public function setApcuPrefix($apcuPrefix)
|
||||
{
|
||||
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The APCu prefix in use, or null if APCu caching is not enabled.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getApcuPrefix()
|
||||
{
|
||||
return $this->apcuPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers this instance as an autoloader.
|
||||
*
|
||||
@ -313,11 +334,6 @@ class ClassLoader
|
||||
*/
|
||||
public function findFile($class)
|
||||
{
|
||||
// work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
|
||||
if ('\\' == $class[0]) {
|
||||
$class = substr($class, 1);
|
||||
}
|
||||
|
||||
// class map lookup
|
||||
if (isset($this->classMap[$class])) {
|
||||
return $this->classMap[$class];
|
||||
@ -325,6 +341,12 @@ class ClassLoader
|
||||
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
||||
return false;
|
||||
}
|
||||
if (null !== $this->apcuPrefix) {
|
||||
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
||||
if ($hit) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
$file = $this->findFileWithExtension($class, '.php');
|
||||
|
||||
@ -333,6 +355,10 @@ class ClassLoader
|
||||
$file = $this->findFileWithExtension($class, '.hh');
|
||||
}
|
||||
|
||||
if (null !== $this->apcuPrefix) {
|
||||
apcu_add($this->apcuPrefix.$class, $file);
|
||||
}
|
||||
|
||||
if (false === $file) {
|
||||
// Remember that this class does not exist.
|
||||
$this->missingClasses[$class] = true;
|
||||
@ -348,9 +374,13 @@ class ClassLoader
|
||||
|
||||
$first = $class[0];
|
||||
if (isset($this->prefixLengthsPsr4[$first])) {
|
||||
foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
|
||||
$subPath = $class;
|
||||
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
||||
$subPath = substr($subPath, 0, $lastPos);
|
||||
$search = $subPath.'\\';
|
||||
if (isset($this->prefixDirsPsr4[$search])) {
|
||||
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
||||
$length = $this->prefixLengthsPsr4[$first][$search];
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
|
||||
return $file;
|
||||
}
|
||||
|
2
vendor/composer/LICENSE
vendored
2
vendor/composer/LICENSE
vendored
@ -1,5 +1,5 @@
|
||||
|
||||
Copyright (c) 2016 Nils Adermann, Jordi Boggiano
|
||||
Copyright (c) Nils Adermann, Jordi Boggiano
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
16
vendor/composer/autoload_real.php
vendored
16
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit59af68441ce8f025170b30378685dd2f
|
||||
class ComposerAutoloaderInit14c73d9b1e5753bdff3c064df55184de
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -19,15 +19,15 @@ class ComposerAutoloaderInit59af68441ce8f025170b30378685dd2f
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit59af68441ce8f025170b30378685dd2f', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit14c73d9b1e5753bdff3c064df55184de', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit59af68441ce8f025170b30378685dd2f', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit14c73d9b1e5753bdff3c064df55184de', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require_once __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit59af68441ce8f025170b30378685dd2f::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit14c73d9b1e5753bdff3c064df55184de::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
@ -48,19 +48,19 @@ class ComposerAutoloaderInit59af68441ce8f025170b30378685dd2f
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit59af68441ce8f025170b30378685dd2f::$files;
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit14c73d9b1e5753bdff3c064df55184de::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire59af68441ce8f025170b30378685dd2f($fileIdentifier, $file);
|
||||
composerRequire14c73d9b1e5753bdff3c064df55184de($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequire59af68441ce8f025170b30378685dd2f($fileIdentifier, $file)
|
||||
function composerRequire14c73d9b1e5753bdff3c064df55184de($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit59af68441ce8f025170b30378685dd2f
|
||||
class ComposerStaticInit14c73d9b1e5753bdff3c064df55184de
|
||||
{
|
||||
public static $files = array (
|
||||
'9b552a3cc426e3287cc811caefa3cf53' => __DIR__ . '/..' . '/topthink/think-helper/src/helper.php',
|
||||
@ -383,9 +383,9 @@ class ComposerStaticInit59af68441ce8f025170b30378685dd2f
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit59af68441ce8f025170b30378685dd2f::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit59af68441ce8f025170b30378685dd2f::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit59af68441ce8f025170b30378685dd2f::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit14c73d9b1e5753bdff3c064df55184de::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit14c73d9b1e5753bdff3c064df55184de::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit14c73d9b1e5753bdff3c064df55184de::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
46
vendor/composer/installed.json
vendored
46
vendor/composer/installed.json
vendored
@ -1,17 +1,17 @@
|
||||
[
|
||||
{
|
||||
"name": "topthink/think-installer",
|
||||
"version": "v1.0.11",
|
||||
"version_normalized": "1.0.11.0",
|
||||
"version": "v1.0.12",
|
||||
"version_normalized": "1.0.12.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/top-think/think-installer.git",
|
||||
"reference": "4c6e1ebecd1afce3f4ccc47e147d61bbe1bf641d"
|
||||
"reference": "1be326e68f63de4e95977ed50f46ae75f017556d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://files.phpcomposer.com/files/top-think/think-installer/4c6e1ebecd1afce3f4ccc47e147d61bbe1bf641d.zip",
|
||||
"reference": "4c6e1ebecd1afce3f4ccc47e147d61bbe1bf641d",
|
||||
"url": "https://files.phpcomposer.com/files/top-think/think-installer/1be326e68f63de4e95977ed50f46ae75f017556d.zip",
|
||||
"reference": "1be326e68f63de4e95977ed50f46ae75f017556d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -20,7 +20,7 @@
|
||||
"require-dev": {
|
||||
"composer/composer": "1.0.*@dev"
|
||||
},
|
||||
"time": "2016-12-01 09:08:45",
|
||||
"time": "2017-05-27T06:58:09+00:00",
|
||||
"type": "composer-plugin",
|
||||
"extra": {
|
||||
"class": "think\\composer\\Plugin"
|
||||
@ -60,7 +60,7 @@
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"time": "2017-05-10 07:41:59",
|
||||
"time": "2017-05-10T07:41:59+00:00",
|
||||
"type": "project",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -100,7 +100,7 @@
|
||||
"phpunit/phpunit": "~4.0",
|
||||
"squizlabs/php_codesniffer": "~2.3"
|
||||
},
|
||||
"time": "2016-11-18 02:57:31",
|
||||
"time": "2016-11-18T02:57:31+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -149,7 +149,7 @@
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"time": "2017-03-22 10:03:27",
|
||||
"time": "2017-03-22T10:03:27+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -194,7 +194,7 @@
|
||||
"phpunit/phpunit": "4.8.*",
|
||||
"sebastian/phpcpd": "2.*"
|
||||
},
|
||||
"time": "2017-05-20 10:43:04",
|
||||
"time": "2017-05-20T10:43:04+00:00",
|
||||
"type": "think-framework",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -235,7 +235,7 @@
|
||||
"reference": "0c55455df26a1626a60d0dc35d2d89002b741d44",
|
||||
"shasum": ""
|
||||
},
|
||||
"time": "2016-07-06 01:47:11",
|
||||
"time": "2016-07-06T01:47:11+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -273,7 +273,7 @@
|
||||
"reference": "fc552c8fe5798679a52f4f0d7e60763f64aeb155",
|
||||
"shasum": ""
|
||||
},
|
||||
"time": "2017-05-05 07:52:33",
|
||||
"time": "2017-05-05T07:52:33+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -309,7 +309,7 @@
|
||||
"reference": "0c99dc625b0d2d4124e1b6ca15a3ad6f0125963f",
|
||||
"shasum": ""
|
||||
},
|
||||
"time": "2017-04-05 07:15:37",
|
||||
"time": "2017-04-05T07:15:37+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -351,7 +351,7 @@
|
||||
"topthink/think-helper": ">=1.0.4",
|
||||
"topthink/think-installer": ">=1.0.10"
|
||||
},
|
||||
"time": "2017-02-28 08:07:37",
|
||||
"time": "2017-02-28T08:07:37+00:00",
|
||||
"type": "think-extend",
|
||||
"extra": {
|
||||
"think-config": {
|
||||
@ -381,27 +381,27 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/options-resolver",
|
||||
"version": "v3.2.8",
|
||||
"version_normalized": "3.2.8.0",
|
||||
"version": "v3.3.0",
|
||||
"version_normalized": "3.3.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/options-resolver.git",
|
||||
"reference": "8cbb4f23414e2a5e92690cf67680a979a461113c"
|
||||
"reference": "ff48982d295bcac1fd861f934f041ebc73ae40f0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://files.phpcomposer.com/files/symfony/options-resolver/8cbb4f23414e2a5e92690cf67680a979a461113c.zip",
|
||||
"reference": "8cbb4f23414e2a5e92690cf67680a979a461113c",
|
||||
"url": "https://files.phpcomposer.com/files/symfony/options-resolver/ff48982d295bcac1fd861f934f041ebc73ae40f0.zip",
|
||||
"reference": "ff48982d295bcac1fd861f934f041ebc73ae40f0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"time": "2017-04-12 14:13:17",
|
||||
"time": "2017-04-12T14:14:56+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.2-dev"
|
||||
"dev-master": "3.3-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
@ -462,7 +462,7 @@
|
||||
"symfony/framework-bundle": "^2.3|^3.0",
|
||||
"symfony/http-kernel": "^2.3|^3.0"
|
||||
},
|
||||
"time": "2017-04-08 09:13:59",
|
||||
"time": "2017-04-08T09:13:59+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
@ -519,7 +519,7 @@
|
||||
"phpunit/phpunit": "~4.0",
|
||||
"satooshi/php-coveralls": "~1.0"
|
||||
},
|
||||
"time": "2017-04-25 09:15:12",
|
||||
"time": "2017-04-25T09:15:12+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
|
@ -27,7 +27,7 @@
|
||||
"minimum-stability": "dev",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.2-dev"
|
||||
"dev-master": "3.3-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,12 +2,21 @@
|
||||
|
||||
namespace think\composer;
|
||||
|
||||
use Composer\Package\PackageInterface;
|
||||
use Composer\Installer\LibraryInstaller;
|
||||
use Composer\Package\PackageInterface;
|
||||
use Composer\Repository\InstalledRepositoryInterface;
|
||||
|
||||
class ThinkFramework extends LibraryInstaller
|
||||
{
|
||||
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
|
||||
{
|
||||
parent::install($repo, $package);
|
||||
if ($this->composer->getPackage()->getType() == 'project' && $package->getInstallationSource() != 'source') {
|
||||
//remove tests dir
|
||||
$this->filesystem->removeDirectory($this->getInstallPath($package) . DIRECTORY_SEPARATOR . 'tests');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@ -31,19 +40,10 @@ class ThinkFramework extends LibraryInstaller
|
||||
return 'thinkphp';
|
||||
}
|
||||
|
||||
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
|
||||
{
|
||||
parent::install($repo, $package);
|
||||
if ($this->composer->getPackage()->getType() == 'project') {
|
||||
//remove tests dir
|
||||
$this->filesystem->removeDirectory($this->getInstallPath($package) . DIRECTORY_SEPARATOR . 'tests');
|
||||
}
|
||||
}
|
||||
|
||||
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
|
||||
{
|
||||
parent::update($repo, $initial, $target);
|
||||
if ($this->composer->getPackage()->getType() == 'project') {
|
||||
if ($this->composer->getPackage()->getType() == 'project' && $target->getInstallationSource() != 'source') {
|
||||
//remove tests dir
|
||||
$this->filesystem->removeDirectory($this->getInstallPath($target) . DIRECTORY_SEPARATOR . 'tests');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user