News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Gonzalo Ayuso's Blog:
Building a small microframework with PHP (Part 2). Command line interface
August 29, 2011 @ 13:19:11

Continuing on with his previous investigations into microframworks and what it takes to create them, Gonzalo Ayuso has posted his second part of the series - a look at working on the command line.

In my last post we spoke about building a small microframework with PHP. The main goal of this kind of framework was to be able to map urls to plain PHP classes and become those classes easily testeable with PHPUnit. Now we're going to take a step forward. [...] It's pretty straightforward to create a command line interface (CLI) for our microframework.

He shows how to use the getopt function and the $GLOBALS superglobal to pull in arguments given to the command line script. He hooks this into the framework and makes it possible to define the controller and action to execute (with a few examples to show it in action). You can find this updated code on his github account.

0 comments voice your opinion now!
microframework exercise cli commandline parse tutorial


blog comments powered by Disqus

Similar Posts

PHP-GTK Community Site: Accessing geo-nick with Zend Framework (Zend_XmlRpc_Client)

Tony Bibbs' Blog: HOWTO: Deploy Your Application Using PEAR

Ivan Iordanov's Blog: extending Zend_Db_Table to create NestedSet models

Vance Lucas: Introducing Bullet: The Functional PHP Micro-Framework

PHPMaster.com: Introduction to Git, Part 1


Community Events

Don't see your event here?
Let us know!


security laravel language laravel5 library introduction podcast release php7 community version interview example video series extension framework api voicesoftheelephpant opinion

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework