klucznik/cog-framework

PHP framework built on Symfony components

Maintainers

Package info

github.com/klucznik/cog-framework

pkg:composer/klucznik/cog-framework

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.9.0 2026-08-08 14:06 UTC

This package is auto-updated.

Last update: 2026-08-10 18:15:48 UTC


README

A PHP framework built on Symfony components, with a database code generator that produces typed model classes from an existing MySQL schema.

Requirements

  • PHP 8.3 or newer
  • Extensions: mbstring, json, dom, libxml, mysqli, simplexml

Installation

composer require klucznik/cog-framework

Bootstrapping

The framework is initialized once per request through Cog\BaseApplication::initialize(). The repository ships a working example of this wiring:

These are reference examples, not files you install. Copy them into your own project and adjust the paths to your Composer autoloader.

Cog\BaseApplication is meant to be extended, you should create your own Application class with your own modifications / customizations.

Code generation

The generator reads a codegen.xml configuration file describing the database connection and output paths. Copy codegen.xml-dist to codegen.xml, fill in your settings, then run:

./cog db:codegen

Testing

The suite runs against a MySQL fixture database. Load it once:

mysql -u root -p < src/Test/cog_test.sql

Connection details come from the COG_TEST_DB_* environment variables; override the defaults in phpunit.xml.dist by copying it to phpunit.xml (git-ignored). Then:

composer test

The bootstrap runs the code generator against that database before any test executes, into the git-ignored .phpunit.codegen/ build directory, and registers an autoloader for the resulting Generated\ and App\ classes. TestCodegen runs first and reports any generation failure; the rest of the suite can rely on the generated ORM layer being present.

License

MIT — see LICENSE.