protected function jobStarted($jobScript) { $file = FileSystem::getRelativePath(getcwd(), $jobScript); echo "Running [0;36m{$file}:[0m"; // Call parent return call_user_func_array(array('parent', __FUNCTION__), func_get_args()); }
$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[1;36m{$table}[0m in [0;36m{$relPath}[0m: "; 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: [0;36m{$relPath}[0m\n"; dumpData($db, $table, $dumpPaths['data']); } } } echo "\n\nDone :-)\n\n";