response; $response->format = $response::FORMAT_JSON; $rootDir = dirname(\Yii::getAlias('@common')); exec("cd $rootDir && /opt/php70/bin/php yii export-xml/hotline", $output); if (count($output) === 1) { return [ 'error' => true, 'output' => $output[ 0 ], ]; } else { return [ 'success' => true, 'output' => $output, ]; } } public function actionNadavi() { set_time_limit(0); $response = \Yii::$app->response; $response->format = $response::FORMAT_JSON; $rootDir = dirname(\Yii::getAlias('@common')); exec("cd $rootDir && /opt/php70/bin/php yii export-xml/nadavi", $output); if (count($output) === 1) { return [ 'error' => true, 'output' => $output[ 0 ], ]; } else { return [ 'success' => true, 'output' => $output, ]; } } }