a programmer's best friend :: the blog of pat, the dog |
Tuesday, September 5. 2006XJConf for PHPIf you want to give XJConf For PHP a try, you can get it via our PEAR channel or from SVN at http://svn.xjconf.net/XJConfForPHP/. The fantastic XJConf logo has been developed and designed by Georg Rothweiler. Sunday, August 27. 2006Analyzing aide (advanced intrusion detection environment) output with PHP
Since we started hosting our sites on our own server we had some nasty cracker-attacks (most often certainly script-kiddies) causing lots of traffic by hosting crappy italian movies or by installing rootkits. To at least have a chance recognizing whether the system had been compromised we started to use aide some time ago. Aide keeps track of changes in the filesystem and provides us with a human-readable report once a day.
However, sometimes changes in the filesystem happen because of (security-)updates and not because a cracker exchanged your ps binary against his own personal version. Continue reading "Analyzing aide (advanced intrusion detection environment) output with PHP" Sunday, August 20. 2006New releases of patTemplate and patForms
After I finally finished my book (and my contribution to Exploring PHP) I finally have enough time to work on all of my open source projects again and today made two new releases. patTemplate 3.1.0b1 contains tons of changes since the last stable version. Most of the features that users have been requesting for years have been incorporated into this release, like the possibility to read templates from a database:
It is now also possible to use any PHP function or method as a default value for a variable which allows you to prefill a value with the current timestamp. Furthermore I have been putting a lot of work into the new patTemplate manual.patForms 0.9.0b3 mostly contains bugfixes and provides several install-groups for the PEAR installer, which allow you to choose your form renderer when installing patForms. This will hopefully be one of the last beta version for patForms 0.9.0 as we plan to release a stable version during the next 4-6 weeks. Both packages can easily be installed using of PEAR channel server at pear.php-tools.net. Creating PEAR-installable nightly builds
If you incorporate a "release early, release often" policy for your projects, it helps you to detect bugs in an early development stage of your application. In many cases making a release takes some time and you do not release new versions as often as you intended. We had these problems with our projects over at www.php-tools.net. That's why we created snaps.php-tools.net, a site where you can download nightly builds of our projects as ZIP, TAR.GZ or TAR.BZ2 archive. This saves the users, who want to test the latest development versions the hassle checking out the latest version from our subversion repository. The problem of this technique was, that most users use the PEAR installer to deploy our packages and if they downloaded a ZIP file, it's not possible to use the PEAR installer on this file. That's why we came up with a solution to create nightly builds that are installable with the PEAR installer. Read on, if you are interested in how this can be achieved...
Continue reading "Creating PEAR-installable nightly builds" Friday, August 18. 2006PHP Design Patterns finished Today I received a message from O'Reilly, that my book PHP Design Patterns is now going to print and is scheduled to be released in September 2006. The work of the last six months is finally bearing fruit and I will be able to spend my spare time on coding again instead of just writing. If you wondered, why patTemplate or any of my other open source projects did not show any progress, this announcement should answer your questions.I put nearly all of my thoughts on software architecture, OO design and patterns into this book and thus it consists of 370 pages dealing with OO development in PHP 5.1, creational patterns, structural patterns, behavioural patterns as well as enterprise patterns and MVC architectures. Furthermore it covers SPL, Propel and patTemplate to provide some real-life examples of the patterns. If you intend to buy the book, you should be warned that it has been written completely in German. If you still are interested, you will find more information on the book as well as the code example on the website or you can already pre-order it from Amazon. Thanks go to gERD, luckec and Frank who supported me with their knowledge as well as Toby, who introduced me to O'Reilly. Thursday, August 17. 2006patForms Gettext Patch
Usually i18n and multi language support is not a big issue in web business. Even if web-sites seem to be global players, most of them get along with support for very few languages. patForms for example comes with support for English, French and German and therefore covers pretty much everything I ever wanted.
On the contrary non-French, non-English and non-Germans may blame patForms for lack of support for Danish, Swedish, Spanish, Russian etc. Rightly, I suppose. Unfortinately, the supported languages are within the form elements and rules. Hence it would mean to change a lot of files (classes) to simply add another languaga's messages. Knowing that we started to introduce support for extrernal translation tables - stored in ini-files. Another idea was to use the PHP Gettext extension which should be available on most servers. The two major advanteages of this method are: (1) You simply don't have to bother about NLS (native language support) while you write some geek patForm rules or element. (2) Gettext is widly spread and comes with a bunch of tools to extract translatable strings and maintain translation tables. This makes it fairly simple to add support for additional languages like Spanish, Danish and even Gungan. So far, patForms does not use Gettext. Still, I created a patch which works extremly well. I love to invite you to test this patch and and tell me what you think about patForms using Gettext. Please also tell me your opinon whether we should move to Gettext for the next release of patForms. Download: - Zip file: patForms-Gettext.zip 512 kByte - Tar Bz2 archive: patForms-Gettext.tar.bz2 188 kByte Checkout from our Subversion repository $ svn co http://www.php-tools.net/svn/patForms/branches/gettext/ Links: - PHP Gettext - GNU Gettext - Translation editor PO Edit, KBabel Monday, August 7. 2006Der Zauberlehrling - Sorcerer's ApprenticeRecently the German PHP Magazine published the August 2006 issue. The principal topic is AJAX and Web 2.0 technologies, including an article covering the PEAR package HTML_AJAX This article's target is (1st) to give a brief introduction to AJAX and how things work from Javascript an PHP side in contrary. Also (2nd) I wanted to show that you actually don't have to muck around with a mess of Javascript (browser compatibility issues and such) because it's it is all done by the Joshua Eichorn's HTML_AJAX framework. Unfortunately, four odd pages arn't enough to build up a complete application. Still, it tells you where to begin and how you can add Web 2.0 features to your site within minutes. Also there is one more crux: it's German only Sunday, August 6. 2006patTemplate 3.1.0a2 released
I just released patTemplate 3.1.0a2. This will be the last alpha version for 3.1.0 and I hope to release a stable version during the next 6-8 weeks. The major changes since 3.0.1a1 include:
Exploring PHP to be published soonThe article I contributed showcases how event-driven-development can be used to create component based, flexible applications that allow you to easily plug in new features without modifying the core application. The examples in the book use PEAR's Event_Dispatcher. Other articles cover unit testing with SimpleTest (by Frank), the generation of 3D images with PEAR's Image_3D (by Kore), migration to PHP 5 and refactoring (by Sandro) as well as news on PHP 6 (by Christian). The editor for the book is Markus Nix, he compiled all the articles. If you take a closer look at the cover, you might see that there are different names listed on the cover than those mentioned in the blog. This is because some of the original authors did not manage to deliver their articles in time and have been replaced. The planned release date for the book is 08/17/2006, so keep your eyes open. Thursday, June 15. 2006Reprogramming wheels
Clay Loveless recently posted a small rant [1] about loner applications, and that inspired me to write up a comment of sorts.
I think that the interoperability Clay wants requires out-of-the-box thinking, but sadly most of the programming world lives in tight boxes. To change that tide would require a lot of dedication and time, both of which I for one am not prepared to invest. It is really quite sad, but the time and effort I need to get the author(s) of any piece of software to become aware of the non-interoperability with software XY I prefer to invest in getting a solution done - especially since the answers are usually "works for me", "don't need software XY", "it's open source, fix it yourself", "nobody needs that except you", "no time, maybe this winter". I usually try contacting the authors in case I should get lucky, but tend to avoid those kinds of discussions as they lead nowhere. I think that one of the core reasons for the lack of interoperability is the reprogramming the wheel syndrome. I did that quite a few times myself, and while it may often be because the programmer feels he can do it better, I think there is more to it than just that. These are a few issues I can think of on the spot:
I am sure a psychiatrist specializing in modern software developers would be able to find quite a bunch more issues, but I am not sure I want to know about that in such detail after all. Expectations, Approaches This is one more issue that I feel compelled to write about, since it is the reason why I have reprogrammed the wheel a few times in the past, and actually still do: different approaches to a problem. As an example, have you ever wondered why there are really that many CMSs out there? Is it really because someone said "I can do it better"? That may very well be the case, but why did he/she think so? I think it is because that someone had a different idea of how a CMS should work, dismissing the other system because it did not match his expectations. Like the users using a software like a CMS will be more at ease with one or the other system, developers will be more at ease with one or the other library. PEAR's HTML_QuickForm [2] essentially does the same than patForms [3], but in a different way - why does one developer choose the one over the other? The choice is not always based on the featureset. I know that when I look at a library and it does not work the way I expect it to, I am easily tempted to find another (if possible) or think of writing one of my own. My friends and colleagues have largely succeeded in curing me of the syndrome, like by teaching me how to use wrappers to overcome the awkwardness of using an "alien" API. Now I usually only program a new wheel when there are not really any good libraries for the task at hand, or the library of choice has serious issues. Real life and productivity vs interoperability When I started my own business, I knew I would need an application that would help me build the websites for my customers, so I started looking around. There are many great frameworks and CMSs out there, and I took a good look at them. My decisionmaking was based on a few simple rules: The system had to
In everyday use, the goals were
I don't want to turn this post into a feature comparison, so I will skip that step. After reviewing several frameworks and CMSs, I realized that none would fit what I wanted. Only a custom solution would work, because for the rate of development I targeted I needed a tool that functions on a level I can comprehend. Inspired by patPortal, I planned and started the development of SimpleSite [4]. As a strictly solo project at first and due to the development timeline priorities, interoperability was the least of my worries. Even now, after about a year and a half of constant development it is still lacking in that regard. However, I have made sure that it is interoperability-ready: all the required interfaces and structures are built to allow swapping components as you see fit. I think that knowing how to prepare for interoperability and adding it to your application development plans is much more important than actually offering it, as it makes the job for other developers that much easier. I also know that it is not always that simple either however - in SimpleSite, the templating engine of choice is patTemplate. While you can use any template engine you like in your modules, the main structure is always handled by patTemplate, and there are related helper methods that only work with patTemplate. It is sometimes really a matter of weighing the development effort and related costs against the added value interoperability would add. Related links [1] Clay loveless' "Stop writing loner applications" post [2] PEAR HTML_QuickForm [3] patForms [4] The SimpleSite development portal Monday, June 5. 2006XML_Parser tutorial published
In January 2005 I wrote a tutorial on the PEAR package XML_Parser, that I maintain. This tutorial was supposed to be published in the PEAR section of Zend's developer zone, as they planned on sponsoring PEAR developers that were willing to write tutorials for their packages. Sadly enough this tutorial has never been published, although Zend promised me to do so and I also never received the promised discount on the Zend certification.
When cleaning up my hard disk yesterday, I stumbled across the tutorial and decided, that it would probably be better to publish it on my own website instead of waiting for Zend to finally put it online. So if you still are using PHP4 or prefer SAX-based parsing although PHP5 offers a decent DOM implementation, you can now find the XML_Parser tutorial on my website. Be warned: Although the tutorial itself has been written in English, the rest of the website is in German, so you might find the navigation a bit strange. But no need to worry, the this link will guide you directly to the tutorial. Thursday, May 11. 2006Nero goes PHP - join us!
Of course, Nero AG in Karlsbad (Germany) if famous for CD-burning software, which is far away from web technologies and PHP. Still, Nero applications grow together with the need of communication in the world wide web. Also there are plenty of traditional web projects as well as AJAX based PHP programming going on.
Still there are so many lines of code to write, so many ideas to implement and so many visions to think about that we can't handle it on our own. Therefore we need your expirience, your skilly, your brain and enthusiasm. We need your help! Have a look and apply for a job in our team, we are looking forward to meet you! German job offers at Nero AG: Job offers GERMAN Job description GERMAN English job offers at Nero AG: Job offers ENGLISH Monday, April 3. 2006Date_Holidays - New releases
The past weekend Stephan spent some time to fix all filed bugs for Date_Holidays. The result was the release of version 0.15.2. Meanwhile I finally managed to install all the tools on my new MacBook I needed for PHP development. Wasn't that easy because I had a hard time deciding what IDE I should use. Since my old Zend-Studio 3.5 couldn't be installed on the MacIntel and I was not willing to spent the money for the current version I switched over to PHPEclipse. I didn't yet try whether debugging and more advanced stuff works, but it's for free and keeping that in mind it's pretty good (IMO better than the Zend PHP-IDE, at the moment). The switch from ZendStudio to Eclipse wasn't a problem as I develop a lot of Java and like Eclipse very much - it's a great platform. Anyhow, as I coded a bit to test the features PHPEclipse offers I implemented a feature-request for Date_Holidays that allows to create drivers not only by a unique driver-id (until now this was the only way to create a driver):
$driver = Date_Holidays::factory('Germany');but also by using an ISO3166 country code: $driver = Date_Holidays::factoryISO3166('de'); as well as: $driver = Date_Holidays::factoryISO3166('deu'); I published this some minutes ago and the 0.16.0 release can be found at the PEAR package home. Tuesday, March 7. 2006patError documentation available
patError has been developed as we needed a simple tool to unify the error management in all our different projects such as patTemplate, patForms or patBBCode. Although we liked the error handling provided by PEAR, we did not want to use it, as we did not want to force our users to use PEAR in combination with our tools. Still, we adopted several concepts from the PEAR error handling, so most of the uses who already have been familiar with PEAR were able to use patError without the need to learn a lot of new concepts.
However, in the past months, more and more people asked us questions about patError and so I decided as was time to write some decent documentation on all the features. As Aaron announced that his upcoming talk at the next PHP Usergroup Frankfurt meeting would also include patError, I realized that it was now or never and wrote the full documentation for patError, which includes advanced topics like registering new error levels are replacing the error class with your own class. The documentation is available on our new Trac-powered site, which also provides SVN-access and a bug tracker. If you ever wanted to know more about patError, you will hopefully find all that you need on our new site. Wednesday, March 1. 2006patTemplate tag reference
This is just a quick note to let you know, that our project has not died. We are currently in the process of moving all available documentation from our website to the Trac installations we will be using to maintain our projects. While moving the exsiting documentation, I also added a new page, which contains a tag reference for patTemplate.
We will keep you updated on our future plans for our projects.
« previous page
(Page 2 of 11, totaling 164 entries)
» next page
View as PDF: This month | Full blog |
php_network_getaddresses: getaddrinfo failed: Name or service not knownphp_network_getaddresses: getaddrinfo failed: Name or service not known |