[Vtigercrm-developers] Vtiger Class Loader?
Hamono, Chris (DPC)
Chris.Hamono at sa.gov.au
Mon Jul 13 06:46:48 GMT 2015
I was thinking about this request because I'd like to be able to override built in (core) classes to extend their functionality.
I know this is not your specific use case but I thought I'd make the point vtiger extensively uses "new self()" within static functions
This means even if you replaced the current loader with a new loader that created a custom class most of the time the parent class will be created and your code never called.
More is the pity. I saw this as a possible way to shortcut the creation of custom classes where you want to slightly manipulate functionality rather than recreate it.
Chris
-----Original Message-----
From: vtigercrm-developers-bounces at lists.vtigercrm.com [mailto:vtigercrm-developers-bounces at lists.vtigercrm.com] On Behalf Of Alan Lord
Sent: Thursday, 18 June 2015 12:21 AM
To: vtigercrm-developers at lists.vtigercrm.com
Subject: [Vtigercrm-developers] Vtiger Class Loader?
I might have a need to have an Autoloader within a custom module so my code can find a bunch of class files in an included library of php code.
So for example my tree would like like
/modules/LSCustomModule/{models,actions,resources,libraries} etc.
In the model I would need to use code that is in an associated library (built to use any PSR-0 compliant autoloader) under my "libraries"
directory.
I don't think the in-built Vtiger_Loader is going to suffice is it because the paths will be all wrong...?
Would I need to I register my own Autoloader as part of the initialisation of my model? Could I override the Vtiger_Loader?
Suggestions welcome ;-)
Thanks
Al
_______________________________________________
http://www.vtiger.com/
More information about the vtigercrm-developers
mailing list