Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
32d63780
Commit
32d63780
authored
May 15, 2012
by
tim.plunkett
Browse files
Fix calls to cache_get()/cache_set().
parent
12d40b40
Changes
2
Hide whitespace changes
Inline
Side-by-side
includes/cache.inc
View file @
32d63780
...
...
@@ -137,7 +137,7 @@ function views_cache_set($cid, $data, $use_language = FALSE) {
$cid
.
=
':'
.
$language
->
language
;
}
cache
_set
(
$cid
,
$data
,
'cache_views'
);
cache
(
'cache_views'
)
->
set
(
$cid
,
$data
);
}
/**
...
...
@@ -160,5 +160,5 @@ function views_cache_get($cid, $use_language = FALSE) {
$cid
.
=
':'
.
$language
->
language
;
}
return
cache
_get
(
$cid
,
'cache_views'
);
return
cache
(
'cache_views'
)
->
get
(
$cid
)
;
}
plugins/views_plugin_cache.inc
View file @
32d63780
...
...
@@ -94,12 +94,12 @@ function cache_set($type) {
'total_rows'
=>
isset
(
$this
->
view
->
total_rows
)
?
$this
->
view
->
total_rows
:
0
,
'current_page'
=>
$this
->
view
->
get_current_page
(),
);
cache
_
set
(
$this
->
get_results_key
(),
$data
,
$this
->
table
,
$this
->
cache_set_expire
(
$type
));
cache
(
$this
->
table
)
->
set
(
$this
->
get_results_key
(),
$data
,
$this
->
cache_set_expire
(
$type
));
break
;
case
'output'
:
$this
->
gather_headers
();
$this
->
storage
[
'output'
]
=
$this
->
view
->
display_handler
->
output
;
cache
_
set
(
$this
->
get_
output
_key
(),
$this
->
storage
,
$this
->
table
,
$this
->
cache_set_expire
(
$type
));
cache
(
$this
->
table
)
->
set
(
$this
->
get_
results
_key
(),
$this
->
storage
,
$this
->
cache_set_expire
(
$type
));
break
;
}
}
...
...
@@ -119,7 +119,7 @@ function cache_get($type) {
case
'results'
:
// Values to set: $view->result, $view->total_rows, $view->execute_time,
// $view->current_page.
if
(
$cache
=
cache
_
get
(
$this
->
get_results_key
()
,
$this
->
table
))
{
if
(
$cache
=
cache
(
$this
->
table
)
->
get
(
$this
->
get_results_key
()))
{
if
(
!
$cutoff
||
$cache
->
created
>
$cutoff
)
{
$this
->
view
->
result
=
$cache
->
data
[
'result'
];
$this
->
view
->
total_rows
=
$cache
->
data
[
'total_rows'
];
...
...
@@ -130,7 +130,7 @@ function cache_get($type) {
}
return
FALSE
;
case
'output'
:
if
(
$cache
=
cache
_get
(
$this
->
get_output_key
(),
$this
->
table
))
{
if
(
$cache
=
cache
(
$this
->
table
)
->
get
(
$this
->
get_results_key
()
))
{
if
(
!
$cutoff
||
$cache
->
created
>
$cutoff
)
{
$this
->
storage
=
$cache
->
data
;
$this
->
view
->
display_handler
->
output
=
$cache
->
data
[
'output'
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment