2017 © Pedro Peláez
 

library project

image

virge/project

  • Wednesday, March 29, 2017
  • by siosphere
  • Repository
  • 1 Watchers
  • 0 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Virge Project

Used to create a new empty Virge project, including most used virge libraries (virge/core, virge/db, virge/router, virge/orm), (*1)

Adding your code

Simply add your namespace in the src/ directory, and add your Namespace to the bootstrap.php file., (*2)

Capsules

Virge projects are split into Capsules, you register all capsules in the Reactor (app/Reactor.php). Each Capsule must be defined as follows:, (*3)

namespace Siosphere\MyCapsule;

/**
 * 
 */
class Capsule extends \Virge\Core\Capsule {
    public function registerCapsule() {

    }
}

Virge will automatically read all configuration files in the config directory of your capsule. This directory is where you will register new services, routes, and API calls., (*4)

Registering Services

Let's say we have the capsule src\Siosphere\MyCapsule, and we had a service Siosphere\MyCapsule\Service\TestService. Create a file called services.php in the src\Siosphere\MyCapsule\config\ directory., (*5)

use Siosphere\MyCapsule\Service\TestService;
use Virge\Virge;

Virge::registerService("my_service_identifier", new TestService());

The Versions