當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OSCOM::getSite方法代碼示例

本文整理匯總了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);
 }
開發者ID:haraldpdl,項目名稱:oscommerce2,代碼行數:7,代碼來源:Hooks.php

示例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);
 }
開發者ID:haraldpdl,項目名稱:oscommerce2,代碼行數:24,代碼來源:Language.php

示例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);
 }
開發者ID:tiansiyuan,項目名稱:oscommerce2,代碼行數:37,代碼來源:Apps.php

示例4: getFile

 function getFile($file, $template = null)
 {
     if (!isset($template)) {
         $template = $this->getCode();
     }
     return OSCOM::BASE_DIR . 'Sites/' . OSCOM::getSite() . '/Templates/' . $template . '/' . $file;
 }
開發者ID:haraldpdl,項目名稱:oscommerce2,代碼行數:7,代碼來源:osc_template.php


注:本文中的OSC\OM\OSCOM::getSite方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。