本文整理汇总了PHP中Flight::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Flight::instance方法的具体用法?PHP Flight::instance怎么用?PHP Flight::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flight
的用法示例。
在下文中一共展示了Flight::instance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/../app/helpers.php';
require __DIR__ . '/../app/routes.php';
$config = (require __DIR__ . '/../app/config.php');
Flight::set('flight.log_errors', $config['debug']);
Flight::set('flight.base_url', $config['base_url']);
Flight::set('flight.views.path', __DIR__ . '/../app/views');
Flight::set('alphabet', $config['hash']['alphabet']);
Flight::instance('hash', '\\app\\components\\Hash', [$config['hash']]);
Flight::instance('db', 'medoo', [$config['db']]);
Flight::instance('db_read', 'medoo', [$config['db_read']]);
Flight::start();
示例2:
<?php
require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/../app/helpers.php';
require __DIR__ . '/../app/routes.php';
$config = (require __DIR__ . '/../app/config.php');
Flight::set('flight.base_url', $config['base_url']);
Flight::set('flight.views.path', __DIR__ . '/../app/views');
Flight::set('alphabet', $config['hash']['alphabet']);
Flight::instance('hash', '\\app\\components\\Hash', [$config['hash']]);
Flight::instance('db', 'medoo', [$config['db']]);
Flight::start();
示例3:
<?php
require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/../app/helpers.php';
require __DIR__ . '/../app/routes.php';
$config = (require __DIR__ . '/../app/config.php');
Flight::set('flight.log_errors', $config['debug']);
Flight::set('flight.base_url', $config['base_url']);
Flight::set('flight.settings', $config['settings']);
Flight::set('flight.views.path', __DIR__ . '/../app/views');
Flight::set('alphabet', $config['hash']['alphabet']);
Flight::instance('hash', '\\app\\components\\Hash', [$config['hash']]);
Flight::instance('db', 'medoo', [$config['db']]);
Flight::instance('db_read', 'medoo', [$config['db_read']]);
Flight::instance('proxies', '\\IPSet\\IPSet', [$config['proxies']]);
Flight::start();