dev-master
9999999-dev https://github.com/emeraldion/emerailsRails-like LAMP web application framework
MIT
The Requires
- php >=5.6.0
- satooshi/php-coveralls ^1.0
The Development Requires
framework webapp lamp rails
EmeRails is a PHP web application framework loosely inspired to Ruby on Rails. It has a MVC architecture, an ORM layer that mimics ActiveRecord, and separates presentation from business logic quite nicely, prioritizing conventions over configuration., (*2)
It supports templating, page caching, action filtering, and a lot of useful features out of the box
that save coding time and server load. Similarly to Rails, EmeRails has a generate.php
script that
can quickly get you up and running, creating your controllers, models, and views in no time., (*3)
EmeRails comes with default support for MySQL via mysql
(deprecated) and mysqli
extensions, is
continuously tested on PHP 5.6
, 7.1
, and nightly
., (*4)
EmeRails comes with a generator script that creates controllers, views, and models with no code:, (*5)
scripts/generate.php Usage: generate.php controller controller_name [action1 [action2 ...]] generate.php model model_name [field1 [type1 [field2 [type2 ...]]]]
In order to generate a controller and its views, run the generator script as follows:, (*6)
scripts/generate.php controller foo bar baz
This will create a controller class FooController
with the default FooController::index
action,
and two actions, FooController::bar
and FooController::baz
.
It will also generate the views index
, bar
, and baz
., (*7)
In order to generate a model with a list of fields and types, run the generator script as follows:, (*8)
scripts/generate.php model foo bar int baz float
This will create a model class Foo
with two fields, bar
of type int
, and baz
of type float
.
It will also create the backing table in the DB., (*9)
Thank you for your interest in EmeRails! Feel free to open issues or submit a PR. See the Contributing Guidelines for detailed instructions., (*10)
EmeRails is a PHP web application. If you are unsure what to do, follow these steps:, (*11)
For development, it's best to use a local MySQL server. I use MAMP on Mac OS X, but you can also run MySQL server in a Docker container., (*12)
make install
This command will create a test MySQL DB:, (*13)
make create_test_db
Note the script assumes there is a mysql
command in the PATH
. It also assumes the database user is
root
and will prompt for the password. If you want to use another user, you have to edit Makefile
., (*14)
Run tests (limited coverage):, (*15)
php_env=test make test
If you're familiar with Docker and Docker Compose, you may want
to package your app as a Docker image thanks to the included Dockerfile
:, (*16)
make docker-build
This goal builds the app as the emerails-app
image; to easily run the image in a container:, (*17)
make docker-run
This goal runs a mysql
DB container, spins up an app container, links them, and forwards the app container's port 80
to local port 8080
. You can then hit the app opening your browser on http://localhost:8080
., (*18)
To stop the app and mysql
containers, run the goal:, (*19)
make docker-stop
There's also a handy goal to cleanup when you're done with Docker images:, (*20)
make docker-clean
The included docker-compose.yml
configuration also allows you to spin up the application locally:, (*21)
docker-compose up --build -d
To generate documentation, you will need Doxygen. You can build it from sources, download a binary, or install it via homebrew:, (*22)
brew install doxygen
Once you have Doxygen, you can run the docs
target:, (*23)
make docs
MIT, (*24)
Copyright (c) 2008, 2017 Claudio Procida, (*25)
Rails-like LAMP web application framework
MIT
framework webapp lamp rails