News:

Looking for documentation? Take a look on our wiki

Main Menu

Use vm classes from joomla cli app?

Started by vmfyelloq19, Yesterday at 17:02:36 PM

Previous topic - Next topic

vmfyelloq19

Hello friends,

I'd like to update some products automatically via a custom joomla cli application.
Unfortunalety I did not manage to initialize VM's classes from there.

For testing I added a system plugin triggerd by onAfterInitialise() and used VmModel::getModel('product')->store(). This works as expected as long as I satisfy VMs security checks with a valid admins session and make sure $_REQUEST is populated manually with the VM form token. But CLI applications neither have a session nor $_REQUEST.

Could anywone elaborate on the proper way of initialising VM's classes via a CLI app?

TIA!

Ghost

VM models aren't written to be used outside of Joomla web environment. Because they perform tasks that are really responsibilities of controllers (reading request data, checking authorization). That reminds me of this old post https://x.com/virtuemart/status/661263708346257408.