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

Christian Weiske's Blog:
First work on the Generic PHP Application Installer
September 27, 2010 @ 08:57:51

In a recent post to his site Christian Weiske shares some of the first steps being made toward an installer he's made that could be used for installing PHP applications of just about any type.

Half a year after I collected requirements for a generic PHP application installer, Kore already implemented the first bits of it for the Arbit installer, which is supposed to be generic enough for other PHP applications, too. He also held a talk at the PHP Unconference in Hamburg, collecting more requirements for it. There is already some code in arbit's svn repository which at least generates a .phar file that checks your application requirements and collects configuration options.

An example of a simple build is included that will create the Arbit installer package that, when executed, will give a basic configuration screen. They suggest making .phar files executable by the web server too (interpreted by PHP) just to make things simpler.

0 comments voice your opinion now!
generic application installer arbit example


Jani Hartikainen's Blog:
Reusable "generic" actions in Zend Framework
December 29, 2008 @ 07:55:13

In this recent blog entry Jani Hartikainen looks at the creation of generic actions for Zend Framework applications - methods that can be used to help eliminate code duplication:

Sometimes you will need nearly the same functionality in many actions. [...] There are several ways to deal with this, such as moving the code into a separate function, or an action helper. But in this post, I'm going to introduce so called "generic actions" - parametrized, easy to reuse actions - which is an idea similar to django generic views.

His example takes a generic action - one that grabs and output records from a table - and modifies it to take in parameters from the defining function as to which action/controller/model and ID to use. Then this action can be used over and over in multiple places without having to do any copy and paste coding.

0 comments voice your opinion now!
generic zction zend framework reuse duplicate


CodeUtopia Blog:
Generic collections in PHP
September 19, 2008 @ 12:06:53

On the CodeUtopia blog Jani Hartikainen has posted some thoughts on generic collections in PHP and a class he's created to try to introduce them to the language.

Strictly typed languages usually use "generic" collection classes instead of arrays. They are kind of like PHP arrays which the programmer can tell which type of items to accept. This is of course only natural when you don't have dynamic typing, but it can also be useful for avoiding programming errors, so I thought I'd try making a basic generic collection class in PHP...

He shows how ti works with a simple code example - creating a new collection type (a string) and pushing the data into it. Calling the add() method on the string throws an exception because of the data type defined. You can grab the code from his svn repository.

0 comments voice your opinion now!
generic collection class download svn example string


David Walsh's Blog:
Using PHP Generic Objects To Organize Your Code
December 07, 2007 @ 07:52:00

David Walsh has put together and posted a class he's created around creating generic objects to help with code organization.

I like using PHP classes to keep my code organized and easy to maintain. I know that they consume more memory than simply using an array or variable system, but if memory is an issue, I'd get more memory. Saving time by coding in a maintainable fashion is more important to me than upgrading a server. I've written a very generic, flexible PHP class that I use in my PHP code to get and set variables for use within the page.

His class is included as are two example of its use - a basic option that sets properties on the object and an example of its use with a database, parsing the results into an object with a load() call.

3 comments voice your opinion now!
generic object class example organize generic object class example organize


Maarten Balliauw's Blog:
Generic arrays in PHP
October 25, 2007 @ 08:50:00

On his blog, Maarten Balliauw has an interesting new post dealing with the use of generics in PHP:

Assuming everyone knows what generics are, let's get down to business right away. PHP does not support generics or something similar, though it could be very useful in PHP development. Luckily, using some standard OO-practises, a semi-generic array can easily be created, even in multiple ways! Here's the road to PHP generics.

He shows the two ways to make generics possible - the hard way (simple inheritance and type hinting) and the more flexible way (a GenericArrayObject that extends the normal ArrayObject to make appending and validating the contents of the array simple).

1 comment voice your opinion now!
generic array arrayobject extend filter validation generic array arrayobject extend filter validation


IBM developerWorks:
Batch processing in PHP
December 07, 2006 @ 09:06:00

Both this post on the Zend Developer Zone and tis post on the International PHP Magazine's website point to a new article over on the IBM developerWorks website by Jack Herrington, Batch processing with PHP.

What do you do when you have a feature in your Web application that takes longer than a second or two to finish? You need some type of offline processing solution. Check out several methods for offline servicing of long-running jobs in your PHP application.

He talks about cron and its role in offline processing (including a basic primer on its format) before getting into the example itself. He looks at three examples:

  • building an email queue
  • building a generic queue system
  • dumping out the database
Each example comes complete with code and descriptions to help you work them up on you very own system.

0 comments voice your opinion now!
batch process cron mail quene generic database dump batch process cron mail quene generic database dump


Dikini.net:
Poor man's macro programming in php
July 26, 2006 @ 13:27:48

vlado, thinking more about a previous post, started wondering what exactly you'd need to do to get macros working in PHP. Read on for his answers.

What is the closest we can get to that without actually changing anything in php (poor man's version? What minimal sugar does php need to make it comfy? What is the natural syntax for macros in php? I definitely don't know the answers to these questions but let's try.

He doesn't create working code, but he does make it a PHP-ish looking solution. He also suggests that while PHP doesn't have this ability (yet?), the generic function pattern can help mimic its functionality pretty closely.

0 comments voice your opinion now!
macro programming poor man generic function pattern macro programming poor man generic function pattern


Community News:
GeSHi Syntax Highlighter
December 13, 2005 @ 07:28:45

There's a project out there for those that might need a bit more to their syntax highlighting than the standard PHP functionality might allow. Enter GeSHi, the Generic Syntax Highlighter - and it's latest snapshot on it's development track to version 1.1.1.

GeSHi started as an idea to create a generic syntax highlighter for the phpBB forum system, but has been generalised to this project. GeSHi aims to be a simple but powerful highlighting class.

GeSHi supports PHP5 and Windows, and has even been used to highlight code on ASP pages. Numerous blogs, wikis and forums use GeSHi, including Dokuwiki, Mambo, phpBB and WikkiWiki.

From the development branch comes another snapshot on the way to 1.1.1. This one adds beginning support for VHDL, courtesy of Lingzi Xue and Java, thanks to Tim Wright.

You can check out the complete specs of the software here, or just download it and give it a try...

1 comment voice your opinion now!
syntax highlighter generic syntax highlighter generic



Community Events





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


interview code list laravel series language community release introduction podcast refactor developer install unittest opinion testing api framework symfony2 threedevsandamaybe

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