| 180 | | if (!count($config->targetDirectories)) { |
| 181 | | $directories = (array)$config->directory; |
| 182 | | } else { |
| 183 | | $directories = $config->targetDirectories; |
| 184 | | } |
| 185 | | |
| 186 | | for ($i = 0, $count = count($directories); $i < $count; ++$i) { |
| 187 | | if (!is_dir($directories[$i])) { |
| 188 | | throw new Stagehand_TestRunner_Exception("ERROR: A specified path [ {$directories[$i]} ] is not found or not a directory."); |
| 189 | | } |
| 190 | | |
| 191 | | $directories[$i] = realpath($directories[$i]); |
| 192 | | if ($directories[$i] === false) { |
| 193 | | throw new Stagehand_TestRunner_Exception("ERROR: Cannnot get the absolute path of a specified directory [ {$directories[$i]} ]. Make sure all elements of the absolute path have valid permissions."); |
| | 181 | $targetDirectories = array(); |
| | 182 | foreach (array_merge($config->targetDirectories, (array)$config->directory) |
| | 183 | as $directory |
| | 184 | ) { |
| | 185 | if (!is_dir($directory)) { |
| | 186 | throw new Stagehand_TestRunner_Exception("ERROR: A specified path [ $directory ] is not found or not a directory."); |
| | 187 | } |
| | 188 | |
| | 189 | $directory = realpath($directory); |
| | 190 | if ($directory === false) { |
| | 191 | throw new Stagehand_TestRunner_Exception("ERROR: Cannnot get the absolute path of a specified directory [ $directory ]. Make sure all elements of the absolute path have valid permissions."); |
| | 192 | } |
| | 193 | |
| | 194 | if (!in_array($directory, $targetDirectories)) { |
| | 195 | $targetDirectories[] = $directory; |