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:

bash
composer require keviontechnologies/module-base

Enable the module:

bash
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:

bash
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 log cleanly to var/log/kevion_base.log with configurable log rotation and severity thresholds.

Configuration

Configure logging via app/code/Kevion/Base/etc/config.xml or in the Magento Admin panel at Stores → Configuration → Kevion Technologies → Base → Logging.

Options

Log LevelDEBUGMinimum severity level to record (DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL)
Log Rotation7Retention window in days before log files are auto-purged

Usage in Your Code

Inject Kevion\Base\Model\Logger\Logger via Dependency Injection in your classes:

php
namespace Vendor\MyModule\Service;

use Kevion\Base\Model\Logger\Logger;
use Throwable;

class OrderSyncService
{
    public function __construct(
        private Logger $logger
    ) {}

    public function execute(int $orderId): void
    {
        $this->logger->info('Starting order sync process', ['order_id' => $orderId]);

        try {
            // Perform sync operations...
            $this->logger->debug('Order sync completed successfully', ['order_id' => $orderId]);
        } catch (Throwable $e) {
            // Log exception details with file, line, and backtrace
            $this->logger->logException($e);
            $this->logger->error('Failed to sync order', [
                'order_id' => $orderId,
                'error' => $e->getMessage()
            ]);
        }
    }
}

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

  • •ImporterInterface — Defines the contract for all importers
  • •AbstractImporter — Base class with batch processing, validation hooks, and error collection
  • •ImportProcessor — Orchestrates the import pipeline

Creating an Importer

php
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

bash
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

php
use Kevion\Base\Model\Scheduler\Task;

$task = $scheduler->register(
    'vendor_module_task',
    '0 */2 * * *',  // every 2 hours
    VendorModule\Cron\Task::class
);

CLI Management

bash
# 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:

Changelog

v1.0.02026-08-12
  • •Initial public release under vendor name `keviontechnologies/module-base`
  • •Private Packagist repository support (https://repo.packagist.com/keviontechnologies/)
  • •Registered full CLI command suite in di.xml: kevion:import:run, kevion:scheduler:list, kevion:scheduler:run, kevion:sysinfo, kevion:modules:list, kevion:modules:check-updates, kevion:logs:clear
  • •Unified Monolog-based logger (var/log/kevion_base.log) with configurable levels, rotation, and stack traces
  • •Extensible import engine supporting batch processing, row validation, and field mapping
  • •Admin notification feed reader for product update announcements
  • •Database-backed task scheduler storing tasks in kevion_base_schedule
  • •Backend config models for serialized configuration and menu management
Kevion Base Module v1.0.0 Documentation | Kevion