Documentation

Complete guide for Kevion Base Module v1.0.0

Getting Started

Kevion Base is the foundational module for all Kevion Magento 2 extensions. It provides shared infrastructure including logging, import engine, scheduler, notifications, and CLI commands.

Requirements

Magento 2.4.x (Open Source or Commerce)
PHP 8.1 or higher
Composer 2.x

Installation

Install via Composer:

composer require kevion/module-base

Enable the module:

php bin/magento module:enable Kevion_Base

php bin/magento setup:upgrade

php bin/magento cache:clean

Verifying Installation

Run the following CLI command to confirm the module is active:

php bin/magento kevion:modules:list

You should see `Kevion_Base` listed with version 1.0.0.

Logger

Kevion Base provides a unified logging system built on Monolog. All Kevion extensions write to the same log file (`var/log/kevion.log`) for easier debugging.

Configuration

Configure logging via `app/code/Kevion/Base/etc/config.xml` or the Magento admin panel at **Stores → Configuration → Kevion → Base → Logging**.

### Options

SettingDefaultDescription
Log Level`DEBUG`Minimum log level to record (DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY)
Log Rotation`7`Number of days to retain log files
Enable Stack Trace`Yes`Include stack traces in ERROR and above entries

Usage in Your Code

use Kevion\Base\Model\Logger;

class YourClass

{

public function __construct(

private Logger $logger

) {}

public function doSomething(): void

{

$this->logger->info('Processing started');

$this->logger->error('Something went wrong', ['exception' => $e]);

}

}

Import Engine

The import engine provides a framework for batch-processing CSV, XML, and JSON data with row validation, error reporting, and progress tracking.

Architecture

ImporterInterfaceDefines the contract for all importers
AbstractImporterBase class with batch processing, validation hooks, and error collection
ImportProcessorOrchestrates the import pipeline

Creating an Importer

use Kevion\Base\Model\Import\AbstractImporter;

class ProductImporter extends AbstractImporter

{

protected function validateRow(array $row): array

{

$errors = [];

if (empty($row['sku'])) {

$errors[] = 'SKU is required';

}

return $errors;

}

protected function processRow(array $row): void

{

// Process each validated row

}

}

Running an Import

php bin/magento kevion:import:run Vendor_Module \

--file=/path/to/data.csv \

--format=csv \

--batch=100

Scheduler

Database-backed cron scheduler that allows extensions to register recurring tasks without editing Magento's `crontab.xml`.

Registering a Task

use Kevion\Base\Model\Scheduler\Task;

$task = $scheduler->register(

'vendor_module_task',

'0 */2 * * *', // every 2 hours

VendorModule\Cron\Task::class

);

CLI Management

# List all scheduled tasks

php bin/magento kevion:scheduler:list

# Run a specific task manually

php bin/magento kevion:scheduler:run vendor_module_task

CLI Commands

Kevion Base provides the following CLI commands:

CommandDescription
`kevion:modules:list`List all installed Kevion modules with versions
`kevion:modules:check-updates`Check for available updates from the Kevion feed
`kevion:logs:clear`Clear old log files based on rotation settings
`kevion:import:run`Run a registered import processor
`kevion:scheduler:list`List all scheduled tasks
`kevion:scheduler:run`Execute a specific task immediately
`kevion:sysinfo`Display system information for support requests

Changelog

v1.0.02026-07-18
  • Initial public release
  • Unified Monolog-based logger with configurable levels and log rotation
  • Extensible import engine with batch processing, validation, and field mapping
  • Admin notification feed for Kevion product updates and announcements
  • Module feed reader to check for available updates
  • Database-backed scheduler for managing cron tasks
  • CLI commands: kevion:modules:list, kevion:modules:check-updates, kevion:logs:clear
  • Backend config models for serialized data and menu configuration
  • Setup/uninstall scripts with clean database management