[Vtigercrm-developers] Vtiger Class Loader?

Hamono, Chris (DPC) Chris.Hamono at sa.gov.au
Mon Jul 13 23:45:40 GMT 2015


Thanks Blazej

Vtigers embedded “new self()” calls prevent a psr-4 compliant autoloader from working as the loader will not be called when instantiating the class

Chris

From: vtigercrm-developers-bounces at lists.vtigercrm.com [mailto:vtigercrm-developers-bounces at lists.vtigercrm.com] On Behalf Of Blazej Pabiszczak
Sent: Monday, 13 July 2015 6:42 PM
To: vtigercrm-developers at lists.vtigercrm.com
Subject: Re: [Vtigercrm-developers] Vtiger Class Loader?


http://www.php-fig.org/psr/psr-4/
---
Z poważaniem / Regards

Błażej Pabiszczak
Chief Executive Officer
M: +48.884999123
E: b.pabiszczak at yetiforce.com<mailto:b.pabiszczak at yetiforce.com>
________________________________

We created an innovative open source project called YetiForceCRM. You can test it here<https://test.yetiforce.com>, download<https://github.com/YetiForceCompany/YetiForceCRM> it for free or read its documentation<https://yetiforce.com/en/documentation.html>. Follow us on Twitter<https://twitter.com/YetiForceEN> to get real-time info about new functionalities and articles.



W dniu 2015-07-13 10:11, Joe Bordes napisał(a):
You may be interested in aspect oriented programming. Search for it in Google, there is a lot of information and there are some very good libraries already implemented for PHP and Javascript.

HTH
Joe
TSolucio


El 13/⁠07/⁠15 a las 08:46, Hamono, Chris (DPC) escribió:
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> [mailto: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<mailto: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/

_______________________________________________
http://www.vtiger.com/

_______________________________________________
http://www.vtiger.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20150714/7ca719df/attachment-0001.html>


More information about the vtigercrm-developers mailing list