Ok, so first thing you want to do is get your dev or staging environment setup.
My needs are pretty complicated as I need to develop on windows using IIS rather than Apache, but the very first decision you need to make is 'do I need to debug' and let me help you out here...
yes you do
So, whether your webserver is IIS or Apache, make sure you are running the debug version of PHP, personally I'll be using XDebug, but thats up to you (the other option is Zend Debugger).
There's a LOT of info out there about getting your version of PHP set up to pass debug info, but trust me, it seems a lot more complicated than it actually is, essentially what you are doing is adding another 'plugin' to it and then setting up the parameters for it, just like you would for MySql or MsSql.
When that's done (you can test it by running up a phpinfo() page and look for the keyword 'debug') your server is ready for the ISC code.
So, get your code on there, and then you need to tweak a couple of things.
The first one is to change /config/config.php to firstly use the localhost name rather than the domain name it currently is, then point to a clone of the live database, (this means that no matter how much you batter the code/database, you can always revert to cloning the live database back again and you're in business).
The next step is to stop the code throwing a wobbly when you use the site, as the ISC license currently jumps in when you log into the /Admin side.
This is NOT RECOMMENDED as it WILL not only invalidate your license, it will also potentially open you up to legal proceedings from Interspire, but if you need to test anything that happens in the Admin side, it's the only way I have so far found to do this (if anyone out there knows a better way of doing this, please let me know).
So, personally I think this has been left deliberately easily findable by ISC as it really didn't take long for me to work out how this worked (I just looked up the license_key variable assignment and went in from there) so I don't think it can put any noses out of joint if I explain how to do this.
In /lib/general.php there is a function called ech0($lk), it gets the license key passed in as $lk and it's immediately set to true.
Then it runs through a couple of state checks looking up to see if anything unsets the true on the license key and if not continues to return out the $v = true, so in simple terms, all you need to do is just before:
Code: Select all
return $v;
}
Code: Select all
$v = true;
Code: Select all
$v = true;
return $v
}
So, next step, debugging.
Now, I use Google Chrome as my primary browser and Aptana as my PHP development IDE, its pretty rich and now supports Debugging out of the box. You do need to set stuff up to enable it completely but it's amazing when it's all working.
So assuming, like me you are using Chrome and Aptana, set up debugging like this:
For Google Chrome, get this extension:
https://chrome.google.com/webstore/deta ... aaoc?hl=en
It adds a little bug into your Address bar, click it and it turns to green, then Aptana hook into the traffic from it and scoop up the debug info.
In Aptana, go to Run -> Debug Configurations -> PHP Web Page and set up a new profile in there.
You will need to tell it WHERE the server is, I use named hosts (so I can have a bunch of websites on one IIS server, all running on port 80) so I have a few servers kicking around, but realistically you're likely to need to click the + button next to PHP Server and put in the usual localhost info, also on the server page you must select which debug server type you will use (XDebug or Zend Debugger).
One thing I HAVE done in here and I'll be honest, I'm not sure if it's necessary or not, I have set the port on my base url to :9000 (so it looks like this http://myservername:9000).
That should be it! Just run up your debug session and then in your chrome browser create a new tab, click the bug to green and put in the address and all being good, BOING, you can has debug info
![Smile :)](./images/smilies/icon_e_smile.gif)
Now, fair warning here, I've been trying (with no luck) to get this working on my Aptana for days, it only started working this morning, so there's EVERY possibility that there's a setting or something under the hood that's helping this work, but if you run into issues with anything, give me a shout and I'll help as much as I can
![Smile :)](./images/smilies/icon_e_smile.gif)
Morsey