| @@ 55-69 (lines=15) @@ | ||
| 52 | * @throws error |
|
| 53 | * @return void |
|
| 54 | */ |
|
| 55 | protected function checkURI($jsonFile) |
|
| 56 | { |
|
| 57 | //If file doesn't exist, check the directory. |
|
| 58 | if (!file_exists($jsonFile)) { |
|
| 59 | $jsonFile = dirname($jsonFile); |
|
| 60 | } |
|
| 61 | ||
| 62 | if (!is_writable($jsonFile)) { |
|
| 63 | throw new Klarna_FileNotWritableException($jsonFile); |
|
| 64 | } |
|
| 65 | ||
| 66 | if (!is_readable($jsonFile)) { |
|
| 67 | throw new Klarna_FileNotReadableException($jsonFile); |
|
| 68 | } |
|
| 69 | } |
|
| 70 | ||
| 71 | /** |
|
| 72 | * Clear the pclasses |
|
| @@ 84-98 (lines=15) @@ | ||
| 81 | * @throws KlarnaException |
|
| 82 | * @return void |
|
| 83 | */ |
|
| 84 | protected function checkURI($xmlFile) |
|
| 85 | { |
|
| 86 | //If file doesn't exist, check the directory. |
|
| 87 | if (!file_exists($xmlFile)) { |
|
| 88 | $xmlFile = dirname($xmlFile); |
|
| 89 | } |
|
| 90 | ||
| 91 | if (!is_writable($xmlFile)) { |
|
| 92 | throw new Klarna_FileNotWritableException($xmlFile); |
|
| 93 | } |
|
| 94 | ||
| 95 | if (!is_readable($xmlFile)) { |
|
| 96 | throw new Klarna_FileNotReadableException($xmlFile); |
|
| 97 | } |
|
| 98 | } |
|
| 99 | ||
| 100 | ||
| 101 | /** |
|