⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.78
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
psa-pear
/
pear
/
php
/
Horde
/
Test
/
Factory
/
Edit File: Db.php
<?php /** * Generates test database connectors. * * PHP version 5 * * @category Horde * @package Test * @author Gunnar Wrobel <wrobel@pardus.de> * @license http://www.horde.org/licenses/lgpl21 LGPL * @link http://www.horde.org/components/Horde_Test */ /** * Generates test database connectors. * * Copyright 2011-2017 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.horde.org/licenses/lgpl21. * * @category Horde * @package Test * @author Gunnar Wrobel <wrobel@pardus.de> * @license http://www.horde.org/licenses/lgpl21 LGPL * @link http://www.horde.org/components/Horde_Test */ class Horde_Test_Factory_Db { /** * Create a connector to an in-memory sqlite DB. * * @param array $params Additional options. * <pre> * 'migrations' - (array) An list of migrations that should be run. * Each element must contain the keys 'migrationsPath' * and 'schemaTableName'. * DEFAULT: empty * </pre> * * @return Horde_Db_Adapter_Pdo_Sqlite The DB adapter. */ public function create($params = array()) { if (!extension_loaded('pdo') || !in_array('sqlite', PDO::getAvailableDrivers())) { throw new Horde_Test_Exception('No sqlite extension or no sqlite PDO driver'); } if (!class_exists('Horde_Db_Adapter_Pdo_Sqlite')) { throw new Horde_Test_Exception('The "Horde_Db_Adapter_Pdo_Sqlite" class is unavailable!'); } $db = new Horde_Db_Adapter_Pdo_Sqlite(array('dbname' => ':memory:', 'charset' => 'utf-8')); if (isset($params['migrations'])) { if (isset($params['migrations']['migrationsPath'])) { $migrations = array($params['migrations']); } else { $migrations = $params['migrations']; } foreach ($migrations as $migration) { $migrator = new Horde_Db_Migration_Migrator( $db, null, $migration ); $migrator->up(); } } return $db; } }
Simpan