Completed
Push — master ( 751bec...101b9a )
by David
11s
created
lib/Dwoo/Loader.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function __construct($cacheDir)
63 63
     {
64
-        $this->corePluginDir = __DIR__ . DIRECTORY_SEPARATOR . 'Plugins';
65
-        $this->cacheDir      = rtrim($cacheDir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
64
+        $this->corePluginDir = __DIR__.DIRECTORY_SEPARATOR.'Plugins';
65
+        $this->cacheDir      = rtrim($cacheDir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
66 66
 
67 67
         // include class paths or rebuild paths if the cache file isn't there
68
-        $cacheFile = $this->cacheDir . 'classpath.cache.d' . Core::RELEASE_TAG . '.php';
68
+        $cacheFile = $this->cacheDir.'classpath.cache.d'.Core::RELEASE_TAG.'.php';
69 69
 
70 70
         $chachedClassPath = null;
71 71
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
             $chachedClassPath = unserialize(file_get_contents($cacheFile));
75 75
 
76 76
             if (is_array($chachedClassPath)) {
77
-                $this->classPath = $chachedClassPath + $this->classPath;
77
+                $this->classPath = $chachedClassPath+$this->classPath;
78 78
             }
79 79
         }
80 80
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         // save in file if it's the first call (not recursed)
114 114
         if ($cacheFile !== false) {
115 115
             if (!file_put_contents($cacheFile, serialize($this->classPath), LOCK_EX)) {
116
-                throw new Exception('Could not write into ' . $cacheFile . ', either because the folder is not there (create it) or because of the chmod configuration (please ensure this directory is writable by php), alternatively you can change the directory used with $dwoo->setCompileDir() or provide a custom loader object with $dwoo->setLoader()');
116
+                throw new Exception('Could not write into '.$cacheFile.', either because the folder is not there (create it) or because of the chmod configuration (please ensure this directory is writable by php), alternatively you can change the directory used with $dwoo->setCompileDir() or provide a custom loader object with $dwoo->setLoader()');
117 117
             }
118 118
             $this->classPath += $tmp;
119 119
         }
@@ -138,22 +138,22 @@  discard block
 block discarded – undo
138 138
          * so we check for that before trying to include() the plugin.
139 139
          */
140 140
         if ((!isset($this->classPath[$class]) || !is_readable($this->classPath[$class])) || (!isset
141
-                ($this->classPath[$class . 'Compile']) || !is_readable($this->classPath[$class . 'Compile']))) {
141
+                ($this->classPath[$class.'Compile']) || !is_readable($this->classPath[$class.'Compile']))) {
142 142
             if ($forceRehash) {
143
-                $this->rebuildClassPathCache($this->corePluginDir, $this->cacheDir . 'classpath.cache.d' .
144
-                    Core::RELEASE_TAG . '.php');
143
+                $this->rebuildClassPathCache($this->corePluginDir, $this->cacheDir.'classpath.cache.d'.
144
+                    Core::RELEASE_TAG.'.php');
145 145
                 foreach ($this->paths as $path => $file) {
146 146
                     $this->rebuildClassPathCache($path, $file);
147 147
                 }
148 148
                 if (isset($this->classPath[$class])) {
149 149
                     include_once $this->classPath[$class];
150
-                } elseif (isset($this->classPath[$class . 'Compile'])) {
151
-                    include_once $this->classPath[$class . 'Compile'];
150
+                } elseif (isset($this->classPath[$class.'Compile'])) {
151
+                    include_once $this->classPath[$class.'Compile'];
152 152
                 } else {
153
-                    throw new Exception('Plugin "' . $class . '" can not be found, maybe you forgot to bind it if it\'s a custom plugin ?', E_USER_NOTICE);
153
+                    throw new Exception('Plugin "'.$class.'" can not be found, maybe you forgot to bind it if it\'s a custom plugin ?', E_USER_NOTICE);
154 154
                 }
155 155
             } else {
156
-                throw new Exception('Plugin "' . $class . '" can not be found, maybe you forgot to bind it if it\'s a custom plugin ?', E_USER_NOTICE);
156
+                throw new Exception('Plugin "'.$class.'" can not be found, maybe you forgot to bind it if it\'s a custom plugin ?', E_USER_NOTICE);
157 157
             }
158 158
         }
159 159
     }
@@ -175,14 +175,14 @@  discard block
 block discarded – undo
175 175
     {
176 176
         $pluginDir = realpath($pluginDirectory);
177 177
         if (!$pluginDir) {
178
-            throw new Exception('Plugin directory does not exist or can not be read : ' . $pluginDirectory);
178
+            throw new Exception('Plugin directory does not exist or can not be read : '.$pluginDirectory);
179 179
         }
180
-        $cacheFile = $this->cacheDir . 'classpath-' . substr(strtr($pluginDir, '/\\:' . PATH_SEPARATOR, '----'),
181
-                strlen($pluginDir) > 80 ? - 80 : 0) . '.d' . Core::RELEASE_TAG . '.php';
180
+        $cacheFile = $this->cacheDir.'classpath-'.substr(strtr($pluginDir, '/\\:'.PATH_SEPARATOR, '----'),
181
+                strlen($pluginDir) > 80 ? -80 : 0).'.d'.Core::RELEASE_TAG.'.php';
182 182
         $this->paths[$pluginDir] = $cacheFile;
183 183
         if (file_exists($cacheFile)) {
184 184
             $classpath       = file_get_contents($cacheFile);
185
-            $this->classPath = unserialize($classpath) + $this->classPath;
185
+            $this->classPath = unserialize($classpath)+$this->classPath;
186 186
         } else {
187 187
             $this->rebuildClassPathCache($pluginDir, $cacheFile);
188 188
         }
Please login to merge, or discard this patch.