Post by straightlight » Fri Nov 02, 2012 9:02 pm

This override engine has the capability for several independent addons to modify the same core method or template.
The completed sentence would be: This override engine has the capability for several independent addons to modify the same core method or template over one single controller, language, model and templates for all the authors and no matter how many distributions which creates the conflicts between distributions.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com contractor officials representative


Administrator

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by JNeuhoff » Sat Nov 03, 2012 1:51 am

straightlight, your statements are getting more and more confusing. If you think neither the Override Engine nor VQmod is the right solution for your purposes, why don't you write up your own demo of what you have in mind, and present it to the OpenCart project?

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by straightlight » Sat Nov 03, 2012 5:37 am

My previous points aren't about the right solution for my purposes, it is rather about those thousands of users who spent their money over contributions, and no matter the price range, hoping these distributions would not only work upon each new OpenCart releases but also amongst other contributions which must be ran with.

So far, analytically speaking / typing, place it the way you want; very few contributions were able to run with no revisions involved regarding those factors and clients who, according to their complaints, most of the time justifies these behaviors as bugs while keeping running those contribution on a previous installation of OpenCart seem to work just fine though.

Rather than requesting / hoping / justify / commenting on the market for troubleshooting issues while these statements can be done on the forum either on PM or public thread (when available, if not then PM) anyhow, then simply to assemble the pieces together from what has already been built in the past. VQMod, idealistically, is a good idea which I never implied otherwise except the fact that the same lines between authors can be confronted and can result catastrophe to a store or to its database and the same for this modified engine which, still, is a great idea. As a PHP Guru, I was indeed amazed by this modification and even pointed out from the previous page of this topic regarding my satisfaction - idealistically.

Rather than re-inventing the wheel and hoping for someone else to do the work, a simpler question could be brought in mind: "why not integrate the idea instead rather than having to re-invent the wheel from scratch ?" and to focus on the objective that has been provided on my earlier replies ?

For instance, regarding the token. The reason why this methodology exists is not only because certified programmers (including PHP) are already aware of this but also because of the thousands of integration upon a platform that can be involved. Linux / UNIX, Visual Studio, Java and even PHP. All these languages uses a token ? Why, so that each files created from compilers can remain unique of their kind and to avoid confrontation on one modification to another. This methodology has been used since more than 20 years already. If you believe tokens are useless, especially in this case, why not ask those millions of programmers who had to do this in the past especially for OSes ?

If we take an example at the CURL / Auth v2.0. Why is there an authentication process (and most of the time not a single process but three process to follow) before validating a user ? Why is this random string in HMAC either needs to be sent with SHA1 or SHA256 to generate a signature ? Why are they dynamic rather than remaining permanent ?

All these aspects are there for a reason and this reason why similarity of these features should also be added in VQMod or on a modified engine - period; in order to separate each authors with their distributions - the way it's supposed to be !

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com contractor officials representative


Administrator

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by JNeuhoff » Sat Nov 03, 2012 5:55 am

Rather than re-inventing the wheel and hoping for someone else to do the work, a simpler question could be brought in mind: "why not integrate the idea instead rather than having to re-invent the wheel from scratch ?"
Fair enough. But as I said, I really struggle to understand your ideas on improving the way addons can modify core templates in an override system. Maybe you or someone else can improve this existing override engine, or the existing vqmod, and present it to the OpenCart project.

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by straightlight » Sat Nov 03, 2012 6:33 am

Your module can already be extended by authors as cached files.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com contractor officials representative


Administrator

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by JNeuhoff » Sun Nov 04, 2012 3:28 am

Just uploaded an update of the Override Engine with some bugfixes in:

system/engine/factory.php
system/library/variable_stream.php

Please re-install if you use the Override Engine.

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by icedlava » Sun Nov 04, 2012 7:26 pm

Just uploaded an update of the Override Engine
Thanks JNeuhoff, this override engine is exactly what i was looking for! It's something that should be in the core opencart. I can now convert my various system file changes to use this!

Newbie

Posts

Joined
Sun Feb 05, 2012 9:53 pm

Post by sv2109 » Mon Nov 05, 2012 4:26 am

Hi guys. I am from Ukraine and my english is very bad, but i hope you will understand me.
I downloaded this module and installed it. Yes, it is working! But i don't like it. I explain. In first, template override. It use helper Modifier with modify template using string functions and position: 'before', 'after', 'replace', 'top', 'bottom', or 'all'.. It exactly like vqmod, only have another realisation.
2. Classes override. If overrides 1 class, all is ok. But if overrides more then 1 class.. again use a string functions! Look on method modifyParrent in Factory class. It load a class file with file_get_contents function, after that modify text of this class with string function, write result to stream and include it (something similar to eval function). I didn't see something like that in no one system what i worked. And i think it is wrong and very bad programming approach use string functionts for classes extending. Sorry JNeuhoff you did big work but it is my opinion.

Opencart must have overriden system, but it must be one level override like in CodeIgniter (http://codeigniter.com/user_guide/gener ... asses.html) without modify core code using string functions.
For module override more better use hook system like in Drupal (http://api.drupal.org/api/drupal/includ ... up/hooks/7) or event system like in Symfony (http://symfony.com/doc/2.0/components/e ... ction.html). Yes this is some more complex but more right way. It can not be wrong, because this approach use such monsters like Drupal and Sypfony.

Sorry again for my english.

My php is more better than my english.

You can find my Extensions here.


User avatar
Newbie

Posts

Joined
Sun Nov 04, 2012 6:10 am
Location - Ukraine

Post by JNeuhoff » Mon Nov 05, 2012 11:39 pm

sv2109 wrote:Hi guys. I am from Ukraine and my english is very bad, but i hope you will understand me.
I downloaded this module and installed it. Yes, it is working! But i don't like it. I explain. In first, template override. It use helper Modifier with modify template using string functions and position: 'before', 'after', 'replace', 'top', 'bottom', or 'all'.. It exactly like vqmod, only have another realisation.
2. Classes override. If overrides 1 class, all is ok. But if overrides more then 1 class.. again use a string functions! Look on method modifyParrent in Factory class. It load a class file with file_get_contents function, after that modify text of this class with string function, write result to stream and include it (something similar to eval function). I didn't see something like that in no one system what i worked. And i think it is wrong and very bad programming approach use string functionts for classes extending. Sorry JNeuhoff you did big work but it is my opinion.

Opencart must have overriden system, but it must be one level override like in CodeIgniter (http://codeigniter.com/user_guide/gener ... asses.html) without modify core code using string functions.
For module override more better use hook system like in Drupal (http://api.drupal.org/api/drupal/includ ... up/hooks/7) or event system like in Symfony (http://symfony.com/doc/2.0/components/e ... ction.html). Yes this is some more complex but more right way. It can not be wrong, because this approach use such monsters like Drupal and Sypfony.

Sorry again for my english.
About template modifications: You don't have to use Modifier, quite often simple str_replace() calls will do the job, the system/helper/modifier.php is just there to make life a little bit easier.

As regards chained class extensions: I looked at many different PHP event listeners, observer patterns, and AOP, and IMHO none of the available alternatives offers a simple and elegant solution. CodeIgnitor is not a good example at all, it's only a simple 1-level ovrride, similar to what Kohana does. The latter offers no solution to the need to have multiple addons modify the same OpenCart core method.

I think you do not understand the concept of the dynamic chain of class extensions. You need to look beyond the limited world of old PHP design patterns where none of them offers a satisfactory solution to the need where several addons have to modify or add functionality to OpenCart core methods without modifying the core files.

None of your listed alternatives offers a solution. Look at Kohana: basically just a whole-file override using PHP's __autoload. Or Drupal: A poor implementation of the mediator design pattern, not what we need for our purposes. Or Symfony: Again just another mediator design pattern for its so-called hooks. I could have opted for a decorator design pattern which would use dynamically nested decorator wrapups of the original core class (and might add it in the next version of the override engine), still not as powerful as the dynamic chain of class extensions.

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by JNeuhoff » Thu Nov 22, 2012 9:49 pm

Qphoria wrote:
JNeuhoff wrote: You are really trying to make my life miserable here ???

Well, Rome wasn't built in a day. :) My Override Engine may need some more refinement to cater for all these crazy cases, you got me there ;D
LOL I just wanted to press a little... maybe for being a bit dismissive of vQmod :)
Granted your way is indeed a much better programmatic way of proper modification. vQmod is just that little hack engine that could.
You might want to study this worst-case scenario example of how the Override Engine can cope even with tricky modifications. This example also highlights some problems with the OpenCart 1.5.4.1 core: Namely, some of the core methods, especially the ones for validation (e.g. validate, validateForm etc) should really be declared as protected, not private, to make them overridable in class extensions. Would make life a lot easier for validating newly introduced form fields from addons!

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by JNeuhoff » Sun Dec 30, 2012 12:57 am

We have now released the Override Engine for OpenCart 1.5.5. Though OpenCart 1.5.5 hasn't yet been released by Daniel at the time of this writing, he has already fixed most bugs and I expect him to release the new OpenCart 1.5.5 soon, without introducing any major changes till then. This should give you a chance to port your addons to the upcoming OpenCart 1.5.5 now.

Notice that you can now override many more methods in 1.5.5, compared to 1.5.4, in extended core classes because many methods which used to be declared as private are now declared as protected.

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by straightlight » Sun Dec 30, 2012 1:30 am

This new version of yours may become handy even though there might be a few subjects to re-work on. For instance, the usage of $GLOBALS from variable_stream.php wouldn't be the best recommended approach. The new DB tracking from the engine which this methodology would only allow one DB at a time to be tracked only rather than multiple databases the way I did it with the PDO Extension library. Additionally, the way to override inside the override folder has a bit too many folders to re-write on.

Other than those mentioned, looks quite interesting to use though. Although, I haven't officially tried anything on it so far.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com contractor officials representative


Administrator

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by JNeuhoff » Wed Jan 02, 2013 9:08 pm

straightlight wrote:This new version of yours may become handy even though there might be a few subjects to re-work on. For instance, the usage of $GLOBALS from variable_stream.php wouldn't be the best recommended approach. The new DB tracking from the engine which this methodology would only allow one DB at a time to be tracked only rather than multiple databases the way I did it with the PDO Extension library. Additionally, the way to override inside the override folder has a bit too many folders to re-write on.

Other than those mentioned, looks quite interesting to use though. Although, I haven't officially tried anything on it so far.
As I said weeks ago, why don't you create an improved version of what you have in mind, and present it to the OpenCart project as a free GPL release?

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by straightlight » Wed Jan 02, 2013 10:45 pm

Already did.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com contractor officials representative


Administrator

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by JNeuhoff » Wed Jan 02, 2013 11:07 pm

straightlight wrote:Already did.
URL please? Where in OpenCart extensions?

UPDATE: 2 weeks later, and still no reply from straightlight, I think his improved version simply doesn't exist :)

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by nsnaveen » Thu Feb 21, 2013 4:43 am

I installed the opencart-1-5-4-x-override-engine-5-1 as said. but after installing whn i open admin iam getting this error

Notice: Cannot find controller class file for route 'common/maintenance' in /home/isdccom/public_html/naudidhi2/system/engine/factory.php on line 155

can any one help me please.

thanks in advance
nsnaveen

Newbie

Posts

Joined
Wed Aug 15, 2012 1:14 am

Post by JedAronson » Thu Feb 21, 2013 10:38 am

Hi there, I'm having a problem after upgrading both OC and the override engine to v1.5.5.1. During checkout, when I try to confirm a cc order (using pp_pro), the order is processed, but it stays on the checkout page (i.e. doesn't go to success page). I found that the POST request was causing this error: "Fatal error: Call to undefined method Factory::newTemplate() in /home/content/23/9882523/html/catalog/model/checkout/order.php on line 282". I checked, and sure enough that method doesn't exist. I've tripled check that I have the latest version of the engine. Is there something obvious I'm missing? My site is not live yet, so it's not an emergency or anything. I'm just at a loss.

thanks in advance.
-jed

edit: OK, it was a pretty easy workaround, actually. I just changed the call to Factory::newTemplate() back to the normal (non-Factory) constructor. I also had to do the same thing for Factory::newMail(). But I still don't know why the download didn't have those functions- since no one else seems to have mentioned it, I'm worried I did something stupid.
Last edited by JedAronson on Fri Feb 22, 2013 12:05 pm, edited 1 time in total.

Newbie

Posts

Joined
Thu Feb 21, 2013 10:23 am

Post by JNeuhoff » Thu Feb 21, 2013 9:45 pm

nsnaveen wrote:I installed the opencart-1-5-4-x-override-engine-5-1 as said. but after installing whn i open admin iam getting this error

Notice: Cannot find controller class file for route 'common/maintenance' in /home/isdccom/public_html/naudidhi2/system/engine/factory.php on line 155

can any one help me please.

thanks in advance
nsnaveen
Please check your system/logs/error.txt for any further clues as to why it might not work. Also check your server's error_log.

Also make sure the file /home/isdccom/public_html/naudidhi2/catalog/controller/common/maintenance.php actually exists. Also, have you extended this class and overridden some of its methods for an addon?

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Qphoria » Fri Feb 22, 2013 4:06 am

I really didn't follow much of that either straightlight.

It sounds like you are slamming vQmod.. but want this to be more like vQmod or for vQmod to start some new trend where multiple copies of the vqcache files are saved, one per author?

So if I understand you want this:

if 2 people have a mod that alters the header.php
then we should have 3 total files
vq2-final-catalog_controller_common_header.php
vq2-author1-catalog_controller_common_header.php
vq2-author2-catalog_controller_common_header.php

where the "final" is the merging of all author subfiles, but the subfiles are separated for easier tracking of problems to see how each individual one makes changes? Is that what you are saying?

Keep in mind I do not want to hijack JN's thread here so if this turns into vQmod suggestions I will move it to its own vqmod discussion area, but maybe if explained in terms of vQmod it will make more sense since most of what you are comparing this engine to is vQmod.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 8 guests