|
123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- if(!defined('DEDEINC')) exit("Request Error!");
- /**
- * @version $Id: autoload.inc.php 1 17:44 2020-09-22 tianya $
- * @package DedeCMS.Libraries
- * @copyright Copyright (c) 2007 - 2020, DesDev, Inc.
- * @copyright Copyright (c) 2020, DedeBIZ.COM
- * @license http://help.dedecms.com/usersguide/license.html
- * @link http://www.dedecms.com
- */
-
- function __autoload($classname)
- {
- $classname = preg_replace("/[^0-9a-z_]/i", '', $classname);
- if( class_exists ( $classname ) )
- {
- return TRUE;
- }
- $classfile = $classname.'.php';
- $libclassfile = $classname.'.class.php';
- if ( is_file ( DEDEINC.'/'.$libclassfile ) )
- {
- require DEDEINC.'/'.$libclassfile;
- }
- else if( is_file ( DEDEMODEL.'/'.$classfile ) )
- {
- require DEDEMODEL.'/'.$classfile;
- }
- else
- {
- if (DEBUG_LEVEL === TRUE)
- {
- echo '<pre>';
- echo $classname.'类找不到';
- echo '</pre>';
- exit ();
- }
- else
- {
- header ( "location:/404.html" );
- die ();
- }
- }
- }
- ?>
|