I am creating a generic file where multiple systems can use the same libraries, thus generating a much smaller package. In this generic file there is a function where I include the necessary files. The problem that is occuring is that when I do the system includes in this function, I do not have access to the properties, variables and functions of the included file. I'll try to exemplify the structure of the system.
The structure of the system is:
-
wamp/www/sistem/exemploSistema/index.php
-
wamp/www/sistem/exemploSistema/funcoes.php
-
wamp/www/sistem/generics/funcaoGenerica.php
File funcoes.php
:
<?
$tt = 'teste';
function teste(){
global $tt;
return $tt;
}
?>
File funcaoGenerica.php
:
<?php
function generic($sting){
include_once($sting);
}
?>
File index.php
:
<?
include_once('/sistem/generics/funcaoGenerica.php');
generic('/sistem/exemploSistema/funcoes.php');
echo teste();
?>
In the index.php
file I can not access the teste
function of the funcoes.php
file. Would you have a solution to this problem or some other way to it?