servergrove/kb-bundle

Symfony2 bundle which provides a complete Knowledge Base system based on the Symfony CMF and PHPCR projects

v0.1 2013-03-12 14:49 UTC

This package is not auto-updated.

Last update: 2022-01-22 01:04:47 UTC


README

This bundle allows to easily create a knowledge base application with a few simple steps.

Installation

You need to add the bundle to your composer file. You can easily do so by running the following command:

$ composer require servergrove/kb-bundle:dev-master

Add the bundle to your project

There is only one requirement, to add the Bundle instance to your Kernel

<?php
// app/AppKernel.php

public function registerBundles() {
    return array(
        // …
        new ServerGrove\KbBundle\ServerGroveKbBundle(),
        // ...
    );
}

Configuration

Configure this bundle

Add the locales you desire to use in your application.

# app/config/config.yml

server_grove_kb:
    locales:        [en, es, pt]
    default_locale: en
    article:
        enable_related_urls: false
        front_page_category: Homepage
        front_page_keyword:  homepage
        top_keyword:         feature
    editor_type: markdown
    mailer:
        from:
            email: noreply@servergrove.com
            name:  ServerGrove KnowledgeBase System

Configure the SecurityBundle

Users

This Bundle provides with a document called User and a service for the user provider, which you can use to manage the access to the admin area. The path to this document is Document/User.php

To complete the user configuration, you need to add the encoder and provider for the mentioned User document.

Encoder
# app/config/security.yml
encoders:
        ServerGrove\KbBundle\Document\User: sha512

Note that you can use the encoder strategy that you like the most.

Provider
# app/config/security.yml
providers:
        user_db:
            id: server_grove_kb.security.user.provider

Remember, these are encoder and provider are available in the bundle, but feel free to use your own implementation.

Test Data

In order to use some test data, you have to run the following commands

$ php app/console doctrine:phpcr:workspace:create sgkb
$ php app/console doctrine:phpcr:register-system-node-types
$ php app/console doctrine:phpcr:fixtures:load

Application

This section assumes that you have your application installed under kb.local

Frontend

The frontend area is located in the main route /. So you can start navigating the application by opening the following address in your web browser: http://kb.local/

Backend

The backend is located under /admin, so you will have to go to http://kb.local/admin. This is a secure area, so you will have to login with valid credentials. If you are using the test data, then you can access it with admin:abc123