• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

php-casbin / think-authz / 15025178114

14 May 2025 03:45PM UTC coverage: 92.667%. Remained the same
15025178114

push

github

web-flow
fix: delete without condition if cache disabled (#52)

1 of 1 new or added line in 1 file covered. (100.0%)

139 of 150 relevant lines covered (92.67%)

48.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/command/Publish.php
1
<?php
2

3
namespace tauthz\command;
4

5
use think\console\{Command, Input, Output};
6

7
/**
8
 * 发布配置文件、迁移文件指令
9
 */
10
class Publish extends Command
11
{
12
    /**
13
     * 配置指令
14
     */
15
    protected function configure()
16
    {
17
        $this->setName('tauthz:publish')->setDescription('Publish Tauthz');
117✔
18
    }
19

20
    /**
21
     * 执行指令
22
     * @param Input  $input
23
     * @param Output $output
24
     * @return null|int
25
     * @throws LogicException
26
     * @see setCode()
27
     */
28
    protected function execute(Input $input, Output $output)
29
    {
30
        $destination = $this->app->getRootPath() . '/database/migrations/';
117✔
31
        if(!is_dir($destination)){
117✔
32
            mkdir($destination, 0755, true);
9✔
33
        }
34
        $source = __DIR__.'/../../database/migrations/';
117✔
35
        $handle = dir($source);
117✔
36
        
37
        while($entry=$handle->read()) {   
117✔
38
            if(($entry!=".")&&($entry!="..")){   
117✔
39
                if(is_file($source.$entry)){
117✔
40
                    copy($source.$entry, $destination.$entry);   
117✔
41
                }
42
            }
43
        }
44

45
        if (!file_exists(config_path().'tauthz-rbac-model.conf')) {
117✔
46
            copy(__DIR__.'/../../config/tauthz-rbac-model.conf', config_path().'tauthz-rbac-model.conf');
9✔
47
        }
48

49
        if (!file_exists(config_path().'tauthz.php')) {
117✔
50
            copy(__DIR__.'/../../config/tauthz.php', config_path().'tauthz.php');
9✔
51
        }
52
    }
53
}
54

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc