本文整理汇总了PHP中app\App::run方法的典型用法代码示例。如果您正苦于以下问题:PHP App::run方法的具体用法?PHP App::run怎么用?PHP App::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\App
的用法示例。
在下文中一共展示了App::run方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRun
public function testRun()
{
$stub = \Mockery::mock('Load');
$stub->shouldReceive('loadExceptionHandler')->once();
$stub->shouldReceive('loadRegistry')->once();
$stub->shouldReceive('loadSession')->once();
$stub->shouldReceive('loadHttp')->once();
$stub->shouldReceive('loadView')->once();
$stub->shouldReceive('loadUser')->once();
$stub->shouldReceive('loadAdmin')->once();
$stub->shouldReceive('loadFrontController')->once();
$stub->shouldReceive('loadTheme')->once();
MockTest::inject($this->app, 'load', $stub);
$this->app->run();
}
示例2: App
<?php
session_start();
require '../vendor/autoload.php';
use app\App;
$app = new App();
echo $app->run();
示例3:
error_reporting(E_ALL);
if (PHP_SAPI == 'cli-server') {
// To help the built-in PHP dev server, check if the request was actually for
// something which should probably be served as a static file
$file = __DIR__ . $_SERVER['REQUEST_URI'];
if (is_file($file)) {
return false;
}
}
require __DIR__ . '/../vendor/autoload.php';
session_start();
// Instantiate the app
$settings = __DIR__ . '/../config/settings.php';
if (!is_file($settings)) {
$defaults = (require __DIR__ . '/../config/settings.php.dist');
$defaults['settings']['jwt']['key'] = base64_encode(Random::secure_random_bytes(64));
file_put_contents($settings, '<?php' . "\n" . 'return ' . var_export($defaults, true) . ';');
}
$app = new \Slim\App(require $settings);
SlimStatic::boot($app);
// Allow static proxies to be called from anywhere in App
Statical::addNamespace('*', __NAMESPACE__ . '\\*');
// Set up dependencies
require __DIR__ . '/../src/dependencies.php';
// Register middleware
require __DIR__ . '/../src/middleware.php';
// Register routes
require __DIR__ . '/../src/routes.php';
// Run app
App::run();
示例4: dirname
<?php
use App\App;
require dirname(__FILE__) . "/vendor/autoload.php";
$app = new App(array('DB_DRIVER' => 'pdo_mysql', 'DB_HOST' => 'localhost', 'DB_USER' => 'root', 'DB_PASS' => 'root', 'DB_NAME' => 'slim_doctrine'));
$app->run();
示例5:
<?php
/**
* Индексный файл, точка входа в приложение веб-сайта
*/
require_once __DIR__ . '/../init.php';
\app\App::run();
示例6: can_return_secret_of_the_universe
/**
* @test
*/
public function can_return_secret_of_the_universe()
{
$app = new App();
$this->assertEquals(42, $app->run());
}