 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
PHPMaster.com: Say Hello to Boris A Better REPL for PHP
by Chris Cornutt April 02, 2013 @ 10:34:00
On PHPMaster.com today Shameer C has a new tutorial introducing you to Boris, a REPL (read-eval-print loop tool) that's a bit more enhanced than the basic PHP interactive shell.
As web developers, we know the importance of the JavaScript console provided by the browser in testing out code snippets. We don't need to write an entire HTML page and JavaScript code just to verify the functioning or logic of a small routine we wrote. Instead, we simply run the expressions in the console and immediately see the results. Similarly, a REPL (Read-Eval-Print Loop) is the console of a programming language in which we can write code line-by-line and see what it does. [...] PHP's REPL is very good in what it does, although it does have some limitations. [...] And so, Boris tries to solve these problems and other concerns as well.
He walks you through the installation (via a git clone and, later, through Composer) and shows how to run it as well as some sample output. He also shows how to make a custom command-line Boris runner and how to embed it into your application. His example of a tool that would benefit from this is a command-line web service client using Boris and Guzzle.
voice your opinion now!
boris repl read eval print loop tool commandline github
DZone.com: The Wheel Symfony Console
by Chris Cornutt March 13, 2013 @ 11:22:31
In this new post to DZone.com, Giorgio Sironi kicks off a series that looks at reusable components in the PHP development world. In this first post of that series he looks at the Symfony console component .
Symfony is one of the most popular open source PHP frameworks on the market. The Symfony Components, however, are loosely coupled projects that can be reused as a library outside of an application based on Symfony. The component this article explores is Console (symfony/console on Packagist and GitHub), dedicated to quickly build console applications.
He goes on to talk about some of the "pros" of using the component (including built-in argument/input handing and multiple "commands") and some of the "cons" of is use (including its size and some of the built-in features you can't really work around).
voice your opinion now!
symfony console reusable component pro con commandline
NetTuts.com: Your One-Stop Guide to Laravel Commands
by Chris Cornutt March 01, 2013 @ 10:56:44
Over on NetTuts.com today they've published a "one stop guide" to creating Laravel commands that can make using the Laravel PHP framework simpler. The format for these commands are more related to the Laravel 4 version of the framework (still in beta).
In this day and age, it's quite normal for a developer to have an understanding of consoles, and how to issue basic commands. But what if you could code your own custom commands to improve your workflow? If we look back to Laravel 3, you might remember that it offered tasks. Tasks were extremely helpful, but still came up short for more complex operations. Thankfully, Laravel 4 packs a beefed up Artisan that will make your life as a developer so much easier!
They start by introducing you to Artisan and what it can do already, then move into how you can create you own custom commands (with code examples). They show you how to add a description, coloring for the output, work with arguments, use confirm/question prompts and working with dependencies you might need.
voice your opinion now!
tutorial laravel4 artisan commandline example custom
Maarten Balliauw: Working with Windows Azure from within PhpStorm
by Chris Cornutt January 03, 2013 @ 09:54:47
Maarten Balliauw has a new post today showing you how to work with your Azure site from inside the popular PHP IDE phpStorm.
Working with Windows Azure and my new toy (PhpStorm), I wanted to have support for doing specific actions like creating a new web site or a new database in the IDE. Since I'm not a Java guy, writing a plugin was not an option. Fortunately, PhpStorm (or WebStorm for that matter) provide support for issuing commands from the IDE. Which led me to think that it may be possible to hook up the Windows Azure Command Line Tools in my IDE.
He shows how to add a new "framework" to the IDE for the Azure CLI tools and how to get to a command line from inside the editor. From there you can execute any of the Azure CLI calls just as you would outside of the IDE (like his example, creating a new site called "GroovyBaby").
voice your opinion now!
windows azure phpstorm ide tutorial framework commandline
Joshua Thijssen: Debugging remote CLI with phpstorm
by Chris Cornutt December 24, 2012 @ 10:11:00
Joshua Thijssen has a recent post for all the PHPStorm users out there (or maybe investigating a new IDE) and are looking for a way to debug your PHP apps easily with XDebug. Well, he's come up with a step-by-step guide to help you get it all set up and working, complete with screenshots. He helps you debug command-line applications, but the setup will work for your web apps too.
Even in these days, with full-featured PHP IDEs around, I still see PHP developers using var_dump() and die() to debug their code. Not only is this a very bad way of "debugging", it has other dangers as well [...]. We've probably all been there,.. But we don't have to. Debugging your code properly through an IDE is quite easy, but one of the major problems is debugging CLI code. Since many frameworks like Zend, Symfony and micro-frameworks like Cilex can be used to create command-line apps, cronjobs and even "deamons", so how do we easily debug this kind of code?
He starts with the setup of a development instance (he recommends a clone-able virtual machine environment) and shows how o configure both XDebug and PHPStorm to work together happily. He shows what configuration options and steps you'll need to take to be able to debug the CLI apps too, including a command-line option to specify the IP to report the debugging into back into.
voice your opinion now!
commandline application debug xdebug phpstorm tutorial screenshots
Smashing Magazine: Powerful Command Line Tools For Developers
by Chris Cornutt October 30, 2012 @ 10:18:56
On the Smashing Magazine site today they've posted a list of powerful CLI tools that every developer should at least know about to help make their lives easier - six of them ranging from SSH tunnels to HTTP testing.
Good tools are invaluable in figuring out where problems lie, and can also help to prevent problems from occurring in the first place, or just help you to be more efficient in general. Command line tools are particularly useful because they lend themselves well to automation and scripting, where they can be combined and reused in all sorts of different ways. Here we cover six particularly powerful and versatile tools which can help make your life a little bit easier.
The tools they mention are all things you'd install on a unix-based system:
- Curl
- Ngrep (network packet searching)
- Netcat (to work with network connections)
- Sshuttle (SSH tunneling)
- Siege (HTTP benchmarking)
- Mitmproxy (capturing proxy, both HTTP and HTTPS)
voice your opinion now!
commandline cli tools developer list curl ngrep netcast sshuttle siege mitmproxy
Joshua Thijssen's Blog: Using augeas (in PHP)
by Chris Cornutt June 04, 2012 @ 08:17:56
In this new post to his blog, Joshua Thijssen looks at using the Augeas tool in a PHP application. Augeas is a configuration editing tool, making it easy to parse many different types of configs and transform them into a tree structure.
Even though I really like using sed and awk, sometimes its hard to change or add parameters in configuration files. Big sed statements that may or may not work, double checking if everything has been done correctly etc. Augeas is a really cool tool that lets you view / add / modify and delete all kind of data from configuration files. If you are using Puppet, you are probably aware of this tool, but I notice that a lot of PHP developers have never heard of it.. Let's explore..
He shows an example of a configuration file and how the "augtool" command line script can be used to modify one of them. He then shows how to use the tool's library to set the server's "date.timezone" setting in the php.ini.
voice your opinion now!
augeas commandline library configuration files
PHPMaster.com: Maintaining your Server with Command Line PHP
by Chris Cornutt April 17, 2012 @ 09:37:16
Stephen Thorpe has a new article posted on the PHPMaster.com site today about using command line PHP to handle some of the automation on your server.
n this article we'll look at the advantages of using PHP CLI. I'll show you how to test PHP's Command Line Interface / Interpreter (CLI) on your server, and then we'll look at some of the options available for PHP CLI including the interactive shell and how to create executable scripts. Finally, I'll give you a couple of examples of scripts to use to maintain your server written in PHP.
He introduces the command-line executable for PHP and shows how to use it to create some simple scripts (including ones that take in command-line arguments). He shows how to make a simple script to monitor disk usage (using the unix command "df") and a backup script that copies files/folders over to another device.
voice your opinion now!
commandline tutorial introduction
Odafe Ojenikoh's Blog: Interactive PHP CLI Applications using Zend Form
by Chris Cornutt February 16, 2012 @ 11:09:57
Odafe Ojenikoh has submitted a post he's written up showing how to create a command line PHP application with the help of the Zend Framework and it's Zend_Form elements.
Over the weekend, I was toying with the idea of interactive cli applications using readline() and Zend Form for validating input. My motivation for using Zend Form or rather Zend Form elements was to exploit the power of features such as labels, validators, filters and the prospect of reusing forms within web application code.
His example code defines a Filter for the form errors (returning them as a string) and a "Cli" class that handles the interaction with the command line. Next up is a class defining the form elements - a prompt for a color name and either of the words "thank" and "you". The Cli class transforms the form elements into prompts on the command line and lets you define validators to check their input.
voice your opinion now!
zendform zendframework cli commandline application tutorial
|
Community Events
Don't see your event here? Let us know!
|