2017 © Pedro Peláez
 

project emerails

image

emeraldion/emerails

  • Monday, July 30, 2018
  • by claudiopro
  • Repository
  • 2 Watchers
  • 1 Stars
  • 467 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Build Status Coverage Status Latest Unstable Version composer.lock Total Downloads Monthly Downloads, (*1)

EmeRails

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)

Generator

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)

Contributing

Thank you for your interest in EmeRails! Feel free to open issues or submit a PR. See the Contributing Guidelines for detailed instructions., (*10)

Development

EmeRails is a PHP web application. If you are unsure what to do, follow these steps:, (*11)

Installing a local MySQL server

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)

Install dependencies

make install

Create test DB

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

Run tests (limited coverage):, (*15)

php_env=test make test

Docker

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

Documentation

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

License

MIT, (*24)

Copyright (c) 2008, 2017 Claudio Procida, (*25)

The Versions

30/07 2018

dev-docker-image

dev-docker-image

  Sources   Download

30/07 2018

dev-zelda

dev-zelda

  Sources   Download

15/02 2017

dev-master

9999999-dev https://github.com/emeraldion/emerails

Rails-like LAMP web application framework

  Sources   Download

MIT

The Requires

 

The Development Requires

framework webapp lamp rails