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

Anthony Ferrara:
Prefix Trees and Parsers
May 19, 2015 @ 10:13:18

Anthony Ferrara has a new post, following up from his previous look at tries and lexers, continuing along the path to apply what he learned to a HTTP routing system.

In my last post, Tries and Lexers, I talked about an experiment I was doing related to parsing of JavaScript code. By the end of the post I had shifted to wanting to build a HTTP router using the techniques that I learned. Let's continue where we left off...

He starts off with thinking that lexing and parsing the routes out into their respective tokens instead of breaking them up as many do (i.e. splitting on the slashes). He shows the results of this lexing and some parser code to handle these results and turn them into something useful. He did find that the current setup caused a lot of overhead (255 new states per character) so he optimizes the processing with a "default" trie but it was still pretty intensive.

He decided to go a different way at this point, opting for the radix tree structure instead. He includes the implementation of this tree for parsing the routes and his matching lexer updates. Finally he shows how to apply code generation to the results of these changes and how coming back to the "slash splitting" could help...

0 comments voice your opinion now!
lexer parser example prefix tree radixtree route matching slashes

Link: http://blog.ircmaxell.com/2015/05/prefix-trees-and-parsers.html

Alison Holloway's Blog:
PHP 5.2.2 Setup on Windows
May 16, 2007 @ 11:19:00

In her blog today, Alison Holloway offers a quick tip for developers out there trying to install PHP 5.2.2 on their Windows machine and running into trouble. Maybe it's the same issue?

I've just been setting up PHP 5.2.2 on Windows XP Pro, with Apache 2.0.59. I couldn't get Apache to find the correct php.ini file. It was looking in C:Windows, instead of where I installed PHP. The httpd.conf file told Apache to look in C:Program FilesPHP, but it wasn't. So none of the extensions were loading.

The problem? She wasn't putting in the right kind of slashes into her configuration file. It couldn't find the right path because of it. The issue isn't mentioned in the latest version of the Underground PHP and Oracle Manual (but will be in the future).

0 comments voice your opinion now!
php5 windows setup slashes forward back underground manual php5 windows setup slashes forward back underground manual



Community Events

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


voicesoftheelephpant library opinion performance interview api php7 configure framework release conference application symfony2 language podcast laravel example series introduction community

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