Ejemplo n.º 1
0
 public function getChunkedItems($items, $prefix = '', $maxLen = 2000)
 {
     if (!Mage::getStoreConfigFlag('foomanspeedster/settings/enabled')) {
         return parent::getChunkedItems($items, $prefix, 450);
     }
     $chunks = array();
     $chunk = $prefix;
     foreach ($items as $item) {
         if (strlen($chunk . ',' . $item) > $maxLen) {
             $chunks[] = $chunk;
             $chunk = $prefix;
         }
         //this is the first item
         if ($chunk === $prefix) {
             //remove first slash, only needed to create double slash for minify shortcut to document root
             $chunk .= substr($item, 1);
         } else {
             //remove first slash, only needed to create double slash for minify shortcut to document root
             $chunk .= ',' . substr($item, 1);
         }
     }
     $chunks[] = $chunk;
     return $chunks;
 }