Example #1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     //echo $this->argument('example');
     //echo $this->option('example');
     $app_name = $this->option('app_name');
     $app_id = $this->option('app_id');
     if ($app_name) {
         $plugins = \Plugin::whereHas('applications', function ($q) use($app_name) {
             $q->where('name', $app_name);
         })->get();
     } else {
         if ($app_id) {
             $plugins = \Plugin::whereHas('applications', function ($q) use($app_id) {
                 $q->where('id', $app_id);
             })->get();
         } else {
             $plugins = \Plugin::get();
         }
     }
     echo "\n";
     foreach ($plugins as $plugin) {
         //Register appliation service providers
         \App::register($plugin->service_provider);
         echo "Publishing for " . $plugin->name . "\n";
     }
     //we now need to re asset publish?
     //TODO: do we really want to force this 100% of the time?
     \Artisan::call('vendor:publish', ['--force' => 1]);
 }
 public function boot()
 {
     \App::register('Barryvdh\\DomPDF\\ServiceProvider');
     $alias = AliasLoader::getInstance();
     $alias->alias('PDF', 'Barryvdh\\DomPDF\\Facade');
     $this->publishes([__DIR__ . '/config/dompdf.php' => config_path('dompdf.php')]);
     $this->createFontDirectory();
 }
 public function registerAPI()
 {
     $this->app['FriendsAPI'] = $this->app->share(function ($app) {
         \App::register('\\EllipseSynergie\\ApiResponse\\Laravel\\ResponseServiceProvider');
         $api = new APIManager();
         return $api;
     });
     $this->createAlias('FriendsAPI', 'DMA\\Friends\\Classes\\API\\APIManager');
 }
Example #4
0
 public function newFromBuilder($attributes = array())
 {
     //this is the standard stuff it used to do..
     $instance = $this->newInstance(array(), true);
     $instance->setRawAttributes((array) $attributes, true);
     //we also need to register the service provider of this content
     //item. This is where the magic happens.
     App::register($instance->service_provider);
     return $instance;
 }
 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->package('fbf/laravel-jobs');
     include __DIR__ . '/../../routes.php';
     \App::register('Cviebrock\\EloquentSluggable\\SluggableServiceProvider');
     // Shortcut so developers don't need to add an Alias in app/config/app.php
     $this->app->booting(function () {
         $loader = \Illuminate\Foundation\AliasLoader::getInstance();
         $loader->alias('Sluggable', 'Cviebrock\\EloquentSluggable\\Facades\\Sluggable');
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->package('fbf/laravel-mobile-facebook-app');
     include __DIR__ . '/../../filter.php';
     \App::register('Thomaswelton\\LaravelFacebook\\LaravelFacebookServiceProvider');
     // Shortcut so developers don't need to add an Alias in app/config/app.php
     $this->app->booting(function () {
         $loader = \Illuminate\Foundation\AliasLoader::getInstance();
         $loader->alias('Facebook', 'Thomaswelton\\LaravelFacebook\\Facades\\Facebook');
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $path = app_path() . '/modules/';
     $di = new \DirectoryIterator($path);
     $modules = array();
     foreach ($di as $row) {
         if ($row->isDir() && !$row->isDot()) {
             $module_name = $row->getBasename();
             if (file_exists($path . $module_name . '/ServiceProvider.php')) {
                 \App::register("App\\Modules\\" . ucfirst($module_name) . "\\ServiceProvider");
             }
         }
     }
 }
 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->package('fbf/laravel-events');
     if (\Config::get('laravel-events::routes.use_package_routes', true)) {
         include __DIR__ . '/../../routes.php';
     }
     \App::register('Thujohn\\Rss\\RssServiceProvider');
     \App::register('Cviebrock\\EloquentSluggable\\SluggableServiceProvider');
     // Shortcut so developers don't need to add an Alias in app/config/app.php
     $this->app->booting(function () {
         $loader = \Illuminate\Foundation\AliasLoader::getInstance();
         $loader->alias('Fbf\\LaravelBlog\\Rss', 'Thujohn\\Rss\\RssFacade');
         $loader->alias('Sluggable', 'Cviebrock\\EloquentSluggable\\Facades\\Sluggable');
     });
 }
Example #9
0
 public function register()
 {
     $this->registerCtrl();
     config(['config/ctrl.php']);
     // Register the DataTables service like this (saves having to add it to config/app.php)
     \App::register('Yajra\\Datatables\\DatatablesServiceProvider');
     // Excel module used when importing, exporting CSV data
     \App::register('Maatwebsite\\Excel\\ExcelServiceProvider');
     // This didn't seem to work, and isn't needed if we "use Maatwebsite\Excel\Facades\Excel;" at the top of the controller
     // \App::alias('Excel','Maatwebsite\Excel\Facades\Excel');
     // Can we create a custom Service Provider here to drive "modules"?
     /* Don't think so
      		\App::register('App\Ctrl\Providers\CtrlModuleServiceProvider');
      		*/
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     parent::register();
     \App::register('Ooglee\\Domain\\Providers\\RouteBlogServiceProvider');
     \App::register('Ooglee\\Domain\\Providers\\EventBlogServiceProvider');
     \App::register('Ooglee\\Domain\\Providers\\PostServiceProvider');
     // Third Party Service Providers
     /**
      * This allows the facade to work without the developer having to add it to the Alias array in config/app.php
      * http://fideloper.com/create-facade-laravel-4
      * Works for L5 too
      */
     $this->app->booting(function () {
         $loader = \Illuminate\Foundation\AliasLoader::getInstance();
         $loader->alias('OogleeBConfig', 'Ooglee\\Infrastructure\\Config\\Facades\\OogleeBlogConfigFacade');
         // Third Party Facades
     });
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     parent::register();
     \App::register('Ooglee\\Domain\\Providers\\HashingServiceProvider');
     \App::register('Ooglee\\Domain\\Providers\\SyncCommandBusServiceProvider');
     \App::register('Ooglee\\Infrastructure\\BreadCrumb\\Providers\\BreadCrumbServiceProvider');
     // Third Party Service Providers
     \App::register('Collective\\Html\\HtmlServiceProvider');
     /**
      * This allows the facade to work without the developer having to add it to the Alias array in app/config/app.php
      * http://fideloper.com/create-facade-laravel-4
      * Works for L5 too
      */
     $this->app->booting(function () {
         $loader = \Illuminate\Foundation\AliasLoader::getInstance();
         $loader->alias('OogleeCConfig', 'Ooglee\\Infrastructure\\Config\\Facades\\OogleeConfigFacade');
         // Third Party Facades
         $loader->alias('Form', 'Collective\\Html\\FormFacade');
         $loader->alias('Html', 'Collective\\Html\\HtmlFacade');
     });
 }
Example #12
0
                require $launchable['file_path'];
                if (class_exists($launchable['controller_class'])) {
                    if (method_exists(new $launchable['controller_class'](), $launchable['action'])) {
                        return call_user_func_array(array(new $launchable['controller_class'](), $launchable['action']), $launchable['parameters']);
                    } else {
                        $this->message = 'ERROR_CONTROLLER_METHOD_NOT_FOUND';
                        return false;
                    }
                } else {
                    $this->message = 'ERROR_CONTROLLER_CLASS_NOT_FOUND';
                    return false;
                }
            } else {
                $this->message = 'ERROR_CONTROLLER_FILE_NOT_FOUND';
                return false;
            }
        }
    }
    public function showError()
    {
        ob_clean();
        $codes = (require SYSDIR . 'framework/error_codes.php');
        $code = $this->message;
        $message = $codes[$code];
        $data = array('ERROR_CODE' => $code, 'ERROR_MESSAGE' => $message);
        $response = View::make('404.twig', $data, 404);
        $response->send();
    }
}
App::register('router', new Router());
require __DIR__ . '/uri.php';
 public function register()
 {
     \App::register('PragmaRX\\Google2FA\\Vendor\\Laravel\\ServiceProvider');
 }
Example #14
0
<?php

$loader = new Twig_Loader_Filesystem(VIEWSDIR);
$twig = new Twig_Environment($loader, array('cache' => APPDIR . 'cache/', 'charset' => 'utf-8', 'auto_reload' => true, 'strict_variables' => false, 'optimizations' => -1, 'autoescape' => false, 'debug' => false));
$twig->disableDebug();
require __DIR__ . '/configure.php';
require __DIR__ . '/view.php';
App::register('twig', $twig);
TwigConfiguration::setup();
Example #15
0
<?php

require __DIR__ . '/redirect.php';
require __DIR__ . '/response.php';
class Controller
{
    protected $app;
    function __construct()
    {
        $app = App::instance();
        $this->app = $app;
    }
    public function __get($name)
    {
        return $this->app->container[strtolower($name)];
    }
    public function __call($name, $params)
    {
        if (!method_exists($this, $name)) {
            if (!empty($params) && in_array($name, array('get', 'post', 'server', 'cookies', 'attributes', 'files', 'headers', 'session', 'flash'))) {
                return $this->app->{$name}()->get($params[0]);
            }
            return $this->app->{$name}();
        }
    }
}
App::register('controller', new Controller());
Example #16
0
 public function setUp()
 {
     parent::setUp();
     App::register('Larablob\\LarablobServiceProvider');
 }
Example #17
0
<?php

require APPDIR . 'config/email.php';
App::register('email', new PHPMailer());
Example #18
0
 public function boot()
 {
     \App::register('Laracasts\\Generators\\GeneratorsServiceProvider');
 }
Example #19
0
 */
use Silex\Application;
use Silex\Application\TwigTrait;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\File\UploadedFile;
// because we can't use PHP 7.0's anonymous classes yet...
if (!class_exists('App')) {
    class App extends Application
    {
        use TwigTrait;
    }
}
$app = new App();
$app->register(new Silex\Provider\TwigServiceProvider(), ['twig.path' => __DIR__ . '/templates']);
$app->register(new Silex\Provider\DoctrineServiceProvider(), ['db.options' => ['driver' => 'pdo_sqlite', 'path' => __DIR__ . '/app.db']]);
$app->get('/', function () use($app) {
    return $app->render('home.html.twig');
});
$app->get('/tidus_laugh.{ext}', function ($ext) use($app) {
    $sth = $app['db']->prepare('SELECT mime_type FROM extensions WHERE extension = ?');
    $sth->bindValue(1, $ext, \PDO::PARAM_STR);
    $sth->execute();
    $mimeType = $sth->fetchColumn();
    if (!is_string($mimeType)) {
        $app->abort(404, 'No such extension');
    }
    $filename = __DIR__ . "/repository/tidus_laugh.{$ext}";
    $expiresDate = new \DateTime();
    $expiresDate->modify('+1 day');
    $response = new BinaryFileResponse($filename);
Example #20
0
 public function boot()
 {
     \App::register('Barryvdh\\Elfinder\\ElfinderServiceProvider');
     $this->publishes([__DIR__ . '/config/elfinder.php' => config_path('elfinder.php')]);
     Event::listen('backend.form.extendFields', function ($form) {
         /*
          * Check for the installed plugin if install then extends fields for that.
          */
         if ($form->model instanceof \AnandPatel\WysiwygEditors\Models\Settings) {
             if (!($theme = Theme::getEditTheme())) {
                 throw new ApplicationException(Lang::get('cms::lang.theme.edit.not_found'));
             }
             if (PluginManager::instance()->hasPlugin('Radiantweb.Problog')) {
                 $form->addFields(['radiant_problog_as_wysiwyg' => ['label' => 'anandpatel.wysiwygeditors::lang.form.problog.label', 'type' => 'switch', 'span' => 'left', 'default' => 'false', 'comment' => 'anandpatel.wysiwygeditors::lang.form.problog.comment', 'tab' => 'anandpatel.wysiwygeditors::lang.form.tab.content']], 'primary');
             }
             if (PluginManager::instance()->hasPlugin('Radiantweb.Proevents')) {
                 $form->addFields(['radiant_proevents_as_wysiwyg' => ['label' => 'anandpatel.wysiwygeditors::lang.form.proevent.label', 'type' => 'switch', 'span' => 'left', 'default' => 'false', 'comment' => 'anandpatel.wysiwygeditors::lang.form.proevent.comment', 'tab' => 'anandpatel.wysiwygeditors::lang.form.tab.content']], 'primary');
             }
             if (PluginManager::instance()->hasPlugin('RainLab.Pages')) {
                 $form->addFields(['static_page_as_wysiwyg' => ['label' => 'anandpatel.wysiwygeditors::lang.form.spages.label', 'type' => 'switch', 'span' => 'left', 'default' => 'false', 'comment' => 'anandpatel.wysiwygeditors::lang.form.spages.comment', 'tab' => 'anandpatel.wysiwygeditors::lang.form.tab.content']], 'primary');
             }
             if (PluginManager::instance()->hasPlugin('RainLab.Blog')) {
                 $form->addFields(['blog_as_wysiwyg' => ['label' => 'anandpatel.wysiwygeditors::lang.form.blog.label', 'type' => 'switch', 'span' => 'left', 'default' => 'false', 'comment' => 'anandpatel.wysiwygeditors::lang.form.blog.comment', 'tab' => 'anandpatel.wysiwygeditors::lang.form.tab.content']], 'primary');
             }
             if (PluginManager::instance()->hasPlugin('Autumn.Pages')) {
                 $form->addFields(['autumn_page_as_wysiwyg' => ['label' => 'anandpatel.wysiwygeditors::lang.form.apages.label', 'type' => 'switch', 'span' => 'left', 'default' => 'false', 'comment' => 'anandpatel.wysiwygeditors::lang.form.apages.comment', 'tab' => 'anandpatel.wysiwygeditors::lang.form.tab.content']], 'primary');
             }
         }
         if (Settings::get('cms_content_as_wysiwyg', false) && get_class($form->config->model) == 'Cms\\Classes\\Content') {
             useWysiwyg($form);
         } else {
             if (Settings::get('cms_partial_as_wysiwyg', false) && get_class($form->config->model) == 'Cms\\Classes\\Partial') {
                 useWysiwyg($form);
             } else {
                 if (Settings::get('cms_layout_as_wysiwyg', false) && get_class($form->config->model) == 'Cms\\Classes\\Layout') {
                     useWysiwyg($form);
                 } else {
                     if (Settings::get('cms_page_as_wysiwyg', false) && get_class($form->config->model) == 'Cms\\Classes\\Page') {
                         useWysiwyg($form);
                     } else {
                         if (Settings::get('others_as_wysiwyg', false)) {
                             if (get_class($form->config->model) != 'Cms\\Classes\\Layout' && get_class($form->config->model) != 'Cms\\Classes\\Page' && get_class($form->config->model) != 'Cms\\Classes\\Content' && get_class($form->config->model) != 'Cms\\Classes\\Partial') {
                                 useWysiwyg($form);
                             }
                         } else {
                             if (Settings::get('radiant_problog_as_wysiwyg', false) && $form->model instanceof \Radiantweb\Problog\Models\Post) {
                                 useWysiwyg($form);
                             }
                             if (Settings::get('radiant_proevents_as_wysiwyg', false) && $form->model instanceof \Radiantweb\Proevents\Models\Event) {
                                 useWysiwyg($form);
                             }
                             if (Settings::get('blog_as_wysiwyg', false) && $form->model instanceof \RainLab\Blog\Models\Post) {
                                 useWysiwyg($form);
                             }
                             if (Settings::get('autumn_page_as_wysiwyg', false) && $form->model instanceof \Autumn\Pages\Models\Page) {
                                 useWysiwyg($form);
                             }
                             if (Settings::get('static_page_as_wysiwyg', false) && $form->model instanceof \RainLab\Pages\Classes\Page) {
                                 useWysiwyg($form);
                             }
                         }
                     }
                 }
             }
         }
     });
     function useWysiwyg($form)
     {
         $replacable = ['codeeditor', 'Eein\\Wysiwyg\\FormWidgets\\Trumbowyg', 'richeditor', 'RainLab\\Blog\\FormWidgets\\BlogMarkdown'];
         foreach ($form->getFields() as $field) {
             if (!empty($field->config['type'])) {
                 if (in_array($field->config['type'], $replacable)) {
                     if (Settings::instance()->editor == 'richeditor') {
                         $field->config['type'] = $field->config['widget'] = 'richeditor';
                     } else {
                         $field->config['type'] = $field->config['widget'] = 'AnandPatel\\WysiwygEditors\\FormWidgets\\Editor';
                     }
                     return;
                 }
             }
         }
     }
 }
Example #21
0
<?php

//
App::register('core\\models\\SlateServiceProvider');
Example #22
0
        $auth = new Auth();
        $auth->type = $type;
        if ($auth->check()) {
            $allowed = true;
        }
        if ($allowed == true) {
            return true;
        } else {
            if ($message != '') {
                $error = $message;
            } else {
                $error = 'You are not allowed to view this page.';
            }
            if ($redirect != '') {
                App::instance()->flash()->set('permission_error', $error);
                Redirect::to($redirect)->send();
            } else {
                \Symfony\Component\HttpFoundation\Response::create($error, 403)->send();
                exit;
            }
        }
    }
    public static function __callStatic($name, $params)
    {
        $authClass = new Auth();
        $authClass->type = $name;
        return $authClass;
    }
}
App::register('auth', new Auth());
Example #23
0
 $languages = array('en');
 //TODO <<
 $locale = null;
 //we need to hunt down the right bit of the url to use for language.
 $pathArr = explode('/', Request::path());
 foreach ($pathArr as $segment) {
     if (in_array($segment, $languages)) {
         //this is our language!
         $locale = $segment;
         break;
     }
 }
 //this doesn't exists in artisan thus we have to if it here.
 if (@$_SERVER['HTTP_HOST']) {
     foreach ($application->plugins as $plugin) {
         App::register($plugin->service_provider);
     }
 }
 Event::fire('routes.before');
 App::setLocale($locale);
 Route::get('/upload', function () {
     return Redirect::action('Bootleg\\Cms\\PagesController@getUpload');
 });
 Route::get(config('bootlegcms.cms_route'), array('as' => 'dash', function () {
     return Redirect::action('Bootleg\\Cms\\UsersController@anyDashboard');
 }));
 Route::any(config('bootlegcms.cms_route') . 'login', array('uses' => 'Bootleg\\Cms\\UsersController@anyLogin'));
 Route::group(array('prefix' => config('bootlegcms.cms_route')), function () use($locale) {
     Route::group(array('prefix' => $locale), function () {
         Route::any('/', array('uses' => 'Bootleg\\Cms\\UsersController@anyDashboard'));
         Route::controller('content', 'Bootleg\\Cms\\ContentsController');
 public function boot()
 {
     \App::register('\\Phamels\\Icepay\\IcepayServiceProviderLaravel5');
 }
Example #25
0
<?php

defined('LARAVEL_START') or die('No direct script access allowed');
set_meta('GIFTWISHES::SKIN', 'skin-blue');
if (!App::bound('orchestra.avatar') && class_exists('Orchestra\\Avatar\\AvatarServiceProvider')) {
    App::register('Orchestra\\Avatar\\AvatarServiceProvider');
}
Example #26
0
<?php

require_once __DIR__ . '/../vendor/autoload.php';
use XO\Service\Game;
use XO\Controller\GameController;
use Silex\Provider\ServiceControllerServiceProvider;
class App extends Silex\Application
{
    use Silex\Application\TwigTrait;
}
$app = new App();
$app->register(new ServiceControllerServiceProvider());
$app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . '/../src/XO/Views'));
$gameService = new Game();
$registry = \XO\Service\PlayerRegistry::getDefaultPlayers();
$app['game.controller'] = $app->share(function () use($app, $gameService, $registry) {
    return new GameController($app, $gameService, $registry);
});
$app->get('/', "game.controller:indexAction");
$app->get('/turn.json', "game.controller:indexJsonAction");
$app->run();
Example #27
0
    }
    $app->setConfig($config);
    // Set up app directories.
    $app->setDirectories(__DIR__);
} catch (\Exception $e) {
    ldd($e->getMessage());
}
// Set up app templates.
$app->setConfig(['app.templates.default.file' => TemplateDefaults::DEFAULT_NAME, 'app.templates.default.content' => TemplateDefaults::DEFAULT_CONTENT, 'app.templates.error404.file' => TemplateDefaults::ERROR404_NAME, 'app.templates.error404.content' => TemplateDefaults::ERROR404_CONTENT, 'app.templates.error500.file' => TemplateDefaults::ERROR500_NAME, 'app.templates.error500.content' => TemplateDefaults::ERROR500_CONTENT]);
// Set up the Twig environment.
$loaderFS = new \Twig_Loader_Filesystem($app->get('app.dir.templates'));
$loaderArray = new \Twig_Loader_Array([$app->get('app.templates.default.file') => $app->get('app.templates.default.content'), $app->get('app.templates.error404.file') => $app->get('app.templates.error404.content'), $app->get('app.templates.error500.file') => $app->get('app.templates.error500.content')]);
$loader = new \Twig_Loader_Chain([$loaderFS, $loaderArray]);
$config = ['cache' => $app->get('app.dir.cache.templates'), 'debug' => $app->get('app.settings.debug')];
// Register Twig as the view library.
$app->register('view', '\\Twig_Environment', [$loader, $config]);
$app->view()->addGlobal('insert', new \Bluematt\Korpus\DocumentInserter($app->get('app.dir.pages')));
// Handle all routes.
$app->route('GET *', function () use($app) {
    try {
        // Get the route.
        $app->initRoute();
        $document = (new DocumentLocator($app->get('app.dir.pages')))->fromRoute($app->get('app.route.path'));
        // Work out if the document has expired and should not redirect.
        if ($document->hasExpired() && !$document->shouldRedirect()) {
            throw new Exceptions\DocumentExpiredException($app->get('app.route'));
        }
        // If the document should redirect, then redirect it.
        if ($document->shouldRedirect()) {
            $app->redirect($document->redirect);
        }
Example #28
0
<?php

require __DIR__ . '/image_moo.php';
App::register('image', new Image_moo());
Example #29
0
|--------------------------------------------------------------------------
|
|
*/
//Get themes
//Set namespace with override support
View::addNamespace('theme', [base_path() . '/theme/' . Theme::getThemeName() . '/views', base_path() . '/theme/default/views']);
/*
|--------------------------------------------------------------------------
| Register The Modules Providers
|--------------------------------------------------------------------------
|
|
*/
foreach (Config::get('module') as $module) {
    App::register('Dynamix\\' . $module . '\\' . $module . 'ServiceProvider');
}
/*
|--------------------------------------------------------------------------
| Register The Laravel Class Loader
|--------------------------------------------------------------------------
|
| In addition to using Composer, you may use the Laravel class loader to
| load your controllers and models. This is useful for keeping all of
| your classes in the "global" namespace without Composer updating.
|
*/
ClassLoader::addDirectories(array(app_path() . '/commands', app_path() . '/controllers', app_path() . '/models', app_path() . '/database/seeds'));
/*
|--------------------------------------------------------------------------
| Application Error Logger
Example #30
0
 /**
  * Boot service provider
  */
 public function boot()
 {
     \App::register('Renatio\\BackupManager\\DropboxFilesystemServiceProvider');
 }