PHP Classes

File: account/phpsls/autoload.php

Recommend this page to a friend!
  Classes of Mohamed Elbahja  >  PHP Secure Login Library  >  account/phpsls/autoload.php  >  Download  
File: account/phpsls/autoload.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP Secure Login Library
Login users and start sessions in a MySQL database
Author: By
Last change:
Date: 5 years ago
Size: 550 bytes
 

Contents

Class file image Download
<?php defined('INC_FILES') || exit('Direct access not allowed');

/**
 * autoloading
 * @param string $class
 * @return void
 */

function SlsLoader($x)
{

   
$prefix = explode('\\', $x);
   
$prefix = $prefix[0];
   
// check sls autoloader prefix
   
if($prefix != 'SlsCore') {
        return;
    }
       
   
$inclass = SLS_DIR . '/' . str_replace('\\', '/', $x) . '.php';

    if (
file_exists($inclass)) {

        if (!
class_exists($x)) {
           
            require_once(
$inclass);
        }
       
        unset(
$inclass, $x);
    }

}

spl_autoload_register('SlsLoader');

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