{"action":"created","issue":{"url":"https://api.github.com/repos/zendframework/zendframework/issues/5524","repository_url":"https://api.github.com/repos/zendframework/zendframework","labels_url":"https://api.github.com/repos/zendframework/zendframework/issues/5524/labels{/name}","comments_url":"https://api.github.com/repos/zendframework/zendframework/issues/5524/comments","events_url":"https://api.github.com/repos/zendframework/zendframework/issues/5524/events","html_url":"https://github.com/zendframework/zendframework/issues/5524","id":23131385,"number":5524,"title":"[ZF3] Thinking component as module","user":{"login":"bakura10","id":1198915,"avatar_url":"https://avatars.githubusercontent.com/u/1198915?v=3","gravatar_id":"","url":"https://api.github.com/users/bakura10","html_url":"https://github.com/bakura10","followers_url":"https://api.github.com/users/bakura10/followers","following_url":"https://api.github.com/users/bakura10/following{/other_user}","gists_url":"https://api.github.com/users/bakura10/gists{/gist_id}","starred_url":"https://api.github.com/users/bakura10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bakura10/subscriptions","organizations_url":"https://api.github.com/users/bakura10/orgs","repos_url":"https://api.github.com/users/bakura10/repos","events_url":"https://api.github.com/users/bakura10/events{/privacy}","received_events_url":"https://api.github.com/users/bakura10/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/zendframework/zendframework/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/zendframework/zendframework/labels/ModuleManager","name":"ModuleManager","color":"008000"},{"url":"https://api.github.com/repos/zendframework/zendframework/labels/Mvc","name":"Mvc","color":"008000"},{"url":"https://api.github.com/repos/zendframework/zendframework/labels/To%20Be%20Closed","name":"To Be Closed","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/zendframework/zendframework/milestones/9","html_url":"https://github.com/zendframework/zendframework/milestones/3.0.0","labels_url":"https://api.github.com/repos/zendframework/zendframework/milestones/9/labels","id":213250,"number":9,"title":"3.0.0","description":"","creator":{"login":"Maks3w","id":1301698,"avatar_url":"https://avatars.githubusercontent.com/u/1301698?v=3","gravatar_id":"","url":"https://api.github.com/users/Maks3w","html_url":"https://github.com/Maks3w","followers_url":"https://api.github.com/users/Maks3w/followers","following_url":"https://api.github.com/users/Maks3w/following{/other_user}","gists_url":"https://api.github.com/users/Maks3w/gists{/gist_id}","starred_url":"https://api.github.com/users/Maks3w/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maks3w/subscriptions","organizations_url":"https://api.github.com/users/Maks3w/orgs","repos_url":"https://api.github.com/users/Maks3w/repos","events_url":"https://api.github.com/users/Maks3w/events{/privacy}","received_events_url":"https://api.github.com/users/Maks3w/received_events","type":"User","site_admin":false},"open_issues":26,"closed_issues":36,"state":"open","created_at":"2012-11-14T22:10:16Z","updated_at":"2016-06-27T18:36:02Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2013-11-22T11:22:40Z","updated_at":"2016-06-27T18:37:48Z","closed_at":null,"body":"Hi everyone,\r\n\r\nThis follows a discussion I had with @ocramius yesterday.\r\n\r\nCurrently, the way plugin manager are configured inside the framework is a bit messy to my opinion. Most plugin manager factories are registered in the Mvc namespace (https://github.com/zendframework/zf2/tree/master/library/Zend/Mvc/Service). This introduces a soft dependency to each of those components in the Mvc namespace, and everyone that want to use those factories require the Mvc component.\r\n\r\nThe idea is to move each of those things to the given components. This make it REALLY easier to discover how plugin managers are constructed. The same apply for view helpers or filters (we already did that).\r\n\r\nNow, the second problem is classes like that: https://github.com/zendframework/zf2/blob/master/library/Zend/Form/View/HelperConfig.php\r\n\r\nThose are nothing more than view helpers. What would be good would be to allow each component to have a config that would be merged. Not sure about the syntax yet, but for instance, the Form component could have a config like that:\r\n\r\n```php\r\nreturn array(\r\n    'view_helpers' => array(\r\n        'invokables' => array(\r\n             // Add form specific helpers\r\n        )\r\n   )\r\n);\r\n```\r\n\r\n> This is usually what is done in third-party modules.\r\n\r\nNext, ViewHelperPluginManagerFactory (which will be situated in the Zend\\View component, and not in the Zend\\Mvc namespace), will do something like that:\r\n\r\n```php\r\nclass ViewHelperPluginManagerFactory implements FactoryInterface\r\n{\r\n    public function createService($sl)\r\n    {\r\n        return new ViewHelperPluginManager($sl->get('Config')['view_helpers']);\r\n    }\r\n}\r\n```\r\n\r\nThe beauty of this is that it will aggregate both ALL the view helpers specified inside the framework and in the ones specified by third-party modules.\r\n\r\nWhat I'd like is to use inside the framework all the best practices we have accumulated in modules.\r\n\r\nNow, the Zend\\View would also define it's own config:\r\n\r\n```php\r\nreturn array(\r\n    'service_manager' => array(\r\n        'factories' => array(\r\n            'Zend\\View\\ViewHelperPluginManager' => 'Zend\\View\\Factory\\ViewHelperPluginManagerFactory'\r\n        )\r\n    )\r\n);\r\n```\r\n\r\n## Drawbacks\r\n\r\nIf we consider each component as a module, it may have some performance drawbacks. But I think we could have a lighter way to handle ZF3 components."},"comment":{"url":"https://api.github.com/repos/zendframework/zendframework/issues/comments/228835541","html_url":"https://github.com/zendframework/zendframework/issues/5524#issuecomment-228835541","issue_url":"https://api.github.com/repos/zendframework/zendframework/issues/5524","id":228835541,"user":{"login":"GeeH","id":613376,"avatar_url":"https://avatars.githubusercontent.com/u/613376?v=3","gravatar_id":"","url":"https://api.github.com/users/GeeH","html_url":"https://github.com/GeeH","followers_url":"https://api.github.com/users/GeeH/followers","following_url":"https://api.github.com/users/GeeH/following{/other_user}","gists_url":"https://api.github.com/users/GeeH/gists{/gist_id}","starred_url":"https://api.github.com/users/GeeH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GeeH/subscriptions","organizations_url":"https://api.github.com/users/GeeH/orgs","repos_url":"https://api.github.com/users/GeeH/repos","events_url":"https://api.github.com/users/GeeH/events{/privacy}","received_events_url":"https://api.github.com/users/GeeH/received_events","type":"User","site_admin":false},"created_at":"2016-06-27T18:37:48Z","updated_at":"2016-06-27T18:37:48Z","body":"This issue has been closed as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html"}}
{"actor":{"display_login":"GeeH"}}