Commit f9a989fe authored by Klaus Weidenbach's avatar Klaus Weidenbach

Add optimize-autoloader to composer config.

parent b16e4c55
......@@ -56,7 +56,8 @@
},
"minimum-stability" : "stable",
"config" : {
"notify-on-install" : false
"notify-on-install" : false,
"optimize-autoloader" : true
},
"repositories": [{
"type": "vcs",
......
......@@ -2,6 +2,6 @@
// autoload.php @generated by Composer
require_once __DIR__ . '/composer' . '/autoload_real.php';
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit7b34d7e50a62201ec5d5e526a5b8b35d::getLoader();
......@@ -53,8 +53,9 @@ class ClassLoader
private $useIncludePath = false;
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,29 +334,34 @@ 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];
}
if ($this->classMapAuthoritative) {
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');
// Search for Hack files if we are running on HHVM
if ($file === null && defined('HHVM_VERSION')) {
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if ($file === null) {
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
return $this->classMap[$class] = false;
$this->missingClasses[$class] = true;
}
return $file;
......@@ -403,6 +429,8 @@ class ClassLoader
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
return false;
}
}
......
This diff is collapsed.
......@@ -791,12 +791,14 @@ return array(
'Zotlabs\\Module\\Apporder' => $baseDir . '/Zotlabs/Module/Apporder.php',
'Zotlabs\\Module\\Apps' => $baseDir . '/Zotlabs/Module/Apps.php',
'Zotlabs\\Module\\Attach' => $baseDir . '/Zotlabs/Module/Attach.php',
'Zotlabs\\Module\\Authorize' => $baseDir . '/Zotlabs/Module/Authorize.php',
'Zotlabs\\Module\\Authtest' => $baseDir . '/Zotlabs/Module/Authtest.php',
'Zotlabs\\Module\\Block' => $baseDir . '/Zotlabs/Module/Block.php',
'Zotlabs\\Module\\Blocks' => $baseDir . '/Zotlabs/Module/Blocks.php',
'Zotlabs\\Module\\Bookmarks' => $baseDir . '/Zotlabs/Module/Bookmarks.php',
'Zotlabs\\Module\\Branchtopic' => $baseDir . '/Zotlabs/Module/Branchtopic.php',
'Zotlabs\\Module\\Cal' => $baseDir . '/Zotlabs/Module/Cal.php',
'Zotlabs\\Module\\Cdav' => $baseDir . '/Zotlabs/Module/Cdav.php',
'Zotlabs\\Module\\Channel' => $baseDir . '/Zotlabs/Module/Channel.php',
'Zotlabs\\Module\\Chanview' => $baseDir . '/Zotlabs/Module/Chanview.php',
'Zotlabs\\Module\\Chat' => $baseDir . '/Zotlabs/Module/Chat.php',
......@@ -852,6 +854,7 @@ return array(
'Zotlabs\\Module\\Menu' => $baseDir . '/Zotlabs/Module/Menu.php',
'Zotlabs\\Module\\Message' => $baseDir . '/Zotlabs/Module/Message.php',
'Zotlabs\\Module\\Mitem' => $baseDir . '/Zotlabs/Module/Mitem.php',
'Zotlabs\\Module\\Moderate' => $baseDir . '/Zotlabs/Module/Moderate.php',
'Zotlabs\\Module\\Mood' => $baseDir . '/Zotlabs/Module/Mood.php',
'Zotlabs\\Module\\Network' => $baseDir . '/Zotlabs/Module/Network.php',
'Zotlabs\\Module\\New_channel' => $baseDir . '/Zotlabs/Module/New_channel.php',
......@@ -929,6 +932,7 @@ return array(
'Zotlabs\\Module\\Thing' => $baseDir . '/Zotlabs/Module/Thing.php',
'Zotlabs\\Module\\Toggle_mobile' => $baseDir . '/Zotlabs/Module/Toggle_mobile.php',
'Zotlabs\\Module\\Toggle_safesearch' => $baseDir . '/Zotlabs/Module/Toggle_safesearch.php',
'Zotlabs\\Module\\Token' => $baseDir . '/Zotlabs/Module/Token.php',
'Zotlabs\\Module\\Uexport' => $baseDir . '/Zotlabs/Module/Uexport.php',
'Zotlabs\\Module\\Update_channel' => $baseDir . '/Zotlabs/Module/Update_channel.php',
'Zotlabs\\Module\\Update_display' => $baseDir . '/Zotlabs/Module/Update_display.php',
......@@ -985,6 +989,7 @@ return array(
'Zotlabs\\Widget\\Bookmarkedchats' => $baseDir . '/Zotlabs/Widget/Bookmarkedchats.php',
'Zotlabs\\Widget\\Catcloud_wall' => $baseDir . '/Zotlabs/Widget/Catcloud_wall.php',
'Zotlabs\\Widget\\Categories' => $baseDir . '/Zotlabs/Widget/Categories.php',
'Zotlabs\\Widget\\Cdav' => $baseDir . '/Zotlabs/Widget/Cdav.php',
'Zotlabs\\Widget\\Chatroom_list' => $baseDir . '/Zotlabs/Widget/Chatroom_list.php',
'Zotlabs\\Widget\\Chatroom_members' => $baseDir . '/Zotlabs/Widget/Chatroom_members.php',
'Zotlabs\\Widget\\Clock' => $baseDir . '/Zotlabs/Widget/Clock.php',
......@@ -1008,6 +1013,7 @@ return array(
'Zotlabs\\Widget\\Photo' => $baseDir . '/Zotlabs/Widget/Photo.php',
'Zotlabs\\Widget\\Photo_albums' => $baseDir . '/Zotlabs/Widget/Photo_albums.php',
'Zotlabs\\Widget\\Photo_rand' => $baseDir . '/Zotlabs/Widget/Photo_rand.php',
'Zotlabs\\Widget\\Portfolio' => $baseDir . '/Zotlabs/Widget/Portfolio.php',
'Zotlabs\\Widget\\Profile' => $baseDir . '/Zotlabs/Widget/Profile.php',
'Zotlabs\\Widget\\Pubsites' => $baseDir . '/Zotlabs/Widget/Pubsites.php',
'Zotlabs\\Widget\\Random_block' => $baseDir . '/Zotlabs/Widget/Random_block.php',
......
......@@ -23,24 +23,35 @@ class ComposerAutoloaderInit7b34d7e50a62201ec5d5e526a5b8b35d
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit7b34d7e50a62201ec5d5e526a5b8b35d', 'loadClassLoader'));
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$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';
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
call_user_func(\Composer\Autoload\ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->register(true);
$includeFiles = require __DIR__ . '/autoload_files.php';
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire7b34d7e50a62201ec5d5e526a5b8b35d($fileIdentifier, $file);
}
......
......@@ -920,12 +920,14 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Module\\Apporder' => __DIR__ . '/../..' . '/Zotlabs/Module/Apporder.php',
'Zotlabs\\Module\\Apps' => __DIR__ . '/../..' . '/Zotlabs/Module/Apps.php',
'Zotlabs\\Module\\Attach' => __DIR__ . '/../..' . '/Zotlabs/Module/Attach.php',
'Zotlabs\\Module\\Authorize' => __DIR__ . '/../..' . '/Zotlabs/Module/Authorize.php',
'Zotlabs\\Module\\Authtest' => __DIR__ . '/../..' . '/Zotlabs/Module/Authtest.php',
'Zotlabs\\Module\\Block' => __DIR__ . '/../..' . '/Zotlabs/Module/Block.php',
'Zotlabs\\Module\\Blocks' => __DIR__ . '/../..' . '/Zotlabs/Module/Blocks.php',
'Zotlabs\\Module\\Bookmarks' => __DIR__ . '/../..' . '/Zotlabs/Module/Bookmarks.php',
'Zotlabs\\Module\\Branchtopic' => __DIR__ . '/../..' . '/Zotlabs/Module/Branchtopic.php',
'Zotlabs\\Module\\Cal' => __DIR__ . '/../..' . '/Zotlabs/Module/Cal.php',
'Zotlabs\\Module\\Cdav' => __DIR__ . '/../..' . '/Zotlabs/Module/Cdav.php',
'Zotlabs\\Module\\Channel' => __DIR__ . '/../..' . '/Zotlabs/Module/Channel.php',
'Zotlabs\\Module\\Chanview' => __DIR__ . '/../..' . '/Zotlabs/Module/Chanview.php',
'Zotlabs\\Module\\Chat' => __DIR__ . '/../..' . '/Zotlabs/Module/Chat.php',
......@@ -981,6 +983,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Module\\Menu' => __DIR__ . '/../..' . '/Zotlabs/Module/Menu.php',
'Zotlabs\\Module\\Message' => __DIR__ . '/../..' . '/Zotlabs/Module/Message.php',
'Zotlabs\\Module\\Mitem' => __DIR__ . '/../..' . '/Zotlabs/Module/Mitem.php',
'Zotlabs\\Module\\Moderate' => __DIR__ . '/../..' . '/Zotlabs/Module/Moderate.php',
'Zotlabs\\Module\\Mood' => __DIR__ . '/../..' . '/Zotlabs/Module/Mood.php',
'Zotlabs\\Module\\Network' => __DIR__ . '/../..' . '/Zotlabs/Module/Network.php',
'Zotlabs\\Module\\New_channel' => __DIR__ . '/../..' . '/Zotlabs/Module/New_channel.php',
......@@ -1058,6 +1061,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Module\\Thing' => __DIR__ . '/../..' . '/Zotlabs/Module/Thing.php',
'Zotlabs\\Module\\Toggle_mobile' => __DIR__ . '/../..' . '/Zotlabs/Module/Toggle_mobile.php',
'Zotlabs\\Module\\Toggle_safesearch' => __DIR__ . '/../..' . '/Zotlabs/Module/Toggle_safesearch.php',
'Zotlabs\\Module\\Token' => __DIR__ . '/../..' . '/Zotlabs/Module/Token.php',
'Zotlabs\\Module\\Uexport' => __DIR__ . '/../..' . '/Zotlabs/Module/Uexport.php',
'Zotlabs\\Module\\Update_channel' => __DIR__ . '/../..' . '/Zotlabs/Module/Update_channel.php',
'Zotlabs\\Module\\Update_display' => __DIR__ . '/../..' . '/Zotlabs/Module/Update_display.php',
......@@ -1114,6 +1118,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Widget\\Bookmarkedchats' => __DIR__ . '/../..' . '/Zotlabs/Widget/Bookmarkedchats.php',
'Zotlabs\\Widget\\Catcloud_wall' => __DIR__ . '/../..' . '/Zotlabs/Widget/Catcloud_wall.php',
'Zotlabs\\Widget\\Categories' => __DIR__ . '/../..' . '/Zotlabs/Widget/Categories.php',
'Zotlabs\\Widget\\Cdav' => __DIR__ . '/../..' . '/Zotlabs/Widget/Cdav.php',
'Zotlabs\\Widget\\Chatroom_list' => __DIR__ . '/../..' . '/Zotlabs/Widget/Chatroom_list.php',
'Zotlabs\\Widget\\Chatroom_members' => __DIR__ . '/../..' . '/Zotlabs/Widget/Chatroom_members.php',
'Zotlabs\\Widget\\Clock' => __DIR__ . '/../..' . '/Zotlabs/Widget/Clock.php',
......@@ -1137,6 +1142,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Widget\\Photo' => __DIR__ . '/../..' . '/Zotlabs/Widget/Photo.php',
'Zotlabs\\Widget\\Photo_albums' => __DIR__ . '/../..' . '/Zotlabs/Widget/Photo_albums.php',
'Zotlabs\\Widget\\Photo_rand' => __DIR__ . '/../..' . '/Zotlabs/Widget/Photo_rand.php',
'Zotlabs\\Widget\\Portfolio' => __DIR__ . '/../..' . '/Zotlabs/Widget/Portfolio.php',
'Zotlabs\\Widget\\Profile' => __DIR__ . '/../..' . '/Zotlabs/Widget/Profile.php',
'Zotlabs\\Widget\\Pubsites' => __DIR__ . '/../..' . '/Zotlabs/Widget/Pubsites.php',
'Zotlabs\\Widget\\Random_block' => __DIR__ . '/../..' . '/Zotlabs/Widget/Random_block.php',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment