Post by James » Sat Aug 09, 2014 3:53 am

Could you just imagine.....

"composer update" - and everything is updated

We can always dream lol

I got introduced to composer about 6 months ago, never looked back..

User avatar
Active Member

Posts

Joined
Wed May 27, 2009 6:07 am
Location - Leeds, UK

Post by i2Paq » Sat Aug 09, 2014 5:25 am

I was like "FTW? Did I start a topic about OC 2.0 and vQmod?" 'When did that happened, while I was drunk?" :drunk:

Anyways, I'm out of this discussion.

I'm fed up with these kind of decisions/discusions.

First the language fallback was removed, without any discussion; then a certain hook was removed and all extensions where useless, without any discussion.

And now OCMod but not vQmod?

What kind of planning or "ahead" thinking is this? :choke:

I'm surprised there is even an "alpha" release.

I'm not attacking anyone, but why in God's name do we have the same crap every release.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by dmsims » Sat Aug 09, 2014 7:56 pm

What do you expect ?

I was very surprised on the VQmod for 2 to see no discussion
Qphoria wrote:
dmsims wrote:Why is Daniel not contributing to this thread?
Why would he? He has his own built in "ocmod" script in 2.0 and he has nothing to do with 3rd party mods.

Active Member

Posts

Joined
Sat Apr 13, 2013 6:05 pm

Post by rph » Sun Aug 10, 2014 10:33 am

James wrote:I got introduced to composer about 6 months ago, never looked back..
It's amazing the tools we have now. Composer + Packigist for libraries, GitHub and Bitbucket for version control, PHPStorm and Netbeans for IDEs, the widespread adoption of unit testing. OpenCart was cutting edge when it came out five years ago but a lot has changed since then. 2.0 would have been a good opportunity to do some reassessment.

Certainly things like templating and a modding system have a widespread impact on designers and developers (and by extension OpenCart's business model). A bit of discussion would have been nice. But i2Paq is dead on. The community is regularly forced into a position of being reactive rather than proactive. I know I complained a lot about 1.5.6, which was unfair to you. It was another one of those surprise releases where the only thing the community could do is react. Having to hear about some change from a client or a question about an extension is never fun.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by dabomb59404 » Sun Aug 10, 2014 6:51 pm

rph wrote:
dabomb59404 wrote:imho vQmod and vQmod Manager should both be integrated into 2.0
It looks like OC 2.0 will have a more robust system than vQmod Manager though I haven't had time to check it out.

I'm gonna be odd man out and say I'd rather neither vQmod nor OCMod were integrated. Leave vQmod as an add-on and have the OpenCart core concentrate on expanding the Events system.
If that more robust system works for vQmod and is at least as good as vQmod Manager is then great but if it is a poor mans version of it like ocmod is to vQmod then it makes more sense to have it instead just like it makes more sense to have vQmod instead of ocmod. Whether they are integrated or not if they are better options than what is included in OC they will be the ones used. Right now they are the most needed and must have addons and the reasons to have them both integrated is simply for convenience and to save time as when you do hundreds of OC installations it would be nice not to have to install them separately. Also for extension developers it would be nice not to have to keep stating "You must have vQmod installed to use this extension" and to constantly keep asking "Do you have vQmod installed" when asked for support.

User avatar
Active Member

Posts

Joined
Thu Jun 09, 2011 5:21 am

Post by Daniel » Tue Aug 12, 2014 12:29 am

There are not 3 engines!

vqmod is not going to be included in 2.0 and the events system is not a modification system a it does not modify files.

I'm not using vqmod for the simple reason its overly complex and has to many features.

ocmod is simple to use by just have a search and replace, insert before, insert after, offset, limit and regex.

Extension developers need to get used to ocmod instead of complaining that they will have to rewrite there mods. They will need to rewrite the mods any way since 2.0 has a lot of changes.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by James » Tue Aug 12, 2014 1:49 am

rph wrote:
James wrote:I got introduced to composer about 6 months ago, never looked back..
It's amazing the tools we have now. Composer + Packigist for libraries, GitHub and Bitbucket for version control, PHPStorm and Netbeans for IDEs, the widespread adoption of unit testing. OpenCart was cutting edge when it came out five years ago but a lot has changed since then. 2.0 would have been a good opportunity to do some reassessment.
I was with you until you mentioned Netbeans lol - sluggish Java sh*t! PHP Storm is awesome though - shame about the price tag but worth it...the guys here like Sublime too.

The downside to re-writing the whole of OC to newer OOP practices is that you would loose many of it's followers, most seem to like the framework as it is not a suite of bloat like Symfony or Zend (or a very dated, hacked version of Zend AKA Magento - might have changed now but not checked). Personally I am getting used to things like "use file/class" in classes and the benefit of composer to install dependent libs, it just doesn't 'fit' in the OC project without starting again (then all devs would be moaning about re-writing new extensions!). Not to mention that changing code for the sake of it is kind of pointless, it is not like its procedural after all.
The community is regularly forced into a position of being reactive rather than proactive. I know I complained a lot about 1.5.6, which was unfair to you. It was another one of those surprise releases where the only thing the community could do is react. Having to hear about some change from a client or a question about an extension is never fun.
And that is the reason behind the planned timeline, alpha and beta release (not to mention sorting out issues BEFORE release!) - I remember speaking in the internal forum a while back about that and hopefully everyone realises now things are at the very least improving to help you and us. I think having dates that everyone including you, Daniel, myself and anyone else can work with gives people a target and at least knows at that time stuff needs to be done. Still, perfection is a long way away but as said before, suggestions are listened to to help improve everything.
First the language fallback was removed, without any discussion; then a certain hook was removed and all extensions where useless, without any discussion.

And now OCMod but not vQmod?

What kind of planning or "ahead" thinking is this? :choke:

I'm surprised there is even an "alpha" release.

I'm not attacking anyone, but why in God's name do we have the same crap every release.
OCmod isn't a last minute addition, its been on the master for well over a year - pretty well planned ahead of this release...

What hook do you mean?

This release is way more managed, we are after all taking about things before (not after) the release :)
vqmod is not going to be included in 2.0 and the events system is not and modification system a it does not modify files.
I think Daniel means; vqmod is not going to be included, ocmod is staying. The events system is going to be included, but this is NOT a file modification system - it just triggers calls to your own code methods before and after something "happens".

IMO (looking at our own extensions) about 30-50% of our current vqmod scripts could use the Event system - this would without question be better for compatibility for other modules since nothing would be fighting for code changes.

FYI anyone developing right now for the events might need to change some of the event names - they are being updated to be more consistent with method names (admin_product_add will be pre_admin_add_product and post_admin_add_product), everything is now consistent with add,edit,delete,copy (not insert,update etc). I'll have this patch done in a day or so.

So hopefully this issue is now cleared up, it might not be what everyone wants but this will be what is happening for 2.0. If you need any help developing your mods with the Event system feel free to PM me - I'll help with what I can.

J

User avatar
Active Member

Posts

Joined
Wed May 27, 2009 6:07 am
Location - Leeds, UK

Post by JNeuhoff » Tue Aug 12, 2014 6:16 am

Daniel wrote: ocmod is simple to use by just have a search and replace, insert before, insert after, offset, limit and regex.
I think users have some valid concerns as regards vqmod versus ocmod:
- OCmod has no line-based attributes similar to VQmod's index and offset
- OCmod unnecessarily uses a different XML syntax compared to VQmod
- both OCmod and VQmod have weaknesses: they rely on source code matches

Using event handlers (for pre-defined hooks in the model classes) is a promising start.
Event hooks should also be introduced for the controller methods, and for loading the view.

IMHO the best way still is to use class extensions with overridden methods for changing core classes.

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
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Cue4cheap » Tue Aug 12, 2014 8:42 am

Daniel wrote:ocmod is simple to use by just have a search and replace, insert before, insert after, offset, limit and regex.

Extension developers need to get used to ocmod instead of complaining that they will have to rewrite there mods. They will need to rewrite the mods any way since 2.0 has a lot of changes.
I just hope it is as easy as VQmod. I am by far not a programmer (or at least a good one) but I was able to figure out VQmod in seconds.

If ocmod is as simple and useful then I guess we press on with a slight learning curve....

Mike

cue4cheap not cheap quality


Active Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by Daniel » Tue Aug 12, 2014 6:45 pm

JNeuhoff,

"- OCmod has no line-based attributes similar to VQmod's index and offset"

Does not need it! finding and replacing parts of code using line based approch is wrong! lines where parts of code start may change depending on what modifications the user has made.

"- OCmod unnecessarily uses a different XML syntax compared to VQmod"

Yes because its not the same, I woudl say my version puts the xml attributes in the right place.

"- both OCmod and VQmod have weaknesses: they rely on source code matches"

If you have ever looked at oscommerce mods from years ago they gave install instructions using find {code} replace with, insert before, insert after after 10th find. they did not use line numbers to say where to add code because they new the line numbers can change.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by JNeuhoff » Tue Aug 12, 2014 10:12 pm

Maybe I underestimate OCmod's capabilities.

I have VQmod's for which I haven't yet figured out how to do them in OCmod.

For examples, suppose I wanted to insert another <tr>-element between 2 existing <tr> elements in the product_form.tpl, e.g. between the

Code: Select all

            <tr>
              <td><?php echo $entry_location; ?></td>
              <td><input type="text" name="location" value="<?php echo $location; ?>" /></td>
            </tr>
            <tr>
              <td><?php echo $entry_price; ?></td>
              <td><input type="text" name="price" value="<?php echo $price; ?>" /></td>
            </tr>
In VQmod, I'd search for the line containing '<input type="text" name="location" value="<?php echo $location; ?>" />', and thenn use offset="1", to skip the </tr>, and then insert my new lines. How would you do that in OCmod when it is not line-based?

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
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by OSWorX » Wed Aug 13, 2014 1:55 am

JNeuhoff wrote:Maybe I underestimate OCmod's capabilities.

I have VQmod's for which I haven't yet figured out how to do them in OCmod.

For examples, suppose I wanted to insert another <tr>-element between 2 existing <tr> elements in the product_form.tpl, e.g. between the

Code: Select all

            <tr>
              <td><?php echo $entry_location; ?></td>
              <td><input type="text" name="location" value="<?php echo $location; ?>" /></td>
            </tr>
            <tr>
              <td><?php echo $entry_price; ?></td>
              <td><input type="text" name="price" value="<?php echo $price; ?>" /></td>
            </tr>
In VQmod, I'd search for the line containing '<input type="text" name="location" value="<?php echo $location; ?>" />', and thenn use offset="1", to skip the </tr>, and then insert my new lines. How would you do that in OCmod when it is not line-based?
Maybe this way (untested):

1. search for (because $location is unique):

Code: Select all

<?php echo $location; ?>" /></td>
2. and replace with:

Code: Select all

<?php echo $location; ?>" /></td>
</tr>
<tr>
   <td>LABEL</td>
   <td>INPUT</td>

Custom Development | Individuelle Entwicklung | Support & Bugfixes

Image Image Image


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by Daniel » Wed Aug 13, 2014 2:10 am

you would find buy:

<tr>
<td><?php echo $entry_location; ?></td>
<td><input type="text" name="location" value="<?php echo $location; ?>" /></td>
</tr>

then replace after

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by JNeuhoff » Wed Aug 13, 2014 4:36 am

Thanks Daniel, I'll give it try.

This is quite a big chunk of a search string, spanning accross multiple lines (I hope it will accept Unix-style line endings "\n", and not fail because of Windows-style "\r\n" line endings).

There is also a danger that if the underlying source code only slightly changes in future OC versions, e.g. adding whitespaces, the search will fail, especially if it is a longer search string.

Core classes should ideally be modified via Event handlers, or class extensions with overridden methods. And OCmod or VQmod search and replace operations on source code should only be the last resort. Modifying templates will always be a nightmare, ideally I'd like them to be clean enough so that an XML parser could be used for adding/modifying elements.

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
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by JAY6390 » Wed Aug 13, 2014 7:44 am

Daniel wrote:If you have ever looked at oscommerce mods from years ago they gave install instructions using find {code} replace with, insert before, insert after after 10th find. they did not use line numbers to say where to add code because they new the line numbers can change.
vQmod doesn't work based on line numbers either. Saying it's "overly complex" is your opinion, but many others as you can see from this thread completely disagree. I read one of your comments somewhere that the path attribute is pointless. If you understood it's purpose, you'd see it isn't actually pointless at all - but you have little to no experience using vQmods yet make all these judgements. It enables you to add multiple files simultaneously to be modified by an operation, or a group of operations. I'd also like to know how wildcards in file paths is a pointless feature too which seems to be missing, as it was the most requested feature of vQmod!

All that aside, OCMod makes it more likely to have collisions between mods. JNeuhoffs example can prove this easily. Suppose someone had edited the HTML of the <input> tag for the location to have a css class of some sort (or even edit any of that HTML) then the search wouldn't match. The whole point of matching parts of a string instead of all of it is to reduce collisions between extensions, and what OCMod does completely reverses this, increasing the likelihood.

One other thing I can't seem to work out... We have a default modification.xml file. This is pretty redundant, since you could manually add the modification() to each of the files and remove it, saving pointless processing of those files each time they need regenerating

Also, I don't think anyone thought vQMod and OCMod would be part of the core. However, it will still work with OCMod when 2.0 is released, and I'm sure it will still be widely used as the vast proportion of extensions in the extension store use vQMod either in part or in full. I find it ridiculous to add in this bastardised version of vQmod just because you don't find a couple of features worthwhile, and screw up thousands of commercial extensions that make us all money, yourself included
James wrote:OCmod isn't a last minute addition, its been on the master for well over a year - pretty well planned ahead of this release...
While it's true in part, the OCMod addition has been changed a few times in that time, and up until recently wasn't even a dead cert to be in the core. "Pretty well planned" is also pretty subjective ;)

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by rph » Wed Aug 13, 2014 1:34 pm

James wrote:I was with you until you mentioned Netbeans lol - sluggish Java sh*t! PHP Storm is awesome though - shame about the price tag but worth it...the guys here like Sublime too.
I use PHPStorm too. And in all honesty it would have been worth it at twice the price. I was just thinking from a free, solid beginners tool to a crazy-powerful commercial one.
Not to mention that changing code for the sake of it is kind of pointless, it is not like its procedural after all.
That's a huge topic that's probably best for another time. I would just generally say that the deep code nesting in certain areas does point to work to be done.
And that is the reason behind the planned timeline, alpha and beta release (not to mention sorting out issues BEFORE release!) - I remember speaking in the internal forum a while back about that and hopefully everyone realises now things are at the very least improving to help you and us.
There has been improvement. This is the first time we've ever gotten an extended alpha.

Problem is an alpha doesn't really help on this issue. Love it or hate it, the OCMod code is a done deal. I know there's about zero chance of it happening but a public RFC process would be much more useful, particularly on changes that are significant backward compatibility breaks.

For example, issues with modding templates have been mentioned in this thread. Headaches consistently occur in vQmod too. I'd love to talk about direct editing of the DOM instead. Except that would require certain template changes and rethinks when the Bootstrap rewrite is also a done deal.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by i2Paq » Wed Aug 13, 2014 2:38 pm

Daniel wrote:There are not 3 engines!
Yes there are!

Like it or not but we have 3 engines!

vQmod and the override engine are here since 2 year, you created a third one.
vqmod is not going to be included in 2.0 and the events system is not a modification system a it does not modify files.

I'm not using vqmod for the simple reason its overly complex and has to many features.

ocmod is simple to use by just have a search and replace, insert before, insert after, offset, limit and regex.
I normally understand your way of thinking, or accept it but in the case you're completely wrong.

You should have adopted vQmod, or just leave it running as a separate add-on like it is now.

Creating you own just for the sake that vQmod is over-complex is a b*llshit reason. No one complains about something being over-complex if it does what one need.

Saying that does it mean that ocmod is less over-complex, has its limitations and in time will be found useless because it can't do what vQmod does?
Extension developers need to get used to ocmod instead of complaining that they will have to rewrite there mods. They will need to rewrite the mods any way since 2.0 has a lot of changes.
Yet another crap comment; why would someone need to learn something new because you create something new that is less then something we already have and have accepted for over 2 years now!

Yes, they do need to rewrite their extensions and now they have to create 3 sorts of extension; regular, vQmod and ocmods.

What a waist of resources, what a recipe for disaster and what a waist of money and time spend by people.

Or is it your intention to get rid of vQmod and the Override-engine?

Sorry that my comment sounds harsh or angry but I just can't understand this kind of decision making.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by MarketInSG » Thu Aug 14, 2014 10:07 pm

Daniel wrote:you would find buy:

<tr>
<td><?php echo $entry_location; ?></td>
<td><input type="text" name="location" value="<?php echo $location; ?>" /></td>
</tr>

then replace after
That's a huge chunk to search, and those whitespaces and inconsistent tabs / spaces will make the search fail if i'm not wrong. Is it possible to at least get line based modification into ocmod, else many things are going to be tough / impossible due to the conflicts between multiple mods.


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by JNeuhoff » Fri Aug 15, 2014 12:02 am

Daniel,

How would go about it if another extension replaced the

Code: Select all

<td><?php echo $entry_location; ?></td>
with

Code: Select all

<td id="location"><?php echo $entry_location; ?></td>
Chances are it might then clash with your suggested modification.

If we used a line based offset="2" and searched for "echo $entry_location;" it would reduce chances of clashes with other extension's modifications significantly.

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
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by dmsims » Sat Aug 16, 2014 3:23 am

Maybe James and Daniel could actually talk to each other?

From James we have let's talk and find a consenus

From Daniel we have the usual my way or no way

Ocmod is pointless and idiotic

Active Member

Posts

Joined
Sat Apr 13, 2013 6:05 pm
Who is online

Users browsing this forum: No registered users and 6 guests