Giter Club home page Giter Club logo

silex-skeleton-app's Introduction

silex-skeleton-app

A skeleton with a generator

Dependencies

For the UI Application to work, you need to purchase xCRUD http://xcrud.com/

Installation

Create two empty dababases: restdb and resttestdb. This separates the production/development and test database environment.

If you generate code the dbs above need to exist. To run unit tests you need to include the --sql option and you need to put the content of /db/db.sql into the sql command of your MySQL database. It will create 2 databases.

Change the configurations to suit your environment.

  • app/config/dev.php
  • app/config/prod.php
  • app/config/test.php
  • Your server configuration must be pointing to: web/index.php (prod) and web/index_dev.php (dev)

Copy the following folders from xCRUD distribution into your project root folder:

  • /xcrud
  • /editors
  • /uploads

Edit the /xcrud/xcrud_config.php file to point to your restdb and resttestdb alternative databases with the same details as you used to set up dev.php and prod.php above.

Start the PHP Development server from the project root directory with:

$ php -S localhost:8888

For development mode: navigate to "http://localhost:8888/web/index_dev.php/" with your browser.

For production mode: navigate to "http://localhost:8888/web/index.php/" with your browser.

Testing

For testing purposes, you can just run this command at your main directory:

$ ./vendor/bin/phpunit -c app/

Code Coverage

For a code coverage report in html, you can just run this command at your main directory:

$ ./vendor/bin/phpunit -c app/ --coverage-html coverage

Standards

Finally for code standards:

$ ./vendor/bin/phpcs ./src/ --standard=PSR2
$ ./vendor/bin/phpcs ./tests/ --standard=PSR2

Generation

Console API:

php app/console generate:restbundle Party party_name:string party_type:string --sql
php app/console generate:restbundle Party party_name:string party_type:string --travis
php app/console generate:restbundle Party party_name:string party_type:string --migration

php app/console generate:restbundle Party party_name:string party_type:string --migration --sql
php app/console generate:restbundle PartyRole role_name:string role_data:string --migration --sql
php app/console generate:restbundle PartyRelationship relationship_name:string relationship_data:string party_id:string party_role_id:string --migration --sql

Console APP:

php app/console generate:appbundle Party party_name:string party_type:string --sql
php app/console generate:appbundle Party party_name:string party_type:string --travis
php app/console generate:appbundle Party party_name:string party_type:string --migration

php app/console generate:appbundle Party party_name:string party_type:string --migration --sql
php app/console generate:appbundle PartyRole role_name:string role_data:string --migration --sql
php app/console generate:appbundle PartyRelationship relationship_name:string relationship_data:string party_id:string party_role_id:string --migration --sql

        /**
         * crud
         */
        $controller->get("/crud", function() use ($app)
        {
            $xcrud = $app['xcrud'];
            $xcrud->table('partyrelationship');
            $xcrud->relation('party_id','party','id','party_name');
            $xcrud->relation('party_role_id','partyrole','id','role_name');
            return $app['twig']->render('partyrelationship.twig', array(
                'xcrud' => $xcrud,
                'className' => $this->repository
            ));
        });
        
php app/console generate:archibundle model

silex-skeleton-app's People

Contributors

andrenventer avatar makusu avatar cashkows-andre avatar

Stargazers

 avatar

Watchers

Andre Venter avatar Markus Köller avatar James Cloos avatar  avatar

Forkers

cesarams

silex-skeleton-app's Issues

Reject reserved terms

Search a reserved terms list and reject terms at the beginning - generation from cli stage

Format input data

Format input data to:
Capital - first term - class name
under_score and solid, lowercase - n terms

YAML config to generate from

Provide YAML config to generate from, in stead of or as a compliment to CLI.
If used together - CLI should build and expand. maybe even version the YAML

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.