From 9a95e58d6e6f22d14d0d38411a5927439227a523 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 29 Mar 2013 10:12:03 +0100 Subject: [PATCH 1/4] Travis support --- .travis.yml | 17 +++++++++++++++++ README.md | 2 ++ 2 files changed, 19 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..401a389 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,17 @@ +# See https://github.com/silverstripe-labs/silverstripe-travis-support for setup details + +language: php +php: + - 5.3 + +env: + - DB=MYSQL CORE_RELEASE=3.0 + - DB=PGSQL CORE_RELEASE=3.0 + +before_script: + - git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support + - php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss + - cd ~/builds/ss + +script: + - phpunit googlesitemaps/tests/ \ No newline at end of file diff --git a/README.md b/README.md index ec13ad4..ca74073 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Google Sitemaps Module +[![Build Status](https://secure.travis-ci.org/silverstripe-labs/silverstripe-googlesitemaps.png?branch=1.0)](http://travis-ci.org/silverstripe-labs/silverstripe-googlesitemaps) + ## Maintainer Contact * Will Rossiter (Nickname: wrossiter, willr) From 27898476d87f25c45e23f4aa0a7c2d5ca1b3f734 Mon Sep 17 00:00:00 2001 From: Danae Miller-Clendon Date: Fri, 6 Oct 2017 12:11:53 +1300 Subject: [PATCH 2/4] Add Subsite support by ensuring the host matches correctly to the current Subsite domain and protocol --- code/extensions/GoogleSitemapExtension.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/code/extensions/GoogleSitemapExtension.php b/code/extensions/GoogleSitemapExtension.php index ac5907c..0394d17 100644 --- a/code/extensions/GoogleSitemapExtension.php +++ b/code/extensions/GoogleSitemapExtension.php @@ -18,6 +18,15 @@ class GoogleSitemapExtension extends DataExtension if ($this->owner->hasMethod('AbsoluteLink')) { $hostHttp = parse_url(Director::protocolAndHost(), PHP_URL_HOST); + + // Subsite support + if (class_exists('Subsite')) { + // Subsite will have a different domain from Director::protocolAndHost + if ($subsite = Subsite::currentSubsite()) { + $hostHttp = parse_url(Director::protocol() . $subsite->getPrimaryDomain(), PHP_URL_HOST); + } + } + $objHttp = parse_url($this->owner->AbsoluteLink(), PHP_URL_HOST); if ($objHttp != $hostHttp) { From 326b1ce4b0edb8fd79b8a1658d22b6f1c942e0a9 Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Wed, 7 Mar 2018 11:05:10 +0000 Subject: [PATCH 3/4] Get travis passing --- .travis.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index d4ed1d5..b39ec08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,34 +4,40 @@ sudo: false language: php +dist: precise + php: - 5.3 - 5.4 - 5.5 - 5.6 - 7.0 + - 7.1 env: - - DB=MYSQL CORE_RELEASE=3.2 + - DB=MYSQL CORE_RELEASE=3.6 matrix: include: - php: 5.6 - env: DB=MYSQL CORE_RELEASE=3 + env: DB=MYSQL CORE_RELEASE=3.5 - php: 5.6 - env: DB=MYSQL CORE_RELEASE=3.1 - - php: 5.6 - env: DB=PGSQL CORE_RELEASE=3.2 + env: DB=PGSQL CORE_RELEASE=3.6 + - php: 7.2 + env: CORE_RELEASE=3 + - php: nightly + env: CORE_RELEASE=3 allow_failures: - - php: 7.0 + - php: 7.2 + env: CORE_RELEASE=3 + - php: nightly + env: CORE_RELEASE=3 before_script: - composer self-update || true - git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support - php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss - cd ~/builds/ss - - composer install - - composer require wilr/silverstripe-googlesitemaps script: - vendor/bin/phpunit googlesitemaps/tests From 729311249cc4d96df03d39aa825381893a01d581 Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Wed, 7 Mar 2018 11:23:19 +0000 Subject: [PATCH 4/4] get tests running --- .travis.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 401a389..7c5c02d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,9 @@ # See https://github.com/silverstripe-labs/silverstripe-travis-support for setup details -language: php +language: php + +dist: precise + php: - 5.3 @@ -14,4 +17,4 @@ before_script: - cd ~/builds/ss script: - - phpunit googlesitemaps/tests/ \ No newline at end of file + - phpunit googlesitemaps/tests/