diff --git a/Examples/10autofilter-selection-1.php b/Examples/10autofilter-selection-1.php index 36882d80..de5fc079 100644 --- a/Examples/10autofilter-selection-1.php +++ b/Examples/10autofilter-selection-1.php @@ -77,7 +77,7 @@ foreach($years as $year) { foreach($countries as $country) { $endDays = date('t',mktime(0,0,0,$period,1,$year)); for($i = 1; $i <= $endDays; ++$i) { - $eDate = \PHPExcel\Shared\Date::FormattedPHPToExcel( + $eDate = \PHPExcel\Shared\Date::formattedPHPToExcel( $year, $period, $i diff --git a/Examples/10autofilter-selection-2.php b/Examples/10autofilter-selection-2.php index 8cd6d121..38be07ef 100644 --- a/Examples/10autofilter-selection-2.php +++ b/Examples/10autofilter-selection-2.php @@ -76,7 +76,7 @@ foreach($years as $year) { foreach($countries as $country) { $endDays = date('t',mktime(0,0,0,$period,1,$year)); for($i = 1; $i <= $endDays; ++$i) { - $eDate = \PHPExcel\Shared\Date::FormattedPHPToExcel( + $eDate = \PHPExcel\Shared\Date::formattedPHPToExcel( $year, $period, $i diff --git a/Examples/10autofilter-selection-display.php b/Examples/10autofilter-selection-display.php index 7fb9b7f6..5ac39e49 100644 --- a/Examples/10autofilter-selection-display.php +++ b/Examples/10autofilter-selection-display.php @@ -77,7 +77,7 @@ foreach($years as $year) { foreach($countries as $country) { $endDays = date('t',mktime(0,0,0,$period,1,$year)); for($i = 1; $i <= $endDays; ++$i) { - $eDate = \PHPExcel\Shared\Date::FormattedPHPToExcel( + $eDate = \PHPExcel\Shared\Date::formattedPHPToExcel( $year, $period, $i diff --git a/src/PhpSpreadsheet/CachedObjectStorage/DiscISAM.php b/src/PhpSpreadsheet/CachedObjectStorage/DiscISAM.php index 603f1705..7f7ea604 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/DiscISAM.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/DiscISAM.php @@ -186,7 +186,7 @@ class DiscISAM extends CacheBase implements ICache { $this->cacheDirectory = ((isset($arguments['dir'])) && ($arguments['dir'] !== null)) ? $arguments['dir'] - : \PHPExcel\Shared\File::sys_get_temp_dir(); + : \PHPExcel\Shared\File::sysGetTempDir(); parent::__construct($parent); if (is_null($this->fileHandle)) { diff --git a/src/PhpSpreadsheet/Calculation/DateTime.php b/src/PhpSpreadsheet/Calculation/DateTime.php index 2bafcc9e..83f4ede8 100644 --- a/src/PhpSpreadsheet/Calculation/DateTime.php +++ b/src/PhpSpreadsheet/Calculation/DateTime.php @@ -123,7 +123,7 @@ class DateTime private static function adjustDateByMonths($dateValue = 0, $adjustmentMonths = 0) { // Execute function - $PHPDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($dateValue); + $PHPDateObject = \PHPExcel\Shared\Date::excelToPHPObject($dateValue); $oMonth = (int) $PHPDateObject->format('m'); $oYear = (int) $PHPDateObject->format('Y'); @@ -218,10 +218,10 @@ class DateTime $retValue = (float) $excelDateTime; break; case Functions::RETURNDATE_PHP_NUMERIC: - $retValue = (integer) \PHPExcel\Shared\Date::ExcelToPHP($excelDateTime); + $retValue = (integer) \PHPExcel\Shared\Date::excelToPHP($excelDateTime); break; case Functions::RETURNDATE_PHP_OBJECT: - $retValue = \PHPExcel\Shared\Date::ExcelToPHPObject($excelDateTime); + $retValue = \PHPExcel\Shared\Date::excelToPHPObject($excelDateTime); break; } date_default_timezone_set($saveTimeZone); @@ -336,14 +336,14 @@ class DateTime } // Execute function - $excelDateValue = \PHPExcel\Shared\Date::FormattedPHPToExcel($year, $month, $day); + $excelDateValue = \PHPExcel\Shared\Date::formattedPHPToExcel($year, $month, $day); switch (Functions::getReturnDateType()) { case Functions::RETURNDATE_EXCEL: return (float) $excelDateValue; case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) \PHPExcel\Shared\Date::ExcelToPHP($excelDateValue); + return (integer) \PHPExcel\Shared\Date::excelToPHP($excelDateValue); case Functions::RETURNDATE_PHP_OBJECT: - return \PHPExcel\Shared\Date::ExcelToPHPObject($excelDateValue); + return \PHPExcel\Shared\Date::excelToPHPObject($excelDateValue); } } @@ -433,9 +433,9 @@ class DateTime if ($calendar != \PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900) { $date = 1; } - return (float) \PHPExcel\Shared\Date::FormattedPHPToExcel($calendar, 1, $date, $hour, $minute, $second); + return (float) \PHPExcel\Shared\Date::formattedPHPToExcel($calendar, 1, $date, $hour, $minute, $second); case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) \PHPExcel\Shared\Date::ExcelToPHP(\PHPExcel\Shared\Date::FormattedPHPToExcel(1970, 1, 1, $hour, $minute, $second)); // -2147468400; // -2147472000 + 3600 + return (integer) \PHPExcel\Shared\Date::excelToPHP(\PHPExcel\Shared\Date::formattedPHPToExcel(1970, 1, 1, $hour, $minute, $second)); // -2147468400; // -2147472000 + 3600 case Functions::RETURNDATE_PHP_OBJECT: $dayAdjust = 0; if ($hour < 0) { @@ -559,7 +559,7 @@ class DateTime $PHPDateArray['day'] = strftime('%d'); } $excelDateValue = floor( - \PHPExcel\Shared\Date::FormattedPHPToExcel( + \PHPExcel\Shared\Date::formattedPHPToExcel( $PHPDateArray['year'], $PHPDateArray['month'], $PHPDateArray['day'], @@ -573,7 +573,7 @@ class DateTime case Functions::RETURNDATE_EXCEL: return (float) $excelDateValue; case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) \PHPExcel\Shared\Date::ExcelToPHP($excelDateValue); + return (integer) \PHPExcel\Shared\Date::excelToPHP($excelDateValue); case Functions::RETURNDATE_PHP_OBJECT: return new \DateTime($PHPDateArray['year'].'-'.$PHPDateArray['month'].'-'.$PHPDateArray['day'].' 00:00:00'); } @@ -612,7 +612,7 @@ class DateTime $PHPDateArray = date_parse($timeValue); if (($PHPDateArray !== false) && ($PHPDateArray['error_count'] == 0)) { if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) { - $excelDateValue = \PHPExcel\Shared\Date::FormattedPHPToExcel( + $excelDateValue = \PHPExcel\Shared\Date::formattedPHPToExcel( $PHPDateArray['year'], $PHPDateArray['month'], $PHPDateArray['day'], @@ -621,14 +621,14 @@ class DateTime $PHPDateArray['second'] ); } else { - $excelDateValue = \PHPExcel\Shared\Date::FormattedPHPToExcel(1900, 1, 1, $PHPDateArray['hour'], $PHPDateArray['minute'], $PHPDateArray['second']) - 1; + $excelDateValue = \PHPExcel\Shared\Date::formattedPHPToExcel(1900, 1, 1, $PHPDateArray['hour'], $PHPDateArray['minute'], $PHPDateArray['second']) - 1; } switch (Functions::getReturnDateType()) { case Functions::RETURNDATE_EXCEL: return (float) $excelDateValue; case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) $phpDateValue = \PHPExcel\Shared\Date::ExcelToPHP($excelDateValue+25569) - 3600; + return (integer) $phpDateValue = \PHPExcel\Shared\Date::excelToPHP($excelDateValue+25569) - 3600; case Functions::RETURNDATE_PHP_OBJECT: return new \DateTime('1900-01-01 '.$PHPDateArray['hour'].':'.$PHPDateArray['minute'].':'.$PHPDateArray['second']); } @@ -668,12 +668,12 @@ class DateTime // Execute function $difference = $endDate - $startDate; - $PHPStartDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($startDate); + $PHPStartDateObject = \PHPExcel\Shared\Date::excelToPHPObject($startDate); $startDays = $PHPStartDateObject->format('j'); $startMonths = $PHPStartDateObject->format('n'); $startYears = $PHPStartDateObject->format('Y'); - $PHPEndDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($endDate); + $PHPEndDateObject = \PHPExcel\Shared\Date::excelToPHPObject($endDate); $endDays = $PHPEndDateObject->format('j'); $endMonths = $PHPEndDateObject->format('n'); $endYears = $PHPEndDateObject->format('Y'); @@ -787,12 +787,12 @@ class DateTime } // Execute function - $PHPStartDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($startDate); + $PHPStartDateObject = \PHPExcel\Shared\Date::excelToPHPObject($startDate); $startDay = $PHPStartDateObject->format('j'); $startMonth = $PHPStartDateObject->format('n'); $startYear = $PHPStartDateObject->format('Y'); - $PHPEndDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($endDate); + $PHPEndDateObject = \PHPExcel\Shared\Date::excelToPHPObject($endDate); $endDay = $PHPEndDateObject->format('j'); $endMonth = $PHPEndDateObject->format('n'); $endYear = $PHPEndDateObject->format('Y'); @@ -1094,9 +1094,9 @@ class DateTime case Functions::RETURNDATE_EXCEL: return (float) $endDate; case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) \PHPExcel\Shared\Date::ExcelToPHP($endDate); + return (integer) \PHPExcel\Shared\Date::excelToPHP($endDate); case Functions::RETURNDATE_PHP_OBJECT: - return \PHPExcel\Shared\Date::ExcelToPHPObject($endDate); + return \PHPExcel\Shared\Date::excelToPHPObject($endDate); } } @@ -1129,7 +1129,7 @@ class DateTime } // Execute function - $PHPDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($dateValue); + $PHPDateObject = \PHPExcel\Shared\Date::excelToPHPObject($dateValue); return (int) $PHPDateObject->format('j'); } @@ -1173,7 +1173,7 @@ class DateTime } // Execute function - $PHPDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($dateValue); + $PHPDateObject = \PHPExcel\Shared\Date::excelToPHPObject($dateValue); $DoW = $PHPDateObject->format('w'); $firstDay = 1; @@ -1249,7 +1249,7 @@ class DateTime } // Execute function - $PHPDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($dateValue); + $PHPDateObject = \PHPExcel\Shared\Date::excelToPHPObject($dateValue); $dayOfYear = $PHPDateObject->format('z'); $dow = $PHPDateObject->format('w'); $PHPDateObject->modify('-' . $dayOfYear . ' days'); @@ -1288,7 +1288,7 @@ class DateTime } // Execute function - $PHPDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($dateValue); + $PHPDateObject = \PHPExcel\Shared\Date::excelToPHPObject($dateValue); return (int) $PHPDateObject->format('n'); } @@ -1320,7 +1320,7 @@ class DateTime } // Execute function - $PHPDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($dateValue); + $PHPDateObject = \PHPExcel\Shared\Date::excelToPHPObject($dateValue); return (int) $PHPDateObject->format('Y'); } @@ -1361,7 +1361,7 @@ class DateTime } elseif ($timeValue < 0.0) { return Functions::NaN(); } - $timeValue = \PHPExcel\Shared\Date::ExcelToPHP($timeValue); + $timeValue = \PHPExcel\Shared\Date::excelToPHP($timeValue); return (int) gmdate('G', $timeValue); } @@ -1402,7 +1402,7 @@ class DateTime } elseif ($timeValue < 0.0) { return Functions::NaN(); } - $timeValue = \PHPExcel\Shared\Date::ExcelToPHP($timeValue); + $timeValue = \PHPExcel\Shared\Date::excelToPHP($timeValue); return (int) gmdate('i', $timeValue); } @@ -1443,7 +1443,7 @@ class DateTime } elseif ($timeValue < 0.0) { return Functions::NaN(); } - $timeValue = \PHPExcel\Shared\Date::ExcelToPHP($timeValue); + $timeValue = \PHPExcel\Shared\Date::excelToPHP($timeValue); return (int) gmdate('s', $timeValue); } @@ -1489,7 +1489,7 @@ class DateTime case Functions::RETURNDATE_EXCEL: return (float) \PHPExcel\Shared\Date::PHPToExcel($PHPDateObject); case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) \PHPExcel\Shared\Date::ExcelToPHP(\PHPExcel\Shared\Date::PHPToExcel($PHPDateObject)); + return (integer) \PHPExcel\Shared\Date::excelToPHP(\PHPExcel\Shared\Date::PHPToExcel($PHPDateObject)); case Functions::RETURNDATE_PHP_OBJECT: return $PHPDateObject; } @@ -1538,7 +1538,7 @@ class DateTime case Functions::RETURNDATE_EXCEL: return (float) \PHPExcel\Shared\Date::PHPToExcel($PHPDateObject); case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) \PHPExcel\Shared\Date::ExcelToPHP(\PHPExcel\Shared\Date::PHPToExcel($PHPDateObject)); + return (integer) \PHPExcel\Shared\Date::excelToPHP(\PHPExcel\Shared\Date::PHPToExcel($PHPDateObject)); case Functions::RETURNDATE_PHP_OBJECT: return $PHPDateObject; } diff --git a/src/PhpSpreadsheet/Calculation/Financial.php b/src/PhpSpreadsheet/Calculation/Financial.php index ce50f91f..fbc9ffe4 100644 --- a/src/PhpSpreadsheet/Calculation/Financial.php +++ b/src/PhpSpreadsheet/Calculation/Financial.php @@ -67,7 +67,7 @@ class Financial { $months = 12 / $frequency; - $result = \PHPExcel\Shared\Date::ExcelToPHPObject($maturity); + $result = \PHPExcel\Shared\Date::excelToPHPObject($maturity); $eom = self::isLastDayOfMonth($result); while ($settlement < \PHPExcel\Shared\Date::PHPToExcel($result)) { diff --git a/src/PhpSpreadsheet/Chart/Legend.php b/src/PhpSpreadsheet/Chart/Legend.php index 237a7a55..1bfc0efb 100644 --- a/src/PhpSpreadsheet/Chart/Legend.php +++ b/src/PhpSpreadsheet/Chart/Legend.php @@ -30,12 +30,12 @@ namespace PHPExcel\Chart; class Legend { /** Legend positions */ - const xlLegendPositionBottom = -4107; // Below the chart. - const xlLegendPositionCorner = 2; // In the upper right-hand corner of the chart border. - const xlLegendPositionCustom = -4161; // A custom position. - const xlLegendPositionLeft = -4131; // Left of the chart. - const xlLegendPositionRight = -4152; // Right of the chart. - const xlLegendPositionTop = -4160; // Above the chart. + const XL_LEGEND_POSITION_BOTTOM = -4107; // Below the chart. + const XL_LEGEND_POSITION_CORNER = 2; // In the upper right-hand corner of the chart border. + const XL_LEGEND_POSITION_CUSTOM = -4161; // A custom position. + const XL_LEGEND_POSITION_LEFT = -4131; // Left of the chart. + const XL_LEGEND_POSITION_RIGHT = -4152; // Right of the chart. + const XL_LEGEND_POSITION_TOP = -4160; // Above the chart. const POSITION_RIGHT = 'r'; const POSITION_LEFT = 'l'; @@ -44,12 +44,12 @@ class Legend const POSITION_TOPRIGHT = 'tr'; private static $positionXLref = array( - self::xlLegendPositionBottom => self::POSITION_BOTTOM, - self::xlLegendPositionCorner => self::POSITION_TOPRIGHT, - self::xlLegendPositionCustom => '??', - self::xlLegendPositionLeft => self::POSITION_LEFT, - self::xlLegendPositionRight => self::POSITION_RIGHT, - self::xlLegendPositionTop => self::POSITION_TOP + self::XL_LEGEND_POSITION_BOTTOM => self::POSITION_BOTTOM, + self::XL_LEGEND_POSITION_CORNER => self::POSITION_TOPRIGHT, + self::XL_LEGEND_POSITION_CUSTOM => '??', + self::XL_LEGEND_POSITION_LEFT => self::POSITION_LEFT, + self::XL_LEGEND_POSITION_RIGHT => self::POSITION_RIGHT, + self::XL_LEGEND_POSITION_TOP => self::POSITION_TOP ); /** @@ -124,7 +124,7 @@ class Legend * * @param number $positionXL */ - public function setPositionXL($positionXL = self::xlLegendPositionRight) + public function setPositionXL($positionXL = self::XL_LEGEND_POSITION_RIGHT) { if (!array_key_exists($positionXL, self::$positionXLref)) { return false; diff --git a/src/PhpSpreadsheet/Reader/Excel5.php b/src/PhpSpreadsheet/Reader/Excel5.php index 22d818ec..2f9a2ed1 100644 --- a/src/PhpSpreadsheet/Reader/Excel5.php +++ b/src/PhpSpreadsheet/Reader/Excel5.php @@ -1358,7 +1358,7 @@ class Excel5 extends BaseReader implements IReader switch ($id) { case 0x01: // Code Page - $codePage = \PHPExcel\Shared\CodePage::NumberToName($value); + $codePage = \PHPExcel\Shared\CodePage::numberToName($value); break; case 0x02: // Title $this->phpExcel->getProperties()->setTitle($value); @@ -1504,7 +1504,7 @@ class Excel5 extends BaseReader implements IReader switch ($id) { case 0x01: // Code Page - $codePage = \PHPExcel\Shared\CodePage::NumberToName($value); + $codePage = \PHPExcel\Shared\CodePage::numberToName($value); break; case 0x02: // Category $this->phpExcel->getProperties()->setCategory($value); @@ -1884,7 +1884,7 @@ class Excel5 extends BaseReader implements IReader // offset: 0; size: 2; code page identifier $codepage = self::getInt2d($recordData, 0); - $this->codepage = \PHPExcel\Shared\CodePage::NumberToName($codepage); + $this->codepage = \PHPExcel\Shared\CodePage::numberToName($codepage); } diff --git a/src/PhpSpreadsheet/Reader/OOCalc.php b/src/PhpSpreadsheet/Reader/OOCalc.php index c99718e1..7b785215 100644 --- a/src/PhpSpreadsheet/Reader/OOCalc.php +++ b/src/PhpSpreadsheet/Reader/OOCalc.php @@ -598,7 +598,7 @@ class OOCalc extends BaseReader implements IReader $dateObj = new DateTime($cellDataOfficeAttributes['date-value'], $GMT); $dateObj->setTimeZone($timezoneObj); list($year, $month, $day, $hour, $minute, $second) = explode(' ', $dateObj->format('Y m d H i s')); - $dataValue = \PHPExcel\Shared\Date::FormattedPHPToExcel($year, $month, $day, $hour, $minute, $second); + $dataValue = \PHPExcel\Shared\Date::formattedPHPToExcel($year, $month, $day, $hour, $minute, $second); if ($dataValue != floor($dataValue)) { $formatting = \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX15.' '.\PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME4; } else { diff --git a/src/PhpSpreadsheet/Shared/CodePage.php b/src/PhpSpreadsheet/Shared/CodePage.php index 24f4b634..1aa6829c 100644 --- a/src/PhpSpreadsheet/Shared/CodePage.php +++ b/src/PhpSpreadsheet/Shared/CodePage.php @@ -37,7 +37,7 @@ class CodePage * @return string Code Page Name * @throws \PHPExcel\Exception */ - public static function NumberToName($codePage = 1252) + public static function numberToName($codePage = 1252) { switch ($codePage) { case 367: diff --git a/src/PhpSpreadsheet/Shared/Date.php b/src/PhpSpreadsheet/Shared/Date.php index 14b42f2c..d1ea52d1 100644 --- a/src/PhpSpreadsheet/Shared/Date.php +++ b/src/PhpSpreadsheet/Shared/Date.php @@ -114,7 +114,7 @@ class Date * @param string $timezone The timezone for finding the adjustment from UST * @return integer PHP serialized date/time */ - public static function ExcelToPHP($dateValue = 0, $adjustToTimezone = false, $timezone = null) + public static function excelToPHP($dateValue = 0, $adjustToTimezone = false, $timezone = null) { if (self::$excelBaseDate == self::CALENDAR_WINDOWS_1900) { $myexcelBaseDate = 25569; @@ -154,9 +154,9 @@ class Date * @param integer $dateValue Excel date/time value * @return \DateTime PHP date/time object */ - public static function ExcelToPHPObject($dateValue = 0) + public static function excelToPHPObject($dateValue = 0) { - $dateTime = self::ExcelToPHP($dateValue); + $dateTime = self::excelToPHP($dateValue); $days = floor($dateTime / 86400); $time = round((($dateTime / 86400) - $days) * 86400); $hours = round($time / 3600); @@ -186,9 +186,9 @@ class Date date_default_timezone_set('UTC'); $retValue = false; if ((is_object($dateValue)) && ($dateValue instanceof \DateTime)) { - $retValue = self::FormattedPHPToExcel($dateValue->format('Y'), $dateValue->format('m'), $dateValue->format('d'), $dateValue->format('H'), $dateValue->format('i'), $dateValue->format('s')); + $retValue = self::formattedPHPToExcel($dateValue->format('Y'), $dateValue->format('m'), $dateValue->format('d'), $dateValue->format('H'), $dateValue->format('i'), $dateValue->format('s')); } elseif (is_numeric($dateValue)) { - $retValue = self::FormattedPHPToExcel(date('Y', $dateValue), date('m', $dateValue), date('d', $dateValue), date('H', $dateValue), date('i', $dateValue), date('s', $dateValue)); + $retValue = self::formattedPHPToExcel(date('Y', $dateValue), date('m', $dateValue), date('d', $dateValue), date('H', $dateValue), date('i', $dateValue), date('s', $dateValue)); } elseif (is_string($dateValue)) { $retValue = self::stringToExcel($dateValue); } @@ -199,7 +199,7 @@ class Date /** - * FormattedPHPToExcel + * formattedPHPToExcel * * @param integer $year * @param integer $month @@ -209,7 +209,7 @@ class Date * @param integer $seconds * @return integer Excel date/time value */ - public static function FormattedPHPToExcel($year, $month, $day, $hours = 0, $minutes = 0, $seconds = 0) + public static function formattedPHPToExcel($year, $month, $day, $hours = 0, $minutes = 0, $seconds = 0) { if (self::$excelBaseDate == self::CALENDAR_WINDOWS_1900) { // diff --git a/src/PhpSpreadsheet/Shared/File.php b/src/PhpSpreadsheet/Shared/File.php index 8b68986f..4e90b354 100644 --- a/src/PhpSpreadsheet/Shared/File.php +++ b/src/PhpSpreadsheet/Shared/File.php @@ -66,7 +66,7 @@ class File * @param string $pFilename Filename * @return bool */ - public static function file_exists($pFilename) + public static function fileExists($pFilename) { // Sick construction, but it seems that // file_exists returns strange values when @@ -130,7 +130,7 @@ class File * * @return string */ - public static function sys_get_temp_dir() + public static function sysGetTempDir() { if (self::$useUploadTempDirectory) { // use upload-directory when defined to allow running on environments having very restricted diff --git a/src/PhpSpreadsheet/Shared/OLE.php b/src/PhpSpreadsheet/Shared/OLE.php index ceb92e2e..0a5837e5 100644 --- a/src/PhpSpreadsheet/Shared/OLE.php +++ b/src/PhpSpreadsheet/Shared/OLE.php @@ -443,7 +443,7 @@ class OLE * @param string $ascii The ASCII string to transform * @return string The string in Unicode */ - public static function Asc2Ucs($ascii) + public static function ascToUcs($ascii) { $rawname = ''; for ($i = 0; $i < strlen($ascii); ++$i) { @@ -461,7 +461,7 @@ class OLE * @param integer $date A timestamp * @return string The string for the OLE container */ - public static function LocalDate2OLE($date = null) + public static function localDateToOLE($date = null) { if (!isset($date)) { return "\x00\x00\x00\x00\x00\x00\x00\x00"; diff --git a/src/PhpSpreadsheet/Shared/OLE/PPS.php b/src/PhpSpreadsheet/Shared/OLE/PPS.php index 7f506d4d..948bd2e1 100644 --- a/src/PhpSpreadsheet/Shared/OLE/PPS.php +++ b/src/PhpSpreadsheet/Shared/OLE/PPS.php @@ -150,7 +150,7 @@ class PPS * @access public * @return integer The amount of data (in bytes) */ - public function _DataLen() + public function getDataLen() { if (!isset($this->_data)) { return 0; @@ -185,8 +185,8 @@ class PPS . "\xc0\x00\x00\x00" // 92 . "\x00\x00\x00\x46" // 96 // Seems to be ok only for Root . "\x00\x00\x00\x00" // 100 - . \PHPExcel\Shared\OLE::LocalDate2OLE($this->Time1st) // 108 - . \PHPExcel\Shared\OLE::LocalDate2OLE($this->Time2nd) // 116 + . \PHPExcel\Shared\OLE::localDateToOLE($this->Time1st) // 108 + . \PHPExcel\Shared\OLE::localDateToOLE($this->Time2nd) // 116 . pack("V", isset($this->startBlock) ? $this->startBlock : 0) // 120 . pack("V", $this->Size) // 124 . pack("V", 0); // 128 diff --git a/src/PhpSpreadsheet/Shared/OLE/PPS/File.php b/src/PhpSpreadsheet/Shared/OLE/PPS/File.php index 5dc333cf..667854a1 100644 --- a/src/PhpSpreadsheet/Shared/OLE/PPS/File.php +++ b/src/PhpSpreadsheet/Shared/OLE/PPS/File.php @@ -37,7 +37,7 @@ class File extends \PHPExcel\Shared\OLE\PPS * * @access public * @param string $name The name of the file (in Unicode) - * @see OLE::Asc2Ucs() + * @see OLE::ascToUcs() */ public function __construct($name) { diff --git a/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php b/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php index 28bcdf20..5bac27ae 100644 --- a/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php +++ b/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php @@ -45,9 +45,9 @@ class Root extends \PHPExcel\Shared\OLE\PPS */ public function __construct($time_1st, $time_2nd, $raChild) { - $this->_tempDir = \PHPExcel\Shared\File::sys_get_temp_dir(); + $this->_tempDir = \PHPExcel\Shared\File::sysGetTempDir(); - parent::__construct(null, \PHPExcel\Shared\OLE::Asc2Ucs('Root Entry'), \PHPExcel\Shared\OLE::OLE_PPS_TYPE_ROOT, null, null, null, $time_1st, $time_2nd, null, $raChild); + parent::__construct(null, \PHPExcel\Shared\OLE::ascToUcs('Root Entry'), \PHPExcel\Shared\OLE::OLE_PPS_TYPE_ROOT, null, null, null, $time_1st, $time_2nd, null, $raChild); } /** @@ -78,7 +78,7 @@ class Root extends \PHPExcel\Shared\OLE\PPS $this->_FILEH_ = $filename; } elseif ($filename == '-' || $filename == '') { if ($this->tempDirectory === null) { - $this->tempDirectory = \PHPExcel\Shared\File::sys_get_temp_dir(); + $this->tempDirectory = \PHPExcel\Shared\File::sysGetTempDir(); } $this->_tmp_filename = tempnam($this->tempDirectory, "OLE_PPS_Root"); $this->_FILEH_ = fopen($this->_tmp_filename, "w+b"); @@ -132,7 +132,7 @@ class Root extends \PHPExcel\Shared\OLE\PPS $iCount = count($raList); for ($i = 0; $i < $iCount; ++$i) { if ($raList[$i]->Type == \PHPExcel\Shared\OLE::OLE_PPS_TYPE_FILE) { - $raList[$i]->Size = $raList[$i]->_DataLen(); + $raList[$i]->Size = $raList[$i]->getDataLen(); if ($raList[$i]->Size < \PHPExcel\Shared\OLE::OLE_DATA_SIZE_SMALL) { $iSBcnt += floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE) + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0); @@ -264,7 +264,7 @@ class Root extends \PHPExcel\Shared\OLE\PPS $iCount = count($raList); for ($i = 0; $i < $iCount; ++$i) { if ($raList[$i]->Type != \PHPExcel\Shared\OLE::OLE_PPS_TYPE_DIR) { - $raList[$i]->Size = $raList[$i]->_DataLen(); + $raList[$i]->Size = $raList[$i]->getDataLen(); if (($raList[$i]->Size >= \PHPExcel\Shared\OLE::OLE_DATA_SIZE_SMALL) || (($raList[$i]->Type == \PHPExcel\Shared\OLE::OLE_PPS_TYPE_ROOT) && isset($raList[$i]->_data))) { // Write Data //if (isset($raList[$i]->_PPS_FILE)) { diff --git a/src/PhpSpreadsheet/Shared/PCLZip/pclzip.lib.php b/src/PhpSpreadsheet/Shared/PCLZip/PclZip.php similarity index 99% rename from src/PhpSpreadsheet/Shared/PCLZip/pclzip.lib.php rename to src/PhpSpreadsheet/Shared/PCLZip/PclZip.php index 263137d1..5a296ca7 100644 --- a/src/PhpSpreadsheet/Shared/PCLZip/pclzip.lib.php +++ b/src/PhpSpreadsheet/Shared/PCLZip/PclZip.php @@ -1,4 +1,7 @@ tempFileName = @tempnam($pTemporaryStorageFolder, 'xml'); diff --git a/src/PhpSpreadsheet/Shared/ZipArchive.php b/src/PhpSpreadsheet/Shared/ZipArchive.php index 7b7d9c8e..9d0ae00f 100644 --- a/src/PhpSpreadsheet/Shared/ZipArchive.php +++ b/src/PhpSpreadsheet/Shared/ZipArchive.php @@ -3,9 +3,10 @@ namespace PHPExcel\Shared; if (!defined('PCLZIP_TEMPORARY_DIR')) { - define('PCLZIP_TEMPORARY_DIR', File::sys_get_temp_dir() . DIRECTORY_SEPARATOR); + define('PCLZIP_TEMPORARY_DIR', File::sysGetTempDir() . DIRECTORY_SEPARATOR); } -require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/PCLZip/pclzip.lib.php'; + +use PHPExcel\Shared\PCLZip\PclZip; /** * PHPExcel_Shared_ZipArchive @@ -63,7 +64,7 @@ class ZipArchive */ public function open($fileName) { - $this->tempDir = File::sys_get_temp_dir(); + $this->tempDir = File::sysGetTempDir(); $this->zip = new PclZip($fileName); return true; diff --git a/src/PhpSpreadsheet/Style/NumberFormat.php b/src/PhpSpreadsheet/Style/NumberFormat.php index 13a23b3e..7ea7f2b9 100644 --- a/src/PhpSpreadsheet/Style/NumberFormat.php +++ b/src/PhpSpreadsheet/Style/NumberFormat.php @@ -487,7 +487,7 @@ class NumberFormat extends Supervisor implements \PHPExcel\IComparable // escape any quoted characters so that DateTime format() will render them correctly $format = preg_replace_callback('/"(.*)"/U', ['self', 'escapeQuotesCallback'], $format); - $dateObj = \PHPExcel\Shared\Date::ExcelToPHPObject($value); + $dateObj = \PHPExcel\Shared\Date::excelToPHPObject($value); $value = $dateObj->format($format); } diff --git a/src/PhpSpreadsheet/Worksheet/AutoFilter.php b/src/PhpSpreadsheet/Worksheet/AutoFilter.php index 42323c27..2b832afd 100644 --- a/src/PhpSpreadsheet/Worksheet/AutoFilter.php +++ b/src/PhpSpreadsheet/Worksheet/AutoFilter.php @@ -327,7 +327,7 @@ class AutoFilter } if (is_numeric($cellValue)) { - $dateValue = \PHPExcel\Shared\Date::ExcelToPHP($cellValue); + $dateValue = \PHPExcel\Shared\Date::excelToPHP($cellValue); if ($cellValue < 1) { // Just the time part $dtVal = date('His', $dateValue); @@ -444,7 +444,7 @@ class AutoFilter } if (is_numeric($cellValue)) { - $dateValue = date('m', \PHPExcel\Shared\Date::ExcelToPHP($cellValue)); + $dateValue = date('m', \PHPExcel\Shared\Date::excelToPHP($cellValue)); if (in_array($dateValue, $monthSet)) { return true; } diff --git a/src/PhpSpreadsheet/Writer/Excel2007.php b/src/PhpSpreadsheet/Writer/Excel2007.php index 738b2600..b7375644 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007.php +++ b/src/PhpSpreadsheet/Writer/Excel2007.php @@ -179,7 +179,7 @@ class Excel2007 extends BaseWriter implements IWriter // If $pFilename is php://output or php://stdout, make it a temporary file... $originalFilename = $pFilename; if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') { - $pFilename = @tempnam(PHPExcel_Shared_File::sys_get_temp_dir(), 'phpxltmp'); + $pFilename = @tempnam(PHPExcel_Shared_File::sysGetTempDir(), 'phpxltmp'); if ($pFilename == '') { $pFilename = $originalFilename; } diff --git a/src/PhpSpreadsheet/Writer/Excel2007/ContentTypes.php b/src/PhpSpreadsheet/Writer/Excel2007/ContentTypes.php index aeb2e94c..29831c89 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/ContentTypes.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/ContentTypes.php @@ -189,7 +189,7 @@ class ContentTypes extends WriterPart */ private function getImageMimeType($pFile = '') { - if (\PHPExcel\Shared\File::file_exists($pFile)) { + if (\PHPExcel\Shared\File::fileExists($pFile)) { $image = getimagesize($pFile); return image_type_to_mime_type($image[2]); } else { diff --git a/src/PhpSpreadsheet/Writer/Excel5.php b/src/PhpSpreadsheet/Writer/Excel5.php index 9042d4d0..998cb066 100644 --- a/src/PhpSpreadsheet/Writer/Excel5.php +++ b/src/PhpSpreadsheet/Writer/Excel5.php @@ -168,7 +168,7 @@ class Excel5 extends BaseWriter implements IWriter // initialize OLE file $workbookStreamName = 'Workbook'; - $OLE = new \PHPExcel\Shared\OLE\PPS\File(\PHPExcel\Shared\OLE::Asc2Ucs($workbookStreamName)); + $OLE = new \PHPExcel\Shared\OLE\PPS\File(\PHPExcel\Shared\OLE::ascToUcs($workbookStreamName)); // Write the worksheet streams before the global workbook stream, // because the byte sizes of these are needed in the global workbook stream @@ -189,14 +189,14 @@ class Excel5 extends BaseWriter implements IWriter $this->documentSummaryInformation = $this->writeDocumentSummaryInformation(); // initialize OLE Document Summary Information if (isset($this->documentSummaryInformation) && !empty($this->documentSummaryInformation)) { - $OLE_DocumentSummaryInformation = new \PHPExcel\Shared\OLE\PPS\File(\PHPExcel\Shared\OLE::Asc2Ucs(chr(5) . 'DocumentSummaryInformation')); + $OLE_DocumentSummaryInformation = new \PHPExcel\Shared\OLE\PPS\File(\PHPExcel\Shared\OLE::ascToUcs(chr(5) . 'DocumentSummaryInformation')); $OLE_DocumentSummaryInformation->append($this->documentSummaryInformation); } $this->summaryInformation = $this->writeSummaryInformation(); // initialize OLE Summary Information if (isset($this->summaryInformation) && !empty($this->summaryInformation)) { - $OLE_SummaryInformation = new \PHPExcel\Shared\OLE\PPS\File(\PHPExcel\Shared\OLE::Asc2Ucs(chr(5) . 'SummaryInformation')); + $OLE_SummaryInformation = new \PHPExcel\Shared\OLE\PPS\File(\PHPExcel\Shared\OLE::ascToUcs(chr(5) . 'SummaryInformation')); $OLE_SummaryInformation->append($this->summaryInformation); } @@ -828,7 +828,7 @@ class Excel5 extends BaseWriter implements IWriter $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0C), 'offset' => array('pack' => 'V'), 'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) - 'data' => array('data' => \PHPExcel\Shared\OLE::LocalDate2OLE($dataProp))); + 'data' => array('data' => \PHPExcel\Shared\OLE::localDateToOLE($dataProp))); $dataSection_NumProps++; } // Modified Date/Time @@ -837,7 +837,7 @@ class Excel5 extends BaseWriter implements IWriter $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0D), 'offset' => array('pack' => 'V'), 'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) - 'data' => array('data' => \PHPExcel\Shared\OLE::LocalDate2OLE($dataProp))); + 'data' => array('data' => \PHPExcel\Shared\OLE::localDateToOLE($dataProp))); $dataSection_NumProps++; } // Security diff --git a/src/PhpSpreadsheet/Writer/HTML.php b/src/PhpSpreadsheet/Writer/HTML.php index 1859a16e..efc6f71f 100644 --- a/src/PhpSpreadsheet/Writer/HTML.php +++ b/src/PhpSpreadsheet/Writer/HTML.php @@ -702,7 +702,7 @@ class HTML extends BaseWriter implements IWriter if ($chart instanceof PHPExcel_Chart) { $chartCoordinates = $chart->getTopLeftPosition(); if ($chartCoordinates['cell'] == $coordinates) { - $chartFileName = PHPExcel_Shared_File::sys_get_temp_dir().'/'.uniqid().'.png'; + $chartFileName = PHPExcel_Shared_File::sysGetTempDir().'/'.uniqid().'.png'; if (!$chart->render($chartFileName)) { return; } diff --git a/src/PhpSpreadsheet/Writer/OpenDocument.php b/src/PhpSpreadsheet/Writer/OpenDocument.php index 4c867177..5f61bf27 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument.php @@ -100,7 +100,7 @@ class OpenDocument extends BaseWriter implements IWriter // If $pFilename is php://output or php://stdout, make it a temporary file... $originalFilename = $pFilename; if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') { - $pFilename = @tempnam(PHPExcel_Shared_File::sys_get_temp_dir(), 'phpxltmp'); + $pFilename = @tempnam(PHPExcel_Shared_File::sysGetTempDir(), 'phpxltmp'); if ($pFilename == '') { $pFilename = $originalFilename; } diff --git a/src/PhpSpreadsheet/Writer/PDF/Core.php b/src/PhpSpreadsheet/Writer/PDF/Core.php index 9dceffda..b023117e 100644 --- a/src/PhpSpreadsheet/Writer/PDF/Core.php +++ b/src/PhpSpreadsheet/Writer/PDF/Core.php @@ -214,7 +214,7 @@ abstract class Core extends \PHPExcel\Writer\HTML { parent::__construct($phpExcel); $this->setUseInlineCss(true); - $this->tempDir = PHPExcel_Shared_File::sys_get_temp_dir(); + $this->tempDir = PHPExcel_Shared_File::sysGetTempDir(); } /** diff --git a/unitTests/Classes/src/Chart/LegendTest.php b/unitTests/Classes/src/Chart/LegendTest.php index ec19c60b..e51fbe9d 100644 --- a/unitTests/Classes/src/Chart/LegendTest.php +++ b/unitTests/Classes/src/Chart/LegendTest.php @@ -47,12 +47,12 @@ class LegendTest extends \PHPUnit_Framework_TestCase public function testSetPositionXL() { $positionValues = array( - \PHPExcel\Chart\Legend::xlLegendPositionBottom, - \PHPExcel\Chart\Legend::xlLegendPositionCorner, - \PHPExcel\Chart\Legend::xlLegendPositionCustom, - \PHPExcel\Chart\Legend::xlLegendPositionLeft, - \PHPExcel\Chart\Legend::xlLegendPositionRight, - \PHPExcel\Chart\Legend::xlLegendPositionTop, + \PHPExcel\Chart\Legend::XL_LEGEND_POSITION_BOTTOM, + \PHPExcel\Chart\Legend::XL_LEGEND_POSITION_CORNER, + \PHPExcel\Chart\Legend::XL_LEGEND_POSITION_CUSTOM, + \PHPExcel\Chart\Legend::XL_LEGEND_POSITION_LEFT, + \PHPExcel\Chart\Legend::XL_LEGEND_POSITION_RIGHT, + \PHPExcel\Chart\Legend::XL_LEGEND_POSITION_TOP, ); $testInstance = new \PHPExcel\Chart\Legend; @@ -71,12 +71,12 @@ class LegendTest extends \PHPUnit_Framework_TestCase $this->assertFalse($result); // Ensure that value is unchanged $result = $testInstance->getPositionXL(); - $this->assertEquals(\PHPExcel\Chart\Legend::xlLegendPositionRight, $result); + $this->assertEquals(\PHPExcel\Chart\Legend::XL_LEGEND_POSITION_RIGHT, $result); } public function testGetPositionXL() { - $PositionValue = \PHPExcel\Chart\Legend::xlLegendPositionCorner; + $PositionValue = \PHPExcel\Chart\Legend::XL_LEGEND_POSITION_CORNER; $testInstance = new \PHPExcel\Chart\Legend; $setValue = $testInstance->setPositionXL($PositionValue); diff --git a/unitTests/Classes/src/Shared/CodePageTest.php b/unitTests/Classes/src/Shared/CodePageTest.php index 5d7ad97f..db91a440 100644 --- a/unitTests/Classes/src/Shared/CodePageTest.php +++ b/unitTests/Classes/src/Shared/CodePageTest.php @@ -13,7 +13,7 @@ class CodePageTest extends \PHPUnit_Framework_TestCase { $args = func_get_args(); $expectedResult = array_pop($args); - $result = call_user_func_array(array('PHPExcel_Shared_CodePage','NumberToName'), $args); + $result = call_user_func_array(array('PHPExcel_Shared_CodePage','numberToName'), $args); $this->assertEquals($expectedResult, $result); } @@ -26,7 +26,7 @@ class CodePageTest extends \PHPUnit_Framework_TestCase { $invalidCodePage = 12345; try { - $result = call_user_func(array('PHPExcel_Shared_CodePage','NumberToName'), $invalidCodePage); + $result = call_user_func(array('PHPExcel_Shared_CodePage','numberToName'), $invalidCodePage); } catch (Exception $e) { $this->assertEquals($e->getMessage(), 'Unknown codepage: 12345'); return; @@ -38,7 +38,7 @@ class CodePageTest extends \PHPUnit_Framework_TestCase { $unsupportedCodePage = 720; try { - $result = call_user_func(array('PHPExcel_Shared_CodePage','NumberToName'), $unsupportedCodePage); + $result = call_user_func(array('PHPExcel_Shared_CodePage','numberToName'), $unsupportedCodePage); } catch (Exception $e) { $this->assertEquals($e->getMessage(), 'Code page 720 not supported.'); return; diff --git a/unitTests/Classes/src/Shared/DateTest.php b/unitTests/Classes/src/Shared/DateTest.php index 121bbe00..1310abda 100644 --- a/unitTests/Classes/src/Shared/DateTest.php +++ b/unitTests/Classes/src/Shared/DateTest.php @@ -72,9 +72,9 @@ class DateTest extends \PHPUnit_Framework_TestCase } /** - * @dataProvider providerDateTimeFormattedPHPToExcel1900 + * @dataProvider providerDateTimeformattedPHPToExcel1900 */ - public function testDateTimeFormattedPHPToExcel1900() + public function testDateTimeformattedPHPToExcel1900() { $result = call_user_func( array('\PHPExcel\Shared\Date','setExcelCalendar'), @@ -83,13 +83,13 @@ class DateTest extends \PHPUnit_Framework_TestCase $args = func_get_args(); $expectedResult = array_pop($args); - $result = call_user_func_array(array('\PHPExcel\Shared\Date','FormattedPHPToExcel'), $args); + $result = call_user_func_array(array('\PHPExcel\Shared\Date','formattedPHPToExcel'), $args); $this->assertEquals($expectedResult, $result, null, 1E-5); } - public function providerDateTimeFormattedPHPToExcel1900() + public function providerDateTimeformattedPHPToExcel1900() { - return new \testDataFileIterator('rawTestData/Shared/DateTimeFormattedPHPToExcel1900.data'); + return new \testDataFileIterator('rawTestData/Shared/DateTimeformattedPHPToExcel1900.data'); } /**