Пример #1
0
 /**
  * @param string $content
  * @return Tx_Asdis_Domain_Model_Asset_Collection
  */
 public function scrape($content)
 {
     $paths = array();
     $masks = array();
     $matches = array();
     preg_match_all('/data-src-[^=]*\\s?=\\s?([\'"])(.*?)([\'"])/i', $content, $matches);
     if (is_array($matches) && sizeof($matches) > 1 && is_array($matches[2])) {
         $paths = $matches[2];
         $masks = $matches[1];
     }
     return $this->assetFactory->createAssetsFromPaths($paths, $masks);
 }
Пример #2
0
 /**
  * @param string $tagName
  * @param string $attributeName
  * @param string $content
  * @param array $requiredOtherAttributes
  * @return Tx_Asdis_Domain_Model_Asset_Collection
  */
 protected function getAssets($tagName, $attributeName, $content, array $requiredOtherAttributes = array())
 {
     $attributes = $this->xmlTagAttributeExtractor->getAttributeFromTag($tagName, $attributeName, $content, $requiredOtherAttributes);
     return $this->assetFactory->createAssetsFromPaths($attributes['paths'], $attributes['masks']);
 }
Пример #3
0
 /**
  * @param $content
  * @return Tx_Asdis_Domain_Model_Asset_Collection
  */
 public function scrape($content)
 {
     $urls = $this->extractUrlPaths($content);
     return $this->assetFactory->createAssetsFromPaths($urls['paths'], $urls['masks']);
 }