Jump to content


Welcome to IPS!

Feel free to browse our community to get a feel for how our community software operates. Post in the pre-sales forum with any questions you have before purchasing or use the Test Posting forum to post a few messages yourself! You can also get a free demo to try the IPS Community Suite yourself.

Already an active IPS client?

Login with the same email address and password you use for the client area to access client-only areas.





Photo - - - - -

How I develop

Posted by W1lz0r, 02 August 2007 · 51 views


Developing can be done with many different tools and on many different environments. Every developer has his own preferences. So this is about how I develop, what tools I use and how I have set things up. You'll probably notice I did not choose for the typical environments you regurlarly see when developing in PHP.

First of all, I have both a laptop and a PC. The laptop is mainly used for day to day business and the PC when I want to withdraw to my private room.

The laptop
My laptop is a Dell XPS M1710. It has 2 Gigs of memory and a dual core 32 bits processor and Windows Vista Ultimate 32 bits installed.

My webserver of choice is IIS 7.0. I use it not because it comes with Windows, but also because it helps to test some features on how they work on IIS. I also find it easy to configure.

I have PHP 5.2.3 installed running in fastcgi mode. FastCGI you might think? Does that work on IIS? In fact Microsoft has developed a fastCGI module for IIS in collaboration with Zend. For more details see here. Before I found this module I used to run PHP as an ISAPI module. Which generally worked fine for me too.
I have the following extensions installed: GD2, MSSQL, MySQL, OCI8 and PGSQL.

On the database side of things it gets interesting. I have four database engines installed. Yes, I am not kidding, I actually have four engines installed on my laptop and the good thing is; I don't notice any slowdowns at all. Yes I make good use of my memory wink.gif
- SQL Server 2005 Express
- MySQL 5.0
- Oracle 10g Express
- PostgreSQL 8.2

Lastly next to Internet Explorer, I have FireFox 2 installed. Which is the browser I prefer most. With the plugin IE View Lite I am able to quickly view a page in Internet Explorer if I wish.

The PC
My PC has a simular setup as my laptop. Only this time it is Windows Vista Ultimate x64. For PHP I use the 64 bits compilation provided by Fusion-X Lan. It is not that the 32 bits edition of PHP cannot be used (it can with some special configuration made in IIS to allow 32 bits components), but I am running 64bits, so my PHP should do too. I do not have all the database installed. Just SQL Server 2005 Express 64 bit.

SVN
As is probably known, the IPS developers use SVN for their version control system and all code is centrally stored on one of IPS' servers. This helps us a lot in the development process keeping everything on par with each other and if multiple developers work together a good version control system is a 'must'. For the client side of things I use TortoiseSVN. This integrates needly into Explorer and makes things like updating, committing, reverting, tagging a breeze. It also has a 64bit version for my PC.

Editor
The editor I use to develop is UltraEdit. I have been using this for a very long time now and it really does it's job right. It has all the editing features I could wish for.

The setup
Whilst developing I allways work on my localhost. But I have it setup in a way I can easily switch between databases and versions. As an example for IP.Board I have the following URL's I use:
http://www.ipboardmssql.dev
http://www.ipboardmysql.dev
http://www.ipboardoracle.dev

I have these URL's pointing to my localhost via the hosts file. In IIS these three URL's all point to the trunk (latest version of the source coming from SVN) of IP.Board. And I have altered my conf_global.php to let the URL decide which database to use as follows:
CODE
if( $_SERVER['HTTP_HOST'] == 'www.ipboardoracle.dev' )
{
     $INFO['sql_driver']            =    'oracle';
{other db connection stuff}
     $INFO['board_url']            =    'http://www.ipboardoracle.dev';
}
elseif( $_SERVER['HTTP_HOST'] == 'www.ipboardmssql.dev' )
{
     $INFO['sql_driver']            =    'mssql';
{other db connection stuff}
      $INFO['board_url']            =    'http://www.ipboardmssql.dev';
}
elseif( $_SERVER['HTTP_HOST'] == 'www.ipboardmysql.dev' )
{
     $INFO['sql_driver']            =    'mysql';
{other db connection stuff}
      $INFO['board_url']            =    'http://www.ipboardmysql.dev';
}
{rest of conf_global}


This allows me to quickly change between databases and still keep all the code in one place. Changes I make to the database drivers can immediatly be committed to SVN without having to copy things over. I find this to be an easy way to be able to support multiple databases in one setup.

For IP.Blog and IP.Gallery I have simular setups. I develop IP.Blog on SQL Server first before I start to make the neccesary file to support the other databases. This puts me in a bit of 'special' positions within IPS, as everything else is developed on MySQL first. But this is how I like it best, so I will probably not change that.




Nice. Some details of how I develop.

Here at the office I have a nice custom built machine - 2GB RAM, Core 2 1.87 Ghz Intel Processor, and plenty enough HD space. 32 bits. I run WAMP, which is an easy to install and configure Apache/PHP/MySQL manager on Windows. There are plenty of these (i.e. XAMPP) but WAMP is my preference. I have the following PHP extensions enabled: GD2, curl, exif, mbstring, mysql, mysqli. I also enable and disable xdebug when I need to (note, it can be tricky finding a win32 build of xdebug for current versions of PHP, so I don't necessarily always have a copy of xdebug, or always have a copy of the latest version of PHP). I will not get into how I use xdebug in depth here, as it would really warrant it's own entry, but to view the files on Windows I use WinCacheGrind, an opensource equivalent (albeit much more limited) version of KCacheGrind. With WAMP, enabling and disabling PHP extensions just involves clicking an off/on switch in a menu from the task bar, making it easy to change these.

(At home, as a note, I have both a 64 bit WinXP system running WAMP, and a laptop - the laptop connects over my network to my main pc so I don't have to run all the software directly on the laptop, which has much limited resources).

I modify my Windows hosts file to set "localhost.com" to point to my localhost IP of 127.0.0.1. This means I can test the software as if I'm running it from a domain.

I also use TortoiseSVN, which is excellent SVN software for Windows, and really stable. The only issue I've ever run into with it, is when I was working both from Windows and a Nix server simultaneously, and TortoiseSVN updated to a recent version of SVN client, while Nix didn't, so Nix could no longer commit files. That was a headache - be careful to keep SVN client versions in synch when working from multiple locations.

I use Firefox almost exclusively, except when working on bug reports, or readying a brand new version. I use the LiveHTTPHeaders tool in Firefox a lot - it lets you inspect the headers the server is sending to the browser (and vice-versa). I find this tool almost invaluable, and use it practically daily.

For my editor, I use Crimson Editor. It has PHP syntax highlighting (among other languages), line numbers, plaint text (so you don't deal with the formatting nonsense you see in MS Wordpad for example), tabs, and other various useful things. I especially like how it honors ctrl + tab as it should - unlike with a browser where you just cycle through tabs, in Crimson Editor it switch back and forth. If I hit ctrl + tab it goes to the last tab I was on, then if I hit it again it goes back. It does not just proceed to the next opened tab. It's the small things that always matter right? wink.gif

I keep IP.Board set to IN_DEV = 1 almost all the time, except when working on the IP.Board Pro skin. I keep it enabled all the time when working on other projects.

I have also setup mail to dump to a folder for debugging purposes. To do this you open conf_global.php and add

CODE
$INFO['fake_mail'] = 1;


And then you create a directory in your forum directory called "_mail" (CHMOD 0777, or set to read/write privileges on Windows). When I do something that triggers a mail, since I don't install mail programs on Windows, it writes it to a file so I can inspect the email.

I have IE7 and Opera installed, and I have a standalone version of IE6 installed I can look at when needed. You can download a standalone version of IE6 from evolt.
QUOTE(bfarber @ Aug 2 2007, 10:24 AM)
For my editor, I use Crimson Editor. It has PHP syntax highlighting (among other languages), line numbers, plaint text (so you don't deal with the formatting nonsense you see in MS Wordpad for example), tabs, and other various useful things. I especially like how it honors ctrl + tab as it should - unlike with a browser where you just cycle through tabs, in Crimson Editor it switch back and forth. If I hit ctrl + tab it goes to the last tab I was on, then if I hit it again it goes back. It does not just proceed to the next opened tab. It's the small things that always matter right? wink.gif


Just a quick note, I got annoyed that Crimson Editor still uses PHP4 syntax (mostly) so I looked and found a syntax file for PHP5.

http://www.crimsoneditor.com/english/board...amp;backdepth=1

Just edit C:\Program Files\Crimson Editor\spec\php.key and add the contents of his post starting at (and including) "[-COMMENT-:GLOBAL]" all the way to the end of the post.

Disclaimer

This blog contains my personal views and does not represent IPS, Inc. in any way.

February 2012

S M T W T F S
   1234
5678 9 1011
12131415161718
19202122232425
26272829   

Search My Blog

Recent Entries

Latest Visitors

0 user(s) viewing

0 members, 0 guests, 0 anonymous users

Recent Comments