#!/usr/bin/env php <?php // Add PHP "Strict Mode" error_reporting(E_ALL ^ E_NOTICE ^ E_STRICT); // Set CWD to the same directory as this file set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . "/../"); chdir(dirname(__FILE__) . "/../"); // No, no, no, go away ini_set('session.use_cookies', '0'); ini_set('magic_quotes_gpc', 'off'); ini_set('magic_quotes_runtime', 'off'); // Init autoloader setup from Composer if (!(include_once __DIR__ . '/vendor/autoload.php')) { die('Have you run composer over this project yet ?'); } // Setup Cilex $app = new \Cilex\Application('A little adventure of code', '1.0'); // Registering Commands // TODO: Now write this class to send us your email to our API (docs: http://www.commonledger.com/job/github/software-engineer) $app->command(new \CommonLedger\Jobs\SoftwareEngineer\Commands\GetToken()); // This class works, and sends us your code that you wrote so we can see how you approached things $app->command(new \CommonLedger\Jobs\SoftwareEngineer\Commands\SendToken()); $app->run();
<?php if (!ini_get("auto_detect_line_endings")) { ini_set("auto_detect_line_endings", '1'); } if (!($loader = (include __DIR__ . '/vendor/autoload.php'))) { die('You must set up the project dependencies.'); } $app = new \Cilex\Application('Cilex'); $app->command(new \Cilex\Command\GreetCommand()); $app->command(new \Gollyg\SolrSyntaxParser\Command\SynonymCommand()); $app->run();
/** * Tests whether the getService method correctly retrieves an element from * the container. */ public function testGetService() { $app = new \Cilex\Application('Test'); $app->command($this->fixture); $this->assertInstanceOf('\\Symfony\\Component\\Console\\Application', $this->fixture->getService('console')); }
<?php require 'app/loader.php'; $engine = new \App\ParseEngine(); $engine->register('ANIMALS', new \App\Strategy\SortedUniqueStrategy()); $engine->register('NUMBERS', new \App\Strategy\UniqueCountStrategy()); $engine->register('CARS', new \App\Strategy\ReverseSortedUniqueHashStrategy()); $app = new \Cilex\Application('Cilex'); $app->command(new \App\Command\ParseCommand($engine)); $app->run();
<?php require __DIR__ . '/../vendor/autoload.php'; $app = new \Cilex\Application('EmailFeed'); $app->command(new \Christiaan\EmailFeed\GenerateFeedCommand()); $app->run();
<?php require_once __DIR__ . '/cilex.phar'; $app = new \Cilex\Application('Cilex'); $app->command(new \Cilex\Command\GreetCommand()); $app->run();
<?php //TODO: config define('DOCS_DIRECTORY', __DIR__ . '/data'); define('BUILD_DIRECTORY', __DIR__ . '/build'); if (!($loader = (include __DIR__ . '/vendor/autoload.php'))) { die('You must set up the project dependencies.'); } $app = new \Cilex\Application('phpdocsToDb'); $app->register(new Cilex\Provider\DoctrineServiceProvider(), array('db.options' => array('driver' => 'pdo_sqlite', 'path' => __DIR__ . '/build/phpdoc.db'))); $app->command(new Chrismou\PhpdocsToDb\Command\CreateCommand($app)); $app->run();
<?php if (!($loader = (include __DIR__ . '/vendor/autoload.php'))) { die('You must set up the project dependencies.'); } $app = new \Cilex\Application('Cilex'); $app->command(new \Cilex\Command\AccountOpenCommand()); $app->run();
<?php use Cilex\Provider\ConfigServiceProvider; use Orukusaki\MagentoRestTest\AuthoriseCommand; use Orukusaki\MagentoRestTest\OauthClientProvider; use Orukusaki\MagentoRestTest\RequestCommand; require_once __DIR__ . '/../vendor/autoload.php'; define('CONFIG_PATH', 'config.json'); $app = new Cilex\Application('Rest Tester'); if (!file_exists(CONFIG_PATH)) { file_put_contents(CONFIG_PATH, '{}'); } $app->register(new ConfigServiceProvider(), ['config.path' => CONFIG_PATH]); $app->register(new OauthClientProvider()); $app->command(new AuthoriseCommand()); $app->command(new RequestCommand()); $app->run();
<?php chdir(__DIR__); if (!($loader = (include '../vendor/autoload.php'))) { die('Autoload file not found'); } date_default_timezone_set("Europe/Amsterdam"); $app = new \Cilex\Application('Cilex'); $app->register(new \Cilex\Provider\ConfigServiceProvider(), array('config.path' => "config.json")); $app->register(new Cilex\Provider\DoctrineServiceProvider(), array('db.options' => array('driver' => 'pdo_mysql', 'dbname' => '', 'password' => ''))); $app->command(new \LWS\Palu\Command\SwitchRelay()); $app->command(new \LWS\Palu\Command\ReadTemp()); $app->command(new \LWS\Palu\Command\CleanDatabase()); $app->run();
#!/usr/bin/env php <?php if (!($loader = (include __DIR__ . '/../vendor/autoload.php'))) { die('You must set up the project dependencies.'); } $app = new \Cilex\Application('Cilex'); $app->command(new \Cilex\Command\GreetCommand()); $app->command(new \Cilex\Command\DemoInfoCommand()); $app->command('foo', function ($input, $output) { $output->writeln('Example output'); }); $app->run();
<?php if (!($loader = (include __DIR__ . '/vendor/autoload.php'))) { die('You must set up the project dependencies.'); } $app = new \Cilex\Application('Cilex'); $app->command(new \Cilex\Command\GamesCommand()); $app->run();
#!/usr/bin/php <?php /** * Created by PhpStorm. * User: yonman * Date: 27/01/2016 * Time: 6:09 PM */ if (!($loader = (include __DIR__ . '/vendor/autoload.php'))) { die('You must set up the project dependencies.'); } $app = new \Cilex\Application('git-log-version', '1.0.2'); $app->command(new \GitLogVersion\Command\ReportCommand()); $app->command(new \GitLogVersion\Command\LabelCommand()); $app->command(new \GitLogVersion\Command\CommentCommand()); if (file_exists(__DIR__ . '/src')) { $app->command(new \GitLogVersion\Command\BuildCommand(__DIR__)); } $app->run();
<?php if (!($loader = (include __DIR__ . '/vendor/autoload.php'))) { die('You must set up the project dependencies.'); } $app = new \Cilex\Application('Cilex'); $app->command(new \Cilex\Command\TillCommand()); $app->run();
<?php require_once __DIR__ . '/vendor/autoload.php'; $app = new \Cilex\Application('ConfigGenerator'); $app->command(new \Configen\Command\ConfigenCommand()); $app->run();
$db = new Aruna\Db("sqlite:" . $app['db_file']); $db->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); $db->setAttribute(\PDO::ATTR_DEFAULT_FETCH_MODE, \PDO::FETCH_ASSOC); return $db; }); $app['posts_repository_reader'] = $app->share(function () use($app) { return new Aruna\PostRepositoryReader($app['db_cache']); }); $app['posts_repository_writer'] = $app->share(function () use($app) { $adapter = new \League\Flysystem\Adapter\Local($app['posts_root']); $filesystem = new \League\Flysystem\Filesystem($adapter); return new \Aruna\Micropub\PostRepositoryWriter($filesystem, $app['db_cache']); }); // processCacheProvider $app['process_cache_handler'] = $app->share(function () use($app) { $pipelineFactory = new Aruna\Micropub\ProcessingPipelineFactory($app); return new Aruna\Micropub\ProcessCacheHandler($app['monolog'], $app['event_store'], $app['posts_repository_reader'], $pipelineFactory); }); $app['action.resize_photos'] = $app->share(function () use($app) { return new Aruna\Micropub\ResizePhotosAction($app['monolog'], $app['event_store'], $app['image_resizer']); }); $app['action.process_webmentions'] = $app->share(function () use($app) { return new Aruna\Webmention\ProcessWebmentionsAction($app['monolog'], $app['event_store'], $app['handler.process_webmentions']); }); $app['handler.process_webmentions'] = $app->share(function () use($app) { return new Aruna\Webmention\ProcessWebmentionsHandler($app['monolog'], $app['event_store'], $app['http_client'], $app['mentions_repository_writer'], $app['posts_repository_reader'], new Aruna\Webmention\WebmentionNotification(), new Aruna\NotifyService($app['http_client'], $app['monolog'], $app['pushover_api_token'], $app['pushover_user_token'])); }); $app->command(new CLI\ProcessCacheCommand()); $app->command(new CLI\ResizePhotoCommand()); $app->command(new CLI\ProcessWebmentionsCommand()); $app->run();