github.com/filamentphp/upgrade v3.3.24+incompatible
Calls PHP file_put_contents()Calls PHP unlink()
SHA-25643a6420194a9522025f4ff63d07a41b9dc8b0d4ffd53b2fd7a91614abfdf87fc
MaleculeH₂(F₂Po₂)
Evidence
1#!/usr/bin/env php
2<?php
3
4use Composer\InstalledVersions;
5use Illuminate\Support\Str;
6use function Termwind\{ask, render};
7
8require 'vendor/autoload.php';
9
10render(<<<'HTML'
⋯4 lines
15:18… >
16
17 <div>
18 Welcome to the <strong>Filament v3</strong> upgrade process!
19
20 <br />
21
22 This script will attempt to handle most of the breaking changes for you.
23
24 <br />
25
26 If you have any questions, please reach out to us on <a href="https://filamentphp.com/discord" class="underline font-bold">Discord</a> or <a href="https://github.com/filamentphp/filament/discussions/new?category=q-a" class="underline font-bold">GitHub</a>.
27 </div>
28
29 <div>
30 To begin, please ensure that you are using a version control system such as Git.
31
32 <br />
33
34 We will make changes directly to your files, and you will need to be able to revert them if something goes wrong.
35
36 <br />
37
38 …
65:8… >
66HTML);
67
68if (file_exists('config/filament-support.php')) {
69 unlink('config/filament-support.php');
70
71 render(<<<HTML
72 <p>
73 Removed <strong>config/filament-support.php</strong …
118:5… IndividualFilamentPackagesInstalled = false;
119
120foreach ([
121 ...glob('resources/css/*.css'),
122 ...glob('resources/css/**/*.css'),
123] as $file) {
124 $fileContents = file_get_contents($file);
125
126 if (str_contains($fileContents, 'filament/forms/dist/module.esm.css')) {
127 $hasIndividualFilamentPackagesInstalled = true;
128
129 $fileContents = preg_replace('/.*filament\/forms\/dist\/module\.esm\.css.*\n/', '', $fileContents);
130
131 render(<<<HTML
132 <p>
133 …
133:67… ng>{$file}</strong>.
134 </p>
135 HTML);
136 }
137
138 file_put_contents($file, $fileContents);
139}
140
⋯5 lines
No evidence locations were recorded for this file. Raw result