Skip to content

Commit

Permalink
Make default_driver property static, fix undefined index warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Dorn committed Apr 13, 2016
1 parent f937e02 commit 9719e0f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion classes/report_types/MysqlReportType.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
class MysqlReportType extends PdoReportType {
public $default_driver = 'mysql';
public static $default_driver = 'mysql';
}
2 changes: 1 addition & 1 deletion classes/report_types/PdoReportType.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
class PdoReportType extends ReportTypeBase {
public $default_driver = null;
public static $default_driver = null;

public static function init(&$report) {
$environments = PhpReports::$config['environments'];
Expand Down
6 changes: 4 additions & 2 deletions lib/PhpReports/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,10 @@ protected function prepareDataSets() {
foreach($this->options['DataSets'] as $i=>$dataset) {
$this->prepareRows($i);
}
$this->options['Rows'] = $this->options['DataSets'][0]['rows'];
$this->options['Count'] = $this->options['DataSets'][0]['count'];
if(isset($this->options['DataSets'][0])) {
$this->options['Rows'] = $this->options['DataSets'][0]['rows'];
$this->options['Count'] = $this->options['DataSets'][0]['count'];
}
}
protected function prepareRows($dataset) {
$rows = array();
Expand Down

0 comments on commit 9719e0f

Please sign in to comment.