Post by JAY6390 » Sat Jan 08, 2011 10:45 pm

Just out of interest does it have regex replace support? So that you could in essence match a block of code rather than just single lines?

Image


User avatar
Guru Member

Posts

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

Post by JNeuhoff » Sat Jan 08, 2011 10:45 pm

Another problem I'm having:

Code: Select all

	.....
	<file name="catalog/controller/information/information.php">
		<operation>
			<search position="after"><![CDATA[public function {]]></search>
			<add><![CDATA[
				$this->load->helper('string');
			]]></add>
		</operation>
		.....
	</file>
	.....
I was trying to add the line

$this->load->helper('string'); after each public function {.
Last edited by JNeuhoff on Sat Jan 08, 2011 10:58 pm, edited 2 times in total.

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 Xsecrets » Sat Jan 08, 2011 10:58 pm

JNeuhoff wrote:Another problem I'm having:

Code: Select all

	<file name="catalog/controller/information/information.php">
		<operation>
			<search position="after"><![CDATA[public function {]]></search>
			<add><![CDATA[
				$this->load->helper('string');
			]]></add>
		</operation>
	</file>
I was trying to add the line

$this->load->helper('string'); after each public function {.
well it probably didn't work since there is no "public function {" in that file. Granted with a regex you could do something like that, but I wouldn't call it a bug that it doesn't match non-existent text.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by JAY6390 » Sat Jan 08, 2011 11:08 pm

Ah yeah they need to have the function names in there to match - this is one of the reasons I was wondering if regex is available

Image


User avatar
Guru Member

Posts

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

Post by Xsecrets » Sun Jan 09, 2011 12:58 am

well I can see the use for regex, but in this particular case if you simply searched for "public function" it should do what you want.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Qphoria » Sun Jan 09, 2011 1:02 am

JNeuhoff wrote:There is still an issue of not doing the logging correctly.

I have an XML file where it ignores an <operation> , probably due to some unknown error, yet it doesn't log anything, making it hard to track down the error cause.
I've not yet seen any spots where the logging hasn't work. If you can send me that part of the mod I can try it out in my debugger.. Normally it should say "OPERATION FAILED: NO MATCH FOR SEARCH" if it couldn't match. Same thing with your other mismatch for:
public function {

You are skipping the name of the function in attempts to match all public functions but still have the "{" there so it will never match. Remove the { and it should work.

@Jay.
RegEx support is planned. I'm not well versed in regex so I have to do a bit more research on it but I guess if I let you set the pattern in the search area, I can plug that into a preg_replace function and use the matches.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by JAY6390 » Sun Jan 09, 2011 4:04 am

Yeah, preg_replace has a "limit" attribute which could come in useful

Image


User avatar
Guru Member

Posts

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

Post by JNeuhoff » Tue Jan 11, 2011 12:44 am

You are skipping the name of the function in attempts to match all public functions but still have the "{" there so it will never match. Remove the { and it should work.
You are right, there shouldn't have been a '{' in the search expression.

And the logging is now working fine.

Maybe I need a break ....
Too much work ....

:bang:

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 JAY6390 » Tue Jan 11, 2011 12:46 am

hehe easy enough to miss :joker:

Image


User avatar
Guru Member

Posts

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


Post by wandotshop » Wed Jan 12, 2011 4:08 pm

Dear Q,
i just identify the bug with example u give to us include at vqmod... "Show List quantity product" if i not wrong...
the issue.. when someone buy with certain quantity and proceed .. let say i set it 20 Quantity.. then buy 5 quantity at same time... but when i try to buy again lets say as a another customer.. at page it still shown 20 quatity...i sure that the quantity left should be 15 right? ... at admin office it looks ok with 15 quantity left...

its bug or what we call it? could u plz indentify the problem and make it work properly... let me know if i wrong..tq

New member

Posts

Joined
Wed Oct 06, 2010 12:15 am

Post by JNeuhoff » Wed Jan 12, 2011 5:46 pm

Would it be possible for vqmod to recreate the files in the vqcache folder automatically after a change to a vqmod XML file? For example, a simple comparison of the file dates of the XML file and the ones in the vqcache folder could trigger a re-creation of the cached files if the XML is newer.

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

Re:


Post by Qphoria » Wed Jan 12, 2011 9:05 pm

wandotshop wrote:Dear Q,
i just identify the bug with example u give to us include at vqmod... "Show List quantity product" if i not wrong...
the issue.. when someone buy with certain quantity and proceed .. let say i set it 20 Quantity.. then buy 5 quantity at same time... but when i try to buy again lets say as a another customer.. at page it still shown 20 quatity...i sure that the quantity left should be 15 right? ... at admin office it looks ok with 15 quantity left...

its bug or what we call it? could u plz indentify the problem and make it work properly... let me know if i wrong..tq
Yea its already been identified and fixed above

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Xsecrets » Wed Jan 12, 2011 9:11 pm

JNeuhoff wrote:Would it be possible for vqmod to recreate the files in the vqcache folder automatically after a change to a vqmod XML file? For example, a simple comparison of the file dates of the XML file and the ones in the vqcache folder could trigger a re-creation of the cached files if the XML is newer.
If I'm not mistaken unless you specifically set it to cache mode it recreates the files on each load anyways.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Qphoria » Wed Jan 12, 2011 10:00 pm

Xsecrets wrote:
JNeuhoff wrote:Would it be possible for vqmod to recreate the files in the vqcache folder automatically after a change to a vqmod XML file? For example, a simple comparison of the file dates of the XML file and the ones in the vqcache folder could trigger a re-creation of the cached files if the XML is newer.
If I'm not mistaken unless you specifically set it to cache mode it recreates the files on each load anyways.
Correct. If useCache is true then it only creates the files if they dont already exist. If false then they are generated each time. It sounds like JN wants a hybrid of sorts where only changed xml files get reprocessed. I did think about doing this but wondered if checking the files for changes each time would be beneficial or take the same amount of time as just recreating anyway. I suppose reading is faster than writing, but any performance effefct seems to be pretty much insignificant anyway.

Not sure of the best way to monitor either. I could keep a txt file list of all the file date modified timestamps I guess, or md5 matches then compare each current file to the list.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Thu Jan 13, 2011 1:25 pm

UPDATE IN FIRST POST!
v1.0.6 - 2011-JAN-12
- Added RegEx Support
- Added new "all" position to replace entire file
- Added new protected file list option to prevent some files from being modded for security
- Additional performance improvements
- Added divider lines to logging to improve readability between files
- Added version to log print

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Xsecrets » Thu Jan 13, 2011 1:31 pm

Qphoria wrote:UPDATE IN FIRST POST!
v1.0.6 - 2011-JAN-12
- Added RegEx Support
- Added new "all" position to replace entire file
oh boy I can see this one getting severely abused.
- Added new protected file list option to prevent some files from being modded for security
- Additional performance improvements
what kind of performance improvements?
- Added divider lines to logging to improve readability between files
- Added version to log print

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Qphoria » Thu Jan 13, 2011 1:41 pm

Xsecrets wrote: oh boy I can see this one getting severely abused.
With great power comes great responsibility :)
Xsecrets wrote: what kind of performance improvements?
1. I had a few too many str_replace functions on the same string multiple times. Now I changed it to do it in one place
2. The initial search check was searching each line for a match. So if there are 1000 lines in a file, and the change is on line 900, the initial search would scan the file for the first match... which happens at 900.. Then that was being used more like a boolean. I wasn't returning that line number so the real modify function would start over scanning again at line 1. But since the initial search was at line 900, I know that is where the first match is, so I pass that line number back into the modify function. So now it just starts at the exact same line to do the change. So thats 899 less lines to scan. So it theoretically is a big performance improvement for mods of larger source files that had the changes towards the end of the file.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by qahar » Thu Jan 13, 2011 6:08 pm

Q, if you don't mind i make vQmod File Collection. I hope it's can help people to get the vQmod file
(i don't like the sound of vQmod Mods :laugh: )

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by i2Paq » Thu Jan 13, 2011 7:49 pm

qahar wrote:Q, if you don't mind i make vQmod File Collection. I hope it's can help people to get the vQmod file
(i don't like the sound of vQmod Mods :laugh: )
Made Sticky ;)

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 Qphoria » Thu Jan 13, 2011 8:42 pm

qahar wrote:Q, if you don't mind i make vQmod File Collection. I hope it's can help people to get the vQmod file
(i don't like the sound of vQmod Mods :laugh: )
Yea great!.. I was going to do this too but your collection threads always look nicer :)

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 9 guests