-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.php
86 lines (72 loc) · 2.73 KB
/
install.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
<?php declare(strict_types = 1);
require __DIR__ . '/vendor/autoload.php';
error_reporting(error_reporting() & ~E_NOTICE);
use GoetasWebservices\SoapServices\SoapClient\Command\Generate;
use GoetasWebservices\Xsd\XsdToPhp\Command\Convert;
use GoetasWebservices\Xsd\XsdToPhp\DependencyInjection\Xsd2PhpExtension;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Logger\ConsoleLogger;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\DependencyInjection\ContainerBuilder;
function deleteFilesInDir($path_to_dir): void
{
if (!is_dir($path_to_dir)) {
return;
}
$tree_files = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator(
$path_to_dir,
FilesystemIterator::SKIP_DOTS
),
RecursiveIteratorIterator::CHILD_FIRST
);
foreach ($tree_files as $file) {
if ($file->isFile()) {
unlink($file->getPathname());
}
if ($file->isDir()) {
rmdir($file->getPathname());
}
}
clearstatcache(true, $path_to_dir);
}
deleteFilesInDir('src/Schema');
deleteFilesInDir('resources/jms');
//shell_exec('vendor/bin/xsd2php convert config/xsd.yml resources/schema/*.xsd');
$input = new ArrayInput([
'command' => 'convert',
'config' => 'config/xsd.yml',
'src' => glob('resources/schema/*.xsd'),
]);
$output = new ConsoleOutput();
$container = new ContainerBuilder();
$container->registerExtension(new Xsd2PhpExtension());
$container->set('logger', new ConsoleLogger($output));
$cli = new Application('Convert XSD to PHP classes Command Line Interface', '2.0');
$cli->setAutoExit(false);
$cli->setCatchExceptions(true);
$cli->add(new Convert($container));
$cli->run($input, $output);
//shell_exec('vendor/bin/soap-server generate config/server.yml --dest-class=Schema/Server/SoapContainer src/Schema/Server');
$input = new ArrayInput([
'command' => 'generate',
'config' => 'config/server.yml',
'dest-dir' => 'src/Schema/Server',
]);
$cli = new Application('Convert WSDL definitions to PHP classes Command Line Interface', '1.0');
$cli->setAutoExit(false);
$cli->setCatchExceptions(true);
$cli->add(new \GoetasWebservices\SoapServices\SoapServer\Command\Generate());
$cli->run($input);
//shell_exec('vendor/bin/soap-client generate config/client.yml --dest-class=Schema/Client/SoapContainer src/Schema/Client');
$input = new ArrayInput([
'command' => 'generate',
'config' => 'config/client.yml',
'dest-dir' => 'src/Schema/Client',
]);
$cli = new Application('Convert WSDL definitions to PHP classes Command Line Interface', '1.0');
$cli->setAutoExit(false);
$cli->setCatchExceptions(true);
$cli->add(new Generate());
$cli->run($input);