@@ -105,10 +105,11 @@ discard block |
||
105 | 105 | } |
106 | 106 | |
107 | 107 | public function __get($prop) { |
108 | - if (array_key_exists($prop, $this->_keys)) |
|
109 | - return $this->_keys[$prop]; |
|
110 | - else if (array_key_exists($prop, $this->_blocks)) |
|
111 | - return $this->_blocks[$prop]; |
|
108 | + if (array_key_exists($prop, $this->_keys)) { |
|
109 | + return $this->_keys[$prop]; |
|
110 | + } else if (array_key_exists($prop, $this->_blocks)) { |
|
111 | + return $this->_blocks[$prop]; |
|
112 | + } |
|
112 | 113 | } |
113 | 114 | |
114 | 115 | public function setKey($prop, $value) { |
@@ -119,8 +120,9 @@ discard block |
||
119 | 120 | public function __toString() { |
120 | 121 | $spec = ''; |
121 | 122 | foreach ($this->_keys as $key => $value) { |
122 | - if ($value === '') |
|
123 | - continue; |
|
123 | + if ($value === '') { |
|
124 | + continue; |
|
125 | + } |
|
124 | 126 | $spec .= sprintf('%s: %s'."\n", $key, $value); |
125 | 127 | } |
126 | 128 |
@@ -52,10 +52,12 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | public function run() { |
55 | - if (!is_dir($_SERVER['HOME'].'/rpmbuild/SOURCES')) |
|
56 | - mkdir($_SERVER['HOME'].'/rpmbuild/SOURCES', 0777); |
|
57 | - if (!is_dir($_SERVER['HOME'].'/rpmbuild/SPECS')) |
|
58 | - mkdir($_SERVER['HOME'].'/rpmbuild/SPECS', 0777); |
|
55 | + if (!is_dir($_SERVER['HOME'].'/rpmbuild/SOURCES')) { |
|
56 | + mkdir($_SERVER['HOME'].'/rpmbuild/SOURCES', 0777); |
|
57 | + } |
|
58 | + if (!is_dir($_SERVER['HOME'].'/rpmbuild/SPECS')) { |
|
59 | + mkdir($_SERVER['HOME'].'/rpmbuild/SPECS', 0777); |
|
60 | + } |
|
59 | 61 | |
60 | 62 | if (file_exists($this->getOutputPath())) { |
61 | 63 | $iterator = new DirectoryIterator($this->getOutputPath()); |
@@ -67,8 +69,9 @@ discard block |
||
67 | 69 | } |
68 | 70 | } |
69 | 71 | |
70 | - if (!is_dir($this->getOutputPath())) |
|
71 | - mkdir($this->getOutputPath(), 0777); |
|
72 | + if (!is_dir($this->getOutputPath())) { |
|
73 | + mkdir($this->getOutputPath(), 0777); |
|
74 | + } |
|
72 | 75 | |
73 | 76 | foreach ($this->mountPoints as $path => $dest) { |
74 | 77 | $this->pathToPath($path, $this->getOutputPath().DIRECTORY_SEPARATOR.$dest); |
@@ -148,7 +151,8 @@ discard block |
||
148 | 151 | mkdir($destFolder, 0777, true); |
149 | 152 | } |
150 | 153 | copy($source, $dest); |
151 | - if (fileperms($source) != fileperms($dest)) |
|
152 | - chmod($dest, fileperms($source)); |
|
154 | + if (fileperms($source) != fileperms($dest)) { |
|
155 | + chmod($dest, fileperms($source)); |
|
156 | + } |
|
153 | 157 | } |
154 | 158 | } |
155 | 159 | \ No newline at end of file |