Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 1192 | Revision 1194 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 1192 Revision 1193
Zeile 1... Zeile 1...
1
<?php
1
<?php
Zeile 2... Zeile 2...
2
 
2
 
Zeile 3... Zeile 3...
3
    namespace App\Http\Controllers;
3
    namespace App\Http\Controllers;
-
 
4
 
Zeile 4... Zeile 5...
4
 
5
    use Illuminate\Support\Facades\DB;
5
    use Illuminate\Support\Facades\DB;
6
    use Illuminate\View\View;
6
 
7
 
Zeile 7... Zeile 8...
7
    class ToolboxController extends Controller
8
    class ToolboxController extends Controller
8
    {
9
    {
9
        private string $xmlDir;
10
        private string $xmlDir;
10
 
11
 
Zeile 11... Zeile 12...
11
        public function create()
12
        public function create(): View
12
        {
13
        {
13
            return view( "admin/toolbox/index" );
14
            return view( "admin/toolbox/index" );
14
        }
15
        }
15
 
16
 
16
        public function changeShopVersion()
17
        public function changeShopVersion(): View
Zeile 152... Zeile 153...
152
            \View::share( "file", "common/changeShopVersion.tpl" );
153
            \View::share( "file", "common/changeShopVersion.tpl" );
Zeile 153... Zeile 154...
153
 
154
 
154
            return view( "admin/toolbox/changeShopVersion" );
155
            return view( "admin/toolbox/changeShopVersion" );
Zeile 155... Zeile 156...
155
        }
156
        }
156
 
157
 
157
        private function getVersions( $phpVer ): array
-
 
158
        {
158
        private function getVersions(): array
159
            global $site, $site_full;
159
        {
160
            $versions = array();
-
 
161
            $path = "/usr/share/php/webanOS/";
-
 
162
            if ( $phpVer == "php7" )
-
 
163
            {
-
 
164
                $path = "/usr/share/php7/webanOS/";
-
 
165
                if ( $site != $site_full )
-
 
166
                {
-
 
167
                    $path = "/usr/share/php/php7/webanOS/";
-
 
168
                }
160
            $versions = array();
169
            }
161
            $path = "/usr/share/php7/webanOS/";
170
            $cmd = "ls " . $path . "tags/";
162
            $cmd = "ls " . $path . "tags/";
171
            exec( $cmd, $out, $ret );
163
            exec( $cmd, $out, $ret );
172
            $this->xmlDir = "/tmp/" . $site . "/webanos/svn/";
164
            $this->xmlDir = "/tmp/" . $site . "/webanos/svn/";
Zeile 184... Zeile 176...
184
                {
176
                {
185
                    $zeit = str_replace( "-", ":", $zeit );
177
                    $zeit = str_replace( "-", ":", $zeit );
186
                }
178
                }
187
                $datStr = $datum . " " . $zeit;
179
                $datStr = $datum . " " . $zeit;
188
                $name = strftime( "%x %H:%M", strtotime( $datStr ) );
180
                $name = strftime( "%x %H:%M", strtotime( $datStr ) );
189
                $versions[ "tags/" . $phpVer . "_" . $version ] = $name;
181
                $versions[ "tags/php7_" . $version ] = $name;
190
                $xmlFile = $this->xmlDir . $phpVer . "_" . $version . ".xml";
182
                $xmlFile = $this->xmlDir . "php7_" . $version . ".xml";
191
                if ( !file_exists( $xmlFile ) )
183
                if ( !file_exists( $xmlFile ) )
192
                {
184
                {
193
                    $cmd = "svn log --xml --stop-on-copy " . $path . "tags/" . $version . " > " . $xmlFile;
185
                    $cmd = "svn log --xml --stop-on-copy " . $path . "tags/" . $version . " > " . $xmlFile;
194
                    exec( $cmd, $svnOut, $ret );
186
                    exec( $cmd, $svnOut, $ret );
195
                    unset( $svnOut );
187
                    unset( $svnOut );
196
                }
188
                }
197
            }
189
            }
198
            $versions[ $phpVer . "_trunk" ] = "trunk";
190
            $versions[ "php7_trunk" ] = "trunk";
199
            $xmlFile = $this->xmlDir . $phpVer . "_trunk.xml";
191
            $xmlFile = $this->xmlDir . "php7_trunk.xml";
200
            $cmd = "svn log --xml " . $path . "/trunk/ -rCOMMITTED > " . $xmlFile;
192
            $cmd = "svn log --xml " . $path . "/trunk/ -rCOMMITTED > " . $xmlFile;
201
            exec( $cmd, $svnOut, $ret );
193
            exec( $cmd, $svnOut, $ret );
202
            unset( $svnOut );
194
            unset( $svnOut );
203
            return $versions;
195
            return $versions;
204
        }
196
        }