本文整理汇总了PHP中OSC\OM\OSCOM::getSite方法的典型用法代码示例。如果您正苦于以下问题:PHP OSCOM::getSite方法的具体用法?PHP OSCOM::getSite怎么用?PHP OSCOM::getSite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OSC\OM\OSCOM
的用法示例。
在下文中一共展示了OSCOM::getSite方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($site = null)
{
if (!isset($site)) {
$site = OSCOM::getSite();
}
$this->site = basename($site);
}
示例2: loadDefinitions
public function loadDefinitions($group, $language_code = null, $scope = null)
{
$language_code = isset($language_code) && $this->exists($language_code) ? $language_code : $this->get('code');
if (!isset($scope)) {
$scope = 'global';
}
$site = OSCOM::getSite();
if (strpos($group, '/') !== false && preg_match('/^([A-Z][A-Za-z0-9-_]*)\\/(.*)$/', $group, $matches) === 1 && OSCOM::siteExists($matches[1])) {
$site = $matches[1];
$group = $matches[2];
}
$pathname = OSCOM::getConfig('dir_root', $site) . 'includes/languages/' . $this->get('directory', $language_code) . '/' . $group;
// legacy
if (is_file($pathname . '.php')) {
include $pathname . '.php';
return true;
}
$pathname .= '.txt';
if ($language_code != 'en') {
call_user_func([$this, __FUNCTION__], $group, 'en', $scope);
}
$defs = $this->getDefinitions($group, $language_code, $pathname);
$this->injectDefinitions($defs, $scope);
}
示例3: getRouteDestination
public static function getRouteDestination($route = null, $filter_vendor_app = null)
{
if (empty($route)) {
$route = array_keys($_GET);
}
$result = $routes = [];
if (empty($route)) {
return $result;
}
$filter_vendor = $filter_app = null;
if (isset($filter_vendor_app)) {
if (strpos($filter_vendor_app, '\\') !== false) {
list($filter_vendor, $filter_app) = explode('\\', $filter_vendor_app, 2);
} else {
$filter_vendor = $filter_vendor_app;
}
}
$vendor_directory = OSCOM::BASE_DIR . 'OSC/Apps';
if (file_exists($vendor_directory)) {
if ($vdir = new \DirectoryIterator($vendor_directory)) {
foreach ($vdir as $vendor) {
if (!$vendor->isDot() && $vendor->isDir() && (!isset($filter_vendor) || $vendor->getFilename() == $filter_vendor)) {
if ($adir = new \DirectoryIterator($vendor->getPath() . '/' . $vendor->getFilename())) {
foreach ($adir as $app) {
if (!$app->isDot() && $app->isDir() && (!isset($filter_app) || $app->getFilename() == $filter_app) && static::exists($vendor->getFilename() . '\\' . $app->getFilename()) && ($json = static::getInfo($vendor->getFilename() . '\\' . $app->getFilename())) !== false) {
if (isset($json['routes'][OSCOM::getSite()])) {
$routes[$json['vendor'] . '\\' . $json['app']] = $json['routes'][OSCOM::getSite()];
}
}
}
}
}
}
}
}
return call_user_func(['OSC\\Sites\\' . OSCOM::getSite() . '\\' . OSCOM::getSite(), 'resolveRoute'], $route, $routes);
}
示例4: getFile
function getFile($file, $template = null)
{
if (!isset($template)) {
$template = $this->getCode();
}
return OSCOM::BASE_DIR . 'Sites/' . OSCOM::getSite() . '/Templates/' . $template . '/' . $file;
}