本文整理匯總了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();