{"action":"closed","issue":{"url":"https://api.github.com/repos/hoaproject/Core/issues/96","labels_url":"https://api.github.com/repos/hoaproject/Core/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/hoaproject/Core/issues/96/comments","events_url":"https://api.github.com/repos/hoaproject/Core/issues/96/events","html_url":"https://github.com/hoaproject/Core/issues/96","id":111106258,"number":96,"title":"[meta] Split the core","user":{"login":"Hywan","id":946104,"avatar_url":"https://avatars.githubusercontent.com/u/946104?v=3","gravatar_id":"","url":"https://api.github.com/users/Hywan","html_url":"https://github.com/Hywan","followers_url":"https://api.github.com/users/Hywan/followers","following_url":"https://api.github.com/users/Hywan/following{/other_user}","gists_url":"https://api.github.com/users/Hywan/gists{/gist_id}","starred_url":"https://api.github.com/users/Hywan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hywan/subscriptions","organizations_url":"https://api.github.com/users/Hywan/orgs","repos_url":"https://api.github.com/users/Hywan/repos","events_url":"https://api.github.com/users/Hywan/events{/privacy}","received_events_url":"https://api.github.com/users/Hywan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hoaproject/Core/labels/difficulty:%20hard","name":"difficulty: hard","color":"DE264C"},{"url":"https://api.github.com/repos/hoaproject/Core/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/hoaproject/Core/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"closed","locked":false,"assignee":{"login":"Hywan","id":946104,"avatar_url":"https://avatars.githubusercontent.com/u/946104?v=3","gravatar_id":"","url":"https://api.github.com/users/Hywan","html_url":"https://github.com/Hywan","followers_url":"https://api.github.com/users/Hywan/followers","following_url":"https://api.github.com/users/Hywan/following{/other_user}","gists_url":"https://api.github.com/users/Hywan/gists{/gist_id}","starred_url":"https://api.github.com/users/Hywan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hywan/subscriptions","organizations_url":"https://api.github.com/users/Hywan/orgs","repos_url":"https://api.github.com/users/Hywan/repos","events_url":"https://api.github.com/users/Hywan/events{/privacy}","received_events_url":"https://api.github.com/users/Hywan/received_events","type":"User","site_admin":false},"milestone":null,"comments":40,"created_at":"2015-10-13T05:18:19Z","updated_at":"2016-01-11T10:11:37Z","closed_at":"2016-01-11T10:11:37Z","body":"### History\r\n\r\nThe core gathers several thin layers into a single library for performance reasons. Let me explain it shortly. Parsing time is not very costly compared to I/O: Accessing to a file, opening it and reading it. The core aimed at putting the minimum always needed codes into small files, in order to reduce this I/O time. Since recent PHP versions and recent I/O progresses (SSD, kernel, FS…), this is no longer necessary. We can then split the core.\r\n\r\n### Global idea\r\n\r\nThe core contains the following layers:\r\n* `Hoa\\Core\\Consistency`,\r\n* `Hoa\\Core\\Data`,\r\n* `Hoa\\Core\\Event`,\r\n* `Hoa\\Core\\Exception`,\r\n* `Hoa\\Core\\Parameter`,\r\n* `Hoa\\Core\\Protocol`.\r\n\r\nWe can split it into the following libraries:\r\n* `Hoa\\Consistency`,\r\n* `Hoa\\Event`,\r\n* `Hoa\\Exception`,\r\n* `Hoa\\Protocol`.\r\n\r\nThey can live outside the core without any problem. So far, though, `Hoa\\Core\\Data` and `Hoa\\Core\\Parameter` will be kept as is.\r\n\r\n### Dealing with pre-loading\r\n\r\n`Hoa\\Core\\Consistency`, `Hoa\\Core\\Parameter` and `Hoa\\Core\\Protocol` were *de-facto* pre-loaded with `Hoa\\Core\\Core`. This latter is automatically pre-loaded with the `autoload.files` Composer's property. Whatever the split, we have to ensure this behavior.\r\n\r\n#### Case of `Hoa\\Core\\Consistency`\r\n\r\nThis layer contains:\r\n* An autoloader,\r\n* An xcallable implementation and,\r\n* Consistency helpers/tools accross PHP VMs (backport features to prior VMs, naming consistencies, feature consistencues etc.).\r\n\r\nOnly the latter is important at any runtime and will be loaded as a separated file with Composer. This will reduce the number of loaded code by approximately 60%.\r\n\r\n#### Case of `Hoa\\Core\\Parameter`\r\n\r\nWill not be extracted yet. Nothing to do.\r\n\r\n#### Case of `Hoa\\Core\\Protocol`\r\n\r\nWe need to register the `hoa://` protocol at any runtime. We use it everywhere. It has never hurt anyone in the whole Hoa's history. So we can load the file that is responsible to register the stream wrapper with Composer. This will reduce the number of loaded code by approximately 50%.\r\n\r\n### Steps\r\n\r\nHere are the following steps to follow (the order is important):\r\n- [x] `Hoa\\Exception`:\r\n  - [x] Create `Hoa\\Exception` (from `Hoa\\Core\\Exception`),\r\n  - [x] Write test suites,\r\n  - [x] Update all libraries to use `Hoa\\Exception`,\r\n  - [x] Remove `Hoa\\Core\\Exception`.\r\n- [x] `Hoa\\Event`:\r\n  - [x] Create `Hoa\\Event` (from `Hoa\\Core\\Event`),\r\n  - [x] Write test suites,\r\n  - [x] Update all libraries  to use `Hoa\\Event`,\r\n  - [x] Remove `Hoa\\Core\\Event`.\r\n- [x] `Hoa\\Protocol`:\r\n  - [x] Create `Hoa\\Protocol`,\r\n  - [x] Write test suites,\r\n  - [x] Update all libraries to use `Hoa\\Protocol`,\r\n  - [x] Remove `Hoa\\Core\\Protocol`.\r\n- [x] `Hoa\\Consistency`:\r\n  - [x] Create `Hoa\\Consistency`,\r\n  - [x] Write test suites,\r\n  - [x] Update all libraries to use `Hoa\\Consistency`,\r\n  - [x] Remove `Hoa\\Core\\Consistency`.\r\n\r\n### Next steps\r\n\r\n~~Continue to split the core, see https://github.com/hoaproject/Core/issues/97.~~\r\n\r\nHere are the following steps to follow:\r\n- [x] `Hoa\\Xyl\\Data`:\r\n  - [x] Move `Hoa\\Core\\Data` to `Hoa\\Xyl\\Data`,\r\n  - [x] Update `Hoa\\View` and other libraries to understand a mixed data structured instead (to remove a dependency),\r\n  - [x] Remove `Hoa\\Core\\Data`.\r\n- [x] `Hoa\\Parameter`:\r\n  - [x] Create `Hoa\\Parameter` (from `Hoa\\Core\\Parameter`),\r\n  - [x] Write test suites (optional so far),\r\n  - [x] Remove `Hoa\\Core\\Parameter`.\r\n- [x] Remove `Hoa\\Core`:\r\n  - [x] Mark the repository as deprecated,\r\n  - [x] Do we empty the repository?\r\n\r\n### Update all `composer.json` files\r\n\r\nBecause we are dropping PHP5.4 too.\r\n\r\n  * [x] Acl\r\n  * [x] Bench\r\n  * [x] Cache\r\n  * [x] Cli\r\n  * [x] Compiler\r\n  * [x] Consistency\r\n  * [x] Console\r\n  * [x] Database\r\n  * [x] Devtools\r\n  * [x] Dispatcher\r\n  * [x] Dns\r\n  * [x] Event\r\n  * [x] Eventsource\r\n  * [x] Exception\r\n  * [x] Fastcgi\r\n  * [x] File\r\n  * [x] Graph\r\n  * [x] Http\r\n  * [x] Irc\r\n  * [x] Iterator\r\n  * [x] Json\r\n  * [x] Locale\r\n  * [x] Log\r\n  * [x] Mail\r\n  * [x] Math\r\n  * [x] Memory\r\n  * [x] Mime\r\n  * [x] Model\r\n  * [x] Notification\r\n  * [x] Praspel\r\n  * [x] Promise\r\n  * [x] Protocol\r\n  * [x] Prototype\r\n  * [x] Realdom\r\n  * [x] Regex\r\n  * [x] Registry\r\n  * [x] Router\r\n  * [x] Ruler\r\n  * [x] Serialize\r\n  * [x] Session\r\n  * [x] Socket\r\n  * [x] Stream\r\n  * [x] String\r\n  * [x] Stringbuffer\r\n  * [x] Test\r\n  * [x] Translate\r\n  * [x] Tree\r\n  * [x] Ustring\r\n  * [x] View\r\n  * [x] Visitor\r\n  * [x] Websocket\r\n  * [x] Worker\r\n  * [x] Xml\r\n  * [x] Xmlrpc\r\n  * [x] Xyl\r\n  * [x] Zformat\r\n  * [x] Zombie\r\n  * [x]  "}}