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


PHP config::reg_field方法代码示例

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


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

示例1: array

<?php

/**
 * Configuration file for directories
 */
config::reg_field("dir", "builtin", "folder_dcss", array("title" => "Folder : dcss", "default" => "Framework/DynamicCSS/", "desc" => "Folder containing dynamic stylesheets source (*.dcss) "));
config::reg_field("dir", "builtin", "folder_dcss_compiled", array("title" => "Folder : dcss_compiled", "default" => "Stylesheets/dynamic/", "desc" => "Folder containing parsed dynamic stylesheets (*.css). Must be writable "));
config::reg_field("template", "content", "dynamic_stylesheet_base_url", array("title" => "Dynamic stylesheet base URL", "type" => "text", "default" => "./../../", "advanced" => true, "desc" => "Base url to use for links in dynamicly generated stylesheets. Can be the relative path from dcss_compiled folder to root folder. Change from default only if you moved the dcss_compiled folder"));
开发者ID:laiello,项目名称:phpbf,代码行数:8,代码来源:plugin.dynamic_stylesheet.php

示例2: array

config::reg_section("locale", array("title" => "Locale"));
config::reg_subsection("locale", "options", array("title" => "Localization and internationalization options", "advanced" => true));
config::reg_subsection("locale", "retreive", array("title" => "Locale retreive mode", "advanced" => true));
config::reg_subsection("locale", "langs", array("title" => "Available languages"));
//// mode
config::reg_field("locale", "options", "locale_enabled", array("title" => "Enable translations", "type" => "checkbox", "label" => "Parse language blocks in pages ", "cast" => "bool", "default" => true, "desc" => "Look for multilanguage tags in page files and translate "));
config::reg_field("locale", "options", "locale_set_php", array("title" => "Use PHP locale", "type" => "checkbox", "label" => "Set PHP locale on every page ", "cast" => "bool", "default" => true, "advanced" => true, "desc" => "Desactivate if locale is enabled but host does not support php's set_locale "));
config::reg_field("locale", "retreive", "locale_use_session", array("title" => "Store with session", "type" => "checkbox", "default" => false, "advanced" => true, "desc" => "Use session to store locale and retrieve on each page. This is transparent to user"));
config::reg_field("locale", "retreive", "locale_use_cookie", array("title" => "Store with cookie", "type" => "checkbox", "default" => true, "advanced" => true, "desc" => "Use cookie to store locale and retrieve on each page. This will be kept across sessions"));
config::reg_field("locale", "retreive", "locale_use_url", array("title" => "Store in URL", "type" => "checkbox", "default" => false, "advanced" => true, "desc" => "Use URL to store locale and retrieve on each page. Will add a 'virtual' top folder for each language. This is a good solution for search engines."));
config::reg_field("locale", "retreive", "locale_url_syntax", array("title" => "URL only: syntax", "type" => "radio", "options" => array("lang_country" => "lang_country (eg. /en_US/)", "lang-country" => "language-country (eg. /en-US/)", "lang" => "language only (eg. /en/)", "country" => "country only (eg. /US/)"), "default" => "lang", "advanced" => true, "desc" => "Define here how to write locale in the URL. Note that this does not affect URL parsing, all syntax are valid for setting the locale"));
config::reg_field("locale", "retreive", "locale_use_get", array("title" => "Store in GET params", "type" => "checkbox", "default" => false, "advanced" => true, "desc" => "Use GET params to store locale and retrieve on each page. This is not as nice as in URL storing but can be used if in URL is not possible."));
config::reg_field("locale", "retreive", "locale_get_param_name", array("title" => "GET param only: locale param name", "type" => "text", "default" => "locale", "advanced" => true, "desc" => "If using GET param to store locale, then define the name of the GET param"));
config::reg_field("locale", "retreive", "locale_use_user", array("title" => "Store in user DB", "type" => "checkbox", "default" => false, "advanced" => true, "desc" => "Use user DB to store logged users locale and retrieve on each page. This will be kept across sessions. User object must have locale_lang and locale_country fields (which can either be real DB entries or an overloaded fields)"));
//// langs
config::reg_field("locale", "langs", "locale_languages", array("title" => "Languages", "type" => "table", "columns" => array("lang" => array("title" => "Language code", "width" => "30%"), "countries" => array("title" => "Countries code")), "num" => "auto", "onsave" => "config_langs_table_save", "onload" => "config_langs_table_load", "default" => array("lang" => array(0 => "en"), "countries" => array(0 => "US|UK")), "example" => array("lang" => "en", "countries" => "US|UK|CA|SG"), "desc" => "Table of all languages available (2 letters ID). First will be default if detection fails.<br/>For each language: list of all countries available (2 letters ID), separated by |. First will be default if detection fails.<br/>Warning: If you use php locales (see Use PHP locale in advanced locale options), each pair of language / first country, must be a valid PHP locale, otherwise, the language won't be available and an error will be thrown"));
function config_langs_table_load($field_id, $raw)
{
    $output = array();
    if (is_array($raw)) {
        foreach ($raw as $lang => $countries) {
            $output[] = array("lang" => $lang, "countries" => $countries);
        }
    }
    return $output;
}
function config_langs_table_save($field_id, $input, &$conf)
{
    $output = array();
    for ($i = 0; $i < count($input['lang']); $i++) {
        $id = strtolower(trim($input['lang'][$i]));
开发者ID:laiello,项目名称:phpbf,代码行数:31,代码来源:core.locale.php

示例3: array

config::reg_field("dir", "builtin", "folder_data", array("title" => "Folder : data", "default" => "core/data/", "desc" => "Folder with write permission (for compiled templates, file DB, etc...)"));
config::reg_field("dir", "builtin", "folder_log", array("title" => "Folder : log", "default" => "core/data/log/", "desc" => "Folder containing log file (must be writable)"));
config::reg_field("dir", "builtin", "folder_compiled", array("title" => "Folder : compiled", "default" => "core/data/compiled_templates/", "desc" => "Folder containing compiled templates (must be writable) "));
config::reg_field("dir", "builtin", "folder_cached", array("title" => "Folder : cached", "default" => "core/data/cached_templates/", "desc" => "Folder containing cached templates (must be writable) "));
config::reg_field("dir", "builtin", "folder_modules", array("title" => "Folder : modules", "default" => "core/lib/phpbf/modules/", "desc" => "Folder containing modules "));
config::reg_field("dir", "builtin", "folder_model", array("title" => "Folder : model", "default" => "core/model/", "desc" => "Folder containing data model "));
config::reg_field("dir", "builtin", "folder_smarty", array("title" => "Folder : smarty", "default" => "core/lib/smarty/", "desc" => "Folder containing Smarty template engine"));
config::reg_field("dir", "builtin", "folder_tags", array("title" => "Folder : tags", "default" => "core/tags/", "desc" => "Folder containing tags for smarty"));
config::reg_field("dir", "builtin", "folder_translations", array("title" => "Folder : translations", "default" => "core/translations/", "desc" => ""));
config::reg_field("dir", "builtin", "folder_img", array("title" => "Folder : img", "default" => "img/", "desc" => "Folder containing images "));
config::reg_field("dir", "builtin", "folder_css", array("title" => "Folder : css", "default" => "css/", "desc" => "Folder containing static stylesheets"));
config::reg_field("dir", "builtin", "folder_js", array("title" => "Folder : js", "default" => "js/", "desc" => "Folder containing javascript's scripts"));
config::reg_field("dir", "builtin", "folder_db", array("title" => "Folder : db", "default" => "core/data/db/", "desc" => "Folder containing file database like sqlite"));
config::reg_field("dir", "builtin", "folder_lib", array("title" => "Folder : lib", "default" => "core/lib/", "desc" => "Lib folder containing third party php libraries"));
//// user-defined
config::reg_field("dir", "userdefined", "userdefined_folders", array("title" => "User-defined folders", "type" => "table", "columns" => array("id" => array("title" => "ID", "width" => "30%"), "path" => array("title" => "Path")), "num" => "auto", "onsave" => "config_folders_table_save", "onload" => "config_folders_table_load", "default" => array(), "example" => array("id" => "mydocs", "path" => "/home/X/Public/docs/"), "desc" => "You can define your owne folder ID, that can be used in the same way as the built in folders."));
function config_folders_table_load($field_id, $raw)
{
    $output = array();
    foreach (config::search('/^folder_/') as $id => $path) {
        foreach (config::$fields["dir"]["builtin"] as $builtin_id => $builtin_path) {
            if ($builtin_id == $id) {
                continue 2;
            }
        }
        $output[] = array("id" => substr($id, 7), "path" => $path);
    }
    return $output;
}
function config_folders_table_save($field_id, $input, &$conf)
{
开发者ID:laiello,项目名称:phpbf,代码行数:31,代码来源:core.2.dir.php

示例4: array

<?php

/**
 * Configuration file for time
 */
config::reg_section("time", array("title" => "Time", "advanced" => false));
config::reg_subsection("time", "time", array("title" => "Server time"));
//// time
config::reg_field("time", "time", "time_default_zone", array("title" => "Server time zone", "type" => "text", "default" => "GMT", "desc" => "Default time zone (Works with PHP versions > 5.1). Must be a <a href='http://php.net/manual/en/timezones.php' target='_blank'>valid PHP Timezone</a>"));
开发者ID:laiello,项目名称:phpbf,代码行数:9,代码来源:core.time.php

示例5: array

<?php

/**
 * Configuration file for mail
 */
config::reg_section("mail", array("title" => "Mail"));
config::reg_subsection("mail", "mode", array("title" => "General settings for sending mails"));
config::reg_subsection("mail", "smtp", array("title" => "SMTP Settings", "advanced" => true));
config::reg_subsection("mail", "sendmail", array("title" => "Sendmail settings", "advanced" => true));
//// mode
config::reg_field("mail", "mode", "mail_default_to", array("title" => "Default To address", "default" => "@", "desc" => "Default address to send mails to, used for contact page."));
config::reg_field("mail", "mode", "mail_method", array("title" => "Mail method", "type" => "radio", "options" => array("mail" => "PHP Mail function", "smtp" => "SMTP", "sendmail" => "Sendmail"), "default" => "mail", "advanced" => true, "desc" => "Determine how user are sorted into groups. See doc for more info"));
//// SMTP
config::reg_field("mail", "smtp", "mail_smtp_host", array("title" => "SMTP Host", "default" => "localhost"));
config::reg_field("mail", "smtp", "mail_smtp_port", array("title" => "SMTP Port number", "default" => "", "Leave blank for default SMTP port"));
config::reg_field("mail", "smtp", "mail_smtp_username", array("title" => "SMTP Username", "default" => ""));
config::reg_field("mail", "smtp", "mail_smtp_password", array("title" => "SMTP Password", "default" => ""));
//// sendmail
config::reg_field("mail", "sendmail", "mail_sendmail_path", array("title" => "Sendmail path", "default" => "", "desc" => "Path to Sendmail on server"));
//// ERROR LOG
config::reg_field("error", "log", "error_send_mail", array("title" => "Mail errors", "type" => "checkbox", "label" => "Send a mail on error", "cast" => "bool", "default" => false, "advanced" => true, "desc" => "Send an email to below address everytime an error occurs (useful in production environment)"));
config::reg_field("error", "log", "error_email", array("title" => "Email for sending errors", "type" => "text", "default" => "", "advanced" => true, "desc" => "Send an email to this address on error with informations for debuging. Need the mail module. Leaving blank will desactivate"));
开发者ID:laiello,项目名称:phpbf,代码行数:22,代码来源:plugin.mail.php

示例6: array

<?php

/**
 * Configuration file for templates
 */
config::reg_section("template", array("title" => "Templates", "advanced" => false));
config::reg_subsection("template", "content", array("title" => "Pages content and organization"));
config::reg_subsection("template", "smarty", array("title" => "Smarty template engine options"));
config::reg_subsection("template", "caching", array("title" => "Caching"));
//// content
config::reg_field("template", "content", "window_title", array("title" => "Window title", "type" => "text", "default" => "My site - %s", "desc" => "Default browser window title. '%s' will be replaced by current page title"));
config::reg_field("template", "content", "template_default_creator", array("title" => "Default template creator meta", "type" => "text", "default" => "My name", "desc" => "Default value for the creator meta tag in header. You can also chage this directly in header.tpl"));
config::reg_field("template", "content", "page_default", array("title" => "Default page", "type" => "text", "default" => "home", "desc" => "Default page to display (site home page)"));
config::reg_field("template", "content", "page_error", array("title" => "Error page", "type" => "text", "default" => "error", "desc" => "Page to display when an error occurs", "advanced" => true));
config::reg_field("template", "content", "page_logged", array("title" => "Logged welcome page", "type" => "text", "default" => "logged", "desc" => "Page to display once user is logged"));
config::reg_field("template", "content", "template_default_content_type", array("title" => "Default content type", "type" => "text", "default" => "text/html", "advanced" => true, "desc" => "Default content type for all templates served by template"));
//// Smarty
config::reg_field("template", "smarty", "template_smarty_debug", array("title" => "Smarty debug mode", "type" => "checkbox", "label" => "Enable", "cast" => "bool", "default" => false, "desc" => "Use Smarty template engine debug mode that display a popup showing all template varaibles assigned on every page"));
config::reg_field("template", "smarty", "template_compile_check", array("title" => "Check templates for modifications", "type" => "radio", "default" => true, "options" => array(0 => "Disabled", 1 => "Enabled"), "cast" => "bool", "desc" => "Upon each invocation of the PHP application, Smarty tests to see if the current template has changed (different time stamp) since the last time it was compiled. If it has changed, it recompiles that template. If the template has not been compiled, it will compile regardless of this setting.", "advanced" => true));
//// Caching
config::reg_field("template", "caching", "template_cache", array("title" => "Caching", "type" => "radio", "options" => array(0 => "Caching disabled", 1 => "Caching enabled"), "default" => false, "cast" => "bool", "desc" => "Cache templates output for better performance. <br/>Note: Make sure all templates can be cached, most dynamic content cannot be cached and need to be escaped"));
config::reg_field("template", "caching", "template_cache_lifetime", array("title" => "Cache lifetime", "type" => "text", "cast" => "int", "default" => 86400, "desc" => "Default lifetime for cached templates. -1 for unlimited, 0 for regenerate on each load (not recommended, disable caching instead)"));
开发者ID:laiello,项目名称:phpbf,代码行数:22,代码来源:core.2.template.php

示例7: array

<?php

/**
 * Configuration file for users
 */
config::reg_section("users", array("title" => "User identification"));
config::reg_subsection("users", "login", array("title" => "User login"));
//// login
config::reg_field("users", "login", "user_login_time", array("title" => "Max logged time", "default" => "24", "desc" => "Time in hours before login expire and user has to login again. 0 for never"));
config::reg_field("users", "login", "user_inactivity_time", array("title" => "Max inactivity time", "default" => "5", "desc" => "Time in hours of inactivity before login expire and user has to login again. 0 for never "));
开发者ID:laiello,项目名称:phpbf,代码行数:10,代码来源:core.users.php

示例8: array

        }
    }
    $conf[$field_id] = $output;
}
//// sections
config::reg_field("sections", "sections", "use_sections", array("title" => "Use sections", "type" => "checkbox", "label" => "Divide site into sections", "cast" => "bool", "default" => false, "desc" => "Each section can have a different color scheme and/or access restriction"));
config::reg_field("sections", "sections", "page_section_div", array("title" => "Template sections mode", "type" => "select", "default" => '.', "options" => array('.' => 'Use / : Sort by folder', '/' => 'Use . : Sort by prefix'), "desc" => "Change how pages are sorted into sections ", "advanced" => true));
config::reg_field("sections", "sections", "sec", array("title" => "Sections", "type" => "table", "columns" => array("id" => array("title" => "ID", "width" => "15%"), "scheme" => array("title" => "Color scheme", "width" => "25%"), "title" => array("title" => "Title", "width" => "35%"), "access" => array("title" => "Permissions")), "num" => "auto", "onsave" => "config_sections_table_save", "onload" => "config_sections_table_load", "default" => array(), "example" => array("id" => "admin", "scheme" => "main", "title" => "Admin section", "access" => "g:admin"), "desc" => "Only ID is necessary, other fields can be left blank"));
function config_sections_table_load($field_id, $raw)
{
    $output = array();
    if (is_array($raw)) {
        foreach ($raw as $id => $data) {
            $output[] = array("id" => $id, "scheme" => $data[0], "title" => $data[1], "access" => $data[2]);
        }
    }
    return $output;
}
function config_sections_table_save($field_id, $input, &$conf)
{
    $output = array();
    for ($i = 0; $i < count($input['id']); $i++) {
        $id = trim($input['id'][$i]);
        if ($id) {
            $output[$id] = array(trim($input['scheme'][$i]), trim($input['title'][$i]), trim($input['access'][$i]));
        }
    }
    $conf[$field_id] = $output;
}
config::reg_field("sections", "sections", "page_default_sec", array("title" => "Default section", "default" => "", "desc" => "Leave blank for first defined section", "advanced" => true));
开发者ID:laiello,项目名称:phpbf,代码行数:30,代码来源:core.sections.php

示例9: array

<?php

/**
 * Configuration file for groups and access restriction
 */
config::reg_section("groups", array("title" => "Groups"));
config::reg_subsection("groups", "mode", array("title" => "Groups mode"));
config::reg_subsection("groups", "builtin", array("title" => "Built-in mode only"));
//// mode
config::reg_field("groups", "mode", "user_group", array("title" => "Group mode", "type" => "radio", "options" => array(1 => "Built-in", 2 => "Database", 0 => "None"), "default" => 1, "cast" => "int", "desc" => "Determine how user are sorted into groups. See doc for more info"));
//// builtin
config::reg_field("groups", "builtin", "user_field_id_group", array("title" => "User table group field name", "type" => "text", "default" => "id_group", "desc" => "Name of the user table field containing the group id. Field must be of type integer with length 2"));
config::reg_field("groups", "builtin", "groups", array("title" => "List of groups", "type" => "table", "columns" => array("id" => array("title" => "ID", "type" => "custom", "width" => "10%", "content" => "<b>%s</b>"), "name" => array("title" => "Name", "width" => "30%"), "parents" => array("title" => "Parent groups (names, seperated by |)")), "num" => 32, "onsave" => "config_groups_table_save", "onload" => "config_groups_table_load", "default" => array(), "desc" => "Each user will be associated to a single group ID, but will also belongs to the group's parents, and will inherite their rights"));
function config_groups_table_load($id, $raw)
{
    $groups_names = is_array(config::get('groups')) ? config::get('groups') : array();
    for ($i = 1; $i <= 32; $i++) {
        $output[$i - 1] = array("id" => $i, "name" => $groups_names[$i], "parents" => array());
        for ($j = 1; $j <= 32; $j++) {
            if (config::get('groups_parents', $i) & pow(2, $j - 1)) {
                $output[$i - 1]["parents"][] = $groups_names[$j];
            }
        }
    }
    return $output;
}
function config_groups_table_save($id, $input, &$conf)
{
    // first add all group names
    $conf["groups_id"] = array();
    for ($i = 1; $i <= 32; $i++) {
开发者ID:laiello,项目名称:phpbf,代码行数:31,代码来源:core.groups.php

示例10: array

<?php

/**
 * Configuration file for error handling
 */
config::reg_section("error", array("title" => "Error handling"));
config::reg_subsection("error", "mode", array("title" => "Error handling"));
config::reg_subsection("error", "log", array("title" => "Error log"));
//// mode
config::reg_field("error", "mode", "error_reporting", array("title" => "PHP error reporting level", "type" => "select", "default" => E_ALL | E_STRICT, "options" => array(0 => 'None', E_ERROR | E_WARNING | E_PARSE => 'E_ERROR | E_WARNING | E_PARSE', E_ERROR | E_WARNING | E_PARSE | E_NOTICE => 'E_ERROR | E_WARNING | E_PARSE | E_NOTICE', E_ALL ^ E_NOTICE ^ E_STRICT => 'E_ALL ^ E_NOTICE ^ E_STRICT', E_ALL ^ E_STRICT => 'E_ALL ^ E_STRICT', E_ALL | E_STRICT => 'E_ALL | E_STRICT'), "onsave" => "config_error_save", "desc" => "PHP error reporting level refert to php doc on error_reporting() "));
config::reg_field("error", "mode", "error_debug", array("title" => "Debug mode", "type" => "radio", "options" => array(0 => "Hide errors (for production)", 1 => "Display debug informations on error"), "default" => true, "cast" => "bool", "desc" => ""));
function config_error_save($id, $input, &$conf)
{
    if ($input == 0) {
        $conf[$id] = "0";
        return;
    }
    foreach (config::$fields["error"]["mode"][$id]["options"] as $value => $text) {
        if ($value == $input) {
            $conf[$id] = $text;
            return;
        }
    }
}
//// log
config::reg_field("error", "log", "error_log", array("title" => "Log errors", "type" => "checkbox", "label" => "Enabled", "cast" => "bool", "default" => true, "desc" => "Log errors in errorlog.txt which will be created in the Data directory"));
开发者ID:laiello,项目名称:phpbf,代码行数:26,代码来源:core.error.php

示例11: array

<?php

/**
 * Configuration file for time
 */
config::reg_section("general", array("title" => "General"));
config::reg_subsection("general", "general", array("title" => "General settings"));
//// general
config::reg_field("general", "general", "project_id", array("title" => "Project ID", "type" => "text", "default" => "", "desc" => "If more than one project runs the Framework on a single webserver, you may need to set a unique project ID to prevent sessions and coockies form being mixed up"));
config::reg_field("general", "general", "general_file_to_load", array("title" => "File to load", "type" => "text", "default" => "", "advanced" => true, "desc" => "If project requires a file to be loaded every time with some custom contants and function definition (eg. myproject.php), enter the name here, or leave blank. File must be placed in the same directory as framework.php and will be loaded right after the framework"));
config::reg_field("general", "general", "encoding", array("title" => "Encoding", "type" => "select", "default" => 'UTF-8', "options" => array('UTF-8' => "UTF-8", 'ISO-8859-1' => 'ISO-8859-1', 'ISO-8859-15' => 'ISO-8859-15', 'cp866' => 'cp866', 'cp1251' => 'cp1251', 'cp1252' => 'cp1252', 'KOI8-R' => 'KOI8-R', 'BIG5' => 'BIG5', 'GB2312' => 'GB2312', 'BIG5-HKSCS' => 'BIG5-HKSCS', 'Shift_JIS' => 'Shift_JIS', 'EUC-JP' => 'EUC-JP'), "desc" => "Char encoding site wide. UTF-8 is default and is recommended. <br/>Note: All translations files are by default encoded in UTF-8", "advanced" => true));
开发者ID:laiello,项目名称:phpbf,代码行数:11,代码来源:core.0.general.php

示例12: array

<?php

/**
 * Configuration file for directories
 */
config::reg_field("dir", "builtin", "folder_forms", array("title" => "Folder : forms", "default" => "core/forms/", "desc" => "Folder containing form data (*.frm) "));
config::reg_field("dir", "builtin", "folder_compiled_forms", array("title" => "Folder : compiled_forms", "default" => "core/data/compiled_forms/", "desc" => "Folder containing compiled form data (must be writable) "));
开发者ID:laiello,项目名称:phpbf,代码行数:7,代码来源:plugin.form.php

示例13: array

<?php

/**
 * Configuration file for time
 */
config::reg_section("db", array("title" => "Database"));
config::reg_subsection("db", "connections", array("title" => "Database connections"));
//config::reg_subsection("db", "tables", array("title" => "Database tables"));
//// connections
config::reg_field("db", "connections", "db", array("title" => "Connections", "type" => "table", "columns" => array("id" => array("title" => "ID", "width" => "15%", "type" => "text"), "type" => array("title" => "Type", "width" => "15%", "type" => "text"), "db" => array("title" => "Database", "width" => "20%", "type" => "text"), "host" => array("title" => "Host", "width" => "20%", "type" => "text"), "user" => array("title" => "Username", "width" => "15%", "type" => "text"), "pass" => array("title" => "Password", "width" => "15%", "type" => "text")), "num" => "auto", "onsave" => "config_db_table_save", "onload" => "config_db_table_load", "default" => array(), "example" => array("id" => "db_loc", "type" => "mysql", "db" => "mydb", "host" => "localhost", "user" => "myusername", "pass" => "mypassword"), "desc" => "All DB connections must be defined here.<br/>The ID must be unique and not contain spaces.<br/>The type is the DB type, for example : mysql, sqlite, etc... The required modules will be loaded."));
function config_db_table_load($field_id, $raw)
{
    $output = array();
    if (is_array($raw)) {
        foreach ($raw as $id => $entry) {
            $output[] = array("id" => $id, "type" => $entry[0], "db" => $entry[1], "host" => $entry[2], "user" => $entry[3], "pass" => $entry[4]);
        }
    }
    return $output;
}
function config_db_table_save($field_id, $input, &$conf)
{
    $output = array();
    for ($i = 0; $i < count($input['id']); $i++) {
        $id = trim($input['id'][$i]);
        if ($id && trim($input['type'][$i])) {
            $output[$id] = array(trim($input['type'][$i]), trim($input['db'][$i]), trim($input['host'][$i]), trim($input['user'][$i]), $input['pass'][$i]);
        }
    }
    $conf[$field_id] = $output;
}
开发者ID:laiello,项目名称:phpbf,代码行数:31,代码来源:core.3.db.php


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