Hi.
Does anybody know how to build package for a few php files which will be used for $modx->getService();?
I do not know how to create $vehicle for this. Package contain only service files without snippets, chunks and other MODx objects. Which object and attributes use for $builder->createVehicle? Or how resolve file array in other way?
Thanks.
There is now a file vehicle object to use if you want to transfer files and have no object to attach them to. Something like this (assumes that you’ve already created the package as $package):
$sourcePath = '_build/myfiles';
$targetPath = "return MODX_ASSETS_PATH . 'myfiles/';";
$obj = array ('source' => $sourcePath,'target' =>$targetPath);
$attributes = array('vehicle_class' => 'xPDOFileVehicle');
$package->put($obj,$attributes);