Page 5 of 35

Re: [MOD] - VirtualQMod - Virtual Modification System

Posted: Sat Jan 08, 2011 10:45 pm
by JAY6390
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?

Re: [MOD] - VirtualQMod - Virtual Modification System

Posted: Sat Jan 08, 2011 10:45 pm
by JNeuhoff
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 {.

Re: [MOD] - VirtualQMod - Virtual Modification System

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

Re: [MOD] - VirtualQMod - Virtual Modification System

Posted: Sat Jan 08, 2011 11:08 pm
by JAY6390
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

Re: [MOD] - VirtualQMod - Virtual Modification System

Posted: Sun Jan 09, 2011 12:58 am
by Xsecrets
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.

Re: [MOD] - VirtualQMod - Virtual Modification System

Posted: Sun Jan 09, 2011 1:02 am
by Qphoria
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.

Re: [MOD] - VirtualQMod - Virtual Modification System

Posted: Sun Jan 09, 2011 4:04 am
by JAY6390
Yeah, preg_replace has a "limit" attribute which could come in useful

Re: [MOD] - VirtualQMod - Virtual Modification System

Posted: Tue Jan 11, 2011 12:44 am
by JNeuhoff
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:

Re: [MOD] - VirtualQMod - Virtual Modification System

Posted: Tue Jan 11, 2011 12:46 am
by JAY6390
hehe easy enough to miss :joker:

Posted: Wed Jan 12, 2011 4:08 pm
by wandotshop
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

Re: [MOD] - VirtualQMod - Virtual Modification System

Posted: Wed Jan 12, 2011 5:46 pm
by JNeuhoff
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.

Re:

Posted: Wed Jan 12, 2011 9:05 pm
by Qphoria
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

Re: [MOD] - VirtualQMod - Virtual Modification System

Posted: Wed Jan 12, 2011 9:11 pm
by Xsecrets
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.

Re: [MOD] - VirtualQMod - Virtual Modification System

Posted: Wed Jan 12, 2011 10:00 pm
by Qphoria
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.

Re: [MOD] - VirtualQMod - Virtual Modification System

Posted: Thu Jan 13, 2011 1:25 pm
by Qphoria
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

Re: [MOD] - VirtualQMod - Virtual Modification System

Posted: Thu Jan 13, 2011 1:31 pm
by Xsecrets
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

Re: [MOD] - VirtualQMod - Virtual Modification System

Posted: Thu Jan 13, 2011 1:41 pm
by Qphoria
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.

Re: [MOD] - VirtualQMod - Virtual Modification System

Posted: Thu Jan 13, 2011 6:08 pm
by qahar
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: )

Re: [MOD] - VirtualQMod - Virtual Modification System

Posted: Thu Jan 13, 2011 7:49 pm
by i2Paq
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 ;)

Re: [MOD] - VirtualQMod - Virtual Modification System

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