Example #1
0
 /**
  * Удаление файла
  *
  * @param $clusterFileSrc
  * @return bool
  * @throws Exception
  */
 public function delete($clusterFileUniqSrc)
 {
     $file = new File($this->getRootSrc($clusterFileUniqSrc));
     if ($file->isExist()) {
         $file->remove();
     }
     return true;
 }
Example #2
0
 public function actionRemoveEnvGlobalFile()
 {
     $file = new File(APP_ENV_GLOBAL_FILE);
     if ($file->remove()) {
         \Yii::$app->session->setFlash('success', \Yii::t('app', 'File deleted successfully'));
     } else {
         \Yii::$app->session->setFlash('error', \Yii::t('app', 'Could not delete the file'));
     }
     return $this->redirect(\Yii::$app->request->getReferrer());
 }