forked from swoft-cloud/swoft-devtool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphar.build.inc
39 lines (35 loc) · 853 Bytes
/
phar.build.inc
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
<?php declare(strict_types=1);
/**
* Created by PhpStorm.
* - the is a config file for compile phar package.
* User: Inhere
* Date: 2018/1/26 0026
* Time: 22:11
* @var \Swoft\Devtool\PharCompiler $compiler
*/
// config
$compiler
->stripComments(true)
->setShebang(true)
->addExclude([
'test',
])
->addFile([
'LICENSE',
'composer.json',
'README.md',
'tests/bootstrap.php',
])
->setCliIndex('bin/devtool')
// ->setWebIndex('web/index.php')
// ->setVersionFile('config/config.php')
;
// Console 下的 Command Controller 命令类不去除注释,注释上是命令帮助信息
$compiler->setStripFilter(function ($file) {
/** @var \SplFileInfo $file */
$path = $file->getPath();
if (strpos($path, 'swoft')) {
return false;
}
return false === strpos($file->getFilename(), 'Command.php');
});