⚝
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
/
Core
/
Factory
/
View File Name :
DbPear.php
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 */ /** * A Horde_Injector:: based factory for creating PEAR DB objects.. * * Copyright 2010-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 Core * @author Michael Slusarz
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 */ class Horde_Core_Factory_DbPear extends Horde_Core_Factory_Base { /** * Instances. * * @var array */ private $_instances = array(); /** * Return the DB instance. * * @param string $type Either 'read' or 'rw'. * @param string $app The application. * @param mixed $dtype The type. If this is an array, this is used as * the configuration array. * * @return DB The singleton DB instance. * @throws Horde_Exception */ public function create($type = 'rw', $app = 'horde', $dtype = null) { global $registry; $sig = hash('sha1', serialize($type . '|' . $app . '|' . $dtype)); if (isset($this->_instances[$sig])) { return $this->_instances[$sig]; } $pushed = ($app == 'horde') ? false : $registry->pushApp($app); $config = is_array($dtype) ? $dtype : $this->getConfig($dtype); if ($type == 'read' && !empty($config['splitread'])) { $config = array_merge($config, $config['read']); } Horde::assertDriverConfig($config, 'sql', array('charset', 'phptype')); /* Connect to the SQL server using the supplied parameters. */ $db = DB::connect($config, array( 'persistent' => !empty($config['persistent']), 'ssl' => !empty($config['ssl']) )); if ($db instanceof PEAR_Error) { if ($pushed) { $registry->popApp(); } throw new Horde_Exception($db); } // Set DB portability options. $db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS); if ($pushed) { $registry->popApp(); } $this->_instances[$sig] = $db; return $db; } /** */ public function getConfig($type) { return Horde::getDriverConfig($type, 'sql'); } }