當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Application::basePath方法代碼示例

本文整理匯總了PHP中Illuminate\Contracts\Foundation\Application::basePath方法的典型用法代碼示例。如果您正苦於以下問題:PHP Application::basePath方法的具體用法?PHP Application::basePath怎麽用?PHP Application::basePath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Contracts\Foundation\Application的用法示例。


在下文中一共展示了Application::basePath方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: loadViewsFrom

 /**
  * Register a view file namespace.
  *
  * @param  string  $path
  * @param  string  $namespace
  * @return void
  */
 protected function loadViewsFrom($path, $namespace)
 {
     if (is_dir($appPath = $this->app->basePath() . '/resources/views/vendor/' . $namespace)) {
         $this->app['view']->addNamespace($namespace, $appPath);
     }
     $this->app['view']->addNamespace($namespace, $path);
 }
開發者ID:qasem2rubik,項目名稱:laravel,代碼行數:14,代碼來源:ServiceProvider.php

示例2: loadFactories

 /**
  * Load factories for active modules
  *
  * @param $factory
  */
 public function loadFactories($factory)
 {
     $this->withFactories()->each(function ($module) use($factory) {
         /* @var Module $module */
         $this->loadFactoryFile($this->app->basePath() . DIRECTORY_SEPARATOR . $module->factoryFilePath(), $factory);
     });
 }
開發者ID:mnabialek,項目名稱:laravel-simple-modules,代碼行數:12,代碼來源:Modular.php

示例3: path

 /**
  * @param string $name
  *
  * @return string
  */
 public function path($name = null)
 {
     if ($name !== null) {
         return $this->path() . '/' . $name;
     } else {
         return $this->app->basePath() . '/' . $this->app['config']->get('addon.path', 'addons');
     }
 }
開發者ID:jumilla,項目名稱:laravel-addomnipot,代碼行數:13,代碼來源:Environment.php

示例4: setNamespace

 /**
  * @throws \RuntimeException
  */
 private function setNamespace()
 {
     $composer = json_decode(file_get_contents($this->laravel->basePath() . '/composer.json'), true);
     foreach ((array) data_get($composer, 'autoload.psr-4') as $namespace => $path) {
         foreach ((array) $path as $pathChoice) {
             if (realpath($this->laravel->basePath() . DIRECTORY_SEPARATOR . 'app') == realpath($this->laravel->basePath() . '/' . $pathChoice)) {
                 return $this->namespace = $namespace . $this->name;
             }
         }
     }
     throw new RuntimeException('Unable to detect application namespace.');
 }
開發者ID:dev-ratna,項目名稱:laravel-modules,代碼行數:15,代碼來源:Module.php

示例5: bootstrap

 /**
  * Bootstrap the given application.
  *
  * @param  \Illuminate\Contracts\Foundation\Application  $app
  * @return void
  */
 public function bootstrap(Application $app)
 {
     try {
         Dotenv::load($app->basePath(), $app->environmentFile());
     } catch (InvalidArgumentException $e) {
         //
     }
     $app->detectEnvironment(function () {
         return env('APP_ENV', 'production');
     });
 }
開發者ID:mubassirhayat,項目名稱:Laravel51-starter,代碼行數:17,代碼來源:DetectEnvironment.php

示例6: index

 /**
  * index.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  * @param \Recca0120\Terminal\Kernel                   $kernel
  * @param \Illuminate\Http\Request                     $request
  * @param \Illuminate\Contracts\Response\Factory       $responseFactory
  * @param \Illuminate\Contracts\Routing\UrlGenerator   $urlGenerator
  * @param string                                       $view
  *
  * @return mixed
  */
 public function index(Application $app, Kernel $kernel, Request $request, ResponseFactory $responseFactory, UrlGenerator $urlGenerator, $view = 'index')
 {
     $kernel->call('--ansi');
     $csrfToken = null;
     if ($request->hasSession() === true) {
         $csrfToken = $request->session()->token();
     }
     $options = json_encode(['csrfToken' => $csrfToken, 'username' => 'LARAVEL', 'hostname' => php_uname('n'), 'os' => PHP_OS, 'basePath' => $app->basePath(), 'environment' => $app->environment(), 'version' => $app->version(), 'endpoint' => $urlGenerator->action('\\' . static::class . '@endpoint'), 'helpInfo' => $kernel->output(), 'interpreters' => ['mysql' => 'mysql', 'artisan tinker' => 'tinker', 'tinker' => 'tinker'], 'confirmToProceed' => ['artisan' => ['migrate', 'migrate:install', 'migrate:refresh', 'migrate:reset', 'migrate:rollback', 'db:seed']]]);
     $id = $view === 'panel' ? Str::random(30) : null;
     return $responseFactory->view('terminal::' . $view, compact('options', 'resources', 'id'));
 }
開發者ID:recca0120,項目名稱:terminal,代碼行數:23,代碼來源:TerminalController.php

示例7: __construct

 /**
  * Create a new console kernel instance.
  *
  * @param  \Illuminate\Contracts\Foundation\Application $app
  * @param  \Illuminate\Contracts\Events\Dispatcher $events
  *
  * @return void
  */
 public function __construct(Application $app, Dispatcher $events)
 {
     // Used in `functions.php` so that we know we can stop from launching
     // the whole theme when in `Console-Mode`, because our goal is to use
     // some of the functions of WordPress.
     if (!defined('ARTISAN_BINARY')) {
         define('ARTISAN_BINARY', 'artisan');
     }
     // Load WordPress so we can use those functions WordPress supplies for us.
     if (!defined('WP_USE_THEMES')) {
         define('WP_USE_THEMES', false);
     }
     $wp_load = realpath($app->basePath() . '/../../../wp-load.php');
     if (file_exists($wp_load)) {
         require_once $wp_load;
     }
     parent::__construct($app, $events);
 }
開發者ID:laraish,項目名稱:framework,代碼行數:26,代碼來源:Kernel.php

示例8: bootstrap

 /**
  * Register The October Auto Loader
  *
  * @param  \Illuminate\Contracts\Foundation\Application  $app
  * @return void
  */
 public function bootstrap(Application $app)
 {
     ClassLoader::register();
     ClassLoader::addDirectories([$app->basePath() . '/modules', $app->basePath() . '/plugins']);
 }
開發者ID:brenodouglas,項目名稱:library,代碼行數:11,代碼來源:RegisterClassLoader.php

示例9: publishAssets

 protected function publishAssets()
 {
     $this->filesystem->copyDirectory($this->application->basePath() . '/vendor/components/font-awesome/fonts', $this->application->publicPath() . '/assets/fonts');
 }
開發者ID:Luceos,項目名稱:core,代碼行數:4,代碼來源:InstallCommand.php

示例10: relativePath

 /**
  * get relative path.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  *
  * @return string
  */
 public function relativePath(Application $app)
 {
     return substr($this->path, strlen($app->basePath()) + 1);
 }
開發者ID:jumilla,項目名稱:laravel-addomnipot,代碼行數:11,代碼來源:Addon.php

示例11: publishAssets

 protected function publishAssets()
 {
     $this->filesystem->copyDirectory(__DIR__ . '/../../../assets', $this->application->basePath() . '/assets');
 }
開發者ID:johnulist,項目名稱:core,代碼行數:4,代碼來源:InstallCommand.php

示例12: let

 function let(Application $laravel)
 {
     $laravel->basePath()->willReturn(__DIR__ . DIRECTORY_SEPARATOR . 'stubs');
     $this->beConstructedWith($laravel);
 }
開發者ID:dev-ratna,項目名稱:laravel-modules,代碼行數:5,代碼來源:ModuleSpec.php

示例13: __construct

 /**
  * Construct a new documentation processor.
  *
  * @param  \Illuminate\Contracts\Foundation\Application  $app
  * @param  \Illuminate\Contracts\Config\Repository  $config
  * @param  \App\Documentation\FileLoader  $loader
  */
 public function __construct(Application $app, Config $config, FileLoader $loader)
 {
     $this->basePath = $app->basePath();
     $this->config = $config;
     $this->loader = $loader;
 }
開發者ID:stevebauman,項目名稱:orchestraplatform.com,代碼行數:13,代碼來源:Viewer.php

示例14: getPluginsDir

 /**
  * The plugins path.
  *
  * @return string
  */
 protected function getPluginsDir()
 {
     return $this->app->basePath() . '/plugins';
 }
開發者ID:printempw,項目名稱:blessing-skin-server,代碼行數:9,代碼來源:PluginManager.php


注:本文中的Illuminate\Contracts\Foundation\Application::basePath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。