Repository navigation
Composer
Tools > Composer packages... shows the project's packages and runs Composer for them: add Div or any package from Packagist, remove, update, install, look for newer versions. divide never edits composer.json behind composer's back: composer does every change, under the progress box, and its output stays in the Composer window.


-
Left: the packages, as a tree. First what the project needs to run (Runtime,
require), what it needs only to develop (Development,require-dev) and the Platform (php, extensions); under each, the vendor (divengine/), then the package by its own name with its installed version (fromcomposer.lock), all alphabetical. A packagecomposer.jsonrequires is bright; one composer installed with them is dim, and it sits under the group of the lock's section it came in.↑marks a package with a newer version, once you looked for them. Space folds a group or a vendor (and they stay folded after a reload); the filter line above the tree keeps only the packages whose name holds what you type (see The Desktop#filtering-a-list-or-a-tree). - Right: the package under the bar (on a group or a vendor, what it holds). Its description, kind, the version required and installed, the newer one, type, license, homepage, source, what it requires and what requires it.
- Below the tree: the project (its name, how many packages), whether it is installed, and how the last command ended.
| Key | |
|---|---|
| Ins | add a package (the assistant below) |
| Del | remove the package (composer remove), after confirming. Only packages the project requires: a dependency goes when what requires it goes. |
| Enter / double click | the package's folder (vendor/...) in the Project Window; on a group or a vendor, fold or unfold it |
| Space | fold or unfold a group or a vendor |
| Ctrl+R | read composer.json and composer.lock again |
| Alt+F10 / Shift+F10 | local menu: update the package (composer update name --with-dependencies), update every package, install, look for newer versions (composer outdated --direct), validate composer.json, dump the autoloader, open composer.json, a new composer.json, choose the composer program |
When composer fails, the Composer window comes to the front with its words.

Ins opens an assistant:
-
Search Packagist: type a few letters; divide asks Packagist (
composer search) once you stop typing. Or type the name,vendor/package, as it is. - Packages: Tab, then move the bar to choose one; its description shows below. Enter (or a double click) adds it.
-
Version: divide asks Packagist for the package's versions and suggests a constraint from the newest stable one (
^6.1for Div 6.1.3). Type your own if you prefer: divide stops suggesting. -
Development only:
require-devinstead ofrequire.

Add runs composer require (with --dev for a development package). Div itself is divengine/div.
A project without composer.json gets an assistant (also Alt+F10 > New composer.json) that writes it as composer init would:

| Field | |
|---|---|
| Name |
vendor/project, in lowercase; suggested from the folder |
| Description, License | MIT by default |
| PHP version | >=8.0 |
| Div version | with Require Div checked, divengine/div is required (^6.1) |
| Class namespace, Classes folder | PSR-4 autoloading of your classes (Acme\Shop\ in src/); the folder is created |
| Kind | a project (an application) or a library (a package for others) |
| Install it now | runs composer install right after |
With Div installed, divide finds the engine by itself in vendor/ (see Installation), and the Div setup can say how to set it up.
divide runs, the first it finds: $DIVIDE_COMPOSER, the program chosen with Alt+F10 > Composer program..., a composer.phar in the project (run with php), then composer in the PATH. Without composer, the window says how to install it. Searching and versions need the network; listing the packages does not.
divide · part of Divengine · report an issue
Manual
- The Desktop
- Editing Templates
- Editing PHP
- Outline
- Finding Files and Commands
- Language Servers
- Completion
- Checking Templates
- Rendering
- Render Trace
- Running PHP
- Running Flows
- Flow Structure
- Flow Designer
- Flow Functions
- Flow Simulation
- Function Mock Simulation
- Debugging PHP
- Web Server
- Data Files
- Other Files
- Project Window
- Div Setup
- Dialector
- Translating Templates
- Composer
- Git
Reference
Links