Post by Qphoria » Thu Sep 15, 2011 10:56 am

SUBSCRIBE TO THIS THREAD FOR UPDATE NOTIFICATIONS

Discussion and feature requests thread can be found here

vQmod 2.0 released!

It is a great feeling to know that the little ideas I knocked around over the years turned into such a popular modification system. Now, thanks to the great effort and coding skills of JayG, we bring version 2.0 to the community. I am going to retire the vQmod v1.0 thread so I will recap a bit about what vQmod is in this thread for new users, as well as explain any changes for those upgrading from vQmod 1.x to vQmod 2.0.

What is vQmod?
"vQmod™" (aka Virtual Quick Mod) is an override system designed to avoid having to change core files. The concept is quite simple... Instead of making changes to the core files directly, the changes are created as xml search/replace script files. These script files are parsed during page load as each "source" core file is loaded with the "include" or "require" php functions. The source is then patched with the script file changes, and saved to a temp file. That temp file is then substituted for the original during execution. The original source file is never altered. This results in a "virtual" change to the core during execution without any actual modification to the core files.

  • Add/Remove a mod by simply adding/removing the associated xml file from the vqmod/xml folder
  • OpenCart upgrades will not overwrite your changes or scripts
  • Different modifications to the same file can co-exist down to a single character! No other modification system exists with this much granularity
  • Powerful yet simple xml formatted syntax
  • Can be used to virtually alter any php or tpl file in OpenCart (except the main index.php)
[/size]
Visit the vQmod home page for more details and examples

How do I install it?
Install Guide (plus video)



How do I use it?
Simple.
1. Download the latest version that has "opencart" in the title
2. Using FTP, upload the "vqmod" folder from the zip to the root of your opencart store.
3. Be sure the vqmod folder and the vqmod/vqcache folders are writable (either 755 or 777). Also be sure index.php and admin/index.php are writable. If not sure which you need, first try 755. If you get errors about permissions, then try 777.
4. Goto http: //www.yoursite.com/vqmod/install.
5. You should get a success message. If not, be sure your store root is writable and try again
6. Load your store homepage
7. Using FTP, verify that there are new "vq" files in the "vqmod/vqcache" folder.
8. If yes, then you are ready to start downloading or creating vQmod scripts, otherwise ask for assistance.
9. The OpenCart development community has made hundreds of vQmod mod scripts in the free and commercial vqmod forums, and almost all developers use vQmod for their other larger modifications that require core alterations.
10. vQmod scripts are simple xml files that you upload into the vqmod/xml folder. If you want to disable a mod, simply remove the script from this folder. After installing a new mod, test it out and verify that no errors are being written to the vqmod/vqmod.log file. If you see errors in that file, be sure you contact the script author for assistance. Do not post script errors here.

What's new in vQmod 2.0?
vQmod 2.0 is a complete rewrite of the code by JayG. The original vQmod 1.x was my original brainchild and was a mess of good and bad ideas mixed into a single file and written as fast as the thoughts came to me. It worked surprisingly well for the shape it was in. JayG took the caterpillar code and turned it into a butterfly :) It still functions the same but should resolve some small nuances. Performance was never really an issue with v1.0 and v2.0 appears to be just as fast.

How do I upgrade from a previous version of vQmod?
Great news! There are no syntax changes or index.php changes for 2.0. So you should not have to change any of your script files.
1. Back up your /vqmod/xml/ folder locally. This is really just a for good practice, but really the files won't be overwritten anyway so this is optional but recommended just for having a backup.
2. Upload the vqmod/ folder to your store's root path so that it merges with your existing vqmod/ folder via FTP. This should retain your current files, but replace existing vqmod files (not folders). FileZilla is recommended. Be sure you drag-n-drop the new vQmod folder to the scroll bar and NOT ON TOP of the existing vQmod folder as that will put the new one inside of the old one instead of merging them. See the install video above for visual example.
3. Delete the vqmod.log (if it exists) and delete all files in the "vqmod/vqcache" folder on your site. The logs are now written to vqmod/logs on "{day}.log" format to break up the logs a bit.

That's it! The same goes for future versions!

Things to Note:
  • While the overall concept of this is virtual modifications, the vQmod installer has to make real changes to the main index.php and admin/index.php files only to initialize the vQmod class. This means if you upgrade to a new version of opencart, you will need to re-run the vQmod install steps above as the index files will likely be overwritten by the upgrade. Be sure that you don't delete the vqmod/install folder after use. There is no danger of keeping it as running the install again will simply note that it is already installed.
  • vQmod is limited to php and tpl files. It cannot modify browser loaded files like css and js. However, you can create new css and js files and alter the tpl file to load the newly created files.
  • vQmod will create a "vqmod.log" file in the vqmod folder if and only if there are script errors. If you don't see the file, then there are no script errors. If you are having trouble with a script or you see the vqmod.log file, open it up to figure out what the issue is. Keep in mind that it will log an error for every page load so if you don't take care of errors your vqmod.log file can get extremely large very quickly. You can delete this log at any time.. it will recreate itself as needed.
Troubleshooting vQmod scripts
vQmod scripts are only as good as the authors who make them. Once vQmod is installed and working, it is very unlikely that there will be any issues with the vQmod engine itself. If you are having issues with a mod not loading properly it is likely due to a script issue. vQmod has a log file that will record any script errors. It is good practice to always check for this file after installing a new mod. If the file doesn't exist, then there are no script errors. Please do not post script problems in this thread. Script bugs or issues need to be discussed with the author of the individual script. This thread is for discussion of the system, and for bug reporting only. Also be sure the "vqmod_opencart.xml" file is always in the vqmod/xml folder. This is the main script that is required for all others to work. It is included as part of the "opencart version" of the main vQmod install.

If you are getting php errors like "Warning: file_put_contents" or "permissions" then be sure to follow step 3 above.

I upgraded my opencart and vQmod stopped working??
Remember, the vQmod installed must make real file changes to the index.php and admin/index.php for vQmod to be initialized. If you ugpraded OpenCart, then you also replaced the index files with the new ones. Simply rerun the install command: http://mysite.com/vqmod/install/index.php and you should be ready to go again.


BEFORE POSTING A QUESTION BE SURE TO READ THIS ENTIRE POST!

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by JAY6390 » Mon Sep 26, 2011 8:50 pm

Version 2.0.1 has now been released

Fixes
- Removed die() on bad real path in vqmod->path method
- Added logging for bad path in mod, along with mod details
- vqmod->modCheck now returns exact file if the realpath resolves to a directory only, preventing route issue
- vqmod_opencart.xml file size reduced as using regex rather than individual items for startup.php

Downloads available here
http://vqmod.com/

Image


User avatar
Guru Member

Posts

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

Post by JAY6390 » Fri Sep 30, 2011 1:56 am

Version 2.1.0 has now been released!

Changes
=====
- Added wildcard support for filenames *NEW*
- Added back support for vqprotect.txt file
- Added vqprotect.txt file
- Added full commenting to the vqmod class
- Added template fetch fix in vqmod_opencart.xml

This is likely to be the last update for a while, except for bug fixes. One feature I'm sure plenty of developers have been waiting for is the arrival of the * in place of a file/folder name. Here's an example of it's use

Code: Select all

	<file name="catalog/view/theme/*/template/product/product.tpl">
		<operation>
			<search position="replace"><![CDATA[$price]]></search>
			<add><![CDATA[$new_price]]></add>
		</operation>
	</file>
This will then apply the modification to ANY product.tpl file regardless of the theme name
A restriction on the * is in place, where it will only match up to a forward slash, so you can't do
catalog/view/*.tpl to apply to all .tpl files within a directory. This restriction is intended, not a flaw for anyone who may want to do so in an extreme circumstance

Downloads available here
http://vqmod.com/

Image


User avatar
Guru Member

Posts

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

Post by JAY6390 » Tue Oct 04, 2011 8:17 pm

Version 2.1.1 has now been released! (bug fix release)

Changes
=====
- Fixed inefficent regex bug
- Fixed controller bug for opencart xml

Downloads available here
http://vqmod.com/

Image


User avatar
Guru Member

Posts

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

Post by JAY6390 » Sun Oct 09, 2011 8:10 pm

Version 2.1.2 has now been released! (bug fix release)

Changes
=======
- Fixed position="bottom" always returning 0
- Fixed VQModObject::_skip not functioning
- Fixed vqprotect.txt trying to load when it doesn't exist
- Removed: vqprotect.txt file


Downloads available here
http://vqmod.com/

Image


User avatar
Guru Member

Posts

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

Post by JAY6390 » Sun Oct 16, 2011 8:16 pm

Version 2.1.3 has now been released! (bug fix release)

- Fixed useCache accidentally taken out when adding in wildcard support (Well spotted rph!)


Downloads available here
http://vqmod.com/

Image


User avatar
Guru Member

Posts

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

Post by JAY6390 » Fri Oct 28, 2011 10:02 pm

Version 2.1.4 has now been released! (bug fix release)

- Added flock to read and write methods, to hopefully eliminate possible locked file problems

Downloads available here
http://vqmod.com/

Image


User avatar
Guru Member

Posts

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

Post by Qphoria » Thu Nov 10, 2011 11:57 pm

Version 2.1.5 has now been released! (performance release)

Changes
=====
- Prevent excessive ajax callbacks from constant rewriting of vqcache files

The Problem:
The page loads once, and sets the vqcache files based on the xml scripts. Then if the page has ajax callbacks, they would also cause the vqcache files to be rewritten (if not using useCache). Tracing all the writes showed that a page load might have 9 vqcache writes, but the ajax callbacks generated another 50 writes to the same file. And since they write so fast, it was causing file writing lock issues

The Solution:
New "Pseudo-cache" code. Quite simply, if the vqcache file is less than 3 secs old, it will just reuse it rather than rewrite it. That prevents all the underlying ajax callbacks from regenerating the same file over and over, removing the issue. It is like having useCache enabled for 3 secs at a time, without the tedious step of having to manually delete the vqcache files when adding new scripts.

vQmod performance was already great, but now it is the fastest it has ever been.

Downloads available here
http://vqmod.com/


NOTE: This version will be required for the next version of OpenCart v1.5.2
I've added ajax error messaging to all steps of the checkout page in the next version of opencart to allow tracking problems better. Due to the ajax callback issue mentioned above, the file locking will cause checkout to throw more errors until you upgrade to this version of vQmod. So be sure to upgrade.

Upgrade simply by grabbing the new vqmod.php file from the zip and drop it into your vqmod folder. That's it!

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Fri Mar 16, 2012 2:44 am

Version 2.1.6 has now been released!

Changes
=====
- Added error attribute to <file> tag. Defaults to "log"

"log" is default. Simply logs the missing file and continues on with the rest of the operations
"skip" means it just ignores and continues on with the rest of the operations
"abort" means it aborts that remainder of that single xml file. It does not revert changes to other files made in that xml file before that operation and does not revert changes from other xml scripts.

It ONLY works for non-wildcard file paths. Wildcard paths are handled differently and already bypass the existence check.

DOWNLOAD

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Fri Aug 17, 2012 5:03 am

Version 2.1.7 has now been released

Features:
- Updated vqmod_opencart.xml file to support OpenCart v1.5.4 (also works with older versions)
- Added new cacheTime to replace useCache with default of 60 secs (vqcache files will only rewrite every 60 secs. You can override this in the index.php file by adding $vqmod->cacheTime=30;
- Deprecated useCache

To upgrade:
1. Unzip the vqmod-2.1.7.opencart.zip file
2. Upload the vqmod folder to your store root path
The existing vqmod folder will merge so you don't need to worry about deleting anything
Be sure to say YES to overwrite existing files

I recommend this for all existing stores, not just 1.5.4

Developers, I recommend you add

Code: Select all

$vqmod->cacheTime=1;
to your index.php file for your own testing as you would normally want to see small changes instantly.

DOWNLOAD

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by JAY6390 » Sun Oct 28, 2012 11:10 am

Version 2.2.0 has now been released!

Changes
=====
- Added folder checks for vqcache and logs folder
- Added rotational daily logs to curb large log file sizes
- Added file being modded to log messages to make easier to debug
- Added modifications caching to increase performance
- Added cache path caching to increase performance

- Removed cache lock code and implemented file modification detection
- Fixed cache bug from 2.1.7

- OpenCart Installer now checks files are writeable and notifies of any issues before attempting write

Any issues, please let us know!

Downloads available here
http://vqmod.com/

Image


User avatar
Guru Member

Posts

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

Post by JAY6390 » Mon Nov 12, 2012 11:40 am

Version 2.2.1 has now been released! (bug fix release)

Changes
=======
- Fixed invalid file path issue
- Fixed empty search content issue
- Added file change detection in original files
- Fixed 1.4.X compatibility in XML for OpenCart

Downloads available here
http://vqmod.com/

Image


User avatar
Guru Member

Posts

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

Post by JAY6390 » Mon Jan 07, 2013 8:13 pm

Version 2.2.2 has now been released! (bug fix release)

Changes
=======
- Fixed invalid file path logging issue

Downloads available here
http://vqmod.com/

Image


User avatar
Guru Member

Posts

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

Post by JAY6390 » Thu Jan 10, 2013 10:54 pm

This thread has been locked to keep it cleaner for bug releases. See the first post for a link to the discussion/feature request thread

Image


User avatar
Guru Member

Posts

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

Post by JAY6390 » Tue Jan 29, 2013 7:13 am

Version 2.3.0 has now been released!

Changes
=======
- Fixed minor bug with mods.cache - now refreshes cache when deleted
- Added <ignoreif> tag to operations
- Added path rewrites to make moved folders easier to manage
- Multiple files can now be named inside name="" attribute, separated by commas
- path="" attribute added to <file> tag to allow base prefix for multiple names
- We now recommend adding a info="" attribute for operations to make it clearer what the operation does. This at present is purely optional but we advise adding for the benefit of others reading the files

Details of the new changes can be read in the development thread (linked above)

Downloads available here
http://vqmod.com/

Image


User avatar
Guru Member

Posts

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

Post by JAY6390 » Wed Feb 27, 2013 7:24 am

Version 2.3.1 has now been released!

Changes
=======
- Fixed bug with path replaces
- Fixed bug with realpath never returning false
- Added error handling for empty/invalid mods.cache
- Added error handling for unknown ignoreif tag bug

Downloads available here
http://vqmod.com/

Image


User avatar
Guru Member

Posts

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

Post by JAY6390 » Wed Feb 27, 2013 7:14 pm

Version 2.3.2 has now been released!

Changes
=======
- Fixed bug for mods.cache issue

Downloads available here
http://vqmod.com/

Image


User avatar
Guru Member

Posts

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

Post by JAY6390 » Mon Jul 29, 2013 3:28 am

Version 2.4.0 has now been released!

NOTE TO UPGRADE YOU NEED TO RUN THE INSTALLER AGAIN

Changes
=======
- Added OpenCart 1.5.6 Compatibility. Yes it is still backwards compatible with previous versions of OpenCart.
- Added "ibefore" and "iafter" methods for "search" tags "position" attribute
- Added case insensitivity for bug with certain windows installations
- Added "required" attribute check for "vqmver" tag for incompatibility
- Added file path being modified to error log
- Added operation index of vQmod file tag to errorlog
- Changed error messages to make them more concise
- Changed "VQMod" class from instantiated to static, making it easier to
integrate
- Changed log file name format to make them consecutive ("0_Sun.log",
"1_Mon.log" etc)
- Changed PHP 5.5+ deprecated "e" regex modifier code to "preg_replace_callback"
using "VQMod::_quotePath"
- Removed position="all" attribute option

OpenCart specific changes
- Added seamless upgrade code to installer
- Added XML header to "vqmod_opencart.xml"
- Changed "vqmod_opencart.xml" to be greatly simplified and cover all php files
in "/system/library" and "/system/engine" more consistently
- Changed "admin" folder name variable to make it easier to edit in Oinstaller
- Changed installer code to use new "VQMod::modCheck()" and "VQMod::bootup()"
code

Downloads available here
http://vqmod.com/ - OC Specific Download Link

Image


User avatar
Guru Member

Posts

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

Post by JAY6390 » Tue Jul 30, 2013 5:43 am

Version 2.4.1 has now been released!

NOTE TO UPGRADE FROM A VERSION BEFORE 2.4.0 YOU NEED TO RUN THE INSTALLER AGAIN

Changes
=======
- Fixed incompatibility with PHP versions lower than 5.3 for "_quotePath" callback
- Turned devmode back to false

Downloads available here
http://vqmod.com/ - OC Specific Download Link

Image


User avatar
Guru Member

Posts

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

Post by JAY6390 » Sat Aug 30, 2014 12:05 am

Version 2.5.0 has now been released!

NOTE TO UPGRADE FROM A VERSION BEFORE 2.4.0 YOU NEED TO RUN THE INSTALLER AGAIN

Changes
=======
- Added caching of checked files to increase performance
- Added error details of invalid XML files
- Added negative offset for REPLACE position to remove lines before matched line instead of only after
- Added <search> and <add> check to ensure present in each <operation>
- Added second parameter to modCheck to allow specifying the Operations file path for a different source file
- Changed $_replaces to $replaces in VQMod object to adhere to naming convention for public property
- Change to file() method to increase performance
- Changed regex path matching to increase performance
- Changed minor pieces of code to increase performance
- Changed file_put_contents to lock files while saving ( bug fix for https://code.google.com/p/vqmod/issues/detail?id=167 )
- Changed .htaccess security method to hopefully fix some servers having 500 ISE messages from Options -Indexes
- Changed vqmod.php (Formatting cleanup)
- Changed readme.txt files

OpenCart specific changes
=================
- Added attempted fix for weird installer bug ( https://code.google.com/p/vqmod/issues/detail?id=145 )
- Added admin/controller/extension/*.php files to core vqmod_opencart.xml
- Changed vqmod_opencart.xml to allow OC 2.0 integration

We've moved to GitHub, so all new downloads are available from here

Image


User avatar
Guru Member

Posts

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

Users browsing this forum: No registered users and 29 guests