Page 28 of 35

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Tue Jun 21, 2011 1:37 am
by Qphoria
I am using vqmod (JayG edition) on my site now. Working great

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Tue Jun 21, 2011 4:19 pm
by madimar
Just PMed to Jay with what seems a little bug. Let me know if you prefer to share bugs here in the forum or mantain it in PM.

Ciao

M

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Tue Jun 21, 2011 6:02 pm
by JAY6390
Hi Madimar. With this not yet being released, I think it best to just share bugs via PM, to save confusion with the 1.x version

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Tue Jun 21, 2011 9:58 pm
by Qphoria
I think on release of v2.0, we will open a new thread and lock this one to get a fresh start.

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Tue Jun 21, 2011 10:16 pm
by madimar
Good idea Q! But I'm still experiencing an issue with 1.2.2 with index. I'm struggling to understand why but, following script doesn't work properly (with OC 1.4.9.5):

Code: Select all

<file name="admin/controller/sale/customer.php">
		<operation>
            <search position="before" index="1,2"><![CDATA[
			if (isset($this->request->get['filter_status'])) {
            ]]></search>
            <add><![CDATA[
// madimar mod
code
// madimar mod end
            ]]></add>
        </operation>	
</file>
The problem is it just hits the first occurence and not the second or others.

If I remove index clause, all the occurrences are correctly hit.

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Tue Jun 21, 2011 10:28 pm
by JAY6390
Just out of interest, does this work with the new one Madimar?

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Tue Jun 21, 2011 10:41 pm
by madimar
Working great, man!!!! With you last version (just download) obviously!

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Tue Jun 21, 2011 10:41 pm
by JAY6390
Also, for your issue, try this...
FInd

Code: Select all

        $positions = array('before','after','replace','top','bottom','all'); 
and before it put

Code: Select all

        if($index && is_string($index)) {
            $index = explode(',', $index);
            if(!count($index))
            $index = false;
        } 

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Tue Jun 21, 2011 10:51 pm
by madimar
Hit and sunk! Ready for 1.2.3 vqmod!!!

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Wed Jun 22, 2011 4:46 am
by Qphoria
ok v1.2.3 added to first post with JayG's fix for index (hopefully the last 1.x version)

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Wed Jun 22, 2011 5:47 am
by madimar
yeah, now 2.0 seems working fine. Continuing testing with my ongoing developments

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Wed Jun 22, 2011 5:56 am
by JAY6390
2.0 is going to be having some changes in the coming weeks, so best not to get too ahead of ourselves :-)

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Wed Jun 22, 2011 10:39 am
by Qphoria
JAY6390 wrote:2.0 is going to be having some changes in the coming weeks, so best not to get too ahead of ourselves :-)
Maybe save that rewrite for 3.0 :)
Long live the single file system

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Wed Jun 22, 2011 6:59 pm
by madimar
s31teg, just for you and for other people, I just discovered a very useful web tool to verify xml syntax.
It helped me to solve some issues with my vqmod xml, when I was struggling in a difficult troubleshooting.

The link is:

http://www.w3schools.com/Dom/dom_validate.asp

You can cut & paste your entire xml script and see if there are syntax errors causing problem to the DOM parser.

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Wed Jun 22, 2011 9:31 pm
by Qphoria
^^ you can also use IE to validate xml

IE has only 2 good uses
- It accurately reports RSS feed errors
- It offers XML validation

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Thu Jun 23, 2011 1:06 am
by jcsmithy
Currently running 1.5.0.5 with vQmod v1.2.3 and having the same issue as before with cache files being generating but no changes are being made.

Tried replacing files from the 1.0.8 version as the first post suggested but still no joy (unsure if that worked for 1.5 anyway).

Tried looking for the 1.1.0 as suggested on page 24/25, but just can't find it anywhere.


Any Ideas?

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Tue Jun 28, 2011 5:28 pm
by DannyMacD
ok, i seem to understand what VQMOD does, thats great, but im having difficulty understanding how to install.

is someone able to point out to me what to do simply?

im running OC 1.5.0.5

thank you.

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Tue Jun 28, 2011 5:45 pm
by madimar
To be honest Danny, what difficulty you are encountering in vqmod installation? It is everything well written in the instructions... Trying to summarize:
1) copy vqmod folder in your server root (same level of catalog, admin, etc.)
2) open a browser and point to: http://YOURSITE/vqmod/install

This is enough and it works 99%. For the rest of 1% you need some adjustements or manual installation (well documented too).

M

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Tue Jun 28, 2011 5:47 pm
by michelk
It is an excellent tool but I didn't want to use it as it was. I didn't like the idea of relying on parsing to find where to insert the mods. In fact all I wanted was a way to substitute a script, or whatever file with a versioned one (for example product.php with product_vX.php where X is a version number) in the original directory). I didn't want either to loose the option to do the originally designed parsing based substitution.

Here is what I have done in vqmod.php:

I have added these 2 lines after
public $logging = TRUE;

Code: Select all

    public $useVersion = true;                          // use a pre-loaded version _vx file
    private $filesToVersion = array();					// Keeps a list of all the files that have version number in xml 

In the
__construct function
, after
$source = str_replace("\\", "/", $this->cwd . '/' . $source);
I added:

Code: Select all

                if (strpos($source,"|") !== false) {
                    $sx = explode("|",$source);
                    $source = $sx[0];
                    $version = $sx[1];
                    if ($version != '') $this->filesToVersion[$source] = $version;
                    }
In the
modCheck
function, just before the
// Create tempfile
comment, I added:

Code: Select all

        if ($this->virtualMode && 
            $this->useVersion && 
            array_key_exists ($sourcefile,$this->filesToVersion)) {
          
            $sx = explode("/",$sourcefile);
            $last = array_pop($sx); 
            $sxx = explode(".",$last);
        
            $sxx[0] .= "_v".$this->filesToVersion[$sourcefile];
        
            $last = implode(".",$sxx);
            array_push($sx,$last);
            $tempfile = implode("/",$sx);

            if (file_exists($tempfile)) {
                $msg  = ("SOURCEFILE:  $sourcefile\r\n");
                $msg .= ("USING VERSION VERSION: $tempfile\r\n");
                $this->log($msg);
                return $tempfile;
                }
		
            }
Finally, in the
getFilesToMod
function, I changed [quote$filepaths[] = $file->getAttribute('name');][/quote] with

Code: Select all

 $filepaths[] = $file->getAttribute('name')."|". $file->getAttribute('version');
To use versioned scripts, add the following lines in the xml file (this is an example... please adapt to your needs):

As you can see, I use a
version
attribute.

Code: Select all

	<file name="catalog\view\theme\default\template\product\product.tpl" version="1" >
 	</file>
and do not forget to copy your script (product.tpl) to product_v1.tpl before changing it to your heart's contempt. Personnaly I also comment each block of code I change.

Again, I need to thank Qphoria for doing the heavy lifting.

P.S. All that is based on work I have done in 1973... just to say I know recycling!

Re: [MOD] - VirtualQMod "vQmod" Virtual File Modification Sy

Posted: Tue Jun 28, 2011 5:51 pm
by JAY6390
One small thing you forgot madimar, if the store is in a subfolder, they will need to enter
http://yoursite/subfolder/vqmod/install/
Although as you rightly point out, it's pretty easy