本文整理匯總了PHP中Vars::tableExist方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vars::tableExist方法的具體用法?PHP Vars::tableExist怎麽用?PHP Vars::tableExist使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Vars
的用法示例。
在下文中一共展示了Vars::tableExist方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: trim
// prod protection for cc all
if ($command == 'cc' && $arg1 == 'all' && ENV == 'prod') {
echo "*********************************************************************\n";
echo " !!! This site is now under PROD mode. ARE YOU SURE TO CLEAR ALL !!! \n";
echo "*********************************************************************\n";
echo "yes/no\n";
$confirmation = trim(fgets(STDIN));
if ($confirmation !== 'yes') {
echo "abort...\n";
exit(0);
}
}
//-- Clear cache
if ($command == 'cc') {
if (Vars::tableExist() && ($var = Vars::findByName('system'))) {
$var->delete();
echo " - System var cache has been cleared.\n";
}
if ($arg1 == 'all') {
echo " - Drop table 'vars' ";
echo Vars::dropTable() ? "success\n" : "fail\n";
echo " - Drop table 'user' ";
echo User::dropTable() ? "success\n" : "fail\n";
}
}
//-- Import DB
if ($command == 'import' && $arg1 == 'db' && (is_null($arg2) || $arg2 == 'core')) {
echo " - Create table 'vars' ";
echo Vars::createTableIfNotExist() ? "success\n" : "fail\n";
echo " - Create table 'user' ";