Merge branch '3.6' into 4.0

This commit is contained in:
Daniel Hensby 2017-11-25 16:56:50 +00:00
commit 07a0f75426
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E
8 changed files with 22 additions and 3 deletions

View File

@ -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),
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).
* 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.)
* 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()`:

View File

@ -308,7 +308,7 @@ class HTTP
// Fallback to use the list from the HTTP.yml configuration and rely on the file extension
// to get the file mime-type
$ext = File::get_file_extension($filename);
$ext = strtolower(File::get_file_extension($filename));
// Get the mime-types
$mimeTypes = HTTP::config()->uninherited('MimeTypes');

View File

@ -218,6 +218,13 @@ class SapphireTest extends PHPUnit_Framework_TestCase implements TestOnly
*/
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
static::$state->setUp($this);

View File

@ -2867,7 +2867,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
$SNG = singleton($callerClass);
$cacheComponents = array($filter, $orderby, $SNG->extend('cacheKeyComponent'));
$cacheKey = md5(var_export($cacheComponents, true));
$cacheKey = md5(serialize($cacheComponents));
$item = null;
if (!$cache || !isset(self::$_cache_get_one[$callerClass][$cacheKey])) {

View File

@ -205,6 +205,7 @@ class HTTPTest extends FunctionalTest
$this->assertEquals('image/gif', HTTP::get_mime_type('file.gif'));
$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('upperfile.JPG'));
$this->assertEquals('image/png', HTTP::get_mime_type('file.png'));
$this->assertEquals(
'image/vnd.adobe.photoshop',

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

View File

@ -930,6 +930,16 @@ class DataListTest extends SapphireTest
$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()
{
$list = TeamComment::get();

View File

@ -84,7 +84,7 @@ class DataQueryTest extends SapphireTest
$this->assertContains('"testctwo_DataQueryTest_C"."ID" = "DataQueryTest_B"."TestCTwoID"', $dq->sql());
}
public function testApplyReplationDeepInheretence()
public function testApplyRelationDeepInheritance()
{
//test has_one relation
$newDQ = new DataQuery(DataQueryTest\ObjectE::class);