mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge branch '3.3' into 3.4
This commit is contained in:
commit
016d39c81e
@ -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');
|
||||
|
@ -22,12 +22,7 @@
|
||||
"require-dev": {
|
||||
"phpunit/PHPUnit": "~3.7"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"3.x-dev": "3.4.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": ["tests/behat/features/bootstrap"]
|
||||
"classmap": ["tests/behat/features/bootstrap"]
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user