本文整理汇总了PHP中AJXP_PluginsService::clearPluginsCache方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_PluginsService::clearPluginsCache方法的具体用法?PHP AJXP_PluginsService::clearPluginsCache怎么用?PHP AJXP_PluginsService::clearPluginsCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AJXP_PluginsService
的用法示例。
在下文中一共展示了AJXP_PluginsService::clearPluginsCache方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switchAction
//.........这里部分代码省略.........
$bmString .= ' ajxp_mime="' . $data["AJXP_MIME"] . '"';
}
if (empty($data["CHILDREN"])) {
print '<tree text="' . AJXP_Utils::xmlEntities($data["LABEL"]) . '" description="' . AJXP_Utils::xmlEntities($data["DESCRIPTION"]) . '" icon="' . $data["ICON"] . '" filename="' . $parentName . $key . '" ' . $bmString . '/>';
} else {
print '<tree text="' . AJXP_Utils::xmlEntities($data["LABEL"]) . '" description="' . AJXP_Utils::xmlEntities($data["DESCRIPTION"]) . '" icon="' . $data["ICON"] . '" filename="' . $parentName . $key . '" ' . $bmString . '>';
foreach ($data["CHILDREN"] as $cKey => $cData) {
$bmString = '';
if (in_array($parentName . $key . "/" . $cKey, $this->currentBookmarks)) {
$bmString = ' ajxp_bookmarked="true" overlay_icon="bookmark.png" ';
}
if ($cKey == "users") {
$bmString .= ' remote_indexation="admin_search"';
}
if (isset($cData["AJXP_MIME"])) {
$bmString .= ' ajxp_mime="' . $cData["AJXP_MIME"] . '"';
}
print '<tree text="' . AJXP_Utils::xmlEntities($cData["LABEL"]) . '" description="' . AJXP_Utils::xmlEntities($cData["DESCRIPTION"]) . '" icon="' . $cData["ICON"] . '" filename="' . $parentName . $key . '/' . $cKey . '" ' . $bmString . '/>';
}
print '</tree>';
}
}
AJXP_XMLWriter::close();
}
break;
case "stat":
header("Content-type:application/json");
print '{"mode":true}';
return;
break;
case "clear_plugins_cache":
AJXP_XMLWriter::header();
// Clear plugins cache if they exist
AJXP_PluginsService::clearPluginsCache();
ConfService::clearMessagesCache();
AJXP_XMLWriter::sendMessage($mess["ajxp_conf." . (AJXP_SKIP_CACHE ? "132" : "131")], null);
AJXP_XMLWriter::reloadDataNode();
AJXP_XMLWriter::close();
break;
case "create_group":
if (isset($httpVars["group_path"])) {
$basePath = AJXP_Utils::forwardSlashDirname($httpVars["group_path"]);
if (empty($basePath)) {
$basePath = "/";
}
$gName = AJXP_Utils::sanitize(AJXP_Utils::decodeSecureMagic(basename($httpVars["group_path"])), AJXP_SANITIZE_ALPHANUM);
} else {
$basePath = substr($httpVars["dir"], strlen("/data/users"));
$gName = AJXP_Utils::sanitize(SystemTextEncoding::magicDequote($httpVars["group_name"]), AJXP_SANITIZE_ALPHANUM);
}
$gLabel = AJXP_Utils::decodeSecureMagic($httpVars["group_label"]);
AuthService::createGroup($basePath, $gName, $gLabel);
AJXP_XMLWriter::header();
AJXP_XMLWriter::sendMessage($mess["ajxp_conf.124"], null);
AJXP_XMLWriter::reloadDataNode();
AJXP_XMLWriter::close();
break;
case "create_role":
$roleId = AJXP_Utils::sanitize(SystemTextEncoding::magicDequote($httpVars["role_id"]), AJXP_SANITIZE_HTML_STRICT);
if (!strlen($roleId)) {
throw new Exception($mess[349]);
}
if (AuthService::getRole($roleId) !== false) {
throw new Exception($mess["ajxp_conf.65"]);
}
$r = new AJXP_Role($roleId);
示例2: clearAllCaches
public static function clearAllCaches()
{
AJXP_PluginsService::clearPluginsCache();
self::clearMessagesCache();
self::getInstance()->getKeyValueCache()->deleteAll();
if (function_exists('opcache_reset')) {
opcache_reset();
}
}
示例3: applyInstallerForm
//.........这里部分代码省略.........
}
$oldBoot = $this->getPluginWorkDir(true) . "/bootstrap.json";
if (is_file($oldBoot)) {
copy($oldBoot, $oldBoot . ".bak");
unlink($oldBoot);
}
$newBootstrap = array("core.conf" => $coreConf, "core.auth" => $coreAuth);
AJXP_Utils::saveSerialFile($oldBoot, $newBootstrap, true, false, "json", true);
// Write new bootstrap and reload conf plugin!
if ($storageType == "db") {
$coreConf["UNIQUE_INSTANCE_CONFIG"]["SQL_DRIVER"] = $coreConf["DIBI_PRECONFIGURATION"];
$coreAuth["MASTER_INSTANCE_CONFIG"]["SQL_DRIVER"] = $coreConf["DIBI_PRECONFIGURATION"];
}
$newConfigPlugin = ConfService::instanciatePluginFromGlobalParams($coreConf["UNIQUE_INSTANCE_CONFIG"], "AbstractConfDriver");
$newAuthPlugin = ConfService::instanciatePluginFromGlobalParams($coreAuth["MASTER_INSTANCE_CONFIG"], "AbstractAuthDriver");
if ($data["ENCODING"] != (defined('AJXP_LOCALE') ? AJXP_LOCALE : SystemTextEncoding::getEncoding())) {
file_put_contents($this->getPluginWorkDir() . "/encoding.php", "<?php \$ROOT_ENCODING='" . $data["ENCODING"] . "';");
}
$tpl = file_get_contents($this->getBaseDir() . "/htaccess.tpl");
if (!empty($data["SERVER_URI"]) && $data["SERVER_URI"] != "/") {
$htContent = str_replace('${APPLICATION_ROOT}', $data["SERVER_URI"], $tpl);
} else {
$htContent = str_replace('${APPLICATION_ROOT}/', "/", $tpl);
$htContent = str_replace('${APPLICATION_ROOT}', "/", $htContent);
}
if (is_writeable(AJXP_INSTALL_PATH . "/.htaccess")) {
file_put_contents(AJXP_INSTALL_PATH . "/.htaccess", $htContent);
} else {
$htAccessToUpdate = AJXP_INSTALL_PATH . "/.htaccess";
}
if ($storageType == "db") {
$sqlPlugs = array("core.notifications/UNIQUE_FEED_INSTANCE" => "feed.sql", "core.log/UNIQUE_PLUGIN_INSTANCE" => "log.sql", "core.mq/UNIQUE_MS_INSTANCE" => "mq.sql");
$data["ENABLE_NOTIF"] = $data["STORAGE_TYPE"]["notifications"];
}
// Prepare plugins configs
$direct = array("APPLICATION_TITLE" => "core.ajaxplorer/APPLICATION_TITLE", "APPLICATION_LANGUAGE" => "core.ajaxplorer/DEFAULT_LANGUAGE", "ENABLE_NOTIF" => "core.notifications/USER_EVENTS", "APPLICATION_WELCOME" => "gui.ajax/CUSTOM_WELCOME_MESSAGE");
$mailerEnabled = $data["MAILER_ENABLE"]["status"];
if ($mailerEnabled == "yes") {
// Enable core.mailer
$data["MAILER_SYSTEM"] = $data["MAILER_ENABLE"]["MAILER_SYSTEM"];
$data["MAILER_ADMIN"] = $data["MAILER_ENABLE"]["MAILER_ADMIN"];
$direct = array_merge($direct, array("MAILER_SYSTEM" => "mailer.phpmailer-lite/MAILER", "MAILER_ADMIN" => "core.mailer/FROM"));
}
foreach ($direct as $key => $value) {
list($pluginId, $param) = explode("/", $value);
$options = array();
$newConfigPlugin->_loadPluginConfig($pluginId, $options);
$options[$param] = $data[$key];
$newConfigPlugin->_savePluginConfig($pluginId, $options);
}
if (isset($sqlPlugs)) {
foreach ($sqlPlugs as $core => $value) {
list($pluginId, $param) = explode("/", $core);
$options = array();
$newConfigPlugin->_loadPluginConfig($pluginId, $options);
$options[$param] = array("instance_name" => $value, "group_switch_value" => $value, "SQL_DRIVER" => array("core_driver" => "core", "group_switch_value" => "core"));
$newConfigPlugin->_savePluginConfig($pluginId, $options);
}
}
ConfService::setTmpStorageImplementations($newConfigPlugin, $newAuthPlugin);
require_once $newConfigPlugin->getUserClassFileName();
$adminLogin = AJXP_Utils::sanitize($data["ADMIN_USER_LOGIN"], AJXP_SANITIZE_EMAILCHARS);
$adminName = $data["ADMIN_USER_NAME"];
$adminPass = $data["ADMIN_USER_PASS"];
$adminPass2 = $data["ADMIN_USER_PASS2"];
AuthService::createUser($adminLogin, $adminPass, true);
$uObj = $newConfigPlugin->createUserObject($adminLogin);
if (isset($data["MAILER_ADMIN"])) {
$uObj->personalRole->setParameterValue("core.conf", "email", $data["MAILER_ADMIN"]);
}
$uObj->personalRole->setParameterValue("core.conf", "USER_DISPLAY_NAME", $adminName);
$uObj->personalRole->setAcl('ajxp_conf', 'rw');
AuthService::updateRole($uObj->personalRole);
$loginP = "USER_LOGIN";
$i = 0;
while (isset($data[$loginP]) && !empty($data[$loginP])) {
$pass = $data[str_replace("_LOGIN", "_PASS", $loginP)];
$pass2 = $data[str_replace("_LOGIN", "_PASS2", $loginP)];
$name = $data[str_replace("_LOGIN", "_NAME", $loginP)];
$mail = $data[str_replace("_LOGIN", "_MAIL", $loginP)];
$saniLogin = AJXP_Utils::sanitize($data[$loginP], AJXP_SANITIZE_EMAILCHARS);
AuthService::createUser($saniLogin, $pass);
$uObj = $newConfigPlugin->createUserObject($saniLogin);
$uObj->personalRole->setParameterValue("core.conf", "email", $mail);
$uObj->personalRole->setParameterValue("core.conf", "USER_DISPLAY_NAME", $name);
AuthService::updateRole($uObj->personalRole);
$i++;
$loginP = "USER_LOGIN_" . $i;
}
AJXP_PluginsService::clearPluginsCache();
AJXP_Utils::setApplicationFirstRunPassed();
if (isset($htAccessToUpdate)) {
HTMLWriter::charsetHeader("application/json");
echo json_encode(array('file' => $htAccessToUpdate, 'content' => $htContent));
} else {
session_destroy();
HTMLWriter::charsetHeader("text/plain");
echo 'OK';
}
}
示例4: clearAllCaches
public static function clearAllCaches()
{
AJXP_PluginsService::clearPluginsCache();
self::clearMessagesCache();
CacheService::deleteAll(AJXP_CACHE_SERVICE_NS_SHARED);
if (function_exists('opcache_reset')) {
opcache_reset();
}
}
示例5: clearCache
public function clearCache()
{
AJXP_PluginsService::clearPluginsCache();
ConfService::clearMessagesCache();
return "Ok";
}