Exemplo n.º 1
0
 /**
  * Static method to return the FileSystem singelton representing
  * this platform's local filesystem driver.
  * @return FileSystem
  */
 public static function getFileSystem()
 {
     if (self::$fs === null) {
         switch (Phing::getProperty('host.fstype')) {
             case 'UNIX':
                 include_once 'phing/system/io/UnixFileSystem.php';
                 self::$fs = new UnixFileSystem();
                 break;
             case 'WIN32':
                 include_once 'phing/system/io/Win32FileSystem.php';
                 self::$fs = new Win32FileSystem();
                 break;
             case 'WINNT':
                 include_once 'phing/system/io/WinNTFileSystem.php';
                 self::$fs = new WinNTFileSystem();
                 break;
             default:
                 throw new Exception("Host uses unsupported filesystem, unable to proceed");
         }
     }
     return self::$fs;
 }
Exemplo n.º 2
0
 public function clearAssets()
 {
     if (isset($_POST['clear_assets'])) {
         FileSystem::fs('assets', Yii::getPathOfAlias('webroot'))->cleardir();
         $this->setFlashMessage(Yii::t('CoreModule.admin', 'SUCCESS_CLR_ASSETS'));
         //$this->refresh();
     }
 }