Changeset 150
- Timestamp:
- 04/26/08 00:29:38 (9 months ago)
- Location:
- trunk/src/Stagehand/TestRunner
- Files:
-
- 2 added
- 2 modified
-
AlterationMonitor.php (modified) (2 diffs)
-
DirectoryScanner (added)
-
DirectoryScanner.php (modified) (2 diffs)
-
DirectoryScanner/Exception.php (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/Stagehand/TestRunner/AlterationMonitor.php
r144 r150 38 38 require_once 'Stagehand/TestRunner/Exception.php'; 39 39 require_once 'Stagehand/TestRunner/DirectoryScanner.php'; 40 require_once 'Stagehand/TestRunner/DirectoryScanner/Exception.php'; 40 41 41 42 // {{{ Stagehand_TestRunner_AlterationMonitor … … 140 141 * @param string $element 141 142 * @throws Stagehand_TestRunner_Exception 143 * @throws Stagehand_TestRunner_DirectoryScanner_Exception 142 144 */ 143 145 public function detectChanges($element) 144 146 { 145 147 if (!$this->_isFirstTime) { 148 $perms = fileperms($element); 149 if ($perms === false) { 150 throw new Stagehand_TestRunner_DirectoryScanner_Exception(); 151 } 152 146 153 if (!array_key_exists($element, $this->_previousElements)) { 147 154 throw new Stagehand_TestRunner_Exception(); 148 155 } 149 156 157 if ($this->_previousElements[$element]['perms'] != $perms) { 158 throw new Stagehand_TestRunner_Exception(); 159 } 160 150 161 if (!is_dir($element)) { 151 162 $mtime = filemtime($element); 163 if ($mtime === false) { 164 throw new Stagehand_TestRunner_DirectoryScanner_Exception(); 165 } 166 152 167 if ($this->_previousElements[$element]['mtime'] != $mtime) { 153 168 throw new Stagehand_TestRunner_Exception(); 154 169 } 155 170 } 156 157 $perms = fileperms($element); 158 if ($this->_previousElements[$element]['perms'] != $perms) { 159 throw new Stagehand_TestRunner_Exception(); 160 } 161 } 162 171 } 172 173 $perms = fileperms($element); 174 if ($perms === false) { 175 throw new Stagehand_TestRunner_DirectoryScanner_Exception(); 176 } 177 178 $this->_currentElements[$element]['perms'] = $perms; 163 179 if (!is_dir($element)) { 164 $this->_currentElements[$element]['mtime'] = filemtime($element); 165 } 166 167 $this->_currentElements[$element]['perms'] = fileperms($element); 180 $mtime = filemtime($element); 181 if ($mtime === false) { 182 throw new Stagehand_TestRunner_DirectoryScanner_Exception(); 183 } 184 185 $this->_currentElements[$element]['mtime'] = $mtime; 186 } 168 187 } 169 188 -
trunk/src/Stagehand/TestRunner/DirectoryScanner.php
r134 r150 35 35 * @since File available since Release 2.1.0 36 36 */ 37 38 require_once 'Stagehand/TestRunner/DirectoryScanner/Exception.php'; 37 39 38 40 // {{{ Stagehand_TestRunner_DirectoryScanner … … 123 125 124 126 $element = $directory . DIRECTORY_SEPARATOR . $files[$i]; 125 call_user_func($this->_callback, $element); 127 try { 128 call_user_func($this->_callback, $element); 129 } catch (Stagehand_TestRunner_DirectoryScanner_Exception $e) { 130 continue; 131 } 126 132 127 133 if (is_dir($element) && $this->_isRecursive) {
