Code Monkey home page Code Monkey logo

symfonypetclinic's Introduction

Project Description

This is an implementation of the Spring Framework PetClinic demo application. It uses The Php Symfony 2.0 framework.

Symfony 2.0 is a significant upgrade to the Symfony framework and parts of the framework are being adopted for larger projects like Drupal. The choice for our testing was based on the fact that the models are lazy-loaded by default unlike other PHP frameworks which is useful for certain aspects of our testing.

  1. Prerequisites

  • Php 5.3 most recent version.
  • Webserver - Apache 2.x
  • MySQL 5.x

Before you begin, make sure that your local system is properly configured for Symfony. To do this, execute the following:

php app/check.php

If you get any warnings or recommendations, fix these now before moving on.

  1. Install aditional Php libraries

Some additional libraries are require for the application. If you're using the distribution version of the php tools (pecl, pear) you'll need sudo - we typically compile our own php for testing.

a) Install MySQL PDO driver

pecl install PDO_MYSQL

As per instructions in the install you should add "extension=pdo_mysql.so" to your php.ini

b) Install PhpUnit

This library is for running tests so you could skip if you no intention of running the test suite.

pear config-set auto_discover 1
pear install pear.phpunit.de/PHPUnit

c) Install Symfony dependencies

First copy the app/config/parameters.ini.dist file to app/config/parameters.ini From the project home directory:

php bin/vendors install
  1. Configure apache

You should add something like this to the apache configuration file httpd.conf

Alias /petclinic/ $APP_HOME/SymfonyPetClinic/web/
<Directory "$APP_HOME/SymfonyPetClinic/web" >
  AllowOverride All
  Allow from All
</Directory>

The application .htaccess file has been configured to use htttp://localhost/petclinic/app_dev.php for the development environment.

  1. Setup and populate database

First go to http://localhost/petclinic/app_dev.php and click on configure button. Follow the instructions to configure the mysql database connection for the application.

This may not work currently. If you don't get a symfony specific page you can just edit the app/config/parameters.ini file directly.

a) First create the database you just configured:

php app/console doctrine:database:create

b) Create the database tables:

php app/console doctrine:schema:create

c) Then populate the PetClinic database using this command:

php app/console petclinic:populate

This command has options to control how many owners and vets are generated. See

php app/console petclinic:populate -h

This can take a while depending on how many pet owners and vets are requested.

  1. Check the application

a) Move the application media and assets to a public directory

php app/console assets:install web

If you have a problem clear the caches for the production deployment before going further php app/console cache:clear --env=prod

symfonypetclinic's People

Contributors

mmennis avatar

Watchers

Fernando Saez 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.