Skip to content

Commit

Permalink
Added videoid parameter to postupload hook
Browse files Browse the repository at this point in the history
  • Loading branch information
tomnomnom committed Mar 27, 2012
1 parent c44d51c commit 348db4e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Scripts/UploadSingle.php
Expand Up @@ -18,7 +18,7 @@
}
$filename = $argv[1];

$executeHooks = function ($stage, $videoFile) use($log){
$executeHooks = function ($stage, $videoFile, $videoId = null) use($log){
$returnValues = array();
$stage = ucFirst(strToLower($stage));

Expand All @@ -36,6 +36,9 @@

$log->info("Executing {$stage} hook [{$fullPath}]");
$cmd = $file->getPathname().' '.escapeshellarg($videoFile);
if ($videoId){
$cmd .= ' '.escapeshellarg($videoId);
}
exec($cmd, $output, $returnValue);
if ($returnValue != 0){
$log->warn("[{$fullPath}] had a non-zero return code for [{$videoFile}]");
Expand Down Expand Up @@ -131,6 +134,6 @@
}

// It worked if we got this far
$executeHooks('Postupload', $filename);
$executeHooks('Postupload', $filename, $videoId);

exit(0);

0 comments on commit 348db4e

Please sign in to comment.