当前位置: 首页>>代码示例>>PHP>>正文


PHP PersistenceContext::get_dbms_utils方法代码示例

本文整理汇总了PHP中PersistenceContext::get_dbms_utils方法的典型用法代码示例。如果您正苦于以下问题:PHP PersistenceContext::get_dbms_utils方法的具体用法?PHP PersistenceContext::get_dbms_utils怎么用?PHP PersistenceContext::get_dbms_utils使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PersistenceContext的用法示例。


在下文中一共展示了PersistenceContext::get_dbms_utils方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: build_form

 private function build_form()
 {
     $picture_yes = '<i class="fa fa-success fa-2x" title="' . LangLoader::get_message('yes', 'common') . '"></i>';
     $picture_no = '<i class="fa fa-error fa-2x" title="' . LangLoader::get_message('no', 'common') . '"></i>';
     $picture_unknown = '<i class="fa fa-question fa-2x" title="' . LangLoader::get_message('unknown', 'main') . '"></i>';
     $default_lang_config = LangsManager::get_lang(LangsManager::get_default_lang())->get_configuration();
     $default_theme_config = ThemesManager::get_theme(ThemesManager::get_default_theme())->get_configuration();
     $editors = AppContext::get_content_formatting_service()->get_available_editors();
     $default_editor = $editors[ContentFormattingConfig::load()->get_default_editor()];
     $server_configuration = new ServerConfiguration();
     $general_config = GeneralConfig::load();
     $server_environment_config = ServerEnvironmentConfig::load();
     $sessions_config = SessionsConfig::load();
     $maintenance_config = MaintenanceConfig::load();
     $url_rewriting_available = false;
     $url_rewriting_known = true;
     try {
         $url_rewriting_available = $server_configuration->has_url_rewriting();
     } catch (UnsupportedOperationException $ex) {
         $url_rewriting_known = false;
     }
     $summerization = "---------------------------------System report---------------------------------\n-----------------------------generated by PHPBoost-----------------------------\nSERVER CONFIGURATION-----------------------------------------------------------\nphp version\t\t\t: " . ServerConfiguration::get_phpversion() . "\ndbms version\t\t\t: " . PersistenceContext::get_dbms_utils()->get_dbms_version() . "\ngd library\t\t\t: " . (int) $server_configuration->has_gd_library() . "\nurl rewriting\t\t\t: " . ($url_rewriting_known ? (int) $url_rewriting_available : 'N/A') . "\napcu cache\t\t\t: " . (int) DataStoreFactory::is_apc_available() . "\nPHPBOOST CONFIGURATION---------------------------------------------------------\nphpboost version\t\t: " . Environment::get_phpboost_version() . "\nserver url\t\t\t: " . $general_config->get_site_url() . "\nsite path\t\t\t: " . $general_config->get_site_path() . "\ndefault theme\t\t\t: " . $default_theme_config->get_name() . " (" . LangLoader::get_message('version', 'admin') . " " . $default_theme_config->get_version() . ")\ndefault language\t\t: " . $default_lang_config->get_name() . "\ndefault editor\t\t\t: " . $default_editor . "\nhome page\t\t\t: " . Environment::get_home_page() . "\nurl rewriting\t\t\t: " . (int) $server_environment_config->is_url_rewriting_enabled() . "\napcu cache\t\t\t: " . (int) DataStoreFactory::is_apc_enabled() . "\noutput gzip\t\t\t: " . (int) $server_environment_config->is_output_gziping_enabled() . "\nsession cookie name\t\t: " . $sessions_config->get_cookie_name() . "\nsession duration\t\t: " . $sessions_config->get_session_duration() . "\nactive session duration\t\t: " . $sessions_config->get_active_session_duration() . "\nDIRECTORIES AUTHORIZATIONS-----------------------------------------------------\n";
     $form = new HTMLForm('system-report', '', false);
     $this->get_advises($form);
     $fieldset = new FormFieldsetHTML('report', $this->admin_lang['server']);
     $form->add_fieldset($fieldset);
     $fieldset->add_field(new FormFieldFree('php_version', $this->admin_lang['php_version'], ServerConfiguration::get_phpversion()));
     $fieldset->add_field(new FormFieldFree('dbms_version', $this->admin_lang['dbms_version'], PersistenceContext::get_dbms_utils()->get_dbms_version()));
     $fieldset->add_field(new FormFieldFree('gd_library', $this->admin_lang['gd_library'], $server_configuration->has_gd_library() ? $picture_yes : $picture_no));
     $fieldset->add_field(new FormFieldFree('url_rewriting', $this->admin_lang['url_rewriting'], $url_rewriting_known ? $url_rewriting_available ? $picture_yes : $picture_no : $picture_unknown));
     $fieldset->add_field(new FormFieldFree('apcu_cache', LangLoader::get_message('apcu_cache', 'admin-cache-common'), DataStoreFactory::is_apc_available() ? $picture_yes : $picture_no));
     $fieldset = new FormFieldsetHTML('report', $this->admin_lang['phpboost_config']);
     $form->add_fieldset($fieldset);
     $fieldset->add_field(new FormFieldFree('kernel_version', $this->admin_lang['kernel_version'], Environment::get_phpboost_version()));
     $fieldset->add_field(new FormFieldFree('site_url', LangLoader::get_message('advanced-config.site_url', 'admin-config-common'), $general_config->get_site_url()));
     $fieldset->add_field(new FormFieldFree('site_path', LangLoader::get_message('advanced-config.site_path', 'admin-config-common'), $general_config->get_site_path()));
     $fieldset->add_field(new FormFieldFree('default_theme', LangLoader::get_message('general-config.default_theme', 'admin-config-common'), $default_theme_config->get_name() . " (" . LangLoader::get_message('version', 'admin') . " " . $default_theme_config->get_version() . ")"));
     $fieldset->add_field(new FormFieldFree('default_language', LangLoader::get_message('general-config.default_language', 'admin-config-common'), $default_lang_config->get_name()));
     $fieldset->add_field(new FormFieldFree('default_editor', LangLoader::get_message('content.config.default-formatting-language', 'admin-contents-common'), $default_editor));
     $fieldset->add_field(new FormFieldFree('start_page', LangLoader::get_message('general-config.start_page', 'admin-config-common'), Environment::get_home_page()));
     $fieldset->add_field(new FormFieldFree('phpboost_url_rewriting', $this->admin_lang['url_rewriting'], $server_environment_config->is_url_rewriting_enabled() ? $picture_yes : $picture_no));
     $fieldset->add_field(new FormFieldFree('phpboost_apcu_cache', LangLoader::get_message('apcu_cache', 'admin-cache-common'), DataStoreFactory::is_apc_enabled() ? $picture_yes : $picture_no));
     $fieldset->add_field(new FormFieldFree('output_gz', $this->admin_lang['output_gz'], $server_environment_config->is_output_gziping_enabled() ? $picture_yes : $picture_no));
     $fieldset->add_field(new FormFieldFree('cookie_name', LangLoader::get_message('advanced-config.cookie-name', 'admin-config-common'), $sessions_config->get_cookie_name()));
     $fieldset->add_field(new FormFieldFree('session_length', LangLoader::get_message('advanced-config.cookie-duration', 'admin-config-common'), $sessions_config->get_session_duration()));
     $fieldset->add_field(new FormFieldFree('session_guest_length', LangLoader::get_message('advanced-config.active-session-duration', 'admin-config-common'), $sessions_config->get_active_session_duration()));
     $fieldset = new FormFieldsetHTML('directories_auth', $this->admin_lang['directories_auth']);
     $form->add_fieldset($fieldset);
     $directories_summerization = '';
     foreach (PHPBoostFoldersPermissions::get_permissions() as $key => $folder) {
         $fieldset->add_field(new FormFieldFree(str_replace('/', '_', $key), $key, $folder->is_writable() ? $picture_yes : $picture_no));
         $directories_summerization .= $key . str_repeat('	', 5 - strlen($key) / 8) . ": " . (int) $folder->is_writable() . "\n";
     }
     $fieldset = new FormFieldsetHTML('summerization', $this->admin_lang['system_report_summerization']);
     $form->add_fieldset($fieldset);
     $fieldset->add_field(new FormFieldLabel($this->admin_lang['system_report_summerization_explain']));
     $fieldset->add_field(new FormFieldMultiLineTextEditor('summerization', '', $summerization . $directories_summerization, array('rows' => 20, 'cols' => 15, 'class' => 'system-report')));
     $this->form = $form;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:59,代码来源:AdminServerSystemReportController.class.php

示例2: optimize_tables

 private function optimize_tables()
 {
     $db_utils = PersistenceContext::get_dbms_utils();
     $tables = $db_utils->list_tables();
     $db_utils->optimize($tables);
     $db_utils->repair($tables);
     CLIOutput::writeln('Database optimized');
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:8,代码来源:CLIRestoreDBCommand.class.php

示例3: dump

 private function dump($file_path, $tables)
 {
     Environment::try_to_increase_max_execution_time();
     $file = new File($file_path);
     $file_writer = new BufferedFileWriter($file);
     if ($tables == null) {
         PersistenceContext::get_dbms_utils()->dump_phpboost($file_writer, DBMSUtils::DUMP_STRUCTURE_AND_DATA);
     } else {
         PersistenceContext::get_dbms_utils()->dump_tables($file_writer, $tables, DBMSUtils::DUMP_STRUCTURE_AND_DATA);
     }
     CLIOutput::writeln('Tables dumped to file ' . $file_path);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:12,代码来源:CLIDumpCommand.class.php

示例4: __construct

 public function __construct($locale = '')
 {
     $this->token = new File(PATH_TO_ROOT . '/cache/.update_token');
     $this->update_followed_file = new File(PATH_TO_ROOT . '/update/update_followed.txt');
     $this->update_followed_file->delete();
     self::$db_utils = PersistenceContext::get_dbms_utils();
     self::$db_querier = PersistenceContext::get_querier();
     if (!empty($locale)) {
         LangLoader::set_locale($locale);
     }
     $this->messages = LangLoader::get('update', 'update');
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:12,代码来源:UpdateServices.class.php

示例5: create_forum_ranks_table

 private function create_forum_ranks_table()
 {
     $fields = array('id' => array('type' => 'integer', 'length' => 11, 'autoincrement' => true, 'notnull' => 1), 'name' => array('type' => 'string', 'length' => 150, 'notnull' => 1, 'default' => "''"), 'msg' => array('type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 0), 'icon' => array('type' => 'string', 'length' => 255, 'notnull' => 1, 'default' => "''"), 'special' => array('type' => 'boolean', 'length' => 1, 'notnull' => 1, 'default' => 0));
     $options = array('primary' => array('id'));
     PersistenceContext::get_dbms_utils()->create_table(self::$forum_ranks_table, $fields, $options);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:6,代码来源:ForumSetup.class.php

示例6: create_pages_cats_table

 private function create_pages_cats_table()
 {
     $fields = array('id' => array('type' => 'integer', 'length' => 11, 'autoincrement' => true, 'notnull' => 1), 'id_page' => array('type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 0), 'id_parent' => array('type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 0));
     $options = array('primary' => array('id'));
     PersistenceContext::get_dbms_utils()->create_table(self::$pages_cats_table, $fields, $options);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:6,代码来源:PagesSetup.class.php

示例7: create_poll_ip_table

 private function create_poll_ip_table()
 {
     $fields = array('id' => array('type' => 'integer', 'length' => 11, 'autoincrement' => true, 'notnull' => 1), 'ip' => array('type' => 'string', 'length' => 50, 'notnull' => 1, 'default' => "''"), 'user_id' => array('type' => 'integer', 'length' => 11, 'default' => 0), 'idpoll' => array('type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 0), 'timestamp' => array('type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 0));
     $options = array('primary' => array('id'));
     PersistenceContext::get_dbms_utils()->create_table(self::$poll_ip_table, $fields, $options);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:6,代码来源:PollSetup.class.php

示例8: __construct

 public function __construct()
 {
     parent::__construct('shoutbox');
     $this->querier = PersistenceContext::get_querier();
     $this->db_utils = PersistenceContext::get_dbms_utils();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:6,代码来源:ShoutboxModuleUpdateVersion.class.php

示例9: foreach

        foreach ($table_structure['fields'] as $fields_info) {
            $tpl->assign_block_vars('fields', array('FIELD_NAME' => $fields_info['name'], 'FIELD_TYPE' => $fields_info['type'], 'FIELD_NULL' => $fields_info['null'] ? LangLoader::get_message('yes', 'common') : LangLoader::get_message('no', 'common'), 'FIELD_VALUE' => TextHelper::strprotect($fields_info['default']), 'C_FIELD_FORM_EXTEND' => $fields_info['type'] == 'text' || $fields_info['type'] == 'mediumtext' ? true : false));
        }
    }
} elseif (!empty($table) && $action == 'optimize') {
    PersistenceContext::get_dbms_utils()->optimize(array($table));
    AppContext::get_response()->redirect('/database/admin_database_tools.php?table=' . $table);
} elseif (!empty($table) && $action == 'truncate') {
    AppContext::get_session()->csrf_get_protect();
    //Protection csrf
    PersistenceContext::get_dbms_utils()->truncate(array($table));
    AppContext::get_response()->redirect('/database/admin_database_tools.php?table=' . $table);
} elseif (!empty($table) && $action == 'drop') {
    AppContext::get_session()->csrf_get_protect();
    //Protection csrf
    PersistenceContext::get_dbms_utils()->drop(array($table));
    AppContext::get_response()->redirect('/database/admin_database_tools.php?table=' . $table);
} elseif (!empty($table) && $action == 'query') {
    $query = retrieve(POST, 'query', '', TSTRING_UNCHANGE);
    $tpl->put_all(array('C_DATABASE_TABLE_QUERY' => true));
    if (!empty($query)) {
        AppContext::get_session()->csrf_get_protect();
        //Protection csrf
        $tpl->put_all(array('C_QUERY_RESULT' => true));
        $lower_query = strtolower($query);
        if (strtolower(substr($query, 0, 6)) == 'select') {
            //On éxécute la requête
            $result = PersistenceContext::get_querier()->select(str_replace('phpboost_', PREFIX, $query));
            $i = 1;
            while ($row = $result->fetch()) {
                $tpl->assign_block_vars('line', array());
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:31,代码来源:admin_database_tools.php

示例10: create_gallery_table

 private function create_gallery_table()
 {
     $fields = array('id' => array('type' => 'integer', 'length' => 11, 'autoincrement' => true, 'notnull' => 1), 'idcat' => array('type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 0), 'name' => array('type' => 'string', 'length' => 255, 'default' => "''"), 'path' => array('type' => 'string', 'length' => 255, 'default' => "''"), 'width' => array('type' => 'integer', 'length' => 9, 'notnull' => 1, 'default' => 0), 'height' => array('type' => 'integer', 'length' => 9, 'notnull' => 1, 'default' => 0), 'weight' => array('type' => 'integer', 'length' => 9, 'notnull' => 1, 'default' => 0), 'user_id' => array('type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 0), 'aprob' => array('type' => 'boolean', 'notnull' => 1, 'default' => 0), 'views' => array('type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 0), 'timestamp' => array('type' => 'integer', 'length' => 11, 'default' => 0));
     $options = array('primary' => array('id'), 'indexes' => array('idcat' => array('type' => 'key', 'fields' => 'idcat')));
     PersistenceContext::get_dbms_utils()->create_table(self::$gallery_table, $fields, $options);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:6,代码来源:GallerySetup.class.php

示例11: generate_insert_values_query

 /**
  * @desc Concatenates the tables content insertion queries to the SQL backup script.
  * @param $tables names of the tables which must be filled by the backup script.
  * If you want to generate the query which will fill all the tables, don't use this parameter
  * of let an empty array.
  */
 public function generate_insert_values_query($tables = array())
 {
     $all_tables = count($tables) == 0 ? true : false;
     foreach ($this->tables as $id => $table_info) {
         if ($all_tables || in_array($table_info['name'], $tables)) {
             $rows_number = PersistenceContext::get_querier()->count($table_info['name']);
             if ($rows_number > 0) {
                 $this->backup_script .= "INSERT INTO " . $table_info['name'] . " (`";
                 $this->backup_script .= implode('`, `', PersistenceContext::get_dbms_utils()->desc_table($table_info['name']));
                 $this->backup_script .= "`) VALUES ";
                 $i = 1;
                 $list_fields = PersistenceContext::get_dbms_utils()->desc_table($table_info['name']);
                 $result = $this->db_querier->select('SELECT * FROM ' . $table_info['name']);
                 while ($row = $result->fetch()) {
                     if ($i % 10 == 0) {
                         $this->backup_script .= ";\n";
                         $this->backup_script .= "INSERT INTO " . $table_info['name'] . " (";
                         $this->backup_script .= implode(', ', $list_fields);
                         $this->backup_script .= ") VALUES ";
                     } elseif ($i > 1) {
                         $this->backup_script .= ", ";
                     }
                     $this->backup_script .= "(";
                     foreach ($row as $key => $value) {
                         $row[$key] = '\'' . str_replace(chr(13), '\\r', str_replace(chr(10), '\\n', str_replace('\\', '\\\\', str_replace("'", "''", $value)))) . '\'';
                     }
                     $this->backup_script .= implode(', ', $row) . ")";
                     $i++;
                 }
                 $this->backup_script .= ";\n";
                 $result->dispose();
             }
         }
     }
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:41,代码来源:Backup.class.php

示例12: create_bugtracker_users_filters_table

 private function create_bugtracker_users_filters_table()
 {
     $fields = array('id' => array('type' => 'integer', 'length' => 11, 'autoincrement' => true, 'notnull' => 1), 'user_id' => array('type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 0), 'page' => array('type' => 'string', 'length' => 64, 'notnull' => 1, 'default' => "''"), 'filters' => array('type' => 'string', 'length' => 64, 'notnull' => 1, 'default' => "''"), 'filters_ids' => array('type' => 'string', 'length' => 64, 'notnull' => 1, 'default' => "''"));
     $options = array('primary' => array('id'), 'indexes' => array('user_id' => array('type' => 'key', 'fields' => 'user_id')));
     PersistenceContext::get_dbms_utils()->create_table(self::$bugtracker_users_filters_table, $fields, $options);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:6,代码来源:BugtrackerSetup.class.php

示例13: list

                }
            }
        }
        if (!empty($error)) {
            if (trim($error) == 'backup_success' && !empty($file)) {
                $tpl->put('message_helper', MessageHelper::display(sprintf($LANG['db_backup_success'], $file, $file), MessageHelper::SUCCESS));
            }
        }
        //liste des tables
        $i = 0;
        list($nbr_rows, $nbr_data, $nbr_free) = array(0, 0, 0);
        foreach (PersistenceContext::get_dbms_utils()->list_and_desc_tables(true) as $key => $table_info) {
            $free = NumberHelper::round($table_info['data_free'] / 1024, 1);
            $data = NumberHelper::round(($table_info['data_length'] + $table_info['index_length']) / 1024, 1);
            $free = $free > 1024 ? NumberHelper::round($free / 1024, 1) . ' ' . LangLoader::get_message('unit.megabytes', 'common') : $free . ' ' . LangLoader::get_message('unit.kilobytes', 'common');
            $data = $data > 1024 ? NumberHelper::round($data / 1024, 1) . ' ' . LangLoader::get_message('unit.megabytes', 'common') : $data . ' ' . LangLoader::get_message('unit.kilobytes', 'common');
            $tpl->assign_block_vars('table_list', array('TABLE_NAME' => $table_info['name'], 'TABLE_ENGINE' => $table_info['engine'], 'TABLE_ROWS' => $table_info['rows'], 'TABLE_DATA' => $data != 0 ? $data : '-', 'TABLE_FREE' => $free != 0 ? $free : '-', 'TABLE_COLLATION' => $table_info['collation'], 'I' => $i));
            $nbr_rows += $table_info['rows'];
            $nbr_free += $table_info['data_free'];
            $nbr_data += $table_info['data_length'] + $table_info['index_length'];
            $i++;
        }
        $nbr_free = NumberHelper::round($nbr_free / 1024, 1);
        $nbr_data = NumberHelper::round($nbr_data / 1024, 1);
        $nbr_free = $nbr_free > 1024 ? NumberHelper::round($nbr_free / 1024, 1) . ' ' . LangLoader::get_message('unit.megabytes', 'common') : $nbr_free . ' ' . LangLoader::get_message('unit.kilobytes', 'common');
        $nbr_data = $nbr_data > 1024 ? NumberHelper::round($nbr_data / 1024, 1) . ' ' . LangLoader::get_message('unit.megabytes', 'common') : $nbr_data . ' ' . LangLoader::get_message('unit.kilobytes', 'common');
        $tpl->put_all(array('C_DATABASE_INDEX' => true, 'TARGET' => url('admin_database.php?token=' . AppContext::get_session()->get_token()), 'NBR_TABLES' => count(PersistenceContext::get_dbms_utils()->list_tables()), 'NBR_ROWS' => $nbr_rows, 'NBR_DATA' => $nbr_data, 'NBR_FREE' => $nbr_free, 'L_EXPLAIN_ACTIONS' => $LANG['db_explain_actions'], 'L_EXPLAIN_ACTIONS_QUESTION' => $LANG['db_explain_actions.question'], 'L_DB_RESTORE' => $LANG['db_restore'], 'L_RESTORE_FROM_SERVER' => $LANG['db_restore_from_server'], 'L_FILE_LIST' => $LANG['db_view_file_list'], 'L_RESTORE_FROM_UPLOADED_FILE' => sprintf($LANG['import_file_explain'], ini_get('upload_max_filesize')), 'L_RESTORE_NOW' => $LANG['db_restore'], 'L_TABLE_LIST' => $LANG['db_table_list'], 'L_TABLE_NAME' => $LANG['db_table_name'], 'L_TABLE_ROWS' => $LANG['db_table_rows'], 'L_TABLE_ENGINE' => $LANG['db_table_engine'], 'L_TABLE_COLLATION' => $LANG['db_table_collation'], 'L_TABLE_DATA' => $LANG['db_table_data'], 'L_TABLE_FREE' => $LANG['db_table_free'], 'L_SELECTED_TABLES' => $LANG['db_selected_tables'], 'L_ALL' => $LANG['db_select_all'], 'ACTION_FOR_SELECTION' => $LANG['db_for_selected_tables'], 'L_OPTIMIZE' => $LANG['db_optimize'], 'L_REPAIR' => $LANG['db_repair'], 'L_BACKUP' => $LANG['db_backup']));
    }
}
$tpl->display();
require_once '../admin/admin_footer.php';
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:31,代码来源:admin_database.php

示例14: create_faq_table

 private function create_faq_table()
 {
     $fields = array('id' => array('type' => 'integer', 'length' => 11, 'autoincrement' => true, 'notnull' => 1), 'id_category' => array('type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 0), 'q_order' => array('type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 0), 'question' => array('type' => 'string', 'length' => 255, 'notnull' => 1, 'default' => "''"), 'answer' => array('type' => 'text', 'length' => 65000, 'default' => "''"), 'creation_date' => array('type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 0), 'author_user_id' => array('type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 0), 'approved' => array('type' => 'boolean', 'notnull' => 1, 'default' => 0));
     $options = array('primary' => array('id'), 'indexes' => array('id_category' => array('type' => 'key', 'fields' => 'id_category'), 'title' => array('type' => 'fulltext', 'fields' => 'question'), 'contents' => array('type' => 'fulltext', 'fields' => 'answer')));
     PersistenceContext::get_dbms_utils()->create_table(self::$faq_table, $fields, $options);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:6,代码来源:FaqSetup.class.php

示例15: create_articles_table

 private function create_articles_table()
 {
     $fields = array('id' => array('type' => 'integer', 'length' => 11, 'autoincrement' => true, 'notnull' => 1), 'id_category' => array('type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 0), 'picture_url' => array('type' => 'string', 'length' => 255, 'notnull' => 1), 'title' => array('type' => 'string', 'length' => 250, 'notnull' => 1, 'default' => "''"), 'rewrited_title' => array('type' => 'string', 'length' => 250, 'default' => "''"), 'description' => array('type' => 'text', 'length' => 65000), 'contents' => array('type' => 'text', 'length' => 65000), 'number_view' => array('type' => 'integer', 'length' => 11, 'default' => 0), 'author_user_id' => array('type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 0), 'author_name_displayed' => array('type' => 'boolean', 'notnull' => 1, 'default' => 1), 'published' => array('type' => 'integer', 'length' => 1, 'notnull' => 1, 'default' => 0), 'publishing_start_date' => array('type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 0), 'publishing_end_date' => array('type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 0), 'date_created' => array('type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 0), 'date_updated' => array('type' => 'integer', 'length' => 11, 'notnull' => 1, 'default' => 0), 'notation_enabled' => array('type' => 'boolean', 'notnull' => 1, 'default' => 1), 'sources' => array('type' => 'text', 'length' => 65000));
     $options = array('primary' => array('id'), 'indexes' => array('id_category' => array('type' => 'key', 'fields' => 'id_category'), 'title' => array('type' => 'fulltext', 'fields' => 'title'), 'description' => array('type' => 'fulltext', 'fields' => 'description'), 'contents' => array('type' => 'fulltext', 'fields' => 'contents')));
     PersistenceContext::get_dbms_utils()->create_table(self::$articles_table, $fields, $options);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:6,代码来源:ArticlesSetup.class.php


注:本文中的PersistenceContext::get_dbms_utils方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。