<commit_before><?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    protected function _initConfig()
    {
        try {
            $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', null, true);
            Zend_Registry::set('config', $config);
        } catch (Exception $e) {
            echo $e->getMessage();
            die('Init config failed.');
        }
    }

    protected function _initLocalDB()
    {
        try {
            $config = Zend_Registry::get('config');
            $dbAdapter = Zend_Db::factory($config->localdb->adapter, $config->localdb->toArray());
            if ($config->localdb->profiler) {
                $dbAdapter->setProfiler($this->_getDbProfileFirebug());
            }
            Zend_Registry::set(Bill_Constant::LOCAL_DB, $dbAdapter);
        } catch (Exception $e) {
            echo $e->getMessage();
            die('Init local db failed.');
        }
    }

    protected function _initAlphaDB()
    {
        try {
            $config = Zend_Registry::get('config');
            $dbAdapter = Zend_Db::factory($config->alphadb->adapter, $config->alphadb->toArray());
            if ($config->localdb->profiler) {
                $dbAdapter->setProfiler($this->_getDbProfileFirebug());
            }
            Zend_Registry::set(Bill_Constant::ALPHA_DB, $dbAdapter);
        } catch (Exception $e) {
            echo $e->getMessage();
            die('Init alpha db failed.');
        }
    }

    protected function _initReleaseDB()
    {
        try {
            $config = Zend_Registry::get('config');
            $dbAdapter = Zend_Db::factory($config->releasedb->adapter, $config->releasedb->toArray());
            if ($config->localdb->profiler) {
                $dbAdapter->setProfiler($this->_getDbProfileFirebug());
            }
            Zend_Registry::set(Bill_Constant::RELEASE_DB, $dbAdapter);
        } catch (Exception $e) {
            echo $e->getMessage();
            die('Init release db failed.');
        }
    }

    protected function _initGetopt()
    {
        if(Bill_Util::isCommandLineInterface() || defined('STDIN')) {
            $opts = new Zend_Console_Getopt(
                array(
                    'index|i' => 'index',
                    'createUser|c' => 'create user',
                    'transferDreamBadData|t' => 'transfer dream & bad data to eject',
                )
            );
            if(isset($opts->index)) {
                $route = new Zend_Controller_Router_Route_Hostname(
                    '',
                    array(<commit_msg>+ fix init db name bug<commit_after><?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    protected function _initConfig()
    {
        try {
            $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', null, true);
            Zend_Registry::set('config', $config);
        } catch (Exception $e) {
            echo $e->getMessage();
            die('Init config failed.');
        }
    }

    protected function _initLocalDB()
    {
        try {
            $config = Zend_Registry::get('config');
            $dbAdapter = Zend_Db::factory($config->localdb->adapter, $config->localdb->toArray());
            if ($config->localdb->profiler) {
                $dbAdapter->setProfiler($this->_getDbProfileFirebug());
            }
            Zend_Registry::set(Bill_Constant::LOCAL_DB, $dbAdapter);
        } catch (Exception $e) {
            echo $e->getMessage();
            die('Init local db failed.');
        }
    }

    protected function _initAlphaDB()
    {
        try {
            $config = Zend_Registry::get('config');
            $dbAdapter = Zend_Db::factory($config->alphadb->adapter, $config->alphadb->toArray());
            if ($config->alphadb->profiler) {
                $dbAdapter->setProfiler($this->_getDbProfileFirebug());
            }
            Zend_Registry::set(Bill_Constant::ALPHA_DB, $dbAdapter);
        } catch (Exception $e) {
            echo $e->getMessage();
            die('Init alpha db failed.');
        }
    }

    protected function _initReleaseDB()
    {
        try {
            $config = Zend_Registry::get('config');
            $dbAdapter = Zend_Db::factory($config->releasedb->adapter, $config->releasedb->toArray());
            if ($config->releasedb->profiler) {
                $dbAdapter->setProfiler($this->_getDbProfileFirebug());
            }
            Zend_Registry::set(Bill_Constant::RELEASE_DB, $dbAdapter);
        } catch (Exception $e) {
            echo $e->getMessage();
            die('Init release db failed.');
        }
    }

    protected function _initGetopt()
    {
        if(Bill_Util::isCommandLineInterface() || defined('STDIN')) {
            $opts = new Zend_Console_Getopt(
                array(
                    'index|i' => 'index',
                    'createUser|c' => 'create user',
                    'transferDreamBadData|t' => 'transfer dream & bad data to eject',
                )
            );
            if(isset($opts->index)) {
                $route = new Zend_Controller_Router_Route_Hostname(
                    '',
                    array(
{'fraction_non_alphanumeric': 0.136999425177237, 'fraction_numerical': 0.0, 'mean_word_length': 1.8744493392070485, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 67, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1747806', 'n_tokens_mistral': 1452, 'n_tokens_neox': 1417, 'n_words': 244}