public function removeTempAction() { if (!$this->isDisabledUpgrade()) { FileUtil::emptyDir(SystemUtil::getDownloadPath()); } FileUtil::emptyDir(SystemUtil::getUploadTmpPath()); return $this->createJsonResponse(true); }
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); }
public function testGetUploadTmpPath() { $testUploadTmpPath = SystemUtil::getUploadTmpPath(); $uploadTmpPath = SystemUtil::getSystemRootPath() . DIRECTORY_SEPARATOR . 'web' . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR . 'tmp'; $this->assertEquals($uploadTmpPath, $testUploadTmpPath); }