-
-
Notifications
You must be signed in to change notification settings - Fork 529
/
Copy pathtransport.core.php
588 lines (529 loc) · 19.2 KB
/
transport.core.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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
<?php
/**
* Builds the MODX core transport package.
*
* @package modx
* @subpackage build
*/
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$tstart = $mtime;
unset($mtime);
/* get rid of time limit */
set_time_limit(0);
error_reporting(E_ALL | E_STRICT); ini_set('display_errors',true);
/* buildImage can be defined for running against a specific build image
wc default means it is run against working copy */
$buildImage = 'wc';
if (!empty($argv) && $argc > 1) {
$buildImage = $argv[1];
}
/* if buildImage is other than wc or blank, try to load a config file for
distributions that uses the buildImage variable (see build.distrib.config.sample.php) */
$buildConfig = empty($buildImage) || $buildImage === 'wc'
? (dirname(__FILE__) . '/build.config.php')
: (dirname(__FILE__) . '/build.distrib.config.php');
if (!empty($argv) && $argc > 2) {
$buildConfig = realpath($argv[2]);
}
/* override with your own defines here (see build.config.sample.php) */
$included = false;
if (file_exists($buildConfig)) {
$included = @include $buildConfig;
}
if (!$included)
die($buildConfig . ' was not found. Please make sure you have created one using the template of build.config.sample.php.');
unset($included);
if (!defined('MODX_CORE_PATH'))
define('MODX_CORE_PATH', dirname(__DIR__) . '/core/');
require_once MODX_CORE_PATH . 'xpdo/xpdo.class.php';
/* define the MODX path constants necessary for core installation */
if (!defined('MODX_BASE_PATH'))
define('MODX_BASE_PATH', dirname(MODX_CORE_PATH) . '/');
if (!defined('MODX_MANAGER_PATH'))
define('MODX_MANAGER_PATH', MODX_BASE_PATH . 'manager/');
if (!defined('MODX_CONNECTORS_PATH'))
define('MODX_CONNECTORS_PATH', MODX_BASE_PATH . 'connectors/');
if (!defined('MODX_ASSETS_PATH'))
define('MODX_ASSETS_PATH', MODX_BASE_PATH . 'assets/');
/* define the connection variables */
if (!defined('XPDO_DSN'))
define('XPDO_DSN', 'mysql:host=localhost;dbname=modx;charset=utf8');
if (!defined('XPDO_DB_USER'))
define('XPDO_DB_USER', 'root');
if (!defined('XPDO_DB_PASS'))
define('XPDO_DB_PASS', '');
if (!defined('XPDO_TABLE_PREFIX'))
define('XPDO_TABLE_PREFIX', 'modx_');
/* define the actual _build location for including build assets */
if (!defined('MODX_BUILD_DIR'))
define('MODX_BUILD_DIR', MODX_BASE_PATH . '_build/');
/* get properties */
$properties = array();
$f = dirname(__FILE__) . '/build.properties.php';
$included = false;
if (file_exists($f)) {
$included = @include $f;
}
if (!$included)
die('build.properties.php was not found. Please make sure you have created one using the template of build.properties.sample.php.');
unset($f, $included);
/* instantiate xpdo instance */
$xpdo = new xPDO(XPDO_DSN, XPDO_DB_USER, XPDO_DB_PASS,
array (
xPDO::OPT_TABLE_PREFIX => XPDO_TABLE_PREFIX,
xPDO::OPT_CACHE_PATH => MODX_CORE_PATH . 'cache/',
),
array (
PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING,
)
);
$cacheManager= $xpdo->getCacheManager();
$xpdo->setLogLevel(xPDO::LOG_LEVEL_INFO);
$xpdo->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
$xpdo->loadClass('transport.xPDOTransport', XPDO_CORE_PATH, true, true);
$packageDirectory = MODX_CORE_PATH . 'packages/';
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Beginning build script processes...'); flush();
/* remove pre-existing package files and directory */
if (file_exists($packageDirectory . 'core.transport.zip')) {
@unlink($packageDirectory . 'core.transport.zip');
}
if (file_exists($packageDirectory . 'core') && is_dir($packageDirectory . 'core')) {
$cacheManager->deleteTree($packageDirectory . 'core',array(
'deleteTop' => true,
'skipDirs' => false,
'extensions' => array(),
));
}
if (!file_exists($packageDirectory . 'core') && !file_exists($packageDirectory . 'core.transport.zip')) {
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Removed pre-existing core/ and core.transport.zip.'); flush();
} else {
$xpdo->log(xPDO::LOG_LEVEL_ERROR,'Could not remove core/ and core.transport.zip before starting build.'); flush();
}
/* create core transport package */
$package = new xPDOTransport($xpdo, 'core', $packageDirectory);
unset($packageDirectory);
$xpdo->setPackage('modx', MODX_CORE_PATH . 'model/');
$xpdo->loadClass('modAccess');
$xpdo->loadClass('modAccessibleObject');
$xpdo->loadClass('modAccessibleSimpleObject');
$xpdo->loadClass('modPrincipal');
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Core transport package created.'); flush();
/* core namespace */
$namespace = $xpdo->newObject('modNamespace');
$namespace->set('name','core');
$namespace->set('path','{core_path}');
$namespace->set('assets_path','{assets_path}');
$package->put($namespace,array(
xPDOTransport::PRESERVE_KEYS => true,
xPDOTransport::UPDATE_OBJECT => true,
));
unset($namespace);
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Core Namespace packaged.'); flush();
/* modWorkspace */
$collection = array ();
$collection['1'] = $xpdo->newObject('modWorkspace');
$collection['1']->fromArray(array (
'id' => 1,
'name' => 'Default MODX workspace',
'path' => '{core_path}',
'active' => 1,
), '', true, true);
$attributes = array (
xPDOTransport::PRESERVE_KEYS => true,
xPDOTransport::UPDATE_OBJECT => false,
);
foreach ($collection as $c) {
$package->put($c, $attributes);
}
unset ($collection, $c, $attributes);
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Default workspace packaged.'); flush();
/* modx.com extras provisioner */
$collection = array ();
$collection['1'] = $xpdo->newObject('transport.modTransportProvider');
$collection['1']->fromArray(array (
'id' => 1,
'name' => 'modx.com',
'description' => 'The official MODX transport provider for 3rd party components.',
'service_url' => 'https://rest.modx.com/extras/',
'created' => strftime('%Y-%m-%d %H:%M:%S'),
), '', true, true);
$attributes = array (
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::UNIQUE_KEY => array ('name'),
);
foreach ($collection as $c) {
$package->put($c, $attributes);
}
unset ($collection, $c, $attributes);
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Packaged modx.com transport provider.'); flush();
/* modMenu */
$collection = include MODX_BUILD_DIR . 'data/transport.core.menus.php';
if (!empty($collection)) {
$attributes = array (
xPDOTransport::PRESERVE_KEYS => true,
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::UNIQUE_KEY => 'text',
xPDOTransport::RELATED_OBJECTS => true,
xPDOTransport::RELATED_OBJECT_ATTRIBUTES => array(
'Children' => array(
xPDOTransport::PRESERVE_KEYS => true,
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::UNIQUE_KEY => 'text',
),
),
);
foreach ($collection as $c) {
$package->put($c, $attributes);
}
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Packaged in '.count($collection).' modMenus.'); flush();
unset ($collection, $c, $attributes);
} else {
$xpdo->log(xPDO::LOG_LEVEL_ERROR,'Could not load modMenus.'); flush();
}
/* modContentTypes */
$collection = array ();
include MODX_BUILD_DIR . 'data/transport.core.content_types.php';
$attributes = array (
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UPDATE_OBJECT => false,
xPDOTransport::UNIQUE_KEY => 'mime_type',
);
foreach ($collection as $c) {
$package->put($c, $attributes);
}
unset ($collection, $c, $attributes);
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Packaged all default modContentTypes.'); flush();
/* modClassMap */
$collection = array ();
include MODX_BUILD_DIR . 'data/transport.core.classmap.php';
$attributes = array (
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UPDATE_OBJECT => false,
xPDOTransport::UNIQUE_KEY => 'class',
);
foreach ($collection as $c) {
$package->put($c, $attributes);
}
unset ($collection, $c, $attributes);
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Packaged all default modClassMap objects.'); flush();
/* modEvent collection */
$events = include MODX_BUILD_DIR . 'data/transport.core.events.php';
if (is_array($events) && !empty($events)) {
$attributes = array (
xPDOTransport::PRESERVE_KEYS => true,
xPDOTransport::UPDATE_OBJECT => true,
);
foreach ($events as $evt) {
$package->put($evt, $attributes);
}
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Packaged in '.count($events).' default events.'); flush();
} else {
$xpdo->log(xPDO::LOG_LEVEL_FATAL,'Could not find default events!'); flush();
}
unset ($events, $evt, $attributes);
/* modSystemSetting collection */
$settings = include MODX_BUILD_DIR . 'data/transport.core.system_settings.php';
if (!is_array($settings) || empty($settings)) { $xpdo->log(xPDO::LOG_LEVEL_FATAL,'Could not package in settings!'); flush(); }
$attributes= array (
xPDOTransport::PRESERVE_KEYS => true,
xPDOTransport::UPDATE_OBJECT => false,
);
foreach ($settings as $setting) {
$package->put($setting, $attributes);
}
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Packaged in '.count($settings).' default system settings.'); flush();
unset ($settings, $setting, $attributes);
/* modContextSetting collection */
$collection = array ();
include MODX_BUILD_DIR . 'data/transport.core.context_settings.php';
$attributes= array(
xPDOTransport::PRESERVE_KEYS => true,
xPDOTransport::UPDATE_OBJECT => false,
xPDOTransport::UNIQUE_KEY => array('context_key', 'key')
);
foreach ($collection as $c) {
$package->put($c, $attributes);
}
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Packaged in '.count($collection).' default context settings.'); flush();
unset ($collection, $c, $attributes);
/* modUserGroup */
$collection = array ();
include MODX_BUILD_DIR . 'data/transport.core.usergroups.php';
$attributes = array (
xPDOTransport::PRESERVE_KEYS => true,
xPDOTransport::UPDATE_OBJECT => false,
);
foreach ($collection as $c) {
$package->put($c, $attributes);
}
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Packaged in '.count($collection).' default user groups.'); flush();
unset ($collection, $c, $attributes);
/* modDashboard */
$collection = array ();
include MODX_BUILD_DIR . 'data/transport.core.dashboards.php';
$attributes = array (
xPDOTransport::PRESERVE_KEYS => true,
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::UNIQUE_KEY => array ('id'),
);
foreach ($collection as $c) {
$package->put($c, $attributes);
}
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Packaged in '.count($collection).' default dashboards.'); flush();
unset ($collection, $c, $attributes);
/* modMediaSource */
$collection = array ();
include MODX_BUILD_DIR . 'data/transport.core.media_sources.php';
$attributes = array (
xPDOTransport::PRESERVE_KEYS => true,
xPDOTransport::UPDATE_OBJECT => false,
xPDOTransport::UNIQUE_KEY => array ('id'),
);
foreach ($collection as $c) {
$package->put($c, $attributes);
}
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Packaged in '.count($collection).' default media sources.'); flush();
unset ($collection, $c, $attributes);
/* modDashboardWidget */
$widgets = include MODX_BUILD_DIR . 'data/transport.core.dashboard_widgets.php';
if (is_array($widgets)) {
$attributes = array (
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::UNIQUE_KEY => array ('name'),
);
$ct = count($widgets);
$idx = 0;
foreach ($widgets as $widget) {
$idx++;
if ($idx == $ct) {
$attributes['resolve'][] = array (
'type' => 'php',
'source' => MODX_BUILD_DIR . 'resolvers/resolve.dashboardwidgets.php',
);
}
$package->put($widget, $attributes);
}
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Packaged in '.count($widgets).' default dashboard widgets.'); flush();
} else {
$xpdo->log(xPDO::LOG_LEVEL_ERROR,'Could not load dashboard widgets!'); flush();
}
unset ($widgets,$widget,$attributes,$ct,$idx);
/* modUserGroupRole */
$collection = array ();
include MODX_BUILD_DIR . 'data/transport.core.usergrouproles.php';
$attributes = array (
xPDOTransport::PRESERVE_KEYS => true,
xPDOTransport::UPDATE_OBJECT => false,
);
foreach ($collection as $c) {
$package->put($c, $attributes);
}
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Packaged in '.count($collection).' default roles Member and SuperUser.'); flush();
unset ($collection, $c, $attributes);
/* modAccessPolicyTemplateGroups */
$templateGroups = include MODX_BUILD_DIR . 'data/transport.core.accesspolicytemplategroups.php';
$attributes = array (
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UNIQUE_KEY => array('name'),
xPDOTransport::UPDATE_OBJECT => true,
);
if (is_array($templateGroups)) {
foreach ($templateGroups as $templateGroup) {
$package->put($templateGroup, $attributes);
}
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Packaged in '.count($templateGroups).' default Access Policy Template Groups.'); flush();
} else {
$xpdo->log(xPDO::LOG_LEVEL_ERROR,'Could not package in Access Policy Template Groups.');
}
unset ($templateGroups, $templateGroup, $attributes);
/* modAccessPolicyTemplate */
$templates = include MODX_BUILD_DIR . 'data/transport.core.accesspolicytemplates.php';
$attributes = array (
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UNIQUE_KEY => array('name'),
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::RELATED_OBJECTS => true,
xPDOTransport::RELATED_OBJECT_ATTRIBUTES => array (
'Permissions' => array (
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::UNIQUE_KEY => array ('template','name'),
),
)
);
if (is_array($templates)) {
$ct = count($templates);
$idx = 0;
foreach ($templates as $template) {
$idx++;
if ($idx == $ct) {
$attributes['resolve'][] = array (
'type' => 'php',
'source' => MODX_BUILD_DIR . 'resolvers/resolve.policytemplates.php',
);
}
$package->put($template, $attributes);
}
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Packaged in '.count($templates).' default Access Policy Templates.'); flush();
} else {
$xpdo->log(xPDO::LOG_LEVEL_ERROR,'Could not package in Access Policy Templates.');
}
unset ($templates,$template,$idx,$ct,$attributes);
/* modAccessPolicy */
$policies = include MODX_BUILD_DIR . 'data/transport.core.accesspolicies.php';
$attributes = array (
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UNIQUE_KEY => array('name'),
xPDOTransport::UPDATE_OBJECT => true,
);
if (is_array($policies)) {
$ct = count($policies);
$idx = 0;
foreach ($policies as $policy) {
$idx++;
if ($idx == $ct) {
$attributes['resolve'][] = array (
'type' => 'php',
'source' => MODX_BUILD_DIR . 'resolvers/resolve.policies.php',
);
}
$package->put($policy, $attributes);
}
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Packaged in '.count($policies).' default Access Policies.'); flush();
} else {
$xpdo->log(xPDO::LOG_LEVEL_ERROR,'Could not package in Access Policies.');
}
unset ($policies,$policy,$idx,$ct,$attributes);
/* modContext = web */
$c = $xpdo->newObject('modContext');
$c->fromArray(array (
'key' => 'web',
'name' => 'Website',
'description' => 'The default front-end context for your web site.',
), '', true, true);
$attributes = array (
xPDOTransport::PRESERVE_KEYS => true,
xPDOTransport::UPDATE_OBJECT => false
);
$attributes['resolve'][] = array (
'type' => 'file',
'source' => MODX_BASE_PATH . 'index.php',
'target' => "return MODX_BASE_PATH;",
);
$attributes['resolve'][] = array (
'type' => 'file',
'source' => MODX_BASE_PATH . 'ht.access',
'target' => "return MODX_BASE_PATH;",
);
$attributes['resolve'][] = array (
'type' => 'php',
'source' => MODX_BUILD_DIR . 'resolvers/resolve.core.php',
'target' => "return MODX_BASE_PATH . 'config.core.php';",
);
$package->put($c, $attributes);
unset ($c, $attributes);
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Packaged in web context.'); flush();
/* modContext = mgr */
$c = $xpdo->newObject('modContext');
$c->fromArray(array (
'key' => 'mgr',
'name' => 'Manager',
'description' => 'The default manager or administration context for content management activity.',
), '', true, true);
$attributes = array (
xPDOTransport::PRESERVE_KEYS => true,
xPDOTransport::UPDATE_OBJECT => false
);
$attributes['resolve'][] = array (
'type' => 'file',
'source' => MODX_BASE_PATH . 'manager/assets',
'target' => "return MODX_MANAGER_PATH;",
);
$attributes['resolve'][] = array (
'type' => 'file',
'source' => MODX_BASE_PATH . 'manager/controllers',
'target' => "return MODX_MANAGER_PATH;",
);
$attributes['resolve'][] = array (
'type' => 'file',
'source' => MODX_BASE_PATH . 'manager/templates',
'target' => "return MODX_MANAGER_PATH;",
);
$attributes['resolve'][] = array (
'type' => 'file',
'source' => MODX_BASE_PATH . 'manager/min',
'target' => "return MODX_MANAGER_PATH;",
);
$attributes['resolve'][] = array (
'type' => 'file',
'source' => MODX_BASE_PATH . 'manager/ht.access',
'target' => "return MODX_MANAGER_PATH;",
);
$attributes['resolve'][] = array (
'type' => 'file',
'source' => MODX_BASE_PATH . 'manager/index.php',
'target' => "return MODX_MANAGER_PATH;",
);
$attributes['resolve'][] = array (
'type' => 'php',
'source' => MODX_BUILD_DIR . 'resolvers/resolve.core.php',
'target' => "return MODX_MANAGER_PATH . 'config.core.php';",
);
$package->put($c, $attributes);
unset ($c, $attributes);
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Packaged in mgr context.'); flush();
/* connector file transport */
$attributes = array (
'vehicle_class' => 'xPDOFileVehicle',
);
$files[] = array (
'source' => MODX_BASE_PATH . 'connectors/system',
'target' => "return MODX_CONNECTORS_PATH;",
);
$files[] = array (
'source' => MODX_BASE_PATH . 'connectors/lang.js.php',
'target' => "return MODX_CONNECTORS_PATH;",
);
$files[] = array (
'source' => MODX_BASE_PATH . 'connectors/modx.config.js.php',
'target' => "return MODX_CONNECTORS_PATH;",
);
foreach ($files as $fileset) {
$package->put($fileset, $attributes);
}
unset ($files, $fileset);
$fileset = array (
'source' => MODX_BASE_PATH . 'connectors/index.php',
'target' => "return MODX_CONNECTORS_PATH;",
);
$attributes['resolve'][] = array (
'type' => 'php',
'source' => MODX_BUILD_DIR . 'resolvers/resolve.core.php',
'target' => "return MODX_CONNECTORS_PATH . 'config.core.php';",
);
$attributes['resolve'][] = array (
'type' => 'php',
'source' => MODX_BUILD_DIR . 'resolvers/resolve.actionfields.php',
);
$package->put($fileset, $attributes);
unset ($fileset, $attributes);
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Packaged in connectors.'); flush();
/* zip up package */
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Beginning to zip up transport package...'); flush();
if ($package->pack()) {
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Transport zip created. Build script finished.'); flush();
} else {
$xpdo->log(xPDO::LOG_LEVEL_INFO,'Error creating transport zip!'); flush();
}
$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$tend = $mtime;
$totalTime = ($tend - $tstart);
$totalTime = sprintf("%2.4f s", $totalTime);
echo "\nExecution time: {$totalTime}\n"; flush();
exit ();