ILIAS  release_8 Revision v8.24
ilBibliographicStorageMigration Class Reference

Class ilBibliographicStorageMigration. More...

+ Inheritance diagram for ilBibliographicStorageMigration:
+ Collaboration diagram for ilBibliographicStorageMigration:

Public Member Functions

 getLabel ()
 @inheritDoc More...
 
 getDefaultAmountOfStepsPerRun ()
 @inheritDoc More...
 
 getPreconditions (Environment $environment)
 @inheritDoc More...
 
 prepare (Environment $environment)
 @inheritDoc More...
 
 step (Environment $environment)
 @inheritDoc More...
 
 getRemainingAmountOfSteps ()
 @inheritDoc More...
 

Protected Attributes

ilResourceStorageMigrationHelper $helper
 

Detailed Description

Member Function Documentation

◆ getDefaultAmountOfStepsPerRun()

ilBibliographicStorageMigration::getDefaultAmountOfStepsPerRun ( )

@inheritDoc

Definition at line 42 of file class.ilBibliographicStorageMigration.php.

42 : int
43 {
44 return 10000;
45 }

◆ getLabel()

ilBibliographicStorageMigration::getLabel ( )

@inheritDoc

Definition at line 34 of file class.ilBibliographicStorageMigration.php.

34 : string
35 {
36 return "Migration of Bibliographies to the Resource Storage Service.";
37 }

◆ getPreconditions()

ilBibliographicStorageMigration::getPreconditions ( Environment  $environment)

@inheritDoc

Definition at line 50 of file class.ilBibliographicStorageMigration.php.

References ilResourceStorageMigrationHelper\getPreconditions().

+ Here is the call graph for this function:

◆ getRemainingAmountOfSteps()

ilBibliographicStorageMigration::getRemainingAmountOfSteps ( )

@inheritDoc

Definition at line 97 of file class.ilBibliographicStorageMigration.php.

97 : int
98 {
99 $r = $this->helper->getDatabase()->query("SELECT COUNT(*) AS amount FROM il_bibl_data WHERE rid IS NULL OR rid = ''");
100 $d = $this->helper->getDatabase()->fetchObject($r);
101
102 return (int) $d->amount;
103 }
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296

References $d.

◆ prepare()

ilBibliographicStorageMigration::prepare ( Environment  $environment)

@inheritDoc

Definition at line 58 of file class.ilBibliographicStorageMigration.php.

58 : void
59 {
60 $this->helper = new ilResourceStorageMigrationHelper(
62 $environment
63 );
64 }
Class ilObjBibliographicStakeholder.

◆ step()

ilBibliographicStorageMigration::step ( Environment  $environment)

@inheritDoc

Definition at line 69 of file class.ilBibliographicStorageMigration.php.

69 : void
70 {
71 $r = $this->helper->getDatabase()->query("SELECT * FROM il_bibl_data
72 JOIN object_data ON object_data.obj_id = il_bibl_data.id
73 WHERE rid IS NULL LIMIT 1");
74 $d = $this->helper->getDatabase()->fetchObject($r);
75
76 $file_path = $this->helper->getClientDataDir() . '/' . ilBibliographicSetupAgent::COMPONENT_DIR . '/' . $d->id . '/' . $d->filename;
77 $identification = $this->helper->movePathToStorage($file_path, (int) $d->owner);
78 if ($identification === null) {
79 $identification = 'failed';
80 } else {
81 $identification = $identification->serialize();
82 }
83
84 $this->helper->getDatabase()->manipulateF(
85 'UPDATE `il_bibl_data` SET `rid` = %s WHERE `id` = %s;',
86 ['text', 'integer'],
87 [
88 $identification,
89 $d->id,
90 ]
91 );
92 }

References $d, and ilBibliographicSetupAgent\COMPONENT_DIR.

Field Documentation

◆ $helper

ilResourceStorageMigrationHelper ilBibliographicStorageMigration::$helper
protected

Definition at line 29 of file class.ilBibliographicStorageMigration.php.


The documentation for this class was generated from the following file: