/** * Get the system migrations folder * * @return string */ protected function getBaseMigrationsPath() { $path = 'database' . DIRECTORY_SEPARATOR . 'migrations'; if (isLaravel5()) { return base_path($path); } return app_path($path); }
/** * Create a base migration file for the reminders. * * @param $name * @return string */ protected function createBaseMigration($name) { if (isLaravel5()) { $path = base_path() . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . 'migrations'; } else { $path = $this->laravel['path'] . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR . 'migrations'; } return $this->laravel['migration.creator']->create($name, $path); }
/** * Register the breadcrumb object instance e.g * * @return void */ private function registerBreadCrumb() { if (isLaravel5()) { // Place module in IoC container $this->app->bindShared('breadcrumb', function ($app) { $breadcrumb = $this->app->make('Ooglee\\Infrastructure\\BreadCrumb\\Manager'); $breadcrumb->setView($this->getConfig('config.breadcrumb_view.view')); var_dump($this->getConfig('config.breadcrumb_view.view')); return $breadcrumb; }); } }
/** * Execute the command. * * @return void */ public function fire() { foreach ($this->tables as $table) { $fullPath = $this->createBaseMigration($table); file_put_contents($fullPath, $this->getMigrationStub($table)); $this->info("Migration {$table} created successfully!"); } if (isLaravel5()) { $this->call('optimize'); } else { $this->call('dump-autoload'); } }
private function registerErrorHandler() { if ($this->getConfig('log_exceptions')) { if (isLaravel5()) { $illuminateHandler = 'Illuminate\\Contracts\\Debug\\ExceptionHandler'; $handler = new TrackerExceptionHandler($this->getTracker(), $this->app[$illuminateHandler]); // Replace original Illuminate Exception Handler by Tracker's $this->app[$illuminateHandler] = $handler; } else { $me = $this; $this->app->error(function (\Exception $exception, $code) use($me) { $me->app['tracker']->handleException($exception, $code); }); } } }
private function loadViews() { if (isLaravel5()) { if (file_exists($viewsFolder = $this->getRootDirectory() . DIRECTORY_SEPARATOR . 'views')) { $this->loadViewsFrom($viewsFolder, "{$this->packageVendor}/{$this->packageName}"); } } else { $this->app->make('view')->addNamespace($this->packageNamespace, $this->getRootDirectory() . '/views'); } }
/** * Get a configuration value * * @param string $key * @return mixed */ public function getConfig($key = null) { if (isLaravel5()) { $configNameSpace = 'vendor.' . $this->packageVendor . '.' . $this->packageName . '.'; //question ? result if true :(result is false) $key = $configNameSpace . ($key ? '.' . $key : ''); return $this->app['config']->get($key); } }