Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Database\Console\Migrations;
4
 
5
use Illuminate\Console\Command;
6
 
7
class BaseCommand extends Command
8
{
9
    /**
10
     * Get all of the migration paths.
11
     *
12
     * @return array
13
     */
14
    protected function getMigrationPaths()
15
    {
16
        // Here, we will check to see if a path option has been defined. If it has we will
17
        // use the path relative to the root of the installation folder so our database
18
        // migrations may be run for any customized path from within the application.
19
        if ($this->input->hasOption('path') && $this->option('path')) {
20
            return collect($this->option('path'))->map(function ($path) {
21
                return ! $this->usingRealPath()
22
                                ? $this->laravel->basePath().'/'.$path
23
                                : $path;
24
            })->all();
25
        }
26
 
27
        return array_merge(
28
            $this->migrator->paths(), [$this->getMigrationPath()]
29
        );
30
    }
31
 
32
    /**
33
     * Determine if the given path(s) are pre-resolved "real" paths.
34
     *
35
     * @return bool
36
     */
37
    protected function usingRealPath()
38
    {
39
        return $this->input->hasOption('realpath') && $this->option('realpath');
40
    }
41
 
42
    /**
43
     * Get the path to the migration directory.
44
     *
45
     * @return string
46
     */
47
    protected function getMigrationPath()
48
    {
49
        return $this->laravel->databasePath().DIRECTORY_SEPARATOR.'migrations';
50
    }
51
}