>
> I guess my question is this:  how do I fire off a controller/action
> pair via a CLI script?

This should fire the PostsController::index action:

/app/webroot/cli.php
---------------------------------------------------------------
$_GET['url'] = '/posts/index';
require_once('index.php');
---------------------------------------------------------------

If you want the 'url' to be variable do something like this:

/app/webroot/cli.php
---------------------------------------------------------------
if (isset(|$argv[0]|))
    $url =|| |$argv[0]|;
else
    $url = '/default';

$_GET['url'] = $url;
require_once('index.php');
---------------------------------------------------------------
||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~||
php -q cli.php /posts/index
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
will then do the same as the first example.

Let me know if this works for you.

Optionally you can also set the url to 'favicon.ico' to manually abuse 
the Dispatcher for whatever eval plans you might have ; ). But that's a 
little hackish.

-- Felix


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to