Files
server/usr/share/psa-pear/pear/horde-check-logger
2026-01-07 20:52:11 +01:00

40 lines
1.1 KiB
PHP
Executable File

#!/usr/bin/env php
<?php
/**
* This script verifies that the logger was initialized without errors.
*
* Copyright 2011-2017 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL-2). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl.
*
* @author Michael Slusarz <slusarz@horde.org>
* @category Horde
* @license http://www.horde.org/licenses/lgpl LGPL-2
* @package Horde
*/
$baseFile = __DIR__ . '/../lib/Application.php';
if (file_exists($baseFile)) {
require_once $baseFile;
} else {
require_once 'PEAR/Config.php';
require_once PEAR_Config::singleton()
->get('horde_dir', null, 'pear.horde.org') . '/lib/Application.php';
}
Horde_Registry::appInit('horde', array(
'authentication' => 'none',
'cli' => true
));
// Ensure Logger object was initialized.
$injector->getInstance('Horde_Log_Logger');
if ($error = $injector->getInstance('Horde_Core_Factory_Logger')->error) {
$cli->fatal($error);
} else {
$cli->message('Logger successfully loaded', 'cli.success');
Horde::log('Test log message.');
$cli->message('Sent test log message.');
}