0) { ob_end_flush(); } ob_start(static fn ($buffer) => $buffer); } /* * -------------------------------------------------------------------- * Debug Toolbar Listeners. * -------------------------------------------------------------------- * If you delete, they will no longer be collected. */ if (CI_DEBUG && ! is_cli()) { Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect'); service('toolbar')->respond(); // Hot Reload route - for framework use on the hot reloader. if (ENVIRONMENT === 'development') { service('routes')->get('__hot-reload', static function (): void { (new HotReloader())->run(); }); } } }); $config = new Load_config(); Events::on('post_controller_constructor', [$config, 'load_config']); $db_log = new Db_log(); Events::on('DBQuery', [$db_log, 'db_log_queries']); $method = new Method(); Events::on('pre_controller', [$method, 'validate_method']); /** * This event triggered when an item sale occurs. * Plugin functionality is triggered here. */ Events::on('item_sale', static function (): void { // Call plugin controller methods to handle the item sale data sent in the static function. }); /** * This event triggered when an item return occurs. * Plugin functionality is triggered here. */ Events::on('item_return', static function (): void { // Call plugin controller methods to handle the item return data sent in the static function. }); /** * This event triggered when an item is changed. This can be an item create, update or delete. * Plugin functionality is triggered here. */ Events::on('item_change', static function (int $itemId): void { // Call plugin controller methods to handle the item change data sent in the static function. log_message('debug', "Item change event triggered on item ID: $itemId"); }); /** * This event triggered when an item inventory action occurs. * This can be during a receiving action or the update inventory partial view in items. */ Events::on('item_inventory', static function (): void { // Call plugin controller methods to handle the item inventory data sent in the static function. }); /** * This event triggered when an items CSV import occurs. * Plugin functionality is triggered here. */ Events::on('items_csv_import', static function (): void { // Call plugin controller methods to handle the items CSV import data sent in the static function. }); /** * This event triggered when a customers CSV import occurs. * Plugin functionality is triggered here. */ Events::on('customers_csv_import', static function (): void { // Call plugin controller methods to handle the customers CSV import data sent in the static function. });