Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 235 | Revision 237 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
233 lars 1
<?php
2
 
3
namespace App\Console\Commands;
4
 
5
use Illuminate\Console\Command;
236 lars 6
use Illuminate\Support\Facades\DB;
233 lars 7
 
8
class convertDB extends Command
9
{
10
    /**
11
     * The name and signature of the console command.
12
     *
13
     * @var string
14
     */
235 lars 15
    protected $signature = 'command:convertDB';
233 lars 16
 
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
235 lars 22
    protected $description = 'Converts the old webanOS-DB to laravel';
233 lars 23
 
24
    /**
25
     * Execute the console command.
26
     *
27
     * @return int
28
     */
29
    public function handle()
30
    {
234 lars 31
        $sql = '
32
            SELECT
33
                *
34
            FROM
35
                directory
36
            WHERE
37
                father>=-1
38
        ';
39
        $pdo = DB::connection('old')->getPdo();
40
        $res = $pdo->query($sql);
41
        while ($row = $res->fetch_assoc()) {
42
            var_dump($row);
43
        }
233 lars 44
    }
45
}