[TYPO3-core] RFC: #13697: Add possibility to retrieve extension version

Oliver Hader oliver at typo3.org
Fri Mar 26 23:09:40 CET 2010


Hi,

Am 25.03.10 14:04, schrieb Oliver Klee:
> Hi,
> 
> Tolleiv Nietsch schrieb:
>> I know that
>> throwing exceptions is a powerful tool in certain cases, but within the
>> localconf.php context I'd prefer not to have exceptions since this might
>> break complete installations just because someone uninstalled a certain
>> extension.
> 
> I've attached an updated patch with the following changes:
> 
> - return an empty string instead of throwing an exception if the
> extension is not installed
> - drop the $GLOBAL (it wasn't actually necessary)
> 
> The function still throws an exception if $key is empty because this can
> only happen if the function is called with a wrong parameter (which is a
> coding error which the developer should be made aware of).

I modified the stuff a bit (see attached patch):
* change the unit tests to use a dataProvider
* added some more negative tests fors objects, booleans, integers (would
have been possible with the last patch as value for $key)
* changed to use InvalidArgumentException instead of t3lib_exception
since it is a common SPL exception and tells something more about the
real problem

Besides that: +1 by reading and testing

olly
-- 
Oliver Hader
TYPO3 v4 Core Team Leader
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0013697_v3.patch
Type: text/x-patch
Size: 3902 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100326/afa51a7f/attachment.bin>


More information about the TYPO3-team-core mailing list