Download the PHP package klucznik/cog-framework without Composer
On this page you can find all versions of the php package klucznik/cog-framework. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package cog-framework
Cog Framework
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.5 or newer
- Extensions:
mbstring,json,dom,libxml,mysqli,simplexml
Installation
Bootstrapping
The framework is initialized once per request through Cog\BaseApplication::initialize().
The repository ships a working example of this wiring:
prepend.inc.php— loads the Composer autoloader and initializes the applicationpublic/index.php— main web entry pointcog— the console command
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:
Testing
The suite runs against a MySQL fixture database. Load it once:
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:
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.
PostgreSQL
TestPostgreSql exercises the PostgreSQL adapter against a parallel fixture. It
is optional - every test in it skips when the pgsql extension, the server or
the fixture is missing, so the suite stays green without one. To run it, load the
schema and let the COG_TEST_PG_* variables point at it:
The adapter is not at parity with the MySQL one: PostgreSQL has no self-updating
timestamp column, so the code generator emits no optimistic locking for a
PostgreSQL schema. See the header of src/Test/cog_framework_test_pg.sql.
License
MIT — see LICENSE.
All versions of cog-framework with dependencies
ext-mbstring Version *
ext-json Version *
ext-dom Version *
ext-libxml Version *
ext-mysqli Version *
ext-simplexml Version *
league/container Version ^5.2
symfony/filesystem Version ^7.4||^8.0
symfony/routing Version ^7.4||^8.0
symfony/http-kernel Version ^7.4||^8.0
symfony/http-foundation Version ^7.4||^8.0
symfony/config Version ^7.4||^8.0
symfony/console Version ^7.4||^8.0
symfony/stopwatch Version ^7.4||^8.0
symfony/mime Version ^7.4||^8.0
symfony/string Version ^7.4||^8.0
symfony/event-dispatcher Version ^7.4||^8.0
symfony/error-handler Version ^7.4||^8.0
symfony/translation-contracts Version ^3.0
vlucas/phpdotenv Version ^5.6
robmorgan/phinx Version ^0.16.12