| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * PHPExcel | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2012-03-03 21:29:01 +00:00
										 |  |  |  * Copyright (c) 2006 - 2012 PHPExcel | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00: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 | 
					
						
							| 
									
										
										
										
											2012-03-03 21:29:01 +00:00
										 |  |  |  * @copyright  Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) | 
					
						
							| 
									
										
										
										
											2012-01-19 22:36:22 +00:00
										 |  |  |  * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  |  * @version    ##VERSION##, ##DATE##
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-23 17:24:29 +00:00
										 |  |  | PHPExcel_Autoloader::Register(); | 
					
						
							| 
									
										
										
										
											2012-05-25 06:45:01 +00:00
										 |  |  | //	As we always try to run the autoloader before anything else, we can use it to do a few
 | 
					
						
							|  |  |  | //		simple checks and initialisations
 | 
					
						
							| 
									
										
										
										
											2010-11-23 17:24:29 +00:00
										 |  |  | PHPExcel_Shared_ZipStreamWrapper::register(); | 
					
						
							|  |  |  | // check mbstring.func_overload
 | 
					
						
							|  |  |  | if (ini_get('mbstring.func_overload') & 2) { | 
					
						
							| 
									
										
										
										
											2012-01-19 22:36:22 +00:00
										 |  |  |     throw new Exception('Multibyte function overloading in PHP must be disabled for string functions (2).'); | 
					
						
							| 
									
										
										
										
											2010-11-23 17:24:29 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2010-12-03 17:48:10 +00:00
										 |  |  | PHPExcel_Shared_String::buildCharacterSets(); | 
					
						
							| 
									
										
										
										
											2010-11-23 17:24:29 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-21 23:55:54 +00:00
										 |  |  | /** | 
					
						
							|  |  |  |  * PHPExcel_Autoloader | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @category	PHPExcel | 
					
						
							|  |  |  |  * @package		PHPExcel | 
					
						
							|  |  |  |  * @copyright	Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | class PHPExcel_Autoloader | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2012-03-21 23:55:54 +00:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * 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
 | 
					
						
							|  |  |  | 		return spl_autoload_register(array('PHPExcel_Autoloader', 'Load')); | 
					
						
							|  |  |  | 	}	//	function Register()
 | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-03-21 23:55:54 +00:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * Autoload a class identified by name | 
					
						
							|  |  |  | 	 * | 
					
						
							|  |  |  | 	 * @param	string	$pClassName		Name of the object to load | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	public static function Load($pClassName){ | 
					
						
							| 
									
										
										
										
											2012-09-06 21:56:56 +00:00
										 |  |  | 		if ((class_exists($pClassName,FALSE)) || (strpos($pClassName, 'PHPExcel') !== 0)) { | 
					
						
							| 
									
										
										
										
											2012-03-21 23:55:54 +00:00
										 |  |  | 			//	Either already loaded, or not a PHPExcel class request
 | 
					
						
							|  |  |  | 			return FALSE; | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-05-25 06:45:01 +00:00
										 |  |  | 		$pClassFilePath = PHPEXCEL_ROOT . | 
					
						
							|  |  |  | 						  str_replace('_',DIRECTORY_SEPARATOR,$pClassName) . | 
					
						
							|  |  |  | 						  '.php'; | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-05-25 06:45:01 +00:00
										 |  |  | 		if ((file_exists($pClassFilePath) === false) || (is_readable($pClassFilePath) === false)) { | 
					
						
							| 
									
										
										
										
											2012-03-21 23:55:54 +00:00
										 |  |  | 			//	Can't load
 | 
					
						
							|  |  |  | 			return FALSE; | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-05-25 06:45:01 +00:00
										 |  |  | 		require($pClassFilePath); | 
					
						
							| 
									
										
										
										
											2012-03-21 23:55:54 +00:00
										 |  |  | 	}	//	function Load()
 | 
					
						
							| 
									
										
										
										
											2010-08-26 19:14:53 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | } |