/**
  * @param RokBooster_Compressor_File $file
  *
  * @return bool
  */
 public function fileBelongs(RokBooster_Compressor_File $file)
 {
     $belong = false;
     $file_state = self::STATE_IGNORE;
     if (!$file->isExternal() && !$file->isIgnored()) {
         $file_state = self::STATE_INCLUDE;
     }
     if ($this->status == $file_state) {
         $belong = true;
     }
     return $belong;
 }
Exemple #2
0
 /**
  * @param RokBooster_Compressor_File $file
  *
  * @return mixed
  */
 public function addFile(RokBooster_Compressor_File $file)
 {
     if ($file->isIgnored() || $file->isExternal()) {
         $current_type = RokBooster_Compressor_FileGroup::STATE_IGNORE;
     } else {
         $current_type = RokBooster_Compressor_FileGroup::STATE_INCLUDE;
     }
     if (!isset($this->current_group) || ($current_type != $this->current_group->getStatus() || !is_null($this->current_group) && $this->current_group->getMime() != $file->getMime() || $file->getAttributes() != $this->current_group->getAttributes())) {
         $this->last_type = $current_type;
         $group = new RokBooster_Compressor_FileGroup($current_type, $file->getMime(), $file->getAttributes());
         $this->groups[] =& $group;
         $this->current_group =& $group;
     }
     $this->current_group->addItem($file);
 }