Merge branch '3.4' into 3

This commit is contained in:
Daniel Hensby 2016-05-20 12:35:58 +01:00
commit e6f9e3a370
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E
4 changed files with 12 additions and 9 deletions

View File

@ -149,7 +149,7 @@ class RSSFeed extends ViewableData {
if(isset($this->entries)) {
foreach($this->entries as $entry) {
$output->push(
new RSSFeed_Entry($entry, $this->titleField, $this->descriptionField, $this->authorField));
RSSFeed_Entry::create($entry, $this->titleField, $this->descriptionField, $this->authorField));
}
}
return $output;
@ -184,7 +184,11 @@ class RSSFeed extends ViewableData {
}
/**
* Output the feed to the browser
* Output the feed to the browser.
*
* TODO: Pass $response object to ->outputToBrowser() to loosen dependence on global state for easier testing/prototyping so dev can inject custom SS_HTTPResponse instance.
*
* @return HTMLText
*/
public function outputToBrowser() {
$prevState = Config::inst()->get('SSViewer', 'source_file_comments');

View File

@ -493,8 +493,7 @@ class SS_ClassManifest {
// files will have changed and TokenisedRegularExpression is quite
// slow. A combination of the file name and file contents hash are used,
// since just using the datetime lead to problems with upgrading.
$file = file_get_contents($pathname);
$key = preg_replace('/[^a-zA-Z0-9_]/', '_', $basename) . '_' . md5($file);
$key = preg_replace('/[^a-zA-Z0-9_]/', '_', $basename) . '_' . md5_file($pathname);
if ($data = $this->cache->load($key)) {
$valid = (
@ -513,7 +512,7 @@ class SS_ClassManifest {
}
if (!$classes) {
$tokens = token_get_all($file);
$tokens = token_get_all(file_get_contents($pathname));
$classes = self::get_namespaced_class_parser()->findAll($tokens);

View File

@ -150,7 +150,7 @@ shortcuts and methods for fetching, sorting and filtering data from our database
$players = Player::get();
// returns a `DataList` containing all the `Player` objects.
$player = Player::get()->byId(2);
$player = Player::get()->byID(2);
// returns a single `Player` object instance that has the ID of 2.
echo $player->ID;

View File

@ -19,13 +19,13 @@ An example of a `SearchFilter` in use:
:::php
// fetch any player that starts with a S
$players = Player::get()->filter(array(
'FirstName:StartsWith' => 'S'
'FirstName:StartsWith' => 'S',
'PlayerNumber:GreaterThan' => '10'
));
// to fetch any player that's name contains the letter 'z'
$players = Player::get()->filterAny(array(
'FirstName:PartialMatch' => 'z'
'FirstName:PartialMatch' => 'z',
'LastName:PartialMatch' => 'z'
));
@ -50,4 +50,4 @@ The following is a query which will return everyone whose first name starts with
## API Documentation
* [api:SearchFilter]
* [api:SearchFilter]