Oxutisfile override

Hi,

I want to provide upload picture option in manufacturer admin area,
Now as per default structure it is taking file upload path from oxutisfile.php file with prefix like TC, MICO etc.
I would like to override this oxutisfile.php file to add one more prefix like MTH for manufacturer thumb, but i can’t override it.
I have checked http://wiki.oxidforge.org/Tutorials/List_of_not_overloadable_classes here but this class is not listed in not overloadable class.

So can anyone let me know how i can override it…?

Thanks

My WBL_Autoloader provides a API to override core files. Probably this could help you.

[QUOTE=WBL_BjoernLange;95975]My WBL_Autoloader provides a API to override core files. Probably this could help you.[/QUOTE]

Thanks for the reply.

Here, I would like to override this using module define in admin.
Like oxutilsfile => mymodule/myutilsfile

Is there anyway to override like this…?

look here https://bugs.oxid-esales.com/view.php?id=3685

[QUOTE=leofonic;95989]look here https://bugs.oxid-esales.com/view.php?id=3685[/QUOTE]

Thanks leofonic,

I think oxutilsfile can be overloaded if this is added to config.inc.php:
//Load Modules
include getShopBasePath().'core/oxconfk.php';
$this->_loadVarsFromDb( $this->getShopId(), array('aModules') ); 

This does the trick.

check here as well:

[QUOTE=hardikbadani;96020]Thanks leofonic,

I think oxutilsfile can be overloaded if this is added to config.inc.php:
//Load Modules
include getShopBasePath().'core/oxconfk.php';
$this->_loadVarsFromDb( $this->getShopId(), array('aModules') ); 

This does the trick.[/QUOTE]

[QUOTE=Hebsacker;96022]check here as well:

And both tricks are done with my autoloader with a nice api :wink: and only loaded if the class is used.

http://ecommerce-developer.de/jetzt-auf-github-fortsetzung-fur-den-wbl-autoloader/ shows the example for using WBL_Modules_Autoloader::addCoreOverride(‘originalclass’, ‘moduleclass’).


<?php
   // functions.php seit OXID 4.6 
   require_once realpath(dirname(__FILE__) . '/WBL/Modules/Autoloader.php');
   $oAutoloader = new WBL_Modules_Autoloader();

   spl_autoload_register(array(
       $oAutoloader
           ->addCoreOverride('oxutilsobject', 'WBL_Modules_UtilsObject')
           ->setAutoloaderNamespaces(array('WBL')),
       'includeClass'
   ));
   unset($oAutoloader);
?>

I added the link to the autoloader (at Github) to the wiki article. I had a look at it, main advantage should be that instead of

efi_FactFinder/efi_FactFinder_Search 

one could just use

efi_FactFinder_Search

. With the paths being in metadata.php now, can the autoloader handle paths also, and what is the advantage of using the autoloader?

please stick to english language in international forums part - or open a new thread in german part about the functionality of the wbl-autoloader

[QUOTE=leofonic;96045]I added the link to the autoloader (at Github) to the wiki article. I had a look at it, main advantage should be that instead of

efi_FactFinder/efi_FactFinder_Search 

one could just use

efi_FactFinder_Search

. With the paths being in metadata.php now, can the autoloader handle paths also, and what is the advantage of using the autoloader?[/QUOTE]

There is no redundancy meddling with paths?! I described the benefits on my blog. There is no need to create unique class names and save their paths redundantly. The advantage got smaller with oxid 4.6, yes, but is still there. The autoloader is used since 4.3.

AND, as said before, there is an api for overriding core files now without changing a core file or changing the config dirty.