You are here

class PHPExcel_Autoloader in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Autoloader.php \PHPExcel_Autoloader

PHPExcel_Autoloader

@category PHPExcel @package PHPExcel @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)

Hierarchy

Expanded class hierarchy of PHPExcel_Autoloader

1 string reference to 'PHPExcel_Autoloader'
PHPExcel_Autoloader::Register in vendor/phpoffice/phpexcel/Classes/PHPExcel/Autoloader.php
Register the Autoloader with SPL

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Autoloader.php, line 46

View source
class PHPExcel_Autoloader {

  /**
   * Register the Autoloader with SPL
   *
   */
  public static function Register() {
    if (function_exists('__autoload')) {

      //    Register any existing autoloader function with SPL, so we don't get any clashes
      spl_autoload_register('__autoload');
    }

    //    Register ourselves with SPL
    if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
      return spl_autoload_register(array(
        'PHPExcel_Autoloader',
        'Load',
      ), true, true);
    }
    else {
      return spl_autoload_register(array(
        'PHPExcel_Autoloader',
        'Load',
      ));
    }
  }

  //    function Register()

  /**
   * Autoload a class identified by name
   *
   * @param    string    $pClassName        Name of the object to load
   */
  public static function Load($pClassName) {
    if (class_exists($pClassName, FALSE) || strpos($pClassName, 'PHPExcel') !== 0) {

      //    Either already loaded, or not a PHPExcel class request
      return FALSE;
    }
    $pClassFilePath = PHPEXCEL_ROOT . str_replace('_', DIRECTORY_SEPARATOR, $pClassName) . '.php';
    if (file_exists($pClassFilePath) === FALSE || is_readable($pClassFilePath) === FALSE) {

      //    Can't load
      return FALSE;
    }
    require $pClassFilePath;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PHPExcel_Autoloader::Load public static function Autoload a class identified by name
PHPExcel_Autoloader::Register public static function Register the Autoloader with SPL