コード例 #1
0
ファイル: Controller.php プロジェクト: rarst/release-belt
 public function getFile(Application $app, $vendor, $file)
 {
     /** @var Finder $finder */
     $finder = $app['finder'];
     $finder->path($vendor)->name($file);
     /** @var SplFileInfo $file */
     foreach ($finder as $file) {
         return $app->sendFile($file->getRealPath());
     }
     return null;
 }
コード例 #2
0
ファイル: index.php プロジェクト: ssteinerx/release-belt
<?php

use Rarst\ReleaseBelt\Application;
require __DIR__ . '/vendor/autoload.php';
$app = new Application([]);
$app->run();
コード例 #3
0
ファイル: encodePassword.php プロジェクト: rarst/release-belt
<?php

use Rarst\ReleaseBelt\Application;
use Silex\Provider\SecurityServiceProvider;
require __DIR__ . '/vendor/autoload.php';
$configPath = __DIR__ . '/config.php';
$app = new Application(file_exists($configPath) ? require $configPath : []);
if (empty($app['security.default_encoder'])) {
    $app->register(new SecurityServiceProvider());
}
if (!empty($argv[1])) {
    $encoder = $app['security.default_encoder'];
    echo $encoder->encodePassword($argv[1], '');
}