News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
feed this:

Debuggable Blog:
Two CakePHP Tricks
August 25, 2008 @ 15:58:03

On the Debuggable blog Felix has posted two quick tips you can use in your CakePHP application - one related to debugging and the other about custom config files.

For tip #1

If you just put a debug() statement in, you will see hundreds of outputs and would not know which one belongs to the case you are interested in. My favorite solution to this problem is to use the Configure class as a toggle for showing the debug information.

For tip #2

This is a very simple one. To make your application configurable via a global config file, all you need to do is the following.

Both come complete with code examples.

0 comments voice your opinion now!
cakephp trick debug function custom configure file



Dhiraj Patra's Blog:
Caching PHP Programs with PEAR
August 07, 2008 @ 12:58:09

In a recent post to his blog Dhiraj Patra looks at the caching functionality that PEAR has to offer via the PEAR Cache package.

Caching is currently a hot topic in the PHP world. Because PHP produces dynamic web pages, scripts must be run and results must be calculated each time a web page is requested, regardless if the results are the same each time. In addition, PHP compiles the script every time it is requested. [...] PEAR's Cache package offers a framework for the caching of dynamic content, database queries, and PHP function calls.

He talks a bit about what kind of methods are included with the package and shows examples of how it works for function call caching, caching the output from the script execution and how to implement your own custom caching extension of the main code to make it even more flexible.

3 comments voice your opinion now!
pear cache tutorial function call output custom handler


Daniel Cousineau's Blog:
PHP Women Best Practice Contest Posts
July 31, 2008 @ 16:09:00

Daniel Cousineau posted copies of his submissions to the PHP Women group's Article Contest (Best Practices) that finishes up today.

I made a few posts to the PHPWomen.org Article Competition and felt I should share them here.

His three submissions are:

There's still (a little) time to get your own submission in to the contest to get over and submit your article for your chance to win a copy of Zend Studio and maybe get your article featured in Linux Pro Magazine.

0 comments voice your opinion now!
phpwomen article contest submit flash error magic function pathing


Developer Tutorials Blog:
Parallel web scraping in PHP cURL multi functions
July 29, 2008 @ 07:57:00

The Developer Tutorials blog has posted a tutorial about scraping other website information in parallel (with their permission, of course) with the help of the cURL extension.

For anyone who's ever tried to fetch multiple resources over HTTP in PHP, the logic is trivial, but one key challenge is ever-present: latency delays. While web servers have perfectly good downstream links, latencies can increase script execution time tenfold just by downloading a few external URLs. But there's a simple solution: parallel cURL operations. In this tutorial, I'll show you how to use the "multi" functions in PHP's cURL library to get around this quickly and easily.

He starts with a basic cURL example, grabbing the content from example.com and putting it into a variable. He modifies this to make it a bit more complex and to run multiple fetches in parallel - creating more than one cURL object and using the culr_multi_* methods to manage them.

0 comments voice your opinion now!
webscraping curl function multi parallel tutorial


Asvin Balloo's Blog:
SEO friendly URL in PHP
July 24, 2008 @ 11:14:40

Asvin Balloo has posted a quick look at making the URLs of your website a bit more "pretty" and SEO-friendly.

When I started implementing mod_rewrite in websites I had a problem in PHP as how to make a SEO friendly URL. All tutorials were geared towards how to implement mod_rewrite, about modifying .htaccess files, but none treated how to make the urls friendly with dynamic content.

He shares a function that he found that helped him a great deal - a method called friendlyURL. It changes a bit of text into a more friendly version of itself ("this is a test" becomes "this-is-a-test") that can be used in anything you'd want. An example could be in automatically generating links to other pages on your site that search engines can easily follow.

0 comments voice your opinion now!
seo friendly url function parse search engine


Stefan Mischook's Blog:
How to call functions from another class
July 22, 2008 @ 12:06:24

Stefan Mischook has a (very) basic introduction video posted showing how to call functions/methods from another class outside the one you're currently using.

Recently I was asked by someone how they could call a function found in one class, in another. This may seem like basic stuff to those of us who know...but please keep in mind, at one time, none of us knew anything!

You can check out the video here. Be sure to check out more of the great videos he's created too on topics ranging from MVC frameworks to a beginner's guide to PHP.

0 comments voice your opinion now!
video tutorial call function class method


Vinu Thomas' Blog:
mbstring Functions by default in PHP
July 18, 2008 @ 07:57:16

In a new post to his blog, Vinu Thomas talks about a set of functions that can make your life easier when handling unicode strings - the mb_* methods of the mbstring extension.

When dealing with multiple languages and internalization in PHP, some of the default functions in PHP end up mangling up the unicode characters in PHP. This is evident when you have a lot of funny looking characters coming up on your web page instead of the actual characters. [...] There is an extensions called mbstring which you can install in PHP which gives you a set of functions which are unicode ( actually multibyte ) ready.

He mentions some of the replacements like mb_send_mail instead o fmail and mb_strlen instead of the usual strlen. Thankfully, there's a simple way to make use of these functions without having to replace a lot of code - a setting in your php.ini (mbstring.func_overload) that tells your application to seamlessly replace things behind the scenes.

0 comments voice your opinion now!
mbstring function utf8 unicode multibyte replace


Eran Gelperin's Blog:
Operator overloading in PHP
July 08, 2008 @ 10:29:54

Eran Gelperin gives an overview of the current state of overloading abilities PHP has in a new blog post today:

Operator overloading is a programming language features that allows operators to act differently depending on the type of data they are operating on. Since OOP lets us create custom types (classes), there are plenty of opportunities to do useful and interesting code manipulations using operator overloading.

He talks about magic functions, the additions that the SPL made, the PECL addition operator and how much its currently being discussed on the PHP internals list.

0 comments voice your opinion now!
operator overload spl magic function operator internals mailing list


Brian DeShong's Blog:
Small news that's big to me my PHP Testfest submissions made it into 5_3!
June 13, 2008 @ 10:25:12

Congrats to Brian DeShong for having his submissions from this year's TestFest be included in the next release of PHP, version 5.3's build.

Someday I'll look back on this post and think it's super lame, but my recent submission of two tests for PHP's putenv() function made it into PHP_5_3! I've officially made a contribution it's a red letter day, folks. Without Atlanta PHP and PHP's Testfest, none of this would have been possible.

His tests ran with putenv() and the safe_mode_allowed_env_vars/safe_mode_protected_env_vars settings in use. You can see the inclusion in this commit message (by Lars Strojny).

0 comments voice your opinion now!
putenv function safemode ini setting php5 codecoverage


Alex Netkachov's Blog:
BAT file tips
June 06, 2008 @ 07:58:08

Alex Netkachov has updated a post he made a while back (in 2006 in fact) about making Windows batch files (.BAT) that would do the same thing as some of the functions in PHP. He's added two more to it today - one for string replace and another for splitting a string.

The replace is as simple three line call, much the same as PHP's and the split call, while a bit more complex, is still pretty straight forward (it just needs a few extra variables).

Other methods in the post include a "switch" method, defining a procedure and updating variable by its name.

0 comments voice your opinion now!
bat file tip string replace split function port



Community Events











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


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

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