$vehicle = $builder->createVehicle($category, array_merge($categoryAttributes, array(
'copy_exclude_patterns' => array('#test#i', '#^__#')
));
$vehicle->resolve('file', array(
'source' => $sources['source_core'],
'target' => "return MODX_CORE_PATH . 'components/';",
));
$builder->putVehicle($vehicle);
$builder->setPackageAttributes(
array(
'license' => file_get_contents($sources['docs'] . 'LICENSE.md'),
'readme' => file_get_contents($sources['docs'] . 'README.md'),
'changelog' => file_get_contents($sources['docs'] . 'CHANGELOG.md'),
'copy_exclude_patterns' => array('#test#i', '#^__#')
)
);
...
/* Create category vehicle for all elements */
$attributes = array(
xPDOTransport::UNIQUE_KEY => 'category',
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::RELATED_OBJECTS => true,
xPDOTransport::RELATED_OBJECT_ATTRIBUTES => array(
'Snippets' => array(
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::UNIQUE_KEY => 'name',
),
'Chunks' => array(
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::UNIQUE_KEY => 'name',
),
'Plugins' => array(
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::UNIQUE_KEY => 'name',
),
'Templates' => array(
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::UNIQUE_KEY => 'templatename',
),
'TemplateVars' => array(
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::UNIQUE_KEY => 'name',
),
)
);
// Exclude files with a specific pattern (eg. __ prefix)
$categoryAttributes = array_merge($attributes, array('copy_exclude_patterns' => array('#^__#')));
$vehicle = $builder->createVehicle($category, $categoryAttributes);
$builder->putVehicle($vehicle);
...
...
/* Add the license file, readme */
$builder->setPackageAttributes(array(
'license' => file_get_contents($sources['docs'].'license.txt'),
'readme' => file_get_contents($sources['docs'].'readme.txt'),
'changelog' => file_get_contents($sources['docs'].'changelog.txt'),
'copy_exclude_patterns' => array('#^__#'),
));
...