2010-08-26 23:14:53 +04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* PHPExcel
|
|
|
|
*
|
2011-01-03 12:20:10 +03:00
|
|
|
* Copyright (c) 2006 - 2011 PHPExcel
|
2010-08-26 23:14:53 +04:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
|
|
|
* @category PHPExcel
|
|
|
|
* @package PHPExcel
|
2011-01-03 12:20:10 +03:00
|
|
|
* @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
|
2012-01-20 02:36:22 +04:00
|
|
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
2010-08-26 23:14:53 +04:00
|
|
|
* @version ##VERSION##, ##DATE##
|
|
|
|
*/
|
|
|
|
|
2010-11-23 20:24:29 +03:00
|
|
|
PHPExcel_Autoloader::Register();
|
|
|
|
PHPExcel_Shared_ZipStreamWrapper::register();
|
|
|
|
// check mbstring.func_overload
|
|
|
|
if (ini_get('mbstring.func_overload') & 2) {
|
2012-01-20 02:36:22 +04:00
|
|
|
throw new Exception('Multibyte function overloading in PHP must be disabled for string functions (2).');
|
2010-11-23 20:24:29 +03:00
|
|
|
}
|
2010-12-03 20:48:10 +03:00
|
|
|
PHPExcel_Shared_String::buildCharacterSets();
|
2010-11-23 20:24:29 +03:00
|
|
|
|
|
|
|
|
2010-08-26 23:14:53 +04:00
|
|
|
class PHPExcel_Autoloader
|
|
|
|
{
|
2012-01-20 02:36:22 +04:00
|
|
|
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
|
|
|
|
return spl_autoload_register(array('PHPExcel_Autoloader', 'Load'));
|
|
|
|
} // function Register()
|
2010-08-26 23:14:53 +04:00
|
|
|
|
|
|
|
|
2012-01-20 02:36:22 +04:00
|
|
|
public static function Load($pObjectName){
|
|
|
|
if ((class_exists($pObjectName)) || (strpos($pObjectName, 'PHPExcel') !== 0)) {
|
|
|
|
// Either already loaded, or not a PHPExcel class request
|
|
|
|
return FALSE;
|
|
|
|
}
|
2010-08-26 23:14:53 +04:00
|
|
|
|
2012-01-20 02:36:22 +04:00
|
|
|
$pObjectFilePath = PHPEXCEL_ROOT .
|
|
|
|
str_replace('_',DIRECTORY_SEPARATOR,$pObjectName) .
|
|
|
|
'.php';
|
2010-08-26 23:14:53 +04:00
|
|
|
|
2012-01-20 02:36:22 +04:00
|
|
|
if ((file_exists($pObjectFilePath) === false) || (is_readable($pObjectFilePath) === false)) {
|
|
|
|
// Can't load
|
|
|
|
return FALSE;
|
|
|
|
}
|
2010-08-26 23:14:53 +04:00
|
|
|
|
2012-01-20 02:36:22 +04:00
|
|
|
require($pObjectFilePath);
|
|
|
|
} // function Load()
|
2010-08-26 23:14:53 +04:00
|
|
|
|
|
|
|
}
|