Skip to content

Commit

Permalink
Removing FirePHP from dev script in favour of declaring $DB
Browse files Browse the repository at this point in the history
  • Loading branch information
FMCorz committed Mar 29, 2022
1 parent 464246d commit 77483d3
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions mdk/scripts/dev.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,15 @@ function mdk_set_config($name, $value, $plugin = null) {
// Don't cache templates.
mdk_set_config('cachetemplates', 0);

// Adds FirePHP
$firephp = "
// FirePHP
if (@include_once('FirePHPCore/fb.php')) {
ob_start();
}
";
// Adds moodle_database declaration to help VSCode detect moodle_database.
$varmoodledb = '/** @var moodle_database */
$DB = $DB;
';
$conffile = dirname(__FILE__) . '/config.php';
if ($content = file_get_contents($conffile)) {
if (strpos($content, "include_once('FirePHPCore/fb.php')") === false) {
if (strpos($content, "@var moodle_database") === false) {
if ($f = fopen($conffile, 'a')) {
fputs($f, $firephp);
fputs($f, $varmoodledb);
fclose($f);
}
}
Expand Down

0 comments on commit 77483d3

Please sign in to comment.