Localization, Tools and PHP 5.3

Written on October 23, 2008 by Mike Gerwitz

A lot’s been going on since the last entry (after a short break). The first I’d like to mention is the progress regarding localization.

I’ve begun work creating language packs and integrating them. However, while doing so, I had to implement unlink() functionality within the datapack (language packs use the datapack wrapper). This broke some code. Therefore, I’m working on fixing that up (and working on some minor optimizations), and will continue with localization after.

The process has spawned two new tools - the “lang” and “dped” tools. The lang tool is a command-line administration tool (which may be used in place of the web interface even when it is created) to create and modify language packs. It will also be used to aid the translation process.

The dped tool I created because debugging datapacks is the biggest pain in the ass I’ve ever seen. Working with easily corrupted binary data (as in, my code has to be perfect, because if it’s one byte off in writing, it may corrupt a lot of data) is not fun. The tool will allow the creation and manipulation of the datapacks. It will also display detailed information, such as header information, descriptors, and even allow the direct modification of descriptors. The tool may also be used to read/write to the datapack.

Perhaps the biggest change is the decision to go with PHP 5.3. It took many months of thought, on and off, and I finally decided within the past couple hours to go with it. Some may think this is a bad decision. I’ll try to outline some of the reasons why I’m doing this:

  • PHP 6 is on the way. It will contain many new features that would be unwise to continue without - it’s the future of PHP. PHP 5.3 incorporates many of these new features, such as namespaces. Web hosts will not have much of a problem upgrading from 5.2 to 5.3 - its’ a minor upgrade (though a major leap in PHP). However, it will take some time to move to PHP 6. Therefore, we’ll be able to use many of the features, instead of sacrificing so many because of web hosts.
  • Namespaces are a major selling point. Currently, I’m prefixing everything with “wk_”. It works, but what if something comes along with the same prefix (or what if something already exists)? It’s also a tedious method. Namespaces will solve this problem. Not only that, but it will allow the overloading of core functions. This makes the system even more customizable. This also means unicode support may be feasable, should I have the time (unless someone else takes that up) in PHP 5.3. There would then be very little difference between WebKernel in PHP 5.3 and 6. In the long run, this would be an excellent decision.
  •  Most major web hosts support PHP 5 and keep it up to date. Upgrading to PHP 5.3 shouldn’t take too long. If it does - so what? WebKernel is still far off. PHP 6 may be released by the time it’s fully complete (I do not know its release date - I’m just considering it). So that gives web hosts plenty of time to upgrade.
  • No dealing with revision numbers (5.2.X) for PHP 5.2 to determine compatibility. 5.3 will work - period.
  • Late static binding is a necessity to ensure classes can be overloaded properly.
  • OpenSSL support for OpenID, which I plan to encorporate as one (of many) authentication options, sometime in the future.
  • getopt() will work on all OS’s now. While I do not endorse nor will I test or maintain WebKernel on Windows systems, this means I can get rid of my command-line option parser and use PHP’s core function.

I am still revewing changes in PHP 5.3, but they just keep getting better. I have looked over the majority of the changes and must say I am very impressed - excited, even - about the direction it is going in. I hope that some day PHP will evolve to be a C-like langauge with more advanced features such as pointers, compiler directives, varibable type declarations, etc. I understand PHP wants to keep it simple, but they should provide the option for the more skilled developers. But PHP is evolving and I’m very happy to be sticking with it. I’ll cross my fingers for PHP 7.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>