Skip to content

Commit

Permalink
changed license to MIT; restructure scripts and tidied up readme
Browse files Browse the repository at this point in the history
  • Loading branch information
niden committed Jan 14, 2024
1 parent 6101d21 commit 8232961
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 20 deletions.
Empty file modified .htaccess
100755 → 100644
Empty file.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020-present The Phalcon PHP Framework

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
53 changes: 34 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,50 @@ To run this application on your machine, you need at least:
* [Nginx][4] Web Server
* Latest stable [Phalcon Framework release][5] extension enabled

You can also run the application using [nanobox.io][8]. Installation instructions for nanobox can be found [here][9].

## Running the application
## Running the application locally

* Clone the repository to a folder on your machine
* Navigate to that folder
* Run `nanobox run`
* After the application compiles you will see `/app $` in your terminal. Type `php-server` to run apache
* Navigate to the IP address displayed in the console.
* Run `docker compose up -d`
* After the build process is completed, you will have the following:
* PHP 8.0 (`tutorial-8.0`)
* PHP 8.1 (`tutorial-8.1`)
* PHP 8.2 (`tutorial-8.2`)
* PHP 8.3 (`tutorial-8.3`)
* You can check the application on your local browser by finding the IP address of the chosen environment and launching it. For example, if you wish to check the PHP 8.3 environment, type the following in your terminal:

```shell
docker inspect tutorial-8.3
```
This will output a JSON file, where you can find the IP address of the container on your local machine.

```shell
...
"EndpointID": "563ba90563ffb7ad5c30689f1216ec4c2e1625d170eb0279e78c001973464691",
"Gateway": "172.29.0.1",
"IPAddress": "172.29.0.5",
"IPPrefixLen": 16,
...
```

Launch a browser and visit the site using that IP address (`http://172.29.0.5`)

To enter an environment and run different commands, such as populating the database:

```shell
docker exec -it tutorial-8.3 /bin/bash
```

## License

Phalcon Tutorial is open-sourced software licensed under the [New BSD License][6]. © Phalcon Framework Team and
Phalcon Tutorial is open-sourced software licensed under the [MIT][6]. © Phalcon Framework Team and
contributors

[1]: https://docs.phalcon.io/latest/en/tutorial-basic

[1]: https://docs.phalcon.io/latest/tutorial-basic
[2]: http://httpd.apache.org/

[3]: http://httpd.apache.org/docs/current/mod/mod_rewrite.html

[4]: http://nginx.org/

[5]: https://github.com/phalcon/cphalcon/releases

[6]: https://github.com/phalcon/tutorial/blob/master/docs/LICENSE.md

[6]: https://github.com/phalcon/tutorial/blob/master/docs/LICENSE
[7]: https://github.com/phalcon/phalcon-devtools

[8]: https://nanobox.io

[9]: https://docs.nanobox.io/install/
[8]: https://docker.com
2 changes: 1 addition & 1 deletion bin/import_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
mysql --user=$DATA_MYSQL_USER \
--password=$DATA_MYSQL_PASS \
--host=$DATA_MYSQL_HOST \
gonano < /app/storage/schemas/tutorial.sql
phalcon_tutorial < /code/resources/schemas/tutorial.sql
11 changes: 11 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<ruleset name="Phalcon">
<description>Phalcon Coding Standards</description>
<arg value="-colors"/>
<arg value="s"/>
<arg value="p"/>
<rule ref="PSR12">
<exclude name="PSR2.Methods.MethodDeclaration.Underscore"/>
</rule>
<file>src</file>
</ruleset>

0 comments on commit 8232961

Please sign in to comment.