News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
feed this:

Richard Heyes' Blog:
Reading a specific line in a file
April 07, 2008 @ 12:56:08

Richard Heyes has thrown together some code for a simple thing that he's seen developers request over and over again - moving to/reading from a specific line in a file.

After reading something on the php-general list I decided that a) I'm bored, and b) I'll write something which handles it. So here it is.

His code is simple - looping through the lines of the file until it locates your desired target (with some error checking along the way). Plus, if it's already fetched, it keeps it in a cached array for future retrieval.

1 comment voice your opinion now!
reading specific file line example code class



SitePoint PHP Blog:
PHP Manual CLI style 2.0
November 29, 2007 @ 09:35:00

Sometimes, you just can't get to a web browser to look up something from the PHP manual (or might not want to). Another option is the command line and in this new post to the SitePoint PHP blog, Troels Knak-Nielsen shows you a method for getting the entire manual entry right at your prompt neatly formatted.

One thing, I missed with either of the two [other solutions mentioned], was the ability to see the entire manual entry. It's quite often, that the manual actually holds useful information (Who'd known that!), so I find myself using www.php.net a lot. Or I did, until I decided to do something about it. Now, shell-scripting isn't what I spent most of my time on, so it's not with out a bit of pride, that I present to you phpm two-oh.

Most of the rest of the post is his bash script ready top cut and paste as well as some simple instructions on getting it working. (An emacs bonus is also included - a method for binding the script to a key to act on the current word.)

0 comments voice your opinion now!
command line manual bash script command line manual bash script


Mikko Koppanen's Blog:
Creating a simple line graph
October 15, 2007 @ 12:55:31

Mikko Koppanen has another post to his blog today that once again shows the combination of PHP and Imagick to create/output an image - this time, it's a simple line graph.

This example demonstrates how Imagick can be used to create graphs. This graphing class itself is mostly a demonstrative example. There are also some hardcoded values in the graph (like the steps in the values on the left hand side) but it should not be hard to refine it into a more elegant graphing solution.

The graph is made using the Imagick drawing functions that extends the standard "draw" class. The code produces a graph with a (straight) line drawn from point to point - code and output examples are both included.

1 comment voice your opinion now!
imagick image output graph line tutorial imagick image output graph line tutorial


Christian Wenz's Blog:
phpa-norl, a phpa port for Mac OS X and Windows
July 09, 2007 @ 07:58:00

On the Hauser & Wenz blog today, Christian Wenz points out a patched version of the interactive command line PHP client, phpa to work on a Mac OS X machine - phpa-norl.

phpa is an interactive command line shell for PHP by David Phillips. Stefan Fischerlander, usually known as a SEO expert and Perl admirer, has patched phpa for Mac OS X and Windows (the default builds theredo not seem to support a feature required by phpa). The result: phpa-norl. Stefan successfully ran this on OS X, and I could confirm that it runs on Windows, as well

He also mentions some features of the client including a history feature that makes looking back through previous commands simple.

0 comments voice your opinion now!
phpanorl command line shell interactive macosx windows phpanorl command line shell interactive macosx windows


Felix Geisendorfer's Blog:
Command line fun in CakePHP 1.2
October 16, 2006 @ 07:18:32

On his ThinkingPHP blog today, Felix Geisendorfer hands out mor eCakePHP goodness with some talk about working with the popular CakePHP framework in an unlikely place - on the command line with the "bake" utility.

The "bake" utility is included with the CakePHP distribution and helps a developer scaffold out an application with minimal effort. Things have been changed in the recent distributions, though:

Unlike the old bake.php, which was only used to auto-generate code for you, this one follows a much cooler concept. The main idea is to have an interface to a wide variety Tasks.

The new and improved "bake" program takes the tasks created and builds out a bit more functionality than just the scaffolding as the version before did. Felix includes an example of a task (a simple echo) just to show how it's formatted.

0 comments voice your opinion now!
cakephp framework task bake command line scaffold cakephp framework task bake command line scaffold


PHPit.net:
PHP on the command line
March 13, 2006 @ 07:26:42

PHPit.net has posted another new tutorial, this time they look at the command-line, providing the basics to those that have only used PHP in the web-based world.

PHP is traditionally only used on the internet to power our websites, but it's also capable of doing more. Since version 4.3 PHP ships with a special version which can be used to execute scripts on the command line, and do certain system tasks. If you're a Linux user, you probably know what the command line is, but if you're a Windows user you might not.

They show the code/commands in the examples they give in the context of it running on a Windows machine, but it's not a far leap to work with it on a unix-based system as well. They start with the basics - how to get to it, how to use it - before moving on to other features, like taking in arguments. They wrap it up with a sample application, a calculator, that can do the four basic operations on the two numbers entered.

0 comments voice your opinion now!
php command line tutorial introduction beginner php command line tutorial introduction beginner



Community Events











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


PHP5 example mysql database release releases cakephp package ajax security application developer code job zend book PEAR conference zendframework framework

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