PHP code example of einenlum / php-stack-detector

1. Go to this page and download the library: Download einenlum/php-stack-detector 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/ */

    

einenlum / php-stack-detector example snippets




ortrabbit\StackDetector\Detector;
use fortrabbit\StackDetector\Factory\FilesystemDetectorFactory;
use fortrabbit\StackDetector\Factory\GithubDetectorFactory;
use fortrabbit\StackDetector\Enum\StackType;

// Local usage

$factory = new FilesystemDetectorFactory();
$detector = $factory->create();
$config = $detector->getFullConfiguration('/path/to/a/symfony/directory');

$phpConfiguration = $config->phpConfiguration;

// value from config platform php
$phpConfiguration->phpVersion->version; // 8.3
// value from te();

$config = $detector->getFullConfiguration('/path/to/a/symfony/directory');

$phpConfiguration = $config->phpConfiguration;
// value from config platform php
$phpConfiguration->phpVersion->version; // 8.3
// value from 

php bin/detect-local.php ~/Prog/php/my_project/
Detected PHP version: Unknown version
Detected PHP d Node.js version: 22.0
Detected Node.js s: ctype, iconv
Detected stack: symfony
Version: 6.3.0

Detected Node.js version: Unknown version
Detected Node.js 

GITHUB_ACCESS_TOKEN=my_token php bin/detect-github.php 'fortrabbit/private-repo'
Detected stack: laravel
Version: 10.19.0

Detected Node.js version: Unknown version
Detected Node.js