-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathitem.json
More file actions
75 lines (75 loc) · 5.63 KB
/
item.json
File metadata and controls
75 lines (75 loc) · 5.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{
"system_name": "Component:item:import Commands",
"class_extends": "ae2fafb4-e84b-4534-ba9c-6c9e1700b318",
"joomla_plugin_group": "63638841-11b1-45ef-b42b-475d0f1635c1",
"add_sql": 0,
"add_php_method_uninstall": 0,
"add_php_postflight_update": 0,
"add_php_postflight_install": 0,
"add_update_server": 0,
"method_selection": null,
"property_selection": null,
"add_head": 1,
"add_sql_uninstall": 0,
"addreadme": 0,
"head": "###POWER_AUTOLOADER###\r\n\r\nuse Joomla\\CMS\\Factory;\r\nuse Joomla\\CMS\\Plugin\\CMSPlugin;\r\nuse Joomla\\Event\\SubscriberInterface;\r\nuse Joomla\\Application\\ApplicationEvents;\r\nuse Joomla\\CMS\\Console\\Application as ConsoleApplication;\r\nuse Joomla\\CMS\\Console\\Loader\\WritableLoaderInterface;\r\nuse Joomla\\Event\\Event;\r\nuse Joomla\\DI\\Container;",
"update_server_target": 3,
"main_class_code": "\t\/**\r\n\t * Returns an array of events this plugin is subscribing to.\r\n\t *\r\n\t * @return array\r\n\t * @since 4.0.0\r\n\t *\/\r\n\tpublic static function getSubscribedEvents(): array\r\n\t{\r\n\t\t\/\/ Return an array of event names and corresponding callback methods\r\n\t\treturn [\r\n\t\t\tApplicationEvents::BEFORE_EXECUTE => 'registerCommands',\r\n\t\t];\r\n\t}\r\n\r\n\t\/**\r\n\t * Registers CLI commands with the application container.\r\n\t *\r\n\t * This method is called just before the console application executes,\r\n\t * giving us access to the container for command registration.\r\n\t *\r\n\t * @param Event $event The application event\r\n\t *\r\n\t * @return void\r\n\t * @since 5.1.4\r\n\t *\/\r\n\tpublic function registerCommands(Event $event): void\r\n\t{\r\n\t\t\/\/ Get the DI container from the application\r\n\t\t$container = $this->getContainer($event);\r\n\r\n\t\tif ($container === null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t\/\/ Register your commands here\r\n\t\t$this->registerPluginCommands($container);\r\n\t}\r\n\r\n\t\/**\r\n\t * Gets the DI container from the console application.\r\n\t *\r\n\t * @param Event $event The application event\r\n\t *\r\n\t * @return Container|null The DI container or null if not available\r\n\t * @since 5.1.4\r\n\t *\/\r\n\tprotected function getContainer(Event $event): ?Container\r\n\t{\r\n\t\t\/\/ Get the application from the event\r\n\t\t$app = $event->getApplication() ?? null;\r\n\r\n\t\t\/\/ Ensure we're running in a console context\r\n\t\tif ($app instanceof ConsoleApplication && method_exists($app, 'getContainer'))\r\n\t\t{\r\n\t\t\treturn $app->getContainer();\r\n\t\t}\r\n\r\n\t\treturn Factory::getContainer() ?? null;\r\n\t}\r\n\r\n\t\/**\r\n\t * Registers the plugin's CLI commands.\r\n\t *\r\n\t * Override or modify this method to register your specific commands.\r\n\t *\r\n\t * @param ContainerInterface\t\t $container The DI container\r\n\t *\r\n\t * @return void\r\n\t * @since 5.1.4\r\n\t *\/\r\n\tprotected function registerPluginCommands(Container $container): void\r\n\t{\r\n\t\t$serviceId = '[[[component]]].importcommand';\r\n\r\n\t\t\/\/ Register command service\r\n\t\t$container->share(\r\n\t\t\t$serviceId,\r\n\t\t\tstatic function (Container $container) {\r\n\t\t\t\treturn new Super___647316a5_eb42_4bec_82dd_ca0dc2861ad3___Power();\r\n\t\t\t},\r\n\t\t\ttrue\r\n\t\t);\r\n\r\n\t\t$container\r\n\t\t\t->get(WritableLoaderInterface::class)\r\n\t\t\t->add('[[[component]]]:item:import', $serviceId);\r\n\t}",
"description": "Register [[[ComponentNamespace]]] Commands\r\n\r\n@since 5.1.4",
"php_postflight_install": "",
"plugin_version": "2.0.0",
"php_postflight_update": "",
"fields": null,
"php_method_uninstall": "",
"add_php_script_construct": 0,
"sql": "",
"php_script_construct": "",
"sql_uninstall": "",
"add_php_preflight_install": 1,
"readme": "You can use all the normal markdown, including the place-holders.",
"php_preflight_install": "\t\t\t\/\/ check that [[[component]]] is installed\r\n\t\t\tif (!is_dir(JPATH_ADMINISTRATOR . '\/components\/com_[[[component]]]'))\r\n\t\t\t{\r\n\t\t\t\t$app->enqueueMessage('[[[component_acronym]]] must first be installed from <a href=\"[[[get_component_link]]]\" target=\"_blank\">[[[component_link_name]]]<\/a>.', 'error');\r\n\t\t\t\treturn false;\r\n\t\t\t}",
"update_server_url": "",
"add_php_preflight_update": 0,
"php_preflight_update": "",
"add_php_preflight_uninstall": 0,
"php_preflight_uninstall": "",
"guid": "5df401b4-c9a6-42c8-b50d-87f67c8a15f3",
"name": "[[[ComponentNamespace]]]Commands",
"@dependencies": [
{
"key": "guid",
"value": "ae2fafb4-e84b-4534-ba9c-6c9e1700b318",
"entity": "class_extends",
"table": "#__componentbuilder_class_extends",
"direction": "out"
},
{
"key": "guid",
"value": "63638841-11b1-45ef-b42b-475d0f1635c1",
"entity": "joomla_plugin_group",
"table": "#__componentbuilder_joomla_plugin_group",
"direction": "out"
},
{
"key": "target",
"value": "[[[component_acronym]]]",
"entity": "placeholder",
"table": "#__componentbuilder_placeholder",
"direction": "out"
},
{
"key": "target",
"value": "[[[get_component_link]]]",
"entity": "placeholder",
"table": "#__componentbuilder_placeholder",
"direction": "out"
},
{
"key": "target",
"value": "[[[component_link_name]]]",
"entity": "placeholder",
"table": "#__componentbuilder_placeholder",
"direction": "out"
}
]
}