 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Chris Hartjes' Blog: Don't Fear The Command Line Using CakePHP Shells
by Chris Cornutt September 05, 2008 @ 07:53:01
Chris Hartjes has a new post to his blog today focusing on using a bit of the CakePHP framework's functionality from the command line.
I'm porting a spaghetti-PHP application over to using CakePHP I am moving their existing authorization system over to using Cake's Auth component. Of course, they are storing all their passwords in plaintext in the user account table, so I needed an easy way to convert all the existing passwords over to be encrypted using the same hash that Auth would use.
With the help of the shells and tasks that the framework makes availiable, he's able to make a simple 24 line class (EncryptPasswordShell) that extends the Shell object and loops through the data to push it back into the database in the correct password format.
voice your opinion now!
cakephp commandline shell task tutorial convert password
Symfony Blog: Batches are dead, long life to tasks!
by Chris Cornutt June 16, 2008 @ 12:05:36
On the Symfony blog today, Romain Dorgueil shows how to create tasks to help automate things in your application like database updates, console scripts or other "repetitive maintenance tasks".
Symfony 1.1 extends symfony 1.0 pake tasks to create a powerful and uniform command line utility for your projects, fully integrated with the symfony Command Line Interface (CLI).
This means that is has the abilities to automatically support a "help" parameter, to grab a current task list the app is using, correct handling of the input parameters, set up a good environment and make sure that the source is readable. The post shows how to create a new task for your application - their examples are a "doNothingTask" that, well, does a lot of nothing and the typical "doHelloWorldTask" that just echoes.
They show how to define the task (including a namespace for it) and how to run it, outputing the results of the execute() method ("I did nothing successfully!" in the first case and a string of passed in parameters in the second.
voice your opinion now!
task batch tutorial symfony framework helloworld
Developer Tutorials Blog: Running PHP cron jobs - regular scheduled tasks in PHP
by Chris Cornutt May 16, 2008 @ 09:32:25
On the Developer Tutorials blog, Akash Mehta has posted an introduction to working with command-line PHP scripts and cron jobs for site automation.
Scheduled tasks are a fairly common feature in modern web applications. From cleaning out caches every 24 hours to checking subscription periods and even generating reports, more web applications live by the clock than ever before. But how do we schedule the execution of a PHP script on the server side?
He shows the two key things to getting it working - an example of a command-line call to a PHP script (executed through his /usr/bin/php) and an example of a line from a crontab showing how to execute the script at midnight every day.
voice your opinion now!
cron job crontab commandline execute schedule task tutorial
Tiger Heron Blog: First steps with PHP - booting a script, Part 1
by Chris Cornutt March 19, 2008 @ 08:48:48
On the Tiger Heron blog, there's a continuation of the series that Tony Freixas has been writing to following the beginning steps of working with PHP. First there was the download/install, then setting up a development environment. This time, he actually gets around to writing a bit of basic code.
Specifically, I will describe how I boot my PHP scripts and why I boot them the way I do. Part 1 shows how my requirements for code portability and maintainability influence the boot process. Part 2 will go into more detail about the specific steps executed by the boot code.
His basic task for the first example is to make a templating sort of system, calling a Navigation class to output links in list items. He outlines the goals of the project, what he's found for his current solution and some alternatives he's discovered along the way.
voice your opinion now!
development tutorial series environment task navigation
Felix Geisendorfer's Blog: Command line fun in CakePHP 1.2
by Chris Cornutt 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.
voice your opinion now!
cakephp framework task bake command line scaffold cakephp framework task bake command line scaffold
|
Community Events
Don't see your event here? Let us know!
|