|
|
@ -73,9 +73,33 @@ class EEDebugController(CementBaseController): |
|
|
|
@expose(hide=True) |
|
|
|
def debug_php(self): |
|
|
|
if self.start: |
|
|
|
print("Start PHP debug") |
|
|
|
if not (EEShellExec.cmd_exec(self, "sed -n \"/upstream php" |
|
|
|
"{/,/}/p \" /etc/nginx/" |
|
|
|
"conf.d/upstream.conf " |
|
|
|
"| grep 9001")): |
|
|
|
print("Enabling PHP debug") |
|
|
|
data = dict(php="9001", debug="9001") |
|
|
|
self.app.log.debug('writting the nginx configration to file' |
|
|
|
'/etc/nginx/conf.d/upstream.conf ') |
|
|
|
ee_nginx = open('/etc/nginx/conf.d/upstream.conf', 'w') |
|
|
|
self.app.render((data), 'upstream.mustache', out=ee_nginx) |
|
|
|
ee_nginx.close() |
|
|
|
|
|
|
|
else: |
|
|
|
print("PHP debug is allready enabled") |
|
|
|
else: |
|
|
|
print("Stop PHP debug") |
|
|
|
if EEShellExec.cmd_exec(self, "sed -n \"/upstream php {/,/}/p\" " |
|
|
|
"/etc/nginx/conf.d/upstream.conf " |
|
|
|
"| grep 9001"): |
|
|
|
print("Disabling PHP debug") |
|
|
|
data = dict(php="9000", debug="9001") |
|
|
|
self.app.log.debug('writting the nginx configration to file' |
|
|
|
'/etc/nginx/conf.d/upstream.conf ') |
|
|
|
ee_nginx = open('/etc/nginx/conf.d/upstream.conf', 'w') |
|
|
|
self.app.render((data), 'upstream.mustache', out=ee_nginx) |
|
|
|
ee_nginx.close() |
|
|
|
else: |
|
|
|
print("PHP debug is allready disbaled") |
|
|
|
|
|
|
|
@expose(hide=True) |
|
|
|
def debug_fpm(self): |
|
|
|