Skip to content

Instantly share code, notes, and snippets.

@ibejohn818
Created June 11, 2014 18:15
Show Gist options
  • Save ibejohn818/6c2d9e70756405c69d95 to your computer and use it in GitHub Desktop.
Save ibejohn818/6c2d9e70756405c69d95 to your computer and use it in GitHub Desktop.
Cake 2.X Cakeshell template
#!/usr/bin/env php
<?php
//path to lib/Cake/Console/cake
$cakeShellpath = "";
//path to your default app directory. IE: /home/sites/mysite.com/cake/app
// ( So you don't have to add '--app /myapppath' for every call and if you're hosting multiple cake sites under a single installation)
$defaultAppPath = "";
$cmd = $cakeShellpath;
if(!in_array("-app",$argv) || !in_array("--app",$argv)) {
$argv[] = "--app";
$argv[] = $defaultAppPath;
}
foreach($_SERVER['argv'] as $k=>$v) {
if($k===0) {
continue;
}
$cmd .= " {$v}";
}
passthru($cmd,$res);
exit($res);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment