1.4 Upgrade Guide

Please 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 due to the use of the composer proxy. 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

In other words, the webman/auto-route plugin is no longer needed.

Controller Reuse Switch

Version 1.4 allows for disabling controller reuse. Set 'controller_reuse' => false, in config/app.php, so that each request will reinitialize a new controller. This means that each request will trigger the __construct() constructor of the corresponding controller, allowing developers to perform some initialization work before processing each request in the constructor.

Due to the ability to disable controller reuse, the webman/action-hook plugin is no longer needed.

Starting HTTP Service

Version 1.4 supports starting multiple ports to provide HTTP services. See Slow Business Processing for details.

View File Configuration

The suffix can only be configured in the options option 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 Driver Namespace Change

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

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

to:

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

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

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