a programmer's best friend :: Entries from March 2004 |
Thursday, March 25. 2004Bugzillas greatest bug
A few hours ago I had some trouble logging into our bug-tracking system. Of course there was no real problem, I just forgot my passwort and I've never logged into it from this computer, so there was no password-manager to assist me. Even worse, I could not use the "I'm so stupid, I forgot my password, please email me a new one"-Button because my mailserver has hanged since the day before and my provider hasn't fixed the problem, yet.
So I decided to use my shell-account, open, run the mysql-client and search for the password in the database. Finding the database useb by bugzill was no problem, but there was no "user" table! I took another few minutes to ascertain: there where lots of tables, a "groups"-table, a "user_group_map" and so on. But no table named "user" or something similar. I could not believe, that bugzilla may work without a "user"-table, so I asked my friend to log into bugzilla. As I assumed, he could not log into bugzilla, too! My fears became true - somehow the user-table of bugzilla was removed. Maybe by an SQL-injection-attack from some bad guys, maybe by a terrible bug in bugzilla or maybe by one of the system's administrators who droped this table by accident. It took some time searching for a file containing the SQL-statements used during the installation of bugzilla that initializes the database-structure. Later we decoverd a table in the existing database. This table is called "profiles" and contains all the data we expected in the non-exiting table "user"! Logging in bugzilla was quit easy after changing my password stored this table. But my friends still seemed to be in trouble. He had not forgotten his password, but he also could not to log in. Once again, we updated his password in the database - without success. Finally we recognized, that he tried to access with his user-name and password instead of his email-address and password. Shortly after solving this problem, we realized once more: usually the bug is in front of the screen. Wednesday, March 24. 2004pat recommends "Advanced PHP Programming"
Today I received my copy of George's book "Advanced PHP Programming". After I skipped thru the table of contents and read some chapters I've to say that I'm amazed. Finally there's a book about PHP that deals with concepts instead of only hacking some source code.
George is talking about "Designing a good API", "Design Patterns", "Error Handling", "Unit Testing" and a lot of other topics that are useful for solving the web problem. There's only one thing, that makes pat sad: in the chapter about using templates for web application there's not a single reference to patTemplate, but nobody's perfect. So if you are using PHP, pat says "Buy this book!". And as last words: George is not paying us, if that's what you wanted to ask.(Although he now should....) patError 1.0 beta released
Dealing with errors and failures is a mess. Errors may appear in every part of an application. Some of them can be ignored others do harm. Furthermore the complexity of errors usually grows with the complexity of the application.
Using patError allows you to handle all kind of errors in an unitary and easy way. Even if patError is very easy to use, it is very flexible in design and allows all kinds of error-handlng. patError Overview Tuesday, March 23. 2004Making progress with patTemplate 3.0
I've been directing a lot of work towards the new patTemplate version and I'm finally making some progress. Most of the old features are now supported by the new (completely revamped) engine. It already supports repetitions, condition templates, simple conditions, oddEven templates and varscopes.
Furthermore some new features have been implemented like the conditions "__first" and "__last" which may be helpful for creating lists as well as some systemvariables that can be added automatically. A quite interesting feature is the new "modulo" template type, that allows you to define a special template for every 5th entry in a list (of course this is not restricted to the 5th entry). The most interesting change is the new structure of the package, which allows driver based readers, dumpers, filters, etc. If you are interested in the development, you may take a look at the source in our CVS repository [1] or download the daily snapshot [2]. Of course you may also take part in the feature discussion [3]. [1] http://cvs.php-tools.net [2] http://snaps.php-tools.net [3] http://forum.php-tools.net/viewtopic.php?t=19 Thursday, March 18. 2004PHP5 RC1 released
Today the first release candidate of PHP5 has been released and we'll now start test-driving our packages with PHP5. Our newer project already seemed to be working quite flawless with the last beta, so chances are good that there's not much work ahead of us.
We encourage you to test the release canditate (though not in production environment) and report bugs at bugs.php.net. It can be downloaded from http://www.php.net/downloads.php#v5, for more information on PHP5 read Andi's announcement. Nearly at the same time the forth release candidate of PHP4.3.5 has been released and is available at php.net. Accessing the eBay API with PHP
I recently started working on a class that acts as a wrapper for eBay's XML API. eBay provides an API for nearly all functions that are available on their site: You may search for item, browse categories, leave feedback and even manage your seller account.
The PEAR package I'm working on will make these functions available as methods of an objects and thus allow you to use them without any knowledge of the eBay XML syntax. You may browse the code in our CVS repository or download an alpha version of the packge (does not support a lot of functions) at pear.php-tools.net. If anyone knows about a package developed by eBay that provides the same functionality, please let me know. Wednesday, March 17. 2004Getting Started With PEAR
Harry Fuecks published an introductory article on PEAR called "Getting Started With PEAR" over at SitePoint.com. The articles starts off with some reasons for using PEAR and after diving into the history of PEAR and the usage of the PEAR installer finally rounds it up with an example of how to use PEAR packages.
The PEAR packages he is using are HTTP_Request and my XML_Serializer package, as he utilizes them to parse a RSS feed. Thanks for mentioning our package in this well-written and informative article. Monday, March 15. 2004Markus Wolff on user authentication
This wednesday the new issue of the German "PHP Magazin" will be released. It features an article by Markus Wolff of DB_DataObject_FormBuilder and LiveUser fame, that discusses the concept of user authentication. Besides the basic concepts like .htaccess and basic authentication he also writes about PHP libraries that help you integrating an authentication system in your website. Besides several PEAR packages he also mentions patUser and has only good things to say about it. In fact he calls our site a code repository that matches or even exceeds PEAR in quality standards.
Thanks very much for the nice read, Markus. Pat likes you! Friday, March 12. 2004Always the current PEAR manual
Since tonight php-tools.net provides a new service. Every midnight we are generating the current PEAR manual in English. As the official version only gets updated on Sundays you may sometimes find information that lacks in the official manual. The disadvantage of this version is, that it's only plain HTML and contains no syntax highlighted examples.
You can find the manual at pear.php-tools.net/peardoc/ Thursday, March 11. 2004Ever wondered how php-tools.net works?
If you ever wanted to know how the website of the PAT team has been implemented, now's your chance. After relocating to the new server we fully control our CVS repository and allow anonymous read-only access to the PHP code and the XML sources of our site.
You'll find instructions on CVS access on cvs.php-tools.net, where you can also just browse the repository. The module of the website is called patSite. If you are to lazy to check it our yourself, you may also download as a daily CVS snapshot from snaps.php-tools.net where you can also get the latest snapshots of most of our tools. Wednesday, March 10. 2004Creating XUL with PHP
Yesterday I released a new PEAR package, called XML_XUL. It allows you to build XUL applications by instantiating PHP objects, a similar approach to creating any XML document with DOM.
XUL is used by Mozilla to build user interfaces and can be combined with CSS, JavaScript and RDF to build complex applications that run in the browser. With this package creating the user interface becomes a charm. Download the package at pear.php.net or take a look at the online examples (which are of course also included in the package). Wednesday, March 3. 2004History's biggest disasters vol. 1 : Atlantis
Ever wondered who is behind all the big disasters in history? Well then look no further - you have found just the man. No kidding - want to know what happended to the city of atlantis? Roughly at the time it is supposed to have happened (~9.600 BC), I was studying the power of the rumour. I had gathered knowledge about the intricacies of planting rumours from the greatest scholars, and felt the urge to test my new found knowledge...
I needed something big - something positively huge. As I was waiting for the right moment to act, a volcano erupted on the mediterranean shores of ancient greece - and the beauty of it simply stunned me: with the use of a 20 feet tall broken statue of the goddess Atlantis, and a very nimble tongue, I was able to plant the seed of the greatest hoax of all time. So how did I manage it? Probably needless to say, but here goes anyway: a master's secret is not so easily given. But basically, I had to follow but a few simple rules. Man loves mystery, especially if there is some hidden treasure involved (this is true even since before the stone age - believe me, I tested that too). Just wrap your golden, shining mystery in a veil of fatally precise (but completely off the mark) indications of where and what happened, and tell of the fate of all the fair maidens that were swallowed by the depths in the cataclysm. A few broken pieces of the statue I mentioned earlier, and the sightings of its other remnants by divers gave the necessary bit of proof needed to ignite that little spark of doubt that makes a story hit "home". And to make them all go really wild, I suggested that some of those fair maidens had now turned into mesmerizing mermaids, guarding the treasure... (I could not help it) Actually I am quite proud - there is nothing more satisfying than watching the seed you planted grow some really huge roots, and have generations of commoners and scientists alike hack each other to pieces (figuratively and literally) about theories and "reliable" sources on the subject. So much energy spent on a puff of smoke... it is not only beautiful, it is consummate, simple and pure genious: one of mankind's eternal traits - gullibility. Atlantis: the real story? CVS repository gets alive
Currently the pat-team works hard to refill the CVS repository. After the whole project moved to the new server, we got "root"-permissions for the entire system. Now there are many giga bytes on the brand new harddisk to be filled with PHP-stuff.
Besides the new subdomain, you can find some new packages in our CVS-repository at cvs.php-tools.net. |
php_network_getaddresses: getaddrinfo failed: Name or service not knownphp_network_getaddresses: getaddrinfo failed: Name or service not known |