>features[$name] = $feature; return $this; } /** * Setup the default features for Pdo * * @return self Provides a fluent interface */ public function setupDefaultFeatures() { $driverName = $this->connection->getDriverName(); if ($driverName == 'sqlite') { $this->addFeature(null, new Feature\SqliteRowCounter); } elseif ($driverName == 'oci') { $this->addFeature(null, new Feature\OracleRowCounter); } return $this; } /** * Get feature * * @param $name * @return AbstractFeature|false */ public function getFeature($name) { if (isset($this->features[$name])) { return $this->features[$name]; } return false; } /** * Get database platform name * * @param string $nameFormat * @return string */ public function getDatabasePlatformName($nameFormat = self::NAME_FORMAT_CAMELCASE) { $name = $this->getConnection()->getDriverName(); if ($nameFormat == self::NAME_FORMAT_CAMELCASE) { switch ($name) { case 'pgsql': return 'Postgresql'; case 'oci': return 'Oracle'; case 'dblib': case 'sqlsrv': return 'SqlServer'; default: return ucfirst($name); } } else { switch ($name) { case 'sqlite': return 'SQLite'; case 'mysql': return 'MySQL'; case 'pgsql': return 'PostgreSQL'; case 'oci': return 'Oracle'; case 'dblib': case 'sqlsrv': return 'SQLServer'; default: return ucfirst($name); } } } /** * Check environment */ public function checkEnvironment() { if (! extension_loaded('PDO')) { throw new Exception\RuntimeException( 'The PDO extension is required for this adapter but the extension is not loaded' ); } } /** * @return Connection */ public function getConnection() { return $this->connection; } /** * @param string|PDOStatement $sqlOrResource * @return Statement */ public function createStatement($sqlOrResource = null) { $statement = clone $this->statementPrototype; if ($sqlOrResource instanceof PDOStatement) { $statement->setResource($sqlOrResource); } else { if (is_string($sqlOrResource)) { $statement->setSql($sqlOrResource); } if (! $this->connection->isConnected()) { $this->connection->connect(); } $statement->initialize($this->connection->getResource()); } return $statement; } /** * @param resource $resource * @param mixed $context * @return Result */ public function createResult($resource, $context = null) { $result = clone $this->resultPrototype; $rowCount = null; // special feature, sqlite PDO counter if ($this->connection->getDriverName() == 'sqlite' && ($sqliteRowCounter = $this->getFeature('SqliteRowCounter')) && $resource->columnCount() > 0) { $rowCount = $sqliteRowCounter->getRowCountClosure($context); } // special feature, oracle PDO counter if ($this->connection->getDriverName() == 'oci' && ($oracleRowCounter = $this->getFeature('OracleRowCounter')) && $resource->columnCount() > 0) { $rowCount = $oracleRowCounter->getRowCountClosure($context); } $result->initialize($resource, $this->connection->getLastGeneratedValue(), $rowCount); return $result; } /** * @return string */ public function getPrepareType() { return self::PARAMETERIZATION_NAMED; } /** * @param string $name * @param string|null $type * @return string */ public function formatParameterName($name, $type = null) { if ($type === null && ! is_numeric($name) || $type == self::PARAMETERIZATION_NAMED) { $name = ltrim($name, ':'); // @see https://bugs.php.net/bug.php?id=43130 if (preg_match('/[^a-zA-Z0-9_]/', $name)) { throw new Exception\RuntimeException(sprintf( 'The PDO param %s contains invalid characters.' . ' Only alphabetic characters, digits, and underscores (_)' . ' are allowed.', $name )); } return ':' . $name; } return '?'; } /** * @param string|null $name * @return string|null|false */ public function getLastGeneratedValue($name = null) { return $this->connection->getLastGeneratedValue($name); } }
Fatal error: Uncaught Error: Class "Zend\Db\Adapter\Driver\Pdo\Pdo" not found in /hp/be/ad/xp/www/webseiten/pokal/src/Zend/Db/src/Adapter/Adapter.php:324 Stack trace: #0 /hp/be/ad/xp/www/webseiten/pokal/src/Zend/Db/src/Adapter/Adapter.php(84): Zend\Db\Adapter\Adapter->createDriver(Array) #1 /hp/be/ad/xp/www/webseiten/pokal/src/Zend/Db/src/Adapter/AdapterServiceFactory.php(29): Zend\Db\Adapter\Adapter->__construct(Array) #2 /hp/be/ad/xp/www/webseiten/pokal/src/Zend/Db/src/Adapter/AdapterServiceFactory.php(40): Zend\Db\Adapter\AdapterServiceFactory->__invoke(Object(Zend\ServiceManager\ServiceManager), 'Zend\\Db\\Adapter...') #3 [internal function]: Zend\Db\Adapter\AdapterServiceFactory->createService(Object(Zend\ServiceManager\ServiceManager), 'zenddbadapterad...', 'Zend\\Db\\Adapter...') #4 /hp/be/ad/xp/www/webseiten/pokal/src/Zend/ServiceManager/src/ServiceManager.php(934): call_user_func(Array, Object(Zend\ServiceManager\ServiceManager), 'zenddbadapterad...', 'Zend\\Db\\Adapter...') #5 /hp/be/ad/xp/www/webseiten/pokal/src/Zend/ServiceManager/src/ServiceManager.php(1092): Zend\ServiceManager\ServiceManager->createServiceViaCallback(Array, 'zenddbadapterad...', 'Zend\\Db\\Adapter...') #6 /hp/be/ad/xp/www/webseiten/pokal/src/Zend/ServiceManager/src/ServiceManager.php(634): Zend\ServiceManager\ServiceManager->createFromFactory('zenddbadapterad...', 'Zend\\Db\\Adapter...') #7 /hp/be/ad/xp/www/webseiten/pokal/src/Zend/ServiceManager/src/ServiceManager.php(597): Zend\ServiceManager\ServiceManager->doCreate('Zend\\Db\\Adapter...', 'zenddbadapterad...') #8 /hp/be/ad/xp/www/webseiten/pokal/src/Zend/ServiceManager/src/ServiceManager.php(530): Zend\ServiceManager\ServiceManager->create(Array) #9 /hp/be/ad/xp/www/webseiten/pokal/module/Base/Module.php(31): Zend\ServiceManager\ServiceManager->get('Zend\\Db\\Adapter...') #10 [internal function]: Base\Module->onBootstrap(Object(Zend\Mvc\MvcEvent)) #11 /hp/be/ad/xp/www/webseiten/pokal/src/Zend/EventManager/src/EventManager.php(490): call_user_func(Array, Object(Zend\Mvc\MvcEvent)) #12 /hp/be/ad/xp/www/webseiten/pokal/src/Zend/EventManager/src/EventManager.php(248): Zend\EventManager\EventManager->triggerListeners('bootstrap', Object(Zend\Mvc\MvcEvent)) #13 /hp/be/ad/xp/www/webseiten/pokal/src/Zend/Mvc/src/Application.php(169): Zend\EventManager\EventManager->triggerEvent(Object(Zend\Mvc\MvcEvent)) #14 /hp/be/ad/xp/www/webseiten/pokal/src/Zend/Mvc/src/Application.php(281): Zend\Mvc\Application->bootstrap(Array) #15 /hp/be/ad/xp/www/webseiten/pokal/public/index.php(66): Zend\Mvc\Application::init(Array) #16 {main} thrown in /hp/be/ad/xp/www/webseiten/pokal/src/Zend/Db/src/Adapter/Adapter.php on line 324