Commit e01a0dfd authored by mikeytown2's avatar mikeytown2

#325813: Bring in htaccess generation.

parent 5a9b1d0e
<?php
// $Id$
/**
* @file
* Admin page callbacks for the boost module.
*/
/**
* Form builder; Configure boost settings.
*
* @ingroup forms
* @see system_settings_form()
*/
function boost_admin_debug_settings() {
$form['boost_message_debug'] = array(
'#type' => 'checkbox',
'#title' => t('Send debug info for each request to watchdog.'),
'#default_value' => variable_get('boost_message_debug', BOOST_MESSAGE_DEBUG),
'#description' => t('Only use for debugging purposes as this can fill up watchdog fairly quickly.'),
);
return system_settings_form($form);
}
<?php
// $Id$
/**
* @file
* Admin page callbacks for the boost module.
*/
/**
* Form builder; Configure boost settings.
*
* @ingroup forms
* @see system_settings_form()
*/
function boost_admin_filesystem_settings() {
$form['boost_root_cache_dir'] = array(
'#type' => 'textfield',
'#title' => t('Root cache directory'),
'#default_value' => variable_get('boost_root_cache_dir', BOOST_ROOT_CACHE_DIR),
);
$form['boost_normal_dir'] = array(
'#type' => 'textfield',
'#title' => t('Normal cache directory'),
'#default_value' => variable_get('boost_normal_dir', BOOST_NORMAL_DIR),
);
$form['boost_char'] = array(
'#type' => 'textfield',
'#title' => t('Character replacement for "?" in the URL'),
'#default_value' => variable_get('boost_char', BOOST_CHAR),
);
$form['boost_permissions_file'] = array(
'#type' => 'textfield',
'#title' => t('Files: Enter in a 4 digit number (octal) that will be used by !link. Example 0664', array('!link' => l(t('chmod()'), 'http://php.net/chmod'))),
'#default_value' => variable_get('boost_permissions_file', BOOST_PERMISSIONS_FILE),
'#description' => t('Sometimes because of funky servers you need it use a different file mode then the default.'),
);
$form['boost_permissions_dir'] = array(
'#type' => 'textfield',
'#title' => t('Directories: Enter in a 4 digit number (octal) that will be used by !link. Example 0775', array('!link' => l(t('chmod()'), 'http://php.net/chmod'))),
'#default_value' => variable_get('boost_permissions_dir', BOOST_PERMISSIONS_DIR),
'#description' => t('Sometimes because of funky servers you need it use a different file mode then the default.'),
);
return system_settings_form($form);
}
This diff is collapsed.
; $Id$
name = Boost
description = Caches text as static files
description = Caches generated output as a static file to be served directly from the webserver.
package = Performance and scalability
core = 7.x
files[] = boost.module
......
......@@ -46,4 +46,41 @@ function boost_uninstall() {
* Implements hook_requirements().
*/
function boost_requirements($phase) {
$requirements = array();
$t = get_t();
// Check the server's ability to use boost
if ($phase == 'runtime') {
$cache_directories = array(
boost_get_normal_cache_dir(),
);
foreach ($cache_directories as $cache_directory) {
if (boost_mkdir($cache_directory)) {
// $root_file = file_put_contents($cache_directory . '/' . variable_get('boost_root_file', '.boost'), $cache_directory);
}
if (!is_dir($cache_directory)) {
$requirements['boost_default'] = array(
'title' => $t('Boost'),
'description' => $t('!cache_dir: does not exist.', array('!cache_dir' => $cache_directory)),
'severity' => REQUIREMENT_ERROR,
'value' => $t('Cache path'),
);
}
if (is_dir($cache_directory) && (!is_writable($cache_directory))) {
$requirements['boost_permissions'] = array(
'title' => $t('Boost'),
'description' => $t('Directory %dir credentials - Permissions: %fp. Owner %fo. Group %fg.<br /> Your credentials - Group ID: %gid. User ID: %uid. Current script owner: %user.', array('%dir' => getcwd() . '/' . $cache_directory, '%gid' => getmygid(), '%uid' => getmyuid(), '%user' => get_current_user(), '%fp' => substr(sprintf('%o', fileperms($cache_directory)), -4), '%fo' => fileowner($cache_directory), '%fg' => filegroup($cache_directory) )),
'severity' => REQUIREMENT_ERROR,
'value' => $t('Can not write to file-system'),
);
}
}
if (empty($requirements)) {
$requirements['boost'] = array(
'title' => $t('Boost'),
'severity' => REQUIREMENT_OK,
'value' => $t('Boost installed correctly, should be working if properly <a href="@settings">configured</a>.', array('@settings' => url('admin/config/development/performance/boost'))),
);
}
}
return $requirements;
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment