{"id":676,"date":"2020-05-24T09:57:03","date_gmt":"2020-05-24T06:57:03","guid":{"rendered":"https:\/\/ek.oa.edu.ua\/Kukhta\/test3\/?p=676"},"modified":"2020-05-24T09:58:30","modified_gmt":"2020-05-24T06:58:30","slug":"prostir-imen","status":"publish","type":"post","link":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/prostir-imen\/","title":{"rendered":"\u041f\u0440\u043e\u0441\u0442\u0456\u0440 \u0456\u043c\u0435\u043d"},"content":{"rendered":"<p>\u041f\u0440\u043e\u0441\u0442\u0456\u0440 \u0456\u043c\u0435\u043d, \u0446\u0435 \u043e\u0434\u0438\u043d \u0456\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u0456\u0432 \u0456\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0456\u0457 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432. \u0422\u0430\u043a\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u0442\u044f \u043c\u043e\u0436\u043d\u0430 \u043f\u043e\u0431\u0430\u0447\u0438\u0442\u0438 \u0432 \u0431\u0430\u0433\u0430\u0442\u044c\u043e\u0445 \u043c\u0456\u0441\u0446\u044f\u0445. \u041d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434, \u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u0439\u043d\u0456\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0456 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0456\u0457 \u0441\u043b\u0443\u0436\u0430\u0442\u044c \u0434\u043b\u044f \u0443\u0433\u0440\u0443\u043f\u043e\u0432\u0430\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432 \u0456 \u0432\u0438\u0441\u0442\u0443\u043f\u0430\u044e\u0442\u044c \u0432 \u044f\u043a\u043e\u0441\u0442\u0456 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0443 \u0456\u043c\u0435\u043d \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u0456\u0432, \u044f\u043a\u0456 \u0432 \u043d\u0438\u0445 \u0437\u043d\u0430\u0445\u043e\u0434\u044f\u0442\u044c\u0441\u044f. \u042f\u043a \u043f\u0440\u0438\u043a\u043b\u0430\u0434 \u0444\u0430\u0439\u043b text.txt \u043c\u043e\u0436\u0435 \u043f\u0435\u0440\u0435\u0431\u0443\u0432\u0430\u0442\u0438 \u0432\u0456\u0434\u0440\u0430\u0437\u0443 \u0432 \u0434\u0435\u043a\u0456\u043b\u044c\u043a\u043e\u0445 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0456\u044f\u0445: \/files \u0456 \/docs, \u0430\u043b\u0435 \u0434\u0432\u0456 \u043a\u043e\u043f\u0456\u0457 text.txt \u043d\u0435 \u043c\u043e\u0436\u0443\u0442\u044c \u0456\u0441\u043d\u0443\u0432\u0430\u0442\u0438 \u0432 \u043e\u0434\u043d\u0456\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0456\u0457. \u0422\u0430\u043a\u043e\u0436, \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0443 \u0434\u043e text.txt \u0437\u0437\u043e\u0432\u043d\u0456, \u043c\u0438 \u043f\u043e\u0432\u0438\u043d\u043d\u0456 \u0434\u043e\u0434\u0430\u0442\u0438 \u0456\u043c&#8217;\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0456\u0457 \u043f\u0435\u0440\u0435\u0434 \u0456\u043c&#8217;\u044f\u043c \u0444\u0430\u0439\u043b\u0443 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u044e\u0447\u0438 \u0440\u043e\u0437\u0434\u0456\u043b\u044c\u043d\u0438\u043a (\/files\/text.txt). \u0422\u0430\u043a\u0438\u0439 \u0436\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u043f\u043e\u0448\u0438\u0440\u044e\u0454\u0442\u044c\u0441\u044f \u0456 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0456\u0440 \u0456\u043c\u0435\u043d.<\/p>\n<p>\u0423 PHP \u043f\u0440\u043e\u0441\u0442\u0456\u0440 \u0456\u043c\u0435\u043d \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0454\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0432\u0438\u0440\u0456\u0448\u0435\u043d\u043d\u044f \u0434\u0432\u043e\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c:<\/p>\n<p><strong>1.<\/strong> \u041a\u043e\u043d\u0444\u043b\u0456\u043a\u0442 \u0456\u043c\u0435\u043d \u043c\u0456\u0436 \u0432\u0430\u0448\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u0456 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0456\u043c\u0438.<br \/>\n<strong>2.<\/strong> \u041c\u043e\u0436\u043b\u0438\u0432\u0456\u0441\u0442\u044c \u0441\u0442\u0432\u043e\u0440\u044e\u0432\u0430\u0442\u0438 \u043f\u0441\u0435\u0432\u0434\u043e\u043d\u0456\u043c\u0438 (\u0430\u0431\u043e \u0441\u043a\u043e\u0440\u043e\u0447\u0435\u043d\u043d\u044f) \u0434\u043b\u044f \u0434\u043e\u0432\u0433\u0438\u0445 \u0456\u043c\u0435\u043d, \u0449\u043e\u0431 \u043f\u043e\u043b\u0435\u0433\u0448\u0438\u0442\u0438 \u043f\u0435\u0440\u0448\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0456 \u043f\u043e\u043b\u0456\u043f\u0448\u0438\u0442\u0438 \u0447\u0438\u0442\u0430\u043d\u0456\u0441\u0442\u044c \u0432\u0438\u0445\u0456\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0443.<br \/>\n\u041f\u0440\u0438\u043a\u043b\u0430\u0434 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u044f.<\/p>\n<p>\u041f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u043c\u043e, \u0443 \u043d\u0430\u0441 \u0442\u0430\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430:<\/p>\n<pre class=\"result\">-- App\r\n--- Main\r\n---- MyClass.php\r\n- namespace.php<\/pre>\n<p>\u041e\u043f\u0438\u0448\u0435\u043c\u043e \u043a\u043b\u0430\u0441 <em>MyClasss.php<\/em>:<\/p>\n<pre class=\"prettyprint linenums\"><span class=\"hljs-preprocessor\">&lt;?php<\/span>\r\n<span class=\"hljs-comment\">\/\/ App\/Main\/MyClass.php<\/span>\r\n\r\n<span class=\"hljs-keyword\">namespace<\/span> <span class=\"hljs-title\">App<\/span>\\<span class=\"hljs-title\">Main<\/span>;\r\n\r\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">MyClass<\/span> <\/span>{\t\r\n\t<span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">hello<\/span><span class=\"hljs-params\">()<\/span> <\/span>{\r\n\t\t<span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-string\">\"hello\"<\/span>;\r\n\t}\r\n}\r\n<span class=\"hljs-preprocessor\">?&gt;<\/span><\/pre>\n<p>\u0417\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0443 \u0456\u043c\u0435\u043d \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u043e \u043a\u043b\u0430\u0441\u0443 <code>MyClass<\/code> (\u0444\u0430\u0439\u043b <em>namespace.ph<\/em>p):<\/p>\n<pre class=\"prettyprint linenums\"><span class=\"hljs-preprocessor\">&lt;?php<\/span>\r\n<span class=\"hljs-comment\">\/\/ namespace.php<\/span>\r\n\r\n<span class=\"hljs-keyword\">namespace<\/span> <span class=\"hljs-title\">App<\/span>\\<span class=\"hljs-title\">Main<\/span>;\r\n\r\n<span class=\"hljs-keyword\">require_once<\/span> <span class=\"hljs-string\">\"App\\Main\\MyClass.php\"<\/span>;\r\n\r\n<span class=\"hljs-variable\">$obj<\/span> = <span class=\"hljs-keyword\">new<\/span> \\App\\Main\\MyClass;\r\n<span class=\"hljs-keyword\">echo<\/span> <span class=\"hljs-variable\">$obj<\/span>-&gt;hello(); <span class=\"hljs-comment\">\/\/ hello<\/span>\r\n<span class=\"hljs-preprocessor\">?&gt;<\/span><\/pre>\n<p>\u041e\u0442\u043e\u0436, \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u0442\u0430\u043a\u0438\u0439 \u0436\u0435 \u043a\u043b\u0430\u0441, \u0442\u0456\u043b\u044c\u043a\u0438 \u0432 \u0456\u043d\u0448\u0456\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0456\u0457. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0442\u0432\u043e\u0440\u0438\u043c\u043e \u043a\u043b\u0430\u0441 \u0437 \u0442\u0430\u043a\u043e\u044e \u0436 \u043d\u0430\u0437\u0432\u043e\u044e \u0432 \u043f\u0430\u043f\u0446\u0456 App\/Core.<\/p>\n<pre class=\"prettyprint linenums\"><span class=\"hljs-preprocessor\">&lt;?php<\/span>\r\n<span class=\"hljs-comment\">\/\/ App\/Core\/MyClass.php<\/span>\r\n\r\n<span class=\"hljs-keyword\">namespace<\/span> <span class=\"hljs-title\">App<\/span>\\<span class=\"hljs-title\">Core<\/span>;\r\n\r\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">MyClass<\/span> <\/span>{\t\r\n\t<span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">hello<\/span><span class=\"hljs-params\">()<\/span> <\/span>{\r\n\t\t<span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-string\">\"hello, it's core\"<\/span>;\r\n\t}\r\n}\r\n<span class=\"hljs-preprocessor\">?&gt;<\/span><\/pre>\n<p>\u041e\u0442\u0440\u0438\u043c\u0430\u0454\u043c\u043e \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u043e \u0446\u044c\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0443:<\/p>\n<pre class=\"prettyprint linenums\"><span class=\"hljs-preprocessor\">&lt;?php<\/span>\r\n<span class=\"hljs-keyword\">namespace<\/span> <span class=\"hljs-title\">App<\/span>\\<span class=\"hljs-title\">Core<\/span>;\r\n\r\n<span class=\"hljs-keyword\">require_once<\/span> <span class=\"hljs-string\">\"App\\Core\\MyClass.php\"<\/span>;\r\n\r\n<span class=\"hljs-variable\">$obj<\/span> = <span class=\"hljs-keyword\">new<\/span> \\App\\Core\\MyClass;\r\n<span class=\"hljs-keyword\">echo<\/span> <span class=\"hljs-variable\">$obj<\/span>-&gt;hello(); <span class=\"hljs-comment\">\/\/ hello it\u2019s core<\/span>\r\n<span class=\"hljs-preprocessor\">?&gt;<\/span><\/pre>\n<h3>\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043f\u0441\u0435\u0432\u0434\u043e\u043d\u0456\u043c\u0430 \u0456\u043c\u0435\u043d\u0456<\/h3>\n<p>\u041f\u0441\u0435\u0432\u0434\u043e\u043d\u0456\u043c\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0443 \u0456\u043c\u0435\u043d \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u044e\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0431\u0456\u043b\u044c\u0448 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0443 \u0434\u043e \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0443. \u041d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434, \u0443 \u0432\u0430\u0441 \u0442\u0430\u043a\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 namespace App\/Core\/Controller\/, \u0449\u043e\u0431 \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0437 \u043a\u043b\u0430\u0441\u0456\u0432, \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u0431\u0443\u0434\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u0438 \u0432\u0435\u0441\u044c \u0446\u0435\u0439 \u0448\u043b\u044f\u0445, \u043d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434, App\/Core\/Controller\/AppController.php. \u041d\u0430\u0431\u0430\u0433\u0430\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0456\u0448\u0435 \u0431\u0443\u043b\u043e \u0431 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u0438 CoreController\/AppController.php. \u0426\u0435 \u043c\u043e\u0436\u043d\u0430 \u0440\u0435\u0430\u043b\u0456\u0437\u0443\u0432\u0430\u0442\u0438 \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e \u043f\u0441\u0435\u0432\u043e\u0434\u043d\u0456\u043c\u043e\u0432.<\/p>\n<p>\u0414\u043b\u044f \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043f\u0441\u0435\u0432\u0434\u043e\u043d\u0456\u043c\u0430 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u044e\u0442\u044c \u043a\u043b\u044e\u0447\u043e\u0432\u0435 \u0441\u043b\u043e\u0432\u043e <code>use<\/code>.<\/p>\n<p>\u041f\u0440\u0438\u043a\u043b\u0430\u0434:<\/p>\n<pre class=\"prettyprint linenums\"><span class=\"hljs-preprocessor\">&lt;?php<\/span>\r\n<span class=\"hljs-keyword\">use<\/span> <span class=\"hljs-title\">App<\/span>\/<span class=\"hljs-title\">Core<\/span>\/<span class=\"hljs-title\">Controller<\/span> <span class=\"hljs-title\">as<\/span> <span class=\"hljs-title\">CoreController<\/span>;\r\n\r\n<span class=\"hljs-comment\">\/\/ \u2026<\/span>\r\n\r\n<span class=\"hljs-variable\">$app<\/span> = <span class=\"hljs-keyword\">new<\/span> CoreController\\AppController.php;\r\n<span class=\"hljs-preprocessor\">?&gt;<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u043e\u0441\u0442\u0456\u0440 \u0456\u043c\u0435\u043d, \u0446\u0435 \u043e\u0434\u0438\u043d \u0456\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u0456\u0432 \u0456\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0456\u0457 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432. \u0422\u0430\u043a\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u0442\u044f \u043c\u043e\u0436\u043d\u0430 \u043f\u043e\u0431\u0430\u0447\u0438\u0442\u0438 \u0432 \u0431\u0430\u0433\u0430\u0442\u044c\u043e\u0445 \u043c\u0456\u0441\u0446\u044f\u0445. \u041d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434, \u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u0439\u043d\u0456\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0456 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0456\u0457 \u0441\u043b\u0443\u0436\u0430\u0442\u044c \u0434\u043b\u044f \u0443\u0433\u0440\u0443\u043f\u043e\u0432\u0430\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432 \u0456 \u0432\u0438\u0441\u0442\u0443\u043f\u0430\u044e\u0442\u044c \u0432 \u044f\u043a\u043e\u0441\u0442\u0456 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0443 \u0456\u043c\u0435\u043d \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u0456\u0432, \u044f\u043a\u0456 \u0432 \u043d\u0438\u0445 \u0437\u043d\u0430\u0445\u043e\u0434\u044f\u0442\u044c\u0441\u044f. \u042f\u043a \u043f\u0440\u0438\u043a\u043b\u0430\u0434 \u0444\u0430\u0439\u043b text.txt \u043c\u043e\u0436\u0435 \u043f\u0435\u0440\u0435\u0431\u0443\u0432\u0430\u0442\u0438 \u0432\u0456\u0434\u0440\u0430\u0437\u0443 \u0432 \u0434\u0435\u043a\u0456\u043b\u044c\u043a\u043e\u0445 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0456\u044f\u0445: \/files \u0456 \/docs, \u0430\u043b\u0435 \u0434\u0432\u0456 \u043a\u043e\u043f\u0456\u0457 text.txt \u043d\u0435 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-676","post","type-post","status-publish","format-standard","hentry","category-oop"],"_links":{"self":[{"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts\/676","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/comments?post=676"}],"version-history":[{"count":2,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts\/676\/revisions"}],"predecessor-version":[{"id":678,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts\/676\/revisions\/678"}],"wp:attachment":[{"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/media?parent=676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/categories?post=676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/tags?post=676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}