当前位置: 首页>>代码示例>>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;未经允许,请勿转载。