本文整理汇总了PHP中mysql::checkRoundCubeTables方法的典型用法代码示例。如果您正苦于以下问题:PHP mysql::checkRoundCubeTables方法的具体用法?PHP mysql::checkRoundCubeTables怎么用?PHP mysql::checkRoundCubeTables使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mysql
的用法示例。
在下文中一共展示了mysql::checkRoundCubeTables方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ROUNDCUBE_INSTALL
function ROUNDCUBE_INSTALL($servername, $root, $hash = array())
{
$srcfolder = ROUNDCUBE_SRC_FOLDER();
$sock = new sockets();
$ldap = new clladp();
$EnablePostfixMultiInstance = $sock->GET_INFO("EnablePostfixMultiInstance");
$RC_VERSION = RC_VERSION($root);
$RC_VERSION_EX = explode(".", $RC_VERSION);
$MAJOR = intval($RC_VERSION[0]);
echo "Starting......: " . date("H:i:s") . " Roundcube {$servername} v{$RC_VERSION} Major {$MAJOR}\n";
$GLOBALS["ADDLOG"] = "{$GLOBALS["ARTICALOGDIR"]}/{$servername}.log";
if ($root == null) {
events("Starting install roundcube Unable to stat root dir");
return false;
}
if (!is_dir($srcfolder)) {
events("Starting install roundcube Unable to stat SRC");
return false;
}
$sql_file = "{$srcfolder}/SQL/mysql.initial.sql";
if (!is_file($sql_file)) {
events("Starting install roundcube Unable to stat {$srcfolder}");
return false;
}
$user = $hash["wwwmysqluser"][0];
$mysql_password = $hash[strtolower("WWWMysqlPassword")][0];
$server_database = str_replace(".", "_", $servername);
$server_database = str_replace("-", "_", $server_database);
events("Starting install roundcube sub-system mysql database {$server_database}...");
if ($user == null) {
events("Starting install roundcube Unable to stat Mysql username");
return false;
}
if ($mysql_password == null) {
events("Starting install roundcube Unable to stat Mysql password");
return false;
}
@mkdir($root, 0755, true);
events("Starting install roundcube sub-system mysql database {$server_database}...");
$q = new mysql();
$q->CREATE_DATABASE($server_database);
if (!$q->DATABASE_EXISTS($server_database)) {
events("Starting install roundcube unable to create MYSQL Database");
return false;
}
events("Starting setting permissions on Database with user {$user}");
echo "Starting......: " . date("H:i:s") . " Roundcube {$servername} set permissions on Database with user {$user}\n";
$q->PRIVILEGES($user, $mysql_password, $server_database);
events("Starting install roundcube installing source code");
echo "Starting......: " . date("H:i:s") . " Roundcube {$servername} installing source code\n";
shell_exec("/bin/rm -rf {$root}/*");
shell_exec("/bin/cp -rf {$srcfolder}/* {$root}/");
if ($q->mysql_password != null) {
$password = " --password={$q->mysql_password} ";
} else {
events("Starting install roundcube installing tables datas with null password");
}
$files[] = $sql_file;
$files[] = "{$srcfolder}/SQL/mysql.update.sql";
while (list($num, $line) = each($files)) {
events("Starting install roundcube installing tables {$server_database}/{$num}");
$cmd = "mysql --port={$q->mysql_port} --skip-column-names --database={$server_database} --silent --xml ";
$cmd = $cmd . " --user={$q->mysql_admin}{$password} <{$line}";
shell_exec($cmd);
events("Starting install roundcube installing datas {$server_database}/{$num}");
$cmd = "mysql --port={$q->mysql_port} --skip-column-names --database={$server_database} --silent --xml ";
$cmd = $cmd . " --user={$q->mysql_admin}{$password} <{$sql_datas}";
shell_exec($cmd);
}
if (is_file("{$root}/plugins/subscriptions_option/subscriptions_option.php")) {
$subscriptions_option = 1;
}
$q->checkRoundCubeTables($server_database);
$conf[] = "<?php";
$conf[] = "\$rcmail_config = array();";
$conf[] = "\$rcmail_config[\"db_dsnw\"] = \"mysql://{$q->mysql_admin}:{$q->mysql_password}@{$q->mysql_server}/{$server_database}\";";
$conf[] = "\$rcmail_config[\"db_dsnr\"] = \"\";";
$conf[] = "\$rcmail_config[\"db_max_length\"] = 512000; // 500K";
$conf[] = "\$rcmail_config[\"db_persistent\"] = FALSE;";
$conf[] = "\$rcmail_config[\"db_table_users\"] = \"users\";";
$conf[] = "\$rcmail_config[\"db_table_identities\"] = \"identities\";";
$conf[] = "\$rcmail_config[\"db_table_contacts\"] = \"contacts\";";
$conf[] = "\$rcmail_config[\"db_table_session\"] = \"session\";";
$conf[] = "\$rcmail_config[\"db_table_cache\"] = \"cache\";";
$conf[] = "\$rcmail_config[\"db_table_messages\"] = \"messages\";";
$conf[] = "\$rcmail_config[\"db_sequence_users\"] = \"user_ids\";";
$conf[] = "\$rcmail_config[\"db_sequence_identities\"] = \"identity_ids\";";
$conf[] = "\$rcmail_config[\"db_sequence_contacts\"] = \"contact_ids\";";
$conf[] = "\$rcmail_config[\"db_sequence_cache\"] = \"cache_ids\";";
$conf[] = "\$rcmail_config[\"db_sequence_messages\"] = \"message_ids\";";
$conf[] = "?>";
events("Starting install roundcube saving {$root}/config/db.inc.php");
echo "Starting......: " . date("H:i:s") . " Roundcube {$servername} db.inc.php OK\n";
@file_put_contents("{$root}/config/db.inc.php", @implode("\n", $conf));
unset($conf);
$wwwmultismtpsender = $hash["wwwmultismtpsender"][0];
$WWWEnableAddressBook = $hash["wwwenableaddressbook"][0];
events("OU={$hash["OU"][0]} EnablePostfixMultiInstance={$EnablePostfixMultiInstance}, SMTP={$wwwmultismtpsender}");
$conf[] = "<?php";
$conf[] = "\$rcmail_config = array();";
//.........这里部分代码省略.........
示例2: check_databases
function check_databases($bd)
{
$q = new mysql();
$q->checkRoundCubeTables($bd);
}
示例3: ROUNDCUBE_INSTALL
function ROUNDCUBE_INSTALL($servername, $root, $hash = array())
{
$srcfolder = ROUNDCUBE_SRC_FOLDER();
$sock = new sockets();
$ldap = new clladp();
$EnablePostfixMultiInstance = $sock->GET_INFO("EnablePostfixMultiInstance");
echo "Starting......: Roundcube {$servername}\n";
$GLOBALS["ADDLOG"] = "/var/log/artica-postfix/{$servername}.log";
if ($root == null) {
events("Starting install roundcube Unable to stat root dir");
return false;
}
if (!is_dir($srcfolder)) {
events("Starting install roundcube Unable to stat SRC");
return false;
}
$sql_file = "{$srcfolder}/SQL/mysql.initial.sql";
if (!is_file($sql_file)) {
events("Starting install roundcube Unable to stat {$srcfolder}");
return false;
}
$user = $hash["wwwmysqluser"][0];
$mysql_password = $hash[strtolower("WWWMysqlPassword")][0];
$server_database = str_replace(".", "_", $servername);
$server_database = str_replace("-", "_", $server_database);
events("Starting install roundcube sub-system mysql database {$server_database}...");
if ($user == null) {
events("Starting install roundcube Unable to stat Mysql username");
return false;
}
if ($mysql_password == null) {
events("Starting install roundcube Unable to stat Mysql password");
return false;
}
@mkdir($root, 0755, true);
events("Starting install roundcube sub-system mysql database {$server_database}...");
$q = new mysql();
$q->CREATE_DATABASE($server_database);
if (!$q->DATABASE_EXISTS($server_database)) {
events("Starting install roundcube unable to create MYSQL Database");
return false;
}
events("Starting setting permissions on Database with user {$user}");
echo "Starting......: Roundcube {$servername} set permissions on Database with user {$user}\n";
AddPrivileges($user, $mysql_password, $server_database);
events("Starting install roundcube installing source code");
echo "Starting......: Roundcube {$servername} installing source code\n";
shell_exec("/bin/rm -rf {$root}/*");
shell_exec("/bin/cp -rf {$srcfolder}/* {$root}/");
if ($q->mysql_password != null) {
$password = " --password={$q->mysql_password} ";
} else {
events("Starting install roundcube installing tables datas with null password");
}
$files[] = $sql_file;
$files[] = "{$srcfolder}/SQL/mysql.update.sql";
while (list($num, $line) = each($files)) {
events("Starting install roundcube installing tables {$server_database}/{$num}");
$cmd = "mysql --port={$q->mysql_port} --skip-column-names --database={$server_database} --silent --xml ";
$cmd = $cmd . " --user={$q->mysql_admin}{$password} <{$line}";
shell_exec($cmd);
events("Starting install roundcube installing datas {$server_database}/{$num}");
$cmd = "mysql --port={$q->mysql_port} --skip-column-names --database={$server_database} --silent --xml ";
$cmd = $cmd . " --user={$q->mysql_admin}{$password} <{$sql_datas}";
shell_exec($cmd);
}
$q->checkRoundCubeTables($server_database);
$conf[] = "<?php";
$conf[] = "\$rcmail_config = array();";
$conf[] = "\$rcmail_config[\"db_dsnw\"] = \"mysql://{$q->mysql_admin}:{$q->mysql_password}@{$q->mysql_server}/{$server_database}\";";
$conf[] = "\$rcmail_config[\"db_dsnr\"] = \"\";";
$conf[] = "\$rcmail_config[\"db_max_length\"] = 512000; // 500K";
$conf[] = "\$rcmail_config[\"db_persistent\"] = FALSE;";
$conf[] = "\$rcmail_config[\"db_table_users\"] = \"users\";";
$conf[] = "\$rcmail_config[\"db_table_identities\"] = \"identities\";";
$conf[] = "\$rcmail_config[\"db_table_contacts\"] = \"contacts\";";
$conf[] = "\$rcmail_config[\"db_table_session\"] = \"session\";";
$conf[] = "\$rcmail_config[\"db_table_cache\"] = \"cache\";";
$conf[] = "\$rcmail_config[\"db_table_messages\"] = \"messages\";";
$conf[] = "\$rcmail_config[\"db_sequence_users\"] = \"user_ids\";";
$conf[] = "\$rcmail_config[\"db_sequence_identities\"] = \"identity_ids\";";
$conf[] = "\$rcmail_config[\"db_sequence_contacts\"] = \"contact_ids\";";
$conf[] = "\$rcmail_config[\"db_sequence_cache\"] = \"cache_ids\";";
$conf[] = "\$rcmail_config[\"db_sequence_messages\"] = \"message_ids\";";
$conf[] = "?>";
events("Starting install roundcube saving {$root}/config/db.inc.php");
echo "Starting......: Roundcube {$servername} db.inc.php OK\n";
@file_put_contents("{$root}/config/db.inc.php", @implode("\n", $conf));
unset($conf);
$wwwmultismtpsender = $hash["wwwmultismtpsender"][0];
$WWWEnableAddressBook = $hash["wwwenableaddressbook"][0];
events("OU={$hash["OU"][0]} EnablePostfixMultiInstance={$EnablePostfixMultiInstance}, SMTP={$wwwmultismtpsender}");
$conf[] = "<?php";
$conf[] = "\$rcmail_config = array();";
$conf[] = "\$rcmail_config['debug_level'] =1;";
$conf[] = "\$rcmail_config['enable_caching'] = TRUE;";
$conf[] = "\$rcmail_config['message_cache_lifetime'] = '10d';";
$conf[] = "\$rcmail_config['auto_create_user'] = TRUE;";
$conf[] = "\$rcmail_config['default_host'] = '127.0.0.1';";
$conf[] = "\$rcmail_config['default_port'] = 143;";
//.........这里部分代码省略.........
示例4: check_databases
function check_databases($bd)
{
include_once dirname(__FILE__) . "/ressources/class.os.system.inc";
if (systemMaxOverloaded()) {
die;
}
$q = new mysql();
$q->checkRoundCubeTables($bd);
}