mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Fixes #15270: Resolved potential race conditions when writing generated php-files
This commit is contained in:

committed by
Alexander Makarov

parent
01ff1f6593
commit
185209957e
@ -643,7 +643,7 @@ abstract class BaseMigrateController extends Controller
|
||||
'namespace' => $namespace,
|
||||
]);
|
||||
FileHelper::createDirectory($migrationPath);
|
||||
file_put_contents($file, $content);
|
||||
file_put_contents($file, $content, LOCK_EX);
|
||||
$this->stdout("New migration created successfully.\n", Console::FG_GREEN);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user