Drupal with Dreamweaver

I had to migrate and setup the whole workspace at my old desktop machine last week after the breakdown of my HP notebook. So while setting it up I thought this little piece of trick could help someone who is fond of Dreamweaver and looking for an IDE to code Drupal.

As a side note, one could accuse me of promoting unethical software and in fact I don’t refute it (even though it is not my intention). I also know there are many great open source editors for coding PHP like Eclipse-PDT and even Gedit which could be transformed to a very helpful IDE. But on other hand I’m kind of addicted to DW after long years of working with it and if someone who already has DW looking for a way to use it for coding Drupal this could be helpful.

The most frustrating thing when coding Drupal modules or themes with DW is that it doesn’t recognize it as a PHP script and doesn’t give any validation or auto completion features like it usually does for php scripts. To fix this there’s little configuration to be done.

First find the installed directory of DW (if it’s Windows it most probably in ~/Program Files or if it’s Linux+wine it should be in your virtual windows environment) and go to Configuration->DocumentTypes. There should be a xml file called MMDocumentTypes that holds configurations regarding which language should be used for a given file format.

Find the line that says,
‘<documenttype id=”PHP_MySQL” servermodel=”PHP MySQL”….’
and depending on weather you are using windows or mac, append ‘,module,install,theme,inc’ to existing winfileextension or macfileextension values.

So for windows it should look like this.

<documenttype id=”PHP_MySQL” servermodel=”PHP MySQL” internaltype=”Dynamic” winfileextension=”php,php3,php4,php5,module,install,theme,inc” />

Now restart DW and open your module or theme file. Ta da!..it should now work as a normal php script.

Hope this will be helpful to someone looking for a way to convert Dreamweaver to a more Drupal friendly place.

Tagged , ,

PHP + Large files

I was working on the project Hotelotravel for last few months and as usual in many cases it involved working with large database files because when you consider all hotels, locations and images all over the world it means a lot. But if we want to do large file uploads or database updates with PHP there are few configurations to be done to default settings and I’m putting this as a note to myself (I’m always keep forgetting this) as well as to any one who may find this useful like when importing a large backup file through phpMyAdmin.

In your php.ini check for these settings and change them as you need.

  • post_max_size (The maximum size of post data you can send in one submission)
  • upload_max_filesize (Maximum size of file that can be uploaded)
  • memory_limit (Maximum memory limit that can be allocated for a script execution)
  • max_execution_time (Maximum time limit for a script execution)

As a side note, if you trying to import large files (backups.etc) through phpMyAdmin and it refuses, you may need to edit config.inc.php file and change these settings to 0 which means no limit.

  • $cfg[‘ExecTimeLimit’]
  • $cfg[‘MemoryLimit’]

As a final note, these settings are there for a purpose. So my advice is change them in whatever manner  you want in a development environment but be very careful when setting them in a production environment because an endless execution of a script can cause your servers to waste bandwidth and even crash.  So I guess this is my disclaimer 😉

Tagged ,

Closing Tributes

It’s bit late for for a closing tribute on SoC, but something is better than nothing, right ? So here we go.

Google Summer of Code 2008 was the second SoC I participated in and last year with Gnome was my first. This time the SoC was with Eclipse and it was in one word ‘Awsome’.

In more details, the summer with Eclipse community was a great experience, Specially my mentor David Carver who supported me in every stciky situation in the process and believe me when I say without his support it would have been a nightmare for me (one badspot with Eclipse is its lack of up-to-date documentation in certain areas). So my heartfelt thanks go to David and all the Eclipse community who helped me to have an easy learning curve.

You can check all 2008 SoC Eclipse projects here. More info on the project I was working on – Eclipse XQuery editor can be found here. The code can be checked out from Eclipse incubator repo from here – eclipse-incub.cvs.sourceforge.net/cvsroot/eclipse-incub/org.eclipse.wst.xquery. Also we have setup a download site for the plugin. If you are interested, please get a copy for yourself and check it out and let me know what you think of it.

Lastly, I’m hoping to continue the project and already have a long todo list prepared. Also my thanks go to all who voted me in as an official commiter for the project. Currently paper works are being carried out and hopefully I will soon get CVS access to Eclipse repo as an official commiter.

Btw, I got my SoC shirt and certificate last week and they will be great mementos to remember this summer with Eclipse. For all these great stuff a big thank goes to Google and specially its Open Source division.

GSoC 2008 mementos

Tagged ,

Trying to start rolling the dice…

Blogging is much like a metallic engine, where when it’s not properly maintained and sustained it starts eroding and it’s same in the case of blogging. When you don’t blog for a long time your writing become eroded and hand becomes heavier and heavier to start writing something. So I finally felt like start rolling the dice and hope it goes in a slope.

Writing is like a metalic engine

Tagged ,

Eclipse XQuery – a breakthrough at last…

Last 2 weeks were very productive for the new xquery editor and finally able to get a breakthrough in the project.

I was trying to work out xquery syntax colouring as I thought it is what someone would be expecting first from an editor. So finally it was completed by this weekend and you can see how it is working in the screenshot below.

When first I was thinking how to tokenize the text it was looking pretty gloomy because it would have taken a good amount of time to write ANTLR grammar file, generate tokeninzing scripts and finally fine tune them. But thanks to xqpretty tokenizer it was pretty easy for me to skip first 2 steps and directly go to 3rd step and fine tune it to my needs.

So I tested a good amount with the tokenizer to see whether it meets my requirements for the plugin and also Eclipse standards like license issues (As usual David was a huge help in these matters). Then I had to generalize token types to something around 10 because it was not manageable with more than 100s of token types.  After this was done I added required classes to provide text colouring such as PreferenceInitializer and LineStyleProvider. Then with some more bug fixing and mucking around finally got the required result.

But mind you, this is not completely tested nor bug free. I already have a list of bugs to fix regarding text parsing and some more runtime errors. So if you have a thing for xquery and some spare time, grab a copy please and list any error you see in text parsing (For now you will have to grab a copy from SF  using the address stated below but I’m now working on an update site for the project so it won’t be that hard then)

CVS: eclipse-incub.cvs.sourceforge.net/cvsroot/eclipse-incub/org.eclipse.wst.xquery

Eclipse-XQuery Syntax Colouring

Tagged , ,