File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 22
33function get_input ($ prompt , $ default = null )
44{
5- $ default = ($ default ) ? "[ $ default] " : '' ;
6- $ input = readline ("$ prompt $ default : " );
5+ $ default_show = ($ default ) ? "[ $ default] " : '' ;
6+ $ input = readline ("$ prompt $ default_show : " );
77 return (trim ($ input ) == "" ) ? $ default : $ input ;
88}
99
@@ -60,6 +60,23 @@ function print_line($text, int $multiplier = 1)
6060$ fp = fopen ($ file , "w " );
6161fwrite ($ fp , $ template );
6262fclose ($ fp );
63+ // Set to .htaccess
64+ $ file = __DIR__ . "/../.htaccess " ;
65+ $ fp = fopen ($ file , "w " );
66+ fwrite ($ fp , "RewriteEngine On
67+ RewriteBase " . $ vars ['APP_ROOT ' ] . "/
68+
69+ RewriteCond %{DOCUMENT_ROOT}/assets/$1 -f
70+ RewriteRule ^(.*)$ assets/$1 [L]
71+
72+ RewriteCond %{DOCUMENT_ROOT}/node_modules/$1 -f
73+ RewriteRule ^(.*)$ node_modules/$1 [L]
74+
75+ RewriteCond %{THE_REQUEST} \s/assets/ [NC,OR]
76+ RewriteCond %{THE_REQUEST} \s/node_modules/ [NC,OR]
77+ RewriteCond %{REQUEST_FILENAME} !-f
78+ RewriteRule ^ index.php [L,QSA] " );
79+ fclose ($ fp );
6380
6481// Set variable values
6582
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ private static function api_route($path)
4646 {
4747 $ routes = API_ROUTES [REQUEST ['method ' ]];
4848 if (array_key_exists ($ path , $ routes )) {
49+ header ("Access-Control-Allow-Origin: * " );
4950 header ("Content-Type: application/json " );
5051 require API_VIEW . $ routes [$ path ][0 ];
5152 } else require APP_ERROR_PAGES . API_ROUTES ['err ' ]['404 ' ];
You can’t perform that action at this time.
0 commit comments