<?php
/**
 * Check bug for LimeSurvey
 * 
 * @author Denis Chenu <denis@sondages.pro>
 * @copyright 2019 Denis Chenu <http://www.sondages.pro>
 * @license WTFPL (Do What The Fuck You Want to Public License)
 * @version 0.0.1
 *
 */
class checkThemeUpdateBug extends PluginBase
{
    static protected $name = 'checkThemeUpdateBug';
    static protected $description = 'check theme update bug';

    public function init()
    {
        $this->subscribe('direct');
    }

    /**
     * Check defaulttheme before and after Survey::model()->findAll();
     * @return @void
     */
    public function direct()
    {
        if($this->event->get("target") != get_class()) {
            return;
        }
        echo Yii::app()->getConfig('defaulttheme')."\n";
        $oSurvey = Survey::model()->findAll();
        echo Yii::app()->getConfig('defaulttheme')."\n";
    }

}
