You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.6 KiB
48 lines
1.6 KiB
"""Debug Plugin for EasyEngine."""
|
|
|
|
from cement.core.controller import CementBaseController, expose
|
|
from cement.core import handler, hook
|
|
|
|
|
|
def debug_plugin_hook(app):
|
|
# do something with the ``app`` object here.
|
|
pass
|
|
|
|
|
|
class EEDebugController(CementBaseController):
|
|
class Meta:
|
|
label = 'debug'
|
|
description = 'debug command enables/disbaled stack debug'
|
|
stacked_on = 'base'
|
|
stacked_type = 'nested'
|
|
arguments = [
|
|
(['--stop'],
|
|
dict(help='Stop debug', action='store_true')),
|
|
(['--start'],
|
|
dict(help='Start debug', action='store_true')),
|
|
(['--nginx'],
|
|
dict(help='Debug Nginx', action='store_true')),
|
|
(['--php'],
|
|
dict(help='Debug PHP', action='store_true')),
|
|
(['--fpm'],
|
|
dict(help='Debug FastCGI', action='store_true')),
|
|
(['--mysql'],
|
|
dict(help='Debug MySQL', action='store_true')),
|
|
(['--wp'],
|
|
dict(help='Debug WordPress sites', action='store_true')),
|
|
(['--rewrite'],
|
|
dict(help='Debug Nginx rewrite rules', action='store_true')),
|
|
(['-i', '--interactive'],
|
|
dict(help='Interactive debug', action='store_true')),
|
|
]
|
|
|
|
@expose(hide=True)
|
|
def default(self):
|
|
print("Inside Debug")
|
|
|
|
|
|
def load(app):
|
|
# register the plugin class.. this only happens if the plugin is enabled
|
|
handler.register(EEDebugController)
|
|
# register a hook (function) to run after arguments are parsed.
|
|
hook.register('post_argument_parsing', debug_plugin_hook)
|
|
|