PHPackages                             hiqsol/core - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. hiqsol/core

ActiveLibrary[Framework](/categories/framework)

hiqsol/core
===========

Yii 3.0 proposal :: NOT FOR ACTUAL USE

3.0.x-dev(7y ago)7131[2 issues](https://github.com/hiqsol/core/issues)BSD-3-ClausePHPPHP &gt;=7.1.0

Since Jul 14Pushed 7y ago3 watchersCompare

[ Source](https://github.com/hiqsol/core)[ Packagist](https://packagist.org/packages/hiqsol/core)[ Docs](http://www.yiiframework.com/)[ RSS](/packages/hiqsol-core/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (6)Versions (2)Used By (0)

Yii 3.0 proposal :: NOT FOR ACTUAL USE
======================================

[](#yii-30-proposal--not-for-actual-use)

[![Latest Stable Version](https://camo.githubusercontent.com/4210bbbd9ff72b4da359b6633224eaeef82b9e15b528de34fdb98231d14a083b/68747470733a2f2f706f7365722e707567782e6f72672f686971736f6c2f636f72652f762f737461626c65)](https://packagist.org/packages/hiqsol/core)[![Total Downloads](https://camo.githubusercontent.com/db2730b0cfdec78eb4d6fe56b1a8da436d15b7870cf951435e24d3552b20117e/68747470733a2f2f706f7365722e707567782e6f72672f686971736f6c2f636f72652f646f776e6c6f616473)](https://packagist.org/packages/hiqsol/core)[![Build Status](https://camo.githubusercontent.com/777c16e79e6c93a61a6d5820d571c02f9f32e5ff3f833336c04a6d737b8f762b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f686971736f6c2f636f72652e737667)](https://travis-ci.org/hiqsol/core)[![Scrutinizer Code Coverage](https://camo.githubusercontent.com/ad67a6ce40c6558c9d0dd65564211a825f27287c4e2772858d1e418f4d07a3b8/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f686971736f6c2f636f72652e737667)](https://scrutinizer-ci.com/g/hiqsol/core/)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e860ef6016557a14436c8a679ecd9ec1c70cbb46b5e2424d56ec3c3c03f33053/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f686971736f6c2f636f72652e737667)](https://scrutinizer-ci.com/g/hiqsol/core/)[![Dependency Status](https://camo.githubusercontent.com/5613ddd21770e4dcfe574cb3678e2d1715bf70e86fe79fc21b0b710d685aa334/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f686971736f6c3a636f72652f6465762d6d61737465722f62616467652e737667)](https://www.versioneye.com/php/hiqsol:core/dev-master)

This package is Yii 3.0 architecture changes proposal.

NOT INTENDED FOR ACTUAL USE
===========================

[](#not-intended-for-actual-use)

Idea
----

[](#idea)

- framework gets split into parts, not radically, but functionally
    - `yiisoft/core` - all former framework but all the following
    - `yiisoft/di` - as is, fixed some bugs
    - `yiisfot/yii-web` - everything from `web` and `filter` folders, can be used without yiisoft/console, but requires core
    - `yiisfot/yii-console` - everything from `console` folder, can be used without yiisoft/web, but requires core
    - `yiisoft/log` - everything from `log` folder, any PSR compatible cache could be used, can be done framework independent
    - `yiisoft/cache` - everything from `caching` folder, any PSR compatible cache could be used, can be done framework independent
    - `yiisoft/db` - not all apps need it, can be done framework independent
    - `yiisoft/rbac` - not all apps need it, can be done framework independent
    - also should be considered:
        - grid
        - widgets
        - split db and ActiveRecord
    - also please see discussion [\#1](https://github.com/hiqsol/core/issues/1)
- don't mention framework version anywhere besides version constraints in `composer.json` files
    - rename yii extensions with `yii-` prefix
    - rule of thumb:
        - if extension requires `yiisoft/core` directly or through dependencies - then prefix with `yii-`
        - if extension can be used without yii (completely or partially) - name without `yii-` prefix
        - if extension provides more functions with yii - suggest yii
- `yiisfot/core` requires only virtual psr implementations instead of concrete yii packages
    - actually not all psr implementations will work right now, but it's a declaration of intentions and will be implemented sooner or later
- every part provides it's own configuration in `config` folder, see examples below
    - summary config is assembled with [composer-config-plugin](https://github.com/hiqdev/composer-config-plugin), we can think about other config assembling tool, but this one is already tested and there are no others :)
    - I understand it is most arguable question but it can become main framework feature
    - allows to throw away things like coreComponents and other crutches like merging config parts available in the framework code
    - the config becomes the config of DI container holding configs for application and all the services (previously it was config of application)
    - allows to create onion applications and plugins, please see [my article](https://hiqdev.com/pages/articles/app-organization)
    - also please see discussion [\#2](https://github.com/hiqsol/core/issues/2)
- `yii2-composer` - not needed anymore
    - yii2-extension composer package type is not need, extensions will become `library`
    - also yii2-composer assembles `extensions.php` used for aliases and bootstrap composer-config-plugin does all the same but more effectively
- think of completely remove bootstrap feature:
    - it was mostly used by extensions to merge into application config - composer-config-plugin must be used for it
    - event triggers should be configured for all other cases
        - which improves performance by running tasks not for every request but for certain only
- DI
    - completely remove `ServiceLocator`, use DI instead
    - completely remove components support from `Application` and `Module`
        - according to my experiense, DI is quite enough
    - `Application` becomes really shorter and simpler
- completely remove `Configurable` and `Yii::configure(),` and `init()` goes with them
    - remove everywhere `$config` (last constructor argument)
    - `Configurable` worked this way:
        - `$config` array was passed to constructor
        - `$config` gets applied with `Yii::configure()`
        - constructor runs `init()`
        - it doesn't work with new DI because of the following:
            - new DI calls constructor and then sets props
            - init cannot be called from constructor
            - in theory `init()` could be called with DI, but it's necessary to ensure it to be called after settings all props
    - it is necessary to fix all classes having `init()`
    - it is serious BC-break, but everything gets simpler:
        - no need to make changes to `yiisoft/di`
        - initialization better be substituted with getters which makes it deferred so more productive in theory
- redo `Yii` as clean helper, without global static properties:
    - no need to require Yii in entry script
    - move to all other helpers `yii\helpers\Yii`
    - remove "global variables" `Yii::$app`, `Yii::$logger` and so on
    - move aliases to `Application`
    - leave only: `Yii::t()`, `Yii::createObject()` and logging and profiling functions
    - to make them working `Yii::setContainer($container)` must be called in entry script
    - but if no container is defined - make all the functions operating in default way like logging with PHP built-in capabilities
    - I think `Yii::createObject()` should be deprecated, starting with removing its use in the framework and then remove it completely in next version in favour of `Factory::create()`
    - bunch of defines will be moved to `config/defines.php`, composer-config-plugin assembles defines too
- cleanup
    - rename folder `web` to `public`
    - rename alias `@webroot` to `@public`
    - I want to make less files in heavy loaded folders (base, web), making a bit more folders, but without growing folder depth
        - move all exceptions to own folder in base and web
        - move web formatters to own folder
        - think of: url, action

### Entry script

[](#entry-script)

```
