News Feed
Sections




News Archive
feed this:

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

SitePoint PHP Blog:
Interactive PHP Debugging with PsySH
September 30, 2014 @ 12:53:30

The SitePoint PHP blog has a new tutorial posted by i>Miguel Ibarra Romero showing how to use the PsySH tool to do some interactive debugging of your PHP applications via both the command line and a web frontend.

It's 1:00 a.m., the deadline for your web application's delivery is in 8 hours… and it's not working. As you try to figure out what's going on, you fill your code with var_dump() and die() everywhere to see where the bug is. [...] Is this situation familiar to you? PsySH to the rescue. PsySH is a Read-Eval-Print Loop (or REPL). You may have used a REPL before via your browser's javascript console. If you have, you know that it possesses a lot of power and can be useful while debugging your JS code.

He walks you through the install via Composer and some of the basic commands and syntax for executing PHP code inside its shell. Command line testing is good, but debugging full applications is a bit more difficult. He shows how to integrate the tool into a sample application that calls PsySH via a "debug" call and output via a set of "window" objects. He also includes a bit close to the end about debugging with unit tests, executing them from inside the shell as well.

0 comments voice your opinion now!
interactive debugging psysh repl unittest commandline web

Link: http://www.sitepoint.com/interactive-php-debugging-psysh/

NetTuts.com:
Running WordPress on OpenShift Part2
July 14, 2014 @ 13:22:52

NetTuts.com has posted the second part of their series about getting WordPress up and running on a RedHat OpenShift cloud instance. In part one of the series they looked at OpenShift as a whole and created the initial application. This part focuses more on setting up the right environment and getting WordPress installed using their rhc client tool.

In this tutorial, we will dive deeply into OpenShift to understand the custom build and deployment process. We will also learn the command-line tool for logging and troubleshooting when our application is down. [...] We did almost all of those tasks using the web interface which is great and very convenient; however, in addition to the dashboard, OpenShift offers a powerful client tool call rhc client.

They guide you through the installation of the command-line client (rhc) as a Ruby gem and include the results of the "help" command. They include example commands showing how to: ssh into the instance, deploy the application and add more functionality to prepare for the WordPress install. There's also some information about environment variables and creating a custom build process to deploy WordPress correctly.

0 comments voice your opinion now!
openshift tutorial install configure wordpress environment commandline

Link: http://code.tutsplus.com/tutorials/running-wordpress-on-openshift-part2--cms-19947

Dutch Web Alliance:
The definitive remote debug and unittest with PHPStorm guide part 6
January 09, 2014 @ 11:20:28

The Dutch Web Alliance has posted the sixth part of their series helping you debug/unit test your applications with PHPStorm and Xdebug. In this new post they focus on working with command-line applications.

So there is already a lot covered: debugging web applications, testing your units, getting code coverage. But one thing that remains is trying to debug your command line applications. Even today more and more applications aren't built for primarily the web, but for other purposes or many web frameworks have some kind of "console" component which allows you to easily create command line tools that deals with asynchronous handling of data, or just mere as cronjobs.

They walk you through the steps you'll need to be sure everything it set up correctly for PHPStorm to catch the debug calls:

  • Ensuring Xdebug is active
  • Validating that PHPStorm is listening for incoming requests
  • Configuring Xdebug on where to connect
  • Setting up the mapping for paths inside PHPStorm
0 comments voice your opinion now!
xdebug phpstorm unittest debug tutorial series part6 commandline

Link: http://dutchweballiance.nl/techblog/the-definitive-remote-debug-and-unittest-with-phpstorm-guide-part-6/

Cal Evans:
Signaling PHP
October 28, 2013 @ 09:21:42

Cal Evans has a new post to his site today about a book he's published covering a topic not really focused on in the PHP world - command-line usage. The book, "Signaling PHP" covers the use of the process control extension to handle command-line signals.

Most of the PHP I write these days is CLI scripts. I really wanted to be able to trap signals in some of my scripts. I struggled with this for a while; I even spent an entire weekend googling and reading only to find out that most of the information out there was either wrong, confusing, or incomplete. I decided that once I figured it out, I was going to put everything I learned together in one place to help others that were struggling with this topic as well.

The eBook is available for purchase and download now at a suggested price of only $5 USD. If you've been looking for a quick, concise guide to using process control in PHP, you should check it out.

0 comments voice your opinion now!
signaling ebook calevans cli commandline

Link: http://blog.calevans.com/2013/10/27/signaling-php/

PHPMaster.com:
Say Hello to Boris A Better REPL for PHP
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.

0 comments voice your opinion now!
boris repl read eval print loop tool commandline github


DZone.com:
The Wheel Symfony Console
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).

0 comments voice your opinion now!
symfony console reusable component pro con commandline


NetTuts.com:
Your One-Stop Guide to Laravel Commands
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.

0 comments voice your opinion now!
tutorial laravel4 artisan commandline example custom


Maarten Balliauw:
Working with Windows Azure from within PhpStorm
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").

0 comments voice your opinion now!
windows azure phpstorm ide tutorial framework commandline


Joshua Thijssen:
Debugging remote CLI with phpstorm
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.

0 comments voice your opinion now!
commandline application debug xdebug phpstorm tutorial screenshots


Smashing Magazine:
Powerful Command Line Tools For Developers
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)
0 comments voice your opinion now!
commandline cli tools developer list curl ngrep netcast sshuttle siege mitmproxy



Community Events





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


laravel install list interview deployment opinion symfony community introduction series zendserver update api podcast framework release package language library tips

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