UnloadController.php 1.58 KB
<?php
    
    namespace artbox\catalog\controllers;
    
    use Yii;
    use yii\filters\AccessControl;
    use yii\web\Controller;
    
    /**
     * UnloadController implements unloading of catalog to different services.
     */
    class UnloadController extends Controller
    {
        /**
         * @inheritdoc
         */
        public function getViewPath()
        {
            return '@backend/views/unload';
        }
        
        /**
         * @inheritdoc
         */
        public function behaviors()
        {
            return [
                'access' => [
                    'class' => AccessControl::className(),
                    'rules' => [
                        [
                            'actions' => [
                                'login',
                                'error',
                            ],
                            'allow'   => true,
                        ],
                        [
                            'allow' => true,
                            'roles' => [ '@' ],
                        ],
                    ],
                ],
            ];
        }
        
        /**
         * Unload prompt page.
         *
         * @return mixed
         */
        public function actionIndex()
        {
            return $this->render('index');
        }
        
//        public function actionHotline()
//        {
//            exec('cd ../../; php yii export-xml/hotline;');
//        }
//
//        public function actionNadavi()
//        {
//            exec('cd ../../; php yii export-xml/nadavi;');
//        }
    }