112 $fp = fopen( dirname(dirname(__DIR__)).
"/config/config.php",
"r");
113 $source = fread($fp, 1024);
115 $pattern =
"/ADMIN_PATH', LEPTON_PATH\.'(.*?)'\);/i";
118 preg_match_all( $pattern, $source, $founds , PREG_SET_ORDER);
120 if(isset($founds[0][1]))
122 self::$instance->admin_dir = $founds[0][1];
125 foreach( self::$instance->files_access_allowed as $key => $value)
127 $dirname = ($key ==
'backend')
128 ? self::$instance->admin_dir
132 foreach($value as $filename)
134 static::$instance->direct_access_allowed[] = $dirname.$filename;
153 $sServerFileName = str_replace(
"\\",
"/",$_SERVER[
'SCRIPT_FILENAME']);
154 if(
false !== strpos( $sServerFileName,
"modules") )
156 $aTerms = explode(
"/", $sServerFileName);
157 $sFolder = array_pop($aTerms);
161 while ($sFolder !=
"modules")
164 $sFolder = array_pop($aTerms);
165 $sPrefix =
"/".$sFolder.$sPrefix;
172 if( ++$iCounter > $iMaxCounts )
179 foreach($newFileNames as &$ref)
186 if(
false === strpos($ref, $sPrefix))
188 $ref = $sPrefix.$ref;
193 static::$instance->direct_access_allowed = $newFileNames;
194 static::$instance->bCalledByModule =
true;