I have this example ocmod:
Code: Select all
<modification>
<name>OpenCart Log Cleaner Simple</name>
<code>log_cleaner_simple</code>
<version>1.0.0</version>
<author>szabolevi98</author>
<link>https://levente.net</link>
<file path="system/library/log.php">
<operation error="log">
<search>
<![CDATA[public function __construct(string $filename) {]]>
</search>
<add position="after">
<![CDATA[ if (file_exists(DIR_LOGS . $filename) && filesize(DIR_LOGS . $filename) > ((defined('MAX_LOG_SIZE') ? MAX_LOG_SIZE : 50) * 1024 * 1024)) {
file_put_contents(DIR_LOGS . $filename, '');
}]]>
</add>
</operation>
<operation error="log">
<search>
<![CDATA[namespace Opencart\System\Library;]]>
</search>
<add position="replace">
<![CDATA[namespace Opencart\System\Library\Extension\Ocmod;]]>
</add>
</operation>
</file>
</modification>
I'm using phpStorm as IDE and I have xdebug installed, so I checked that this file never called. It calls the original file at /system/library/log.php.
What is the error here? I even modified the namespace. (I tried without it also)
Or it is not possible to make ocmod for system/library, it is only possible for controllers and models?