Beispiel #1
0
 /**
  * Bootstrap DFE Installer
  *
  * @return bool
  */
 function __dfe_installer_main()
 {
     //  Register The Composer Auto Loader
     require __DIR__ . '/../bootstrap/autoload.php';
     $_app = (require_once __DIR__ . '/../bootstrap/app.php');
     /** @type Illuminate\Contracts\Http\Kernel $_kernel */
     $_kernel = $_app->make(Illuminate\Contracts\Http\Kernel::class);
     $_response = $_kernel->handle($_request = Illuminate\Http\Request::capture());
     $_response->send();
     $_kernel->terminate($_request, $_response);
 }
Beispiel #2
0
 /**
  * Bootstrap Illuminate before PrestaShop dispatch (first function call in prestashop)
  */
 public function dispatch()
 {
     /*
     |--------------------------------------------------------------------------
     | Register The Auto Loader
     |--------------------------------------------------------------------------
     |
     | Composer provides a convenient, automatically generated class loader for
     | our application. We just need to utilize it! We'll simply require it
     | into the script here so that we don't have to worry about manual
     | loading any of our classes later on. It feels nice to relax.
     |
     */
     require _PS_MODULE_DIR_ . '/illuminato/src/bootstrap/autoload.php';
     // @todo Don't know why yet but this file isn't loaded with autoload...
     require_once _PS_MODULE_DIR_ . '/illuminato/src/Module.php';
     /*
     |--------------------------------------------------------------------------
     | Turn On The Lights
     |--------------------------------------------------------------------------
     |
     | We need to illuminate PHP development, so let us turn on the lights.
     | This bootstraps the framework and gets it ready for use, then it
     | will load up this application so that we can run it and send
     | the responses back to the browser and delight our users.
     |
     */
     $app = (require_once _PS_MODULE_DIR_ . '/illuminato/src/bootstrap/app.php');
     /*
     |--------------------------------------------------------------------------
     | Run The Application
     |--------------------------------------------------------------------------
     |
     | Once we have the application, we can handle the incoming request
     | through the kernel, and send the associated response back to
     | the client's browser allowing them to enjoy the creative
     | and wonderful application we have prepared for them.
     |
     */
     $kernel = $app->make('Illuminate\\Contracts\\Http\\Kernel');
     $response = $kernel->handle($request = Illuminate\Http\Request::capture());
     /*
     | Set locale from Prestashop context
     */
     $context = \Context::getContext();
     $app->setLocale($context->language->iso_code);
     /*
     
     $response->send();
     
     $kernel->terminate($request, $response);
     */
     parent::dispatch();
 }
Beispiel #3
0
 function __dfe_startup()
 {
     $_path = dirname(__DIR__);
     //  Composer
     require $_path . '/bootstrap/autoload.php';
     //  Laravel
     $_app = (require_once $_path . '/bootstrap/app.php');
     /** @type Kernel $_kernel */
     $_kernel = $_app->make('Illuminate\\Contracts\\Http\\Kernel');
     $_response = $_kernel->handle($_request = Illuminate\Http\Request::capture());
     $_response->send();
     $_kernel->terminate($_request, $_response);
 }
Beispiel #4
0
 /** @return \Illuminate\Foundation\Application */
 public static function create($baseDir, $tempDir)
 {
     require $baseDir . '/app/bootstrap/autoload.php';
     /** @var \Illuminate\Foundation\Application $app */
     $app = (require_once $baseDir . '/app/bootstrap/app.php');
     $app->bind('path.public', function () use($baseDir) {
         return $baseDir . '/public';
     });
     $app->bind('path.base', function () use($baseDir) {
         return $baseDir;
     });
     $app->bind('path.storage', function () use($tempDir) {
         return $tempDir;
     });
     /** @var \Illuminate\Filesystem\Filesystem $fs */
     $fs = $app->make('files');
     $fs->makeDirectory($tempDir, 0777, true);
     $makedirs = ['app', 'framework/cache', 'framework/sessions', 'framework/views', 'logs'];
     foreach ($makedirs as $d) {
         $fs->makeDirectory(Path::join($tempDir, $d), 0777, true);
     }
     $dbPath = Path::join($tempDir, 'database.sqlite');
     $fs->put($dbPath, '');
     $app->config->set('cache.driver', 'file');
     $app->config->set('database.default', 'sqlite');
     $app->config->set('database.connections.sqlite', ['driver' => 'sqlite', 'database' => $dbPath, 'prefix' => '']);
     $app->config->set('mail.driver', 'log');
     $app->config->set('session.driver', 'file');
     //
     // MIGRATE
     //
     /** @var \Illuminate\Database\Migrations\Migrator $mg */
     $mg = $app->make('migrator');
     $mg->setConnection('sqlite');
     $mgr = $mg->getRepository();
     $mgr->setSource('sqlite');
     $mgr->createRepository();
     $mg->run($baseDir . '/database/migrations');
     #$app->boot();
     $kernel = $app->make('Illuminate\\Contracts\\Http\\Kernel');
     #$kernel->bootstrap();
     $response = $kernel->handle($request = Illuminate\Http\Request::capture());
     static::$tempDir = $tempDir;
     return static::$app = $app;
 }
Beispiel #5
0
| loading any of our classes /var/www/testphp.phplater on. It feels nice to relax.
|
*/
require __DIR__ . '/../bootstrap/autoload.php';
/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/
$app = (require_once __DIR__ . '/../bootstrap/app.php');
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle($request = Illuminate\Http\Request::capture());
$response->send();
$kernel->terminate($request, $response);
Beispiel #6
0
<?php

/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| First we need to get an application instance. This creates an instance
| of the application / container and bootstraps the application so it
| is ready to receive HTTP / Console requests from the environment.
|
*/
$app = (require __DIR__ . '/../bootstrap/app.php');
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$request = Illuminate\Http\Request::capture();
$app->run($request);
Beispiel #7
0
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax.
|
*/
require __DIR__ . '/../bootstrap/autoload.php';
/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let's turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight these users.
|
*/
$app = (require_once __DIR__ . '/../bootstrap/app.php');
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can simply call the run method,
| which will execute the request and send the response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have whipped up for them.
|
*/
$response = $app->make('Illuminate\\Contracts\\Http\\Kernel')->handle(Illuminate\Http\Request::capture());
$response->send();
Beispiel #8
0
function urlObj()
{
    $routes = new Illuminate\Routing\RouteCollection();
    $context = Illuminate\Http\Request::createFromBase(Illuminate\Http\Request::capture());
    return new Illuminate\Routing\UrlGenerator($routes, $context);
}
Beispiel #9
0
<?php

//header('Access-Control-Allow-Origin: http://www.baidu.com'); //设置http://www.baidu.com允许跨域访问
//header('Access-Control-Allow-Headers: X-Requested-With,X_Requested_With'); //设置允许的跨域header
date_default_timezone_set("Asia/chongqing");
error_reporting(E_ERROR);
header("Content-Type: text/html; charset=utf-8");
define('IN_UEDITOR', TRUE);
//import laravel
require dirname($_SERVER['DOCUMENT_ROOT']) . '/bootstrap/autoload.php';
$app = (require_once dirname($_SERVER['DOCUMENT_ROOT']) . '/bootstrap/app.php');
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$kernel->handle(Illuminate\Http\Request::capture());
use App\Services\Admin\Login\Process as LoginProcess;
$isLogin = (new LoginProcess())->getProcess()->hasLogin();
if (empty($isLogin)) {
    return;
}
$CONFIG = json_decode(preg_replace("/\\/\\*[\\s\\S]+?\\*\\//", "", file_get_contents("config.json")), true);
$APPCONFIG = (require dirname($_SERVER['DOCUMENT_ROOT']) . '/config/sys.php');
$action = $_GET['action'];
switch ($action) {
    case 'config':
        $result = json_encode($CONFIG);
        break;
        /* 上传图片 */
    /* 上传图片 */
    case 'uploadimage':
        /* 上传涂鸦 */
    /* 上传涂鸦 */
    case 'uploadscrawl':
Beispiel #10
0
<?php

/*
Plugin Name: LaraPress framework
Plugin URI: http://larapress.com/
Description: A framework for WordPress developers.
Version: 1.0.0
Author: Jeff Berry
Author URI: http://portonefive.com
License: GPLv2
*/
$app = (require_once __DIR__ . '/../../../bootstrap/app.php');
/** @var App\Http\Kernel $kernel */
$kernel = $app->make('Illuminate\\Contracts\\Http\\Kernel');
$kernel->init($request = Illuminate\Http\Request::capture());
Beispiel #11
0
function laravelauth()
{
    global $app;
    $kernel = $app->make('Illuminate\\Contracts\\Http\\Kernel');
    $response = $kernel->handle($request = Illuminate\Http\Request::capture());
    $id = isset($_COOKIE[$app['config']['session.cookie']]) ? $app['encrypter']->decrypt($_COOKIE[$app['config']['session.cookie']]) : '';
    $app['session']->driver()->setId($id);
    $app['session']->driver()->start();
    if (!$app['auth']->check()) {
        return ["is_loggedin" => false];
    }
    $salida = $app['auth']->user()->toArray();
    $salida["is_loggedin"] = true;
    return $salida;
}
Beispiel #12
0
| Register routes for the application which have been defined within the
| routes.php file in the app directory.
|
*/
require __DIR__ . '/../app/routes.php';
/*
|--------------------------------------------------------------------------
| Register and resolve middleware
|--------------------------------------------------------------------------
*/
$stack = $application->middleware(require __DIR__ . '/../app/config/middleware.php');
$application = $stack->resolve($application);
/*
|--------------------------------------------------------------------------
| Handle the request into the framework
|--------------------------------------------------------------------------
|
| Handle the request entering the framework, capturing the request and
| passing this into the handle method will return us a response.
|
*/
$response = $application->handle($request = Illuminate\Http\Request::capture());
/*
|--------------------------------------------------------------------------
| Send the response back to the client
|--------------------------------------------------------------------------
|
| Now we have a response object, send this back to the client.
|
*/
$response->send();
Beispiel #13
0
<?php

/**
 * Load laravel framework with http kernel, decrypted cookies and sessions
 */
require __DIR__ . '/../../../../bootstrap/autoload.php';
$app = (require __DIR__ . '/../../../../bootstrap/app.php');
$app->instance('request', Illuminate\Http\Request::capture());
$app->make(Illuminate\Contracts\Http\Kernel::class)->bootstrap();
/** @var \Symfony\Component\HttpFoundation\ParameterBag $requestCookies */
$requestCookies = $app->make('request')->cookies;
foreach ($requestCookies->all() as $key => $cookie) {
    try {
        $cookie = $app->make('encrypter')->decrypt($cookie);
    } catch (\Illuminate\Contracts\Encryption\DecryptException $e) {
        $cookie = null;
    }
    $requestCookies->set($key, $cookie);
}
/** @var Illuminate\Session\SessionInterface $session */
$session = $app->make('session')->driver();
$session->setId($requestCookies->get($app->make('config')->get('session.cookie')));
$session->start();
Beispiel #14
0
<?php

/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| First we need to get an application instance. This creates an instance
| of the application / container and bootstraps the application so it
| is ready to receive HTTP / Console requests from the environment.
|
*/
use Illuminate\Support\Facades\Request;
$app = (require __DIR__ . '/../bootstrap/app.php');
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$app->run(Illuminate\Http\Request::capture());