Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
E
expire
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
drupal.org
expire
Commits
5a2c1066
Commit
5a2c1066
authored
Dec 23, 2010
by
Mike Carper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#998056 by fgm: add uninstall & admin page.
parent
450eab99
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
4 deletions
+111
-4
expire.admin.inc
expire.admin.inc
+58
-0
expire.info
expire.info
+3
-3
expire.install
expire.install
+25
-0
expire.module
expire.module
+25
-1
No files found.
expire.admin.inc
0 → 100644
View file @
5a2c1066
<?php
// $Id$
/**
* @file
* Provides form for changing settings
*/
/**
* Implementation of the former hook_settings().
*/
function
expire_admin_settings_form
()
{
drupal_set_title
(
t
(
'Cache Expiration'
));
$form
[
'expire'
]
=
array
(
'#type'
=>
'fieldset'
,
'#title'
=>
t
(
'What to expire'
),
);
$form
[
'expire'
][
'expire_flush_front'
]
=
array
(
'#type'
=>
'checkbox'
,
'#title'
=>
t
(
'Expire front page'
),
'#default_value'
=>
variable_get
(
'expire_flush_front'
,
EXPIRE_FLUSH_FRONT
),
'#description'
=>
t
(
'When expiring a node: if promoted to front page, expire front page.'
),
);
$form
[
'expire'
][
'expire_flush_node_terms'
]
=
array
(
'#type'
=>
'checkbox'
,
'#title'
=>
t
(
'Expire node term pages'
),
'#default_value'
=>
variable_get
(
'expire_flush_node_terms'
,
EXPIRE_FLUSH_NODE_TERMS
),
'#description'
=>
t
(
'When expiring a node: expire taxonomy pages for its terms.'
),
);
$form
[
'expire'
][
'expire_flush_menu_items'
]
=
array
(
'#type'
=>
'radios'
,
'#title'
=>
t
(
'Expire menus'
),
'#options'
=>
array
(
0
=>
t
(
'No'
),
EXPIRE_FLUSH_MENU_ITEMS
=>
t
(
'Family'
),
2
=>
t
(
'Entire menu'
)),
'#default_value'
=>
variable_get
(
'expire_flush_menu_items'
,
EXPIRE_FLUSH_MENU_ITEMS
),
'#description'
=>
t
(
'When expiring a node: expire related menu items or entire menu'
),
);
$form
[
'expire'
][
'expire_flush_cck_references'
]
=
array
(
'#type'
=>
'checkbox'
,
'#title'
=>
t
(
'Expire CCK node references'
),
'#default_value'
=>
variable_get
(
'expire_flush_cck_references'
,
EXPIRE_FLUSH_CCK_REFERENCES
),
'#description'
=>
t
(
'When expiring a node: expire its node references and nodes containing it in their own ndoe references.'
),
);
$form
[
'format'
]
=
array
(
'#type'
=>
'fieldset'
,
'#title'
=>
t
(
'Expire protocol'
),
);
$form
[
'format'
][
'expire_include_base_url'
]
=
array
(
'#type'
=>
'checkbox'
,
'#title'
=>
t
(
'Include base URL in expires'
),
'#default_value'
=>
variable_get
(
'expire_include_base_url'
,
EXPIRE_INCLUDE_BASE_URL
),
'#description'
=>
t
(
'Include the base URL in expire requests. Compatible with Domain Access'
),
);
return
system_settings_form
(
$form
);
}
expire.info
View file @
5a2c1066
;
$
Id
$
name
=
Cache
Expiration
description
=
Logic
for
expiring
page
caches
name
=
"Cache Expiration"
description
=
"Logic for expiring page caches"
recommends
[]
=
nodereferrer
package
=
Performance
and
scalability
package
=
"Performance and scalability"
core
=
6.
x
expire.install
0 → 100644
View file @
5a2c1066
<?php
// $Id$
/**
* @file
* Install file for expire module
*/
/**
* Implementation of hook_uninstall().
*/
function
expire_uninstall
()
{
$vars
=
array
(
'expire_flush_front'
,
'expire_flush_node_terms'
,
'expire_flush_menu_items'
,
'expire_flush_cck_references'
,
'expire_include_base_url'
,
);
foreach
(
$vars
as
$var
)
{
variable_del
(
$var
);
}
$t
=
get_t
();
drupal_set_message
(
$t
(
'Removed Expire variables'
));
}
expire.module
View file @
5a2c1066
...
...
@@ -13,6 +13,29 @@ define('EXPIRE_FLUSH_CCK_REFERENCES', TRUE);
define
(
'EXPIRE_FLUSH_FRONT'
,
TRUE
);
define
(
'EXPIRE_INCLUDE_BASE_URL'
,
TRUE
);
/**
* Implementation of hook_menu().
*/
function
expire_menu
()
{
$items
=
array
();
$items
[
'admin/settings/performance/default'
]
=
array
(
'title'
=>
'Performance'
,
'type'
=>
MENU_DEFAULT_LOCAL_TASK
,
'file path'
=>
drupal_get_path
(
'module'
,
'system'
),
);
$items
[
'admin/settings/performance/expire'
]
=
array
(
'type'
=>
MENU_LOCAL_TASK
,
'title'
=>
'Cache Expiration'
,
'page callback'
=>
'drupal_get_form'
,
'page arguments'
=>
array
(
'expire_admin_settings_form'
),
'access arguments'
=>
array
(
'administer site configuration'
),
'file path'
=>
drupal_get_path
(
'module'
,
'boost'
),
'file'
=>
'expire.admin.inc'
,
);
return
$items
;
}
/**
* Implementation of hook_comment(). Acts on comment modification.
*/
...
...
@@ -119,7 +142,7 @@ function expire_user($op, &$edit, &$account, $category = NULL) {
* @param $node
* node object
*/
function
expire_node
(
$node
)
{
function
expire_node
(
&
$node
)
{
$paths
=
array
();
// Check node object
...
...
@@ -524,3 +547,4 @@ function expire_get_domains(&$node) {
}
return
$domains
;
}
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