mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge branch '3.6' into 4.0
This commit is contained in:
commit
07a0f75426
@ -12,6 +12,7 @@ Our web-based [PHP installer](installation/) can check if you meet the requireme
|
|||||||
* Once PHP versions become [unsupported by the PHP Project](http://php.net/supported-versions.php),
|
* Once PHP versions become [unsupported by the PHP Project](http://php.net/supported-versions.php),
|
||||||
we drop support for those versions in the [next minor release](/contributing/release-process). This means that PHP 5.6 support may be dropped in a 4.x minor release after December 2018.
|
we drop support for those versions in the [next minor release](/contributing/release-process). This means that PHP 5.6 support may be dropped in a 4.x minor release after December 2018.
|
||||||
* We recommend using a PHP accelerator or opcode cache, such as [xcache](http://xcache.lighttpd.net/) or [WinCache](http://www.iis.net/download/wincacheforphp).
|
* We recommend using a PHP accelerator or opcode cache, such as [xcache](http://xcache.lighttpd.net/) or [WinCache](http://www.iis.net/download/wincacheforphp).
|
||||||
|
* Note: Some PHP 5.5+ packages already have [Zend OpCache](http://php.net/manual/en/book.opcache.php) installed by default. If this is the case on your system, do not try and run additional opcaches alongside Zend OpCache without first disabling it, as it will likely have unexpected consequences.
|
||||||
* Allocate at least 48MB of memory to each PHP process. (SilverStripe can be resource hungry for some intensive operations.)
|
* Allocate at least 48MB of memory to each PHP process. (SilverStripe can be resource hungry for some intensive operations.)
|
||||||
* PHP requires a suitable CSPRNG (random number generator) source for generating random tokens, password salts etc. This can be any of the following, and most operating systems will have at least one source available:
|
* PHP requires a suitable CSPRNG (random number generator) source for generating random tokens, password salts etc. This can be any of the following, and most operating systems will have at least one source available:
|
||||||
* PHP 7 `random_bytes()`:
|
* PHP 7 `random_bytes()`:
|
||||||
|
@ -308,7 +308,7 @@ class HTTP
|
|||||||
|
|
||||||
// Fallback to use the list from the HTTP.yml configuration and rely on the file extension
|
// Fallback to use the list from the HTTP.yml configuration and rely on the file extension
|
||||||
// to get the file mime-type
|
// to get the file mime-type
|
||||||
$ext = File::get_file_extension($filename);
|
$ext = strtolower(File::get_file_extension($filename));
|
||||||
// Get the mime-types
|
// Get the mime-types
|
||||||
$mimeTypes = HTTP::config()->uninherited('MimeTypes');
|
$mimeTypes = HTTP::config()->uninherited('MimeTypes');
|
||||||
|
|
||||||
|
@ -218,6 +218,13 @@ class SapphireTest extends PHPUnit_Framework_TestCase implements TestOnly
|
|||||||
*/
|
*/
|
||||||
protected function setUp()
|
protected function setUp()
|
||||||
{
|
{
|
||||||
|
if (!defined('FRAMEWORK_PATH')) {
|
||||||
|
trigger_error(
|
||||||
|
'Missing constants, did you remember to include the test bootstrap in your phpunit.xml file?',
|
||||||
|
E_USER_WARNING
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Call state helpers
|
// Call state helpers
|
||||||
static::$state->setUp($this);
|
static::$state->setUp($this);
|
||||||
|
|
||||||
|
@ -2867,7 +2867,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
$SNG = singleton($callerClass);
|
$SNG = singleton($callerClass);
|
||||||
|
|
||||||
$cacheComponents = array($filter, $orderby, $SNG->extend('cacheKeyComponent'));
|
$cacheComponents = array($filter, $orderby, $SNG->extend('cacheKeyComponent'));
|
||||||
$cacheKey = md5(var_export($cacheComponents, true));
|
$cacheKey = md5(serialize($cacheComponents));
|
||||||
|
|
||||||
$item = null;
|
$item = null;
|
||||||
if (!$cache || !isset(self::$_cache_get_one[$callerClass][$cacheKey])) {
|
if (!$cache || !isset(self::$_cache_get_one[$callerClass][$cacheKey])) {
|
||||||
|
@ -205,6 +205,7 @@ class HTTPTest extends FunctionalTest
|
|||||||
$this->assertEquals('image/gif', HTTP::get_mime_type('file.gif'));
|
$this->assertEquals('image/gif', HTTP::get_mime_type('file.gif'));
|
||||||
$this->assertEquals('text/html', HTTP::get_mime_type('file.html'));
|
$this->assertEquals('text/html', HTTP::get_mime_type('file.html'));
|
||||||
$this->assertEquals('image/jpeg', HTTP::get_mime_type('file.jpg'));
|
$this->assertEquals('image/jpeg', HTTP::get_mime_type('file.jpg'));
|
||||||
|
$this->assertEquals('image/jpeg', HTTP::get_mime_type('upperfile.JPG'));
|
||||||
$this->assertEquals('image/png', HTTP::get_mime_type('file.png'));
|
$this->assertEquals('image/png', HTTP::get_mime_type('file.png'));
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'image/vnd.adobe.photoshop',
|
'image/vnd.adobe.photoshop',
|
||||||
|
BIN
tests/php/Control/HTTPTest/upperfile.JPG
Normal file
BIN
tests/php/Control/HTTPTest/upperfile.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 331 B |
@ -930,6 +930,16 @@ class DataListTest extends SapphireTest
|
|||||||
$this->assertEquals(1, $list->count());
|
$this->assertEquals(1, $list->count());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testFilterAnyWithRelation()
|
||||||
|
{
|
||||||
|
$list = Player::get();
|
||||||
|
$list = $list->filterAny(array(
|
||||||
|
'Teams.Title:StartsWith' => 'Team',
|
||||||
|
'ID:GreaterThan' => 0,
|
||||||
|
));
|
||||||
|
$this->assertCount(4, $list);
|
||||||
|
}
|
||||||
|
|
||||||
public function testFilterAnyMultipleArray()
|
public function testFilterAnyMultipleArray()
|
||||||
{
|
{
|
||||||
$list = TeamComment::get();
|
$list = TeamComment::get();
|
||||||
|
@ -84,7 +84,7 @@ class DataQueryTest extends SapphireTest
|
|||||||
$this->assertContains('"testctwo_DataQueryTest_C"."ID" = "DataQueryTest_B"."TestCTwoID"', $dq->sql());
|
$this->assertContains('"testctwo_DataQueryTest_C"."ID" = "DataQueryTest_B"."TestCTwoID"', $dq->sql());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testApplyReplationDeepInheretence()
|
public function testApplyRelationDeepInheritance()
|
||||||
{
|
{
|
||||||
//test has_one relation
|
//test has_one relation
|
||||||
$newDQ = new DataQuery(DataQueryTest\ObjectE::class);
|
$newDQ = new DataQuery(DataQueryTest\ObjectE::class);
|
||||||
|
Loading…
Reference in New Issue
Block a user