当前位置: 首页>>代码示例>>PHP>>正文


PHP Loader::getPersonal方法代码示例

本文整理汇总了PHP中Bitrix\Main\Loader::getPersonal方法的典型用法代码示例。如果您正苦于以下问题:PHP Loader::getPersonal方法的具体用法?PHP Loader::getPersonal怎么用?PHP Loader::getPersonal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bitrix\Main\Loader的用法示例。


在下文中一共展示了Loader::getPersonal方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: connectInternal

 /**
  * Establishes a connection to the database.
  * Includes php_interface/after_connect_d7.php on success.
  * Throws exception on failure.
  *
  * @return void
  * @throws \Bitrix\Main\DB\ConnectionException
  */
 protected function connectInternal()
 {
     if ($this->isConnected) {
         return;
     }
     $connectionInfo = array("UID" => $this->login, "PWD" => $this->password, "Database" => $this->database, "ReturnDatesAsStrings" => true);
     if (($this->options & self::PERSISTENT) != 0) {
         $connectionInfo["ConnectionPooling"] = true;
     } else {
         $connectionInfo["ConnectionPooling"] = false;
     }
     $connection = sqlsrv_connect($this->host, $connectionInfo);
     if (!$connection) {
         throw new ConnectionException('MS Sql connect error', $this->getErrorMessage());
     }
     $this->resource = $connection;
     $this->isConnected = true;
     // hide cautions
     sqlsrv_configure("WarningsReturnAsErrors", 0);
     /** @noinspection PhpUnusedLocalVariableInspection */
     global $DB, $USER, $APPLICATION;
     if ($fn = \Bitrix\Main\Loader::getPersonal("php_interface/after_connect_d7.php")) {
         include $fn;
     }
 }
开发者ID:Satariall,项目名称:izurit,代码行数:33,代码来源:mssqlconnection.php

示例2: runInitScripts

 public static function runInitScripts()
 {
     if (($includePath = \Bitrix\Main\Loader::getLocal("init.php")) !== false) {
         require_once $includePath;
     }
     if (($includePath = \Bitrix\Main\Loader::getPersonal("php_interface/init.php")) !== false) {
         require_once $includePath;
     }
     if (($includePath = \Bitrix\Main\Loader::getPersonal("php_interface/" . SITE_ID . "/init.php")) !== false) {
         require_once $includePath;
     }
 }
开发者ID:rasuldev,项目名称:torino,代码行数:12,代码来源:compatiblestrategy.php

示例3: connectInternal

 protected function connectInternal()
 {
     if ($this->isConnected) {
         return;
     }
     $dbHost = $this->dbHost;
     $dbPort = 0;
     if (($pos = strpos($dbHost, ":")) !== false) {
         $dbPort = intval(substr($dbHost, $pos + 1));
         $dbHost = substr($dbHost, 0, $pos);
     }
     if (($this->dbOptions & self::PERSISTENT) != 0) {
         $dbHost = "p:" . $dbHost;
     }
     /** @var $connection \mysqli */
     $connection = \mysqli_init();
     if (!$connection) {
         throw new ConnectionException('Mysql init failed');
     }
     if (!empty($this->dbInitCommand)) {
         if (!$connection->options(MYSQLI_INIT_COMMAND, $this->dbInitCommand)) {
             throw new ConnectionException('Setting mysql init command failed');
         }
     }
     if ($dbPort > 0) {
         $r = $connection->real_connect($dbHost, $this->dbLogin, $this->dbPassword, $this->dbName, $dbPort);
     } else {
         $r = $connection->real_connect($dbHost, $this->dbLogin, $this->dbPassword, $this->dbName);
     }
     if (!$r) {
         throw new ConnectionException('Mysql connect error', sprintf('(%s) %s', $connection->connect_errno, $connection->connect_error));
     }
     $this->resource = $connection;
     $this->isConnected = true;
     // nosql memcached driver
     if (isset($this->configuration['memcache'])) {
         $memcached = \Bitrix\Main\Application::getInstance()->getConnectionPool()->getConnection($this->configuration['memcache']);
         mysqlnd_memcache_set($this->resource, $memcached->getResource());
     }
     //global $DB, $USER, $APPLICATION;
     if ($fn = \Bitrix\Main\Loader::getPersonal("php_interface/after_connect_d7.php")) {
         include $fn;
     }
 }
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:44,代码来源:mysqliconnection.php

示例4: connectInternal

 protected function connectInternal()
 {
     if ($this->isConnected) {
         return;
     }
     if (($this->dbOptions & self::PERSISTENT) != 0) {
         $connection = oci_pconnect($this->dbLogin, $this->dbPassword, $this->dbName);
     } else {
         $connection = oci_connect($this->dbLogin, $this->dbPassword, $this->dbName);
     }
     if (!$connection) {
         throw new ConnectionException('Oracle connect error', $this->getErrorMessage());
     }
     $this->isConnected = true;
     $this->resource = $connection;
     global $DB, $USER, $APPLICATION;
     if ($fn = \Bitrix\Main\Loader::getPersonal("php_interface/after_connect_d7.php")) {
         include $fn;
     }
 }
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:20,代码来源:oracleconnection.php

示例5: connectInternal

 /**
  * Establishes a connection to the database.
  * Includes php_interface/after_connect_d7.php on success.
  * Throws exception on failure.
  *
  * @return void
  * @throws \Bitrix\Main\DB\ConnectionException
  */
 protected function connectInternal()
 {
     if ($this->isConnected) {
         return;
     }
     if (($this->options & self::PERSISTENT) != 0) {
         $connection = oci_pconnect($this->login, $this->password, $this->database);
     } else {
         $connection = oci_new_connect($this->login, $this->password, $this->database);
     }
     if (!$connection) {
         throw new ConnectionException('Oracle connect error', $this->getErrorMessage());
     }
     $this->isConnected = true;
     $this->resource = $connection;
     /** @noinspection PhpUnusedLocalVariableInspection */
     global $DB, $USER, $APPLICATION;
     if ($fn = \Bitrix\Main\Loader::getPersonal("php_interface/after_connect_d7.php")) {
         include $fn;
     }
 }
开发者ID:Satariall,项目名称:izurit,代码行数:29,代码来源:oracleconnection.php

示例6: connectInternal

 protected function connectInternal()
 {
     if ($this->isConnected) {
         return;
     }
     if (($this->dbOptions & self::PERSISTENT) != 0) {
         $connection = mysql_pconnect($this->dbHost, $this->dbLogin, $this->dbPassword);
     } else {
         $connection = mysql_connect($this->dbHost, $this->dbLogin, $this->dbPassword, true);
     }
     if (!$connection) {
         throw new ConnectionException('Mysql connect error', mysql_error());
     }
     if (!mysql_select_db($this->dbName, $connection)) {
         throw new ConnectionException('Mysql select db error', mysql_error($connection));
     }
     $this->resource = $connection;
     $this->isConnected = true;
     if ($fn = \Bitrix\Main\Loader::getPersonal("php_interface/after_connect_d7.php")) {
         include $fn;
     }
 }
开发者ID:spas-viktor,项目名称:books,代码行数:22,代码来源:mysqlconnection.php

示例7: clearCache

 public static function clearCache($full = false, $initDir = "")
 {
     if ($full !== true && $full !== false && $initDir === "" && is_string($full)) {
         $initDir = $full;
         $full = true;
     }
     $res = true;
     if ($full === true) {
         $obCache = static::createInstance();
         $obCache->cleanDir($initDir, "cache");
     }
     $path = Main\Loader::getPersonal("cache" . $initDir);
     if (is_dir($path) && ($handle = opendir($path))) {
         while (($file = readdir($handle)) !== false) {
             if ($file === "." || $file === "..") {
                 continue;
             }
             if (is_dir($path . "/" . $file)) {
                 if (!static::clearCache($full, $initDir . "/" . $file)) {
                     $res = false;
                 } else {
                     @chmod($path . "/" . $file, BX_DIR_PERMISSIONS);
                     //We suppress error handle here because there may be valid cache files in this dir
                     @rmdir($path . "/" . $file);
                 }
             } elseif ($full) {
                 @chmod($path . "/" . $file, BX_FILE_PERMISSIONS);
                 if (!unlink($path . "/" . $file)) {
                     $res = false;
                 }
             } elseif (substr($file, -4) === ".php") {
                 $c = static::createInstance();
                 if ($c->isCacheExpired($path . "/" . $file)) {
                     @chmod($path . "/" . $file, BX_FILE_PERMISSIONS);
                     if (!unlink($path . "/" . $file)) {
                         $res = false;
                     }
                 }
             } else {
                 //We should skip unknown file
                 //it will be deleted with full cache cleanup
             }
         }
         closedir($handle);
     }
     return $res;
 }
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:47,代码来源:cache.php

示例8: runInitScripts

 protected function runInitScripts()
 {
     if (!$this->dispatcher instanceof Dispatcher) {
         throw new \Exception();
     }
     if (($includePath = Loader::getLocal("init_d7.php")) !== false) {
         require_once $includePath;
     }
     if (($includePath = Loader::getPersonal("php_interface/init_d7.php")) !== false) {
         require_once $includePath;
     }
     // константы после init.php
     define("BX_CRONTAB_SUPPORT", defined("BX_CRONTAB"));
     if (!defined("BX_FILE_PERMISSIONS")) {
         define("BX_FILE_PERMISSIONS", 0644);
     }
     if (!defined("BX_DIR_PERMISSIONS")) {
         define("BX_DIR_PERMISSIONS", 0755);
     }
 }
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:20,代码来源:application.php


注:本文中的Bitrix\Main\Loader::getPersonal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。