 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Anthony Ferrara's Blog: On Optimization in PHP
by Chris Cornutt August 10, 2011 @ 08:35:38
Anthony Ferrara has a new post to his blog today looking at something that's constantly a focus of user-facing applications, PHP ones or otherwise - application optimization. He specifically discusses handling it in PHP and some things to keep an eye out for.
When it comes to optimization, there are two competing viewpoints in the PHP community. Some say that optimization should only ever be an after thought and to avoid premature optimization at all costs. Others will say that this is impractical, and you should make your application fast as you write it, since then you won't have to go back and clean it up to make it faster. While I can understand the viewpoints of both sides, I am firmly in the former category.
He talks about the "90/10 Rule" of development (most of the work is done by only a small part of the code) and what that critical 10% could be made of. He also touches on the "60/40 Rule", "instinctual optimization" and the emphasis people put on benchmarks for their tool or framework of choice.
voice your opinion now!
optimize application opinion rule benchmark
QaFoo.com Blog: Howto write a Rule for PHPMD
by Chris Cornutt March 21, 2011 @ 09:16:57
On the QaFoo blog today Manuel Pichler has written up a guide to help you write a custom rule to use with the PHP Mess Detector (PHPMD) as extended from some of the current rules (it's always easier to start from examples).
Let us start with some architecture basics behind PHPMD. All rules in PHPMD must at least implement the PHP_PMD_Rule interface. You can also extend the abstract rule base class PHP_PMD_AbstractRule which already provides an implementation of all required infrastructure methods and application logic, so that the only task which is left to you is the implementation of the concrete validation code of your rule.
He walks you through some sample code and talks about some of the common interfaces that are available to your testing. He takes one of them, IFunctionAware, and looks at it specifically, showing how to use it to detect and add violations for the validation. He includes an example of writing a rule based on an existing software metric (in this case, the number of public methods). There's also bit at the end showing how to write a rule based on the "abstract syntax tree" to be able to check just about anything in the code you're looking to test.
voice your opinion now!
phpmd mess detector rule tutorial
Manuel Pichler's Blog: Howto create custom rule sets for PHPMD
by Chris Cornutt April 09, 2010 @ 13:19:25
If you've been using the PHP Mess Detector (PHPMD) to help clean up problem areas in your applications, but have needed more than just the basic rules that it comes with, you're in luck. Manuel Pichler has put together a new post for his blog about creating custom rules sets for the tool.
PHPMD can be seen as an one level down/low level equivalent to PHP_CodeSniffer. It is a simple command line tool that can be used to check your application's source code for possible bugs, suboptimal or overcomplicated code. The current release of PHPMD ships with three default rule sets.
The first deals with code size, the second checks for unused variables and the like and the third looks at naming conventions. He shows how to take one of the structures from one of these three and create a new rule. For his example it's a measurement of cyclomatic complexity. He also shows you how to exclude certain rules that might come in another set so you don't have to completely redefine to use pre-existing rules.
The latest release of PHPMD can be pulled from pear.phpmd.org or from its github repository.
voice your opinion now!
phpmd custom rule set tutorial
Stefan Koopmanschap's Blog: Serving frontend and backend from the same document root with symfony
by Chris Cornutt March 25, 2009 @ 09:31:45
Stefan Koopmanschap has a recent post to his blog about a small oversight (and gotcha other symfony developers should watch for) that he's made a few times when trying to work with a subdomain of his main symfony-powered website:
Quite often have I been staring at my virtualhost setup for the admin subdomain of this application, wondering why the hell it kept serving the frontend. I'd set the DirectoryIndex to backend.php, so why did it keep serving the frontend?
The culprit was something that's usually one of the first things set up when you load a new framework - the mod_rewrite rules in an .htaccess. Of course, since they were the default, things would get routed back to "index.php" instead of his "backend.php" as he wanted. To fix it, he moved these options out of the .htaccess and into the virtualhost configuration.
voice your opinion now!
symfony framework htaccess frontend backend modrewrite rule
Chris Hartjes' Blog: CakePHP + Nginx Configuration Update
by Chris Cornutt January 26, 2009 @ 10:21:57
In this new post from Chris Hartjes today he continues his look at combining a CakePHP application with the Nginx web server. This time the focus is on the configuration of the web server side of things to make the CakePHP routing work.
I'm in the process of creating the website for my upcoming book *and* had recently switched back from using Apache to using Nginx again, so I thought it might be time to roll up my sleeves and figure out how to make it work in a subdirectory. After much gnashing of teeth and pissing and moaning, I figured it out.
A simple configuration example is included as a part of the post showing how to correctly configure the rewrite routes to catch everything and send it back to the index.php file. His is a two-part process: it tries to match anything with "/foo" in it then, if it wasn't caught there, it sends it off to be rerouted to the front controller.
voice your opinion now!
cakephp framework nginx webserver rewrite rule configure
Elizabeth Naramore's Blog: PHP Throwdown Updates
by Chris Cornutt December 05, 2006 @ 08:34:00
Elizabeth Naramore has posted an update about the PHP Throwdown event being planned, including updates on the judges, prizes, sponsors, and registration.
Many people probably think the PHP Throwdown has stalled, but it's quite the contrary actually. We've been mulling over many things and have come to some conclusions. So if you're interested, read on!
The judges have been found, the categories are still being decided, prizes are en route, Jupiter Hosting has stepped up as a sponsor for the event, registration is coming soon, and the rules have been posted.
Be sure to check out the main page for complete details on the event. The PHP Throwdown is a competition to see what can be accomplished with PHP in 24 hours.
Who: You! You can compete in a team, or individually.
voice your opinion now!
phpthrowdown2006 update judge prize category sponsor rule registration phpthrowdown2006 update judge prize category sponsor rule registration
True Hacker! Blog: Digg style clean URLs with PHP and Apache
by Chris Cornutt November 29, 2006 @ 09:57:00
The 'true hacker!' blog has a new post today that gives you a quick four step process for creating some clean, Digg-style URLs for your site with some simple Apache configuration changes (mod_rewrite).
You might have noticed that Digg has a cool way of maintaining clean URLs. Digg actually uses LAMP - Linux/Apache/MySQL/PHP. But where are the .php extensions? The answer is here. 4 steps to implement your own Digg style clean URLs.
His method turns on Apache's rewrite engine (you do have mod_rewrite enabled, don't you?) and adds a rule to push all of the requests to two default PHP files. There's also a ForceType method that can be used to achieve the same effect. One .htaccess file later, you're in business and the PHP script only needs to access the $_SERVER['REQUEST_URI'] value to get the parameters.
voice your opinion now!
digg style clean url apache modrewrite rule forcetype digg style clean url apache modrewrite rule forcetype
International PHP Magazine: Poll Question The Features of Symfony Include
by Chris Cornutt November 28, 2006 @ 08:24:00
The results of the latest poll from the International PHP Magazine are in. The question this time asked which, of the options given, were your favorites in the Smyfony project's feature set. There was a clear winner above all of the others - the scaffolding that it makes so simple.
Some of the other options that were included but didn't get nearly as many votes were:
- Simple templating and helpers
- Multilingualism and I18N support
- Object model and MVC separation
- Ajax support
Following at a distant second was the "Object model and MVC separation" choice (and to others, "Enterprise ready" and "Ajax support" nipping close at its heels).
Be sure to cast your vote in this week's poll that asks your opinion on some of the rules that the PHP Throwdown has set in place. Vote for the one that you think fits best with the spirit of the competition.
voice your opinion now!
poll question symfony throwdown rule scaffolding poll question symfony throwdown rule scaffolding
Simplesem.com: 4 Steps to Make Your PHP Site Indexed Properly
by Chris Cornutt May 12, 2006 @ 05:46:15
In a (very) brief post on Simplesem.com today, there's some suggestions to help you and your site be properly noticed by Google and other search engine spiders out there.
It's common tendency for Search Engine Optimization specialists to avoid use of dynamic URLs and not groundlessness. Search Engine Spiders don't index URLs overwhelmed with dynamic parameters.
So if your site is PHP-based and resides on an Apache Server then you might consider carrying out these four simple steps to boost your traffic.
The steps are basic, but they are a good place to start if you're looking at getting started with "search engine optimization". The main suggestion is to use an Apache rewrite rule to change url parameters into part of the path (and vice-versa). Obviously, it's not the solution for everyone as you'd need access to the server's config to use it.
voice your opinion now!
search engine index properly rewrite rule apache mod_rewrite search engine index properly rewrite rule apache mod_rewrite
|
Community Events
Don't see your event here? Let us know!
|