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


PHP static::_connection方法代码示例

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


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

示例1: MockDocumentSource

 public static function &connection()
 {
     if (!static::$_connection) {
         static::$_connection = new MockDocumentSource();
     }
     return static::$_connection;
 }
开发者ID:EHER,项目名称:monopolis,代码行数:7,代码来源:MockDocumentPost.php

示例2: _init

 public static function _init()
 {
     \Config::load('debtsolv', 'debtsolv');
     static::$_debtsolv_database = \Config::get('debtsolv.debtsolv_database', static::$_debtsolv_database);
     static::$_leadpool_database = \Config::get('debtsolv.leadpool_database', static::$_leadpool_database);
     static::$_connection = \Database_Connection::instance('Debtsolv', \Config::get('debtsolv.connection', static::$_connection));
 }
开发者ID:ClixLtd,项目名称:pccupload,代码行数:7,代码来源:debtsolv.php

示例3: connection

 /**
  * Named connection getter/setter
  */
 public static function connection($connection = null)
 {
     if (null !== $connection) {
         static::$_connection = $connection;
         return $this;
     }
     return static::$_connection;
 }
开发者ID:vlucas,项目名称:spot,代码行数:11,代码来源:Entity.php

示例4: _init

 /**
  * init the class
  */
 public static function _init()
 {
     // auth config
     \Config::load('ormauth', true);
     // set the connection this model should use
     static::$_connection = \Config::get('ormauth.db_connection');
     // set the models table name
     static::$_table_name = \Config::get('ormauth.table_name', 'users') . '_user_permissions';
 }
开发者ID:marietta-adachi,项目名称:website,代码行数:12,代码来源:userpermission.php

示例5: _init

 /**
  * init the class
  */
 public static function _init()
 {
     // auth config
     \Config::load('ormauth', true);
     // set the connection this model should use
     static::$_connection = \Config::get('ormauth.db_connection');
     // set the write connection this model should use
     static::$_write_connection = \Config::get('ormauth.db_write_connection') ?: static::$_connection;
     // set the models table name
     static::$_table_name = \Config::get('ormauth.table_name', 'users') . '_providers';
 }
开发者ID:socialskeptic,项目名称:sainsburys,代码行数:14,代码来源:provider.php

示例6: forge

 public static function forge($companyID = 0, $clientID = 0)
 {
     // -- Set the database name
     // ------------------------
     $Database = Database::connect((int) $companyID);
     static::$databaseName = $Database->debtsolvDBName();
     static::$_connection = $Database->connection();
     // -- Set the Client ID
     // --------------------
     static::$clientID = (int) $clientID;
     static::$_companyID = (int) $companyID;
 }
开发者ID:ClixLtd,项目名称:pccupload,代码行数:12,代码来源:debtsolv.php

示例7: _init

 /**
  * init the class
  */
 public static function _init()
 {
     // auth config
     \Config::load('ormauth', true);
     // set the connection this model should use
     static::$_connection = \Config::get('ormauth.db_connection');
     // set the models table name
     static::$_table_name = \Config::get('ormauth.table_name', 'users') . '_groups';
     // set the relations through table names
     static::$_many_many['roles']['table_through'] = \Config::get('ormauth.table_name', 'users') . '_group_roles';
     static::$_many_many['permissions']['table_through'] = \Config::get('ormauth.table_name', 'users') . '_group_permissions';
     // model language file
     \Lang::load('auth_model_group', true);
 }
开发者ID:marietta-adachi,项目名称:website,代码行数:17,代码来源:group.php

示例8: connect

 public function connect()
 {
     try {
         static::$_oauth = new OAuth(static::$_defaults['consumer_key'], static::$_defaults['consumer_secret'], OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI);
         static::$_oauth->enableDebug();
         static::$_oauth->enableSSLChecks();
         static::$_oauth->setToken(static::$_defaults['token'], static::$_defaults['token_secret']);
         //make a simple request to trythe connection
         static::$_oauth->fetch(static::$_defaults['info_info_api_url']);
         static::$_connection = true;
     } catch (OAuthException $E) {
         static::setErrot($E->lastResponse, $E->getCode());
         static::$_connection = false;
     }
     return static::$_connection;
 }
开发者ID:guoyu07,项目名称:admin-biarq-com,代码行数:16,代码来源:UbuntuOne.php

示例9: connection

 /**
  * Fetch the database connection name to use
  *
  * @param	bool	if true return the writeable connection (if set)
  * @return  null|string
  */
 public static function connection($writeable = false)
 {
     // if in tracsaction, conection force to be writable.
     if (\DB::in_transaction()) {
         $writeable = true;
     }
     if ($writeable) {
         if (empty(static::$_write_connection)) {
             static::$_write_connection = static::get_write_connection_default();
         }
         return static::$_write_connection;
     }
     if (empty(static::$_connection)) {
         static::$_connection = static::get_read_connection_default();
     }
     return static::$_connection;
 }
开发者ID:uzura8,项目名称:flockbird,代码行数:23,代码来源:model.php

示例10: _init

 /**
  * Static constructor called by autoloader
  */
 public static function _init()
 {
     $config = \Config::load('tinychimp');
     if (empty($config['api_key'])) {
         throw new \FuelException('API key not specified.');
     }
     static::$api_key = $config['api_key'];
     static::$secure_connection = is_bool($config['secure']) ? $config['secure'] : false;
     static::$timeout = is_integer($config['timeout']) ? $config['timeout'] : 300;
     static::$api_url = empty($config['api_url']) ? static::get_api_url() : $config['api_url'];
     $connection = curl_init();
     curl_setopt_array($connection, array(CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => static::$timeout, CURLOPT_POST => true));
     if (static::$secure_connection) {
         curl_setopt_array($connection, array(CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => true, CURLOPT_PORT => 443));
     }
     static::$_connection = $connection;
 }
开发者ID:EdgeCommerce,项目名称:edgecommerce,代码行数:20,代码来源:tinychimp.php

示例11: _init

 /**
  * init the class
  */
 public static function _init()
 {
     // auth config
     \Config::load('ormauth', true);
     // set the connection this model should use
     static::$_connection = \Config::get('ormauth.db_connection');
     // set the write connection this model should use
     static::$_connection = \Config::get('ormauth.db_write_connection');
     // set the models table name
     static::$_table_name = \Config::get('ormauth.table_name', 'users') . '_roles';
     // set the relations through table names
     static::$_many_many['users']['table_through'] = \Config::get('ormauth.table_name', 'users') . '_user_roles';
     static::$_many_many['groups']['table_through'] = \Config::get('ormauth.table_name', 'users') . '_group_roles';
     static::$_many_many['permissions']['table_through'] = \Config::get('ormauth.table_name', 'users') . '_role_permissions';
     // model language file
     \Lang::load('auth_model_role', true);
     // set the filter options from the language file
     static::$_properties['filter']['form']['options'] = \Lang::get('auth_model_role.permissions');
 }
开发者ID:takawasitobi,项目名称:pembit,代码行数:22,代码来源:role.php

示例12: setDatabaseConnection

 /**
  * Get the database name
  * 
  * @author David stansfield
  */
 public static function setDatabaseConnection()
 {
     $Database = Database::connect(static::$_userCentreID);
     static::$_connection = $Database->connection();
     static::$_debtsolvDatabase = $Database->debtsolvDBName();
 }
开发者ID:ClixLtd,项目名称:pccupload,代码行数:11,代码来源:clientarea.php

示例13: setConnectionString

 /**
  * @param string $connectionString
  * @param string $userName
  * @param string $password
  * @param array  $pdoOptions
  *
  * @return void|\PDO
  */
 public static function setConnectionString($connectionString, $userName = null, $password = null, array $pdoOptions = [])
 {
     static::setConnection(null);
     //	If you set a connection string a new connection one is created for you
     if (!empty($connectionString)) {
         static::$_connectionString = $connectionString;
         static::$_connection = new \PDO(static::$_connectionString, $userName, $password, array_merge([\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION], $pdoOptions));
     }
     return static::$_connection;
 }
开发者ID:rajeshpillai,项目名称:php-utils,代码行数:18,代码来源:Sql.php

示例14: set_connection

 /**
  * Sets the write connection to use for this model.
  * @param string $connection
  */
 public static function set_connection($connection)
 {
     static::$_connection = $connection;
 }
开发者ID:le-toan-mulodo,项目名称:UnitTest,代码行数:8,代码来源:model.php

示例15: connection

 /**
  * Gets/sets the connection object to which this model is bound.
  *
  * @param  object $connection The connection instance to set or `null` to get the current one.
  * @return mixed              Returns a connection instance on get.
  */
 public static function connection($connection = null)
 {
     if (func_num_args()) {
         static::$_connection = $connection;
         unset(static::$_definitions[static::class]);
         return;
     }
     return static::$_connection;
 }
开发者ID:crysalead,项目名称:chaos,代码行数:15,代码来源:Model.php


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