예제 #1
0
 /**
  * @param $uid
  * @throws Exception
  */
 public function updateFiles($uid)
 {
     $unzipFolder = UpdateHelper::getUnzipFolderFromUID($uid);
     // Put the site into maintenance mode.
     Craft::log('Putting the site into maintenance mode.', LogLevel::Info, true);
     Craft::enableMaintenanceMode();
     // Update the files.
     Craft::log('Performing file update.', LogLevel::Info, true);
     if (!UpdateHelper::doFileUpdate(UpdateHelper::getManifestData($unzipFolder), $unzipFolder)) {
         Craft::log('Taking the site out of maintenance mode.', LogLevel::Info, true);
         Craft::disableMaintenanceMode();
         throw new Exception(Craft::t('There was a problem updating your files.'));
     }
 }