Example #1
0
        $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' ";
    echo User::createTableIfNotExist() ? "success\n" : "fail\n";
}
//-- Import Fixture
if ($command == 'import' && $arg1 == 'fixture' && (is_null($arg2) || $arg2 == 'user')) {
    User::importFixture();
    echo " - Import fixture for User\n";
}
if ($command == 'import' && $arg1 == 'fixture') {
    if (isset($arg2)) {
        import_fixture($arg2);
    } else {
        global $enabled_modules;
        foreach ($enabled_modules as $module) {
            import_fixture($module);
        }
    }