News Feed
Sections
News Archive


Community Events
php|tek 2008 PHP Conference



feed this:

PHP in Action Blog:
I want enums in PHP
0 comments :: posted Monday May 12, 2008 @ 08:41:16
voice your opinion now!
I want Enums in PHP

That's how this new post on the PHP in Action blog starts this morning. The one thing that he wants is enumeration support in PHP. He shows how it can currently come close with a "roles" system:

Useful examples I've encountered in web programming are states or stages in a process and user roles. Another kind of example is one I used in PHP In Action: an authorization system with three fixed roles or categories of user: regular, webmaster and administrator.

He sets up an example class that sets constants for the different access levels rather than just relying on strings to handle it (which, as he points out, could very easily be misspelled and not throw any kind of error) .

tagged with: enumeraction enum phpinaction multiple value constant


Hasin Hayder's Blog:
Web scrapping in a smart way, making a "Today in History" object in PHP
0 comments :: posted Tuesday April 29, 2008 @ 10:27:41
voice your opinion now!

Hasin Hayder has written up a quick tutorial for his blog that shows how to create your own "Today in History" page with details from Scopesys pulled with a little web scraping.

There are thousands of services available on web who are presenting interesting as well as education information which you can really integrate in your web page or make a nice widget and let others use them seamlessly with their content delivery platforms. In this article I am going to show you how you can make a nice Today-in-History widget with the help of the data provided in Scopesys.

He wisely recommends that you check one thing first about the content you're grabbing - the copyright it carries with it. This could get you into big trouble down the line depending on whose content it is. The actual script is pretty simple - he defines some constants as markers for where things start and stop in the HTML and then uses strpos to get the locations for his substr call to grab the segments.

tagged with: todayinhistory widget copyright scopesys constant define substr strpos

Michael Kimsal's Blog:
Another PHP bugbear…
0 comments :: posted Wednesday March 05, 2008 @ 19:08:00
voice your opinion now!

Micheal Kimsal has pointed out another "bugbear" he's found in his work with PHP - this time it's with the use of class constants.

My issue is not with the language itself (this time!) but how this sort of documentation is handled. Updating public documentation well ahead of a release creates confusion.

He's referring to the documentation for the class constants not quite matching up with the current functionality (resulting in a T_PAAMAYIM_NEKUDOTAYIM). He wants consistency in the documentation and maybe references to what it requires to use a certain bit of code.

tagged with: docuemntation static class constant consistent

Lars Strojny's Blog:
New magic constant in PHP 5.3
0 comments :: posted Friday February 22, 2008 @ 15:02:00
voice your opinion now!

In this new blog post today, Lars Strojny talks about a new magic constant that will be joining its brothers in the upcoming PHP 5.3 release - __DIR__.

In PHP 5.3 there will be another magic constant __DIR__. [...] To allow this, the internal function php_dirname() has been moved in the Zend Engine and is now called zend_dirname(). Nevertheless an alias still exists.

__DIR__ will join the other constants (like __LINE__ and __FUNCTION__) to help give the currently running script a little introspection for things like its filename, what class it's currently in and now, what directory the file currently lives in.

tagged with: dir magic constant directory php5 new


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

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