sy / project
Project template
Requires
- php: >=8.1
- sy/bootstrap: ^2.2
- sy/flyway: *
- sy/genini: *
Requires (Dev)
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- 7.1.0
- 7.0.2
- 7.0.1
- 7.0.0
- 6.6.1
- 6.6.0
- 6.5.1
- 6.5.0
- 6.4.11
- 6.4.10
- 6.4.9
- 6.4.8
- 6.4.7
- 6.4.6
- 6.4.5
- 6.4.4
- 6.4.3
- 6.4.2
- 6.4.1
- 6.4.0
- 6.3.1
- 6.3.0
- 6.2.1
- 6.2.0
- 6.1.4
- 6.1.3
- 6.1.2
- 6.1.1
- 6.1.0
- 6.0.0
- 5.5.6
- 5.5.5
- 5.5.4
- 5.5.3
- 5.5.2
- 5.5.1
- 5.5.0
- 5.4.1
- 5.4.0
- 5.3.0
- 5.2.6
- 5.2.5
- 5.2.4
- 5.2.3
- 5.2.2
- 5.2.1
- 5.2.0
- 5.1.0
- 5.0.0
- 4.8.0
- 4.7.3
- 4.7.2
- 4.7.1
- 4.7.0
- 4.6.6
- 4.6.5
- 4.6.4
- 4.6.3
- 4.6.2
- 4.6.1
- 4.6.0
- 4.5.0
- 4.4.1
- 4.4.0
- 4.3.0
- 4.2.2
- 4.2.1
- 4.2.0
- 4.1.3
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.0
- 3.5.1
- 3.5.0
- 3.4.0
- 3.3.0
- 3.2.1
- 3.2.0
- 3.1.1
- 3.1.0
- 3.0.1
- 3.0.0
- 2.3.0
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.1.1
- 1.1.0
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.0.1
- dev-develop
- dev-feature/wysiwyg-backend
This package is auto-updated.
Last update: 2026-11-27 19:48:08 UTC
README
A skeleton to start a new website. Build with sy/bootstrap
Requirements
- Docker
Installation
Start a new project with
composer create-project sy/project [DIRECTORY]
Composer scripts
The project lifecycle is one command, wired to the three Composer events that can happen on an install or an update:
"post-create-project-cmd": ["@sy install"], "post-install-cmd": ["@sy install"], "post-update-cmd": ["@sy install"]
vendor/bin/sy is shipped by sy/bootstrap. sy install is idempotent: every
configuration file that is missing is generated, the plugin files are copied
when absent and refreshed when their vendor copy is newer, and the Sass build
and the migrations run only when they are actually needed. Nothing is
remembered in a state file — every decision is derived from the filesystem.
| Command | Effect |
|---|---|
composer create-project sy/project [DIRECTORY] |
Installs the dependencies, then runs sy install: asks for the missing INI files, builds the assets, migrates the database. |
composer install |
Installs the dependencies, then sy install. |
composer update |
Updates the dependencies, then sy install. |
composer require sy/bootstrap-<plugin> |
Installs the plugin, then sy install runs through post-update-cmd. |
composer install-plugin <plugin> [version] |
Shorthand for composer require sy/bootstrap-<plugin>[:version]. |
composer sy <verb> |
Any installer verb directly: install, sync, build, db, doctor. |
composer db [task] |
Flyway on the core schema and on every plugin schema. migrate by default; info, repair, clean, validate and baseline are accepted. |
composer build |
Rebuilds the CSS and JS assets on demand. |
composer doctor |
Exits non zero when a plugin file, assets/css/app.css or a configuration file is missing. |
composer chown |
Gives the current user back the files created as root by the Docker build (WSL). |
composer format, composer check |
PHP_CodeSniffer fixer and checker. |
Composer swallows the flags placed after a script name, so pass them through
the installer itself: composer sy install --dry-run, or
protected/vendor/bin/sy install --dry-run.
Configuration
Everything lives in composer.json, under extra.sy:
"extra": { "sy": { "build": "docker run --pull always --rm -v \"$PWD\":/syproject -w /syproject node:slim gulp build", "ini": { "database": { "file": "protected/conf/database.ini", "input": { "host": { "question": "MySQL hostname" } } }, "smtp": { "file": "protected/conf/smtp.ini", "input": { "host": { "question": "SMTP hostname" } } } }, "install": ["php protected/bin/seed.php"] } }
buildis the shell command compiling the project assets; it runs in the project root and only when a plugin SCSS file is newer thanassets/css/app.css;inilists the configuration filesgeninigenerates when they are missing, with the questions asked to the developer;installlists the shell commands run once, just after the INI generation, so a latersy installdoes nothing.
Add an entry to ini for a project-specific file, and a command to install
for anything genini cannot express.
Plugin files
sy install applies the same rules to every installed plugin
(vendor/sy/bootstrap-*):
assets/are copied, or refreshed when the vendor copy is newer;templates/are copied only when the file is missing: once copied, a template belongs to the project and is never overwritten;- the Sass build runs only when a plugin ships
scss/(or a.scssfile undertemplates/), and only whenassets/css/app.cssis older than every plugin SCSS file; - the migrations run per plugin schema, each with its own
flyway_<plugin>_historytable.
composer doctor is the cheapest way to check a deployment: it exits non zero
when a plugin asset is missing from the project, which is exactly the failure a
git clean or a stale deploy produces.
Create configuration files
The installer guides you through these files: each entry of extra.sy.ini is
asked for when the file is missing, on the first composer install (or
composer sy install).
Create the file [DOCUMENT ROOT]/protected/conf/database.ini
Example:
host = localhost
port = 3306
dbname = mydatabase
username = myuser
password = mypassword
charset = utf8mb4
Create the file [DOCUMENT ROOT]/protected/conf/smtp.ini
Example:
host = smtp.gmail.com
username = user@example.com
password = mypassword
port = 587
encryption = tls
Create database
When a new project is created, the database is created with this SQL script: protected/sql/V1__init.sql
We use Flyway to manage database changes. Here is the composer custom command:
composer db [FLYWAY COMMAND]
Flyway commands:
- migrate
- info
- repair
- clean
- validate
- baseline
Example:
composer db migrate
Build CSS & JS
We have a composer custom command for building CSS and JS assets:
composer build
But it's recommended to install NodeJS and Gulp if you have to rebuild frequently the CSS or JS.
Go to the project folder and install project dependencies
npm install
To build css (protected/scss/app.scss -> assets/css/app.css)
gulp css
To build js (protected/js/*.js -> assets/js/app.js)
gulp js
Check/format PHP coding style
Check the coding style
composer check [FILE or DIRECTORY]
Format the coding style
composer format [FILE or DIRECTORY]
Example:
composer format protected/src
Coding standard ruleset used: sy/coding-standard