tmpDir().'/packages/'.str_replace('/', '-', $name); if (! file_exists($dirName)) { mkdir($dirName); } file_put_contents($dirName.'/composer.json', json_encode([ 'name' => $name, 'version' => '1.0.0', 'require' => [ 'flarum/core' => $coreVersions ], ], JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT)); } }