芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/libraries.8/vendor/joomla/database/src/DatabaseFactory.php
setDbo($db); } return $o; } /** * Gets an importer class object. * * @param string $name Name of the driver you want an importer for. * @param DatabaseInterface|null $db Optional database driver to inject into the query object. * * @return DatabaseImporter * * @since 1.0 * @throws Exception\UnsupportedAdapterException if there is not a compatible database importer */ public function getImporter(string $name, ?DatabaseInterface $db = null): DatabaseImporter { // Derive the class name from the driver. $class = __NAMESPACE__ . '\\' . ucfirst(strtolower($name)) . '\\' . ucfirst(strtolower($name)) . 'Importer'; // Make sure we have an importer class for this driver. if (!class_exists($class)) { // If it doesn't exist we are at an impasse so throw an exception. throw new Exception\UnsupportedAdapterException('Database importer not found.'); } /** @var $o DatabaseImporter */ $o = new $class; if ($db) { $o->setDbo($db); } return $o; } /** * Get a new iterator on the current query. * * @param string $name Name of the driver you want an iterator for. * @param StatementInterface $statement Statement holding the result set to be iterated. * @param string|null $column An optional column to use as the iterator key. * @param string $class The class of object that is returned. * * @return DatabaseIterator * * @since 2.0.0 */ public function getIterator( string $name, StatementInterface $statement, ?string $column = null, string $class = \stdClass::class ): DatabaseIterator { // Derive the class name from the driver. $iteratorClass = __NAMESPACE__ . '\\' . ucfirst($name) . '\\' . ucfirst($name) . 'Iterator'; // Make sure we have an iterator class for this driver. if (!class_exists($iteratorClass)) { // We can work with the base iterator class so use that $iteratorClass = DatabaseIterator::class; } // Return a new iterator return new $iteratorClass($statement, $column, $class); } /** * Get the current query object or a new Query object. * * @param string $name Name of the driver you want an query object for. * @param DatabaseInterface|null $db Optional database driver to inject into the query object. * * @return QueryInterface * * @since 1.0 * @throws Exception\UnsupportedAdapterException if there is not a compatible database query object */ public function getQuery(string $name, ?DatabaseInterface $db = null): QueryInterface { // Derive the class name from the driver. $class = __NAMESPACE__ . '\\' . ucfirst(strtolower($name)) . '\\' . ucfirst(strtolower($name)) . 'Query'; // Make sure we have a query class for this driver. if (!class_exists($class)) { // If it doesn't exist we are at an impasse so throw an exception. throw new Exception\UnsupportedAdapterException('Database Query class not found'); } return new $class($db); } }