本文整理匯總了PHP中BigTree::tableContents方法的典型用法代碼示例。如果您正苦於以下問題:PHP BigTree::tableContents方法的具體用法?PHP BigTree::tableContents怎麽用?PHP BigTree::tableContents使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BigTree
的用法示例。
在下文中一共展示了BigTree::tableContents方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: backupDatabase
static function backupDatabase($file)
{
if (!BigTree::isDirectoryWritable($file)) {
return false;
}
$pointer = fopen($file, "w");
fwrite($pointer, "SET SESSION sql_mode = 'NO_AUTO_VALUE_ON_ZERO';\n");
fwrite($pointer, "SET foreign_key_checks = 0;\n\n");
// We need to dump the bigtree tables in the proper order or they will not properly be recreated with the right foreign keys
$q = sqlquery("SHOW TABLES");
while ($f = sqlfetch($q)) {
$table = current($f);
// Write the drop / create statements
fwrite($pointer, "DROP TABLE IF EXISTS `{$table}`;\n");
$definition = sqlfetch(sqlquery("SHOW CREATE TABLE `{$table}`"));
fwrite($pointer, str_replace(array("\n ", "\n"), "", end($definition)) . ";\n");
// Get all the table contents, write them out
$rows = BigTree::tableContents($table);
foreach ($rows as $row) {
fwrite($pointer, $row . ";\n");
}
// Separate it from the next table
fwrite($pointer, "\n");
}
fwrite($pointer, "\nSET foreign_key_checks = 1;");
fclose($pointer);
return true;
}