本文整理汇总了PHP中MOXMAN::getUserStorage方法的典型用法代码示例。如果您正苦于以下问题:PHP MOXMAN::getUserStorage方法的具体用法?PHP MOXMAN::getUserStorage怎么用?PHP MOXMAN::getUserStorage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MOXMAN
的用法示例。
在下文中一共展示了MOXMAN::getUserStorage方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onFileAction
public function onFileAction(MOXMAN_Vfs_FileActionEventArgs $args)
{
switch ($args->getAction()) {
case MOXMAN_Vfs_FileActionEventArgs::DELETE:
case MOXMAN_Vfs_FileActionEventArgs::COPY:
case MOXMAN_Vfs_FileActionEventArgs::ADD:
MOXMAN::getUserStorage()->put("quota.size", max(0, $this->currentSize));
break;
}
}
示例2: onFileAction
public function onFileAction(MOXMAN_Core_FileActionEventArgs $args)
{
switch ($args->getAction()) {
case MOXMAN_Core_FileActionEventArgs::LIST_FILES:
// Recalculate quota size when listing files
$dirs = MOXMAN::getUserStorage()->get("quota.dirs", new stdClass());
$this->recalcQuota($args->getFile(), $dirs);
MOXMAN::getUserStorage()->put("quota.dirs", $dirs);
break;
}
}
示例3: listFilesFiltered
public function listFilesFiltered(MOXMAN_Vfs_IFileFilter $filter)
{
$entries = MOXMAN_Util_Json::decode(MOXMAN::getUserStorage()->get("uploaded.files", "[]"));
$files = array();
foreach ($entries as $entry) {
$file = new MOXMAN_Uploaded_File($this->fileSystem, $entry->path, $entry);
if ($filter->accept($file) == MOXMAN_Vfs_IFileFilter::ACCEPTED) {
$files[] = $file;
}
}
return $files;
}
示例4: listFilesFiltered
public function listFilesFiltered(MOXMAN_Vfs_IFileFilter $filter)
{
$files = array();
if ($this->isDirectory()) {
$fileSystem = $this->getFileSystem();
$entries = MOXMAN_Util_Json::decode(MOXMAN::getUserStorage()->get("uploaded.files", "[]"));
foreach ($entries as $entry) {
$file = new MOXMAN_Favorites_File($fileSystem, $entry->path, $entry);
if ($filter->accept($file)) {
$files[] = $file;
}
}
}
return new MOXMAN_Vfs_FileList($files);
}
示例5: remove
public function remove($params)
{
if (isset($params->paths) && is_array($params->paths)) {
$paths = $params->paths;
$files = MOXMAN_Util_Json::decode(MOXMAN::getUserStorage()->get("uploaded.files", "[]"));
// Remove existing paths
for ($i = 0; $i < count($files); $i++) {
foreach ($paths as $path) {
if ($files[$i]->path == $path) {
array_splice($files, $i, 1);
}
}
}
MOXMAN::getUserStorage()->put("uploaded.files", MOXMAN_Util_Json::encode($files));
}
return true;
}
示例6: listFilesFiltered
public function listFilesFiltered(MOXMAN_Vfs_IFileFilter $filter)
{
$files = array();
if ($this->isDirectory()) {
$fileSystem = $this->getFileSystem();
$entries = MOXMAN_Util_Json::decode(MOXMAN::getUserStorage()->get("history.files", "[]"));
$index = 0;
foreach ($entries as $entry) {
$file = new MOXMAN_History_File($fileSystem, $entry->path, $entry);
if ($filter->accept($file)) {
$entry->name = basename($entry->path) . "_\$\$[" . $index++ . "]";
$files[] = $file;
}
}
}
return new MOXMAN_Vfs_FileList($files);
}
示例7: remove
public function remove($params)
{
if (isset($params->paths) && is_array($params->paths)) {
$paths = $params->paths;
$files = MOXMAN_Util_Json::decode(MOXMAN::getUserStorage()->get("favorites.files", "[]"));
foreach ($paths as $path) {
for ($i = count($files) - 1; $i >= 0; $i--) {
if ($files[$i]->path == $path) {
array_splice($files, $i, 1);
$i--;
}
}
}
MOXMAN::getUserStorage()->put("favorites.files", MOXMAN_Util_Json::encode($files));
}
return true;
}
示例8: remove
public function remove($params)
{
if (MOXMAN::getConfig()->get('general.demo')) {
throw new MOXMAN_Exception("This action is restricted in demo mode.", MOXMAN_Exception::DEMO_MODE);
}
if (isset($params->paths) && is_array($params->paths)) {
$paths = $params->paths;
$files = MOXMAN_Util_Json::decode(MOXMAN::getUserStorage()->get("history.files", "[]"));
for ($i = count($files) - 1; $i >= 0; $i--) {
foreach ($paths as $path) {
if ($files[$i]->path == $path) {
array_splice($files, $i, 1);
$i--;
}
}
}
MOXMAN::getUserStorage()->put("history.files", MOXMAN_Util_Json::encode($files));
}
return true;
}