Example #1
0
 /**
  * Application constructor.
  *
  * @todo Read version from somewhere?
  *
  * @param   App $silexApp
  *
  * @return  Application
  */
 public function __construct(App $silexApp)
 {
     parent::__construct('Silex - Backend', '0.0.0');
     // Store application
     $this->silexApp = $silexApp;
     // Register console application specified providers
     $this->silexApp->register(new DoctrineMigrationsProvider($this), $this->getDoctrineMigrationsProviderOptions());
     // Register pure Doctrine commands
     $this->registerDoctrineCommands();
     // Boot application
     $this->silexApp->boot();
     $this->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The Environment name.', $this->silexApp->getEnv()));
 }
<?php

/*
    Plugin Name: Wordpress Recipes Manager
    Plugin URI: http://wrm.if36.com
    Description: Wordpress Recipes Manager
    Version: 1.0.0
    Author: Karim Lamghari & Younes Rafie
    Author URI: http://wrm.if36.com
    Text Domain: WRM-lang
    Domain Path: /languages/
*/
require_once __DIR__ . '/vendor/autoload.php';
use App\Application;
$app = new Application();
$app->boot();
// Boot application
require_once __DIR__ . '/bootstrap/bootstrap.php';
register_activation_hook(__FILE__, array($app, 'activatePlugin'));
register_deactivation_hook(__FILE__, array($app, 'deactivatePlugin'));
register_uninstall_hook(__FILE__, array(get_class($app), 'uninstallPlugin'));
add_action('wp_ajax_wrm_execute', 'wrm_execute');
add_action('wp_ajax_nopriv_wrm_execute', 'wrm_execute');
function wrm_execute()
{
    /* 
        ControllerHandler should exist on the App\Http\Controllers\ namespace, 
        while other controller can be changed from the config
    */
    $controller = new App\Http\Controllers\ControllerHandler();
    $controller->run();
Example #3
0
 /**
  * Boot the application's service providers.
  *
  * @return void 
  * @static 
  */
 public static function boot()
 {
     //Method inherited from \Illuminate\Foundation\Application
     \App\Application::boot();
 }