forked from aimeos/aimeos-typo3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
class.ext_update.php
64 lines (52 loc) · 1.17 KB
/
class.ext_update.php
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
<?php
/**
* @license GPLv3, http://www.gnu.org/copyleft/gpl.html
* @copyright Metaways Infosystems GmbH, 2012
* @copyright Aimeos (aimos.org), 2014
* @package TYPO3_Aimeos
*/
$localautoloader = __DIR__ . '/Resources/Libraries/autoload.php';
if( file_exists( $localautoloader ) === true ) {
require_once $localautoloader;
}
/**
* Update class for Aimeos TYPO3 extension.
*
* @package TYPO3_Aimeos
*/
class ext_update
{
/**
* Returns the status if an update is necessary.
*
* @return boolean True if the update entry is available, false if not
*/
public function access()
{
return true;
}
/**
* Main update method called by the extension manager.
*
* @return string Messages
*/
public function main()
{
ob_start();
$exectimeStart = microtime( true );
try
{
\Aimeos\Aimeos\Setup::execute();
$output = ob_get_contents();
}
catch( Exception $e )
{
$output = ob_get_contents();
$output .= PHP_EOL . $e->getMessage();
$output .= PHP_EOL . $e->getTraceAsString();
}
ob_end_clean();
return '<pre>' . $output . '</pre>' . PHP_EOL .
sprintf( "Setup process lasted %1\$f sec</br>\n", (microtime( true ) - $exectimeStart) );
}
}