diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..2424685 --- /dev/null +++ b/run.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +cd sandbox/public +sudo php -S 0.0.0.0:8081 \ No newline at end of file diff --git a/sandbox/app/routes/Routes.php b/sandbox/app/routes/Routes.php new file mode 100644 index 0000000..fc25c1b --- /dev/null +++ b/sandbox/app/routes/Routes.php @@ -0,0 +1,10 @@ +_verb) . " === $route->_uri"; + }, RouteCollection::getInstance()->_routes); + } + + function withTag(string $tag): array + { + return Array(); + } + + function fromGroup(string $group): array + { + return Array(); + } + +} diff --git a/sandbox/app/users/clients/Client.php b/sandbox/app/users/clients/Client.php new file mode 100644 index 0000000..12c7fff --- /dev/null +++ b/sandbox/app/users/clients/Client.php @@ -0,0 +1,57 @@ +id = $id; + $this->name = self::generateRandomName(); + } + + /** + * Generate a random Client Name + * + * @param int $id Id of the Client + * @return string + */ + public static function generateClient(int $id): Client + { + + return new Client($id); + } + + public static function generateRandomName(): string + { + $firstname = self::$listOfFirstNames[rand(0, sizeof(self::$listOfFirstNames) - 1)]; + $middleName = self::$listOfMiddleNames[rand(0, sizeof(self::$listOfMiddleNames) - 1)]; + $lastName = self::$listOfLastNames[rand(0, sizeof(self::$listOfLastNames) - 1)]; + + return "$firstname $middleName $lastName"; + } +} \ No newline at end of file diff --git a/sandbox/app/users/clients/ClientsController.php b/sandbox/app/users/clients/ClientsController.php new file mode 100644 index 0000000..acf6b2c --- /dev/null +++ b/sandbox/app/users/clients/ClientsController.php @@ -0,0 +1,54 @@ +id} - " . $client->name; + } + + function fullBuild(Client $client, Permission $permission, Config $config, bool $ignoreCache = true) + { + + } + + + function crazyTest(Client $client, Permission $permission, Config $config, bool $ignoreCache = true): Array + { + return [$client, $permission, $config, $ignoreCache]; + } + + function dump(Client $client, Permission $permission, Config $config, bool $ignoreCache = true): Array + { + return [$client, $permission, $config, $ignoreCache]; + } + +} diff --git a/sandbox/app/users/clients/Config.php b/sandbox/app/users/clients/Config.php new file mode 100644 index 0000000..9100324 --- /dev/null +++ b/sandbox/app/users/clients/Config.php @@ -0,0 +1,8 @@ + [ + "id" => 1, + "name" => "user-edit", + "displayName" => "Editar Usuário" + ], + "user-delete" => [ + "id" => 2, + "name" => "user-delete", + "displayName" => "Apagar Usuário" + ] + ]; + + function __construct(string $permission = ''){ + if(isset(self::$permissions[$permission])){ + $permission = (object) self::$permissions[$permission]; + + $this->id = $permission->id; + $this->name = $permission->name; + $this->displayName = $permission->displayName; + } + } +} \ No newline at end of file diff --git a/sandbox/app/users/clients/Routes.php b/sandbox/app/users/clients/Routes.php new file mode 100644 index 0000000..268b75b --- /dev/null +++ b/sandbox/app/users/clients/Routes.php @@ -0,0 +1,24 @@ +crawl(__DIR__ . "/app")->loadRoutes(); +RouteCollection::getInstance()->submit(); diff --git a/sandbox/includes.php b/sandbox/includes.php new file mode 100644 index 0000000..3b3b2ee --- /dev/null +++ b/sandbox/includes.php @@ -0,0 +1,26 @@ +