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


PHP Connection::getConfig方法代碼示例

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


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

示例1: __construct

 public function __construct()
 {
     if (is_null($this->table)) {
         $database = Connection::getConfig($this->connection);
         $this->table = $database['prefix'] . Inflector::underscore(get_class($this));
     }
     $this->loadBehaviors($this->behaviors);
 }
開發者ID:klawdyo,項目名稱:spaghettiphp,代碼行數:8,代碼來源:Model.php

示例2: __construct

 /**
  * 構造方法
  *
  * @param Connection $connection
  * @param string|null $databaseName 數據庫名,默認使用連接中的數據庫
  */
 public function __construct(Connection $connection, $databaseName = null)
 {
     $this->connection = $connection;
     $this->dbConfig = $connection->getConfig();
     if (!$databaseName) {
         $databaseName = $this->dbConfig['dbname'];
     }
     $this->explainSchema($databaseName);
 }
開發者ID:chaoyanjie,項目名稱:MonkeyPHP,代碼行數:15,代碼來源:Schema.php

示例3: install_models

function install_models(Connection $connection, $package, $models)
{
    $factory = RelationFactory::getInstance();
    $factory->prepareRelations($package, $models);
    $models = $factory->getRelations($connection->getConfig()->getType());
    foreach ($models as $model) {
        if (!install_model($connection, $model)) {
            return false;
        }
    }
    return true;
}
開發者ID:exildev,項目名稱:corvus,代碼行數:12,代碼來源:install.php

示例4: array

<?php

Connection::add(array('development' => array('driver' => 'MySql', 'host' => 'localhost', 'user' => 'root', 'password' => '', 'database' => 'spaghetti', 'prefix' => ''), 'production' => array('driver' => 'MySql', 'host' => 'localhost', 'user' => 'root', 'password' => '', 'database' => 'spaghetti', 'prefix' => ''), 'test' => array('driver' => 'MySql', 'host' => 'localhost', 'user' => 'root', 'password' => '', 'database' => 'spaghetti', 'prefix' => '')));
$env = Config::read('App.environment');
Connection::add('default', Connection::getConfig($env));
開發者ID:klawdyo,項目名稱:spaghettiphp,代碼行數:5,代碼來源:connections.example.php

示例5: __construct

 public function __construct(Connection $connection)
 {
     $this->connection = $connection;
     $params = $connection->getConfig();
     parent::__construct($params);
 }
開發者ID:vigm,項目名稱:advancedMD,代碼行數:6,代碼來源:Query.php


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