Skip to content

Commit

Permalink
corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
schpill committed Jun 13, 2017
1 parent 62e386d commit a1a54eb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
15 changes: 13 additions & 2 deletions lib/octaliaiterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down Expand Up @@ -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('<?php' . "\nreturn " . $content . ';');
}
}
}

0 comments on commit a1a54eb

Please sign in to comment.