0byt3m1n1
Path:
/
data
/
applications
/
aps
/
b2evolution
/
4.1.5b-1
/
standard
/
scripts
/
[
Home
]
File: configure
<?php ini_set('include_path', '.'); require_once('env-parser.php'); require_once('file-util.php'); require_once('db-util.php'); require_once('app-util.php'); require_once('upgrade-app.php'); function admin_password_crypt($value) { return md5($value); } $config_files = array( '/' => array( array('_basic_config.php.in', 'conf/_basic_config.php'), array('_application.php.in', 'conf/_application.php'), array('_formatting.php.in', 'conf/_formatting.php'), array('_admin.php.in', 'conf/_admin.php'), array('_locales.php.in', 'conf/_locales.php'), array('_advanced.php.in', 'conf/_advanced.php'), array('user.ini', '.user.ini')),'/cgi-bin'=> array()); $schema_files = array( 'schema.sql' => 'main' ); $reconf_schema_files = array( 'reconfigure.sql' => 'main' ); $remove_schema_files = array( 'remove.sql' => 'main' ); $psa_params = array ( ); $db_ids = array ( 'main' ); $web_ids = array ( 'media', '/' ); $settings_params = array ( 'admin_firstname', 'admin_lastname', 'admin_nick', 'admin_name', 'admin_email', 'admin_domain', 'app_name', 'app_shortname', 'minimum_comment_interval', 'timeout_online_user', 'cookie_expires', 'cookie_expired', 'upload_maxmaxkb' ); $settings_enum_params = array ( 'admin_locale' => array( 'en-US' => 'en-US', 'fr-FR' => 'fr-FR', 'de-DE' => 'de-DE' ), 'default_ctrl' => array( 'antispam' => 'antispam', 'set_antispam' => 'set_antispam', 'chapters' => 'chapters', 'collections' => 'collections', 'coll_settings' => 'coll_settings', 'comments' => 'comments', 'crontab' => 'crontab', 'dashboard' => 'dashboard', 'features' => 'features', 'files' => 'files', 'fileset' => 'fileset', 'filetypes' => 'filetypes', 'items' => 'items', 'itemstatuses' => 'itemstatuses', 'itemtypes' => 'itemtypes', 'locales' => 'locales', 'mtimport' => 'mtimport', 'plugins' => 'plugins', 'Settings' => 'Settings', 'skins' => 'skins', 'stats' => 'stats', 'system' => 'system', 'tools' => 'tools', 'users' => 'users', 'upload' => 'upload', 'widgets' => 'widgets', 'wpimport' => 'wpimport' ), 'allow_cross_posting' => array( '-1' => '-1', '0' => '0', '1' => '1', '2' => '2', '3' => '3' ), 'default_post_status' => array( 'published' => 'published', 'deprecated' => 'deprecated', 'protected' => 'protected', 'private' => 'private', 'draft' => 'draft', 'redirected' => 'redirected' ), 'use_preview' => array( '1' => '1', '0' => '0' ), 'use_post_url' => array( '1' => '1', '0' => '0' ), 'report_abuse' => array( '1' => '1', '0' => '0' ), 'use_balanceTags' => array( '1' => '1', '0' => '0' ), 'use_xhtmlvalidation_for_comments' => array( 'true' => 'true', 'false' => 'false' ), 'use_strict' => array( 'true' => 'true', 'false' => 'false' ), 'comments_use_autobr' => array( 'never' => 'never', 'opt-in' => 'opt-in', 'opt-out' => 'opt-out', 'always' => 'always' ), 'comments_allow_css_tweaks' => array( 'true' => 'true', 'false' => 'false' ), 'debug' => array( '0' => '0', '1' => '1', '2' => '2' ), 'log_app_errors' => array( '0' => '0', '1' => '1', '2' => '2' ), 'demo_mode' => array( 'true' => 'true', 'false' => 'false' ), 'require_name_email' => array( '1' => '1', '0' => '0' ), 'antispam_on_message_form' => array( '1' => '1', '0' => '0' ), 'public_access_to_media' => array( 'true' => 'true', 'false' => 'false' ), 'show_errors' => array( 'true' => 'true', 'false' => 'false' ), 'halt_on_error' => array( 'true' => 'true', 'false' => 'false' ), 'locale' => array( 'en-US' => 'en-US', 'fr-FR' => 'fr-FR', 'de-DE' => 'de-DE' ), 'maintenance_mode' => array( '0' => '0', '1' => '1' ) ); $crypt_settings_params = array ( 'admin_password' ); $psa_modify_hash = get_psa_modify_hash($psa_params); $db_modify_hash = get_db_modify_hash($db_ids); $web_modify_hash = get_web_modify_hash($web_ids); $settings_modify_hash = get_settings_modify_hash($settings_params); $settings_enum_modify_hash = get_settings_enum_modify_hash($settings_enum_params); $crypt_settings_modify_hash = get_crypt_settings_modify_hash($crypt_settings_params); $additional_modify_hash = get_additional_modify_hash(); if(count($argv) < 2) { print "Usage: configure (install | upgrade <version> | configure | remove)\n"; exit(1); } $command = $argv[1]; if($command == "upgrade") { if($argv[2] && $argv[3]){ global $Debuglog; global $inc_path; global $Messages; global $DB; global $Timer; global $new_db_version; $upgrade_schema_files = get_upgrade_schema_files($argv[2], $argv[3]); // $upgrade_schema_files = array(); // array('upgrade-1.0-1.sql' => 'main') configure($config_files, $upgrade_schema_files, $db_ids, $psa_modify_hash, $db_modify_hash, $settings_modify_hash, $crypt_settings_modify_hash, $settings_enum_modify_hash, $additional_modify_hash); ini_set('memory_limit', '64M'); ini_set('max_execution_time', '2000'); $curdir = getcwd(); chdir($psa_modify_hash['@@ROOT_DIR@@']); //include($psa_modify_hash['@@ROOT_DIR@@'].'/upgrade_aps.php'); include($psa_modify_hash['@@ROOT_DIR@@'].'/upgrade_app.php'); chdir($curdir); exit(0); } else{ print "Error: upgrade version or release not specified.\n"; exit(1); } } if($command == "install") { configure($config_files, $schema_files, $db_ids, $psa_modify_hash, $db_modify_hash, $settings_modify_hash, $crypt_settings_modify_hash, $settings_enum_modify_hash, $additional_modify_hash); exit(0); } if($command == "remove") { remove_app($remove_schema_files, $db_ids, $psa_modify_hash, $db_modify_hash, $settings_modify_hash, $crypt_settings_modify_hash, $settings_enum_modify_hash, $additional_modify_hash); exit(0); } if($command == "configure") { configure($config_files, $reconf_schema_files, $db_ids, $psa_modify_hash, $db_modify_hash, $settings_modify_hash, $crypt_settings_modify_hash, $settings_enum_modify_hash, $additional_modify_hash); exit(0); } print "Error: unknown command $command.\n"; exit(1); ?>