public function init() { if ($this->enabled) { $this->enabled = Yii::app()->user->checkAccess(DaWebUser::ROLE_DEV); } parent::init(); }
public function save() { $renderer = Yii::app()->getComponent('viewRenderer'); if ($renderer instanceof Yii2DebugViewRenderer) { return Yii2Debug::prepareData($renderer->getStack()); } return null; }
/** * @param Yii2Debug $owner * @param string $id */ public function __construct($owner, $id) { $this->_owner = $owner; $this->_id = $id; $this->_tag = $owner->getTag(); }
public function actionConfig() { if (!$this->getOwner()->showConfig) { throw new CHttpException(403, 'Forbidden'); } $components = array(); foreach (Yii::app()->getComponents(false) as $id => $config) { try { $components[$id] = Yii::app()->getComponent($id); } catch (Exception $e) { assert(is_array($config)); $components[$id] = array_merge($config, array('_error_' => $e->getMessage())); } } ksort($components); $modules = Yii::app()->modules; ksort($modules); $data = $this->hideConfigData(array('app' => Yii2Debug::prepareData(Yii::app()), 'components' => Yii2Debug::prepareData($components), 'modules' => Yii2Debug::prepareData($modules), 'params' => Yii2Debug::prepareData(Yii::app()->params)), $this->getOwner()->hiddenConfigOptions); $this->render('config', $data); }