Include page in Dev vs Prod

I have to use some custom functions pages. To get SC to work with them, I need to put this on each page where I am calling the functions page:

require (’/home/prodservername/public_html/scriptcase9/app/projname/_lib/functions/functions_page.php’);

Now, for Development, it is on a different server and it has to be this:

require (’/home/devservername/public_html/_lib/functions/functions_page.php’);

How do I do this on my Development scripts so that I can test on the DEV server, but when I publish I dont have to keep changing the path to the function page?

What I would do is create a file on a relative location and include that one. This included file refers to the location requested. That way, you only have to setup your env once, and then reuse each time without bothering the location.

1 Like

Why cant you put your functions.php code into an External library and then include it in your onload or some event.
I do this with the PHPExcel library. It’s on my dev environment under one path but under the production environment in a different path, yet both are accessible relative to the ‘_lib’ path as you have above.
include sc_url_library(‘sys’, ‘PHPExcel1.8’, ‘Classes/PHPExcel.php’);

1 Like