@@ -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,15 +136,15 @@ 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 | // Add triples from included configuration, adjust :config resource |
143 | 143 | $configResource = $this->configResource($graph, $location); |
144 | - foreach($graph->resources() as $resource) { |
|
144 | + foreach ($graph->resources() as $resource) { |
|
145 | 145 | $subject = $resource == $configResource ? $this->resource : $resource; |
146 | - foreach($graph->properties($resource) as $property) { |
|
147 | - foreach($resource->all($property) as $value) { |
|
146 | + foreach ($graph->properties($resource) as $property) { |
|
147 | + foreach ($resource->all($property) as $value) { |
|
148 | 148 | $this->graph->add($subject, $property, $value); |
149 | 149 | } |
150 | 150 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $this->resource = $this->configResource($this->graph, $filename); |
166 | 166 | |
167 | 167 | $includes = $this->graph->allResources($this->resource, "skosmos:includeConfig"); |
168 | - foreach($includes as $location) { |
|
168 | + foreach ($includes as $location) { |
|
169 | 169 | $this->includeConfig($location); |
170 | 170 | } |
171 | 171 | } |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | public function getGlobalPlugins() |
386 | 386 | { |
387 | 387 | $globalPlugins = array(); |
388 | - $globalPluginsResource = $this->getResource()->getResource("skosmos:globalPlugins"); |
|
388 | + $globalPluginsResource = $this->getResource()->getResource("skosmos:globalPlugins"); |
|
389 | 389 | if ($globalPluginsResource) { |
390 | 390 | foreach ($globalPluginsResource as $resource) { |
391 | 391 | $globalPlugins[] = $resource->getValue(); |