I try to code a small plugin for osticket but it doesnt work. Here is the code
plugin.php
<?php
// plugin.php
// include/plugins/test-logger/
return array(
'id' => 'test-logger:minimal',
'version' => '1.0',
'name' => 'Minimal Debug Logger',
'author' => 'Test User',
'description' => 'Write log entry (bootstrap).',
'url' => '#',
'plugin' => 'MinimalLoggerPlugin.php:MinimalLoggerPlugin',
);
MinimalLoggerPlugin.php
<?php
// MinimalLoggerPlugin.php
// include/plugins/test-logger/
require_once INCLUDE_DIR . 'class.plugin.php';
class MinimalLoggerPlugin extends Plugin {
public $config_class = 'MinimalLoggerConfig';
function bootstrap() {
global $ost;
if ($ost) {
$ost->logDebug(
'MINIMAL_DEBUG_TEST',
'MinimalLoggerPlugin loaded in bootstrap(). Time: ' . time()
);
}
error_log("--- PHP_ERROR_LOG_TEST: try from MinimalPlugin ---");
}
}
class MinimalLoggerConfig extends PluginConfig {
function getDefaults() {
return array();
}
}
?>
I can install and active/deactivate it in osticket 1.18 but I get no log message. I also tried error_log but it also doesnt work. It seems that bootstrap is never called. Can anyone tell me what is wrong with my code?