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


PHP Application::getPersonalRoot方法代碼示例

本文整理匯總了PHP中Bitrix\Main\Application::getPersonalRoot方法的典型用法代碼示例。如果您正苦於以下問題:PHP Application::getPersonalRoot方法的具體用法?PHP Application::getPersonalRoot怎麽用?PHP Application::getPersonalRoot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Bitrix\Main\Application的用法示例。


在下文中一共展示了Application::getPersonalRoot方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: UnInstallFiles

 function UnInstallFiles()
 {
     $rootDir = Application::getDocumentRoot() . '/' . Application::getPersonalRoot();
     $adminGatewayFile = '/admin/ws_tools.php';
     unlink($rootDir . $adminGatewayFile);
     return true;
 }
開發者ID:Under5,項目名稱:bitrix-module-tools,代碼行數:7,代碼來源:index.php

示例2: UnInstallFiles

 public function UnInstallFiles()
 {
     $files = array('js' => '/js/' . $this->MODULE_ID, 'img' => '/images/' . $this->MODULE_ID, 'request' => '/tools/' . $this->MODULE_ID);
     $rootDir = Application::getDocumentRoot() . '/' . ltrim(Application::getPersonalRoot(), '/');
     foreach ($files as $file) {
         Directory::deleteDirectory($rootDir . $file);
     }
 }
開發者ID:askew-,項目名稱:bitrix-typograf,代碼行數:8,代碼來源:index.php

示例3: getCurrentTemplateId

 public static function getCurrentTemplateId($siteId)
 {
     $cacheFlags = Config\Configuration::getValue("cache_flags");
     $ttl = isset($cacheFlags["site_template"]) ? $cacheFlags["site_template"] : 0;
     $connection = Application::getConnection();
     $sqlHelper = $connection->getSqlHelper();
     $field = $connection->getType() === "mysql" ? "`CONDITION`" : "CONDITION";
     $path2templates = IO\Path::combine(Application::getDocumentRoot(), Application::getPersonalRoot(), "templates");
     if ($ttl === false) {
         $sql = "\n\t\t\t\tSELECT " . $field . ", TEMPLATE\n\t\t\t\tFROM b_site_template\n\t\t\t\tWHERE SITE_ID = '" . $sqlHelper->forSql($siteId) . "'\n\t\t\t\tORDER BY IF(LENGTH(" . $field . ") > 0, 1, 2), SORT\n\t\t\t\t";
         $recordset = $connection->query($sql);
         while ($record = $recordset->fetch()) {
             $condition = trim($record["CONDITION"]);
             if ($condition != '' && !@eval("return " . $condition . ";")) {
                 continue;
             }
             if (IO\Directory::isDirectoryExists($path2templates . "/" . $record["TEMPLATE"])) {
                 return $record["TEMPLATE"];
             }
         }
     } else {
         $managedCache = Application::getInstance()->getManagedCache();
         if ($managedCache->read($ttl, "b_site_template")) {
             $arSiteTemplateBySite = $managedCache->get("b_site_template");
         } else {
             $arSiteTemplateBySite = array();
             $sql = "\n\t\t\t\t\tSELECT " . $field . ", TEMPLATE, SITE_ID\n\t\t\t\t\tFROM b_site_template\n\t\t\t\t\tWHERE SITE_ID = '" . $sqlHelper->forSql($siteId) . "'\n\t\t\t\t\tORDER BY SITE_ID, IF(LENGTH(" . $field . ") > 0, 1, 2), SORT\n\t\t\t\t\t";
             $recordset = $connection->query($sql);
             while ($record = $recordset->fetch()) {
                 $arSiteTemplateBySite[$record['SITE_ID']][] = $record;
             }
             $managedCache->set("b_site_template", $arSiteTemplateBySite);
         }
         if (is_array($arSiteTemplateBySite[$siteId])) {
             foreach ($arSiteTemplateBySite[$siteId] as $record) {
                 $condition = trim($record["CONDITION"]);
                 if ($condition != '' && !@eval("return " . $condition . ";")) {
                     continue;
                 }
                 if (IO\Directory::isDirectoryExists($path2templates . "/" . $record["TEMPLATE"])) {
                     return $record["TEMPLATE"];
                 }
             }
         }
     }
     return ".default";
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:47,代碼來源:sitetemplate.php

示例4: initCache

 public function initCache($TTL, $uniqueString, $initDir = false, $baseDir = "cache")
 {
     if ($initDir === false) {
         $request = Main\Context::getCurrent()->getRequest();
         $initDir = $request->getRequestedPageDirectory();
     }
     $personalRoot = Main\Application::getPersonalRoot();
     $this->baseDir = $personalRoot . "/" . $baseDir . "/";
     $this->initDir = $initDir;
     $this->filename = "/" . $this->getPath($uniqueString);
     $this->TTL = $TTL;
     $this->uniqueString = $uniqueString;
     $this->vars = false;
     if ($TTL <= 0) {
         return false;
     }
     if (static::shouldClearCache()) {
         return false;
     }
     $arAllVars = array("CONTENT" => "", "VARS" => "");
     if (!$this->cacheEngine->read($arAllVars, $this->baseDir, $this->initDir, $this->filename, $this->TTL)) {
         return false;
     }
     if (static::$showCacheStat) {
         $read = 0;
         $path = '';
         if ($this->cacheEngine instanceof ICacheEngineStat) {
             $read = $this->cacheEngine->getReadBytes();
             $path = $this->cacheEngine->getCachePath();
         } elseif ($this->cacheEngine instanceof \ICacheBackend) {
             /** @noinspection PhpUndefinedFieldInspection */
             $read = $this->cacheEngine->read;
             /** @noinspection PhpUndefinedFieldInspection */
             $path = $this->cacheEngine->path;
         }
         Diag\CacheTracker::addCacheStatBytes($read);
         Diag\CacheTracker::add($read, $path, $this->baseDir, $this->initDir, $this->filename, "R");
     }
     $this->content = $arAllVars["CONTENT"];
     $this->vars = $arAllVars["VARS"];
     return true;
 }
開發者ID:ASDAFF,項目名稱:entask.ru,代碼行數:42,代碼來源:cache.php

示例5: getDbConnConnectionParameters

 private function getDbConnConnectionParameters()
 {
     /* Old kernel code for compatibility */
     global $DBType, $DBDebug, $DBDebugToFile, $DBHost, $DBName, $DBLogin, $DBPassword, $DBSQLServerType;
     require_once Main\Application::getDocumentRoot() . Main\Application::getPersonalRoot() . "/php_interface/dbconn.php";
     $DBType = strtolower($DBType);
     if ($DBType == 'mysql') {
         $className = "\\Bitrix\\Main\\DB\\MysqlConnection";
     } elseif ($DBType == 'mssql') {
         $className = "\\Bitrix\\Main\\DB\\MssqlConnection";
     } else {
         $className = "\\Bitrix\\Main\\DB\\OracleConnection";
     }
     return array('className' => $className, 'host' => $DBHost, 'database' => $DBName, 'login' => $DBLogin, 'password' => $DBPassword, 'options' => (!defined("DBPersistent") || DBPersistent ? Main\DB\Connection::PERSISTENT : 0) | (defined("DELAY_DB_CONNECT") && DELAY_DB_CONNECT === true ? Main\DB\Connection::DEFERRED : 0));
 }
開發者ID:spas-viktor,項目名稱:books,代碼行數:15,代碼來源:connectionpool.php

示例6: includeConfiguration

 /**
  * Reads the configuration.
  *
  * @return array
  */
 public function includeConfiguration()
 {
     if (!isset($this->options)) {
         $arHTMLPagesOptions = array();
         $configurationPath = Main\IO\Path::convertRelativeToAbsolute(Main\Application::getPersonalRoot() . "/html_pages/.config.php");
         if (file_exists($configurationPath)) {
             include $configurationPath;
         }
         $this->options = $arHTMLPagesOptions;
     }
     return $this->options;
 }
開發者ID:spas-viktor,項目名稱:books,代碼行數:17,代碼來源:statichtmlcache.php

示例7: initCache

 public function initCache($TTL, $uniqueString, $initDir = false, $baseDir = "cache")
 {
     if ($initDir === false) {
         $request = \Bitrix\Main\Context::getCurrent()->getRequest();
         $initDir = $request->getRequestedPageDirectory();
     }
     $personalRoot = \Bitrix\Main\Application::getPersonalRoot();
     $this->baseDir = \Bitrix\Main\IO\Path::combine($personalRoot, $baseDir);
     $this->initDir = $initDir;
     $this->filename = $this->getPath($uniqueString);
     $this->TTL = $TTL;
     $this->uniqueString = $uniqueString;
     $this->vars = false;
     if ($TTL <= 0) {
         return false;
     }
     if ($this->getClearCache()) {
         return false;
     }
     $arAllVars = array("CONTENT" => "", "VARS" => "");
     if (!$this->cacheEngine->read($arAllVars, $this->baseDir, $this->initDir, $this->filename, $this->TTL)) {
         return false;
     }
     $this->content = $arAllVars["CONTENT"];
     $this->vars = $arAllVars["VARS"];
     return true;
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:27,代碼來源:cache.php

示例8: __construct

 public function __construct($cacheKey, array $configuration, array $htmlCacheOptions)
 {
     parent::__construct($cacheKey, $configuration, $htmlCacheOptions);
     $this->cacheFile = new Main\IO\File(Main\IO\Path::convertRelativeToAbsolute(Main\Application::getPersonalRoot() . "/html_pages" . $this->cacheKey));
 }
開發者ID:rasuldev,項目名稱:torino,代碼行數:5,代碼來源:statichtmlfilestorage.php

示例9: baseDir

 /**
  * @return string
  */
 private function baseDir()
 {
     $personalRoot = Application::getPersonalRoot();
     return $personalRoot . "/" . $this->bxBaseDir . "/";
 }
開發者ID:Under5,項目名稱:bitrix-module-tools,代碼行數:8,代碼來源:cache.php


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