-
Notifications
You must be signed in to change notification settings - Fork 2
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 367ee34
Showing
3 changed files
with
69 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,22 @@ | ||
{ | ||
"name": "humanmade/dev-tools", | ||
"description": "Human Made Platform Developer Tools Module", | ||
"license": "GPL-2.0-or-later", | ||
"authors": [ | ||
{ | ||
"name": "Human Made", | ||
"email": "hello@humanmade.com" | ||
} | ||
], | ||
"autoload": { | ||
"files": [ | ||
"load.php" | ||
], | ||
"classmap": [ | ||
"inc/" | ||
] | ||
}, | ||
"require": { | ||
"johnbillion/query-monitor": "~3.3" | ||
} | ||
} |
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,24 @@ | ||
<?php | ||
|
||
namespace HM\Platform\Dev_Tools; | ||
|
||
use const HM\Platform\ROOT_DIR; | ||
use function HM\Platform\get_config; | ||
|
||
/** | ||
* Bootstrap. | ||
*/ | ||
function bootstrap() { | ||
add_action( 'plugins_loaded', __NAMESPACE__ . '\\on_plugins_loaded', 1 ); | ||
} | ||
|
||
/** | ||
* Load in other code as necessary. | ||
*/ | ||
function on_plugins_loaded() { | ||
$config = get_config()['modules']['dev-tools']; | ||
|
||
if ( $config['query-monitor'] ) { | ||
require_once ROOT_DIR . '/vendor/johnbillion/query-monitor/query-monitor.php'; | ||
} | ||
} |
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,23 @@ | ||
<?php | ||
|
||
namespace HM\Platform\Dev_Tools; | ||
|
||
use HM\Platform; | ||
use function HM\Platform\get_environment_architecture; | ||
|
||
require_once __DIR__ . '/inc/namespace.php'; | ||
|
||
add_action( 'hm-platform.modules.init', function () { | ||
$default_settings = [ | ||
'enabled' => in_array( get_environment_architecture(), [ 'local-server' ] ), | ||
'query-monitor' => true, | ||
]; | ||
|
||
Platform\register_module( | ||
'dev-tools', | ||
__DIR__, | ||
'Developer Tools', | ||
$default_settings, | ||
__NAMESPACE__ . '\\bootstrap' | ||
); | ||
} ); |