Giter Site home page Giter Site logo

pramodwerea / silex-orm-skeleton Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fredjuvaux/silex-orm-skeleton

0.0 1.0 0.0 575 KB

Silex skeleton with doctrine ORM, bootstrap, LESS with an OOP example.

PHP 33.19% HTML 59.49% JavaScript 0.01% CSS 7.32%

silex-orm-skeleton's Introduction

silex-orm-skeleton

Silex skeleton with doctrine ORM, bootstrap and CRUD example.

For doctrine documentation see symfony and doctrine docs.

Install:

cd /path/to/your_project
git clone [email protected]:fredjuvaux/silex-orm-skeleton.git

Install composer:

curl -s https://getcomposer.org/installer | php

More information on Composer can be found on getcomposer.org.

And install your dependencies:

php composer.phar install

Set your database information in src/app.php:

$app->register(new DoctrineServiceProvider(), array(
    'db.options' => array(
        'driver'        => 'pdo_mysql',
        'host'          => 'localhost',
        'dbname'        => 'xxx',
        'user'          => 'xxx',
        'password'      => 'xxx',
    ),
));

Create database, then generate tables with CLI tool (for acme demo by example):

php bin/console orm:schema-tool:update --force

Commands available:

php bin/console --info
Available commands:
  help                             Displays help for a command
  list                             Lists commands
dbal
  dbal:import                      Import SQL file(s) directly to Database.
  dbal:reserved-words              Checks if the current database contains identifiers that are reserved.
  dbal:run-sql                     Executes arbitrary SQL directly from the command line.
orm
  orm:clear-cache:metadata         Clear all metadata cache of the various cache drivers.
  orm:clear-cache:query            Clear all query cache of the various cache drivers.
  orm:clear-cache:result           Clear result cache of the various cache drivers.
  orm:convert-d1-schema            Converts Doctrine 1.X schema into a Doctrine 2.X schema.
  orm:convert-mapping              Convert mapping information between supported formats.
  orm:ensure-production-settings   Verify that Doctrine is properly configured for a production environment.
  orm:generate-entities            Generate entity classes and method stubs from your mapping information.
  orm:generate-proxies             Generates proxy classes for entity classes.
  orm:generate-repositories        Generate repository classes from your mapping information.
  orm:info                         Show basic information about all mapped entities
  orm:run-dql                      Executes arbitrary DQL directly from the command line.
  orm:schema-tool:create           Processes the schema and either create it directly on EntityManager Storage Connection or generate the SQL output.
  orm:schema-tool:drop             Drop the complete database schema of EntityManager Storage Connection or generate the corresponding SQL output.
  orm:schema-tool:update           Executes (or dumps) the SQL needed to update the database schema to match the current mapping metadata.
  orm:validate-schema              Validate that the mapping files.

Example:

php bin/console orm:generate-entities src

Acme CRUD demo routes:

/path/to/your_project/acme/
/path/to/your_project/acme/create
/path/to/your_project/acme/show/{id}
/path/to/your_project/acme/update/{id}
/path/to/your_project/acme/delete/{id}

silex-orm-skeleton's People

Contributors

fredjuvaux avatar

Watchers

 avatar

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.