-
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')) {
class WhichKernel extends \LaravelFly\MidKernel{}
} 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
. -
MySql coroutine can be used. Ensure
const LARAVELFLY_COROUTINE = true;
in fly.conf.php, then add 'coroutine' => true, to config/database. This feature is still under dev.
'mysql' => [
'driver' => 'mysql',
'coroutine' => true,
...
],
This feature depends on laravel-s.
- Redis Driver supporting coroutine
- install hiredis
sudo make
sudo make install
sudo ldconfig
-
install swoole with
--enable-async-redis
-
edit config/database.php
'redis' => [
'client' => 'swoole_redis',
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
'var_serialize'=>false, // if serialize php var
],
],
note:
- not implemented methods: scan object sort migrate hscan sscan zscan
- no support cluster
- Start
- Coding Guideline
- Deploy and OS Configuration
- New API
- Design
- Dev about Mode Map
- Dev about Mode Backup