diff --git a/Build/build-phar.php b/Build/build-phar.php index 5e505aa..d2e5063 100644 --- a/Build/build-phar.php +++ b/Build/build-phar.php @@ -36,7 +36,7 @@ if (ini_get('phar.readonly')) { $pharName = 'PHPExcel.phar'; // target folder -$sourceDir = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'Classes' . DIRECTORY_SEPARATOR; +$sourceDir = dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'Classes' . DIRECTORY_SEPARATOR; // default meta information $metaData = array( diff --git a/Examples/32chartreadwrite.php b/Examples/32chartreadwrite.php index 614dc6e..797612e 100644 --- a/Examples/32chartreadwrite.php +++ b/Examples/32chartreadwrite.php @@ -48,7 +48,7 @@ $inputFileNames = 'templates/32readwrite*[0-9].xlsx'; if ((isset($argc)) && ($argc > 1)) { $inputFileNames = array(); for($i = 1; $i < $argc; ++$i) { - $inputFileNames[] = __DIR__ . '/templates/' . $argv[$i]; + $inputFileNames[] = dirname(__FILE__) . '/templates/' . $argv[$i]; } } else { $inputFileNames = glob($inputFileNames); diff --git a/Examples/35chartrender.php b/Examples/35chartrender.php index bb3ec5f..601fb4c 100644 --- a/Examples/35chartrender.php +++ b/Examples/35chartrender.php @@ -68,7 +68,7 @@ $inputFileNames = 'templates/32readwrite*[0-9].xlsx'; if ((isset($argc)) && ($argc > 1)) { $inputFileNames = array(); for($i = 1; $i < $argc; ++$i) { - $inputFileNames[] = __DIR__ . '/templates/' . $argv[$i]; + $inputFileNames[] = dirname(__FILE__) . '/templates/' . $argv[$i]; } } else { $inputFileNames = glob($inputFileNames); diff --git a/Examples/36chartreadwriteHTML.php b/Examples/36chartreadwriteHTML.php index d2c0a70..3998378 100644 --- a/Examples/36chartreadwriteHTML.php +++ b/Examples/36chartreadwriteHTML.php @@ -68,7 +68,7 @@ $inputFileNames = 'templates/36write*.xlsx'; if ((isset($argc)) && ($argc > 1)) { $inputFileNames = array(); for($i = 1; $i < $argc; ++$i) { - $inputFileNames[] = __DIR__ . '/templates/' . $argv[$i]; + $inputFileNames[] = dirname(__FILE__) . '/templates/' . $argv[$i]; } } else { $inputFileNames = glob($inputFileNames); diff --git a/Examples/36chartreadwritePDF.php b/Examples/36chartreadwritePDF.php index f1b4130..bdac471 100644 --- a/Examples/36chartreadwritePDF.php +++ b/Examples/36chartreadwritePDF.php @@ -91,7 +91,7 @@ $inputFileNames = 'templates/36write*.xlsx'; if ((isset($argc)) && ($argc > 1)) { $inputFileNames = array(); for($i = 1; $i < $argc; ++$i) { - $inputFileNames[] = __DIR__ . '/templates/' . $argv[$i]; + $inputFileNames[] = dirname(__FILE__) . '/templates/' . $argv[$i]; } } else { $inputFileNames = glob($inputFileNames); diff --git a/unitTests/custom/complexAssert.php b/unitTests/custom/complexAssert.php index 486e092..5b813d2 100644 --- a/unitTests/custom/complexAssert.php +++ b/unitTests/custom/complexAssert.php @@ -1,6 +1,6 @@ _getcsv($testData, ',', "'"); foreach($dataSet as &$dataValue) { $dataValue = $this->_parseDataValue($dataValue); } @@ -66,6 +66,25 @@ class testDataFileIterator implements Iterator return $dataSet; } + private function _getcsv($input, $delimiter, $enclosure) + { + if (function_exists('str_getcsv')) { + return str_getcsv($input, $delimiter, $enclosure); + } + + $temp = fopen('php://memory', 'rw'); + fwrite($temp, $input); + rewind($temp); + $data = fgetcsv($temp, strlen($input), $delimiter, $enclosure); + fclose($temp); + + if ($data === false) { + $data = array(null); + } + + return $data; + } + private function _parseDataValue($dataValue) { // discard any white space $dataValue = trim($dataValue);