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)) {
|
if(isset($this->entries)) {
|
||||||
foreach($this->entries as $entry) {
|
foreach($this->entries as $entry) {
|
||||||
$output->push(
|
$output->push(
|
||||||
new RSSFeed_Entry($entry, $this->titleField, $this->descriptionField, $this->authorField));
|
RSSFeed_Entry::create($entry, $this->titleField, $this->descriptionField, $this->authorField));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $output;
|
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() {
|
public function outputToBrowser() {
|
||||||
$prevState = Config::inst()->get('SSViewer', 'source_file_comments');
|
$prevState = Config::inst()->get('SSViewer', 'source_file_comments');
|
||||||
|
@ -22,11 +22,6 @@
|
|||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/PHPUnit": "~3.7"
|
"phpunit/PHPUnit": "~3.7"
|
||||||
},
|
},
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"3.x-dev": "3.4.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
"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
|
// files will have changed and TokenisedRegularExpression is quite
|
||||||
// slow. A combination of the file name and file contents hash are used,
|
// slow. A combination of the file name and file contents hash are used,
|
||||||
// since just using the datetime lead to problems with upgrading.
|
// 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($pathname);
|
||||||
$key = preg_replace('/[^a-zA-Z0-9_]/', '_', $basename) . '_' . md5($file);
|
|
||||||
|
|
||||||
if ($data = $this->cache->load($key)) {
|
if ($data = $this->cache->load($key)) {
|
||||||
$valid = (
|
$valid = (
|
||||||
@ -513,7 +512,7 @@ class SS_ClassManifest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$classes) {
|
if (!$classes) {
|
||||||
$tokens = token_get_all($file);
|
$tokens = token_get_all(file_get_contents($pathname));
|
||||||
|
|
||||||
$classes = self::get_namespaced_class_parser()->findAll($tokens);
|
$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();
|
$players = Player::get();
|
||||||
// returns a `DataList` containing all the `Player` objects.
|
// 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.
|
// returns a single `Player` object instance that has the ID of 2.
|
||||||
|
|
||||||
echo $player->ID;
|
echo $player->ID;
|
||||||
|
@ -19,13 +19,13 @@ An example of a `SearchFilter` in use:
|
|||||||
:::php
|
:::php
|
||||||
// fetch any player that starts with a S
|
// fetch any player that starts with a S
|
||||||
$players = Player::get()->filter(array(
|
$players = Player::get()->filter(array(
|
||||||
'FirstName:StartsWith' => 'S'
|
'FirstName:StartsWith' => 'S',
|
||||||
'PlayerNumber:GreaterThan' => '10'
|
'PlayerNumber:GreaterThan' => '10'
|
||||||
));
|
));
|
||||||
|
|
||||||
// to fetch any player that's name contains the letter 'z'
|
// to fetch any player that's name contains the letter 'z'
|
||||||
$players = Player::get()->filterAny(array(
|
$players = Player::get()->filterAny(array(
|
||||||
'FirstName:PartialMatch' => 'z'
|
'FirstName:PartialMatch' => 'z',
|
||||||
'LastName:PartialMatch' => 'z'
|
'LastName:PartialMatch' => 'z'
|
||||||
));
|
));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user