PHP Classes

File: sys/core.php

Recommend this page to a friend!
  Classes of Nemeth Zoltan  >  RS framework  >  sys/core.php  >  Download  
File: sys/core.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: RS framework
Web application development framework
Author: By
Last change: Update of sys/core.php
Date: 29 days ago
Size: 675 bytes
 

Contents

Class file image Download
<?php
/**
 * Core functions
 */
@session_start();
$_SESSION['core'] = 1;
/**
 * Autoload classes
 *
 * @param string $className
 * @return void
 */
function loadClasses($className) {
   
$_tmp = explode("_", $className);
   
$class = array_pop($_tmp);
    if (
count($_tmp) > 0) {
       
$classPath = DS . implode(DS, $_tmp);
    }
    else {
       
$classPath = "";
    }
   
$baseDirs = array(
       
'libs',
       
'libs/interfaces',
       
'vendor',
       
'theme',
    );
    foreach (
$baseDirs as $dir) {
        if (
file_exists($dir . $classPath . DS . $class . ".php")) {
           
set_include_path($dir . $classPath);
           
spl_autoload($class);
            return;
        }
    }
}
spl_autoload_extensions('.php');
spl_autoload_register('loadClasses');



For more information send a message to info at phpclasses dot org.