Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function onAnalysisStart($feed, tubepress_api_url_UrlInterface $url)
 {
     $this->_skippedVideoCount = 0;
     $loggerEnabled = $this->_logger->isEnabled();
     $this->_feedAsArray = json_decode($feed, true);
     if ($this->_feedAsArray === null) {
         throw new RuntimeException('Unable to decode JSON from YouTube');
     }
     if ($loggerEnabled) {
         $this->_logDebug(sprintf('Decoded feed from YouTube is visible in the HTML source of this page.<span style="display:none">%s</span>', htmlspecialchars(print_r($this->_feedAsArray, true))));
     }
     $this->_apiUtility->checkForApiResponseError($this->_feedAsArray);
     $this->_metadataAsArray = $this->_collectMetadata();
     if ($loggerEnabled) {
         $this->_logDebug(sprintf('Decoded metadata collected from YouTube is visible in the HTML source of this page.<span style="display:none">%s</span>', htmlspecialchars(print_r($this->_metadataAsArray, true))));
     }
 }