SHARE
TWEET

Untitled

a guest Jun 25th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class / conexao / conexao.php
  2.             mvc   / modelos / PessoasModelos.php
  3.                     visoes  / PessoasVisoes.php
  4.                   controles / PessoasControles.php
  5.            util   / classUtilitarios.php
  6.      
  7. $DS = DIRECTORY_SEPARATOR;
  8.  
  9.    $paths[] = __DIR__ . $DS  . "class" . $DS  . "conexao" . $DS . $class . ".php";
  10.    $paths[] = __DIR__ . $DS  . "class" . $DS  . "mvc" . $DS  . "modelos" . $DS . $class . ".php";
  11.    $paths[] = __DIR__ . $DS  . "class" . $DS  . "mvc" . $DS  . "visoes" . $DS . $class . ".php";
  12.    $paths[] = __DIR__ . $DS  . "class" . $DS  . "mvc" . $DS  . "controles" . $DS . $class . ".php";
  13.    $paths[] = __DIR__ . $DS  . "class" . $DS  . "classUtilitarios" . $DS . $class . ".php";
  14.  
  15. foreach ( $paths as $path ) :
  16.  
  17.     if ( file_exists( $path ) ) require_once $path;
  18.  
  19. endforeach;
  20.      
  21. function autoload( $class ) {
  22.  
  23.        $DS = DIRECTORY_SEPARATOR;
  24.  
  25.        $paths[] = __DIR__ . $DS  . "class" . $DS  . "conexao" . $DS . $class . ".php";
  26.        $paths[] = __DIR__ . $DS  . "class" . $DS  . "mvc" . $DS  . "modelos" . $DS . $class . ".php";
  27.        $paths[] = __DIR__ . $DS  . "class" . $DS  . "mvc" . $DS  . "visoes" . $DS . $class . ".php";
  28.        $paths[] = __DIR__ . $DS  . "class" . $DS  . "mvc" . $DS  . "controles" . $DS . $class . ".php";
  29.        $paths[] = __DIR__ . $DS  . "class" . $DS  . "classUtilitarios" . $DS . $class . ".php";
  30.  
  31.     foreach ( $paths as $path ) :
  32.  
  33.         if ( file_exists( $path ) ) require_once $path;
  34.  
  35.     endforeach;
  36.  
  37. }
  38.  
  39. spl_autoloader_register("autoload");
  40.      
  41. foreach ( $paths as $path ) :
  42.          if(count($path.subpath > 0 ) função recursiva...
  43.         if ( file_exists( $path ) ) require_once $path;
  44.  
  45.     endforeach;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top