diff --git a/lib/lib.php b/lib/lib.php index 6bdfa67..9c2e3fd 100755 --- a/lib/lib.php +++ b/lib/lib.php @@ -1837,8 +1837,8 @@ function systemBoot($dir = null) staticFacade('\\Octo\\Now', 'Registry'); } - Autoloader::alias('\\Octo\\Str', '\\Octo\\Inflector'); - Autoloader::alias('\\Octo\\Dater', '\\Carbon\\Carbon'); + Autoloader::alias('Str', '\\Octo\\Inflector'); + Autoloader::alias('Dater', '\\Carbon\\Carbon'); $dirs = Arrays::last( explode( diff --git a/lib/octaliaiterator.php b/lib/octaliaiterator.php index f959163..58b9fc6 100644 --- a/lib/octaliaiterator.php +++ b/lib/octaliaiterator.php @@ -544,10 +544,10 @@ public function row($row) return $item; } - public function export($type = 'csv') + public function export($type = 'xls') { $rows = $this->raw(); - $fileds = array_keys(current($rows)); + $fields = array_keys(current($rows)); if ($type == 'csv') { $csv = []; @@ -608,6 +608,17 @@ public function export($type = 'csv') echo "\xEF\xBB\xBF"; die($xls); + } elseif ($type == 'php') { + $content = var_export($rows, true); + + header ("Content-type: application/php"); + header ('Content-disposition: attachement; filename="Export.php"'); + header("Content-Transfer-Encoding: binary"); + header("Expires: 0"); + header("Cache-Control: no-cache, must-revalidate"); + header("Pragma: no-cache"); + + die('