You are here

public static function PHPExcel_Writer_Excel5_BIFFwriter::getByteOrder in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/BIFFwriter.php \PHPExcel_Writer_Excel5_BIFFwriter::getByteOrder()

* Determine the byte order and store it as class data to avoid * recalculating it for each call to new(). * *

Return value

int

7 calls to PHPExcel_Writer_Excel5_BIFFwriter::getByteOrder()
PHPExcel_Writer_Excel5_Parser::_convertNumber in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Parser.php
* Convert a number token to ptgInt or ptgNum * * @access private *
PHPExcel_Writer_Excel5_Worksheet::_writeMarginBottom in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Worksheet.php
* Store the BOTTOMMARGIN BIFF record.
PHPExcel_Writer_Excel5_Worksheet::_writeMarginLeft in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Worksheet.php
* Store the LEFTMARGIN BIFF record.
PHPExcel_Writer_Excel5_Worksheet::_writeMarginRight in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Worksheet.php
* Store the RIGHTMARGIN BIFF record.
PHPExcel_Writer_Excel5_Worksheet::_writeMarginTop in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Worksheet.php
* Store the TOPMARGIN BIFF record.

... See full list

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/BIFFwriter.php, line 113

Class

PHPExcel_Writer_Excel5_BIFFwriter
PHPExcel_Writer_Excel5_BIFFwriter

Code

public static function getByteOrder() {
  if (!isset(self::$_byte_order)) {

    // Check if "pack" gives the required IEEE 64bit float
    $teststr = pack("d", 1.2345);
    $number = pack("C8", 0x8d, 0x97, 0x6e, 0x12, 0x83, 0xc0, 0xf3, 0x3f);
    if ($number == $teststr) {
      $byte_order = 0;

      // Little Endian
    }
    elseif ($number == strrev($teststr)) {
      $byte_order = 1;

      // Big Endian
    }
    else {

      // Give up. I'll fix this in a later version.
      throw new PHPExcel_Writer_Exception("Required floating point format not supported on this platform.");
    }
    self::$_byte_order = $byte_order;
  }
  return self::$_byte_order;
}