예제 #1
0
 protected function jobStarted($jobScript)
 {
     $file = FileSystem::getRelativePath(getcwd(), $jobScript);
     echo "Running {$file}:";
     // Call parent
     return call_user_func_array(array('parent', __FUNCTION__), func_get_args());
 }
예제 #2
0
    $dumpPaths = array('structure' => $tm->getDdlScript($table), 'data' => $tm->getDataScript($table));
    // Create parent directories
    foreach ($dumpPaths as $path) {
        if ($path) {
            FileSystem::createFilePath($path);
        }
    }
    $relPath = FileSystem::getRelativePath($workPath, $dumpPaths['structure']);
    echo "\n{$table} in {$relPath}: ";
    switch (dumpStructure($db, $table, $dumpPaths['structure'])) {
        case 0:
            echo "ok";
            break;
        case 1:
            echo "created";
            break;
        case 2:
            echo "updated";
            break;
    }
    if ($args->get('data')) {
        if ($dumpPaths['data'] === FALSE) {
            echo "\n   -> data dump skipped by config\n";
        } else {
            $relPath = FileSystem::getRelativePath($workPath, $dumpPaths['data']);
            echo "\n   -> data dumped in: {$relPath}\n";
            dumpData($db, $table, $dumpPaths['data']);
        }
    }
}
echo "\n\nDone :-)\n\n";