Esempio n. 1
0
 public function removeTempAction()
 {
     if (!$this->isDisabledUpgrade()) {
         FileUtil::emptyDir(SystemUtil::getDownloadPath());
     }
     FileUtil::emptyDir(SystemUtil::getUploadTmpPath());
     return $this->createJsonResponse(true);
 }
Esempio n. 2
0
 public static function backupdb()
 {
     $backUpdir = SystemUtil::getUploadTmpPath();
     $backUpdir .= DIRECTORY_SEPARATOR . uniqid(mt_rand()) . '.txt';
     $dbSetting = array('exclude' => array('session', 'cache'));
     $dump = new MySQLDumper(ServiceKernel::instance()->getConnection(), $dbSetting);
     return $dump->export($backUpdir);
 }
Esempio n. 3
0
 public function testGetUploadTmpPath()
 {
     $testUploadTmpPath = SystemUtil::getUploadTmpPath();
     $uploadTmpPath = SystemUtil::getSystemRootPath() . DIRECTORY_SEPARATOR . 'web' . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR . 'tmp';
     $this->assertEquals($uploadTmpPath, $testUploadTmpPath);
 }