Jul 13 2009

Netbeans 6.7+ IDE: use it for PHP as well

Here’s why:

So you’ve been developing for a while. Coding PHP, etc. You must have a favorite IDE (code editor)…

My favorite is / was TextMate. I just loved one its fastness and mainly its ’sunburst’ dark background based color theme. The only thing I did not love with TextMate is its lack of automatic code completion / suggestion. It has none of that - and my feeling is that in such times of huge frameworks (yii, kohana, symfony, zend comes to mind) you can just always try to look up something. Once you’ve tried automatic code completion and suggestion (with docs automatically lifted from code) you can’t go back.

Add to this the open-source nature of Netbeans, and its support for CVS, SVN, PHP, Ruby, Python - this is just my list of required languages because I love ruby on rails, and the django framework, besides php of course -. Its support for code-snippets, auto-completion, debug (via xdebug for PHP). Also let’s not forget that this is an IDE written in Java, and it supports Java as a programming language as well (with GUI designer, debugging and so on). It also has a project navigator and a code navigator as well (class methods, attributes, etc.). It also quickly indexes your source code tree, so you can easily look up code - without even lifting your hand off the keyboard. It is just amazing.

And despite it’s being java - it’s speed is good. Well compared to TextMate it’s slow, but it does so many more things…

My only problem with it so far is the built-in default color profile ‘netbeans’ - › Continue reading


Apr 2 2009

Drupal Multimedia /book review/

Drupal Multimedia 

Drupal Multimedia

Drupal Multimedia has been released towards the end of 2008. It was written by Aaron Winborn, who also wrote and maintains the embedded field (emfield) module for drupal.

 The book has 11 chapters of which one is a general introduction probably not necessary for anyone who has spent at least a week with drupal.

An other chapter, the very last one, is devoted to future speculation regarding drupal and internet trends in general. It is an interesting read nonetheless. There are some words about microformats, rdf and “the” semantic web amongst other things.

So skipping these two chapters that don’t really deal with the subject matter, the rest of the book deals with 3 things:

  1. images, both local and remote (flickr for instance) embedding and theming them
  2. videos, local and third party embeddable ones (youtube, etc.) and theming them
  3. audio (you guessed right, local and not so local ones) and theming again

In general if you have no idea how you can use images, video or audio with drupal, have never heard of CCK and Views and have not got the faintest idea about theming then this book is highly recommended for you.

If you have already been exposed to modules such as Image, Imagefield and Filefield then you might not learn too much from this book.

Also as the whole drupal infrastructure tends to quickly change over time the information contained in the book is not the most up to date (understandable), and might not contain the ideal solution (or close to it) to your problems.

The author gives good ideas though, so if you have no idea how you can build an mp3 player with playlist support or how you can add a thumbnail for a video file that is shown on page load (like youtube) or how to create an image gallery, then give it a go. You won’t regret it.

› Continue reading


Oct 10 2008

OSX 10.5.x (Leopard and upper) PHP + mail() / postfix

UPDATED: 2009/April/1st (no joke)

Results of working and non-working email sending in OSX’s console logs:

logs of good and bad result

Article updated with auto-start for postfix.

My previous post might be working for some, but it stopped working for me.

I also now wholeheartedly recommend the xampp distribution for apache+php+mysql work. I am fed up with compiling shit (ie.: code) from source, patching, configuring, etc. but am much better off with making a few symlinks though, and editing php.ini files wherever I find them ;)

So, as OSX relies on postfix, we still need to go to private/etc/postfix/main.cf

Now, besides editing the myhostname line (put a domain name there that you own) concentrate on the # INTERNET OR INTRANET section, below which you will find the relayhost parameter. This is the place where you need to put your ISP’s smtp mail server address like this:

relayhost = smtp.[your-isp.com]

If you are a UPC (old: chello) user in hungary, you will find this page valuable:
http://www.upclive.hu/Gyakorlati_tudnivalok/

In particular some ISPs also check the ‘validity’ of the sending domain (yours). As usually mac’s have a [blahblah].local DNS name by default most ISPs bounce your message as it’s invalid. And the fact that you specify a valid ‘from’ address does not matter.

In such cases you should try to edit the same file as above, and find the INTERNET HSOT AND DOMAIN NAMES part. In it uncomment one myhostname line, and add your own valid domain name there like: johnrules.com or whatever you have. Yahoo would put ‘yahoo.com’ in there. If you do not have your own domain, feel free to put anything (khm. yahoo.com?) in there. It will be accepted.

 

Also if for some reason it is not enough, then allow postfix to auto-start by following this guide and getting this file. Only do this if none of the above works. The postfix daemon does not need to be running in order for emails to be sent. The sendmail command gets triggered every time a mail is to be sent and, as it uses postfix, it reads its configuration options from the above mentioned file. › Continue reading