Merge remote-tracking branch 'origin/4.1' into 4

This commit is contained in:
Damian Mooyman 2018-02-15 09:28:14 +13:00
commit 12e701c8ed
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A
13 changed files with 77 additions and 36 deletions

47
LICENSE
View File

@ -1,30 +1,29 @@
Copyright (c) 2006-2017, SilverStripe Limited - www.silverstripe.com
BSD 3-Clause License
Copyright (c) 2006-2018, SilverStripe Limited - www.silverstripe.com
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of SilverStripe nor the names of its contributors may be used to endorse or promote products derived from this software
without specific prior written permission.
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
Attribution
============
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
Some icons by Yusuke Kamiyamane
All rights reserved. Licensed under a Creative Commons Attribution 3.0 License
default_media.png by Thibault Geffroy from The Noun Project
All rights reserved. Licensed under a [Creative Commons Attribution 3.0 License
http://p.yusukekamiyamane.com/
http://thenounproject.com/
http://creativecommons.org/licenses/by/3.0/
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -37,3 +37,8 @@ If you would like to make changes to the SilverStripe core codebase, we have an
* [Forums](http://silverstripe.org/forums)
* [Developer Mailinglist](https://groups.google.com/forum/#!forum/silverstripe-dev)
* [License](./LICENSE)
## Attribution ##
* Some icons by [Yusuke Kamiyamane](http://p.yusukekamiyamane.com/). All rights reserved. Licensed under a [Creative Commons Attribution 3.0 License](http://creativecommons.org/licenses/by/3.0/).
* default_media.png by Thibault Geffroy from [The Noun Project](http://thenounproject.com/). All rights reserved. Licensed under a [Creative Commons Attribution 3.0 License](http://creativecommons.org/licenses/by/3.0/).

View File

@ -1,6 +1,6 @@
---
Name: basei18n
Before: '/i18n'
Before: '#defaulti18n'
---
SilverStripe\i18n\Data\Sources:
module_priority:

View File

@ -51,7 +51,7 @@ Make sure that after you have modified the `routes.yml` file, that you clear you
```yml
---
Name: mysiteroutes
After: framework/routes#coreroutes
After: framework/_config/routes#coreroutes
---
SilverStripe\Control\Director:
rules:

View File

@ -20,7 +20,7 @@ These routes by standard, go into a `routes.yml` file in your applications `_con
```yml
---
Name: mysiteroutes
After: framework/routes#coreroutes
After: framework/_config/routes#coreroutes
---
SilverStripe\Control\Director:
rules:

View File

@ -337,7 +337,7 @@ To create a custom module order, you need to specify a config fragment that inse
```yml
---
Name: customi18n
Before: 'defaulti18n'
Before: '#defaulti18n'
---
SilverStripe\i18n\i18n:
module_priority:

View File

@ -21,6 +21,7 @@
* 2017-11-27 [1fedc5fc](https://github.com/silverstripe/silverstripe-cms/commit/1fedc5fc10b6a1d2af417a051d7fe6bd8182b191) Make `CMSMain::getSiteTreeFor()` default to `null` nodeCount (#2029) (Lee Bradley)
* 2017-11-14 [f863573d1](https://github.com/silverstripe/silverstripe-framework/commit/f863573d1c2029be0414f352634adee3bc222663) Add getShortName to DBClassName (Damian Mooyman)
* 2017-11-07 [642cbdafc](https://github.com/silverstripe/silverstripe-framework/commit/642cbdafc8cf16d2ca48dcd0d51d5655f23ad664) Allow an array as a param to makeFieldReadOnly() (Reece Alexander)
* 2017-11-03 [91f1a58](https://github.com/silverstripe/silverstripe-framework/commit/91f1a58018b208b3677550dc4d22ac5d83f5124a) Allow chain-ability on adding and removing fields (Reece Alexander)
### Features and Enhancements

View File

@ -605,6 +605,6 @@ class Convert
if ($multiple) {
return preg_replace('#[/\\\\]+#', $separator, $path);
}
return str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $path);
return str_replace(['/', '\\'], $separator, $path);
}
}

View File

@ -103,7 +103,7 @@ class ModuleResourceLoader implements TemplateGlobalProvider
$resource = $matches['resource'];
$moduleObj = ModuleLoader::getModule($module);
if (!$moduleObj) {
throw new InvalidArgumentException("Can't find module '$module'");
throw new InvalidArgumentException("Can't find module '$module', the composer.json file may be missing from the modules installation directory");
}
$resourceObj = $moduleObj->getResource($resource);

View File

@ -590,7 +590,7 @@ XML
/**
* Test that bytes2memstring returns a binary prefixed string representing the number of bytes
*
* @param string $memString
* @param string $bytes
* @param int $expected
* @dataProvider bytes2MemStringProvider
*/
@ -613,4 +613,40 @@ XML
[(512 * 1024 * 1024 * 1024 * 1024 * 1024), '512P']
];
}
public function providerTestSlashes()
{
return [
['bob/bob', '/', true, 'bob/bob'],
['\\bob/bob\\', '/', true, '/bob/bob/'],
['\\bob////bob\\/', '/', true, '/bob/bob/'],
['bob/bob', '\\', true, 'bob\\bob'],
['\\bob/bob\\', '\\', true, '\\bob\\bob\\'],
['\\bob////bob\\/', '\\', true, '\\bob\\bob\\'],
['bob/bob', '#', true, 'bob#bob'],
['\\bob/bob\\', '#', true, '#bob#bob#'],
['\\bob////bob\\/', '#', true, '#bob#bob#'],
['bob/bob', '/', false, 'bob/bob'],
['\\bob/bob\\', '/', false, '/bob/bob/'],
['\\bob////bob\\/', '/', false, '/bob////bob//'],
['bob/bob', '\\', false, 'bob\\bob'],
['\\bob/bob\\', '\\', false, '\\bob\\bob\\'],
['\\bob////bob\\/', '\\', false, '\\bob\\\\\\\\bob\\\\'],
['bob/bob', '#', false, 'bob#bob'],
['\\bob/bob\\', '#', false, '#bob#bob#'],
['\\bob////bob\\/', '#', false, '#bob####bob##'],
];
}
/**
* @dataProvider providerTestSlashes
* @param string $path
* @param string $separator
* @param bool $multiple
* @param string $expected
*/
public function testSlashes($path, $separator, $multiple, $expected)
{
$this->assertEquals($expected, Convert::slashes($path, $separator, $multiple));
}
}

View File

@ -7,7 +7,7 @@ use SilverStripe\Assets\FileNameFilter;
use SilverStripe\Assets\Filesystem;
use SilverStripe\Assets\Folder;
use SilverStripe\Assets\Image;
use SilverStripe\Assets\Tests\Storage\AssetStoreTest\TestAssetStore;
use Silverstripe\Assets\Dev\TestAssetStore;
use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Manifest\ModuleLoader;
use SilverStripe\Core\Manifest\ModuleManifest;

View File

@ -8,7 +8,7 @@ use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\View\Requirements;
use SilverStripe\View\ArrayData;
use SilverStripe\Assets\Tests\Storage\AssetStoreTest\TestAssetStore;
use Silverstripe\Assets\Dev\TestAssetStore;
use SilverStripe\View\Requirements_Backend;
use SilverStripe\Core\Manifest\ResourceURLGenerator;
use SilverStripe\Control\SimpleResourceURLGenerator;

View File

@ -5,7 +5,7 @@ namespace SilverStripe\View\Tests;
use Exception;
use InvalidArgumentException;
use PHPUnit_Framework_MockObject_MockObject;
use SilverStripe\Assets\Tests\Storage\AssetStoreTest\TestAssetStore;
use Silverstripe\Assets\Dev\TestAssetStore;
use SilverStripe\Control\ContentNegotiator;
use SilverStripe\Control\Controller;
use SilverStripe\Control\Director;