Skip to content

Commit

Permalink
NEW Convert to vendor module
Browse files Browse the repository at this point in the history
  • Loading branch information
robbieaverill committed Dec 4, 2017
1 parent 0ebf950 commit 95a7156
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 19 deletions.
7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,11 @@ before_script:
- phpenv config-rm xdebug.ini
- echo 'memory_limit = 2G' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- composer validate
- composer require silverstripe/recipe-cms 1.0.x-dev --no-update
- composer require silverstripe/installer 4.0.x-dev --no-update
- if [[ $DB == PGSQL ]]; then composer require --no-update silverstripe/postgresql:2.0.x-dev; fi
- composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
- echo "SS_BASE_URL=http://localhost:8080/" >> .env

# Bootstrap cms / mysite folder
- php ./vendor/silverstripe/cms/tests/bootstrap/mysite.php

# Behat bootstrapping
- if [[ $BEHAT_TEST ]]; then echo "" >> .env && echo "SS_BASE_URL=http://localhost:8080/" >> .env; fi
- if [[ $BEHAT_TEST ]]; then mkdir artifacts; fi
Expand All @@ -50,7 +47,7 @@ before_script:
script:
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit; fi
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml; fi
- if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs --standard=vendor/silverstripe/framework/phpcs.xml.dist src/ tests/ ; fi
- if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs --standard=vendor/silverstripe/framework/phpcs.xml.dist src tests *.php ; fi
- if [[ $BEHAT_TEST ]]; then vendor/bin/behat @subsites; fi

after_success:
Expand Down
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "silverstripe/subsites",
"description": "Run multiple sites from a single SilverStripe install.",
"license": "BSD-3-Clause",
"type": "silverstripe-module",
"type": "silverstripe-vendormodule",
"keywords": ["silverstripe", "subsites", "multisite"],
"authors": [
{
Expand Down Expand Up @@ -34,7 +34,11 @@
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"expose": [
"javascript",
"css"
]
},
"minimum-stability": "dev",
"prefer-stable": true
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<phpunit bootstrap="vendor/silverstripe/framework/tests/bootstrap.php" colors="true">
<phpunit bootstrap="vendor/silverstripe/cms/tests/bootstrap.php" colors="true">
<testsuite name="Default">
<directory>tests/php</directory>
</testsuite>
Expand Down
12 changes: 4 additions & 8 deletions src/Extension/LeftAndMainSubsites.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use SilverStripe\Control\Controller;
use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Convert;
use SilverStripe\Core\Manifest\ModuleLoader;
use SilverStripe\Forms\HiddenField;
use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\DataObject;
Expand Down Expand Up @@ -41,11 +40,9 @@ class LeftAndMainSubsites extends LeftAndMainExtension

public function init()
{
$module = ModuleLoader::getModule('silverstripe/subsites');

Requirements::css($module->getRelativeResourcePath('css/LeftAndMain_Subsites.css'));
Requirements::javascript($module->getRelativeResourcePath('javascript/LeftAndMain_Subsites.js'));
Requirements::javascript($module->getRelativeResourcePath('javascript/VirtualPage_Subsites.js'));
Requirements::css('silverstripe/subsites:css/LeftAndMain_Subsites.css');
Requirements::javascript('silverstripe/subsites:javascript/LeftAndMain_Subsites.js');
Requirements::javascript('silverstripe/subsites:javascript/VirtualPage_Subsites.js');
}

/**
Expand Down Expand Up @@ -152,8 +149,7 @@ public function ListSubsites()
return false;
}

$module = ModuleLoader::getModule('silverstripe/subsites');
Requirements::javascript($module->getRelativeResourcePath('javascript/LeftAndMain_Subsites.js'));
Requirements::javascript('silverstripe/subsites:javascript/LeftAndMain_Subsites.js');

$output = ArrayList::create();

Expand Down
4 changes: 1 addition & 3 deletions src/Forms/SubsitesTreeDropdownField.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use SilverStripe\Control\Controller;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Core\Manifest\ModuleLoader;
use SilverStripe\Forms\TreeDropdownField;
use SilverStripe\View\Requirements;
use SilverStripe\Subsites\State\SubsiteState;
Expand Down Expand Up @@ -35,8 +34,7 @@ public function Field($properties = [])
{
$html = parent::Field($properties);

$module = ModuleLoader::getModule('silverstripe/subsites');
Requirements::javascript($module->getRelativeResourcePath('javascript/SubsitesTreeDropdownField.js'));
Requirements::javascript('silverstripe/subsitesjavascript/SubsitesTreeDropdownField.js');

return $html;
}
Expand Down

0 comments on commit 95a7156

Please sign in to comment.