decodelabs / integra
Composer file inspector and front-end
Installs: 11 846
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.4
- decodelabs/atlas: ^0.12
- decodelabs/coercion: ^0.3
- decodelabs/collections: ^0.11
- decodelabs/exceptional: ^0.5
- decodelabs/lucid: ^0.5
- decodelabs/monarch: ^0.1.2
- decodelabs/systemic: ^0.11
Requires (Dev)
README
Composer file inspector and front-end
Integra provides inspection tools for your composer.json file and a front end to control composer within your project.
Installation
Install via Composer:
composer require decodelabs/integra
Usage
Load a project to work from:
use DecodeLabs\Integra\Project; $project = new Project('path/to/project/');
If no path is specified, the current working directory will be used. Integra will search back up the file tree for the nearest composer.json.
echo $project->rootDir; // Parent or current dir containing composer.json echo $project->binDir; // Bin dir relative to composer echo $project->composerFile; // Location of composer.json $project->run('update'); // composer update $project->runGlobal('update'); // composer global update $project->runScript('my-script'); // composer run-script my-script $project->runBin('phpstan', '--debug'); // composer exec phpstan -- --debug $project->runGlobalBin('phpstan', '--debug'); // composer global exec phpstan -- --debug if(!$project->hasPackage('package1')) { $project->install('package1', 'package2'); // composer require package1 package2 } $project->installDev('package1', 'package2'); // composer require package1 package2 --dev $project->installGlobal('package1', 'package2'); // composer global require package1 package2 $project->installDevGlobal('package1', 'package2'); // composer global require package1 package2 --dev
Manifest
Access the composer.json manifest:
$manifest = $project->getLocalManifest(); echo $manifest->getDescription(); foreach($manifest->getRequiredPackages() as $package) { echo $package->name; }
See the Manifest.php class for full data access interface - it maps to the majority of the documented composer config options.
Licensing
Integra is licensed under the MIT License. See LICENSE for the full license text.