2005-07-28

CBC Radio Ogg Vorbis Stream

I just found an ogg vorbis stream of CBC Radio 1 & 2.

The only somewhat acceptable player I could find for OS X though was Whamb. VLC can also play it as well.
Whamb works good as far as playing audio is concerned. But it has bugs, and some really bad ones too. Mostly concerning the playlist.
I also find the user interface badly designed.

What I would really like is for Apple to support OGG Vorbis in QuickTime/iTunes.

[UPDATE]
For those who want to play Ogg Vorbis or Speex in iTunes or QuickTime 7, checkout Xiph.org QuickTime Components.

2005-07-26

MachCMS is Bug Free

After a lot of debugging and fixing code, I believe MachCMS 1.0 is now ready to roll so to speak.
But it currently requires PHP 5.1 CVS because of a bug in PDO in 5.1 beta3.

I will wait until for a PHP release that works before releasing MCMS 1.0. It's just makes more sense. It the meantime it will be tweaked and enhanced.

2005-07-23

MachCMS Update 07

There seems to be a bug in PDO in PHP 5.1.0 beta3 because in my database class for MachCMS 1.0 keeps locking up the entire system.
That is the main thing blocking the release. I need to either work around this bug or wait for it to be fixed.

I'm also not sure yet whether I want to wait until the PHP 5.1 final release before releasing MachCMS. But we'll see.
I just do it'll be a great release.

What is MachCMS? It's your replacement for Frontpage, Dreamweaver, and any other desktop web editor.
It's content management made really easy yet powerful. It's page based instead of module based. It does not require a database server but it does require the very lastest PHP release.

It's template based. It's customizable to no end. And much more.

If the future more features will be added but for now I'm working on getting something stable out so that I can go back to work on ACal 3.

2005-07-19

PHP Link Tracker 0.1.2 Released

I needed a simple way to track clicks on a web site and so wrote a simple script to track and display link statistics. It currently consists of only 224 lines of code.

Features:

  1. Does not require a database. Uses a simple flat file approach.
  2. Very fast. Next to no overhead.
  3. Instant web access to the latest statistics.
  4. It can exclude specific people by setting a cookie which can be done automatically by the script.
Installation and Usage:

To install simply copy link.php to the appropiate location and create and folder named linkdb next to it. The linkdb folder must be writable.

To use it for linking. Use the following syntax:
link.php?url=http://www.domain.tld">Link text

To view the latest statistics:
link.php?view

To set the DONOTRACK cookie:
link.php?set

Please leave a comment of what you think about it. More features will be added in v0.2 such as sorting in the statistics, HTML output, etc.

2005-07-15

Experience with PDO

After having experimented with PHP Data Objects (PDO) in PHP 5.1.0-dev, here are my thoughts on it.

- I like the fact that SQLite 3 is supported.
- It's simply and what works, works well.

But... It would be really nice if there was a way a person could tell what methods are support by each of the drivers rather than trying and failing.
I wrote a script that used a method not implemented, only having to rewrite it after testing it.


Overall PDO looks like it has some great potential. I just hope it improves a lot more, as of now it's not really a standard interface and the interface varies a lot between drivers, or so it seems.

2005-07-09

Back to Work on ACal 3.0

Well after living outside in a tent for awhile without outside contact, somehow I got the urge to work on ACal again.

Going to add a features page to the web site (see RFE 1231683) and work towards version 3.0 beta 1.

MachCMS 1.0 is still waiting for some bugs to be fixed in PHP. It should be noted though that PHP 5.1.0 will be required.

ACal will not use PHP's native new time zone support in order to keep the 5.0 minimum version requirement.

Will post as more develops.

2005-07-06

Running PHP4 and PHP5 Concurrently

This is something I've been thinking about for awhile because many organizations and hosting solutions are slow to adopt PHP 5 because it might break some stuff. Meanwhile I was writing stuff that used features that required PHP 5 and nobody could host it!

So today I decided to see how easy it is to fix this problem. So here's what you'll need:

  • Compiler tools. GCC, linkers, etc.
  • Apache 1.3 or later.
  • Latest PHP 4.x and 5.x source code from http://www.php.net
I'll assume here that you want PHP 4 to be default and then if a user prefers PHP 5 instead, he can enable it himself.

Install PHP 4

You can skip this step if PHP 4 is already installed. Basically make sure you use the --with-apxs configure option and install it like you normally would.
See http://www.php.net/manual/en/install.php


Install PHP 5

This is very important. Before you do anything else, you must modify two lines in one source file.
Open your PHP source folder (ex: php-5.1.0) and navigate to sapi/apache. There you will find a file called mod_php5.c.
Inside this file you will find a block of code that looks like this:
handler_rec php_handlers[] =
{
{"application/x-httpd-php", send_parsed_php},
{"application/x-httpd-php-source", send_parsed_php_source},
{"text/html", php_xbithack_handler},
{NULL}
};


You must add a 5 suffix to application/x-httpd-php and application/x-httpd-php-src so that the block of code becomes something like:
handler_rec php_handlers[] =
{
{"application/x-httpd-php5", send_parsed_php},
{"application/x-httpd-php5-source", send_parsed_php_source},
{"text/html", php_xbithack_handler},
{NULL}
};


And that's it.

Now one thing you must remember is that your optional PHP version must be installed from source. Why? Because it must be installed in a separate location, isolated from everything else.
You must use the
--with-apxs and --prefix configure options. I set the prefix to /usr/local/php4 which should work well for anyone. (--prefix=/usr/local/php4)

Configure Apache

Now this is the part that makes things really tick.
When running
make install, apxs should have added the lines needed to load both mod_php5 and mod_php4 and you also need the following lines:
AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps

Like this all PHP files (files with the .php extension) will be parsed with PHP 4. Now what you could do is add these lines so that files with the .php5 extension are parsed with PHP 5:
AddType application/x-httpd-php5 .php5 AddType application/x-httpd-php5-source .php5s
But that would be no fun. And it's not nearly future proof. But simply a bad idea.
There are two ways of fixing this problem. You want each user to be able to select either PHP 4 or 5.
You most likely already allow them to use .htaccess files, so your users could simply create .htaccess files--where they want PHP 5--containing the x-httpd-php5 lines and they are set to go.
I believe this is the best approach because this allows your users to use PHP4 in some places and PHP5 in others.
But another way to avoid .htaccess files is using user configuration files.

On Mac OS X each user has his own configuration file located in /etc/httpd/users/user.conf.
And at the bottom of httpd.conf there is an include which reads like this:
Include /private/etc/httpd/users/*.conf

So if users are allowed to edit their own *.conf file, they could add the correct AddType lines there.

Another more complex solution is, if you provide a web configuration interface such as CPanel, have an option where you can select PHP 4/5. This option would change the configuration for that user at the apache level.

So as you can see, running both PHP 4 and 5 concurrently, or parallel, is really easy if done right. Just do it! :)

2005-07-02

Projects Update

  • MachCMS 1.0 - Almost done. Having some problems with updating pages but that's about it. Should be out soon.
  • wxPHP - Halted right now due to bug in PHP.
  • ACal 3.0 - Nothing to report

As you can see not much has been going on lately. I've been too busy the past few weeks.
I hope to get some more stuff done next week but after that I'll be working again for awhile.