core.backend — Setup
core.backend — Setup
How to install the package in a host project (Plesk-hosted domain).
1. Require the Package
In the host project's
composer.json (at the domain root, outside /public):{
"require": {
"unvrsl/core-backend": "dev-main"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/olivmiron/core.backend.git"
}
]
}The
require name must match the package's own composer.json name. Repo URL uses https — auth comes from the server's SSH key (generated by Plesk when a domain is linked to GitHub; the key must be added to the repo's deploy keys or the GitHub user).2. Register the Composer Path in Plesk
Composer must run from a folder outside
/public (so vendor isn't web-accessible):su -
plesk ext composer --application -register -domain example.medkronos.com -path "/example.medkronos.com"Then in the domain's Plesk composer menu: [change] folder → pick the new folder → install.
3. Use in Code
<?php
require __DIR__ . '/../vendor/autoload.php';
use UNVRSL\Core\htmlTemplateInit\DocumentShell;
$doc = new DocumentShell(['title' => 'My App']);
echo $doc->open();
// ... content ...
echo $doc->close();Rules: PSR-4 — file name must match class name; namespace
UNVRSL\Core\<folder> maps to src/<folder>.Updating
composer update unvrsl/core-backend