PHP Classes

File: Example/_autoload.php

Recommend this page to a friend!
  Classes of Pierre-Henry Soria   PHP Markdown and BBCode Parser   Example/_autoload.php   Download  
File: Example/_autoload.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Markdown and BBCode Parser
Parse and replace Markdown and BBCode by HTML
Author: By
Last change: Update of Example/_autoload.php
Date: 5 months ago
Size: 757 bytes
 

Contents

Class file image Download
<?php
/**
 * @title Classes loader
 *
 * @author Pierre-Henry Soria <ph7software@gmail.com>
 * @copyright (c) 2012-2013, Pierre-Henry Soria. All Rights Reserved.
 * @license Lesser General Public License; See LICENSE.txt in the root directory.
 * @link http://github.com/pH-7
 * @package PH7
 * @version 1.0
 */

namespace PH7;
defined('PH7') or exit('Restricted access');

// Autoloading Classes Files
spl_autoload_register(function($sClass)
{
   
// Hack to remove namespace and backslash
   
$sClass = str_replace(array(__NAMESPACE__ . '\\', '\\'), '/', $sClass);

    if(
is_file(dirname(__DIR__) . $sClass . '.class.php'))
        require
dirname(__DIR__) . $sClass . '.class.php';
});