getFilename(), 0, 3) === 'php') { $phpVersions[] = $dir->getFilename(); } } foreach ($phpVersions as $phpVersion) { foreach ($platforms as $platform) { $dockerfile = __DIR__ . "/$phpVersion/$platform/Dockerfile"; $fileContents = file_get_contents($dockerfile); $fileContents = preg_replace('#ENV JOOMLA_VERSION [^ ]*\n#', "ENV JOOMLA_VERSION $version\n", $fileContents); $fileContents = preg_replace('#ENV JOOMLA_SHA1 [^ ]*\n#', "ENV JOOMLA_SHA1 $signature\n\n", $fileContents); file_put_contents($dockerfile, $fileContents); // To make management easier, we use these files for all variants copy(__DIR__ . '/docker-entrypoint.sh', __DIR__ . "/$phpVersion/$platform/docker-entrypoint.sh"); copy(__DIR__ . '/makedb.php', __DIR__ . "/$phpVersion/$platform/makedb.php"); } } echo 'Dockerfile variants updated' . PHP_EOL;