PHP code example of railt / discovery
1. Go to this page and download the library: Download railt/discovery 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/ */
railt / discovery example snippets
$discovery = new Railt\Discovery\Discovery(__DIR__ . '/vendor');
$discovery->get('config.commands');
// array(2) { "ExampleCommand1", "ExampleCommand2" }
$discovery = Railt\Discovery\Discovery::auto();
// Composer ClassLoader
$loader = ::fromClassLoader($loader);
use Composer\Composer;
use Railt\Discovery\Discovery;
class ComposerPlugin
{
public function __construct(Composer $composer)
{
$discovery = Discovery::fromComposer($composer);
}
}