Archive for the 'Uncategorized' Category

Debate on 702 Monday, 15 June 2009 at 11am

One of the comments on my Open letter to Core reads:

Interesting debate regarding CAB Platinum Store Versus Core’s strong arm tactics on 702 Consumer Watch show on Monday the 15th of June 2009 at 11h00.
702 Studio Phone +27 011 883 0702
Main Switchboard +27 011 506 3702
Comment line (sms) 31702

Phone in and made a contribution!

Installing, integrating and configuring Eclipse for Drupal on a Mac

This post is about how to set up a php IDE on a Mac (or windows) so that you can start debugging php code in drupal projects. This is important to me because I’ve been using textwrangler as my coding tool for years – which simply highlights php syntax. I want something a bit more powerful.

Step 1: Download the All-in-One Eclipse PDT + Zend Debugger Package by heading to http://www.zend.com/en/community/pdt. his package includes all you need in order to develop and debug PHP on your machine – the Eclipse Web Tools Platform, PHP Development Tool and the Zend Debugger Plug-in.

Step 2: Unzip it and place it in your Applications folder (or, in my case, /Users/roger/Applications/_authoring/eclipse ). You can run Eclipse immediately without having to do any “installation” stuff if you’re on a Mac.

Great! So now we have a php IDE – let’s configure it for drupal.

Step 3: Go to the Configuring Eclipse page on drupal.org and follow those instructions (it’s quick).

Our next step is integrating Eclipse into our php web environment (apache, in my case). You could always download MAMP: I use the built-in apache server on Mac OS 10.4 and downloaded and configured mysql myself (but if I had to do it all again, MAMP is the way to go). So, assuming you already have some kind of apache + php + mysql environment up and running…

Step 4: Copy the appropriate ZendDebugger.so file to the MAMP install’s PHP extension directory. The best way to find out is via the “phpinfo()” command. Create a PHP-file called phpinfo.php with the following content:

<?php phpinfo(); ?>

and then load that file in your browser.

Step 5: Edit your php.ini file and add or update the following directives:

implicit_flush = On
output_buffering = Off
eaccelerator.enable=”0″

;zend_extension=/usr/lib/php4/20020429/xdebug.so (comment out this directive if it exists)
;extension=dbg.so (comment out this directive if it exists)
;extension=php_dbg.dll (comment out this directive if it exists)

[Zend]
zend_extension=/Path/To/ZendDebugger.so
zend_debugger.allow_hosts=127.0.0.1/32
zend_debugger.expose_remotely=always

Remove all other directives from the [Zend] section of the php.ini file.

Step 6: Copy the file named dummy.php in the server’s document root directory (usually /User/you/Sites). Eclipse will load it later to verify that everything is setup properly. The file is inside the “Debugger Extension” archive. If this file is not there, please download it from:

http://www.lgorithms.com/dummy.txt

Restart apache. Load up the php info.php file you created earlier, and search for “debugger”. You should get something about the Zend debugger now.

Step 7: read how to use Eclipse to debug php.

This is condensed from Using PDT : Installation : Installing the Zend Debugger and Mac PHP Debugging using Eclipse PDT and MAMP.

Step 8: configure Eclipse for drupal (very quick).

Step 9: Open Eclipse and create a new php project. Give it a name and click “next”. Then in “Source” click “Link Source…” add your drupal folder (select “ignore nesting conflicts”) you’re working with.

Step 10: Click “Run” and “Run Configurations…”. Under PHP Web Page click the “plus” icon to add a new launch configuration. Give it a name, make sure the server debugger is Zend, then click “New” next to “PHP Server.” Give your server a name and put in the url to your document root, in my case it’s http://webdev.local/~roger

Save and close that dialogue. Then under File click “browse” and select the index.php file from your drupal site. Under URL make sure you’ve put in the correct url to index.php that you call in your browser. You can then click “Apply” and “Test Debugger.” If everything works you should get a “Success!” message.

Step 11: Whew! That took a while! Now you have the Eclipse IDE up and running with the Zend debugger installed. To see it in action load up your index.php file in Eclipse, right click just to the left of the line number on a line of code and select “Toggle Breakpoints.” Then click “Run” and “Debug”. Eclipse will load your drupal site into your browser, and pause the loading of the page at the place you set a breakpoint in your code.

Take a moment to bask in the glow of your monitor. PHP coding fame is yours! To get back to the view you were just in, click Window -> Open Perspective -> PHP

If you want to get really geeky you can also:
Configure Eclipse for Remote Debugging with Zend.

 
Technorati Tags: , , , , , , ,

Open letter to AllYouCanEat.co.za support aka Father Christmas

Dear Allyoucaneat support

Can I have a kitten, and a bicycle, and a puppy, and some chocolate, and a new haircut for Christmas? And while you’re at it, could you please check why my mostly unused 2 GB topup from September October didn’t carry over to October November on the account enterprisesa?

My mommy says that you’re not real, and that not only do you not live at the North Pole and don’t deliver presents once a year, you also don’t answer support emails. I would like to think she’s wrong, so I’m going to send this email once a day until I hear from you, because, unlike her, I believe in the impossible.

Send count: 2.

Regards
Roger

Technorati Tags:

A sweet letter

Jostina

At the place where I’m staying we have an awesome domestic worker named Jostina (or Moitsane – her Tswana name). It’s her birthday today and she gave me a letter which reads like this:

Dear Roger

I’m sorry to bother you, I need some help with a computer. My children are in need of a pc. If you know anyone who has a pc which they don’t use please let us know. If you do have some you can offer help too.

My children go to Boston College where you have to have a pc in order to read.

Please let me know when you found one.

From

Jostina

So, does anyone have a functional pc lying around which they would be happy to give towards a worthy cause? I would probably install Ubuntu on it, so no worries about viruses ;)

Theming Drupal

A pdf of presentation slides from the “Drupal Theming” presentation at DrupalCon 07.

Technorati Tags: ,

Drupal vs Joomla

I’ve had conversations a few times in the last few months about open source content management systems. The top ones people usually look at at Wordpress, Joomla and Drupal. Wordpress is great – this blog is powered off Wordpress and some bigger sites run off the platform – although as a development platform I’ve moved away from it. I’ve developed a number of sites using Joomla and thoroughly enjoyed using it, as long as nothing too complex was attempted. There’s even a Joomla South Africa community! It’s easy to install and has a lot of add-on components, so lots of people use it. I’ve moved away from Joomla too now in favour of a more powerful and flexible system: drupal.

mydrupal.com has a great overview of drupal vs joomla.

Technorati Tags: ,

Migrating to Joomla from Mambo

Back in the day I did quite a few Mambo sites. Although I now prefer Drupal for many good reasons, Mambo remains a popular Content Management System (CMS). A few years back there was a split in the open source Mambo community which resulted in the entire development team leaving. They forked the code and created Joomla, which was recently voted 2007’s Best PHP Open Source CMS winner(Drupal won for the Overall Open Source CMS category).

Anyway, I have a Mambo site which I needed to upgrade to Joomla this week. The process is fairly simple, and it outlined at http://help.joomla.org/content/view/818/181/ I’ll summarise:

  • Backup everything – Mambo files and Joomla files.
  • Upgrade Mambo to latest version (4.5.2 or 4.5.2.3 – either works)
  • Upload latest Joomla files and overwrite Mambo files (but don’t upload the “installation” folder)
  • In the installation/sql folder there’s a file – migrate_Mambo4523_to_Joomla_100.sql. Execute it as a sql query in phpMyAdmin – this will upgrade your database to a Joomla database.

And you should be good to go. I didn’t need to change anything in my Mambo template for it to work on Joomla – hopefully this is the case for you too.

Technorati Tags: , ,

Using “locate” to find stuff from Terminal

Spotlight on Mac is great but often I’m mucking around on the command line and want to find something without having to switch to spotlight and back again. locate is a great (and fast) tool which indexes your entire hard drive into a database. When searching, instead of searching the hard drive directly, it just searches its database, meaning it is blisteringly fast (sure, if you’re looking for files which have changed in the last week it’ll point to a non-existent location, but for finding that annoyingly missing php.ini file it’s great).

The locate database is rebuilt each week by periodic (which runs system functions daily, weekly and monthly). periodic is called by cron, uh, periodically. *sigh* These posts are never going to make me interesting to non-geeks.

To manually update your locate database just call the weekly periodic script:

sudo periodic weekly

Take a look at everything periodic runs by opening Terminal and taking a look inside /etc/periodic
Geeks will love you for it. I hope. *sigh*

Technorati Tags:

Upgrading mysql on Tiger

After a system crash I’ve bought a MacBookPro and have ALL of my settings and preferences imported onto it from my iBook (running 10.3.9). The only thing that hasn’t come across seamlessly (so far?) is mysql. Apparently there are different binaries for Panther and Tiger, so I need to reinstall.

First, I removed the old mysql from my system by backing up the following to a “mysql old” folder:

/Library/MySQL

/Library/StartupItems/MySQL

/Library/Receipts/MySQL.pkg

This at least means I have a full backup of my data.

Secondly, I downloaded the binary from dev.mysql.com and installed it. I could’ve used mysql 5 but am sticking with 4 because I like it (and because all of my old tables are in that format – I don’t have sql exported versions I can use for importing).

Installed mysql-standard, the MySQLStartupItem and the MySQL.prefPane (for controlling mysql through System Preferences). Then I started mysql through terminal (open it up, type “cd /usr/local/mysql” then “sudo ./bin/mysqld_safe” and it should start up) although the instructions I’m following advocate a full reboot. Seeing that I can’t seem to get php talking to mysql, reboot time it is.

After rebooting although ./bin/mysqlcheck -p -A -r now works, I still can’t get apache/php talking to mysql. Downloaded a Dashboard app called TailDash which gives me the output of my log files (httpd, error_log etc). Nothing obvious.

Ah ha! According to a comment at MacDevCenter, “After updating to Mac OS X 10.4.4, you may find that the connection between PHP and MySQL running on your local webserver is broken. Apparently the socket file got moved in the update.” (see osxhints article)

The fix is quite simple:

sudo mkdir -p /var/mysql

sudo chgrp mysql /var/mysql

sudo chmod g+w /var/mysql

edit/create /private/etc/my.cnf and add the lines:

[mysqld]

socket=/var/mysql/mysql.sock

[client]

socket=/var/mysql/mysql.sock

restart mysql

And it works! Hooray!

Technorati Tags: , , ,

How to find your flickr user id

Simply visit http://idgettr.com/

Technorati Tags:

Next Page »