本文整理汇总了PHP中Executor::executeDown方法的典型用法代码示例。如果您正苦于以下问题:PHP Executor::executeDown方法的具体用法?PHP Executor::executeDown怎么用?PHP Executor::executeDown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Executor
的用法示例。
在下文中一共展示了Executor::executeDown方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printUsage
function printUsage($error = null)
{
echo "PoC Migration tool (ivasilchev) \n";
echo $error;
echo "Usage : migrate < up | down > <migration name> \n";
echo "Example: migrate up special-days \n";
echo "\n";
exit;
}
if ($argc < 3) {
printUsage("Not enough paramteres");
}
if (in_array($argv[1], ['up', 'down']) == false) {
echo "------{$argv[2]}-----";
printUsage("Error: Invalid parameter - migration step must be 'up' or 'down'");
}
if (in_array($argv[2], array_keys($aliases)) == false) {
printUsage("Error: Unknown migration alias " . $argv[3] . "\n" . "Available migrations: " . implode(',', array_keys($aliases)));
}
$migration = new $aliases[$argv[2]]['class']();
$executor = new Executor(include_once 'dbconfig.php');
switch ($argv[1]) {
case 'up':
$executor->executeUp($migration);
break;
case 'down':
$executor->executeDown($migration);
break;
default:
exit('Unexpected input for migration type :' . $argv[1]);
}