From 45059d7359322e8cb59b1ad9dab12c5df0903417 Mon Sep 17 00:00:00 2001 From: Jeremy Dorn Date: Wed, 30 May 2012 14:57:40 -0700 Subject: [PATCH] Added config and database variables for php reports. This enables php reports to query mysql or magento for the currently selected database. --- classes/report_types/PhpReportType.php | 3 +++ index.php | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/report_types/PhpReportType.php b/classes/report_types/PhpReportType.php index 0d0f83ff..23c6cde6 100644 --- a/classes/report_types/PhpReportType.php +++ b/classes/report_types/PhpReportType.php @@ -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(); diff --git a/index.php b/index.php index 9cc92cc4..d15b5f33 100644 --- a/index.php +++ b/index.php @@ -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() {