Skip to content

Instantly share code, notes, and snippets.

@joseph-montanez
Created March 30, 2011 08:56
Show Gist options
  • Save joseph-montanez/894085 to your computer and use it in GitHub Desktop.
Save joseph-montanez/894085 to your computer and use it in GitHub Desktop.
Sample of running a starting tasklet, waiting for it to finish and start another
<?php
require_once 'app.php';
$id = \App\Task\add($title = 'DVD XML Info', $cmd = 'lsdvd -Ox');
while (!\App\Task\isCompleted($id)) {
sleep(1);
}
$task = \App\Task\get($id);
$xml = new SimpleXMLElement($task->output);
$cmd = sprintf(
'mplayer dvd://%s -v -dumpstream -dumpfile %s.vob',
$xml->longest_track,
$xml->title
);
\App\Task\add('Rip DVD!!!!', $cmd);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment