本文整理汇总了PHP中ClassLoader::getClassNames方法的典型用法代码示例。如果您正苦于以下问题:PHP ClassLoader::getClassNames方法的具体用法?PHP ClassLoader::getClassNames怎么用?PHP ClassLoader::getClassNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClassLoader
的用法示例。
在下文中一共展示了ClassLoader::getClassNames方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: writeContextCache
public function writeContextCache()
{
if ($this->clearedContextFiles == true) {
return;
}
if ($this->writeCache == false) {
return;
}
$contextFile = $this->getContextCacheFile();
// error_log('Wrote context cache');
$cacheContents = '<?php
$this->plugins = ' . var_export($this->plugins, true) . ';
ClassLoader::setClassNames(' . var_export(ClassLoader::getClassNames(), true) . ');
$this->context = ' . var_export($this->context, true) . ';
$this->aliasMap = ' . var_export($this->aliasMap, true) . ';
$this->events = ' . var_export($this->contextEvents, true) . ';
$this->pluginDirectories = ' . var_export($this->pluginDirectories, true) . ';
$this->enabledPluginDirectories = ' . var_export($this->enabledPluginDirectories, true) . ';';
$cacheContents .= "\n\n";
foreach ($this->plugins as $plugin) {
if (!empty($plugin['directory'])) {
$const = $this->getPluginConstant($plugin);
$cacheContents .= "if(defined(\"{$const}\") === FALSE) define(\"{$const}\",\"{$plugin['directory']}\");\n";
}
}
$cacheContents .= "return true;";
ContextUtils::safeFilePutContents($contextFile, $cacheContents);
}