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


PHP resource::getAttribute方法代碼示例

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


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

示例1: setDriver

 /**
  * @param \Zend\Db\Adapter\Driver\Sqlsrv\Sqlsrv|\Zend\Db\Adapter\Driver\Pdo\Pdo|resource|\PDO $driver
  * @throws \Zend\Db\Adapter\Exception\InvalidArgumentException
  *
  * @return self
  */
 public function setDriver($driver)
 {
     // handle Zend\Db drivers
     if ($driver instanceof Pdo\Pdo && in_array($driver->getDatabasePlatformName(), ['SqlServer', 'Dblib']) || $driver instanceof \PDO && in_array($driver->getAttribute(\PDO::ATTR_DRIVER_NAME), ['sqlsrv', 'dblib'])) {
         $this->resource = $driver;
         return $this;
     }
     throw new Exception\InvalidArgumentException('$driver must be a Sqlsrv PDO Zend\\Db\\Adapter\\Driver or Sqlsrv PDO instance');
 }
開發者ID:zendframework,項目名稱:zend-db,代碼行數:15,代碼來源:SqlServer.php

示例2: parseProperty

 /**
  * Parses the Property element.
  *
  * The Property element can be a child of either the root XRD
  * element or the Link element
  *
  * @param array &$el the parent JRD element
  */
 private function parseProperty(&$el)
 {
     $type = $this->reader->getAttribute('type');
     if ($this->reader->getAttributeNs('nil', self::XSI_NS)) {
         $value = null;
     } else {
         $value = $this->reader->readString();
     }
     $el[$this->reader->getAttribute('type')] = $value;
     $this->reader->next();
 }
開發者ID:kelvinmo,項目名稱:simplexrd,代碼行數:19,代碼來源:simplexrd.class.php

示例3: __construct

 /**
  * Constructor
  *
  * @param resource $pdooci    PDOOCI connection
  * @param string   $statement sql statement
  *
  * @return Statement $statement created
  */
 public function __construct($pdooci, $statement)
 {
     try {
         $this->_pdooci = $pdooci;
         $this->_con = $pdooci->getConnection();
         $this->_statement = Statement::insertMarks($statement);
         $this->_stmt = \oci_parse($this->_con, $this->_statement);
         $this->_fetch_sty = \PDO::FETCH_BOTH;
         $this->_case = $pdooci->getAttribute(\PDO::ATTR_CASE);
     } catch (\Exception $e) {
         throw new \PDOException($e->getMessage());
     }
 }
開發者ID:taq,項目名稱:pdooci,代碼行數:21,代碼來源:Statement.php

示例4: setDriver

 /**
  * @param \Zend\Db\Adapter\Driver\Sqlsrv\Sqlsrv|\Zend\Db\Adapter\Driver\Pdo\Pdo||resource|\PDO $driver
  * @throws \Zend\Db\Adapter\Exception\InvalidArgumentException
  * @return $this
  */
 public function setDriver($driver)
 {
     // handle Zend_Db drivers
     if ($driver instanceof Pdo\Pdo && $driver->getDatabasePlatformName() == 'Sqlsrv') {
         /** @var $driver \Zend\Db\Adapter\Driver\DriverInterface */
         $this->resource = $driver->getConnection()->getResource();
         return $this;
     }
     // handle
     if ($driver instanceof \PDO && $driver->getAttribute(\PDO::ATTR_DRIVER_NAME) == 'sqlsrv') {
         $this->resource = $driver;
         return $this;
     }
     throw new Exception\InvalidArgumentException('$driver must be a Sqlsrv PDO Zend\\Db\\Adapter\\Driver or Sqlsrv PDO instance');
 }
開發者ID:totolouis,項目名稱:ZF2-Auth,代碼行數:20,代碼來源:SqlServer.php

示例5: catch

 function __construct($db = null)
 {
     if (class_exists('jqGridDB') && $db) {
         $interface = jqGridDB::getInterface();
     } else {
         $interface = 'chartarray';
     }
     $this->conn = $db;
     if ($interface == 'pdo') {
         try {
             $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
             $this->dbtype = $this->conn->getAttribute(PDO::ATTR_DRIVER_NAME);
         } catch (Exception $e) {
         }
     } else {
         $this->dbtype = $interface;
     }
     # Set Default Values
     $this->coptions['credits']['enabled'] = false;
     $this->coptions['chart']['renderTo'] = '';
     $this->coptions['series'] = array();
     $this->i_serie_index = 0;
     $this->jscode = false;
 }
開發者ID:Russell-IO,項目名稱:php-syslog-ng,代碼行數:24,代碼來源:jqChart.php

示例6: createMetaData

 /**
  * Creates a meta data object based on the driver of given connection and
  * $schema name.
  *
  * @param PDO|resource $connection
  * @param string $schema
  * @return PHPUnit_Extensions_Database_DB_IMetaData
  */
 public static function createMetaData($connection, $schema)
 {
     // for PDO use PHPUnit_Extensions_Database_DB_IMetaData
     if ($connection instanceof PDO) {
         $driverName = $connection->getAttribute(PDO::ATTR_DRIVER_NAME);
         // register overloaded classes maps for pdo
         if (isset(self::$metaDataClassMap[$driverName])) {
             $className = self::$metaDataClassMap[$driverName];
             PHPUnit_Extensions_Database_DB_MetaData::registerClassWithDriver($className, $driverName);
         }
         return PHPUnit_Extensions_Database_DB_MetaData::createMetaData($connection, $connection);
     }
     $driverName = 'oracle';
     if (isset(self::$metaDataClassMap[$driverName])) {
         $className = self::$metaDataClassMap[$driverName];
         if ($className instanceof ReflectionClass) {
             return $className->newInstance($connection, $schema);
         } else {
             return self::registerClassWithDriver($className, $driverName)->newInstance($connection, $schema);
         }
     } else {
         throw new Exception("Could not find a meta data driver for {$driverName} driver.");
     }
 }
開發者ID:cwcw,項目名稱:cms,代碼行數:32,代碼來源:MetaData.php

示例7: getServerInfo

 /**
  *   Gets the mysql client info in period (.) delimited
  */
 public function getServerInfo()
 {
     return $this->connection->getAttribute(PDO::ATTR_SERVER_VERSION);
 }
開發者ID:mvnp,項目名稱:Simple-MVC-Framework,代碼行數:7,代碼來源:Database.class.php

示例8: getDatabaseServer

 /**
  * Get the database server, namely mysql, pgsql, or mssql.
  * @return string
  */
 public function getDatabaseServer()
 {
     return $this->dbConn->getAttribute(PDO::ATTR_DRIVER_NAME);
 }
開發者ID:racontemoi,項目名稱:shibuichi,代碼行數:8,代碼來源:PDODatabase.php


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