-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor bugs fixed & added oauth module
- Loading branch information
1 parent
7ea615a
commit 451be80
Showing
191 changed files
with
56,204 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/vendor | ||
/public/tmp | ||
/public/compressed | ||
/storage/db | ||
/storage/app | ||
/storage/temp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,12 @@ | ||
"# F3Module" | ||
|
||
## KNOWN ISSUES | ||
1: Rendering modules views: | ||
This issue can be resolved by modifying `Preview->render` as below: | ||
if(is_file($view = $f3->fixslashes($dir.$file))) // REPLACE THIS WITH | ||
|
||
|
||
$_f = $fw->fixslashes($dir.$file); | ||
$_fr = str_ireplace('./', '', $_f); | ||
$view = (is_file($_f) ? $_f : (is_file($_fr) ? $_fr : null)); | ||
if ($view) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
#!/usr/bin/env php | ||
|
||
<?php | ||
|
||
class App { | ||
|
||
public function __construct($args) { | ||
$this->args = $args; | ||
} | ||
|
||
public function help() { | ||
echo "\n"; | ||
echo "Syntax: php app <command> [<args>]".PHP_EOL; | ||
echo PHP_EOL; | ||
echo "Commands: \n"; | ||
echo "php app --help --> Displays the help menu.".PHP_EOL; | ||
echo "php app generate --> Generate SECRET key.".PHP_EOL; | ||
echo "php app serve --> Start WebServer.".PHP_EOL; | ||
echo "php app serve --port --> Start WebServer to specific port.".PHP_EOL; | ||
echo PHP_EOL; | ||
} | ||
|
||
public function run() { | ||
if (count($this->args) <= 1) { | ||
$this->help(); | ||
} else { | ||
switch ($this->args[1]) { | ||
case "generate": | ||
$this->generateKey(); | ||
break; | ||
case "serve": | ||
$this->serve(); | ||
break; | ||
case "help": | ||
case "--help": | ||
$this->help(); | ||
break; | ||
default: | ||
$this->error(); | ||
} | ||
} | ||
} | ||
|
||
private function serve() { | ||
$command = 'php -S'; | ||
$ip = '127.0.0.1'; | ||
$port = 8888; | ||
$dir = './'; | ||
|
||
foreach($this->args as $key => $arg) { | ||
$arg = strtolower($arg); | ||
if($arg === 'ip' || $arg === '--ip'){ | ||
$host = $this->args[++$key]; | ||
if( | ||
(is_numeric($host) && !filter_var($host, FILTER_VALIDATE_IP)) | ||
|| | ||
(is_string($host) && strtolower($host) !== 'localhost') | ||
){ | ||
$this->error($arg.': '.$host.' must be localhost OR an valid IP!'); | ||
break; | ||
} | ||
$ip = $host; | ||
} | ||
if($arg === 'port' || $arg === '--port'){ | ||
$port = $this->args[++$key]; | ||
} | ||
if($arg === 'dir' || $arg === '--dir'){ | ||
$dir = $this->args[++$key]; | ||
} | ||
} | ||
|
||
echo "Served as {$ip}:{$port} to {$dir}"; | ||
$started = exec($command.' '.$ip.':'.$port.' -t '.$dir); | ||
$this->error($started); | ||
} | ||
|
||
private function generateKey() { | ||
$cipher = 'AES-256-CBC'; | ||
echo 'base64:'.base64_encode(random_bytes($cipher == 'AES-128-CBC' ? 16 : 32)); | ||
} | ||
|
||
private function error($msg = null) { | ||
if($msg){ | ||
echo "\t{$msg}"; | ||
exit(); | ||
} | ||
|
||
echo "\nSupplied argument/s is not supported:\n"; | ||
foreach($this->args as $arg) { | ||
if($arg == 'app') { continue; } | ||
echo "\t"; | ||
echo "{$arg}"; | ||
echo "\n"; | ||
} | ||
|
||
echo PHP_EOL; | ||
} | ||
} | ||
|
||
$app = new App($argv); | ||
$app->run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
<?php | ||
|
||
abstract class ApiController extends Controller | ||
{} | ||
{ | ||
public function response($data, $headers = null) | ||
{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.