cosray / cms
Cosray content management system and framework
Requires
- php: ^8.5
- ext-curl: *
- ext-dom: *
- ext-gd: *
- ext-intl: *
- ext-pgsql: *
- ext-sodium: *
- ext-xml: *
- celemas/boiler: ^0.4.0
- celemas/core: ^0.4.0
- celemas/quma: ^0.2.0
- celemas/session: ^0.2.0
- celemas/sire: ^0.4.0
- gumlet/php-image-resize: 2.0.*
- hidehalo/nanoid-php: ^2
- psr/log: ^3.0
- vlucas/phpdotenv: ^5.6
Requires (Dev)
- celemas/dev: ^4.2
- filp/whoops: ^2.15
- laminas/laminas-diactoros: ^3
Suggests
- filp/whoops: Enables pretty debug error pages in debug mode.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-22 20:08:34 UTC
README
Cosray is a PHP content management framework with code-first content models, PostgreSQL-backed storage, and an admin panel for editors.
[!WARNING] Cosray has not had its first public release. Its API, data model, and panel design are still changing. These documents explain the current implementation, not a stability promise or a fixed product roadmap.
Starting an application
Cosray\App creates the configuration and CMS bootstrap, installs the default error handler, and registers the CMS catchall route when run() is called. Application-defined node and collection classes are registered before that call:
use Cosray\App; use Cosray\Locales; $app = App::create(dirname(__DIR__), [ 'app.name' => 'mycms', ]); $locales = new Locales(); $locales->add('en', title: 'English', pgDict: 'english'); $app->load($locales); $app->section('Content')->collection(\App\Cms\Collection\Pages::class); $app->node(\App\Cms\Node\HomePage::class); $app->run();
See application setup for environment loading, console commands, panel installation, plugins, and users; content models covers nodes, routes, queries, and rendering.
Requirements
- PHP
^8.5and Composer 2. Required extensions are declared in composer.json; runcomposer check-platform-reqsafter installation. - PostgreSQL with
btree_gist,btree_gin, andunaccent. CI uses PostgreSQL 17. The migration role needs permission to create the required extensions, or an administrator must provision them. - A web server routing requests to the public PHP entrypoint while serving existing public files directly.
- Node.js and pnpm for building the panel, with versions declared in panel/package.json. The transitional legacy richtext migration also needs Node.js, but ordinary CMS requests do not.
Documentation
Read the topic relevant to the task rather than loading every reference. When documentation and implementation disagree, inspect the source and tests before relying on the documented behavior. A current limitation is not a prohibition on exploring a different design.
These links describe a source checkout. Distribution archives omit development documentation and tests; for an installed package, consult the repository at the source reference recorded in its Composer lock file, not necessarily the latest branch.
| Topic | Reference |
|---|---|
| Configuration, console, plugins, users, panel integration | Application setup |
| Nodes, embedded fields, routes, queries, menus, working copies | Content models |
| Assets, image sizes, imports, reference indexes | Media |
| Field descriptors, form transport, custom elements | Editor controls |
| Block types, translation, storage, frontend rendering | Blocks |
| Richtext storage and validation | Richtext format |
| Search selection, queries, safe snippets, deployment | Full-text search |
| CSS conventions and the live styleguide | Panel styles |
| Current shortcuts and keyboard considerations | Panel keyboard |
| PHP tests and isolated database setup | Testing |
| Panel development and tests | Panel |
| Shared PHP/TypeScript behavior fixtures | Contract fixtures |
There is no rolling changelog before the first public release. Git history and tags retain development history; migration requirements belong with the affected feature.
Source map
- src/App.php, src/Bootstrap.php: application integration.
- src/Config/Defaults.php, src/Config.php: settings and typed access.
- src/Node/, src/Field/, src/Value/: schema, persistence, and template-facing values.
- src/Routes.php, src/Controller/: HTTP endpoints and access checks.
- panel/views/, panel/src/, panel/styles/: Boiler SSR views, htmx behaviors, Svelte custom elements, and CSS.
- db/migrations/, db/sql/: schema evolution and named queries.
- tests/, panel/tests/: executable examples and regression coverage.
License
Cosray is licensed under MIT. Bundled third-party files retain their respective licenses; see REUSE.toml.