1.4 Upgrade Guide

Make sure to backup before upgrading, execute the following command to upgrade
composer require workerman/webman-framework ^1.4.7 && composer require webman/console ^1.2.12 && php webman install

Note
If unable to upgrade, it is likely because a composer proxy is being used. Please use the following command composer config -g --unset repos.packagist to restore the use of the official composer data source.

Features and Changes

Application Plugins

Version 1.4 supports application plugins, for more information, please refer to Application Plugins

Automatic Routing

Version 1.4 supports various complex controller directory rules, for example

app
├── admin
│   └── v1
│       └── v2
│           └── v3
│               └── controller
│                   └── Index.php
└── controller
    ├── v1
    │   └── Index.php
    └── v2
        └── v3
            └── Index.php

This means that the webman/auto-route plugin is no longer needed.

Controller Reuse Switch

Version 1.4 allows for the closure of controller reuse. Set 'controller_reuse' => false, in config/app.php. This way, each request will initialize a new controller, meaning that each request will trigger the __construct() constructor of the corresponding controller. Developers can perform some initialization work before each request in the constructor.

Because controller reuse can be turned off, the webman/action-hook plugin is no longer needed.

Starting HTTP Services

Version 1.4 supports opening multiple ports to provide HTTP services. See Slow Business Processing

View File Configuration

The suffix can only be configured in the options of view.php.
Deprecated Usage

use support\view\Raw;
return [
    'handler' => Raw::class,
    'view_suffix' => '.php'
];

Correct Usage

use support\view\Raw;
return [
    'handler' => Raw::class,
    'options' => [
        'view_suffix' => '.php'
    ]
];

Session Handler Namespace Change

Starting from 1.4.0, webman changed the namespace of the SessionHandler class from the original

use Webman\FileSessionHandler;  
use Webman\RedisSessionHandler;  
use Webman\RedisClusterSessionHandler;  

to

use Webman\Session\FileSessionHandler;  
use Webman\Session\RedisSessionHandler;  
use Webman\Session\RedisClusterSessionHandler;

To avoid program errors after upgrading, the Webman\FileSessionHandler class is still preserved for a period of time and will be completely removed in future versions.

This change affects the handler configuration in config/session.php.