-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 84a84f7
Showing
5 changed files
with
334 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"require": { | ||
"maximebf/debugbar": "^1.13" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
namespace Concrete\Package\Debugbar; | ||
|
||
use Concrete\Core\Package\Package; | ||
use Concrete\Core\View\View; | ||
use Concrete5Debugbar\Debugbar; | ||
use Database; | ||
|
||
class Controller extends Package | ||
{ | ||
protected $pkgHandle = 'debugbar'; | ||
protected $appVersionRequired = '8.0.0'; | ||
protected $pkgVersion = '0.1'; | ||
protected $pkgAutoloaderRegistries = [ | ||
'src/Concrete5Debugbar' => 'Concrete5Debugbar' | ||
]; | ||
|
||
/** | ||
* Returns the translated name of the package. | ||
* | ||
* @return string | ||
*/ | ||
public function getPackageName() | ||
{ | ||
return t('PHP Debug Bar for concrete5'); | ||
} | ||
|
||
/** | ||
* Returns the translated package description. | ||
* | ||
* @return string | ||
*/ | ||
public function getPackageDescription() | ||
{ | ||
return t('Displays a debug bar in the browser with information from php.'); | ||
} | ||
|
||
public function on_start() | ||
{ | ||
require $this->getPackagePath() . '/vendor/autoload.php'; | ||
|
||
$debugbar = new Debugbar(); | ||
$debugbarRenderer = $debugbar->getJavascriptRenderer( | ||
$this->getRelativePath() . '/vendor/maximebf/debugbar/src/DebugBar/Resources' | ||
); | ||
|
||
$v = View::getInstance(); | ||
$v->addHeaderItem($debugbarRenderer->renderHead()); | ||
$v->addFooterItem($debugbarRenderer->render()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
namespace Concrete5Debugbar; | ||
|
||
use DebugBar\DataCollector\MemoryCollector; | ||
use DebugBar\DataCollector\MessagesCollector; | ||
use DebugBar\DataCollector\PhpInfoCollector; | ||
use DebugBar\DataCollector\TimeDataCollector; | ||
|
||
class Debugbar extends \DebugBar\DebugBar | ||
{ | ||
/** | ||
* Debugbar constructor. | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->addCollector(new PhpInfoCollector()); | ||
$this->addCollector(new MessagesCollector()); | ||
$this->addCollector(new TimeDataCollector()); | ||
$this->addCollector(new MemoryCollector()); | ||
// TODO: Concrete5AuthenticationCollector | ||
// TODO: Concrete5ControllerCollector | ||
// TODO: Concrete5DatabaseQueryCollector | ||
// TODO: Concrete5LoggingCollector | ||
// TODO: Concrete5RequestCollector | ||
// TODO: Concrete5RouteCollector | ||
// TODO: Concrete5ViewCollector | ||
} | ||
} |