/**
  *
  */
 protected function identifyStyleFiles()
 {
     $doc = JFactory::getDocument();
     foreach ($doc->_styleSheets as $filename => $fileinfo) {
         $file = new RokBooster_Compressor_File($filename, $this->options->root_url, $this->options->root_path);
         $file->setType('css');
         $file->setMime($fileinfo['mime']);
         $file->setAttributes($fileinfo['attribs']);
         $file->addAttribute('media', $fileinfo['media']);
         if ($this->strposArray($filename, $this->options->ignored_files) !== false) {
             $file->setIgnored(true);
         }
         $this->style_file_sorter->addFile($file);
     }
     $file_groups = $this->style_file_sorter->getGroups();
     foreach ($file_groups as &$file_group) {
         if ($this->isOutputExpired($file_group) && !$this->isBeingRendered($file_group)) {
             $this->render_style_file_groups[] = $file_group;
             $this->setCurrentlyRendering($file_group);
         }
     }
 }
Ejemplo n.º 2
0
 /**
  *
  */
 protected function identifyStyleFiles()
 {
     $header_links = pq($this->prefix . 'link[href][rel=stylesheet]', $this->document);
     foreach ($header_links as $link) {
         $attribs = pq($link, $this->document)->attr('*');
         $href = $attribs['href'];
         unset($attribs['href']);
         $mime = $attribs['type'];
         unset($attribs['type']);
         unset($attribs['rel']);
         $file = new RokBooster_Compressor_File($href, $this->options->root_url, $this->options->root_path);
         $file->setMime($mime);
         $file->setType('css');
         $file->setAttributes($attribs);
         if (in_array($file->file, $this->options->ignored_files)) {
             $file->setIgnored(true);
         }
         $this->style_file_sorter->addFile($file);
     }
     $file_groups = $this->style_file_sorter->getGroups();
     foreach ($file_groups as &$file_group) {
         if ($this->isCacheExpired($file_group->getChecksum()) && !$this->isBeingRendered($file_group->getChecksum())) {
             $this->render_style_file_groups[] = $file_group;
             $this->setCurrentlyRendering($file_group->getChecksum());
         }
     }
 }