-
Notifications
You must be signed in to change notification settings - Fork 41
Configuration
-
Publish server config file
php artisan vendor:publish --tag=fly-server
. -
Edit server config file
<project_root_dir>/fly.conf.php
. -
Publish app config file
php artisan vendor:publish --tag=fly-app
. -
Edit app config file
<project_root_dir>/config/laravelfly.php
.
Note: items prefixed with "/** depends " deverve your consideration.
- Edit
<project_root_dir>/app/Http/Kernel.php
, changeclass Kernel extends HttpKernel
to
if (defined('LARAVELFLY_MODE')) {
if (LARAVELFLY_MODE == 'Map') {
class WhichKernel extends \LaravelFly\Map\Kernel { }
}elseif (LARAVELFLY_MODE == 'Backup') {
class WhichKernel extends \LaravelFly\Backup\Kernel { }
} elseif (LARAVELFLY_MODE == 'FpmLike') {
class WhichKernel extends HttpKernel{}
}
} else {
class WhichKernel extends HttpKernel { }
}
class Kernel extends WhichKernel
- If you use tinker(), put this line at the top of
public/index.php
:
function tinker(){ return '';}
This line avoids error Call to undefined function tinker()
when you use php-fpm with tinker() left in your code.
-
composer require --dev "eaglewu/swoole-ide-helper:dev-master"
, which is useful in IDE development. -
Config and restart nginx: swoole http server lacks some http functions, so it's better to use swoole with other http servers like nginx. There is a nginx site conf example at
vendor/scil/laravel-fly/config/nginx+swoole.conf
. -
if you want to use mysql persistent, add following to config/database.php
'options' => [
PDO::ATTR_PERSISTENT => true,
],
- In Mode Map, MySql coroutine can be used. Add 'coroutine' => true, to config/database. This feature is still under dev.
'mysql' => [
'driver' => 'mysql',
'coroutine' => true,
...
],
This feature depends on laravel-s and still under dev.
- Start
- Coding Guideline
- Deploy and OS Configuration
- New API
- Design
- Dev about Mode Map
- Dev about Mode Backup