Coder Social home page Coder Social logo

knpbundles's Introduction

KnpBundles

Open-source code of the knpbundles.com website, written in Symfony2.

Any ideas are welcome!

Build Status

Please note that this service was previously called Symfony2Bundles but we had to change the name due to trademark issues.

Install

Get the code

git clone git://github.com/KnpLabs/KnpBundles.git

Configure

To configure your database in your development environment, copy /app/config/parameters.yml.dist to /app/config/parameters.yml and edit it according to your database settings.

If you want to use github connect locally, you'll need to create an app on github with the callback:

http://yourlocalurl/login/check-github

And update the parameters.yml with the Client ID and Secret.

If you also want to use sensio labs connect locally, you'll need to create a client on sensio labs connect with the callback:

http://yourlocalurl/login/check-sensio

And update the parameters.yml with the Client ID and Secret.

Install vendors

curl -s http://getcomposer.org/installer | php
php composer.phar install

Create database and tables

php app/console doctrine:database:drop --force
php app/console doctrine:database:create
php app/console doctrine:schema:create

php app/console --env=test doctrine:database:drop --force
php app/console --env=test doctrine:database:create
php app/console --env=test doctrine:schema:create

Load data fixtures

php app/console doctrine:fixtures:load
php app/console --env=test doctrine:fixtures:load

Run the tests (requires PHPUnit >= 3.5)

phpunit -c app

Run the Behat tests (requires PHPUnit >= 3.5)

./bin/behat @KnpBundlesBundle

To generate migrations from your current schema

php app/console doctrine:migrations:diff
php app/console doctrine:migrations:migrate
php app/console cache:warmup

Usage

Launch the consumer

We rely on RabbitMQ to update bundles:

  • The main server produces messages saying "Hey, we should update this bundle"
  • The consumers read these messages and update them

To launch a consumer, do:

php app/console rabbitmq:consumer update_bundle

Note that you will need a functional rabbitmq server โˆ’ Follow the instructions in this page to install it.

Populate document collections from GitHub

php app/console kb:populate

This can take a long time. GitHub API is limited to 60 calls per minute, so the commands needs to wait.

Update all bundles in database

php app/console kb:update:bundles

This can take a long time but should be run to trigger update on all bundles when this is needed.

Search engine

We use Solr and its PHP client Solarium to search bundles.

To install SOLR follow the steps listed in this document. Use the default Jetty server included with SOLR. The default directory used for the installation is 'opt/solr/example'. Copy the recommended configuration and schema found here to your solr/conf directory.

You can run SOLR using:

php app/console kb:solr:start

See bin/prepare-test-solr.sh script Bundles will be automatically indexed on next update, or you can force indexing by console command.

If you have Solr up and running, simply do:

php app/console kb:solr:index --verbose

This will index all bundles.

Generate sitemap

php app/console kb:sitemap:generate --spaceless=1

Will create sitemap.xml and sitemap.xml.gz in web directory. Sitemap includes bundles and user profiles

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.