77
88/**
99 * @experimental This driver is experimental and may be unstable. Report issues at GitHub!
10+ *
1011 * @see https://github.com/hydephp/realtime-compiler/pull/30
1112 */
1213class HydeValetDriver extends BasicValetDriver
@@ -31,7 +32,7 @@ public function beforeLoading(string $sitePath, string $siteName, string $uri):
3132 /**
3233 * Determine if the incoming request is for a static file.
3334 */
34- public function isStaticFile (string $ sitePath , string $ siteName , string $ uri )/*: string| false */
35+ public function isStaticFile (string $ sitePath , string $ siteName , string $ uri ): false
3536 {
3637 return false ; // Handled by the realtime compiler
3738 }
@@ -49,43 +50,43 @@ public function frontControllerPath(string $sitePath, string $siteName, string $
4950 */
5051 public function logFilesPaths (): array
5152 {
52- return [" /storage/logs " ];
53+ return [' /storage/logs ' ];
5354 }
5455
5556 /**
5657 * Display information about the application in the information tab of the Sites UI.
5758 */
5859 public function siteInformation (string $ sitePath , string $ phpBinary ): array
5960 {
60- $ composerJson = json_decode (file_get_contents ($ sitePath . '/composer.json ' ), true );
61- $ hydeConfig = include $ sitePath . '/config/hyde.php ' ;
61+ $ composerJson = json_decode (file_get_contents ($ sitePath. '/composer.json ' ), true );
62+ $ hydeConfig = include $ sitePath. '/config/hyde.php ' ;
6263
6364 return [
64- " HydePHP Info " => [
65- " Hyde Version " => InstalledVersions::isInstalled ('hyde/hyde ' ) ? InstalledVersions::getPrettyVersion ('hyde/hyde ' ) : 'Unknown ' ,
66- " Framework Version " => InstalledVersions::getPrettyVersion ('hyde/framework ' ) ?: 'Unknown ' ,
67- " Site Name " => $ hydeConfig ['name ' ] ?? 'Unknown ' ,
68- " Site URL " => $ hydeConfig ['url ' ] ?? 'Not set ' ,
69- " Site Language " => $ hydeConfig ['language ' ] ?? 'en ' ,
70- " Output Directory " => $ hydeConfig ['output_directory ' ] ?? '_site ' ,
65+ ' HydePHP Info ' => [
66+ ' Hyde Version ' => InstalledVersions::isInstalled ('hyde/hyde ' ) ? InstalledVersions::getPrettyVersion ('hyde/hyde ' ) : 'Unknown ' ,
67+ ' Framework Version ' => InstalledVersions::getPrettyVersion ('hyde/framework ' ) ?: 'Unknown ' ,
68+ ' Site Name ' => $ hydeConfig ['name ' ] ?? 'Unknown ' ,
69+ ' Site URL ' => $ hydeConfig ['url ' ] ?? 'Not set ' ,
70+ ' Site Language ' => $ hydeConfig ['language ' ] ?? 'en ' ,
71+ ' Output Directory ' => $ hydeConfig ['output_directory ' ] ?? '_site ' ,
7172 ],
72- " Build Info " => [
73- " Pretty URLs " => $ hydeConfig ['pretty_urls ' ] ? 'Enabled ' : 'Disabled ' ,
74- " Generate Sitemap " => $ hydeConfig ['generate_sitemap ' ] ? 'Yes ' : 'No ' ,
75- " RSS Feed " => ($ hydeConfig ['rss ' ]['enabled ' ] ?? false ) ? 'Enabled ' : 'Disabled ' ,
76- " Source Root " => $ hydeConfig ['source_root ' ] ?: '(Project Root) ' ,
73+ ' Build Info ' => [
74+ ' Pretty URLs ' => $ hydeConfig ['pretty_urls ' ] ? 'Enabled ' : 'Disabled ' ,
75+ ' Generate Sitemap ' => $ hydeConfig ['generate_sitemap ' ] ? 'Yes ' : 'No ' ,
76+ ' RSS Feed ' => ($ hydeConfig ['rss ' ]['enabled ' ] ?? false ) ? 'Enabled ' : 'Disabled ' ,
77+ ' Source Root ' => $ hydeConfig ['source_root ' ] ?: '(Project Root) ' ,
7778 ],
78- " Features " => [
79- " Enabled Features " => implode (', ' , array_map (function ($ feature ) {
79+ ' Features ' => [
80+ ' Enabled Features ' => implode (', ' , array_map (function ($ feature ) {
8081 return $ feature ->name ;
8182 }, $ hydeConfig ['features ' ] ?? [])),
8283 ],
83- " Server Configuration " => [
84- " Port " => $ hydeConfig ['server ' ]['port ' ] ?? 8080 ,
85- " Host " => $ hydeConfig ['server ' ]['host ' ] ?? 'localhost ' ,
86- " Save Preview " => ($ hydeConfig ['server ' ]['save_preview ' ] ?? true ) ? 'Yes ' : 'No ' ,
87- " Live Edit " => ($ hydeConfig ['server ' ]['live_edit ' ] ?? false ) ? 'Enabled ' : 'Disabled ' ,
88- " Dashboard " => ($ hydeConfig ['server ' ]['dashboard ' ]['enabled ' ] ?? true ) ? 'Enabled ' : 'Disabled ' ,
84+ ' Server Configuration ' => [
85+ ' Port ' => $ hydeConfig ['server ' ]['port ' ] ?? 8080 ,
86+ ' Host ' => $ hydeConfig ['server ' ]['host ' ] ?? 'localhost ' ,
87+ ' Save Preview ' => ($ hydeConfig ['server ' ]['save_preview ' ] ?? true ) ? 'Yes ' : 'No ' ,
88+ ' Live Edit ' => ($ hydeConfig ['server ' ]['live_edit ' ] ?? false ) ? 'Enabled ' : 'Disabled ' ,
89+ ' Dashboard ' => ($ hydeConfig ['server ' ]['dashboard ' ]['enabled ' ] ?? true ) ? 'Enabled ' : 'Disabled ' ,
8990 ],
9091 ];
9192 }
0 commit comments