mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-06-13 01:59:56 -04:00
- Remove unused function - reorder parameters in log(), logTo() and log_plugin_message() Signed-off-by: objec <objecttothis@gmail.com>
27 lines
703 B
PHP
27 lines
703 B
PHP
<?php
|
|
|
|
use CodeIgniter\Events\Events;
|
|
|
|
if (!function_exists('log_plugin_message')) {
|
|
function log_plugin_message(string $level, string $message, string $pluginId, ?string $logName = null): void
|
|
{
|
|
service('pluginLogger')->log($level, $message, $pluginId, $logName);
|
|
}
|
|
}
|
|
|
|
if (!function_exists('pluginContent')) {
|
|
function pluginContent(string $section, array $data = []): string
|
|
{
|
|
ob_start();
|
|
Events::trigger("view:{$section}", $data);
|
|
return ob_get_clean() ?: '';
|
|
}
|
|
}
|
|
|
|
if (!function_exists('pluginContentExists')) {
|
|
function pluginContentExists(string $section): bool
|
|
{
|
|
return !empty(Events::listeners("view:{$section}"));
|
|
}
|
|
}
|