PHP code example of digipolisgent / robo-digipolis-general

1. Go to this page and download the library: Download digipolisgent/robo-digipolis-general 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/ */

    

digipolisgent / robo-digipolis-general example snippets


// Recursively search for a project root folder in the current directory with a
// maximum depth of 2.
$result = $this->taskDetermineProjectRoot(getcwd(), 2)
    // Do not search in the tests and vendor folders.
    ->exclude(['tests', 'vendor'])
    // A folder containing a composer.json is considered a project root.
    ->searchFiles(['composer.json'])
    ->run();
// The project root is stored in the digipolis.root.project config.
$root = $this->getConfig()->get('digipolis.root.project');

// Recursively search for a web root folder in the current directory with a
// maximum depth of 2.
$result = $this->taskDetermineWebRoot(getcwd(), 2)
    // Do not search in the tests and vendor folders.
    ->exclude(['tests', 'vendor'])
    // A folder containing an index.php is considered a project root.
    ->searchFiles(['index.php'])
    ->run();
// The project root is stored in the digipolis.root.web config.
$root = $this->getConfig()->get('digipolis.root.web');

// Search for default.properties.yml and properties.yml files in the current
// directory.
$result = $this->taskReadProperties([getcwd()])
    ->run();
// Values are stored in config.
$root = $this->getConfig()->get('my.config.value');