function __construct( $xls_fname = null ) { if ( is_string( $xls_fname ) ) { # create special "default" format key/val to avoid extra "if" logic: self::$format = array( 'null' => null ); self::$wb = new Spreadsheet_Excel_Writer_Workbook( $xls_fname ); self::$wb->setVersion( 8 ); self::$ws = self::$wb->addworksheet(); self::$ws->setInputEncoding( 'utf-8' ); self::$ws->setPaper( 9 ); } }
function __construct( $xls_fname = null ) { parent::__construct( $xls_fname ); # Create question writers; Single instances will be re-used in the top loop. # They are sharing the same instance of Spreadsheet_Excel_Writer_Worksheet. # We do not use class with static properties and methods only because # such class names cannot be accessed by reference in PHP < 5.3.0: # http://php.net/manual/en/language.oop5.static.php # "As of PHP 5.3.0, it's possible to reference the class using a variable. # The variable's value can not be a keyword (e.g. self, parent and static)." $this->tabular_writer = new qp_XlsTabularQuestion(); $this->text_writer = new qp_XlsTextQuestion(); }