We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2364
    • 73 Posts
    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.
      • 3749
      • 24,544 Posts
      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);
      
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 2364
        • 73 Posts
        Exactly! Thank you, Bob.