Ver Mensaje Individual
  #10 (permalink)  
Antiguo 25/01/2007, 17:51
Avatar de B**
B**
 
Fecha de Ingreso: enero-2006
Ubicación: Monterrey,Mexico
Mensajes: 952
Antigüedad: 18 años, 3 meses
Puntos: 3
Re: Importar al estilo java

EDIT:
Mi import gracias a GatorV:
Código PHP:
function import$class ) {
                    
$importDir getcwd() . "/application/";
                   
                    
$classDir str_replace"."DIRECTORY_SEPARATOR$class );
                    
                    if( 
substr$classDir, -1) === "*" ) { // Import several Classes
                        
$classDir str_replace"*"""$classDir );
                        
$importDir .= $classDir;
                        
$archivo=scandir($importDir);
                        foreach(
$archivo as $key => $val)
                         {
                             
$tmp=explode(".",$val);
                             if(
end($tmp)=="php")
                                 require_once(
$importDir $val);
                             
                         }
                    } else {
                        
$file $importDir $classDir '.php';
                        if( 
file_exists$file ) ) {
                            require_once( 
$file );
                        } else {
                            throw new 
Exception"$class not found" );
                        }
                    }
                } 
__________________
-URL= Go PHP5.
-Age=22.
-Learning=PHP,J2EE,Struts,MAMBO,C++,JSON,AJAX,XHTML ,CSS.

Última edición por B**; 25/01/2007 a las 18:09