preserved.php 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <?php return array (
  2. 'cfcc329eb831525d81ee59e90755b5b6' =>
  3. array (
  4. 'criteria' =>
  5. array (
  6. 'name' => 'controlerrorlog',
  7. ),
  8. 'object' =>
  9. array (
  10. 'name' => 'controlerrorlog',
  11. 'path' => '{core_path}components/controlerrorlog/',
  12. 'assets_path' => '',
  13. ),
  14. ),
  15. '8ab77a1c2fb4a17efdea27b6756be973' =>
  16. array (
  17. 'criteria' =>
  18. array (
  19. 'key' => 'controlerrorlog.last_lines',
  20. ),
  21. 'object' =>
  22. array (
  23. 'key' => 'controlerrorlog.last_lines',
  24. 'value' => '15',
  25. 'xtype' => 'numberfield',
  26. 'namespace' => 'controlerrorlog',
  27. 'area' => 'controlerrorlog.main',
  28. 'editedon' => NULL,
  29. ),
  30. ),
  31. '17b191c27199c7801528bc7560b500da' =>
  32. array (
  33. 'criteria' =>
  34. array (
  35. 'key' => 'controlerrorlog.refresh_freq',
  36. ),
  37. 'object' =>
  38. array (
  39. 'key' => 'controlerrorlog.refresh_freq',
  40. 'value' => '60',
  41. 'xtype' => 'numberfield',
  42. 'namespace' => 'controlerrorlog',
  43. 'area' => 'controlerrorlog.main',
  44. 'editedon' => NULL,
  45. ),
  46. ),
  47. 'e07b5dca8fbe408e15ca8a54b3c955ff' =>
  48. array (
  49. 'criteria' =>
  50. array (
  51. 'key' => 'controlerrorlog.auto_refresh',
  52. ),
  53. 'object' =>
  54. array (
  55. 'key' => 'controlerrorlog.auto_refresh',
  56. 'value' => '1',
  57. 'xtype' => 'combo-boolean',
  58. 'namespace' => 'controlerrorlog',
  59. 'area' => 'controlerrorlog.main',
  60. 'editedon' => NULL,
  61. ),
  62. ),
  63. '3634058ff6f3b9e0998aad8241d81069' =>
  64. array (
  65. 'criteria' =>
  66. array (
  67. 'key' => 'controlerrorlog.control_frontend',
  68. ),
  69. 'object' =>
  70. array (
  71. 'key' => 'controlerrorlog.control_frontend',
  72. 'value' => '',
  73. 'xtype' => 'combo-boolean',
  74. 'namespace' => 'controlerrorlog',
  75. 'area' => 'controlerrorlog.main',
  76. 'editedon' => NULL,
  77. ),
  78. ),
  79. '480508a17f6a747f6821938f4924e734' =>
  80. array (
  81. 'criteria' =>
  82. array (
  83. 'key' => 'controlerrorlog.admin_email',
  84. ),
  85. 'object' =>
  86. array (
  87. 'key' => 'controlerrorlog.admin_email',
  88. 'value' => '',
  89. 'xtype' => 'textfield',
  90. 'namespace' => 'controlerrorlog',
  91. 'area' => 'controlerrorlog.main',
  92. 'editedon' => NULL,
  93. ),
  94. ),
  95. 'a7c7c35d35d463638db14ae06f8d0eb4' =>
  96. array (
  97. 'criteria' =>
  98. array (
  99. 'category' => 'controlErrorLog',
  100. ),
  101. 'object' =>
  102. array (
  103. 'id' => 14,
  104. 'parent' => 0,
  105. 'category' => 'controlErrorLog',
  106. 'rank' => 0,
  107. ),
  108. ),
  109. '1935d8dd2279b94c384b3fcc93d60783' =>
  110. array (
  111. 'criteria' =>
  112. array (
  113. 'name' => 'controlErrorLog',
  114. ),
  115. 'object' =>
  116. array (
  117. 'id' => 7,
  118. 'source' => 1,
  119. 'property_preprocess' => 0,
  120. 'name' => 'controlErrorLog',
  121. 'description' => '',
  122. 'editor_type' => 0,
  123. 'category' => 14,
  124. 'cache_type' => 0,
  125. 'plugincode' => 'switch ($modx->event->name) {
  126. case \'OnManagerPageBeforeRender\':
  127. if ($modx->hasPermission(\'error_log_view\')) {
  128. $modx->controller->addLexiconTopic(\'controlerrorlog:default\');
  129. $modx->controller->addCss($modx->getOption(\'assets_url\').\'components/controlerrorlog/css/mgr/main.css\');
  130. $modx->controller->addJavascript($modx->getOption(\'assets_url\').\'components/controlerrorlog/js/mgr/cel.default.js\');
  131. $response = $modx->runProcessor(\'mgr/errorlog/get\', array(\'includeContent\'=>false), array(\'processors_path\' => $modx->getOption(\'core_path\') . \'components/controlerrorlog/processors/\'));
  132. $resObj = $response->getObject();
  133. $_html = "<script> var cel_config = " . $modx->toJSON($resObj) . "; </script>";
  134. $modx->controller->addHtml($_html);
  135. }
  136. break;
  137. case \'OnWebPageComplete\':
  138. $email = $modx->getOption(\'controlerrorlog.admin_email\');
  139. if ($modx->context->get(\'key\') == \'mgr\' || empty($email) || !$modx->getOption(\'controlerrorlog.control_frontend\')) return;
  140. $f = $modx->getOption(xPDO::OPT_CACHE_PATH) . \'logs/error.log\';
  141. if (file_exists($f)) {
  142. $casheHash = $modx->cacheManager->get(\'error_log\');
  143. $hash = md5_file($f);
  144. if (filesize($f) > 0 && !empty($casheHash) && $casheHash != $hash) {
  145. $modx->lexicon->load(\'controlerrorlog:default\');
  146. /** @var modPHPMailer $mail */
  147. $mail = $modx->getService(\'mail\', \'mail.modPHPMailer\');
  148. $mail->setHTML(true);
  149. $mail->set(modMail::MAIL_SUBJECT, $modx->lexicon(\'error_log_email_subject\'));
  150. $mail->set(modMail::MAIL_BODY, $modx->lexicon(\'error_log_email_body\', array(\'siteName\' => $modx->config[\'site_name\'])));
  151. $mail->set(modMail::MAIL_SENDER, $modx->getOption(\'emailsender\'));
  152. $mail->set(modMail::MAIL_FROM, $modx->getOption(\'emailsender\'));
  153. $mail->set(modMail::MAIL_FROM_NAME, $modx->getOption(\'site_name\'));
  154. $mail->address(\'to\', $email);
  155. $mail->address(\'reply-to\', $modx->getOption(\'emailsender\'));
  156. if (!$mail->send()) {
  157. print (\'An error occurred while trying to send the email: \'.$modx->mail->mailer->ErrorInfo);
  158. }
  159. $mail->reset();
  160. }
  161. if ($casheHash != $hash) {
  162. $modx->cacheManager->set(\'error_log\', $hash, 0);
  163. }
  164. }
  165. break;
  166. }',
  167. 'locked' => 0,
  168. 'properties' => NULL,
  169. 'disabled' => 0,
  170. 'moduleguid' => '',
  171. 'static' => 0,
  172. 'static_file' => 'core/components/controlerrorlog/elements/plugins/plugin.controlerrorlog.php',
  173. 'content' => 'switch ($modx->event->name) {
  174. case \'OnManagerPageBeforeRender\':
  175. if ($modx->hasPermission(\'error_log_view\')) {
  176. $modx->controller->addLexiconTopic(\'controlerrorlog:default\');
  177. $modx->controller->addCss($modx->getOption(\'assets_url\').\'components/controlerrorlog/css/mgr/main.css\');
  178. $modx->controller->addJavascript($modx->getOption(\'assets_url\').\'components/controlerrorlog/js/mgr/cel.default.js\');
  179. $response = $modx->runProcessor(\'mgr/errorlog/get\', array(\'includeContent\'=>false), array(\'processors_path\' => $modx->getOption(\'core_path\') . \'components/controlerrorlog/processors/\'));
  180. $resObj = $response->getObject();
  181. $_html = "<script> var cel_config = " . $modx->toJSON($resObj) . "; </script>";
  182. $modx->controller->addHtml($_html);
  183. }
  184. break;
  185. case \'OnWebPageComplete\':
  186. $email = $modx->getOption(\'controlerrorlog.admin_email\');
  187. if ($modx->context->get(\'key\') == \'mgr\' || empty($email) || !$modx->getOption(\'controlerrorlog.control_frontend\')) return;
  188. $f = $modx->getOption(xPDO::OPT_CACHE_PATH) . \'logs/error.log\';
  189. if (file_exists($f)) {
  190. $casheHash = $modx->cacheManager->get(\'error_log\');
  191. $hash = md5_file($f);
  192. if (filesize($f) > 0 && !empty($casheHash) && $casheHash != $hash) {
  193. $modx->lexicon->load(\'controlerrorlog:default\');
  194. /** @var modPHPMailer $mail */
  195. $mail = $modx->getService(\'mail\', \'mail.modPHPMailer\');
  196. $mail->setHTML(true);
  197. $mail->set(modMail::MAIL_SUBJECT, $modx->lexicon(\'error_log_email_subject\'));
  198. $mail->set(modMail::MAIL_BODY, $modx->lexicon(\'error_log_email_body\', array(\'siteName\' => $modx->config[\'site_name\'])));
  199. $mail->set(modMail::MAIL_SENDER, $modx->getOption(\'emailsender\'));
  200. $mail->set(modMail::MAIL_FROM, $modx->getOption(\'emailsender\'));
  201. $mail->set(modMail::MAIL_FROM_NAME, $modx->getOption(\'site_name\'));
  202. $mail->address(\'to\', $email);
  203. $mail->address(\'reply-to\', $modx->getOption(\'emailsender\'));
  204. if (!$mail->send()) {
  205. print (\'An error occurred while trying to send the email: \'.$modx->mail->mailer->ErrorInfo);
  206. }
  207. $mail->reset();
  208. }
  209. if ($casheHash != $hash) {
  210. $modx->cacheManager->set(\'error_log\', $hash, 0);
  211. }
  212. }
  213. break;
  214. }',
  215. ),
  216. ),
  217. 'e7ab7ce05f18e304c8359c0b2a3935b7' =>
  218. array (
  219. 'criteria' =>
  220. array (
  221. 'pluginid' => 7,
  222. 'event' => 'OnManagerPageBeforeRender',
  223. ),
  224. 'object' =>
  225. array (
  226. 'pluginid' => 7,
  227. 'event' => 'OnManagerPageBeforeRender',
  228. 'priority' => 0,
  229. 'propertyset' => 0,
  230. ),
  231. ),
  232. 'a272f82e0dc47cd422a7593cd11e7ffa' =>
  233. array (
  234. 'criteria' =>
  235. array (
  236. 'pluginid' => 7,
  237. 'event' => 'OnWebPageComplete',
  238. ),
  239. 'object' =>
  240. array (
  241. 'pluginid' => 7,
  242. 'event' => 'OnWebPageComplete',
  243. 'priority' => 0,
  244. 'propertyset' => 0,
  245. ),
  246. ),
  247. );