vite-plugin-php 1.0.67 → 1.0.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/router.php +14 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,6 +22,7 @@ Check out the [starter repo](https://github.com/nititech/php-vite-starter) for a
|
|
|
22
22
|
|
|
23
23
|
| Version | Feature |
|
|
24
24
|
| ------- | ----------------------------------------------------------------------------------------------------------- |
|
|
25
|
+
| 1.0.68 | Improved transpiled code evaluation (removed native `eval()`) |
|
|
25
26
|
| 1.0.67 | Removed whitespaces from PHP responses in dev mode |
|
|
26
27
|
| 1.0.66 | Fixed file monitoring on Windows |
|
|
27
28
|
| 1.0.65 | Fixed request body forwarding for all request methods |
|
package/dist/router.php
CHANGED
|
@@ -32,11 +32,18 @@ if (count($matches)) {
|
|
|
32
32
|
$source .= ' ?>';
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} catch (\Throwable $th) {
|
|
40
|
-
die($th->getMessage());
|
|
35
|
+
$includeFile = tempnam(sys_get_temp_dir(), 'vite-php');
|
|
36
|
+
register_shutdown_function(function ($file) {
|
|
37
|
+
if (file_exists($file)) {
|
|
38
|
+
unlink($file);
|
|
41
39
|
}
|
|
42
|
-
}
|
|
40
|
+
}, $includeFile);
|
|
41
|
+
file_put_contents($includeFile, $source);
|
|
42
|
+
|
|
43
|
+
try {
|
|
44
|
+
(function () {
|
|
45
|
+
include(func_get_arg(0));
|
|
46
|
+
})($includeFile);
|
|
47
|
+
} catch (\Throwable $th) {
|
|
48
|
+
print($th->getMessage());
|
|
49
|
+
}
|