Merge pull request #1980 from open-sausages/pulls/4/vendorise-me-baby

Expose as vendor module
This commit is contained in:
Damian Mooyman 2017-10-03 16:15:23 +13:00 committed by GitHub
commit 9c3b0cf9bf
4 changed files with 12 additions and 34 deletions

View File

@ -1,6 +0,0 @@
<FilesMatch "\.(php|php3|php4|php5|phtml|inc)$">
Deny from all
</FilesMatch>
<FilesMatch "silverstripe_version$">
Deny from all
</FilesMatch>

View File

@ -7,28 +7,18 @@ use SilverStripe\CMS\Controllers\CMSPageEditController;
use SilverStripe\CMS\Controllers\CMSPageHistoryController; use SilverStripe\CMS\Controllers\CMSPageHistoryController;
use SilverStripe\CMS\Controllers\CMSPageSettingsController; use SilverStripe\CMS\Controllers\CMSPageSettingsController;
use SilverStripe\CMS\Model\SiteTree; use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Core\Manifest\ModuleLoader;
use SilverStripe\Forms\HTMLEditor\TinyMCEConfig; use SilverStripe\Forms\HTMLEditor\TinyMCEConfig;
use SilverStripe\View\Parsers\ShortcodeParser; use SilverStripe\View\Parsers\ShortcodeParser;
/**
* Define constants
*
* - CMS_DIR: Path relative to webroot, e.g. "cms"
* - CMS_PATH: Absolute filepath, e.g. "/var/www/my-webroot/cms"
*/
call_user_func(function () { call_user_func(function () {
// Check if CMS is root dir, or subdir $module = ModuleLoader::inst()->getManifest()->getModule('silverstripe/cms');
if (strcasecmp(__DIR__, BASE_PATH) === 0) {
$clientPath = 'client';
} else {
$clientPath = basename(__DIR__) . '/client';
}
// Enable insert-link to internal pages // Enable insert-link to internal pages
TinyMCEConfig::get('cms') TinyMCEConfig::get('cms')
->enablePlugins(array( ->enablePlugins(array(
'sslinkinternal' => "{$clientPath}/dist/js/TinyMCE_sslink-internal.js", 'sslinkinternal' => $module->getResource('client/dist/js/TinyMCE_sslink-internal.js')->getURL(),
'sslinkanchor' => "{$clientPath}/dist/js/TinyMCE_sslink-anchor.js", 'sslinkanchor' => $module->getResource('client/dist/js/TinyMCE_sslink-anchor.js')->getURL()
)); ));
}); });

View File

@ -1,6 +1,6 @@
{ {
"name": "silverstripe/cms", "name": "silverstripe/cms",
"type": "silverstripe-module", "type": "silverstripe-vendormodule",
"description": "The SilverStripe Content Management System", "description": "The SilverStripe Content Management System",
"homepage": "http://silverstripe.org", "homepage": "http://silverstripe.org",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
@ -25,7 +25,8 @@
"silverstripe/framework": "^4@dev", "silverstripe/framework": "^4@dev",
"silverstripe/reports": "^4@dev", "silverstripe/reports": "^4@dev",
"silverstripe/siteconfig": "^4@dev", "silverstripe/siteconfig": "^4@dev",
"silverstripe/versioned": "^1@dev" "silverstripe/versioned": "^1@dev",
"silverstripe/vendor-plugin": "^1.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^5.7", "phpunit/phpunit": "^5.7",
@ -37,7 +38,11 @@
"branch-alias": { "branch-alias": {
"4.x-dev": "4.0.x-dev", "4.x-dev": "4.0.x-dev",
"dev-master": "5.x-dev" "dev-master": "5.x-dev"
} },
"expose": [
"client/dist",
"client/lang"
]
}, },
"scripts": { "scripts": {
"lint": "phpcs -s code/ tests/php/ tests/behat/src/", "lint": "phpcs -s code/ tests/php/ tests/behat/src/",

View File

@ -1,11 +0,0 @@
<configuration>
<system.webServer>
<security>
<requestFiltering>
<hiddenSegments>
<add segment="silverstripe_version" />
</hiddenSegments>
</requestFiltering>
</security>
</system.webServer>
</configuration>