{"id":369602,"date":"2024-05-21T04:07:10","date_gmt":"2024-05-21T04:07:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=369602"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=369602","title":{"rendered":"<span>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f CLI \u0432 Joomla 4 \u0438 Joomla 5 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043b\u0430\u0433\u0438\u043d\u0430<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 Joomla, \u043a\u0430\u043a \u0438 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 PHP \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u0445 \u0438 \u0434\u0432\u0438\u0436\u043a\u0430\u0445, \u0443\u0436\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u0430\u0432\u043d\u043e (\u0441 \u0432\u0435\u0440\u0441\u0438\u0439 1.7.x) \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CLI &#8212; Command line interface. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u0440\u044f\u0434 \u043b\u0438 \u0432 \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u043e\u043f\u0430\u0434\u0443\u0442 \u043b\u044e\u0434\u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0435 \u0441 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u044e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439, \u043d\u043e \u0434\u043b\u044f \u0441\u043f\u0440\u0430\u0432\u043a\u0438 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Joomla \u0447\u0435\u0440\u0435\u0437 CLI \u043d\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 (Apache, Nginx etc.), \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 <code>php<\/code> (\u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445), \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 (\u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e 60 \u0441\u0435\u043a\u0443\u043d\u0434). <\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CLI \u0440\u0435\u0448\u0430\u044e\u0442 \u0442\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 (\u0438\u0437 \u0430\u0434\u043c\u0438\u043d\u043a\u0438) Joomla \u043d\u0435\u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e \u0438\u0437-\u0437\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 &#8212; \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 &#171;\u0442\u044f\u0436\u0435\u043b\u044b\u0435&#187; \u0437\u0430\u0434\u0430\u0447\u0438. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u0441\u043e \u0441\u0442\u0430\u0440\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Joomla \u043d\u0430 \u043d\u043e\u0432\u0443\u044e, \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u043f\u043e API (\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0446\u0435\u043d \u0438 \u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432, \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430 \u0437\u0430\u043a\u0430\u0437\u043e\u0432), \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u043c\u0438, \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0451\u043c\u0430\u0445 (\u0434\u0435\u0441\u044f\u0442\u043a\u0438-\u0441\u043e\u0442\u043d\u0438 \u0442\u044b\u0441\u044f\u0447 \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u044b \u043f\u043e\u0437\u0438\u0446\u0438\u0439) \u0438 \u0442.\u0434. &#8212; \u0432\u0441\u0451 \u0442\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<h2>\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/h2>\n<ul>\n<li>\n<p><a href=\"#sources\" rel=\"noopener noreferrer nofollow\">\u0421\u043f\u0438\u0441\u043e\u043a \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#create-joomla-plugin\" rel=\"noopener noreferrer nofollow\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u044b console \u0434\u043b\u044f Joomla 4 \/ Joomla 5<\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#xml-manifest\" rel=\"noopener noreferrer nofollow\">XML-\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u043f\u043b\u0430\u0433\u0438\u043d\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#provider\" rel=\"noopener noreferrer nofollow\">\u0424\u0430\u0439\u043b services\/provider.php<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#plugin-file\" rel=\"noopener noreferrer nofollow\">\u0424\u0430\u0439\u043b \u043f\u043b\u0430\u0433\u0438\u043d\u0430 src\/Extension\/Testconsole.php<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#commands-file\" rel=\"noopener noreferrer nofollow\">\u0424\u0430\u0439\u043b\u044b \u0441 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f Joomla CLI<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#method-configure\" rel=\"noopener noreferrer nofollow\">\u041c\u0435\u0442\u043e\u0434 configure()<\/a>. \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u043f\u0446\u0438\u0439 \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u044b.<\/p>\n<\/li>\n<li>\n<p><a href=\"#method-doexecute\" rel=\"noopener noreferrer nofollow\">\u041c\u0435\u0442\u043e\u0434 doExecute()<\/a>. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b.<\/p>\n<\/li>\n<li>\n<p><a href=\"#SymfonyStyle\" rel=\"noopener noreferrer nofollow\">SymfonyStyle: \u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438<\/a><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f3e\/6e0\/eb5\/f3e6e0eb569573359ccb008bedcdd1b0.png\" alt=\"\u0427\u0430\u0441\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434 CLI  \u044f\u0434\u0440\u0430 Joomla 5\" title=\"\u0427\u0430\u0441\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434 CLI  \u044f\u0434\u0440\u0430 Joomla 5\" width=\"701\" height=\"730\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f3e\/6e0\/eb5\/f3e6e0eb569573359ccb008bedcdd1b0.png\"\/><\/p>\n<div><figcaption>\u0427\u0430\u0441\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434 CLI  \u044f\u0434\u0440\u0430 Joomla 5<\/figcaption><\/div>\n<\/figure>\n<p><a class=\"anchor\" name=\"sources\" id=\"sources\"><\/a><\/p>\n<h2>\u0421\u043f\u0438\u0441\u043e\u043a \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b<\/h2>\n<ol>\n<li>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u043a\u043e\u0434 \u044f\u0434\u0440\u0430 Joomla \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439. PHP-\u043a\u043b\u0430\u0441\u0441\u044b CLI \u043a\u043e\u043c\u0430\u043d\u0434 \u044f\u0434\u0440\u0430 \u043b\u0435\u0436\u0430\u0442 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>libraries\/src\/Console<\/code>.  \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0445, \u0438\u0437\u0443\u0447\u0430\u0435\u043c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0440\u0430\u0437\u0446\u0430.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2f3\/436\/4e3\/2f34364e3311cfa563a81a97dbdcf014.png\" width=\"431\" height=\"777\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2f3\/436\/4e3\/2f34364e3311cfa563a81a97dbdcf014.png\"\/><\/figure>\n<\/li>\n<li>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f <a href=\"https:\/\/habr.com\/ru\/articles\/696222\/\" rel=\"noopener noreferrer nofollow\">Joomla 4: \u043c\u043e\u0449\u044c CLI \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/a>:  \u0432 \u043d\u0435\u0439 \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 CLI \u0432 Joomla, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434. \u0410 \u0442\u0430\u043a \u0436\u0435 \u0441\u0442\u0430\u0442\u044c\u044e \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u0430\u043d\u0434 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 Akeeba Backup.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.joomla.org\/J4.x:Writing_A_CLI_Application\" rel=\"noopener noreferrer nofollow\">\u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f Joomla<\/a>. \u0412  \u043d\u0435\u0439 \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u044b <code>console<\/code> \u0434\u043b\u044f Joomla 4+ \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 CLI. \u0422\u0430\u043a\u0436\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0432\u0438\u0434\u0435\u043e.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f <a href=\"https:\/\/habr.com\/ru\/articles\/676902\/\" rel=\"noopener noreferrer nofollow\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 WebCron \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043b\u044f Joomla 4 (Task Scheduler Plugin)<\/a>. \u0412 Joomla 4.1 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0437\u0430\u0434\u0430\u0447 &#8212; <strong>Task Scheduler<\/strong>. \u041c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0438 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0438 \u0447\u0435\u0440\u0435\u0437 \u0430\u0434\u043c\u0438\u043d\u043a\u0443, \u0430 \u0432 CLI \u0438\u043b\u0438 \u0432 CRON \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443: <code>php \/path\/to\/site\/public_html\/cli\/joomla.php scheduler:run<\/code>. <strong>\u042d\u0442\u043e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/strong> <\/p>\n<\/li>\n<li>\n<p>\u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f <a href=\"https:\/\/docs.joomla.org\/J4.x:CLI_example_-_Onoffbydate\" rel=\"noopener noreferrer nofollow\">Joomla CLI example &#8212; Onoffbydate<\/a> \u0438 \u0435\u0451 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 <a href=\"https:\/\/mb4.ru\/cms\/joomla4\/1655-j4-cli-example-onoffbydate-joomla-4.html\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f CLI \u0434\u043b\u044f Joomla 4 &#8212; Onoffbydate<\/a> \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 Joomla CLI, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u044c \/ \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0434\u0430\u0442\u044b \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0433\u043e\u0434\u0430 \u043f\u043e CRON.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f <a href=\"https:\/\/magazine.joomla.org\/all-issues\/april-2021\/jiji-your-new-joomla-4-console-friend\" rel=\"noopener noreferrer nofollow\">Jiji, your new Joomla! 4 Console friend<\/a> \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0436\u0443\u0440\u043d\u0430\u043b\u0435 \u043c\u0435\u0436\u0434\u0443\u043d\u0430\u0440\u043e\u0434\u043d\u043e\u0433\u043e Joomla-\u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430 Joomla Community Magazine. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <code>hello world<\/code>. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u0430\u043c\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043a\u043e\u0434\u0430, \u0441\u0442\u043e\u0438\u0442 <a href=\"https:\/\/github.com\/alexandreelise\/plg_system_jiji\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c GitHub \u044d\u0442\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430<\/a>, \u0433\u0434\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430\u043c\u0438 Joomla, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u043c\u043f\u043e\u0440\u0442 \u0441\u0442\u0430\u0442\u0435\u0439 Joomla \u0438\u0437 \u0444\u0430\u0439\u043b\u0430. \u0427\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0435\u0440\u0435\u0434 \u0433\u043b\u0430\u0437\u0430\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u0435\u043c \u043f\u0440\u043e\u0449\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0441\u0432\u043e\u0451.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f <a href=\"https:\/\/habr.com\/ru\/articles\/736412\/\" rel=\"noopener noreferrer nofollow\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b Joomla 4<\/a> \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f Joomla 4 \/ Joomla 5 \u043f\u043e \u043d\u043e\u0432\u044b\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043f\u0440\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0435 \u043e\u0434\u0438\u043d \u0433\u043e\u0434 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 legacy (\u043f\u043b\u0430\u0433\u0438\u043d \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438), \u0447\u0442\u043e \u043e\u0449\u0443\u0442\u0438\u043c\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442 \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 Joomla.<\/p>\n<\/li>\n<\/ol>\n<p><a class=\"anchor\" name=\"create-joomla-plugin\" id=\"create-joomla-plugin\"><\/a><\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u044b console \u0434\u043b\u044f Joomla 4 \/ Joomla 5<\/h2>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043b\u0430\u0433\u0438\u043d\u0430. \u0424\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0435\u0433\u043e \u0432 \u0446\u0435\u043b\u043e\u043c \u0442\u0438\u043f\u0438\u0447\u043d\u0430\u044f \u0434\u043b\u044f Joomla. \u0412 Joomla \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438\u0437 PHP \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Symfony, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0435\u043c, \u043a\u0442\u043e \u0443\u0436\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 CLI  \u0432 Symfony &#8212; \u0432 Joomla \u0441\u0435\u0431\u044f \u0431\u0443\u0434\u0435\u0442 \u0447\u0443\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0443 \u0441\u0435\u0431\u044f \u0434\u043e\u043c\u0430 ?.<\/p>\n<hr\/>\n<p>\u042f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u044f\u0442\u0441\u044f \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 &#171;\u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b&#187;, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0441\u043e \u0441\u0442\u0430\u0442\u044c\u0451\u0439 <a href=\"https:\/\/habr.com\/ru\/articles\/736412\/\" rel=\"noopener noreferrer nofollow\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b Joomla 4<\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0443 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u043d\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445.<\/p>\n<hr\/>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u043b\u0430\u0433\u0438\u043d \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <code>testconsole<\/code> \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0442\u043e \u0443\u043c\u0435\u0435\u0442 Joomla \u0432 CLI.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4ed\/bac\/14a\/4edbac14a990fb313a856de37e4068cf.png\" width=\"408\" height=\"284\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4ed\/bac\/14a\/4edbac14a990fb313a856de37e4068cf.png\"\/><\/figure>\n<p><a class=\"anchor\" name=\"xml-manifest\" id=\"xml-manifest\"><\/a><\/p>\n<h3>XML-\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u043f\u043b\u0430\u0433\u0438\u043d\u0430<\/h3>\n<p>\u042d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0449\u0438\u043a\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 Joomla (\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0438\u043c\u044f, \u0433\u0440\u0443\u043f\u043f\u0443 \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u0434\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f, \u0432\u0435\u0440\u0441\u0438\u044f, \u0441\u0430\u0439\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0438 \u0442.\u0434.), \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439,\u00a0<strong>\u0430 \u0442\u0430\u043a\u0436\u0435<\/strong>\u00a0<strong>\u0437\u0430\u0434\u0430\u0451\u0442 Namespace \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432<\/strong>. \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f\u00a0<code>Namespace<\/code>\u00a0\u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0432 \u0440\u0435\u0435\u0441\u0442\u0440\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f. \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 (Joomla 5.0.3) \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435\u00a0<code>administrator\/cache\/autoload_psr4.php<\/code>. \u041e\u043d \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438\u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f.  <\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?> &lt;extension type=\"plugin\" group=\"console\" method=\"upgrade\"> &lt;name>Console - Testconsole&lt;\/name> &lt;author>Sergey Tolkachyov&lt;\/author> &lt;creationDate>Feb 2024&lt;\/creationDate> &lt;copyright>Copyright \u00a9 2024 Sergey Tolkachyov. All rights reserved.&lt;\/copyright> &lt;license>GNU\/GPL 3&lt;\/license> &lt;authorEmail>info@web-tolk.ru&lt;\/authorEmail> &lt;authorUrl>https:\/\/web-tolk.ru&lt;\/authorUrl> &lt;version>1.0.0&lt;\/version> &lt;description>PLG_CONSOLE_SCANJOOMLASITES_DESC&lt;\/description> &lt;namespace path=\"src\">Joomla\\Plugin\\Console\\Testconsole&lt;\/namespace> &lt;languages folder=\"language\"> &lt;language tag=\"en-GB\">en-GB\/plg_console_testconsole.ini&lt;\/language> &lt;language tag=\"en-GB\">en-GB\/plg_console_testconsole.sys.ini&lt;\/language> &lt;language tag=\"ru-RU\">ru-RU\/plg_console_testconsole.ini&lt;\/language> &lt;language tag=\"ru-RU\">ru-RU\/plg_console_testconsole.sys.ini&lt;\/language> &lt;\/languages> &lt;files> &lt;folder>services&lt;\/folder> &lt;folder plugin=\"testconsole\">src&lt;\/folder> &lt;\/files> &lt;\/extension><\/code><\/pre>\n<p>\u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u043f\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u043c Joomla \u0438\u043c\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0438 \u0435\u0433\u043e \u0433\u0440\u0443\u043f\u043f\u0443: <code>Console - Testconsole<\/code>. \u0422\u0430\u043a\u0436\u0435 <code>namespace<\/code> \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u0433\u0440\u0443\u043f\u043f\u0443 \u043f\u043b\u0430\u0433\u0438\u043d\u0430. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 <em>Joomla\\Plugin\\<\/em><strong><em>Console<\/em><\/strong><em>\\Testconsole<\/em>. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dab\/30a\/d98\/dab30ad988d5096a8a74fba21159389e.png\" width=\"781\" height=\"510\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dab\/30a\/d98\/dab30ad988d5096a8a74fba21159389e.png\"\/><\/figure>\n<p>\u041f\u043b\u0430\u0433\u0438\u043d\u044b \u0433\u0440\u0443\u043f\u043f\u044b <code>console<\/code> \u0432 Joomla \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u043b\u044e\u0431\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b, \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u0434\u0435. \u0425\u043e\u0442\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0432 CLI \u0432\u0430\u0436\u043d\u0435\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043d\u043e \u043d\u0430 \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0443, \u0434\u0430 \u0438 \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0432 \u0446\u0435\u043b\u043e\u043c \u043c\u043e\u0433\u0443\u0442 \u0432\u043b\u0438\u044f\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u044b\u0435 \u0445\u043e\u0441\u0442\u044b, \u043f\u0430\u0440\u043e\u043b\u0438, \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u044b \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<p><a class=\"anchor\" name=\"provider\" id=\"provider\"><\/a><\/p>\n<h3>\u0424\u0430\u0439\u043b services\/provider.php<\/h3>\n<p>\u041f\u043b\u0430\u0433\u0438\u043d\u0443 \u043d\u0443\u0436\u0435\u043d \u0444\u0430\u0439\u043b \u0441\u0435\u0440\u0432\u0438\u0441-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u0432 DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 Joomla \u0438 \u0434\u0430\u0451\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0438\u0437\u0432\u043d\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e\u00a0<code>MVCFactory<\/code>. <\/p>\n<pre><code class=\"php\">&lt;?php \\defined('_JEXEC') or die;  use Joomla\\CMS\\Extension\\PluginInterface; use Joomla\\CMS\\Extension\\Service\\Provider\\MVCFactory; use Joomla\\CMS\\Factory; use Joomla\\CMS\\MVC\\Factory\\MVCFactoryInterface; use Joomla\\CMS\\Plugin\\PluginHelper; use Joomla\\DI\\Container; use Joomla\\DI\\ServiceProviderInterface; use Joomla\\Event\\DispatcherInterface; use Joomla\\Plugin\\Console\\Testconsole\\Extension\\Testconsole;  return new class () implements ServiceProviderInterface {  \/**  * Registers the service provider with a DI container.  *  * @param   Container  $container  The DI container.  *  * @since   1.0.0  *\/ public function register(Container $container) { $container->registerServiceProvider(new MVCFactory('Joomla\\\\Plugin\\\\Console\\\\Testconsole'));  $container->set(PluginInterface::class, function (Container $container) { $config     = (array) PluginHelper::getPlugin('console', 'testconsole');  $subject    = $container->get(DispatcherInterface::class); $mvcFactory = $container->get(MVCFactoryInterface::class);  $app = Factory::getApplication();  $plugin = new Testconsole($subject, $config); $plugin->setApplication($app); $plugin->setMVCFactory($mvcFactory);  return $plugin; } ); } }; <\/code><\/pre>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 <code>$this->getApplication()<\/code>. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u0430 <code>MVCFactory<\/code>, \u0442\u043e \u0438 \u043a \u043d\u0435\u0439 \u0447\u0435\u0440\u0435\u0437 <code>$this->getMVCFactory()<\/code>. <code>MVCFactory<\/code> \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 Joomla \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 &#8212; \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u043c\u0438, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0412\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 Joomla 4 \/ Joomla 5 &#8212; \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 &#171;\u043f\u043b\u044e\u0448\u043a\u0438&#187;. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0435\u0441\u043b\u0438 \u0412\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438, \u0438\u043c\u0435\u044e\u0449\u0438\u043c\u0438 \u0434\u0430\u0432\u043d\u044e\u044e \u0438\u0441\u0442\u043e\u0440\u0438\u044e, \u0412\u044b \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>MVCFactory<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0435\u0449\u0451 \u043d\u0435 &#171;\u043f\u0435\u0440\u0435\u0435\u0445\u0430\u043b\u0438&#187; \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 <code>SiteApplication<\/code>, \u0430 <code>CliApplication<\/code>.  \u0422\u0430\u043a\u0436\u0435 \u0432 \u044f\u0434\u0440\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u0445\u043e\u0436\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b: <code>ConsoleApplication<\/code> &#8212; \u043a\u043b\u0430\u0441\u0441 \u0438\u0437 Joomla-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u0432\u043b\u0438\u0442 \u0432 CMS Joomla \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 4.0. \u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u043e\u0431\u043b\u0435\u0433\u0447\u0451\u043d\u043d\u044b\u0439, \u043b\u0438\u0448\u0435\u043d \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 &#171;\u0444\u0438\u0447&#187; CMS. \u0415\u0449\u0451 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 <code>DaemonApplication<\/code> &#8212; \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b Joomla \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0434\u0435\u043c\u043e\u043d\u0430. \u041f\u043e \u0438\u0434\u0435\u0435, \u043e\u043d \u0443\u043c\u0435\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \/ \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u0440\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0438 \u0441\u0430\u043c \u0441\u0435\u0431\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442. <\/p>\n<p><a class=\"anchor\" name=\"plugin-file\" id=\"plugin-file\"><\/a><\/p>\n<h3>\u0424\u0430\u0439\u043b \u043f\u043b\u0430\u0433\u0438\u043d\u0430 src\/Extension\/Testconsole.php<\/h3>\n<p>\u041a\u043b\u0430\u0441\u0441 \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u0441\u043b\u0443\u0436\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0446\u0435\u043b\u0438: \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 CLI Joomla. \u041f\u043b\u0430\u0433\u0438\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c <code>Joomla\\Event\\SubscriberInterface<\/code>, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432 \u043d\u0451\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u043c\u0435\u0442\u043e\u0434 <code>getSubscribedEvents<\/code>, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 \u043c\u0430\u043f\u043f\u0438\u043d\u0433 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0430. <\/p>\n<pre><code class=\"php\">&lt;?php  namespace Joomla\\Plugin\\Console\\Testconsole\\Extension;  \\defined('_JEXEC') or die;  use Joomla\\CMS\\Factory; use Joomla\\CMS\\MVC\\Factory\\MVCFactoryAwareTrait; use Joomla\\CMS\\Plugin\\CMSPlugin; use Joomla\\Database\\DatabaseAwareTrait; use Joomla\\Event\\SubscriberInterface; use Psr\\Container\\ContainerInterface;  \/\/ \u042d\u0442\u043e namespaces \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 Joomla CLI use Joomla\\Plugin\\Console\\Testconsole\\Extension\\Command\\TestCommand; use Joomla\\Plugin\\Console\\Testconsole\\Extension\\Command\\SecondtestCommand;   class Testconsole extends CMSPlugin implements SubscriberInterface { use MVCFactoryAwareTrait; use DatabaseAwareTrait;  \/**  * Choose which events this plugin is subscribed to and will respond to  * @return string[]  *  * @since version  *\/ public static function getSubscribedEvents(): array { return [ \\Joomla\\Application\\ApplicationEvents::BEFORE_EXECUTE => 'registerCommands', ]; }    }<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044e <code>application.before_execute<\/code>, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c\u0443 \u0432 <code>libraries\/vendor\/joomla\/application\/src\/ApplicationEvents.php<\/code>,  \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d \u043c\u0435\u0442\u043e\u0434 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 <code>registerCommands<\/code>. \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u044b\u043c, \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0435.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0432 Joomla 4 \/ Joomla 5 \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0442\u0443 &#8212; <code>void<\/code>. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 &#8212; <code>$event<\/code>. \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 Joomla CLI \u043c\u0435\u0442\u043e\u0434 (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>registerCommands<\/code>) \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0442\u0443, \u043d\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043d\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 Joomla DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043b\u043e\u0430\u0434\u0435\u0440\u0443 CLI \u043a\u043e\u043c\u0430\u043d\u0434 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0438\u0437 DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 Joomla.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"php\">&lt;?php  namespace Joomla\\Plugin\\Console\\Testconsole\\Extension;  \\defined('_JEXEC') or die;  use Joomla\\CMS\\Factory; use Joomla\\CMS\\MVC\\Factory\\MVCFactoryAwareTrait; use Joomla\\CMS\\Plugin\\CMSPlugin; use Joomla\\Database\\DatabaseAwareTrait; use Joomla\\Event\\SubscriberInterface; use Joomla\\Plugin\\Console\\Testconsole\\Extension\\Command\\TestCommand; use Joomla\\Plugin\\Console\\Testconsole\\Extension\\Command\\SecondtestCommand; use Psr\\Container\\ContainerInterface;   class Testconsole extends CMSPlugin implements SubscriberInterface { use MVCFactoryAwareTrait; use DatabaseAwareTrait;  \/**  * Choose which events this plugin is subscribed to and will respond to  * @return string[]  *  * @since version  *\/ public static function getSubscribedEvents(): array { return [ \\Joomla\\Application\\ApplicationEvents::BEFORE_EXECUTE => 'registerCommands', ]; }  \/**  * Register custom commands  *  * @since version  *\/ public function registerCommands(): void { \/\/ Test command Factory::getContainer()->share( 'testconsole.test', function (ContainerInterface $container) { return new TestCommand; }, true );  \/\/ add test command to joomla.php cli script Factory::getContainer()->get(\\Joomla\\CMS\\Console\\Loader\\WritableLoaderInterface::class) ->add('testconsole:test', 'testconsole.test');   \/\/ Second test command Factory::getContainer()->share( 'testconsole.secondtest', function (ContainerInterface $container) { return new SecondtestCommand; }, true ); \/\/ Add second test command to joomla.php cli script Factory::getContainer()->get(\\Joomla\\CMS\\Console\\Loader\\WritableLoaderInterface::class) ->add('testconsole:secondtest', 'testconsole.secondtest');  }  }<\/code><\/pre>\n<p>\u0412 Joomla DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>share()<\/code>. \u0415\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435:<\/p>\n<ul>\n<li>\n<p><code>$key<\/code> &#8212; \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435. <\/p>\n<\/li>\n<li>\n<p><code>$value<\/code> &#8212; \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f (Callable function) \u0438\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043a\u043b\u044e\u0447\u0430 \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430<\/p>\n<\/li>\n<li>\n<p><code>$protected<\/code> &#8212;  \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0444\u043b\u0430\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043e\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0438. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0440\u0430\u0432\u0435\u043d <code>false<\/code>, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 <code>true<\/code> \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b. \u0423\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 Joomla DI \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0432 <code>libraries\/vendor\/joomla\/di\/src\/Container.php<\/code>. <\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u043c\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 &#8212; <code>testconsole.start<\/code>.  \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 &#8212; <code>function (ContainerInterface $container) { return new TestCommand; }<\/code> &#8212; \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0430\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. 3-\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 &#8212; <code>true<\/code> &#8212; \u044d\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>$protected<\/code>, \u0437\u0430\u0449\u0438\u0449\u0430\u044e\u0449\u0438\u0439 \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043e\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0438.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043b\u043e\u0430\u0434\u0435\u0440\u0443 CLI \u043a\u043e\u043c\u0430\u043d\u0434 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>add()<\/code> \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>testconsole:test<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>testconsole.test<\/code>.<\/p>\n<pre><code class=\"php\">&lt;?php \/\/ add test command to joomla.php cli script Factory::getContainer()->get(\\Joomla\\CMS\\Console\\Loader\\WritableLoaderInterface::class) ->add('testconsole:test', 'testconsole.test');<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b (XML-\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442, \u0444\u0430\u0439\u043b \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440) \u043f\u043b\u0430\u0433\u0438\u043d \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c. \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435 Joomla.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/45e\/47d\/6a5\/45e47d6a5d28240adcd19cb422f7a1fa.png\" width=\"1092\" height=\"469\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/45e\/47d\/6a5\/45e47d6a5d28240adcd19cb422f7a1fa.png\"\/><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438\/\u0438\u043b\u0438 \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u044b \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043d\u0435\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 &#8212; \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443: <strong>The command &#171;testconsole:test&#187; does not exists<\/strong>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>path\/to\/joomla\/cli<\/code> \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>php joomla.php<\/code>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9ee\/64b\/b4c\/9ee64bb4cf4bf992694707750a390b91.png\" alt=\"\u0427\u0430\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0438\u0448\u0443 \u043d\u0430 Windows-\u043c\u0430\u0448\u0438\u043d\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438 \u043f\u0443\u0442\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445\" title=\"\u0427\u0430\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0438\u0448\u0443 \u043d\u0430 Windows-\u043c\u0430\u0448\u0438\u043d\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438 \u043f\u0443\u0442\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445\" width=\"578\" height=\"304\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9ee\/64b\/b4c\/9ee64bb4cf4bf992694707750a390b91.png\"\/><\/p>\n<div><figcaption>\u0427\u0430\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0438\u0448\u0443 \u043d\u0430 Windows-\u043c\u0430\u0448\u0438\u043d\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438 \u043f\u0443\u0442\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445<\/figcaption><\/div>\n<\/figure>\n<p><a class=\"anchor\" name=\"#commands-file\" id=\"#commands-file\"><\/a><\/p>\n<h3>\u0424\u0430\u0439\u043b\u044b \u0441 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f Joomla CLI<\/h3>\n<p>\u0421\u0430\u043c\u0438 \u0444\u0430\u0439\u043b\u044b \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 \u0438 \u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u044b \u043b\u0435\u0436\u0430\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u0440\u044f\u0434\u043e\u043c. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>namespaces<\/code> &#8212; \u0438\u0445 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0430\u043f\u043a\u0438 <code>src<\/code> \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u044b\u043c, \u0441\u043e\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0449\u0438\u043c\u0441\u044f \u0441 \u043d\u0430\u0448\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0438 \u0437\u0434\u0440\u0430\u0432\u044b\u043c \u0441\u043c\u044b\u0441\u043b\u043e\u043c. <\/p>\n<h4>\u0420\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432<\/h4>\n<p><strong>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 1:<\/strong> \u043f\u0430\u043f\u043a\u0430 \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 <code>src\/Extension<\/code>, \u0442\u043e\u0433\u0434\u0430 <code>namespace<\/code> \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f Joomla CLI \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c <code>Joomla\\Plugin\\Console\\Testconsole\\Extension\\Command<\/code>.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/718\/c41\/d86\/718c41d86a87710d205b4e9bec626646.png\" alt=\"PHP \u043a\u043b\u0430\u0441\u0441\u044b \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 Command \u043f\u043b\u0430\u0433\u0438\u043d\u0430\" title=\"PHP \u043a\u043b\u0430\u0441\u0441\u044b \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 Command \u043f\u043b\u0430\u0433\u0438\u043d\u0430\" width=\"403\" height=\"205\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/718\/c41\/d86\/718c41d86a87710d205b4e9bec626646.png\"\/><\/p>\n<div><figcaption>PHP \u043a\u043b\u0430\u0441\u0441\u044b \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 Command \u043f\u043b\u0430\u0433\u0438\u043d\u0430<\/figcaption><\/div>\n<\/figure>\n<p><strong>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 2:<\/strong> \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u043f\u0430\u043f\u043a\u0443 Command \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u0432\u0435\u0440\u0445 \u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0435\u0451 \u0440\u044f\u0434\u043e\u043c \u0441 \u043f\u0430\u043f\u043a\u043e\u0439 Extension. \u0422\u043e\u0433\u0434\u0430 <code>namespace<\/code> \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f Joomla CLI \u0431\u0443\u0434\u0435\u0442 <code>Joomla\\Plugin\\Console\\Testconsole\\Command<\/code>. <\/p>\n<p>\u041f\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0441\u0447\u0451\u0442\u0443 \u044d\u0442\u043e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0435 \u0432\u0430\u0436\u043d\u043e \u0438 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u0437\u0434\u0435\u0441\u044c &#8212; \u0432\u043d\u044f\u0442\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0438 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f.<\/p>\n<h4>\u041a\u043b\u0430\u0441\u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/h4>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0444\u0430\u0439\u043b\u044b \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 <code>src\/Extension\/Command<\/code>.  Namespace \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434 \u0431\u0443\u0434\u0435\u0442: <code>Joomla\\Plugin\\Console\\Testconsole\\Extension\\Command<\/code>. \u041a\u043b\u0430\u0441\u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 <code>AbstractCommand<\/code>  \u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c:<\/p>\n<ol>\n<li>\n<p>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <code>$defaultName<\/code>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0435 \u0438\u043c\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>protected static $defaultName = 'testconsole:test'<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u041c\u0435\u0442\u043e\u0434 <code>doExecute()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u041e\u0431\u044b\u0447\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 <code>MVCFactory<\/code> \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0443\u0436\u043d\u044b\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 <code>configure()<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0435\u0442. \u0415\u0441\u043b\u0438 \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0435\u0442 &#8212; \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\u043b\u0438 Exeption \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u0421\u043a\u043e\u0440\u0435\u0435 \u0440\u0435\u0447\u044c \u0438\u0434\u0451\u0442 \u043e \u0441\u0442\u0440\u043e\u0433\u043e\u0439 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u043a \u0435\u0433\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u044e, \u0447\u0442\u043e \u043e\u0431\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0445\u043e\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c. <\/p>\n<p><a class=\"anchor\" name=\"method-configure\" id=\"method-configure\"><\/a><\/p>\n<h4>\u041c\u0435\u0442\u043e\u0434 configure() CLI \u043f\u043b\u0430\u0433\u0438\u043d\u0430 Joomla 4 \/ Joomla 5<\/h4>\n<p>\u041c\u0435\u0442\u043e\u0434 <code>configure()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u043e\u043f\u0446\u0438\u0439 \u0432\u0438\u0434\u0430 <code>--optionName=optionValue<\/code>  \u043a \u043a\u043e\u043c\u0430\u043d\u0434\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0430\u043c\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 Joomla 4 \/ Joomla 5 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u0442 PHP-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Symfony, \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e Symfony <a href=\"https:\/\/symfony.com\/doc\/current\/console\/input.html\" rel=\"noopener noreferrer nofollow\">Console Input (Arguments &amp; Options)<\/a>, <a href=\"https:\/\/symfony.ru\/doc\/current\/console\/input.html\" rel=\"noopener noreferrer nofollow\">\u043e\u043d\u0430 \u0436\u0435 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435<\/a>.<\/p>\n<pre><code class=\"php\">&lt;?php \/**  * Configure the command.  *  * @return  void  *  * @since   4.0.0  *\/  \\defined('_JEXEC') or die;  protected function configure(): void {     \/\/ \u042d\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u043d\u043e \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043a\u043e\u043c\u0430\u043d\u0434 Joomla CLI     $this->setDescription(\"Test command 1 form plugin Testconsole\");      $help = \"&lt;info>%command.name%&lt;\/info> will demonstrate a simple Hello world function     \\nUsage: &lt;info>php joomla.php %command.full_name%&lt;\/info>\";       $this->setHelp($help); }<\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434 <code>$this->setDescription()<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0438\u0434\u043d\u043e \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043a\u043e\u043c\u0430\u043d\u0434 CLI Joomla. \u042d\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <code>\\Joomla\\Console\\Command\\AbstractCommand<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0435\u0441\u043b\u0438 \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>php joomla.php<\/code>, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u0438\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0439.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/de5\/3e1\/e23\/de53e1e23c7a5e9dcfc077943b1534e3.png\" width=\"573\" height=\"303\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/de5\/3e1\/e23\/de53e1e23c7a5e9dcfc077943b1534e3.png\"\/><\/figure>\n<p>\u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 Joomla \u0435\u0441\u0442\u044c \u043e\u0431\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b: <code>--help<\/code> \u0438\u043b\u0438 <code>-h<\/code> &#8212; \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043c\u043e\u0449\u0438 \u0438 \u0441\u043f\u0438\u0441\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043e\u043f\u0446\u0438\u0439\/\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432; \u0438\u043b\u0438 <code>-q<\/code>, <code>--quiet<\/code> &#8212; \u0444\u043b\u0430\u0433, \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u0432\u044b\u0432\u043e\u0434 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u0435. \u041f\u0440\u0438 \u0432\u0432\u043e\u0434\u0435 \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0441 \u043e\u043f\u0446\u0438\u0435\u0439 <code>--help<\/code> \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>configure()<\/code> \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9bb\/e6d\/151\/9bbe6d1515fd7f63f0eb527074699571.png\" width=\"576\" height=\"282\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9bb\/e6d\/151\/9bbe6d1515fd7f63f0eb527074699571.png\"\/><\/figure>\n<p>\u0412 \u043a\u043e\u0434\u0435 \u0441\u043f\u0440\u0430\u0432\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0448\u043e\u0440\u0442-\u043a\u043e\u0434\u044b <code>%command.name%<\/code> \u0438 <code>%command.full_name%<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043c\u0435\u043d\u0435\u043d\u044b \u043d\u0430 \u0438\u043c\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u043f\u043e\u043b\u043d\u043e\u0435 \u0438\u043c\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438. \u041f\u043e\u043b\u043d\u043e\u0435 \u0438\u043c\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u044f &#171;\u0442\u043e\u0447\u043a\u0443 \u0432\u0445\u043e\u0434\u0430&#187; \u0432 CLI &#8212; <code>joomla.php<\/code>.  <code>%command.name%<\/code> \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>testconsole:test<\/code>, \u0430 <code>%command.full_name%<\/code> &#8212; <code>joomla.php testconsole:test<\/code>.<\/p>\n<h4>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u043f\u0446\u0438\u0439 \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 configure()<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u0432\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0446\u0438\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u0438\u0434\u0430 <code>--option=value<\/code>. \u0418\u043b\u0438 \u0443\u043a\u043e\u0440\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 <code>-o=value<\/code>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043f\u0446\u0438\u0438 \u043c\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u043d\u0430 \u0432\u0445\u043e\u0434 \u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043b\u0438 \u043e\u043d\u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0438\u043b\u0438 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438.<\/p>\n<pre><code class=\"php\">&lt;?php  use Symfony\\Component\\Console\\Input\\InputArgument; use Symfony\\Component\\Console\\Input\\InputOption;  \\defined('_JEXEC') or die;  \/**  * Configure the command.  *  * @return  void  *  * @since   4.0.0  *\/ protected function configure(): void {     \/\/ \u042d\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u043d\u043e \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043a\u043e\u043c\u0430\u043d\u0434 Joomla CLI     $this->setDescription(\"Test command 1 form plugin Testconsole\");     $help = \"&lt;info>%command.name%&lt;\/info> will demonstrate a simple Hello world function     \\nUsage: &lt;info>php joomla.php %command.full_name%&lt;\/info>\";     $this->setHelp($help);     \/\/ \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u043f\u0446\u0438\u0438 \u0432\u0438\u0434\u0430 --param=value \u0434\u043b\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b   \/**     * $name         \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043e\u043f\u0446\u0438\u0438     * $shortcut     \u0448\u043e\u0440\u0442\u043a\u0430\u0442, \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043e\u043f\u0446\u0438\u0438. \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c null, \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0448\u043e\u0440\u0442\u043a\u0430\u0442\u043e\u0432, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 | \u0438\u043b\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c \u0448\u043e\u0440\u0442\u043a\u0430\u0442\u043e\u0432     * $mode         \u0440\u0435\u0436\u0438\u043c \u043e\u043f\u0446\u0438\u0438:      *                  InputOption::VALUE_NONE - \u043d\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u043f\u0446\u0438\u044e. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.     *                  InputOption::VALUE_REQUIRED - \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u043f\u0446\u0438\u044f.     *                  InputOption::VALUE_OPTIONAL - \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u043f\u0446\u0438\u044f.     *                  InputOption::VALUE_IS_ARRAY - \u043e\u043f\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0431\u0435\u043b)     *                  InputOption::VALUE_NEGATABLE - \u043e\u043f\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0438\u043b\u0438 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (--ansi \u0438\u043b\u0438 --no-ansi)     * $description  \u0422\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u043f\u0446\u0438\u0438     * $default      \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (\u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c null \u0434\u043b\u044f InputOption::VALUE_NONE)     *\/   $this->addOption('option', 'o', InputOption::VALUE_OPTIONAL, 'interesting description for our option', null);    \/\/ \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b   \/**     * $name         \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430     * $mode         \u0440\u0435\u0436\u0438\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430     *                   InputArgument::REQUIRED - \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439     *                   InputArgument::OPTIONAL - \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439     * $description  \u0422\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u043f\u0446\u0438\u0438     * $default      \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (\u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f InputArgument::OPTIONAL)     *\/   $this->addArgument('argument', InputArgument::OPTIONAL, 'interesting description for our argument', null);    }<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/87e\/ae7\/82a\/87eae782a0c6ab4739c07e709ebc7037.png\" width=\"674\" height=\"364\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/87e\/ae7\/82a\/87eae782a0c6ab4739c07e709ebc7037.png\"\/><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0438 \u043e\u043f\u0446\u0438\u0438. \u041d\u0430\u0431\u0440\u0430\u0432 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>php joomla.php testconsole:test -o=any_value argument<\/code>, \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 <code>doExecute()<\/code>. \u041f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u043e\u043f\u0446\u0438\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b 2 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430. \u0412 \u043f\u043e\u043b\u043d\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a: <code>php joomla.php testconsole:test --option=any_value argument<\/code>.<\/p>\n<p><a class=\"anchor\" name=\"method-doexecute\" id=\"method-doexecute\"><\/a><\/p>\n<h4>\u041c\u0435\u0442\u043e\u0434 doExecute() \u043a\u043e\u043d\u0441\u043e\u043b\u0438 Joomla 4 \/ Joomla 5<\/h4>\n<p>\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 &#8212; &#171;\u0440\u0430\u0431\u043e\u0447\u0430\u044f \u043b\u043e\u0448\u0430\u0434\u043a\u0430&#187; \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0432\u0441\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443. \u041c\u0435\u0442\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 2 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438: <\/p>\n<ul>\n<li>\n<p><code>Symfony\\Component\\Console\\Input\\InputInterface $input<\/code>  <\/p>\n<\/li>\n<li>\n<p><code>Symfony\\Component\\Console\\Output\\OutputInterface $output<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u043e\u0436\u043d\u043e \u0435\u0449\u0451 \u0440\u0430\u0437 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Symfony (<a href=\"https:\/\/symfony.com\/doc\/current\/console\/input.html\" rel=\"noopener noreferrer nofollow\">Console Input (Arguments &amp; Options)<\/a>, <a href=\"https:\/\/symfony.com\/doc\/current\/console.html\" rel=\"noopener noreferrer nofollow\">Console Commands<\/a>), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0445\u043e\u0440\u043e\u0448\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442 \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e.<\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 <code>doExecute()<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e <code>int<\/code> &#8212; \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u041c\u043e\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e <code>0<\/code> \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043f\u0435\u0445\u0430, <code>1<\/code> \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\u043b\u0438 <code>2<\/code> \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u043f\u0446\u0438\u0439 \u0438\/\u0438\u043b\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u041d\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u043a\u043b\u0430\u0441\u0441\u0430 <code>Command<\/code>. <\/p>\n<p> <code>$input<\/code> \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u043e\u043f\u0446\u0438\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0437\u0430\u0434\u0430\u043b\u0438 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>configure()<\/code>. <code>$output<\/code> \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c.<\/p>\n<pre><code class=\"php\">&lt;?php use Symfony\\Component\\Console\\Command\\Command; use Symfony\\Component\\Console\\Input\\InputInterface; use Symfony\\Component\\Console\\Output\\OutputInterface;  \\defined('_JEXEC') or die;  protected function doExecute(InputInterface $input, OutputInterface $output): int {   \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u043f\u0446\u0438\u044e \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438   $option = $input->getOption('option');      \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u043e\u043f\u0446\u0438\u044e\u0444   if($option !== 'any_data')   {     \/\/ \u041d\u0435\u0432\u0435\u0440\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 $option, \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430     return Command::INVALID;   }      \/\/ \u0417\u0434\u0435\u0441\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b   \/** @var $result bool result status **\/   $result = $this->mainTask();    if($result)   {     \/\/ \u0412\u0441\u0451 \u0445\u043e\u0440\u043e\u0448\u043e     return Command::SUCCESS;    }     \/\/ \u0412\u0441\u0451 \u043f\u043b\u043e\u0445\u043e   return Command::FAILURE;    }<\/code><\/pre>\n<p>\u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>mainTask()<\/code> \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0447\u0430\u0441\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0438\u043b\u0438 \u0432\u0441\u044e. \u041e\u0431\u044b\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u0438\u0434\u0451\u0442 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u043a\u044d\u0448\u0430 \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b (\u0444\u0430\u0439\u043b <code>libraries\/src\/Console\/CleanCacheCommand.php<\/code>)<\/p>\n<pre><code class=\"php\">&lt;?php use Symfony\\Component\\Console\\Command\\Command; use Symfony\\Component\\Console\\Input\\InputInterface; use Symfony\\Component\\Console\\Output\\OutputInterface;  \\defined('_JEXEC') or die;  protected function doExecute(InputInterface $input, OutputInterface $output): int {        $symfonyStyle = new SymfonyStyle($input, $output);     \/\/ \u041f\u0438\u0448\u0435\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435     $symfonyStyle->title('Cleaning System Cache');          \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u0438\u0437 MVCFactory     $cache = $this->getApplication()->bootComponent('com_cache')->getMVCFactory();     \/** @var \\Joomla\\Component\\Cache\\Administrator\\Model\\CacheModel $model *\/     $model = $cache->createModel('Cache', 'Administrator', ['ignore_request' => true]);      \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u043c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 expired     \/\/ \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0442\u0443\u0445\u0448\u0438\u0439 \u043a\u044d\u0448     if ($input->getArgument('expired')) {         if (!$model->purge()) {             $symfonyStyle->error('Expired Cache not cleaned');             \/\/ \u0427\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a             return Command::FAILURE;         }          $symfonyStyle->success('Expired Cache cleaned');         \/\/ \u0412\u0441\u0451 \u0445\u043e\u0440\u043e\u0448\u043e.         return Command::SUCCESS;     }      \/\/ \u0427\u0438\u0441\u0442\u0438\u043c \u0432\u0435\u0441\u044c \u043a\u044d\u0448     if (!$model->clean()) {         $symfonyStyle->error('Cache not cleaned');         \/\/ \u0427\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a         return Command::FAILURE;     }      $symfonyStyle->success('Cache cleaned');     \/\/ \u0416\u0438\u0437\u043d\u044c \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u0430!     return Command::SUCCESS; }<\/code><\/pre>\n<p><a class=\"anchor\" name=\"SymfonyStyle\" id=\"SymfonyStyle\"><\/a><\/p>\n<h4>SymfonyStyle: \u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438<\/h4>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430 <code>Symfony\\Component\\Console\\Style\\SymfonyStyle<\/code> \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b, \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b. \u0424\u0430\u0439\u043b \u043a\u043b\u0430\u0441\u0441\u0430 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0432 <code>libraries\/vendor\/symfony\/console\/Style\/SymfonyStyle.php<\/code>,  \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0432 \u043d\u0451\u043c \u0438\u043b\u0438 \u0436\u0435 \u043b\u0443\u0447\u0448\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a <a href=\"https:\/\/symfony.com\/doc\/current\/console\/style.html\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Symfony \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443<\/a>.<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0435\u0433\u043e \u0432\u044b\u0432\u043e\u0434 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c.<\/p>\n<pre><code class=\"php\">&lt;?php use Symfony\\Component\\Console\\Command\\Command; use Symfony\\Component\\Console\\Input\\InputInterface; use Symfony\\Component\\Console\\Output\\OutputInterface; use Symfony\\Component\\Console\\Style\\SymfonyStyle;   \/**  * \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u0441\u044f \u0414\u041e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 doExecute().   *  * @param   \\Symfony\\Component\\Console\\Input\\InputInterface    $input  * @param   \\Symfony\\Component\\Console\\Output\\OutputInterface  $output  *  *  * @since version 1.0.0  *\/ protected function initialise(InputInterface $input, OutputInterface $output): void {        $symfonyStyle = new SymfonyStyle($input, $output);     \/**     * \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 Jiji, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b.     *      * $question  string \u0412\u043e\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f     * $default   string \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0442\u043e\u0436\u0435.     * $validator callable Callback-\u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445     *     *\/     $this->name = $symfonyStyle->ask('What is your name?', 'Super joomler', function ($value) {         if (empty($value) || !is_string($value))         {             throw new \\RuntimeException('Your name cannot be empty. Are you a robot?');         }          return $value;     });      parent::initialise($input, $output); }   protected function doExecute(InputInterface $input, OutputInterface $output): int {    \/\/ \u0415\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Simfony Style \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0435\u0433\u043e   $symfonyStyle = new SymfonyStyle($input, $output);    \/** @var $this->name string  \u042d\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u043e\u0435 \u043d\u0430\u043c\u0438 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 initialise() \u0438\u043c\u044f *\/   $output->write($this->name);   \/\/ \u0438\u043b\u0438 \u0430\u043d\u0430\u043b\u043e\u0433 $symfonyStyle->text($this->name);      \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u043f\u0446\u0438\u044e \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438   $option = $input->getOption('option');      \/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u043e\u043f\u0446\u0438\u044e\u0444   if($option !== 'any_data')   {     $symfonyStyle->warning('\u0423\u043a\u0430\u0437\u0430\u043d \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0434\u043b\u044f \u043e\u043f\u0446\u0438\u0438 option');     \/\/ \u041d\u0435\u0432\u0435\u0440\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 $option, \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430     return Command::INVALID;   }      \/\/ \u0417\u0434\u0435\u0441\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b   \/** @var $result bool result status **\/   $result = $this->mainTask();    if($result)   {          $symfonyStyle->success('\u0412\u0441\u0451 \u0445\u043e\u0440\u043e\u0448\u043e, \u0440\u0430\u0431\u043e\u0442\u0443 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0438.');     \/\/ \u0412\u0441\u0451 \u0445\u043e\u0440\u043e\u0448\u043e     return Command::SUCCESS;        }     $symfonyStyle->error('\u0412\u0441\u0451 \u043f\u043b\u043e\u0445\u043e, \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0435 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b. \u0416\u0438\u0437\u043d\u044c - \u0442\u043b\u0435\u043d.');   \/\/ \u0412\u0441\u0451 \u043f\u043b\u043e\u0445\u043e   return Command::FAILURE; }<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f5e\/73e\/a4f\/f5e73ea4f0789177b56237b6d77b12b2.png\" width=\"607\" height=\"214\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f5e\/73e\/a4f\/f5e73ea4f0789177b56237b6d77b12b2.png\"\/><\/figure>\n<p>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u043c\u043e\u0433\u0443\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u044b SymfonyStyle:<\/p>\n<ul>\n<li>\n<p><code>askHidden<\/code> &#8212; \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0430\u0440\u043e\u043b\u0435\u0439<\/p>\n<\/li>\n<li>\n<p><code>choice<\/code> &#8212; \u0432\u044b\u0431\u043e\u0440 \u0438\u0437 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432<\/p>\n<\/li>\n<li>\n<p><code>confirm<\/code> &#8212; \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u043e\u043f\u0440\u043e\u0441\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0443 \u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b <code>write<\/code> &#8212; \u0432\u044b\u0432\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0438. \u0418 <code>writeln<\/code> &#8212; \u0432\u044b\u0432\u043e\u0434 \u0441 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<p>\u0422\u0430\u043a \u0436\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u0432\u044b\u0432\u0435\u043b \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0432 \u0432\u0438\u0434\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e 2 \u043c\u0430\u0441\u0441\u0438\u0432\u0430: \u0441 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u043c\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0433\u0434\u0435 \u043f\u0435\u0440\u0432\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 &#8212; <code>rows<\/code>, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 &#8212; <code>columns<\/code>.<\/p>\n<pre><code class=\"php\">&lt;?php use Symfony\\Component\\Console\\Input\\InputInterface; use Symfony\\Component\\Console\\Output\\OutputInterface; use Symfony\\Component\\Console\\Style\\SymfonyStyle;  protected function doExecute(InputInterface $input, OutputInterface $output): int {       $symfonyStyle = new SymfonyStyle($input, $output);              $headers = ['Column 1', 'Column 2'];       $rows = [           ['Value 1','Value 2'],           ['Value 1','Value 2'],           ['Value 1','Value 2'],       ];       $symfonyStyle->table($headers, $rows);       return Command::SUCCESS; }<\/code><\/pre>\n<p>\u0414\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0432 Joomla CLI \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <code>ProgressBar<\/code> (<a href=\"https:\/\/symfony.com\/doc\/current\/components\/console\/helpers\/progressbar.html\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f Simfony<\/a>). \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043d\u0435\u043a\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443. \u041f\u043e\u043b\u0435\u0437\u043d\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0435\u0451 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"php\">&lt;?php  use Symfony\\Component\\Console\\Input\\InputInterface; use Symfony\\Component\\Console\\Output\\OutputInterface; use Symfony\\Component\\Console\\Style\\SymfonyStyle;  protected function doExecute(InputInterface $input, OutputInterface $output): int {      $symfonyStyle = new SymfonyStyle($input, $output);      \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c ProgressBar. \u041c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 int $max     $symfonyStyle->createProgressBar();     \/\/ \u041c\u043e\u0436\u043d\u043e \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c ProgressBar \u0441\u0442\u0440\u043e\u0447\u043a\u043e\u0439 \u0432\u044b\u0448\u0435, \u0430 \u0441\u0440\u0430\u0437\u0443 \u0441\u0434\u0435\u043b\u0430\u0442\u044c progressStart(),     \/\/ \u0438 \u0443\u0436\u0435 \u0435\u043c\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 int $max     $symfonyStyle->progressStart();     \/\/ \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u043a\u0440\u0430\u0441\u043e\u0442\u044b, \u0434\u043b\u044f \u0441\u0430\u043c\u0438\u0445 \u0441\u0435\u0431\u044f     $symfonyStyle->note('Start to iterate');     $limit = 100;     $i = 0;     while ($i &lt; $limit)     {         \/\/ \u0411\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0434\u0435\u043c\u043e-\u043f\u0440\u043e\u043a\u0440\u0430\u0441\u0442\u0438\u043d\u0430\u0446\u0438\u044f. \u0412\u043e\u0440\u043e\u0447\u0430\u0435\u043c \u0437\u0434\u0435\u0441\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c,         \/\/ \u0434\u0432\u0438\u0433\u0430\u0435\u043c Progressbar \u0432\u043f\u0435\u0440\u0451\u0434         $symfonyStyle->progressAdvance();         sleep(1);         $i++;      }     \/\/ \u0412\u0441\u0451 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u043e\u0441\u044c.      $symfonyStyle->progressFinish();     return Command::SUCCESS; }<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438.<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/65f310d9315cc3d4a1e4b547\" data-style=\"\" id=\"65f310d9315cc3d4a1e4b547\" width=\"\"><\/div>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u0435\u043c, \u043a\u0442\u043e \u0441 Joomla  \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CLI \u0435\u0449\u0451 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b. \u0414\u043b\u044f \u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0432 \u043d\u0435\u0439 \u0432\u0440\u044f\u0434 \u043b\u0438 \u043d\u0430\u0448\u043b\u043e\u0441\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u043e\u0432\u043e\u0435, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0445 \u0441 Symfony. \u041d\u043e, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043c\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e &#171;Joomla \u0442\u0430\u043a \u043c\u043e\u0436\u0435\u0442&#187;. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u044d\u0442\u043e\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043c\u0430\u043d\u0443\u0430\u043b \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435\u043c \u043f\u0440\u0438\u043c\u0443 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u043a \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0442 \u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u0442\u043e\u0432\u0430\u0440\u0438\u0449\u0435\u0439.<\/p>\n<h2>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b Joomla<\/h2>\n<h3>\u0420\u0435\u0441\u0443\u0440\u0441\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430:<\/h3>\n<ul>\n<li>\n<p><a href=\"https:\/\/joomlaforum.ru\/\" rel=\"noopener noreferrer nofollow\"><u>\u0444\u043e\u0440\u0443\u043c \u0440\u0443\u0441\u0441\u043a\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 Joomla<\/u><\/a>.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/joomlaportal.ru\/\" rel=\"noopener noreferrer nofollow\"><u>\u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043f\u043e\u0440\u0442\u0430\u043b Joomla-\u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430<\/u><\/a>.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/vc.ru\/s\/1146097-joomla\" rel=\"noopener noreferrer nofollow\">https:\/\/vc.ru\/s\/1146097-joomla<\/a>\u00a0&#8212; \u0421\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e Joomla \u043d\u0430 VC.<\/p>\n<\/li>\n<\/ul>\n<h3>Telegram:<\/h3>\n<ul>\n<li>\n<p><a href=\"https:\/\/t.me\/joomlaru\" rel=\"noopener noreferrer nofollow\"><u>\u0427\u0430\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430 \u00abJoomla! \u043f\u043e-\u0440\u0443\u0441\u0441\u043a\u0438\u00bb<\/u><\/a>.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/t.me\/projoomla\" rel=\"noopener noreferrer nofollow\"><u>Joomla \u0434\u043b\u044f \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u043e\u0432, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 Joomla<\/u><\/a>.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/t.me\/joomlafeed\" rel=\"noopener noreferrer nofollow\"><u>\u041d\u043e\u0432\u043e\u0441\u0442\u0438 \u043e Joomla! \u0438 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u043e-\u0440\u0443\u0441\u0441\u043a\u0438<\/u><\/a>.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/t.me\/joomla_jobs\" rel=\"noopener noreferrer nofollow\"><u>\u0412\u0430\u043a\u0430\u043d\u0441\u0438\u0438 \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e Joomla<\/u><\/a>: \u0444\u0443\u043b\u043b\u0442\u0430\u0439\u043c, \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u0430\u044f \u0437\u0430\u043d\u044f\u0442\u043e\u0441\u0442\u044c \u0438 \u0440\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u043e\u0434\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0420\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432\u0430\u043a\u0430\u043d\u0441\u0438\u0439\u00a0<a href=\"https:\/\/jpath.ru\/jobs\/add\" rel=\"noopener noreferrer nofollow\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a>.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/t.me\/joomlatalks\" rel=\"noopener noreferrer nofollow\">\u0410\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0439 \u0447\u0430\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430<\/a>.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/t.me\/joomlahub\" rel=\"noopener noreferrer nofollow\">\u041d\u043e\u0432\u043e\u0441\u0442\u0438 Joomla! \u043f\u043e-\u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/797155\/\"> https:\/\/habr.com\/ru\/articles\/797155\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 Joomla, \u043a\u0430\u043a \u0438 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 PHP \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u0445 \u0438 \u0434\u0432\u0438\u0436\u043a\u0430\u0445, \u0443\u0436\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u0430\u0432\u043d\u043e (\u0441 \u0432\u0435\u0440\u0441\u0438\u0439 1.7.x) \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CLI &#8212; Command line interface. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u0440\u044f\u0434 \u043b\u0438 \u0432 \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u043e\u043f\u0430\u0434\u0443\u0442 \u043b\u044e\u0434\u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0435 \u0441 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u044e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439, \u043d\u043e \u0434\u043b\u044f \u0441\u043f\u0440\u0430\u0432\u043a\u0438 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Joomla \u0447\u0435\u0440\u0435\u0437 CLI \u043d\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 (Apache, Nginx etc.), \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 <code>php<\/code> (\u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445), \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 (\u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e 60 \u0441\u0435\u043a\u0443\u043d\u0434). <\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CLI \u0440\u0435\u0448\u0430\u044e\u0442 \u0442\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 (\u0438\u0437 \u0430\u0434\u043c\u0438\u043d\u043a\u0438) Joomla \u043d\u0435\u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e \u0438\u0437-\u0437\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 &#8212; \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 &#171;\u0442\u044f\u0436\u0435\u043b\u044b\u0435&#187; \u0437\u0430\u0434\u0430\u0447\u0438. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u0441\u043e \u0441\u0442\u0430\u0440\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Joomla \u043d\u0430 \u043d\u043e\u0432\u0443\u044e, \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u043f\u043e API (\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0446\u0435\u043d \u0438 \u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432, \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430 \u0437\u0430\u043a\u0430\u0437\u043e\u0432), \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u043c\u0438, \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0451\u043c\u0430\u0445 (\u0434\u0435\u0441\u044f\u0442\u043a\u0438-\u0441\u043e\u0442\u043d\u0438 \u0442\u044b\u0441\u044f\u0447 \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u044b \u043f\u043e\u0437\u0438\u0446\u0438\u0439) \u0438 \u0442.\u0434. &#8212; \u0432\u0441\u0451 \u0442\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<h2>\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/h2>\n<ul>\n<li>\n<p><a href=\"#sources\" rel=\"noopener noreferrer nofollow\">\u0421\u043f\u0438\u0441\u043e\u043a \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#create-joomla-plugin\" rel=\"noopener noreferrer nofollow\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u044b console \u0434\u043b\u044f Joomla 4 \/ Joomla 5<\/a><\/p>\n<ul>\n<li>\n<p><a href=\"#xml-manifest\" rel=\"noopener noreferrer nofollow\">XML-\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u043f\u043b\u0430\u0433\u0438\u043d\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#provider\" rel=\"noopener noreferrer nofollow\">\u0424\u0430\u0439\u043b services\/provider.php<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#plugin-file\" rel=\"noopener noreferrer nofollow\">\u0424\u0430\u0439\u043b \u043f\u043b\u0430\u0433\u0438\u043d\u0430 src\/Extension\/Testconsole.php<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#commands-file\" rel=\"noopener noreferrer nofollow\">\u0424\u0430\u0439\u043b\u044b \u0441 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f Joomla CLI<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#method-configure\" rel=\"noopener noreferrer nofollow\">\u041c\u0435\u0442\u043e\u0434 configure()<\/a>. \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u043f\u0446\u0438\u0439 \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u044b.<\/p>\n<\/li>\n<li>\n<p><a href=\"#method-doexecute\" rel=\"noopener noreferrer nofollow\">\u041c\u0435\u0442\u043e\u0434 doExecute()<\/a>. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b.<\/p>\n<\/li>\n<li>\n<p><a href=\"#SymfonyStyle\" rel=\"noopener noreferrer nofollow\">SymfonyStyle: \u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438<\/a><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<figure class=\"full-width\">\n<div><figcaption>\u0427\u0430\u0441\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434 CLI  \u044f\u0434\u0440\u0430 Joomla 5<\/figcaption><\/div>\n<\/figure>\n<p><a class=\"anchor\" name=\"sources\" id=\"sources\"><\/a><\/p>\n<h2>\u0421\u043f\u0438\u0441\u043e\u043a \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b<\/h2>\n<ol>\n<li>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u043a\u043e\u0434 \u044f\u0434\u0440\u0430 Joomla \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439. PHP-\u043a\u043b\u0430\u0441\u0441\u044b CLI \u043a\u043e\u043c\u0430\u043d\u0434 \u044f\u0434\u0440\u0430 \u043b\u0435\u0436\u0430\u0442 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>libraries\/src\/Console<\/code>.  \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0445, \u0438\u0437\u0443\u0447\u0430\u0435\u043c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0440\u0430\u0437\u0446\u0430.<\/p>\n<figure class=\"\"><\/figure>\n<\/li>\n<li>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f <a href=\"https:\/\/habr.com\/ru\/articles\/696222\/\" rel=\"noopener noreferrer nofollow\">Joomla 4: \u043c\u043e\u0449\u044c CLI \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/a>:  \u0432 \u043d\u0435\u0439 \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 CLI \u0432 Joomla, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434. \u0410 \u0442\u0430\u043a \u0436\u0435 \u0441\u0442\u0430\u0442\u044c\u044e \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u0430\u043d\u0434 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 Akeeba Backup.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.joomla.org\/J4.x:Writing_A_CLI_Application\" rel=\"noopener noreferrer nofollow\">\u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f Joomla<\/a>. \u0412  \u043d\u0435\u0439 \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u044b <code>console<\/code> \u0434\u043b\u044f Joomla 4+ \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 CLI. \u0422\u0430\u043a\u0436\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0432\u0438\u0434\u0435\u043e.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f <a href=\"https:\/\/habr.com\/ru\/articles\/676902\/\" rel=\"noopener noreferrer nofollow\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 WebCron \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043b\u044f Joomla 4 (Task Scheduler Plugin)<\/a>. \u0412 Joomla 4.1 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0437\u0430\u0434\u0430\u0447 &#8212; <strong>Task Scheduler<\/strong>. \u041c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0438 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0438 \u0447\u0435\u0440\u0435\u0437 \u0430\u0434\u043c\u0438\u043d\u043a\u0443, \u0430 \u0432 CLI \u0438\u043b\u0438 \u0432 CRON \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443: <code>php \/path\/to\/site\/public_html\/cli\/joomla.php scheduler:run<\/code>. <strong>\u042d\u0442\u043e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/strong> <\/p>\n<\/li>\n<li>\n<p>\u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f <a href=\"https:\/\/docs.joomla.org\/J4.x:CLI_example_-_Onoffbydate\" rel=\"noopener noreferrer nofollow\">Joomla CLI example &#8212; Onoffbydate<\/a> \u0438 \u0435\u0451 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 <a href=\"https:\/\/mb4.ru\/cms\/joomla4\/1655-j4-cli-example-onoffbydate-joomla-4.html\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f CLI \u0434\u043b\u044f Joomla 4 &#8212; Onoffbydate<\/a> \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 Joomla CLI, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u044c \/ \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0434\u0430\u0442\u044b \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0433\u043e\u0434\u0430 \u043f\u043e CRON.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f <a href=\"https:\/\/magazine.joomla.org\/all-issues\/april-2021\/jiji-your-new-joomla-4-console-friend\" rel=\"noopener noreferrer nofollow\">Jiji, your new Joomla! 4 Console friend<\/a> \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0436\u0443\u0440\u043d\u0430\u043b\u0435 \u043c\u0435\u0436\u0434\u0443\u043d\u0430\u0440\u043e\u0434\u043d\u043e\u0433\u043e Joomla-\u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430 Joomla Community Magazine. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <code>hello world<\/code>. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u0430\u043c\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043a\u043e\u0434\u0430, \u0441\u0442\u043e\u0438\u0442 <a href=\"https:\/\/github.com\/alexandreelise\/plg_system_jiji\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c GitHub \u044d\u0442\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430<\/a>, \u0433\u0434\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430\u043c\u0438 Joomla, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u043c\u043f\u043e\u0440\u0442 \u0441\u0442\u0430\u0442\u0435\u0439 Joomla \u0438\u0437 \u0444\u0430\u0439\u043b\u0430. \u0427\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0435\u0440\u0435\u0434 \u0433\u043b\u0430\u0437\u0430\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u0435\u043c \u043f\u0440\u043e\u0449\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0441\u0432\u043e\u0451.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f <a href=\"https:\/\/habr.com\/ru\/articles\/736412\/\" rel=\"noopener noreferrer nofollow\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b Joomla 4<\/a> \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f Joomla 4 \/ Joomla 5 \u043f\u043e \u043d\u043e\u0432\u044b\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043f\u0440\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0435 \u043e\u0434\u0438\u043d \u0433\u043e\u0434 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 legacy (\u043f\u043b\u0430\u0433\u0438\u043d \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438), \u0447\u0442\u043e \u043e\u0449\u0443\u0442\u0438\u043c\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442 \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 Joomla.<\/p>\n<\/li>\n<\/ol>\n<p><a class=\"anchor\" name=\"create-joomla-plugin\" id=\"create-joomla-plugin\"><\/a><\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u044b console \u0434\u043b\u044f Joomla 4 \/ Joomla 5<\/h2>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043b\u0430\u0433\u0438\u043d\u0430. \u0424\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0435\u0433\u043e \u0432 \u0446\u0435\u043b\u043e\u043c \u0442\u0438\u043f\u0438\u0447\u043d\u0430\u044f \u0434\u043b\u044f Joomla. \u0412 Joomla \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438\u0437 PHP \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Symfony, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0435\u043c, \u043a\u0442\u043e \u0443\u0436\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 CLI  \u0432 Symfony &#8212; \u0432 Joomla \u0441\u0435\u0431\u044f \u0431\u0443\u0434\u0435\u0442 \u0447\u0443\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0443 \u0441\u0435\u0431\u044f \u0434\u043e\u043c\u0430 ?.<\/p>\n<hr\/>\n<p>\u042f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u044f\u0442\u0441\u044f \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 &#171;\u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b&#187;, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0441\u043e \u0441\u0442\u0430\u0442\u044c\u0451\u0439 <a href=\"https:\/\/habr.com\/ru\/articles\/736412\/\" rel=\"noopener noreferrer nofollow\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b Joomla 4<\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0443 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u043d\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445.<\/p>\n<hr\/>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u043b\u0430\u0433\u0438\u043d \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <code>testconsole<\/code> \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0442\u043e \u0443\u043c\u0435\u0435\u0442 Joomla \u0432 CLI.<\/p>\n<figure class=\"\"><\/figure>\n<p><a class=\"anchor\" name=\"xml-manifest\" id=\"xml-manifest\"><\/a><\/p>\n<h3>XML-\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u043f\u043b\u0430\u0433\u0438\u043d\u0430<\/h3>\n<p>\u042d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0449\u0438\u043a\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 Joomla (\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0438\u043c\u044f, \u0433\u0440\u0443\u043f\u043f\u0443 \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u0434\u0430\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f, \u0432\u0435\u0440\u0441\u0438\u044f, \u0441\u0430\u0439\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0438 \u0442.\u0434.), \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439,\u00a0<strong>\u0430 \u0442\u0430\u043a\u0436\u0435<\/strong>\u00a0<strong>\u0437\u0430\u0434\u0430\u0451\u0442 Namespace \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432<\/strong>. \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f\u00a0<code>Namespace<\/code>\u00a0\u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0432 \u0440\u0435\u0435\u0441\u0442\u0440\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f. \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 (Joomla 5.0.3) \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435\u00a0<code>administrator\/cache\/autoload_psr4.php<\/code>. \u041e\u043d \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438\u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f.  <\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?> &lt;extension type=\"plugin\" group=\"console\" method=\"upgrade\"> &lt;name>Console - Testconsole&lt;\/name> &lt;author>Sergey Tolkachyov&lt;\/author> &lt;creationDate>Feb 2024&lt;\/creationDate> &lt;copyright>Copyright \u00a9 2024 Sergey Tolkachyov. All rights reserved.&lt;\/copyright> &lt;license>GNU\/GPL 3&lt;\/license> &lt;authorEmail>info@web-tolk.ru&lt;\/authorEmail> &lt;authorUrl>https:\/\/web-tolk.ru&lt;\/authorUrl> &lt;version>1.0.0&lt;\/version> &lt;description>PLG_CONSOLE_SCANJOOMLASITES_DESC&lt;\/description> &lt;namespace path=\"src\">Joomla\\Plugin\\Console\\Testconsole&lt;\/namespace> &lt;languages folder=\"language\"> &lt;language tag=\"en-GB\">en-GB\/plg_console_testconsole.ini&lt;\/language> &lt;language tag=\"en-GB\">en-GB\/plg_console_testconsole.sys.ini&lt;\/language> &lt;language tag=\"ru-RU\">ru-RU\/plg_console_testconsole.ini&lt;\/language> &lt;language tag=\"ru-RU\">ru-RU\/plg_console_testconsole.sys.ini&lt;\/language> &lt;\/languages> &lt;files> &lt;folder>services&lt;\/folder> &lt;folder plugin=\"testconsole\">src&lt;\/folder> &lt;\/files> &lt;\/extension><\/code><\/pre>\n<p>\u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u043f\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u043c Joomla \u0438\u043c\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0438 \u0435\u0433\u043e \u0433\u0440\u0443\u043f\u043f\u0443: <code>Console - Testconsole<\/code>. \u0422\u0430\u043a\u0436\u0435 <code>namespace<\/code> \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u0433\u0440\u0443\u043f\u043f\u0443 \u043f\u043b\u0430\u0433\u0438\u043d\u0430. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 <em>Joomla\\Plugin\\<\/em><strong><em>Console<\/em><\/strong><em>\\Testconsole<\/em>. <\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u043b\u0430\u0433\u0438\u043d\u044b \u0433\u0440\u0443\u043f\u043f\u044b <code>console<\/code> \u0432 Joomla \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u043b\u044e\u0431\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b, \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u0434\u0435. \u0425\u043e\u0442\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0432 CLI \u0432\u0430\u0436\u043d\u0435\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043d\u043e \u043d\u0430 \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0443, \u0434\u0430 \u0438 \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0432 \u0446\u0435\u043b\u043e\u043c \u043c\u043e\u0433\u0443\u0442 \u0432\u043b\u0438\u044f\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u044b\u0435 \u0445\u043e\u0441\u0442\u044b, \u043f\u0430\u0440\u043e\u043b\u0438, \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u044b \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<p><a class=\"anchor\" name=\"provider\" id=\"provider\"><\/a><\/p>\n<h3>\u0424\u0430\u0439\u043b services\/provider.php<\/h3>\n<p>\u041f\u043b\u0430\u0433\u0438\u043d\u0443 \u043d\u0443\u0436\u0435\u043d \u0444\u0430\u0439\u043b \u0441\u0435\u0440\u0432\u0438\u0441-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u0432 DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 Joomla \u0438 \u0434\u0430\u0451\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0438\u0437\u0432\u043d\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e\u00a0<code>MVCFactory<\/code>. <\/p>\n<pre><code class=\"php\">&lt;?php \\defined('_JEXEC') or die;  use Joomla\\CMS\\Extension\\PluginInterface; use Joomla\\CMS\\Extension\\Service\\Provider\\MVCFactory; use Joomla\\CMS\\Factory; use Joomla\\CMS\\MVC\\Factory\\MVCFactoryInterface; use Joomla\\CMS\\Plugin\\PluginHelper; use Joomla\\DI\\Container; use Joomla\\DI\\ServiceProviderInterface; use Joomla\\Event\\DispatcherInterface; use Joomla\\Plugin\\Console\\Testconsole\\Extension\\Testconsole;  return new class () implements ServiceProviderInterface {  \/**  * Registers the service provider with a DI container.  *  * @param   Container  $container  The DI container.  *  * @since   1.0.0  *\/ public function register(Container $container) { $container->registerServiceProvider(new MVCFactory('Joomla\\\\Plugin\\\\Console\\\\Testconsole'));  $container->set(PluginInterface::class, function (Container $container) { $config     = (array) PluginHelper::getPlugin('console', 'testconsole');  $subject    = $container->get(DispatcherInterface::class); $mvcFactory = $container->get(MVCFactoryInterface::class);  $app = Factory::getApplication();  $plugin = new Testconsole($subject, $config); $plugin->setApplication($app); $plugin->setMVCFactory($mvcFactory);  return $plugin; } ); } }; <\/code><\/pre>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 <code>$this->getApplication()<\/code>. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u0430 <code>MVCFactory<\/code>, \u0442\u043e \u0438 \u043a \u043d\u0435\u0439 \u0447\u0435\u0440\u0435\u0437 <code>$this->getMVCFactory()<\/code>. <code>MVCFactory<\/code> \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 Joomla \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 &#8212; \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u043c\u0438, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0412\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 Joomla 4 \/ Joomla 5 &#8212; \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 &#171;\u043f\u043b\u044e\u0448\u043a\u0438&#187;. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0435\u0441\u043b\u0438 \u0412\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438, \u0438\u043c\u0435\u044e\u0449\u0438\u043c\u0438 \u0434\u0430\u0432\u043d\u044e\u044e \u0438\u0441\u0442\u043e\u0440\u0438\u044e, \u0412\u044b \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>MVCFactory<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0435\u0449\u0451 \u043d\u0435 &#171;\u043f\u0435\u0440\u0435\u0435\u0445\u0430\u043b\u0438&#187; \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 <code>SiteApplication<\/code>, \u0430 <code>CliApplication<\/code>.  \u0422\u0430\u043a\u0436\u0435 \u0432 \u044f\u0434\u0440\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u0445\u043e\u0436\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b: <code>ConsoleApplication<\/code> &#8212; \u043a\u043b\u0430\u0441\u0441 \u0438\u0437 Joomla-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u0432\u043b\u0438\u0442 \u0432 CMS Joomla \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 4.0. \u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u043e\u0431\u043b\u0435\u0433\u0447\u0451\u043d\u043d\u044b\u0439, \u043b\u0438\u0448\u0435\u043d \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 &#171;\u0444\u0438\u0447&#187; CMS. \u0415\u0449\u0451 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 <code>DaemonApplication<\/code> &#8212; \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b Joomla \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0434\u0435\u043c\u043e\u043d\u0430. \u041f\u043e \u0438\u0434\u0435\u0435, \u043e\u043d \u0443\u043c\u0435\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \/ \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u0440\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0438 \u0441\u0430\u043c \u0441\u0435\u0431\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442. <\/p>\n<p><a class=\"anchor\" name=\"plugin-file\" id=\"plugin-file\"><\/a><\/p>\n<h3>\u0424\u0430\u0439\u043b \u043f\u043b\u0430\u0433\u0438\u043d\u0430 src\/Extension\/Testconsole.php<\/h3>\n<p>\u041a\u043b\u0430\u0441\u0441 \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u0441\u043b\u0443\u0436\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0446\u0435\u043b\u0438: \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 CLI Joomla. \u041f\u043b\u0430\u0433\u0438\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c <code>Joomla\\Event\\SubscriberInterface<\/code>, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432 \u043d\u0451\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u043c\u0435\u0442\u043e\u0434 <code>getSubscribedEvents<\/code>, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 \u043c\u0430\u043f\u043f\u0438\u043d\u0433 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0430. <\/p>\n<pre><code class=\"php\">&lt;?php  namespace Joomla\\Plugin\\Console\\Testconsole\\Extension;  \\defined('_JEXEC') or die;  use Joomla\\CMS\\Factory; use Joomla\\CMS\\MVC\\Factory\\MVCFactoryAwareTrait; use Joomla\\CMS\\Plugin\\CMSPlugin; use Joomla\\Database\\DatabaseAwareTrait; use Joomla\\Event\\SubscriberInterface; use Psr\\Container\\ContainerInterface;  \/\/ \u042d\u0442\u043e namespaces \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 Joomla CLI use Joomla\\Plugin\\Console\\Testconsole\\Extension\\Command\\TestCommand; use Joomla\\Plugin\\Console\\Testconsole\\Extension\\Command\\SecondtestCommand;   class Testconsole extends CMSPlugin implements SubscriberInterface { use MVCFactoryAwareTrait; use DatabaseAwareTrait;  \/**  * Choose which events this plugin is subscribed to and will respond to  * @return string[]  * <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-369602","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/369602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=369602"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/369602\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=369602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=369602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=369602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}