SAREhub/php_component_worker

View on GitHub
examples/run-example

Summary

Maintainability
Test Coverage
#!/usr/bin/env php
<?php

require dirname(__DIR__).'/vendor/autoload.php';
if (empty($argv[1])) {
    echo "USAGE: php runExample.php <examplePath>";
    return;
}

$examplePath = __DIR__.'/'.$argv[1].'/example.php';

if (file_exists($examplePath)) {
    require $examplePath;
} else {
    echo "not found example.php for ".$argv[1]." in ".$examplePath;
}