コード例 #1
0
ファイル: console_db.php プロジェクト: jeffreycai/reader
<?php

//-- SiteUser:Clear cache
if ($command == "cc") {
    if ($arg1 == "all" || $arg1 == "siteuser") {
        echo " - Drop table 'site_user' ";
        echo SiteUser::dropTable() ? "success\n" : "fail\n";
    }
}
//-- SiteUser:Import DB
if ($command == "import" && $arg1 == "db" && (is_null($arg2) || $arg2 == "site_user")) {
    //- create tables if not exits
    echo " - Create table 'site_user' ";
    echo SiteUser::createTableIfNotExist() ? "success\n" : "fail\n";
}
//-- SitePermission:Clear cache
if ($command == "cc") {
    if ($arg1 == "all" || $arg1 == "siteuser") {
        echo " - Drop table 'site_permission' ";
        echo SitePermission::dropTable() ? "success\n" : "fail\n";
    }
}
//-- SitePermission:Import DB
if ($command == "import" && $arg1 == "db" && (is_null($arg2) || $arg2 == "site_permission")) {
    //- create tables if not exits
    echo " - Create table 'site_permission' ";
    echo SitePermission::createTableIfNotExist() ? "success\n" : "fail\n";
}
//-- SiteRole:Clear cache
if ($command == "cc") {
    if ($arg1 == "all" || $arg1 == "siteuser") {