本文整理汇总了PHP中OCA\Files_Trashbin\Trashbin::deleteExpiredFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP Trashbin::deleteExpiredFiles方法的具体用法?PHP Trashbin::deleteExpiredFiles怎么用?PHP Trashbin::deleteExpiredFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OCA\Files_Trashbin\Trashbin
的用法示例。
在下文中一共展示了Trashbin::deleteExpiredFiles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* @param $argument
* @throws \Exception
*/
protected function run($argument)
{
$maxAge = $this->expiration->getMaxAgeAsTimestamp();
if (!$maxAge) {
return;
}
$this->userManager->callForAllUsers(function (IUser $user) {
$uid = $user->getUID();
if (!$this->setupFS($uid)) {
return;
}
$dirContent = Helper::getTrashFiles('/', $uid, 'mtime');
Trashbin::deleteExpiredFiles($dirContent, $uid);
});
\OC_Util::tearDownFS();
}
示例2: dummyDeleteExpiredFiles
/**
* @param OCP\Files\FileInfo[] $files
* @param integer $limit
*/
public function dummyDeleteExpiredFiles($files, $limit)
{
// dummy value for $retention_obligation because it is not needed here
return parent::deleteExpiredFiles($files, \Test_Trashbin::TEST_TRASHBIN_USER1, $limit, 0);
}
示例3: run
/**
* @param $argument
* @throws \Exception
*/
protected function run($argument)
{
$maxAge = $this->expiration->getMaxAgeAsTimestamp();
if (!$maxAge) {
return;
}
$offset = $this->config->getAppValue('files_trashbin', 'cronjob_user_offset', 0);
$users = $this->userManager->search('', self::USERS_PER_SESSION, $offset);
if (!count($users)) {
// No users found, reset offset and retry
$offset = 0;
$users = $this->userManager->search('', self::USERS_PER_SESSION);
}
$offset += self::USERS_PER_SESSION;
$this->config->setAppValue('files_trashbin', 'cronjob_user_offset', $offset);
foreach ($users as $user) {
$uid = $user->getUID();
if (!$this->setupFS($uid)) {
continue;
}
$dirContent = Helper::getTrashFiles('/', $uid, 'mtime');
Trashbin::deleteExpiredFiles($dirContent, $uid);
}
\OC_Util::tearDownFS();
}