-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreadme.html
52 lines (40 loc) · 3.72 KB
/
readme.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Zen Cart Notifier Report</title>
</head>
<body>
<h1 id="zencartnotifierreport">Zen Cart Notifier Report</h1>
<h3>Version 1.1.0, by lat9</h3>
<h4>Copyright, 2019-2020. <a href="https://vinosdefrutastropicales.com" target="_blank">Vinos de Frutas Tropicales</a></h4>
<h4>Zen Cart Support Thread: <a href="https://www.zen-cart.com/showthread.php?225903-Zen-Cart-Notifier-Report-Support-Thread&p=1361711#post1361711" target="_blank">https://www.zen-cart.com/showthread.php?225903-Zen-Cart-Notifier-Report-Support-Thread&p=1361711#post1361711</a></h4>
<p>As more and more plugins are relying on Zen Cart notifiers to perform their customizations, it can be a developer's debug nightmare if an expected notification isn't present. It's kind of like you're waiting for something to do, but no one's there to say "Go do it".</p>
<p>This simple script traverses a site's <code>DIR_FS_CATALOG</code> directory ... and <em>all</em> contained sub-directories ... searching all <code>.php</code> files for the presence of a <code>->notify</code> call (i.e. the notification itself). Its output is created in a file named <code>notifier_report_YYYYMMDD_HHMMSS.txt</code> in the site's <code>/logs</code> directory. That file contains a list of all <code>.php</code> files containing a notification, identifying the line number(s) and notifications issued.</p>
<p>Here's a sample of the output:</p>
<pre><code>Start notifier report (v1.1.0), created 2020-04-16 13:54:54
admin/admin_activity.php
line#293: 'NOTIFY_ADMIN_ACTIVITY_LOG_RESET'
admin/attributes_controller.php
line#421: 'NOTIFY_ATTRIBUTE_CONTROLLER_ADD_PRODUCT_ATTRIBUTES', $products_attributes_id
line#565: 'NOTIFY_ATTRIBUTE_CONTROLLER_UPDATE_PRODUCT_ATTRIBUTE', $attribute_id
line#584: 'NOTIFY_ATTRIBUTE_CONTROLLER_DELETE_ATTRIBUTE', array('attribute_id' => $attribute_id), $attribute_id
line#601: 'NOTIFY_ATTRIBUTE_CONTROLLER_DELETE_ALL', array('pID' => $_POST['products_filter'])
line#615: 'NOTIFY_ATTRIBUTE_CONTROLLER_DELETE_OPTION_NAME_VALUES', array('pID' => $_POST['products_filter'], 'options_id' => $_POST['products_options_id_all'])
</code></pre>
<p><strong>Note</strong>: This is a <em>developer tool</em>, not a "proper" plugin. There's no language file, no means (although it's open source) to create an entry in the admin's menu.</p>
<h2 id="installation">Installation</h2>
<p>Installation is simple (there's only one file). Simply copy <code>notifier_report.php</code> to your site's admin directory (where the <code>admin_account.php</code> and <code>admin_activity.php</code> files reside). Admin <em>superusers only</em> will be able to access the script, entering a link similar to <code>www.example.com/myadmin/notifier_report.php</code> in the browser's address. The script will take a while (depending on how many files are in that directory-tree) and will print a message to the screen once complete:</p>
<pre><code>Report created: C:/xampp/htdocs/testsite/logs/notifier_report_20190916_135949.txt.
</code></pre>
<p>To create a report in <em>markdown</em> format, simply add a 'markdown' variable to that link, e.g. <code>www.example.com/myadmin/notifier_report.php?markdown</code>. That will produce a markdown-formatted file suitable for inclusion in the Zen Cart <a href="https://github.com/zencart/documentation" target="_blank">documentation</a>.</p>
<h2>Change History</h2>
<ul>
<li>v1.1.0, 20200416:<ol>
<li>CHANGE: Enable a <em>markdown</em>-formatted output. Also removes superfluous information from the report.</li>
</ol></li>
<li>v1.0.0, 20190916: Initial release.</li>
</ul>
</body>
</html>