Skip to content

Commit

Permalink
Added config and database variables for php reports.
Browse files Browse the repository at this point in the history
This enables php reports to query mysql or magento for the currently selected database.
  • Loading branch information
jdorn committed May 30, 2012
1 parent ea1aa7b commit 45059d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions classes/report_types/PhpReportType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public static function closeConnection(&$report) {
public static function run(&$report) {
extract($report->macros);

$config = PhpReports::$config;
$database = PhpReports::$config['databases'][$report->options['Database']];

ob_start();
require(PhpReports::$config['reportDir'].'/'.$report->report);
$result = ob_get_contents();
Expand Down
3 changes: 2 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
@apache_setenv('no-gzip', 1);
@ini_set('zlib.output_compression', 0);
@ini_set('implicit_flush', 1);


//sets up autoload (looks in classes/local/, classes/, and lib/ in that order)
require 'lib/PhpReports/PhpReports.php';

Flight::route('/',function() {
Expand Down

0 comments on commit 45059d7

Please sign in to comment.