Jump to content

Recommended Posts

hi guys

 

i work on a system in which i need to make a function that dynamicaly checks if a include file exists in the site specific folder otherwise use includes folder.

 

function site_specific_include($path) {
	$file = basename($path);
	if(ereg($path, "../")) $dotslash = "../";

	if(file_exists($dotslash."site_specific/".$file)) {
		include($dotslash."site_specific/".$file);
	}
	else {
		include($dotslash."includes/".$file);
	}
}

 

works fine but the problem is that objects instantiated outside the include file are no longer visible to the include file so i have to instantiate them inside now.

 

i recon its a memory scope issue but how do i resolve it ?

 

i used require require once include once i dont know ?

 

it affects my styles.php include in the main file too

Link to comment
https://forums.phpfreaks.com/topic/99176-includes-scope-problem/
Share on other sites

Well, I find it immensely annoying when people don't upgrade. They're preventing progression. How long time did it take after the release of PHP5 before you could actually use it? All because of people who are not upgrading. Same goes for Internet Explorer. It's still necessary to support IE6 even though IE7 has been out for a long time - all because of people who are too lazy to upgrade.

i said the exact same thing before i styarted working id love to work withh php 5 but teh problem is that most legacey systems the ones which are the best because they do there job well so they have lasted longer live on php 4 some even 3 lol, but yeh i wish i had php 5 systems so i could do proper oop with protection etc and all those little extras but it aint happening. IE 7 is just a bunch of asses cos they removed the glitch so u cant determin it using ie 6 glitch so u have to use object creation detection they are trying to make it so u develop on there platform IE7 and 6 are great to use but they are crap to develop on and develop for. Firefox is crap to use but is great to develop on because it has many tools and it knows what ur trying to do.l

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.