Sunday, October 30. 2005

Photo taken near the Queens Midtown Tunnel
Saturday, October 29. 2005
A few minutes ago, I released a proof-of-concept custom install task/custom install role pair of packages at pear.chiaraquartet.net. PEAR_Task_Chiara_Managedb and PEAR_Installer_Role_Chiaramdb2schema work together along with a post-install script in the PEAR_Task_Chiara_Managedb package to automatically initialize and upgrade the database structure of applications. The end-user is responsible for setting the DSN that should be used to access the database via the post-installation script (installation will simply fail with an error message if this has not occurred). To use, your package should contain a <usesrole>/<usestask> combo like this following: <usesrole> <role>chiaramdb2schema</role> <package>PEAR_Installer_Role_Chiaramdb2schema</package> <channel>pear.chiaraquartet.net</channel> </usesrole> <usestask> <task>chiara_managedb</task> <package>PEAR_Task_Chiara_Managedb</package> <channel>pear.chiaraquartet.net</channel> </usestask> Then, in the contents section, an MDB2_Schema-based schema file defining database structure should be entered like so: <file role="chiaramdb2schema" name="schema.xml"> <tasks:chiara_managedb/> </file> The rest of the work is performed by the excellent MDB2_Schema package, which has the ability to examine two schema files, generate a diff, and literally upgrade the database structure. Because of this strength, it is no longer necessary to provide special sql files differentiating each release (although this is not a bad idea for those who like to do manual configuration). Note that as a proof-of-concept, this code is alpha stability. This means that those using it will be testing out the solution for the purpose of experimenting with seriously bleeding-edge technology. All the same, the source code for such a complex task was incredibly easy - and simple - to write, showing just how much is actually possible with PEAR 1.4.3 and newer. These packages both require PEAR 1.4.3 and newer to function properly, due to bugfixes. PEAR 1.4.3 is not released yet, and is undergoing final release preparations at the moment, but will be out very soon. Enjoy!
Friday, October 28. 2005
Today, the New York Times (and others) reported that Lewis Libby, Vice President Dick Cheney's chief of staff, has been indicted for perjury and obstruction of justice. Wow. I wish I could say that I didn't see this coming. Assuming a jury finds Libby guilty (which is likely), let's examine this from another angle: what motivation did one of the most powerful people in the nation have to lie to a grand jury Surely, a man that smart knows the meaning of perjury and obstruction of justice, so he was clearly afraid of something far worse than these charges. Now, I am speculating, but since he perjured himself in relation to a national security breach, this could be either fear of the utter destruction of the Bush presidency, or of revealing something worse than perjury, say treason. Either way, the truths that his lies are covering pose an even more unsettling question: Why does 50% of the country think Bush is an honest man and his administration will do good for the world The people I know who have voted for Bush generally voted against his opponent for various reasons (abortion rights, fiscally conservative). However, it still confounds me to this day that the man was elected. - I predicted on the eve of his election that we would be at war unnecessarily within 4 years. My guess was China because of trade difficulties back in 2000. I was wrong, and should have seen it coming - of course he would set his sights on Iraq. He surrounded himself with his Dad's and Reagan's chief advisors.
- He has been lying from the beginning, and I mean back when he was running for governor of Texas. Back then, he was claiming to be environmentally sound, when his record showed otherwise. During his tenure as governor, Houston went from a relatively clean city to being more polluted than Los Angeles. As a student at Rice University, I could physically perceive the difference when jogging. Compassionate conservative Why is his chief advisor (Karl Rove) the man his father hired because of a newspaper article describing the dirty tricks Rove performed for Nixon while still in college What was the deal with those phone calls sullying John McCain's name in the 2000 North Carolina primary
- He has never demonstrated the key qualities of a Christian that he exploited to get elected - I am speaking of forgiveness, compassion for the poor, and humility. Instead, the primary values he has displayed in his actions have been vengeance ("wanted, dead or alive"), exploitation or plain ignorance of the poor (special contracts to Halliburton during 2003, cutting taxes for the rich and proposing cutting back Social Security, tax breaks for oil companies after Katrina), and extreme hubris (refusing to release documents on John Roberts or Harriet Miers).
Even my grandmother, who has voted Republican since Eisenhower, voted against the man in the last election. What is wrong with this country Is it going to take an impeachable offense for people to wake up and recognize that the Republican party simply doesn't represent the interests of the majority of their voting base Actually, I know the answer to this. It will take the re-organization of the biased media outlets like Fox News and others who confuse editorial with fact. Until people start receiving the actual news, there is no hope whatsoever.
Wednesday, October 26. 2005
Recently, there has been a fair amount of fear over the Zend Framework. This kind of reaction always surprises me. As I see it, there are two reasons to fear a new software project - the developers plan to patent it
- the developers plan to close the source and charge a lot of money for it
Zend, obviously, has no plans for either. What most PHP developers fail to appreciate is that a higher standard for all is the natural result of competition within open source code. Obviously, inter-operability is crucial when there are multiple ways to solve a problem, as the ability to unplug one solution (like PEAR::DB, for instance) and then plug in another (PEAR::MDB2) is a great asset. If I have one piece of advice for Zend, it would be to make one of the stated goals to provide interfaces to existing solutions, wherever possible, so that users who are entrenched in a PEAR solution, for instance, can start using the Zend Framework with minimal migration pain - and vice versa. As PHP developers, we have three choices. We can either lead, follow, or become roadkill. To create high quality solutions (the reason we use any programming language, remember ), it is better to have more high-quality choices. I am excited for what this will do to other established projects like Horde, PEAR, and so on. The potential for spurring positive change is immense.
Update 12/27/2005 - I see this is still a popular post, so I should amend this with ZDE 2.0 final works fantastic, the studio server connects without problem. Hope this is useful  I've spent the past month and a half trying off and on to get Zend Studio Server beta 2 to work on my Windows XP professional up-to-date system. It just won't work. I've tried having it install everything from scratch (Apache 1.3.33, use winenabler), uninstalling, installing apache 1.3.33 and getting it working, and then installing it into that both with and without winenabler. Afterwards, I get a blank screen. When using the PHP 5.0.5 I have installed, I would get continual crashes until I killed apache. Literally no configuration or installation tricks have worked. The only thing that fixes apache is to uninstall the studio server, then it starts working again. Zend has been a bit busy, it seems, and has offered no feedback, so I'm appealing to the general public. I REALLY need a working web server, as it is practically impossible to debug problems with pearweb without either the debug server or a whole hell of a lot of time. Any advice P.S. please suggest FREE solutions.
Monday, October 10. 2005
There have been a number of reports recently of problems with the installroot option of PEAR. First, it was reported that a PEAR installation done at an installroot didn't actually work at all. This is because the pearcmd.php script sets the include_path to a known value: the location of PEAR at installation time. However, if installroot was set, this was being set to a non-existent directory. For instance, if PEAR is installed at /usr/local/lib/php, with an installroot of /path/to/installroot, the proper include_path would be: /path/to/installroot/usr/local/lib/php this is how installroot works. However, it was being improperly set to: /usr/local/lib/php which causes a fatal error at the first require_once, breaking the pear command completely. Therefore, this was fixed in version 1.4.0a1. However, there have been a number of reports of people using the installroot option on unix to package up PEAR in distributions of PHP, such as the ever-popular RPM format. As it is a generally bad idea to do things as the root user that do not directly involve installation or configuration of some kind, these users were using the installroot option to install PEAR in a local directory and then copying the files created into the RPM for packaging. Unfortunately, this relies upon the afore-mentioned bug in PEAR 1.3.6 and earlier, and so scripts that have been working for ages suddenly stop working. This is not a good thing. For people wishing to distribute PEAR 1.4.x, there are two possible solutions, one for PHP versions earlier than 5.1, and one for PHP 5.1 and newer. For earlier PHP versions, the best thing to do is to perform these steps: - install PEAR using installroot option, just as you always have
- ALSO bundle up the install-pear.php file from pear-core at cvs.php.net
- Use a %post option and run the CLI version of php on install-pear.php like so:
- %post
php install-pear.php -d %{_libdir}/php/pear -b %{_bindir} - Use a %postun option to erase the contents of PEAR via:
- %postun
pear uninstall -n --ignore-errors PEAR rm -rf %{_libdir}/php/pear
the %post option will create all needed files, and the %postun option will cleverly erase binary PEAR files (like the pear command, pecl command, etc.) and then remove all other pear files. The instructions for PHP 5.1 and newer are similar: - Grab install-pear.phar from http://pear.php.net/install-pear.phar
- Use a %post option and run the CLI version of php on install-pear.phar like so:
- %post
php install-pear.phar -d %{_libdir}/php/pear -b %{_bindir} - Use a %postun option to erase the contents of PEAR via:
- %postun
pear uninstall -n --ignore-errors PEAR rm -rf %{_libdir}/php/pear
As you can see, the second option is a lot simpler from a packaging perspective, but it is quite similar from step 3 on. If you are using 1 script to bundle several different PHP versions, the first option will also work with earlier versions, but you will need to first grab the contents of pear-core/ and overwrite php-src/pear with these contents, as PEAR 1.3.6 is the bundled PEAR version for PHP 5.0.x and earlier. I promised an open question, so here it is: Does anyone actually USE installroot in order to install PHP or PEAR into a directory that they intend to use it from Was the original behavior actually a bug, or was the bug in the documentation of installroot Although the steps above will work regardless of the contents of installroot (a good thing), in the interest of correctness, I have to know the answer about this. If the installroot option is only used by people packaging up RPMs and ebuilds and such, then the current behavior is a bug. Thanks for any feedback.
Saturday, October 8. 2005
Recently, Chiara_PEAR_Server 0.18.2 was released. The official release announcement was delayed until PEAR 1.4.2 was available, as Chiara_PEAR_Server depends on PEAR 1.4.2 Chiara_PEAR_Server 0.18.2 fixes some egregious bugs in the post-install script, and adds per-channel information to maintainers. In addition, bugs in the server administrative backend relating to releasing packages have been fixed. This is a recommended upgrade for all users of Chiara_PEAR_Server or the deprecated PEAR_Server. Chiara_PEAR_Server implements a REST-based PEAR channel server that provides a great deal more customization than an old XML-RPC-based channel server. In particular, indexing on sites like pearified.com and pearadise.net is now possible. We have welcomed new developer Clay Loveless of Killersoft as a co-lead along with myself and Davey Shafik. Thanks to all who contributed ideas, testing, and of course actual code. Keep an eye out for version 0.19.0, this will have some killer new features...
I am trying to fix up the pear makerpm command so that something like the following English is possible "Package X conflicts with (Package Y > 1.5 and Package Y < 1. or (Package Y > 1.8 and Package Y < 2.0)" However, after literally an hour searching through google, through the linux documentation project, and so on, I still haven't found a SINGLE page of documentation that actually describes in detail all of the possible settings for the Conflicts: tag. What I do know is: - it's the same as the Requires: tag
- you can use "or" to join related conditions
- you can use commas to separate different conditions
- or, you can use Conflicts0 Conflicts1 etc.
This is all I can find. WHERE IS THE STUPID DOCUMENTATION! @# !@ @!
|