Download the PHP package ssitu/medicis without Composer
On this page you can find all versions of the php package ssitu/medicis. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ssitu/medicis
More information about ssitu/medicis
Files in ssitu/medicis
Package medicis
Short Description A PHP tool dedicated to fastforward JSON collection creation. Handles schema, sample data, translations; generates pages and menu config for UI integration; bundles collections in groups and profiles; run in CLI.
License MIT
Homepage https://github.com/I-is-as-I-does/MetaMedicis
Informations about the package medicis
Medicis
A PHP tool dedicated to fastforward JSON collection creation.
- Handles schema, sample data, translations
- Can generate additional custom config files
- Bundles collections in groups
- Run in CLI
Setup
Install
ssitu/jacktrades
will be installed too. It's a very small library of utils.
Ready for CLI
To uses Medicis in CLI, install ssitu/euclid
too. It should be suggested by Composer; otherwise:
Init
Directories will be mkdir'd.
TLDR
Take a look at files in samples/collections
;
And to dip toes in CLI:
Collections
The whole point of Medicis is to write Json schema (and make use of them), easy and quick.
Collections will be arranged in groups.
Groups are bundles of related collections.
Of course, a group can also host a single collection.
Prep
To set up a collection:
-
in
src/collc
: create a sub folder, named after your group of collections. example:
src/collc/people/
- then inside that folder, create collection json file(s).
File(s) name(s) must be 'group name' dash 'collection name';
example:
people-contacts.json
andpeople-activities.json
Each collection file must specify 2 main properties:
required
| array (required properties; will be used for schema validation),- and
props
| array (schema properties).
props
items are objects, each containing 2 properties:
method
| string- and
param
| array
The shortcut is within method
and param
: they refer to methods in MedicisModels that will do the heavy work.
Example:
people-activities.json
:
Related method in MedicisModel:
MedicisModel interface file will serve as a cheat sheet for available methods:
Medicis/src/MedicisFamily/MedicisModels_i.php
Config
You can add a config property to each collection; what it may contain is entirely up to you. If collections are going to be integrated in some UI, it could be things like auth level, template used, position in menu, etc.
Content will be detached from the src file, into its own file in dist/
. As for the other collection files, a bundle is generated when running 'Groups'
commands in CLI.
You can also create a similar file for group-wide config, in src/collc/your-group/
, naming it after your group: your-group.json
. The group bundle file will then include the group config, and wrap collections config in an 'items' property.
Translation
For each language your are planning translations, create a file in src/transl
folder, named as follow: collections-{language}.json
In CLI, run 'transl'
commands for either collections, or groups: source translation files will automatically be populated with keys that requires translation (and you'll get a log).
Note that 'all'
commands include translation.
Entries are separated between:
'name'
for collections and groups names,- and
'prop'
for properties titles.
Example
collections-en.json
Distill
To generate from there a real schema, dummy data, translation arrays, and optionally some config, in CLI:
- pick
'Collc'
- then
'people-activities -> all'
You'll get a log of what worked, failed, have been skipped, etc, and you'll find generated files in dist/people/
folders:
sch
, data
, config
and transl
.
Merge
In CLI, a 'Group'
command will:
- run action for all group collections at once,
- plus generate a bundled file for each category. Destination folder:
dist/your-group/bundle/
.
MetaMedicis
MedicisCli is fine and dandy for quick, common use operations, but for more targeted operations:
- use Euclid main tool (in which case, please refer to Euclid doc),
- or operate from the MetaMedicis class:
A non-exhaustive list of possibilities (cf. interfaces for more):
Contributing
Sure! You can take a loot at CONTRIBUTING.
License
This project is under the MIT License; cf. LICENSE for details.