That was a feature I added to avoid write locking. It means the vqcache file couldn't be written to in a timely manner and took up to 1 sec to be written. It typically means your host is slow. But does it still work?drivenbyweb wrote:My log file has a bunch of lines in it that say ---DELAYED WRITE---. Searched google and the forum but can seem to find what it means. Does anyone know?
Hmm, you convinced me... inline-after and replace (properly used) are equivalent.Qphoria wrote:Well no.. Think about itmadimar wrote:I'm not sure I understood correctly. If you replace the line, you will have a different code in your file.Qphoria wrote:Yes it is true, inline after/before would be good. But it can be done in a pseudo-way like I showed above.. by using replace and finding the line and replacing the same line with code after it. Since if that line changed anyway, it wouldn't match anyway so the same effect still happens.
Adding directly in the file those str_replace operations (as in my example), mantains the original line unchanged in the file.
If all the other mods work in the same way, I think the conflict risk is minor even if not completely avoided.
You have to search "abc123"
and replace with "abc123-XYZ"
You are replacing the exact same code with the original code plus your new code.
And you are actually bound to rule since your search would have to match in the first place
So another script could use that same search tag without breaking anything
So If you had search "abc123"
and inline-after "-XYZ"
still resulting in "abc123-XYZ"
You'd still end up with all the same pieces of the puzzle
And another script could still search on the tag the same way.
It is 6 vs half-dozen.
What about my "experiment" of "str_replace or string concatenation - after" ? In this way, mainly for modified sql queries, if another mod applies a "not restricted" vqmod replace on the original text, maybe things can work without conflicts. Example
A) "standard vqmod"
1) First mod:
code:
Code: Select all
$sql = "abc123-XYZ";
result:
Code: Select all
$sql = "abc123-ABCD-XYZ";
code:
Code: Select all
$sql = "abc123-ABCD-XYZ";
vqmod search: 123-XYZ - replace 123-XYZ-9999
result:
not match!
B) "madimar trick with str-replace"
1) First mod:
code:
Code: Select all
$sql = "abc123-XYZ";
result:
Code: Select all
$sql = "abc123-XYZ";
$sql = str-replace('123','123-ABCD' ,$sql);
$sql = "abc123-ABCD-XYZ";
2) Second mod:
code:
Code: Select all
$sql = "abc123-XYZ";
$sql = str-replace('123','123-ABCD' ,$sql);
vqmod search: 123-XYZ - replace 123-XYZ-9999
result:
Code: Select all
$sql = "abc123-XYZ-9999";
$sql = str-replace('123','123-ABCD' ,$sql);
$sql = "abc123-ABCD-XYZ-9999";
Hmm... let me say, the modification conflict is avoided, even if the risk of mulfunction is still high, but maybe you are lucky and things work...
Any opinion about it?
-----------------------------------------------------------------------
My last mods: Partita IVA e CF | Pro EU VAT Number | Sales Agents | Pricelist Pro
-----------------------------------------------------------------------
In these situations, you just have to leave it be. You can't be held responsible for your mod not working with every other mod out there (take PC applications for example, they conflict on occasion - it just happens)
Jay, you are perfectly right... but I'm incidentally personally work on some (3-4) indipendent vqmod mods. In same cases, with "standard" coding my mods conflict each other...JAY6390 wrote:Personally I try to have as little effect on the original code as I possibly can but sometimes it's inevitable that you are going to make changes that have the potential to screw up another mod/a mod will screw up your matches
In these situations, you just have to leave it be. You can't be held responsible for your mod not working with every other mod out there (take PC applications for example, they conflict on occasion - it just happens)

So I tried to code these mods in order to not conflicting each other and the only way I currently found was that "complicate" one I was showing you...
Ok, you can't avoid conflict with the world of mods out there... but at least your own mods should be compatible!!! This is my situation!
-----------------------------------------------------------------------
My last mods: Partita IVA e CF | Pro EU VAT Number | Sales Agents | Pricelist Pro
-----------------------------------------------------------------------
But I think what Jay says kinda negates it...
It looks like your example is 2 mods that want to edit the same exact line in the same exact way, yeilding different results. But then the mods will have logical conflicts anyway.
if mod 1 says:
search: blue
replace: red
and mod 2 says
search: blue
replace: green
even if you tried some passive
str_replace(blue, red, $line)
str_replace(blue, gree, $line)
The end result is that those 2 mods do diff things to the same line are not compatible anyway.
hmm... ;-) hope not annoying... if yes, please tell me... I will stop! Actually I'm saying :Qphoria wrote:I think I see what you mean madimar,
But I think what Jay says kinda negates it...
It looks like your example is 2 mods that want to edit the same exact line in the same exact way, yeilding different results. But then the mods will have logical conflicts anyway.
if mod 1 says:
search: blue
replace: red
and mod 2 says
search: blue
replace: green
even if you tried some passive
str_replace(blue, red, $line)
str_replace(blue, gree, $line)
The end result is that those 2 mods do diff things to the same line are not compatible anyway.
str_replace(blue, blue red, $line)
str_replace(blue, blue green, $line)
result: blue green red
My typical case is in some mysql query, where I could typically need to add some fields to be select.
See please me original example (slightly modified):
Code: Select all
<operation>
<search position="after"><![CDATA[
$sql = "SELECT o.order_id, CONCAT(o.firstname, ' ', o.lastname) AS customer, (SELECT os.name FROM " . DB_PREFIX . "order_status os WHERE os.order_status_id = o.order_status_id AND os.language_id = '" . (int)$this->config->get('config_language_id') . "') AS status, o.total, o.currency_code, o.currency_value, o.date_added, o.date_modified FROM `" . DB_PREFIX . "order` o";
]]></search>
<add><![CDATA[
// madimar mod
$sql = str_replace (' FROM `', ', sr.name AS sales_rep FROM `', $sql);
// madimar mod end
]]></add>
</operation>
Code: Select all
<operation>
<search position="after"><![CDATA[
$sql = "SELECT o.order_id, CONCAT(o.firstname, ' ', o.lastname) AS customer, (SELECT os.name FROM " . DB_PREFIX . "order_status os WHERE os.order_status_id = o.order_status_id AND os.language_id = '" . (int)$this->config->get('config_language_id') . "') AS status, o.total, o.currency_code, o.currency_value, o.date_added, o.date_modified FROM `" . DB_PREFIX . "order` o";
]]></search>
<add><![CDATA[
// madimar mod
$sql = str_replace (' FROM `', ', newfield AS newfield FROM `', $sql);
// madimar mod end
]]></add>
</operation>
$sql = "SELECT o.order_id, CONCAT(o.firstname, ' ', o.lastname) AS customer, (SELECT os.name FROM " . DB_PREFIX . "order_status os WHERE os.order_status_id = o.order_status_id AND os.language_id = '" . (int)$this->config->get('config_language_id') . "') AS status, o.total, o.currency_code, o.currency_value, o.date_added, o.date_modified, sr.name AS sales_rep, newfield AS newfield FROM `" . DB_PREFIX . "order` o";
.... for my own mods maybe I could do the same also with vqmod replace...




-----------------------------------------------------------------------
My last mods: Partita IVA e CF | Pro EU VAT Number | Sales Agents | Pricelist Pro
-----------------------------------------------------------------------
It works great. I'm working locally as the only user and this machine is plenty fast enough. Is there anything in the formatting of the XML files that causes this to happen or is it just PHP and the OS?Qphoria wrote:That was a feature I added to avoid write locking. It means the vqcache file couldn't be written to in a timely manner and took up to 1 sec to be written. It typically means your host is slow. But does it still work?drivenbyweb wrote:My log file has a bunch of lines in it that say ---DELAYED WRITE---. Searched google and the forum but can seem to find what it means. Does anyone know?
All I'm getting is the "VQMOD HAS BEEN INSTALLED ON YOUR SYSTEM!" every time I run the installer, nothing more. Nothing in server error logs, no new files in vqmod folder, nothing in vqcache either. Example mods don't seem to work, at least I'm not getting anything at all neither by using helloworld example nor other xml files from examples folder.
Tried both 775 and 777 to vqmod and vqcache, also tried both recursively.
Can't read 32 pages of discussion here at the moment, what could be the problem?
UPD:
Just noticed admin/index.php needs to be writable too and since it wasn't it didn't get changed. Actually it would be cool if there was an is_writable check or something and an error message about permissions in the installer.
Users browsing this forum: No registered users and 5 guests