Setting up your own Dev/Staging platform

Tips, Tricks, How To Guides, etc..

Setting up your own Dev/Staging platform

Postby mors3 » Tue Mar 19, 2013 3:04 pm

(thread moved from viewtopic.php?f=6&t=1396)

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;
}

add this:
Code: Select all
    $v = true;

so the result is:
Code: Select all
    $v = true;
    return $v
}

..it's really that simple. It's so simple and obvious, like I say, if Interspire really didn't want us to be able to do that, they would have made that a damn sight more complicated.

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 :)

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 :)

Morsey
ISC Ultimate (et al) 6.1.8
mors3
 
Posts: 8
Joined: Wed Mar 13, 2013 11:41 am
Location: Salisbury, United Kingdom

Re: Setting up your own Dev/Staging platform

Postby CharlieFoxtrot » Thu Dec 26, 2013 11:49 pm

In version 4.x the ech0 function appears to be almost identical, except that the value of $v is undefined by default. As the function executes, it returns simply true or false. I modified the function so that "return true;" is the first line. Works like a charm for my development site.
ISC 4.0.7

"... and let's be honest that whole "by design" thing is getting old too."
CharlieFoxtrot
Confirmed
Confirmed
 
Posts: 413
Joined: Sun Aug 09, 2009 1:23 pm

Re: Setting up your own Dev/Staging platform

Postby Martin » Thu Dec 14, 2017 3:34 pm

So, I'm back on ISC looking at how difficult it would be to update the code to PHP 7 and wondered how much any of you might have done with this?

PHPStorm seems to be a good place to start but there's a LOT of deprecated functions to sort out so may well be a non-starter...

Anyone gone this route as yet?
Martin
Site Admin
Site Admin
 
Posts: 1856
Joined: Wed Jun 17, 2009 6:30 pm
Location: South Yorkshire UK


Return to [SC] Knowledge Base

Who is online

Users browsing this forum: No registered users and 1 guest

cron