This class helps you to make changes in an specified folder or in a list of files. You can use functions from FileModifier
class.
use WeblaborMX\FileModifier\MasiveModifier;
This will teach you how to initialize Masive Modifier.
To add a list of files you will need to call MasiveModifier
and the array of the files to edit.
$files = ['msg1.txt', 'msg2.txt'];
MasiveModifier::files($files);
To add a single directory you should use the next code:
MasiveModifier::directory('folder_name');
Or if you want a list of directories:
$files = ['dir1', 'dir2'];
MasiveModifier::directories($files');
MasiveModifier::directory($directory)->execute(function($fileModifier) {
$fileModifier->replace('Hi', 'GoodBye');
});
Inside of the function you will call any function in FileModifier
. It is not necessary to use the execute function, it will be launched automatically.