isDevMode() && !file_exists($targetFile)) { copy($sampleFile, $targetFile); } } /** * Create application temporary and upload directories which are not tracked * in Git. */ public static function createDirectories(Event $event) { if (!$event->isDevMode()) { return; } $vendorDir = $event->getComposer()->getConfig()->get('vendor-dir'); require_once $vendorDir.'/autoload.php'; if (!file_exists(self::$cacheDir)) { mkdir(self::$cacheDir, 0777, true); chmod(self::$cacheDir, 0777); } if (!file_exists(self::$uploadsDir)) { mkdir(self::$uploadsDir, 0777, true); chmod(self::$uploadsDir, 0777); } } }