This document discusses three ways to build command line interfaces (CLI) using Zend Framework: freestyle, Zend_Tool, and creating a custom CLI application using Zend Framework MVC. It describes building a "bugU" CLI application that makes phone calls using the Tropo API as an example of the custom approach. The custom approach overrides default objects like the bootstrap, request, and response to build a CLI application without new skills while reusing existing Zend Framework code. Code samples of the custom bootstrap, request, router, and controller classes are presented.
8. Freestyle
curl, wget, etc.
? Handy tools
? Easy to ^cron ̄ a process
? Can usually use existing code as-is
? Unnecessary overhead
9. Freestyle
curl, wget, etc.
? Handy tools
? Easy to ^cron ̄ a process
? Can usually use existing code as-is
? Unnecessary overhead
? Security ramifications
23. What the Tropo side looks like
<?php
_log('Number To Call:'.$numToCall);
_log('Payload:'.$payload);
call('+'.$numToCall,
array("callerID" => '16155551212',
"timeout" => 30)
);
say ($payload, array('voice'=>'veronica'));
hangup();
call('+16157158812',array('network'=>'SMS'));
say('I sent a message to '.$numToCall.' saying
'.$payload);
hangup();
?>
25. NOT A TROPO AD
? Tropo is pretty cool
? Free for development
? Cheap for production
? Adam Kalsey is pretty dang cool
? Awesome shirts if you can get one
? http://tropo.com
26. bugU
? Make a phone ring from the command line
? Have to override 3 of the default objects
C Custom Bootstrap
C Custom Request
C Custom Response
29. bugU
? Make a phone ring from the command line
? Have to override 3 of the default objects
C Custom Bootstrap
C Custom Request
C Custom Response
? Sample is more complex than necessary to
show flexibility
C Implemented Views
C Implemented Context Switching