当前位置: 首页>>代码示例>>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;未经允许,请勿转载。