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


PHP Creole::import方法代碼示例

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


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

示例1: connect

 /**
  * connect()
  */
 public function connect($dsninfo, $flags = 0)
 {
     if (!($driver = Creole::getDriver($dsninfo['phptype']))) {
         throw new SQLException("No driver has been registered to handle connection type: {$type}");
     }
     $connectionClass = Creole::import($driver);
     $this->childConnection = new $connectionClass();
     $this->log("connect(): DSN: " . var_export($dsninfo, true) . ", FLAGS: " . var_export($flags, true));
     return $this->childConnection->connect($dsninfo, $flags);
 }
開發者ID:rodrigoprestesmachado,項目名稱:whiteboard,代碼行數:13,代碼來源:DebugConnection.php

示例2: connect

 /**
  * @see Connection::connect()
  */
 public function connect($dsninfo, $flags = 0)
 {
     if (!function_exists('odbc_connect')) {
         throw new SQLException('odbc extension not loaded');
     }
     $adapterclass = isset($dsninfo['adapter']) ? $dsninfo['adapter'] : null;
     if (!$adapterclass) {
         $adapterclass = 'ODBCAdapter';
     } else {
         $adapterclass .= 'Adapter';
     }
     Creole::import('creole.drivers.odbc.adapters.' . $adapterclass);
     $this->adapter = new $adapterclass();
     $this->dsn = $dsninfo;
     $this->flags = $flags;
     if (!($this->flags & Creole::COMPAT_ASSOC_LOWER) && !$this->adapter->preservesColumnCase()) {
         trigger_error('Connection created without Creole::COMPAT_ASSOC_LOWER, ' . 'but driver does not support case preservation.', E_USER_WARNING);
         $this->flags != Creole::COMPAT_ASSOC_LOWER;
     }
     $persistent = ($flags & Creole::PERSISTENT) === Creole::PERSISTENT;
     if ($dsninfo['database']) {
         $odbcdsn = $dsninfo['database'];
     } elseif ($dsninfo['hostspec']) {
         $odbcdsn = $dsninfo['hostspec'];
     } else {
         $odbcdsn = 'localhost';
     }
     $user = @$dsninfo['username'];
     $pw = @$dsninfo['password'];
     $connect_function = $persistent ? 'odbc_pconnect' : 'odbc_connect';
     $conn = @$connect_function($odbcdsn, $user, $pw, SQL_CUR_USE_IF_NEEDED);
     if (!is_resource($conn)) {
         throw new SQLException('connect failed', $this->nativeError(), $odbcdsn);
     }
     $this->dblink = $conn;
     /**
      * This prevents blob fields from being fetched when a row is loaded
      * from a recordset. Clob fields however are loaded with up to
      * 'odbc.defaultlrl' data. This should be the default anyway, but we'll
      * set it here just to keep things consistent.
      */
     @odbc_binmode(0, ODBC_BINMODE_PASSTHRU);
     @odbc_longreadlen(0, ini_get('odbc.defaultlrl'));
 }
開發者ID:saiber,項目名稱:www,代碼行數:47,代碼來源:ODBCConnection.php

示例3: connect

 /**
  * @see Connection::connect()
  */
 function connect($dsninfo, $flags = 0)
 {
     $class = Creole::getDriver($dsninfo['phptype']);
     $class = Creole::import($class);
     $this->driver = new $class();
 }
開發者ID:BackupTheBerlios,項目名稱:php5cms-svn,代碼行數:9,代碼來源:MyCatchallConnection.php


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