本文整理汇总了PHP中AJXP_PluginsService::findPluginById方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_PluginsService::findPluginById方法的具体用法?PHP AJXP_PluginsService::findPluginById怎么用?PHP AJXP_PluginsService::findPluginById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AJXP_PluginsService
的用法示例。
在下文中一共展示了AJXP_PluginsService::findPluginById方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init($options)
{
parent::init($options);
if (!isset($this->options["FTP_LOGIN_SCREEN"]) || $this->options["FTP_LOGIN_SCREEN"] != "TRUE" || $this->options["FTP_LOGIN_SCREEN"] === false) {
return;
}
// ENABLE WEBFTP LOGIN SCREEN
$this->logDebug(__FUNCTION__, "Enabling authfront.webftp");
AJXP_PluginsService::findPluginById("authfront.webftp")->enabled = true;
}
示例2: initMeta
public function initMeta($accessDriver)
{
parent::initMeta($accessDriver);
$this->notificationCenter = AJXP_PluginsService::findPluginById("core.notifications");
$store = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType("metastore");
if ($store === false) {
throw new Exception("The 'meta.watch' plugin requires at least one active 'metastore' plugin");
}
$this->metaStore = $store;
$this->metaStore->initMeta($accessDriver);
}
示例3: testConnexions
/**
* Helpers to test SQL connection and send a test email.
* @param $action
* @param $httpVars
* @param $fileVars
* @throws Exception
*/
public function testConnexions($action, $httpVars, $fileVars)
{
$data = array();
AJXP_Utils::parseStandardFormParameters($httpVars, $data, null, "DRIVER_OPTION_");
if ($action == "boot_test_sql_connexion") {
$p = AJXP_Utils::cleanDibiDriverParameters($data["db_type"]);
if ($p["driver"] == "sqlite3") {
$dbFile = AJXP_VarsFilter::filter($p["database"]);
if (!file_exists(dirname($dbFile))) {
mkdir(dirname($dbFile), 0755, true);
}
}
// Should throw an exception if there was a problem.
dibi::connect($p);
dibi::disconnect();
echo 'SUCCESS:Connexion established!';
} else {
if ($action == "boot_test_mailer") {
$mailerPlug = AJXP_PluginsService::findPluginById("mailer.phpmailer-lite");
$mailerPlug->loadConfigs(array("MAILER" => $data["MAILER_ENABLE"]["MAILER_SYSTEM"]));
$mailerPlug->sendMail(array("adress" => $data["MAILER_ENABLE"]["MAILER_ADMIN"]), "Pydio Test Mail", "Body of the test", array("adress" => $data["MAILER_ENABLE"]["MAILER_ADMIN"]));
echo 'SUCCESS:Mail sent to the admin adress, please check it is in your inbox!';
}
}
}
示例4: getShareCenter
/**
* @return ShareCenter
*/
public static function getShareCenter()
{
return AJXP_PluginsService::findPluginById("action.share");
}
示例5: applyCallback
private function applyCallback($xPath, $callback, &$actionName, &$httpVars, &$fileVars, &$variableArgs = null)
{
//Processing
$plugId = $xPath->query("@pluginId", $callback)->item(0)->value;
$methodName = $xPath->query("@methodName", $callback)->item(0)->value;
$plugInstance = AJXP_PluginsService::findPluginById($plugId);
//return call_user_func(array($plugInstance, $methodName), $actionName, $httpVars, $fileVars);
// Do not use call_user_func, it cannot pass parameters by reference.
if (method_exists($plugInstance, $methodName)) {
if ($variableArgs == null) {
return $plugInstance->{$methodName}($actionName, $httpVars, $fileVars);
} else {
call_user_func_array(array($plugInstance, $methodName), $variableArgs);
}
} else {
throw new AJXP_Exception("Cannot find method {$methodName} for plugin {$plugId}!");
}
}
示例6: applyCallback
/**
* Applies a callback node
* @static
* @param DOMElement|Array $callback The DOM Node or directly an array of attributes
* @param String $actionName
* @param Array $httpVars
* @param Array $fileVars
* @param null $variableArgs
* @param bool $defer
* @throws AJXP_Exception* @internal param \DOMXPath $xPath
* @return mixed
*/
private static function applyCallback($callback, &$actionName, &$httpVars, &$fileVars, &$variableArgs = null, $defer = false)
{
//Processing
if (is_array($callback)) {
$plugId = $callback["pluginId"];
$methodName = $callback["methodName"];
} else {
$plugId = $callback->getAttribute("pluginId");
$methodName = $callback->getAttribute("methodName");
}
$plugInstance = AJXP_PluginsService::findPluginById($plugId);
//return call_user_func(array($plugInstance, $methodName), $actionName, $httpVars, $fileVars);
// Do not use call_user_func, it cannot pass parameters by reference.
if (method_exists($plugInstance, $methodName)) {
if ($variableArgs == null) {
return $plugInstance->{$methodName}($actionName, $httpVars, $fileVars);
} else {
if ($defer == true) {
AJXP_ShutdownScheduler::getInstance()->registerShutdownEventArray(array($plugInstance, $methodName), $variableArgs);
} else {
call_user_func_array(array($plugInstance, $methodName), $variableArgs);
}
}
} else {
throw new AJXP_Exception("Cannot find method {$methodName} for plugin {$plugId}!");
}
}
示例7: switchAction
//.........这里部分代码省略.........
}
}
if (!(RecycleBinManager::getRelativeRecycle() == $dest && $this->getFilteredOption("HIDE_RECYCLE", $this->repository->getId()) == true)) {
//$reloadDataNode = $dest;
}
break;
//------------------------------------
// DELETE
//------------------------------------
//------------------------------------
// DELETE
//------------------------------------
case "delete":
if ($selection->isEmpty()) {
throw new AJXP_Exception("", 113);
}
$logMessages = array();
$errorMessage = $this->delete($selection->getFiles(), $logMessages);
if (count($logMessages)) {
$logMessage = join("\n", $logMessages);
}
if ($errorMessage) {
throw new AJXP_Exception(SystemTextEncoding::toUTF8($errorMessage));
}
$this->logInfo("Delete", array("files" => $this->addSlugToPath($selection)));
if (!isset($nodesDiffs)) {
$nodesDiffs = $this->getNodesDiffArray();
}
$nodesDiffs["REMOVE"] = array_merge($nodesDiffs["REMOVE"], $selection->getFiles());
break;
case "purge":
$hardPurgeTime = intval($this->repository->getOption("PURGE_AFTER")) * 3600 * 24;
$softPurgeTime = intval($this->repository->getOption("PURGE_AFTER_SOFT")) * 3600 * 24;
$shareCenter = AJXP_PluginsService::findPluginById('action.share');
if (!($shareCenter && $shareCenter->isEnabled())) {
//action.share is disabled, don't look at the softPurgeTime
$softPurgeTime = 0;
}
if ($hardPurgeTime > 0 || $softPurgeTime > 0) {
$this->recursivePurge($this->urlBase, $hardPurgeTime, $softPurgeTime);
}
break;
//------------------------------------
// RENAME
//------------------------------------
//------------------------------------
// RENAME
//------------------------------------
case "rename":
$file = AJXP_Utils::decodeSecureMagic($httpVars["file"]);
$filename_new = AJXP_Utils::decodeSecureMagic($httpVars["filename_new"]);
$dest = null;
if (isset($httpVars["dest"])) {
$dest = AJXP_Utils::decodeSecureMagic($httpVars["dest"]);
$filename_new = "";
}
$this->filterUserSelectionToHidden(array($filename_new));
$this->rename($file, $filename_new, $dest);
$logMessage = SystemTextEncoding::toUTF8($file) . " {$mess['41']} " . SystemTextEncoding::toUTF8($filename_new);
//$reloadContextNode = true;
//$pendingSelection = $filename_new;
if (!isset($nodesDiffs)) {
$nodesDiffs = $this->getNodesDiffArray();
}
if ($dest == null) {
$dest = AJXP_Utils::safeDirname($file);
示例8: loadMinisite
public static function loadMinisite($data, $hash = '', $error = null)
{
if (isset($data["SECURITY_MODIFIED"]) && $data["SECURITY_MODIFIED"] === true) {
$mess = ConfService::getMessages();
$error = $mess['share_center.164'];
}
$repository = $data["REPOSITORY"];
AJXP_PluginsService::getInstance()->initActivePlugins();
$shareCenter = AJXP_PluginsService::findPlugin("action", "share");
$confs = $shareCenter->getConfigs();
$minisiteLogo = "plugins/gui.ajax/PydioLogo250.png";
if (!empty($confs["CUSTOM_MINISITE_LOGO"])) {
$logoPath = $confs["CUSTOM_MINISITE_LOGO"];
if (strpos($logoPath, "plugins/") === 0 && is_file(AJXP_INSTALL_PATH . "/" . $logoPath)) {
$minisiteLogo = $logoPath;
} else {
$minisiteLogo = "index_shared.php?get_action=get_global_binary_param&binary_id=" . $logoPath;
}
}
// Default value
if (isset($data["AJXP_TEMPLATE_NAME"])) {
$templateName = $data["AJXP_TEMPLATE_NAME"];
if ($templateName == "ajxp_film_strip" && AJXP_Utils::userAgentIsMobile()) {
$templateName = "ajxp_shared_folder";
}
}
if (!isset($templateName)) {
$repoObject = ConfService::getRepositoryById($repository);
if (!is_object($repoObject)) {
$mess = ConfService::getMessages();
$error = $mess["share_center.166"];
$templateName = "ajxp_unique_strip";
} else {
$filter = $repoObject->getContentFilter();
if (!empty($filter) && count($filter->virtualPaths) == 1) {
$templateName = "ajxp_unique_strip";
} else {
$templateName = "ajxp_shared_folder";
}
}
}
// UPDATE TEMPLATE
$html = file_get_contents(AJXP_INSTALL_PATH . "/" . AJXP_PLUGINS_FOLDER . "/action.share/res/minisite.php");
AJXP_Controller::applyHook("tpl.filter_html", array(&$html));
$html = AJXP_XMLWriter::replaceAjxpXmlKeywords($html);
$html = str_replace("AJXP_MINISITE_LOGO", $minisiteLogo, $html);
$html = str_replace("AJXP_APPLICATION_TITLE", ConfService::getCoreConf("APPLICATION_TITLE"), $html);
$html = str_replace("PYDIO_APP_TITLE", ConfService::getCoreConf("APPLICATION_TITLE"), $html);
if (isset($repository)) {
$html = str_replace("AJXP_START_REPOSITORY", $repository, $html);
$html = str_replace("AJXP_REPOSITORY_LABEL", ConfService::getRepositoryById($repository)->getDisplay(), $html);
}
$html = str_replace('AJXP_HASH_LOAD_ERROR', isset($error) ? $error : '', $html);
$html = str_replace("AJXP_TEMPLATE_NAME", $templateName, $html);
$html = str_replace("AJXP_LINK_HASH", $hash, $html);
$guiConfigs = AJXP_PluginsService::findPluginById("gui.ajax")->getConfigs();
$html = str_replace("AJXP_THEME", $guiConfigs["GUI_THEME"], $html);
if (isset($_GET["dl"]) && isset($_GET["file"])) {
AuthService::$useSession = false;
} else {
session_name("AjaXplorer_Shared" . str_replace(".", "_", $hash));
session_start();
AuthService::disconnect();
}
if (!empty($data["PRELOG_USER"])) {
AuthService::logUser($data["PRELOG_USER"], "", true);
$html = str_replace("AJXP_PRELOGED_USER", "ajxp_preloged_user", $html);
} else {
if (isset($data["PRESET_LOGIN"])) {
$_SESSION["PENDING_REPOSITORY_ID"] = $repository;
$_SESSION["PENDING_FOLDER"] = "/";
$html = str_replace("AJXP_PRELOGED_USER", $data["PRESET_LOGIN"], $html);
} else {
$html = str_replace("AJXP_PRELOGED_USER", "ajxp_legacy_minisite", $html);
}
}
if (isset($hash)) {
$_SESSION["CURRENT_MINISITE"] = $hash;
}
if (isset($_GET["dl"]) && isset($_GET["file"]) && (!isset($data["DOWNLOAD_DISABLED"]) || $data["DOWNLOAD_DISABLED"] === false)) {
ConfService::switchRootDir($repository);
ConfService::loadRepositoryDriver();
AJXP_PluginsService::deferBuildingRegistry();
AJXP_PluginsService::getInstance()->initActivePlugins();
AJXP_PluginsService::flushDeferredRegistryBuilding();
$errMessage = null;
try {
$params = $_GET;
$ACTION = "download";
if (isset($_GET["ct"])) {
$mime = pathinfo($params["file"], PATHINFO_EXTENSION);
$editors = AJXP_PluginsService::searchAllManifests("//editor[contains(@mimes,'{$mime}') and @previewProvider='true']", "node", true, true, false);
if (count($editors)) {
foreach ($editors as $editor) {
$xPath = new DOMXPath($editor->ownerDocument);
$callbacks = $xPath->query("//action[@contentTypedProvider]", $editor);
if ($callbacks->length) {
$ACTION = $callbacks->item(0)->getAttribute("name");
if ($ACTION == "audio_proxy") {
$params["file"] = "base64encoded:" . base64_encode($params["file"]);
//.........这里部分代码省略.........
示例9: switchAction
public function switchAction($action, $httpVars, $fileVars)
{
parent::accessPreprocess($action, $httpVars, $fileVars);
$loggedUser = AuthService::getLoggedUser();
if (!AuthService::usersEnabled()) {
return;
}
if ($action == "edit") {
if (isset($httpVars["sub_action"])) {
$action = $httpVars["sub_action"];
}
}
$mess = ConfService::getMessages();
switch ($action) {
//------------------------------------
// BASIC LISTING
//------------------------------------
case "ls":
$rootNodes = array("users" => array("LABEL" => $mess["user_dash.1"], "ICON" => "user_shared.png", "ICON-CLASS" => "icon-book", "DESCRIPTION" => $mess["user_dash.30"]), "files" => array("LABEL" => $mess["user_dash.34"], "ICON" => "user_shared.png", "ICON-CLASS" => "icon-share", "DESCRIPTION" => $mess["user_dash.35"]), "settings" => array("LABEL" => $mess["user_dash.36"], "ICON" => "user_shared.png", "ICON-CLASS" => "icon-cog", "DESCRIPTION" => $mess["user_dash.37"]), "repositories" => array("LABEL" => $mess["user_dash.36"], "ICON" => "user_shared.png", "ICON-CLASS" => "icon-cog", "DESCRIPTION" => $mess["user_dash.37"]), "teams" => array("LABEL" => "Teams", "ICON" => "user_shared.png", "ICON-CLASS" => "icon-group", "DESCRIPTION" => "My Teams"));
$dir = isset($httpVars["dir"]) ? $httpVars["dir"] : "";
$splits = explode("/", $dir);
if (count($splits)) {
if ($splits[0] == "") {
array_shift($splits);
}
if (count($splits)) {
$strippedDir = strtolower(urldecode($splits[0]));
} else {
$strippedDir = "";
}
}
if (array_key_exists($strippedDir, $rootNodes)) {
AJXP_XMLWriter::header();
if ($strippedDir == "users") {
$this->listUsers();
} else {
if ($strippedDir == "teams") {
$this->listTeams();
} else {
if ($strippedDir == "repositories") {
$this->listRepositories();
} else {
if ($strippedDir == "files") {
$this->listSharedFiles("files");
}
}
}
}
AJXP_XMLWriter::close();
} else {
AJXP_XMLWriter::header();
/*
AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchGridMode="filelist"><column messageId="user_dash.8" attributeName="ajxp_label" sortType="String"/><column messageId="user_dash.31" attributeName="description" sortType="String"/></columns>');
foreach ($rootNodes as $key => $data) {
$l = $data["LABEL"];
print '<tree text="'.$l.'" icon="'.$data["ICON"].'" filename="/'.$key.'" parentname="/" description="'.$data["DESCRIPTION"].'" />';
}
*/
AJXP_XMLWriter::close();
}
break;
case "stat":
header("Content-type:application/json");
print '{"mode":true}';
break;
case "delete":
$mime = $httpVars["ajxp_mime"];
$selection = new UserSelection();
$selection->initFromHttpVars($httpVars);
$files = $selection->getFiles();
AJXP_XMLWriter::header();
$minisites = $this->listSharedFiles("minisites");
$shareCenter = AJXP_PluginsService::findPluginById("action.share");
foreach ($files as $index => $element) {
$element = basename($element);
$ar = explode("shared_", $mime);
$mime = array_pop($ar);
if ($mime == "repository" && isset($minisites[$element])) {
$mime = "minisite";
$element = $minisites[$element];
}
$shareCenter->deleteSharedElement($mime, $element, $loggedUser);
if ($mime == "repository" || $mime == "minisite") {
$out = $mess["ajxp_conf.59"];
} else {
if ($mime == "user") {
$out = $mess["ajxp_conf.60"];
} else {
if ($mime == "file") {
$out = $mess["user_dash.13"];
}
}
}
}
AJXP_XMLWriter::sendMessage($out, null);
AJXP_XMLWriter::reloadDataNode();
AJXP_XMLWriter::close();
break;
case "clear_expired":
$shareCenter = AJXP_PluginsService::getInstance()->findPluginById("action.share");
//.........这里部分代码省略.........
示例10: getDriverLabel
protected function getDriverLabel($pluginId, &$labels)
{
if (isset($labels[$pluginId])) {
return $labels[$pluginId];
}
$plugin = AJXP_PluginsService::findPluginById("access." . $pluginId);
if (!is_object($plugin)) {
$label = "access.{$plugin} (plugin disabled!)";
} else {
$label = $plugin->getManifestLabel();
}
$labels[$pluginId] = $label;
return $label;
}
示例11: rename
<?php
// FORCE bootstrap_context copy, otherwise it won't reboot
if (is_file(AJXP_INSTALL_PATH . "/conf/bootstrap_context.php" . ".new-" . date("Ymd"))) {
rename(AJXP_INSTALL_PATH . "/conf/bootstrap_context.php", AJXP_INSTALL_PATH . "/conf/bootstrap_context.php.pre-update");
rename(AJXP_INSTALL_PATH . "/conf/bootstrap_context.php" . ".new-" . date("Ymd"), AJXP_INSTALL_PATH . "/conf/bootstrap_context.php");
}
// RE-ENABLE NEWLY DISABLED DRIVERS TO AVOID DISAPPEARING FEATURES
$disabledPlugins = array("access.demo", "access.imap", "access.jsapi", "access.mysql", "access.sftp", "access.sft_psl", "access.smb", "access.webdav", "auth.basic_http", "auth.custom_db", "auth.ftp", "auth.radius", "auth.remote_ajxp", "auth.serial", "auth.smb", "conf.serial", "index.elasticsearch", "log.syslog", "meta.svn", "metastore.xattr");
$skipReenable = array("access.demo", "access.jsapi", "access.mysql", "auth.remote_ajxp", "meta.svn");
$enabled = array();
$skipped = array();
$confStorage = ConfService::getConfStorageImpl();
foreach ($disabledPlugins as $plugin) {
$plugObject = AJXP_PluginsService::findPluginById($plugin);
if (is_a($plugObject, "AJXP_Plugin")) {
if ($plugObject->isEnabled()) {
continue;
}
if (in_array($plugin, $skipReenable)) {
$skipped[] = $plugin;
continue;
}
list($type, $name) = explode(".", $plugin);
$options = $confStorage->loadPluginConfig($type, $name);
$options["AJXP_PLUGIN_ENABLED"] = true;
$confStorage->savePluginConfig($plugin, $options);
$enabled[] = $plugin;
}
}
echo "To improve performances, many plugins were disabled by default in the new version.<br>";