mirror of
https://github.com/YunoHost-Apps/limesurvey_ynh.git
synced 2024-09-03 19:36:32 +02:00
25 lines
No EOL
805 B
PHP
25 lines
No EOL
805 B
PHP
<?php
|
|
|
|
/**
|
|
*
|
|
*/
|
|
class LimeDebug extends CWidget
|
|
{
|
|
public function run()
|
|
{
|
|
if (YII_DEBUG && in_array(getIPAddress(), array("127.0.0.1","::1")))
|
|
{
|
|
//App()->getClientScript()->registerScriptFile(App()->getAssetManager()->publish(Yii::getPathOfAlias('ext.LimeScript.assets'). '/script.js'));
|
|
$data = array(
|
|
'session' => $_SESSION,
|
|
'server' => $_SERVER
|
|
);
|
|
$json = json_encode($data, JSON_FORCE_OBJECT);
|
|
$script = "LSdebug = $json;\n";
|
|
$script .= "console.dir(LSdebug)\n";
|
|
App()->getClientScript()->registerScript('LimeDebug', $script, CClientScript::POS_HEAD);
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|