{"action":"created","issue":{"url":"https://api.github.com/repos/scribetw/pixmicat_modules/issues/60","labels_url":"https://api.github.com/repos/scribetw/pixmicat_modules/issues/60/labels{/name}","comments_url":"https://api.github.com/repos/scribetw/pixmicat_modules/issues/60/comments","events_url":"https://api.github.com/repos/scribetw/pixmicat_modules/issues/60/events","html_url":"https://github.com/scribetw/pixmicat_modules/issues/60","id":56361296,"number":60,"title":"Question about namespace","user":{"login":"Kennyl","id":1933134,"avatar_url":"https://avatars.githubusercontent.com/u/1933134?v=3","gravatar_id":"","url":"https://api.github.com/users/Kennyl","html_url":"https://github.com/Kennyl","followers_url":"https://api.github.com/users/Kennyl/followers","following_url":"https://api.github.com/users/Kennyl/following{/other_user}","gists_url":"https://api.github.com/users/Kennyl/gists{/gist_id}","starred_url":"https://api.github.com/users/Kennyl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kennyl/subscriptions","organizations_url":"https://api.github.com/users/Kennyl/orgs","repos_url":"https://api.github.com/users/Kennyl/repos","events_url":"https://api.github.com/users/Kennyl/events{/privacy}","received_events_url":"https://api.github.com/users/Kennyl/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/scribetw/pixmicat_modules/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-03T10:45:24Z","updated_at":"2015-08-06T11:47:30Z","closed_at":null,"body":"若用class mod_adminenhance來做例子。\r\nnamespace 是否寫成如下？\r\nnamespace Pixmicat\\mod_adminenhance;\r\n或\r\n namespace Pixmicat\\Modules\\mod_adminenhance;"},"comment":{"url":"https://api.github.com/repos/scribetw/pixmicat_modules/issues/comments/128340127","html_url":"https://github.com/scribetw/pixmicat_modules/issues/60#issuecomment-128340127","issue_url":"https://api.github.com/repos/scribetw/pixmicat_modules/issues/60","id":128340127,"user":{"login":"scribetw","id":6398934,"avatar_url":"https://avatars.githubusercontent.com/u/6398934?v=3","gravatar_id":"","url":"https://api.github.com/users/scribetw","html_url":"https://github.com/scribetw","followers_url":"https://api.github.com/users/scribetw/followers","following_url":"https://api.github.com/users/scribetw/following{/other_user}","gists_url":"https://api.github.com/users/scribetw/gists{/gist_id}","starred_url":"https://api.github.com/users/scribetw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scribetw/subscriptions","organizations_url":"https://api.github.com/users/scribetw/orgs","repos_url":"https://api.github.com/users/scribetw/repos","events_url":"https://api.github.com/users/scribetw/events{/privacy}","received_events_url":"https://api.github.com/users/scribetw/received_events","type":"User","site_admin":false},"created_at":"2015-08-06T11:47:29Z","updated_at":"2015-08-06T11:47:29Z","body":"Hi,\r\n\r\n這題若考量到PHP 5.3，是有困難度。因為 importing function PHP 5.6 才有\r\n> All versions of PHP that support namespaces support three kinds of aliasing or importing: aliasing a class name, aliasing an interface name, and aliasing a namespace name. PHP 5.6+ also allows aliasing or importing function and constant names.\r\n\r\n或許可以不必考慮5.3，畢竟現在還在用5.3的比率應該也很低。\r\n\r\n> lib_common.php 與 lib_compatible.php 如有使用必要,就抄一套去Pixmicat/Module處。\r\n因為有許多模組事實上在用 lib_common.php 提供的 function。\r\n最好的辦法的確是重構，將這兩個弄成 Object 來使用。\r\n不過這意味著模組必須要經過適當修改才能用。\r\n\r\n是說現在本來也要加namespace才能動，乾脆狠一點不相容舊版模組算了？\r\n沒有相容性包裹的話，會比較好設計。"}}