decodelabs / integra
Composer file inspector and front-end
Installs: 9 433
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
- decodelabs/atlas: ^0.12
- decodelabs/coercion: ^0.2.6
- decodelabs/collections: ^0.9
- decodelabs/exceptional: ^0.4.3
- decodelabs/systemic: ^0.11
- decodelabs/veneer: ^0.11.6
Requires (Dev)
- decodelabs/phpstan-decodelabs: ^0.6.2
- decodelabs/terminus: ^0.10
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.
Get news and updates on the DecodeLabs blog.
Installation
Install via Composer:
composer require decodelabs/integra
Usage
Load a context to work from:
use DecodeLabs\Integra\Context; $context = new Context('path/to/project/');
Or use the Integra
Veneer frontage to work from cwd()
.
Integra will search back up the file tree for the nearest composer.json.
echo Integra::$runDir; // Working directory echo Integra::$rootDir; // Parent or current dir containing composer.json echo Integra::$binDir; // Bin dir relative to composer echo Integra::$composerFile; // Location of composer.json Integra::run('update'); // composer update Integra::runGlobal('update'); // composer global update Integra::runScript('my-script'); // composer run-script my-script Integra::runBin('phpstan', '--debug'); // composer exec phpstan -- --debug Integra::runGlobalBin('phpstan', '--debug'); // composer global exec phpstan -- --debug if(!Integra::hasPackage('package1')) { Integra::install('package1', 'package2'); // composer require package1 package2 } Integra::installDev('package1', 'package2'); // composer require package1 package2 --dev Integra::installGlobal('package1', 'package2'); // composer global require package1 package2 Integra::installDevGlobal('package1', 'package2'); // composer global require package1 package2 --dev
Manifest
Access the composer.json manifest:
$manifest = Integra::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.