Author: ralfbecker
New Revision: 55877
URL: http://svn.stylite.de/viewvc/egroupware?rev=55877&view=rev
Log:
- Admin: clear cache after admin-cli.php commands, so they become active automatically, also backported feedback for “Clear cache and register hooks” from trunk
and allow to send json requests with basic auth credentials without an active session, used here to clear cache via webservice call, as we can NOT clear shared memmory cache of webserver from cli
Modified:
branches/14.2/admin/ (props changed)
branches/14.2/admin/admin-cli.php
branches/14.2/admin/inc/class.admin_hooks.inc.php
branches/14.2/egroupware/json.php
Propchange: branches/14.2/admin/
— svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 27 12:13:34 2016
@@ -1,2 +1,2 @@
/branches/14.1/admin:51499
-/trunk/admin:51376,51460,51639,51699,51770,51810,51812,51817,51836,51855,51878,52247,52357,52451,52481,52520,52550-52551,52572,52574,52780,52958,53021-53022,53024,53026,53042,53044,53087,53116,53146-53147,53198,53287,53667,53705,53707,53712,53726,53732,53753,53772,53787,53828,53960,53991,54030,54032,54050,54156,54158,54444-54445,54452,54472,54522,54529,54533,54545
+/trunk/admin:51376,51460,51639,51699,51770,51810,51812,51817,51836,51855,51878,52247,52357,52451,52481,52520,52550-52551,52572,52574,52780,52958,53021-53022,53024,53026,53042,53044,53087,53116,53146-53147,53198,53287,53667,53705,53707,53712,53726,53732,53753,53772,53787,53828,53960,53991,54030,54032,54050,54156,54158,54444-54445,54452,54472,54522,54529,54533,54545,55095
— branches/14.2/admin/admin-cli.php (original)
+++ branches/14.2/admin/admin-cli.php Wed Apr 27 12:13:34 2016
@@ -112,7 +112,7 @@
*/
function run_command(admin_cmd $cmd)
{
-
global $arguments,$user,$arg0s,$domain;
$skip_checks = false;
while ($arguments && ($extra = array_shift($arguments)))
@@ -167,6 +167,24 @@
//_debug_array($cmd);
try {
print_r($cmd->run($time, true, $skip_checks, $dry_run));
-
-
// cli can NOT clear instance cache of APC(u), as cli uses different shared memory then webserver
-
// --> we use a webservice call to clear cache (might fail if no domain in specified in webserver_url or on command line)
-
if (!$dry_run)
-
{
-
$url = $GLOBALS['egw_info']['server']['webserver_url'].'/json.php?menuaction=admin.admin_hooks.ajax_clear_cache';
-
if ($url[0] == '/') $url = 'http://'.(!empty($domain) && $domain != 'default' ? $domain : 'localhost').$url;
-
$data = file_get_contents($url, false, egw_framework::proxy_context($user,$arg0s[1]));
-
//error_log("file_get_contents('$url') returned ".array2string($data));
-
if ($data && strpos($data, '"success"') !== false)
-
{
-
error_log('Instance cache cleared.');
-
}
-
else
-
{
-
error_log('You might need to clear the cache for changes to be visiable: Admin >> Clear cache!');
-
}
-
}
}
catch (egw_exception_wrong_userinput $e) {
echo “\n”.$e->getMessage()."\n\n";
@@ -427,7 +445,7 @@
catch (Exception $e) { // new account
$data[‘account_lid’] = $account;
$account = false;
- }
run_command(new admin_cmd_edit_user($account,$data,null,$run_addaccount_hook));
}
— branches/14.2/admin/inc/class.admin_hooks.inc.php (original)
+++ branches/14.2/admin/inc/class.admin_hooks.inc.php Wed Apr 27 12:13:34 2016
@@ -112,7 +112,12 @@
if (! $GLOBALS['egw']->acl->check('applications_acc',16,'admin'))
{
-
$file['Clear cache and register hooks'] = array(
-
'id' => 'admin/clear_cache',
-
'no_lang' => true,
-
'link' => "javascript:egw.message('".lang('Clear cache and register hooks') . "<br />" .lang('Please wait...')."','info'); " .
-
"egw.json('admin.admin_hooks.ajax_clear_cache').sendRequest(true);"
-
);
}
if (! $GLOBALS['egw']->acl->check('asyncservice_acc',1,'admin'))
@@ -152,9 +157,9 @@
}
/**
-
- */
- function register_all_hooks()
-
- Clears instance cache and register hooks
- */
- function ajax_clear_cache()
{
if ($GLOBALS[‘egw’]->acl->check(‘applications_acc’,16,‘admin’))
{
@@ -173,7 +178,7 @@
// allow apps to hook into “Admin >> Clear cache and register hooks”
$GLOBALS[‘egw’]->hooks->process(‘clear_cache’, array(), true);
— branches/14.2/egroupware/json.php (original)
+++ branches/14.2/egroupware/json.php Wed Apr 27 12:13:34 2016
@@ -11,13 +11,19 @@
*/
/**
-
- callback if the session-check fails, redirects to login.php
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs