Use the mb_pattern_copy_file function to copy a file using a PHP script in user-defined patterns.
The following example shows how the mb_pattern_copy_file function is called:
mb_pattern_copy_file(string $project_name, string $source_file, string $output_file);
The arguments taken by mb_pattern_copy_file are shown in the following table:
Argument | Description |
---|---|
project_name | The name of the pattern instance project where the directory is created. |
source_file | The source file name to copy. The file must
be inside the include path of the PHP runtime.
The include path of the PHP runtime includes the
directory containing the PHP script in execution. The include
path can be configured by using the standard PHP function set_include_path.
For more information, see ![]() |
output_file | The output file where the file is copied to, for example directory/subdirectory/test.txt. The output file path is relative to the directory of the project name you input as project_name. If the output file path is a subdirectory in the project, this API command creates the intermediate directories if they do not exist. |