-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathupdate.package.php
More file actions
114 lines (93 loc) · 2.36 KB
/
update.package.php
File metadata and controls
114 lines (93 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
/*******************************************************************************
*
* @author : Dominik Bonsch <dominik.bonsch@webfrap.net>
* @date :
* @copyright : Webfrap Developer Network <contact@webfrap.net>
* @project : Webfrap Web Frame Application
* @projectUrl : http://webfrap.net
*
* @licence : BSD License see: LICENCE/BSD Licence.txt
*
* @version: @package_version@ Revision: @package_revision@
*
* Changes:
*
*******************************************************************************/
// definieren, dass dies ein Syncscript ist
define( 'GAIA_CONTEXT', 'update' );
// die Basis Logik einbinden
include 'wbf/bootstrap.cli.php';
/* @var $console UiConsole */
$packagePath = Request::arg( 'package' );
$tmp = null;
// wenn ein package name übergeben wurde, wird dieses package installiert
if( $packagePath )
{
if( !Fs::exists( $packagePath ) )
{
$console->error( "Konnte kein Paket unter ".$packagePath.' finden.' );
}
$archive = new ArchiveZip( $packagePath, ArchiveZip::MODE_HUGE );
$tmp = Gaia::mkTmpFolder();
$archive->unpack( $tmp );
$package = new Package( $tmp.'package.bdl' );
if( !$package->isLoaded() )
{
$console->error( 'Konnte die '.$tmp.'package.bdl nicht laden' );
exit(1);
}
$package->setDataPath( $tmp );
}
else
{
$package = new Package( GAIA_PATH.'conf/package.bdl' );
if( !$package->isLoaded() )
{
$console->error( 'Konnte die '.GAIA_PATH.'conf/package.bdl nicht laden' );
exit(1);
}
}
$type = $package->getType();
try
{
switch( $type )
{
case 'patch':
{
$builder = new WbfSetupPatch();
$builder->patch( $package );
break;
}
case 'update':
{
break;
}
case 'application':
{
$builder = new WbfUpdateApplication( $console, $package->getDataPath() );
$builder->update( $package );
break;
}
case 'app':
{
$builder = new WbfUpdateApplication( $console, $package->getDataPath() );
$builder->update( $package );
break;
}
case 'module':
{
break;
}
default:
{
$console->error( "Der pakettype: ".$type." wird von dieser Version nicht unterstützt." );
}
}
}
catch( GaiaException $exc )
{
$console->error( 'Installation wurde abgebrochen '.$exc->getMessage() );
}
// tmp löschen
Fs::del( GAIA_PATH.'tmp' );