diff --git a/docs/en/00_Getting_Started/00_Server_Requirements.md b/docs/en/00_Getting_Started/00_Server_Requirements.md index 85b72b64f..c1ba6b938 100644 --- a/docs/en/00_Getting_Started/00_Server_Requirements.md +++ b/docs/en/00_Getting_Started/00_Server_Requirements.md @@ -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()`: diff --git a/src/Control/HTTP.php b/src/Control/HTTP.php index cd407bdd7..14225ec22 100644 --- a/src/Control/HTTP.php +++ b/src/Control/HTTP.php @@ -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'); diff --git a/src/Dev/SapphireTest.php b/src/Dev/SapphireTest.php index 8b4cc28cc..f32c57d6c 100644 --- a/src/Dev/SapphireTest.php +++ b/src/Dev/SapphireTest.php @@ -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); diff --git a/src/ORM/DataObject.php b/src/ORM/DataObject.php index e59e9f11c..aeea71e03 100644 --- a/src/ORM/DataObject.php +++ b/src/ORM/DataObject.php @@ -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])) { diff --git a/tests/php/Control/HTTPTest.php b/tests/php/Control/HTTPTest.php index fdc3cec4b..bb556e34b 100644 --- a/tests/php/Control/HTTPTest.php +++ b/tests/php/Control/HTTPTest.php @@ -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', diff --git a/tests/php/Control/HTTPTest/upperfile.JPG b/tests/php/Control/HTTPTest/upperfile.JPG new file mode 100644 index 000000000..3aad05d8f Binary files /dev/null and b/tests/php/Control/HTTPTest/upperfile.JPG differ diff --git a/tests/php/ORM/DataListTest.php b/tests/php/ORM/DataListTest.php index cafaa8499..363bc43d9 100755 --- a/tests/php/ORM/DataListTest.php +++ b/tests/php/ORM/DataListTest.php @@ -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(); diff --git a/tests/php/ORM/DataQueryTest.php b/tests/php/ORM/DataQueryTest.php index 92fa58591..b9278a496 100644 --- a/tests/php/ORM/DataQueryTest.php +++ b/tests/php/ORM/DataQueryTest.php @@ -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);