diff --git a/lib/PHPRtfLite/Autoloader.php b/lib/PHPRtfLite/Autoloader.php index 5dc5af5..873d8de 100644 --- a/lib/PHPRtfLite/Autoloader.php +++ b/lib/PHPRtfLite/Autoloader.php @@ -59,6 +59,11 @@ public static function autoload($className) if (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/m', $className)) { throw new Exception("Class name '$className' is invalid"); } + // Idea: Smarty - Autoloader - https://github.com/smarty-php/smarty/blob/master/libs/Autoloader.php + // Just autoload with your own PHPRtfLite files + if (stripos($className, 'PHPRtfLite') !== 0) { + return; + } $classFile = self::$_baseDir . '/' . str_replace('_', '/', $className) . '.php'; diff --git a/lib/PHPRtfLite/Table.php b/lib/PHPRtfLite/Table.php index 62d354a..df7c8aa 100644 --- a/lib/PHPRtfLite/Table.php +++ b/lib/PHPRtfLite/Table.php @@ -49,13 +49,13 @@ class PHPRtfLite_Table implements PHPRtfLite_Freeable * array of PHPRtfLite_Table_Row instances * @var PHPRtfLite_Table_Row[] */ - protected $_rows; + protected $_rows = array(); /** * array of PHPRtfLite_Table_Column instances * @var PHPRtfLite_Table_Column[] */ - protected $_columns; + protected $_columns = array(); /** * @var string