mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge remote-tracking branch 'origin/4.1' into 4
This commit is contained in:
commit
12e701c8ed
47
LICENSE
47
LICENSE
@ -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.
|
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 of source code must retain the above copyright notice, this
|
||||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
|
list of conditions and the following disclaimer.
|
||||||
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.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
* Redistributions in binary form must reproduce the above copyright notice,
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
this list of conditions and the following disclaimer in the documentation
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
and/or other materials provided with the distribution.
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
All rights reserved. Licensed under a Creative Commons Attribution 3.0 License
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
default_media.png by Thibault Geffroy from The Noun Project
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
All rights reserved. Licensed under a [Creative Commons Attribution 3.0 License
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
http://p.yusukekamiyamane.com/
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
http://thenounproject.com/
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
http://creativecommons.org/licenses/by/3.0/
|
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.
|
||||||
|
@ -37,3 +37,8 @@ If you would like to make changes to the SilverStripe core codebase, we have an
|
|||||||
* [Forums](http://silverstripe.org/forums)
|
* [Forums](http://silverstripe.org/forums)
|
||||||
* [Developer Mailinglist](https://groups.google.com/forum/#!forum/silverstripe-dev)
|
* [Developer Mailinglist](https://groups.google.com/forum/#!forum/silverstripe-dev)
|
||||||
* [License](./LICENSE)
|
* [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/).
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
Name: basei18n
|
Name: basei18n
|
||||||
Before: '/i18n'
|
Before: '#defaulti18n'
|
||||||
---
|
---
|
||||||
SilverStripe\i18n\Data\Sources:
|
SilverStripe\i18n\Data\Sources:
|
||||||
module_priority:
|
module_priority:
|
||||||
|
@ -51,7 +51,7 @@ Make sure that after you have modified the `routes.yml` file, that you clear you
|
|||||||
```yml
|
```yml
|
||||||
---
|
---
|
||||||
Name: mysiteroutes
|
Name: mysiteroutes
|
||||||
After: framework/routes#coreroutes
|
After: framework/_config/routes#coreroutes
|
||||||
---
|
---
|
||||||
SilverStripe\Control\Director:
|
SilverStripe\Control\Director:
|
||||||
rules:
|
rules:
|
||||||
|
@ -20,7 +20,7 @@ These routes by standard, go into a `routes.yml` file in your applications `_con
|
|||||||
```yml
|
```yml
|
||||||
---
|
---
|
||||||
Name: mysiteroutes
|
Name: mysiteroutes
|
||||||
After: framework/routes#coreroutes
|
After: framework/_config/routes#coreroutes
|
||||||
---
|
---
|
||||||
SilverStripe\Control\Director:
|
SilverStripe\Control\Director:
|
||||||
rules:
|
rules:
|
||||||
|
@ -337,7 +337,7 @@ To create a custom module order, you need to specify a config fragment that inse
|
|||||||
```yml
|
```yml
|
||||||
---
|
---
|
||||||
Name: customi18n
|
Name: customi18n
|
||||||
Before: 'defaulti18n'
|
Before: '#defaulti18n'
|
||||||
---
|
---
|
||||||
SilverStripe\i18n\i18n:
|
SilverStripe\i18n\i18n:
|
||||||
module_priority:
|
module_priority:
|
||||||
|
@ -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-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-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-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
|
### Features and Enhancements
|
||||||
|
|
||||||
|
@ -605,6 +605,6 @@ class Convert
|
|||||||
if ($multiple) {
|
if ($multiple) {
|
||||||
return preg_replace('#[/\\\\]+#', $separator, $path);
|
return preg_replace('#[/\\\\]+#', $separator, $path);
|
||||||
}
|
}
|
||||||
return str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $path);
|
return str_replace(['/', '\\'], $separator, $path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ class ModuleResourceLoader implements TemplateGlobalProvider
|
|||||||
$resource = $matches['resource'];
|
$resource = $matches['resource'];
|
||||||
$moduleObj = ModuleLoader::getModule($module);
|
$moduleObj = ModuleLoader::getModule($module);
|
||||||
if (!$moduleObj) {
|
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);
|
$resourceObj = $moduleObj->getResource($resource);
|
||||||
|
|
||||||
|
@ -259,7 +259,7 @@ PHP
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests {@link Convert::testRaw2URL()}
|
* Tests {@link Convert::testRaw2URL()}
|
||||||
*
|
*
|
||||||
* @todo test toASCII()
|
* @todo test toASCII()
|
||||||
*/
|
*/
|
||||||
public function testRaw2URL()
|
public function testRaw2URL()
|
||||||
@ -273,7 +273,7 @@ PHP
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper function for comparing characters with significant whitespaces
|
* Helper function for comparing characters with significant whitespaces
|
||||||
*
|
*
|
||||||
* @param string $expected
|
* @param string $expected
|
||||||
* @param string $actual
|
* @param string $actual
|
||||||
*/
|
*/
|
||||||
@ -590,7 +590,7 @@ XML
|
|||||||
/**
|
/**
|
||||||
* Test that bytes2memstring returns a binary prefixed string representing the number of bytes
|
* Test that bytes2memstring returns a binary prefixed string representing the number of bytes
|
||||||
*
|
*
|
||||||
* @param string $memString
|
* @param string $bytes
|
||||||
* @param int $expected
|
* @param int $expected
|
||||||
* @dataProvider bytes2MemStringProvider
|
* @dataProvider bytes2MemStringProvider
|
||||||
*/
|
*/
|
||||||
@ -613,4 +613,40 @@ XML
|
|||||||
[(512 * 1024 * 1024 * 1024 * 1024 * 1024), '512P']
|
[(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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ use SilverStripe\Assets\FileNameFilter;
|
|||||||
use SilverStripe\Assets\Filesystem;
|
use SilverStripe\Assets\Filesystem;
|
||||||
use SilverStripe\Assets\Folder;
|
use SilverStripe\Assets\Folder;
|
||||||
use SilverStripe\Assets\Image;
|
use SilverStripe\Assets\Image;
|
||||||
use SilverStripe\Assets\Tests\Storage\AssetStoreTest\TestAssetStore;
|
use Silverstripe\Assets\Dev\TestAssetStore;
|
||||||
use SilverStripe\Core\Config\Config;
|
use SilverStripe\Core\Config\Config;
|
||||||
use SilverStripe\Core\Manifest\ModuleLoader;
|
use SilverStripe\Core\Manifest\ModuleLoader;
|
||||||
use SilverStripe\Core\Manifest\ModuleManifest;
|
use SilverStripe\Core\Manifest\ModuleManifest;
|
||||||
|
@ -8,7 +8,7 @@ use SilverStripe\Core\Injector\Injector;
|
|||||||
use SilverStripe\Dev\SapphireTest;
|
use SilverStripe\Dev\SapphireTest;
|
||||||
use SilverStripe\View\Requirements;
|
use SilverStripe\View\Requirements;
|
||||||
use SilverStripe\View\ArrayData;
|
use SilverStripe\View\ArrayData;
|
||||||
use SilverStripe\Assets\Tests\Storage\AssetStoreTest\TestAssetStore;
|
use Silverstripe\Assets\Dev\TestAssetStore;
|
||||||
use SilverStripe\View\Requirements_Backend;
|
use SilverStripe\View\Requirements_Backend;
|
||||||
use SilverStripe\Core\Manifest\ResourceURLGenerator;
|
use SilverStripe\Core\Manifest\ResourceURLGenerator;
|
||||||
use SilverStripe\Control\SimpleResourceURLGenerator;
|
use SilverStripe\Control\SimpleResourceURLGenerator;
|
||||||
|
@ -5,7 +5,7 @@ namespace SilverStripe\View\Tests;
|
|||||||
use Exception;
|
use Exception;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use PHPUnit_Framework_MockObject_MockObject;
|
use PHPUnit_Framework_MockObject_MockObject;
|
||||||
use SilverStripe\Assets\Tests\Storage\AssetStoreTest\TestAssetStore;
|
use Silverstripe\Assets\Dev\TestAssetStore;
|
||||||
use SilverStripe\Control\ContentNegotiator;
|
use SilverStripe\Control\ContentNegotiator;
|
||||||
use SilverStripe\Control\Controller;
|
use SilverStripe\Control\Controller;
|
||||||
use SilverStripe\Control\Director;
|
use SilverStripe\Control\Director;
|
||||||
|
Loading…
Reference in New Issue
Block a user