PHP code example of decodelabs / integra

1. Go to this page and download the library: Download decodelabs/integra library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

decodelabs / integra example snippets


use DecodeLabs\Integra\Project;

$project = new Project('path/to/project/');

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 

$manifest = $project->getLocalManifest();
echo $manifest->getDescription();

foreach($manifest->getRequiredPackages() as $package) {
    echo $package->name;
}