-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #238 from dotkernel/issue-228
Documentation
- Loading branch information
Showing
18 changed files
with
1,011 additions
and
171 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: "Continuous Integration" | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
tags: | ||
|
||
jobs: | ||
ci: | ||
uses: laminas/workflow-continuous-integration/.github/workflows/[email protected] |
This file was deleted.
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: docs-build | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Build Docs | ||
uses: dotkernel/documentation-theme/github-actions/docs@main | ||
env: | ||
DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
JOB=$3 | ||
PHP_VERSION=$4 | ||
COMMAND=$(echo "${JOB}" | jq -r '.command') | ||
|
||
echo "Running $COMMAND" | ||
|
||
if [[ ${COMMAND} =~ phpunit ]];then | ||
|
||
apt-get install php"${PHP_VERSION}"-sqlite3 | ||
|
||
cp config/autoload/local.php.dist config/autoload/local.php | ||
cp config/autoload/mail.local.php.dist config/autoload/mail.local.php | ||
cp config/autoload/local.test.php.dist config/autoload/local.test.php | ||
|
||
fi |
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
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
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 @@ | ||
# ../../README.md |
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,54 @@ | ||
# File structure | ||
|
||
It is a good practice to standardize the file structure of projects. This way it’s easier to keep a clean overview of multiple projects, and less time is wasted trying to find the correct class. | ||
|
||
When using DotKernel API the following structure is recommended: | ||
|
||
## Main directories | ||
|
||
* `src` - should contain the source code files | ||
* `templates` - should contain the page templates and layouts | ||
* `data` - should contain project-related data (AVOID storing sensitive data on VCS) | ||
* `docs` - should contain project-related documentation | ||
|
||
These directories reside in one of the following directories: | ||
|
||
* if the Module is a composer package where the directories above are stored in the package’s root path, eg.: `/vendor/my-name/my-project-name/` | ||
* if the Module is an extension/component for the project, eg.: `/src/MyProjectName` | ||
|
||
## The `src` directory | ||
|
||
This directory contains all source code related to the Module. It should contain following directories, if they’re not empty: | ||
|
||
* Handler - Action classes (similar to Controllers but can only perform one action) | ||
* Entity - For database entities | ||
* Service - Service classes | ||
* Collection - Database entities collections | ||
* Repository - Entity repository folder | ||
|
||
> The above example is just some of the directories a project may include, but these should give you an idea of how the structure should look like. | ||
Other classes in the `src` directory may include `InputFilter`, `EventListener`, `Helper`, `Command`, `Factory` etc. | ||
|
||
The `src` directory should also contain 2 files: | ||
|
||
* `ConfigProvider.php` - Provides configuration data | ||
* `RoutesDelegator.php` - Module main routes entry file | ||
|
||
## The `templates` directory | ||
|
||
This directory contains the template files, used for example to help render e-mail templates. | ||
|
||
> DotKernel API uses twig as Templating Engine. All template files have the extension .html.twig | ||
## The `data` directory | ||
|
||
This directory contains project-related data (such as cache, file uploads) | ||
|
||
We recommend using the following directory structure: | ||
|
||
* `data/cache` - location where caches are stored | ||
* `data/oauth` - encryption, private and public keys needed for authentication. | ||
* `data/lock` - folder where lock files generated by commands are stored, if enabled | ||
* `data/doctrine/fixtures` - folder for doctrine data fixtures | ||
* `data/doctrine/migrations` - folder for doctrine migrations |
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,5 @@ | ||
# Clone the project | ||
|
||
Using your terminal, navigate inside the directory you want to download the project files into. Make sure that the directory is empty before proceeding to the download process. Once there, run the following command: | ||
|
||
git clone https://github.com/dotkernel/api.git . |
Oops, something went wrong.