|
Sponsored Link
|
[Update: I've put these parser/lexer tools on BitBucket and Github; enjoy!]
From time to time, I find that I need to put a parser together. Most of the time I find that I need to do this in C for performance, but other times I just want something convenient, like PHP, and have been out of luck.
This thanksgiving I set out to remedy this and adapted lemon to optionally emit PHP code, and likewise with JLex.
You need a C compiler to build lemon and a java compiler and runtime to build and ...
Continue...
High Code Coverage through extensive Unit Testing is the Holy Grail in software development. Theoretically, it would create an environment where the code could be debugged, re-factored, and extended while keeping a stable and overall clean system. Unfortunately, this is just about as elusive as the Holy Grail. So how can we do Unit Testing in the real world.
On the Zend Developer Zone there's a post looking at uploading files in a Adobe Flex-based application that uses a slightly different than usual approach to uploading files through Zend_Amf.Zend AMF is a PHP implementation of the AMF (Action Message Format) binary protocol within the Zend Framework. I had to implement a system to upload files that were a little different than what is typically used in Flash, so I built upon Zend AMF for my needs. Researching a little on the net, I found a solution that...
In this quick post to the Purple Rock Scissors blog, there's a suggestion from Rob Zienert about how you can avoid a "cache stampede" on your site's caching tool with the help of a pseudo-lock on the record.A cache stampede occurs when a cached item expires and multiple clients attempt to repopulate the cache at the same time. Take for example a page cache expires and a few thousand people try to refresh the generated HTML. That's a lot of instant load - hitting the database, re-saving the cache and...
In a new post to his blog, Josh Holmes has posted about some of the testing he done with Azure and SimpleCloud to get them connected and playing nicely together.I've been playing with Zend's SimpleCloud API for the webcast that I'm doing with Zend today. I started with the Zend Framework Quickstart tutorial but changed out the backend to hit the Azure Tables and such (well kinda - I used Zend Studio 8 Beta 2 and didn't use the ZF tool but I still created a little guestbook). I'm going to expand this...
New on VoidWeb.com there's a post looking at clustering PHP applications with the help of the mod_proxy component that can be added into the Apache web server.Often for my clients, I have to prepare the deployment strategy for their LAMP based web applications. Some of them are small to medium businesses and are starting up so a single server setup work out for them. But there are few large web applications too which are growing continuously in terms of users and demands scaling either horizontally or...
In a few days I will attempt one of my most tricky conference schedules in a long while (perhaps ever), I get the feeling a vacation will be in order after all this.
It was a privilege to get my talks accepted accepted at the PHP Barcelona Conference 2010 in Barcelona, Spain where I will be speaking about Hidden Features of PHP as well as APC & Memcached. Then I get to fly home to Toronto for about 24 hours, and from there travel to ZendCon in Santa Clara, California, where I get to speak about the...
Developing applications has become simpler and simpler these days and the multitude of IDEs out there can help you keep all of your files organized and linked together so you know everything is in its place. There's one thing that only a handful out there can do, though - enforce coding standards. Thankfully, there's a tool that can help you keep your code following down the right path and PHPBuilder.com has a new tutorial about using it - PHP_CodeSniffer.Although defined according to formal grammar and...
If you've been having issues upgrading to the latest version of PHPUnit (v3.5), Sebastian Bergmann might have the answer to your problems that's related to the PEAR installer and this bug.The new dependencies of the PHPUnit package, such as PHPUnit_MockObject for instance, are installed first. The PHPUnit package itself is installed last. And herein lies the problem: PHPUnit_MockObject installs the new version of MockObject/Generator.php before the PHPUnit package is upgraded. This upgrade deletes the...
Popular posts from PHPDeveloper.org for the past week:Jay Allen's Blog: Adminer | The World's Smallest MySQL Admin Script
Smashing Magazine: Common Security Mistakes in Web Applications
Vance Lucas' Blog: Practical Uses for PHP 5.3 Closures
Paul Jones' Blog: PHP Framework Benchmarks on Github
Phil Sturgeon's Blog: CodeIgniter 2.0 is stable (enough)
Lorna Mitchell' Blog: Best Practices in API Design: Audio and Slides
Leszek Stachowski's Blog: php anachronic coding standards
SitePoint.com: OAuth for PHP...
The issues related to upgrading from a previous version to PHPUnit 3.5 that I mentioned in the release announcement are more serious than I initially thought. Only today did I find the time to really investigate the root cause.
Here is the situation before the upgrade:
root@ubuntu:~# pear list
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.7 stable
Console_Getopt 1.2.3 stable
PEAR 1.9.1 stable
Structures_Graph 1.0.3 stable...
A quick announcment: Following on the heels of
1.11.0BETA1, the Zend Framework team is pleased
to announce the immediate availability of the first release candidate of
version 1.11.0. Almost 30 issues have been resolved since the beta, most of
which occurred during our bug hunt days this
week.
On WebReference.com there's a new tutorial posted about localizing your website by defining a character set to use for your content.The process of making your applications/websites usable in many different locales is called internationalization, While customizing your code for different locales is called localization. Localization is the process of making your applications or websites local to where it is being viewed. For example, you can make a website more local to a particular place by converting its...
This year I was invited to speak at ZendCon 2010, the PHP conference of the year in Santa Clara, CA (USA). I'm giving three talks there and I host the uncon sessions (see my previous announcement about that).I'm not only sharing the stage with great icons from the community, but I'm also celebrating the fact I recently became a ZCE for PHP 5.3.At the end of ZendCon, I'll be a part of a community panel to answer questions regarding community and user groups. At PHPNW I closed the conference with a short...
Over on Reddit.com there's an interesting post (yes, despite some of the comments made on it) about variable variables that turns into a detailed look at PHP variable handling as based around "$".OK, here's the thing: [variable variables are] only the entrance of the rabbit hole. [...] The first thing to understand is what $ is. $ is actually a shorthand for ${} and means "return the value of the variable whose name is contained in this".The response goes on to talk about variable names as strings, a few...
New on the ServerGrove blog today is a quick post talking about how you can enforce key constraints on a MongoDb with Doctrine in Symfony.Of course you can define unique indexes to prevent duplicate values and there are a couple of different syntax options to do so, which are clearly defined in the official documentation. But defining and creating the indexes is not enough. You must specify when you want to enforce the constrain, this is due to the fact that the PHP driver needs to tell MongoDB to throw...
In response to a post from Leszek Stachowski about underscores in PHP class development, Paul Jones has shared his own thoughts on the matter - that he disagrees with Leszek and suggests keeping the underscore prefix for private methods.I think the underscore-prefix for protected and private is a good convention to keep. As with many things about programming, this convention is not for the program, it is for for the programmer. For example, limiting your line length to about 80 characters is a good idea,...
In a new post to his blog Padraic Brady takes a look at remote timing attacks that happen on a nanosecond scale and whether or not we, as application developers, should take them seriously. Timing attacks involve gleaning information off of systems based on the response and execution time.I've been following the progress of Remote Timing Attacks with a lot of interest over the years, during which time there has been an obvious trend in improving the technique. The most recent reported cases of Remote...
Paul Reinheimer has posted something to think about for both developers and those planning out projects and features - the paths the users will take through the application, not just the features they'll have available.There's a popular turn of phrase "pave the cow paths", which was introduced to me by my friend Chris Shiflett in one of his talks. The essence (as I understand it) of paving the cow paths is that it's easier to positively encourage users to act they way they already want to, than to have...
Since may 11 TLD's (top-level domainnames) have been added. In order for this to work successfully, a lot of applications will have to be fixed.
Many email-validation scripts might use an approach like this:$ok = preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$/i', $email);This one is pretty simple, it matches the most common address formats, as long as the tld (.com, nl, .uk, etc) is under 6 characters. For a bit more sophistication you might want to ensure that the tld is a bit more valid:$ok =...
|
|