Completed
Push — master ( 8c3306...57acb7 )
by Martijn van
02:51
created

PublishSuperSakeCommmand::fire()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
4
class PublishSuperSakeCommmand extends SilverstripeCommand
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
5
{
6
    /**
7
     * @var string
8
     */
9
    protected $name = 'console:publish';
10
11
    /**
12
     * @var string
13
     */
14
    protected $description = 'Copy the supersake to your webroot';
15
16
    public function fire()
17
    {
18
        $this->writeSuperSakeFileToWebRoot();
19
    }
20
21
    protected function writeSuperSakeFileToWebRoot()
22
    {
23
        try {
24
            file_put_contents(
25
                BASE_PATH . '/supersake',
26
                file_get_contents(BASE_PATH . '/console/publish/supersake')
27
            );
28
            $this->info('supersake file copied to webroot');
29
        }catch(Exception $e) {
30
            $this->error($e->getMessage());
31
        }
32
    }
33
}
34