[TYPO3-caretaker] extending Remote Operation

Oliver Krause krause at network.publishing.de
Thu Sep 9 16:40:57 CEST 2010


Am 09.09.2010 12:34, schrieb Martin Ficzel:
> Am 08.09.10 10:42, schrieb Oliver Krause:
>> Hi,
>>
>> thank you again for this wonderful caretake project. We updated our
>> servers last week and
>> are now almost complete green with core and extension versions for all
>> our customer sites!
>> Without the caretaker support it would have been a toture!
>>
>> I'm currently writing a new test to find all locally changed
>> extensions and noticing that
>> the remote Operation 'GetExtensionList' gives me nearly all
>> information I need but misses
>> the MD5 hashs.
>>
>> It is only one additional line in the file
>> class.tx_caretakerinstance_Operation_GetExtensionList.php
>>
>> to bring it to work. Just add in line 107
>> $extensionInfo[$extKey]['_md5_values_when_last_written'] =
>> $EM_CONF[$extKey]['_md5_values_when_last_written'];
>>
>> My question is:
>> Is it better to write an own operation extension or can you adopt it
>> in your file? I know
>> you're trying to keep the system lean, so I can understand if you're
>> rejecting it.
>>
>> Maybe it can be useful to introduce a new parameter key
>> 'additionalEmConfKeys' where you
>> can retrieve user-specified Information about the extensions.
>> If you find that useful I can send you the implementation in no time...
>
>
> Hi Olli,
>
> i like your proposal but i would suggest to handle it a bit different.
>
> 1. What you suggest is that we only request the md5 info from the
> extension info. That gives not much information. I would suggest to
> calculate the md5 of the extension folder instead. The TER stores an md5
> valueof the t3x file for each extension and so we should do the same.
> That would allow the caretaker server to compare this md5 with the info
> from ter.
>
> 2. There is already an InstanceOperation getFilesystemChecksum which
> takes a file or folder and returns an md5 value. The only Problem is
> that this value is different from the t3xmd5 which is included in the
> TER-DB.
>
> Possible solutions would be to add a new instanceOperation
> getFilesystemT3xChecksum. I do'nt recommend to add this information
> directly to the getExtensionList-Opereation since this feature will be
> quite expensive. Afterwards it is quite simple to create a test on which
> requests all t3xmd5 values of the extension and compares them with the
> ter-values.
>
> Regards Martin

Hi Martin,

thanks a lot for your answer.

I was thinking about a valid data source for the untouched md5 value. 
The t3xmd5 from TER could be a solution. I'm actually batteling with 
performance problems since a full md5 test for all extension files (with 
the remote operation from the instance) takes too long, even for a 
single site with few MVC extensions... But I assume the t3x compression 
will be expensive too.

I started thinking about a shell script that creates the hashes nightly 
and stores them in a file inside the extension directory. If nobody 
touches the md5 values inside the EMCONF that should work. Maybe I can 
register a post-install hook in the extension manager for creating an 
original-hash file too.
I can request these files in an own remote operation afterwards.

BTW:
During the development I changed the 'GetExtensionList' Operation in a 
way that retrievs arbitrary information from the ext_emconf.php file by 
calling an additional parameter with a list of additional array keys.

$operations[] = array(
   'GetExtensionList',
   array(
     'locations' => array('local'),
     'additionalEmConfKeys' => 'author,_md5_values_when_last_written',
   )
);

Are you interested in that modification? It is fully backward compatible.

Regards,
Olli


More information about the TYPO3-project-caretaker mailing list