- new queue invocation method

git-svn-id: file:///svn/phpbb/trunk@5136 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2005-04-30 14:28:07 +00:00
parent 0dec4135c5
commit 15c0535cbc
5 changed files with 145 additions and 21 deletions

View file

@ -36,6 +36,12 @@ if (@ini_get('register_globals'))
}
}
if (defined('IN_CRON'))
{
chdir($phpbb_root_path);
$phpbb_root_path = getcwd() . '/';
}
require($phpbb_root_path . 'config.'.$phpEx);
if (!defined('PHPBB_INSTALLED'))
@ -291,24 +297,6 @@ else
unset($cached_config);
}
// Tidy the cache
if (method_exists($cache, 'tidy') && time() - $config['cache_gc'] > $config['cache_last_gc'])
{
$cache->tidy();
set_config('cache_last_gc', time(), TRUE);
}
// Handle email/cron queue.
if (time() - $config['queue_interval'] >= $config['last_queue_run'] && !defined('IN_ADMIN'))
{
if (file_exists($phpbb_root_path . 'cache/queue.' . $phpEx))
{
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
$queue = new queue();
$queue->process();
}
}
// Warn about install/ directory
if (file_exists('install'))
{

75
phpBB/cron.php Normal file
View file

@ -0,0 +1,75 @@
<?php
/**
*
* @package phpBB3
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
*/
define('IN_PHPBB', true);
define('IN_CRON', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
$cron_type = request_var('cron_type', '');
$use_shutdown_function = (@function_exists('register_shutdown_function')) ? true : false;
// Run cron-like action
// Real cron-based layer will be introduced in 3.2
switch ($cron_type)
{
case 'queue':
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
$queue = new queue();
if ($use_shutdown_function)
{
register_shutdown_function(array(&$queue, 'process'));
}
else
{
$queue->process();
}
break;
case 'tidy_cache':
if ($use_shutdown_function)
{
register_shutdown_function(array(&$cache, 'tidy'));
}
else
{
$cache->tidy();
}
break;
case 'tidy_database':
include_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
if ($use_shutdown_function)
{
register_shutdown_function('tidy_database');
}
else
{
tidy_database();
}
break;
}
// Output transparent gif
header('Cache-Control: no-cache');
header('Content-type: image/gif');
header('Content-length: 43');
echo base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
flush();
exit;
?>

View file

@ -2113,13 +2113,22 @@ $lang += array(
'DISPLAY_AT_REGISTRATION' => 'Display at registration screen',
'HIDE_PROFILE_FIELD' => 'Hide Profile Field',
'HIDE_PROFILE_FIELD_EXPLAIN'=> 'Only Administrators and Moderators are able to see/fill out this profile field',
'EXCLUDE_FROM_VIEW' => 'Do not display profile field',
'EXCLUDE_FROM_VIEW_EXPLAIN' => 'The profile field will not be shown on viewtopic/viewprofile/memberlist/etc.',
'ADDED_PROFILE_FIELD' => 'Successfully added custom profile field',
'CREATE_NEW_FIELD' => 'Create New Field',
'DELETED_PROFILE_FIELD' => 'Successfully deleted profile field.',
'REMOVED_PROFILE_FIELD' => 'Successfully removed profile field.',
'CONFIRM_DELETE_PROFILE_FIELD' => 'Are you sure you want to delete this profile field?',
'PROFILE_FIELD_ACTIVATED' => 'Profile field successfully activated',
'PROFILE_FIELD_DEACTIVATED' => 'Profile field successfully deactivated',
'CHANGED_PROFILE_FIELD' => 'Successfully changed profile field',
'LOG_CREATE_PROFILE_FIELD' => '<b>Profile field added</b><br />&#187; %s',
'LOG_EDIT_PROFILE_FIELD' => '<b>Profile field changed</b><br />&#187; %s',
'LOG_ACTIVATE_PROFILE_FIELD' => '<b>Profile field activated</b><br />&#187; %s',
'LOG_DEACTIVATE_PROFILE_FIELD' => '<b>Profile field deactivated</b><br />&#187; %s',
'LOG_REMOVED_PROFILE_FIELD' => '<b>Profile field removed</b><br />&#187; %s',
'CHARS_ANY' => 'Any character',
'NUMBERS_ONLY' => 'Only numbers (0-9)',
@ -2158,6 +2167,58 @@ $lang += array(
'DEFAULT_ISO_LANGUAGE' => 'Default Language [%s]',
'ISO_LANGUAGE' => 'Language [%s]',
'NO_FIELD_ID' => 'No field id specified',
'FIELD_NOT_FOUND' => 'Profile field not found',
'NO_FIELD_ENTRIES' => 'No Entries defined',
);
// Language Packs
$lang += array(
'LANGUAGE_PACKS_EXPLAIN' => 'Here you are able to install/remove language packs',
'LANGUAGE_PACK_NAME' => 'Name',
'LANGUAGE_PACK_LOCALNAME' => 'Local name',
'LANGUAGE_PACK_ISO' => 'ISO',
'LANGUAGE_PACK_USED_BY' => 'Used by',
'INSTALLED_LANGUAGE_PACKS' => 'Installed language packs',
'UNINSTALLED_LANGUAGE_PACKS'=> 'Uninstalled language packs',
'NO_UNINSTALLED_LANGUAGE_PACKS' => 'No uninstalled language packs',
'NO_LANG_ID' => 'You haven\'t specified a language pack',
'NO_REMOVE_DEFAULT_LANG' => 'You are not able to remove the default language pack.<br />If you want to remove this language pack, change your boards default language first.',
'LANGUAGE_PACK_DELETED' => 'The language pack <b>%s</b> has been removed successfully. All users using this language have been resetted to the boards default language.',
'LANGUAGE_PACK_NOT_EXIST' => 'The selected language pack does not exist.',
'LANGUAGE_PACK_ALREADY_INSTALLED' => 'This language pack is already installed.',
'INVALID_LANGUAGE_PACK' => 'The selected language pack seems to be not valid. Please verify the language pack and upload it again if necessary.',
'LANGUAGE_PACK_INSTALLED' => 'The language pack <b>%s</b> has been successfully installed.',
'LANGUAGE_PACK_DETAILS' => 'Language Pack Details',
'WRONG_LANGUAGE_FILE' => 'Selected language file is invalid',
'LANGUAGE_DETAILS_UPDATED' => 'Language details successfully updated',
'LANG_ENGLISH_NAME' => 'English name',
'LANG_LOCAL_NAME' => 'Local name',
'LANG_ISO_CODE' => 'ISO Code',
'LANG_AUTHOR' => 'Language Pack Author',
'MISSING_LANGUAGE_FILE' => 'Missing Language File: <span style="color:red">%s</span>',
'THOSE_MISSING_LANG_FILES' => 'The following language files are missing from the %s language folder',
'MISSING_LANG_VARIABLES' => 'Missing Language Variables',
'THOSE_MISSING_LANG_VARIABLES' => 'The following language variables are missing from the <b>%s</b> language pack',
'LANGUAGE_KEY' => 'Language Key',
'LANGUAGE_VARIABLE' => 'Language Variable',
'LANGUAGE_FILES' => 'Language Files',
'HELP_FILES' => 'Help Files',
'EMAIL_TEMPLATES' => 'Email Templates',
'LANGUAGE_ENTRIES' => 'Language Entries',
'LANGUAGE_ENTRIES_EXPLAIN' => 'Here you are able to change existing language pack entries or not already translated ones.<br /><b>Note:</b> Once you changed a language file, the changes will be stored within a seperate folder for you to download. The changes will not be seen by your users until you replace the original language files at your webspace (by uploading them).',
'REMOVE_FROM_STORAGE_FOLDER'=> 'Remove from storage folder',
'FILE_CONTENTS' => 'File Contents',
'FILE_FROM_STORAGE' => 'File from storage folder',
'SUBMIT_AND_DOWNLOAD' => 'Submit and Download File',
'SELECT_DOWNLOAD_FORMAT' => 'Select download format',
'DOWNLOAD_AS' => 'Download as',
'DOWNLOAD' => 'Download',
);
?>

View file

@ -71,7 +71,7 @@ $lang += array(
'BOOKMARKS_REMOVED' => 'Bookmarks removed successfully',
'CANNOT_EDIT_MESSAGE_TIME' => 'You can no longer edit or delete that message',
'CANNOT_MOVE_TO_SAME_FOLDER'=> 'Messages can not be moved to the folder which will be removed.',
'CANNOT_MOVE_TO_SAME_FOLDER'=> 'Messages can not be moved to the folder you want to remove.',
'CANNOT_RENAME_FOLDER' => 'This folder can not be renamed.',
'CANNOT_REMOVE_FOLDER' => 'This folder can not be removed.',
'CHANGE_PASSWORD' => 'Change password',

View file

@ -1,4 +1,4 @@
{RUN_CRON_TASK}
</div>
<!--