本文整理汇总了PHP中OC_App::isAppLoaded方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_App::isAppLoaded方法的具体用法?PHP OC_App::isAppLoaded怎么用?PHP OC_App::isAppLoaded使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_App
的用法示例。
在下文中一共展示了OC_App::isAppLoaded方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadRoutes
/**
* Loads the routes
*
* @param null|string $app
*/
public function loadRoutes($app = null)
{
if (is_string($app)) {
$app = \OC_App::cleanAppId($app);
}
$requestedApp = $app;
if ($this->loaded) {
return;
}
if (is_null($app)) {
$this->loaded = true;
$routingFiles = $this->getRoutingFiles();
} else {
if (isset($this->loadedApps[$app])) {
return;
}
$file = \OC_App::getAppPath($app) . '/appinfo/routes.php';
if ($file !== false && file_exists($file)) {
$routingFiles = [$app => $file];
} else {
$routingFiles = [];
}
}
\OC::$server->getEventLogger()->start('loadroutes' . $requestedApp, 'Loading Routes');
foreach ($routingFiles as $app => $file) {
if (!isset($this->loadedApps[$app])) {
if (!\OC_App::isAppLoaded($app)) {
// app MUST be loaded before app routes
// try again next time loadRoutes() is called
$this->loaded = false;
continue;
}
$this->loadedApps[$app] = true;
$this->useCollection($app);
$this->requireRouteFile($file, $app);
$collection = $this->getCollection($app);
$collection->addPrefix('/apps/' . $app);
$this->root->addCollection($collection);
}
}
if (!isset($this->loadedApps['core'])) {
$this->loadedApps['core'] = true;
$this->useCollection('root');
require_once __DIR__ . '/../../../settings/routes.php';
require_once __DIR__ . '/../../../core/routes.php';
}
if ($this->loaded) {
// include ocs routes, must be loaded last for /ocs prefix
require_once __DIR__ . '/../../../ocs/routes.php';
$collection = $this->getCollection('ocs');
$collection->addPrefix('/ocs');
$this->root->addCollection($collection);
}
\OC::$server->getEventLogger()->end('loadroutes' . $requestedApp);
}