Example #1
0
 /**
  * Return the current status of the configuration.
  *
  * @param  boolean $human_name
  *   If TRUE a human readable name will be return for the status of the
  *   configuration. If FALSE a numeric code will be returned.
  * @return string|integer
  *   The status of the configuration. (ActiveStore only, In Sync, Overriden).
  */
 public function getStatus($human_name = TRUE)
 {
     if ($this->broken) {
         return $human_name ? t('Removed from ActiveStore') : 0;
     }
     $tracking_file = ConfigurationManagement::readTrackingFile();
     $tracked = array();
     if (isset($tracking_file['tracked'])) {
         $tracked = $tracking_file['tracked'];
     }
     if (isset($tracked[$this->getUniqueId()])) {
         $file_hash = $tracked[$this->getUniqueId()];
     }
     if (!isset($file_hash)) {
         return $human_name ? t('ActiveStore only') : Configuration::notTracked;
     } else {
         if ($this->getHash() == $file_hash) {
             return $human_name ? t('In Sync') : Configuration::inSync;
         } else {
             return $human_name ? t('Overriden') : Configuration::overriden;
         }
     }
 }