| @@ -66,9 +66,8 @@ discard block | ||
| 66 | 66 | |
| 67 | 67 | /** | 
| 68 | 68 | * Put the database from the given sspak file into this webroot. | 
| 69 | - * @param array $details The previously sniffed details of this webroot | |
| 70 | 69 | * @param bool $dropdb Drop the DB prior to install | 
| 71 | - * @param string $sspakFile Filename | |
| 70 | + * @param SSPakFile $sspak Filename | |
| 72 | 71 | */ | 
| 73 | 72 |  	public function putdb($sspak, $dropdb) { | 
| 74 | 73 | $details = $this->details(); | 
| @@ -135,6 +134,9 @@ discard block | ||
| 135 | 134 | fclose($stream); | 
| 136 | 135 | } | 
| 137 | 136 | |
| 137 | + /** | |
| 138 | + * @param SSPakFile $sspak | |
| 139 | + */ | |
| 138 | 140 |  	public function putassets($sspak) { | 
| 139 | 141 | $details = $this->details(); | 
| 140 | 142 | $assetsPath = $details['assets_path']; | 
| @@ -16,7 +16,9 @@ discard block | ||
| 16 | 16 | * Calls sniff once and then caches | 
| 17 | 17 | */ | 
| 18 | 18 |  	public function details() { | 
| 19 | - if(!$this->details) $this->details = $this->sniff(); | |
| 19 | +		if(!$this->details) { | |
| 20 | + $this->details = $this->sniff(); | |
| 21 | + } | |
| 20 | 22 | return $this->details; | 
| 21 | 23 | } | 
| 22 | 24 | |
| @@ -26,7 +28,9 @@ discard block | ||
| 26 | 28 |  	public function sniff() { | 
| 27 | 29 | global $snifferFileContent; | 
| 28 | 30 | |
| 29 | - if(!$snifferFileContent) $snifferFileContent = file_get_contents(PACKAGE_ROOT . 'src/sspak-sniffer.php'); | |
| 31 | +		if(!$snifferFileContent) { | |
| 32 | + $snifferFileContent = file_get_contents(PACKAGE_ROOT . 'src/sspak-sniffer.php'); | |
| 33 | + } | |
| 30 | 34 | |
| 31 | 35 | $remoteSniffer = '/tmp/sspak-sniffer-' . rand(100000,999999) . '.php'; | 
| 32 | 36 | $this->uploadContent($snifferFileContent, $remoteSniffer); | 
| @@ -35,7 +39,9 @@ discard block | ||
| 35 | 39 | $this->unlink($remoteSniffer); | 
| 36 | 40 | |
| 37 | 41 | $parsed = @unserialize($result['output']); | 
| 38 | -		if(!$parsed) throw new Exception("Could not parse sspak-sniffer content:\n{$result['output']}\n"); | |
| 42 | +		if(!$parsed) { | |
| 43 | +			throw new Exception("Could not parse sspak-sniffer content:\n{$result['output']}\n"); | |
| 44 | + } | |
| 39 | 45 | return $parsed; | 
| 40 | 46 | } | 
| 41 | 47 | |
| @@ -45,7 +51,9 @@ discard block | ||
| 45 | 51 | */ | 
| 46 | 52 |  	public function execSudo($command) { | 
| 47 | 53 |  		if($this->sudo) { | 
| 48 | - if(is_array($command)) $command = $this->executor->commandArrayToString($command); | |
| 54 | +			if(is_array($command)) { | |
| 55 | + $command = $this->executor->commandArrayToString($command); | |
| 56 | + } | |
| 49 | 57 | // Try running sudo without asking for a password | 
| 50 | 58 |  			try { | 
| 51 | 59 |  				return $this->exec("sudo -n -u " . escapeshellarg($this->sudo) . " " . $command); |