@@ -30,17 +30,17 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | private $configModifiedTime = null; |
| 32 | 32 | |
| 33 | - public function __construct($config_name='/../config.ttl') |
|
| 33 | + public function __construct($config_name = '/../config.ttl') |
|
| 34 | 34 | { |
| 35 | 35 | $this->cache = new Cache(); |
| 36 | 36 | try { |
| 37 | - $this->filePath = realpath( dirname(__FILE__) . $config_name ); |
|
| 37 | + $this->filePath = realpath(dirname(__FILE__).$config_name); |
|
| 38 | 38 | if (!file_exists($this->filePath)) { |
| 39 | 39 | throw new Exception('config.ttl file is missing, please provide one.'); |
| 40 | 40 | } |
| 41 | 41 | $this->initializeConfig(); |
| 42 | 42 | } catch (Exception $e) { |
| 43 | - echo "Error: " . $e->getMessage(); |
|
| 43 | + echo "Error: ".$e->getMessage(); |
|
| 44 | 44 | return; |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -74,8 +74,8 @@ discard block |
||
| 74 | 74 | // use APC user cache to store parsed config.ttl configuration |
| 75 | 75 | if ($this->cache->isAvailable() && !is_null($this->configModifiedTime)) { |
| 76 | 76 | // @codeCoverageIgnoreStart |
| 77 | - $key = realpath($this->filePath) . ", " . $this->configModifiedTime; |
|
| 78 | - $nskey = "namespaces of " . $key; |
|
| 77 | + $key = realpath($this->filePath).", ".$this->configModifiedTime; |
|
| 78 | + $nskey = "namespaces of ".$key; |
|
| 79 | 79 | $this->graph = $this->cache->fetch($key); |
| 80 | 80 | $this->namespaces = $this->cache->fetch($nskey); |
| 81 | 81 | if ($this->graph && $this->namespaces) { // found in cache |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | $this->initializeNamespaces(); |
| 94 | 94 | } catch (Exception $e) { |
| 95 | - echo "Error: " . $e->getMessage(); |
|
| 95 | + echo "Error: ".$e->getMessage(); |
|
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
@@ -136,12 +136,12 @@ discard block |
||
| 136 | 136 | try { |
| 137 | 137 | $graph = $parser->parseGraph($turtle, $location); |
| 138 | 138 | } catch (Exception $e) { |
| 139 | - throw new Exception("Failed to parse $location: " . $e->getMessage()); |
|
| 139 | + throw new Exception("Failed to parse $location: ".$e->getMessage()); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | $configResource = $this->configResource($graph, $location); |
| 143 | - foreach($graph->properties($configResource) as $property) { |
|
| 144 | - foreach($configResource->all($property) as $value) { |
|
| 143 | + foreach ($graph->properties($configResource) as $property) { |
|
| 144 | + foreach ($configResource->all($property) as $value) { |
|
| 145 | 145 | $this->graph->add($this->resource, $property, $value); |
| 146 | 146 | } |
| 147 | 147 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $this->resource = $this->configResource($this->graph, $filename); |
| 162 | 162 | |
| 163 | 163 | $includes = $this->graph->allResources($this->resource, "skosmos:includeConfig"); |
| 164 | - foreach($includes as $location) { |
|
| 164 | + foreach ($includes as $location) { |
|
| 165 | 165 | $this->includeConfig($location); |
| 166 | 166 | } |
| 167 | 167 | } |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | public function getGlobalPlugins() |
| 382 | 382 | { |
| 383 | 383 | $globalPlugins = array(); |
| 384 | - $globalPluginsResource = $this->getResource()->getResource("skosmos:globalPlugins"); |
|
| 384 | + $globalPluginsResource = $this->getResource()->getResource("skosmos:globalPlugins"); |
|
| 385 | 385 | if ($globalPluginsResource) { |
| 386 | 386 | foreach ($globalPluginsResource as $resource) { |
| 387 | 387 | $globalPlugins[] = $resource->getValue(); |