本文整理汇总了PHP中AJXP_Utils::loadSerialFile方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_Utils::loadSerialFile方法的具体用法?PHP AJXP_Utils::loadSerialFile怎么用?PHP AJXP_Utils::loadSerialFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AJXP_Utils
的用法示例。
在下文中一共展示了AJXP_Utils::loadSerialFile方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadChannel
public function loadChannel($channelName, $create = false)
{
if (isset($this->channels) && is_array($this->channels[$channelName])) {
return;
}
if (is_file($this->getPluginWorkDir() . "/queues/channel-{$channelName}")) {
if (!isset($this->channels)) {
$this->channels = array();
}
$data = AJXP_Utils::loadSerialFile($this->getPluginWorkDir() . "/queues/channel-{$channelName}");
if (is_array($data)) {
if (!is_array($data["MESSAGES"])) {
$data["MESSAGES"] = array();
}
if (!is_array($data["CLIENTS"])) {
$data["CLIENTS"] = array();
}
$this->channels[$channelName] = $data;
return;
}
}
if ($create) {
if (!isset($this->channels)) {
$this->channels = array();
}
$this->channels[$channelName] = array("CLIENTS" => array(), "MESSAGES" => array());
}
}
示例2: loadCounters
private static function loadCounters()
{
if (!isset(self::$counters)) {
self::$counters = AJXP_Utils::loadSerialFile(ConfService::getCoreConf("PUBLIC_DOWNLOAD_FOLDER") . "/.ajxp_publiclet_counters.ser");
}
return self::$counters;
}
示例3: listUsers
function listUsers()
{
$users = AJXP_Utils::loadSerialFile($this->usersSerFile);
if (AuthService::ignoreUserCase()) {
$users = array_combine(array_map("strtolower", array_keys($users)), array_values($users));
}
return $users;
}
示例4: listUsers
public function listUsers($baseGroup = "/")
{
$users = AJXP_Utils::loadSerialFile($this->usersSerFile);
if (AuthService::ignoreUserCase()) {
$users = array_combine(array_map("strtolower", array_keys($users)), array_values($users));
}
ConfService::getConfStorageImpl()->filterUsersByGroup($users, $baseGroup, false);
return $users;
}
示例5: init
/**
* Initialize the driver.
*
* Gives the driver a chance to set up it's connection / file resource etc..
*
* @param Array $options array of options specific to the logger driver.
* @access public
*/
public function init($options)
{
parent::init($options);
$this->sqlDriver = AJXP_Utils::cleanDibiDriverParameters($options["SQL_DRIVER"]);
try {
dibi::connect($this->sqlDriver);
} catch (DibiException $e) {
echo get_class($e), ': ', $e->getMessage(), "\n";
exit(1);
}
$this->queries = AJXP_Utils::loadSerialFile($this->getBaseDir() . "/queries.json", false, "json");
}
示例6: listUsers
public function listUsers()
{
//Remote user list for admins.
if ($this->isAdmin()) {
$users = $this->getRemoteUsers();
AJXP_Utils::saveSerialFile($this->usersSerFile, $users);
} else {
$users = AJXP_Utils::loadSerialFile($this->usersSerFile);
}
if (AuthService::ignoreUserCase()) {
$users = array_combine(array_map("strtolower", array_keys($users)), array_values($users));
}
ksort($users);
return $users;
}
示例7: getTemporaryData
/**
* Get Temporary Data.
* Implementation uses serialised files because of the overhead incurred with a full db implementation.
*
* @param $key String key of data to retrieve
* @return Requested value
*/
function getTemporaryData($key)
{
$dirPath = $this->storage->getOption("USERS_DIRPATH");
if ($dirPath == "") {
$dirPath = AJXP_INSTALL_PATH . "/data/users";
AJXP_Logger::logAction("getTemporaryData", array("Warning" => "The conf.sql driver is missing a mandatory option USERS_DIRPATH!"));
}
return AJXP_Utils::loadSerialFile($dirPath . "/" . $this->getId() . "-temp-" . $key . ".ser");
}
示例8: getTemporaryData
public function getTemporaryData($key)
{
$fastCheck = $this->storage->getOption("FAST_CHECKS");
$fastCheck = $fastCheck == "true" || $fastCheck == true;
return AJXP_Utils::loadSerialFile($this->getStoragePath() . "/" . $key . ".ser", $fastCheck);
}
示例9: updateAliasesIndex
/**
* Serial specific method : indexes repositories by slugs, for better performances
*/
function updateAliasesIndex($repositoryId, $repositorySlug)
{
$data = AJXP_Utils::loadSerialFile($this->aliasesIndexFile);
$byId = array_flip($data);
$byId[$repositoryId] = $repositorySlug;
AJXP_Utils::saveSerialFile($this->aliasesIndexFile, array_flip($byId));
}
示例10: listUsers
public function listUsers($baseGroup = "/", $recursive = true)
{
$users = AJXP_Utils::loadSerialFile($this->usersSerFile);
if (AuthService::ignoreUserCase()) {
$users = array_combine(array_map("strtolower", array_keys($users)), array_values($users));
}
ksort($users);
return $users;
}
示例11: getTemporaryData
/**
* Get Temporary Data.
* Implementation uses serialised files because of the overhead incurred with a full db implementation.
*
* @param $key String key of data to retrieve
* @return Requested value
*/
public function getTemporaryData($key)
{
$dirPath = $this->storage->getOption("USERS_DIRPATH");
if ($dirPath == "") {
$dirPath = AJXP_INSTALL_PATH . "/data/users";
AJXP_Logger::info(__CLASS__, "getTemporaryData", array("Warning" => "The conf.sql driver is missing a mandatory option USERS_DIRPATH!"));
}
$id = AuthService::ignoreUserCase() ? strtolower($this->getId()) : $this->getId();
return AJXP_Utils::loadSerialFile($dirPath . "/" . $id . "/temp-" . $key . ".ser");
}
示例12: _savePluginConfig
/**
* @param String $pluginId
* @param String $options
*/
public function _savePluginConfig($pluginId, $options)
{
$jsonPath = $this->getPluginWorkDir(true) . "/bootstrap.json";
$jsonData = AJXP_Utils::loadSerialFile($jsonPath, false, "json");
if (!is_array($jsonData)) {
$jsonData = array();
}
$jsonData[$pluginId] = $options;
if ($pluginId == "core.conf" || $pluginId == "core.auth") {
$testKey = $pluginId == "core.conf" ? "UNIQUE_INSTANCE_CONFIG" : "MASTER_INSTANCE_CONFIG";
$current = array();
$this->_loadPluginConfig($pluginId, $current);
if (isset($current[$testKey]["instance_name"]) && $current[$testKey]["instance_name"] != $options[$testKey]["instance_name"]) {
$forceDisconnexion = $pluginId;
}
}
if (file_exists($jsonPath)) {
copy($jsonPath, $jsonPath . ".bak");
}
AJXP_Utils::saveSerialFile($jsonPath, $jsonData, true, false, "json", true);
if (isset($forceDisconnexion)) {
if ($pluginId == "core.conf") {
// DISCONNECT
AuthService::disconnect();
} else {
if ($pluginId == "core.auth") {
// DELETE admin_counted file and DISCONNECT
@unlink(AJXP_CACHE_DIR . "/admin_counted");
}
}
}
}
示例13: listUsers
function listUsers()
{
return AJXP_Utils::loadSerialFile($this->usersSerFile);
}
示例14: getTemporaryData
function getTemporaryData($key)
{
return AJXP_Utils::loadSerialFile($this->storage->getOption("USERS_DIRPATH") . "/" . $this->getId() . "/" . $key . ".ser");
}
示例15: groupExists
/**
* Check if group already exists
* @param string $groupPath
* @return boolean
*/
public function groupExists($groupPath)
{
$groups = AJXP_Utils::loadSerialFile(AJXP_VarsFilter::filter($this->getOption("USERS_DIRPATH")) . "/groups.ser");
$reverse = array_flip($groups);
if (isset($reverse[$groupPath])) {
return true;
}
return false;
}