function InitCommand::addVendorIgnore
1 call to InitCommand::addVendorIgnore()
- InitCommand::execute in vendor/
composer/ composer/ src/ Composer/ Command/ InitCommand.php
File
-
vendor/
composer/ composer/ src/ Composer/ Command/ InitCommand.php, line 583
Class
- InitCommand
- @author Justin Rainbow <justin.rainbow@gmail.com> @author Jordi Boggiano <j.boggiano@seld.be>
Namespace
Composer\CommandCode
protected function addVendorIgnore(string $ignoreFile, string $vendor = '/vendor/') : void {
$contents = "";
if (file_exists($ignoreFile)) {
$contents = file_get_contents($ignoreFile);
if (strpos($contents, "\n") !== 0) {
$contents .= "\n";
}
}
file_put_contents($ignoreFile, $contents . $vendor . "\n");
}