Пример #1
0
 /**
  * Updates the Pattern Lab Website and prints the appropriate message
  * @param  {String}       file name to included in the message
  * @param  {String}       a switch for decided which message isn't printed
  *
  * @return {String}       the final message
  */
 private function updateSite($fileName, $message, $verbose = true)
 {
     $watchMessage = "";
     if ($verbose) {
         if ($message == "added") {
             $watchMessage = "<warning>" . $fileName . " was added to Pattern Lab. reload the website to see this change in the navigation...</warning>";
         } elseif ($message == "removed") {
             $watchMessage = "<warning>" . $fileName . " was removed from Pattern Lab. reload the website to see this change reflected in the navigation...</warning>";
         } elseif ($message == "hidden") {
             $watchMessage = "<warning>" . $fileName . " was hidden from Pattern Lab. reload the website to see this change reflected in the navigation...</warning>";
         } else {
             $watchMessage = "<info>" . $fileName . " changed...</info>";
         }
     }
     $options = $this->options;
     $options["watchVerbose"] = $verbose;
     $options["watchMessage"] = $watchMessage;
     $options["moveStatic"] = false;
     // clear the various data stores for re-population
     Data::clear();
     PatternData::clear();
     Annotations::clear();
     $g = new Generator();
     $g->generate($options);
 }