30 protected \ilResourceStorageMigrationHelper
$helper;
34 return "Migration of Profile Pictures to the Resource Storage Service.";
44 return \ilResourceStorageMigrationHelper::getPreconditions();
49 $this->helper = new \ilResourceStorageMigrationHelper(
57 $r = $this->helper->getDatabase()->query(
61 WHERE usr_data.rid IS NULL OR usr_data.rid = '' 65 $d = $this->helper->getDatabase()->fetchObject(
$r);
66 $user_id = (
int)
$d->usr_id;
68 $base_path = $this->buildBasePath();
69 $pattern =
'/.*\/(usr|upload)\_' . $user_id .
'\..*/m';
71 $rid = $this->helper->moveFirstFileOfPatternToStorage(
77 $save_rid = $rid === null ?
'-' : $rid->serialize();
78 $this->helper->getDatabase()->update(
80 [
'rid' => [
'text', $save_rid]],
81 [
'usr_id' => [
'integer', $user_id],]
87 $r = $this->helper->getDatabase()->query(
89 count(usr_data.usr_id) AS amount 91 WHERE usr_data.rid IS NULL OR usr_data.rid = '';" 93 $d = $this->helper->getDatabase()->fetchObject(
$r);
95 return (
int)
$d->amount;
getPreconditions(Environment $environment)
prepare(Environment $environment)
getDefaultAmountOfStepsPerRun()
ilResourceStorageMigrationHelper $helper
step(Environment $environment)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
An environment holds resources to be used in the setup process.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getRemainingAmountOfSteps()