AuthleteCommand
extends Command
in package
The base class for Authlete*Command classes.
Table of Contents
Methods
- addApiRoute() : mixed
- Add a route to 'routes/api.php'.
- addWebRoute() : mixed
- Add a route to 'routes/web.php'.
- appendContent() : mixed
- Append a content to a target file.
- copyResourceFile() : mixed
- Copy a file from the resource directoy to the target directory.
- createDirectory() : mixed
- Create a directory if it does not exist.
- getControllerDirectory() : mixed
- Create a directory for controllers ('Http/Controllers/Authlete/') under the application directory.
- getControllerNamespace() : mixed
- Get the name space for the controllers which are created under 'Http/Controllers/Authlete/' directory.
- getCssDirectory() : mixed
- Create a directory for CSS files ('css/authlete/') under the public directory.
- getViewDirectory() : mixed
- Create a directory for views ('views/authlete/') under the resource directory.
- relocateController() : mixed
- Relocate a controller from the resource directory to the controller directory.
Methods
addApiRoute()
Add a route to 'routes/api.php'.
protected
addApiRoute(string $method, string $path, string $controller) : mixed
Parameters
- $method : string
-
An HTTP method such as
post
. - $path : string
-
The path to which the controller is mapped.
- $controller : string
-
The name of a controller.
addWebRoute()
Add a route to 'routes/web.php'.
protected
addWebRoute(string $method, string $path, string $controller) : mixed
Parameters
- $method : string
-
An HTTP method such as
post
. - $path : string
-
The path to which the controller is mapped.
- $controller : string
-
The name of a controller.
appendContent()
Append a content to a target file.
protected
appendContent(string $content, string $targetFile) : mixed
Parameters
- $content : string
-
A content which is appended to the target file.
- $targetFile : string
-
The path of a target file.
copyResourceFile()
Copy a file from the resource directoy to the target directory.
protected
copyResourceFile(string $resourceFile, string $targetDirectory[, bool $overwrite = true ]) : mixed
Parameters
- $resourceFile : string
-
The name of a resource file.
- $targetDirectory : string
-
The path of a target directory.
- $overwrite : bool = true
-
true
to overwrite the target file even if it exists. The default value istrue
.
createDirectory()
Create a directory if it does not exist.
protected
createDirectory(string $path) : mixed
Parameters
- $path : string
-
The path of a directory.
getControllerDirectory()
Create a directory for controllers ('Http/Controllers/Authlete/') under the application directory.
protected
getControllerDirectory() : mixed
getControllerNamespace()
Get the name space for the controllers which are created under 'Http/Controllers/Authlete/' directory.
protected
getControllerNamespace() : mixed
getCssDirectory()
Create a directory for CSS files ('css/authlete/') under the public directory.
protected
getCssDirectory() : mixed
getViewDirectory()
Create a directory for views ('views/authlete/') under the resource directory.
protected
getViewDirectory() : mixed
relocateController()
Relocate a controller from the resource directory to the controller directory.
protected
relocateController(string $controller) : mixed
Parameters
- $controller : string
-
The file name of a controller.