Skip to content

Commit

Permalink
Updated: Bugfix for php 5.3 compatability and added feature to create…
Browse files Browse the repository at this point in the history
… xml sitemap storage directory if it does not already exist
  • Loading branch information
brookinsconsulting committed Nov 21, 2014
1 parent c160516 commit a852e00
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion cronjobs/bcgenerategooglevideositemap.php
Expand Up @@ -147,7 +147,8 @@
if( $objectEmbededRelatedObjectAttributeVideoContentAttributes['response'][0]['status'] != 'error' && isset( $objectEmbededRelatedObjectAttributeVideoContentAttributes['thumb'] ) )
{
$objectEmbededRelatedObjectAttributeVideoContentAttributeThumbnail = $objectEmbededRelatedObjectAttributeVideoContentAttributes['thumb'];
$objectEmbededRelatedObjectAttributeVideoContentAttributeDownloadMetaDetails = array_reverse( $objectEmbededRelatedObjectAttributeVideoContentAttributes['response'][1]['conversions'] )[0];
$objectEmbededRelatedObjectAttributeVideoContentAttributeDownloadMetaDetails = array_reverse( $objectEmbededRelatedObjectAttributeVideoContentAttributes['response'][1]['conversions'] );
$objectEmbededRelatedObjectAttributeVideoContentAttributeDownloadMetaDetails = $objectEmbededRelatedObjectAttributeVideoContentAttributeDownloadMetaDetails[0];
$objectEmbededRelatedObjectAttributeVideoContentAttributeDownload = $objectEmbededRelatedObjectAttributeVideoContentAttributeDownloadMetaDetails['link'];
$objectEmbededRelatedObjectAttributeVideoContentAttributeDownload = $objectEmbededRelatedObjectAttributeVideoContentAttributeDownloadMetaDetails['link']['protocol'] . '://' . $objectEmbededRelatedObjectAttributeVideoContentAttributeDownloadMetaDetails['link']['address'] . $objectEmbededRelatedObjectAttributeVideoContentAttributeDownloadMetaDetails['link']['path'];
$objectEmbededRelatedObjectAttributeVideoContentAttributeResponce = $objectEmbededRelatedObjectAttributeVideoContentAttributes['response'];
Expand Down Expand Up @@ -260,6 +261,12 @@
}
}

// Create XML Sitemap storage directory if it does not already exist
if ( !file_exists( $sitemapPath ) && !is_dir( $sitemapPath ) )
{
mkdir( $sitemapPath, 0775 );
}

// Write XML video sitemap data file to disk
$dom->save( $xmlDataFile );

Expand Down
9 changes: 8 additions & 1 deletion cronjobs/bcgenerategooglevideositemapfromobjects.php
Expand Up @@ -114,7 +114,8 @@
{
$objectAttributeVideoContentAttributeThumbnail = $objectAttributeVideoContentAttributes['thumb'];
//$objectAttributeVideoContentAttributeDownload = $objectAttributeVideoContentAttributes['download'];
$objectAttributeVideoContentAttributeDownloadMetaDetails = array_reverse( $objectAttributeVideoContentAttributes['response'][1]['conversions'] )[0];
$objectAttributeVideoContentAttributeDownloadMetaDetails = array_reverse( $objectAttributeVideoContentAttributes['response'][1]['conversions'] );
$objectAttributeVideoContentAttributeDownloadMetaDetails = $objectAttributeVideoContentAttributeDownloadMetaDetails[0];
$objectAttributeVideoContentAttributeDownload = $objectAttributeVideoContentAttributeDownloadMetaDetails['link'];
$objectAttributeVideoContentAttributeDownload = $objectAttributeVideoContentAttributeDownloadMetaDetails['link']['protocol'] . '://' . $objectAttributeVideoContentAttributeDownloadMetaDetails['link']['address'] . $objectAttributeVideoContentAttributeDownloadMetaDetails['link']['path'];
$objectAttributeVideoContentAttributeResponce = $objectAttributeVideoContentAttributes['response'];
Expand Down Expand Up @@ -247,6 +248,12 @@
}
}

// Create XML Sitemap storage directory if it does not already exist
if ( !file_exists( $sitemapPath ) && !is_dir( $sitemapPath ) )
{
mkdir( $sitemapPath, 0775 );
}

// Write XML file to disk
$dom->save( $xmlDataFile );

Expand Down

0 comments on commit a852e00

Please sign in to comment.