public function __construct() { $config_b8 = array('storage' => 'mysqli'); $conf = get_codo_db_conf(); $config_storage = array('database' => $conf['database'], 'table_name' => 'b8_wordlist', 'host' => $conf['host'], 'user' => $conf['username'], 'pass' => $conf['password']); if ($conf['driver'] == 'mysql') { $this->use = true; } # Tell b8 to use the new-style HTML extractor $config_lexer = array('old_get_html' => FALSE, 'get_html' => TRUE); # Tell the degenerator to use multibyte operations # (needs PHP's mbstring module! If you don't have it, set 'multibyte'to FALSE) $config_degenerator = array('multibyte' => TRUE); if (!self::$b8) { try { self::$b8 = new \b8($config_b8, $config_storage, $config_lexer, $config_degenerator); } catch (\Exception $e) { throw $e; } } }
<?php /* * @CODOLICENSE */ defined('IN_CODOF') or die; $installed = true; function get_codo_db_conf() { $config = array('driver' => 'mysql', 'host' => 'localhost', 'database' => 'if15_janilv', 'username' => 'if15', 'password' => 'ifikad15', 'prefix' => '', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci'); return $config; } $DB = get_codo_db_conf(); $CONF = array('driver' => 'Custom', 'UID' => '5696730fe7cdf', 'SECRET' => '5696730fe80c5', 'PREFIX' => '');
/** * Creates a default connection to codoforum installed database */ protected function createDefaultConnection() { //get default DB configuration $config = \get_codo_db_conf(); $name = $this->defaultConnectionName; $this->connections[$name] = $this->createConnection($config); $this->instances[$name] = $this->getQueryInstance($this->connections[$name], $config); }
if (file_exists(DATA_PATH . 'config.php')) { //contains valuable db information require DATA_PATH . 'config.php'; $container = new Load(); //IoC::setIoCContainer($container); //$container->loadServiceProvider(); if (!$installed) { $r_path = str_replace("index.php", "", $path); header('Location: ' . $r_path . 'install'); } \Constants::post_config($CONF); //contains routing system require ABSPATH . 'sys/Ext/limonade/limonade.php'; require ABSPATH . 'sys/vendor/autoload.php'; $capsule = new Capsule(); $config = get_codo_db_conf(); $capsule->addConnection($config); $capsule->setAsGlobal(); $capsule->bootEloquent(); // $x = $container->make('db')->query('SELECT * FROM codo_config')->fetchAll(); Hook::call('after_config_loaded'); Util::start_session(); //$u = \User::get(); //var_dump($u->id); //exit('hello'); //loads translation system require DATA_PATH . 'locale/lang.php'; require SYSPATH . 'globals/global.php'; //initiate all plugins //Now the plugins can work on the data available $plg = new \CODOF\Plugin();
public function __construct() { $this->db = \DB::getPDO(); $conf = get_codo_db_conf(); $this->isMySQL = in_array($conf['driver'], array('mysql', 'mysqli')); }