Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace autoloader;
- function _autoload( $is_admin = false ){
- if( $is_admin == 1 )
- $is_admin = 'admin/';
- foreach ( glob( self::$plugin_obj->include_path . $is_admin . '*.class.php' ) as $k => $file ) {
- $s = self::$plugin_obj->include_path . $is_admin . "(#.*?).class.php";
- preg_match_all( '/' . str_replace( array( '/', '.', '#\.' ), array( '\/', '\.', '.' ), $s ) . "$/" , $file, $match );
- require_once( $match[0][0] );
- $class = __NAMESPACE__ . '\\' . $match[1][0];
- new $class();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement