public function testCanBeImportedOk() { $path = 'tests/tmp/svn/testSVN'; USVN_SVNUtils::createSvn($path); $this->assertTrue(USVN_ImportSVNRepositories::canBeImported($path, array('verbose' => true))); USVN_DirectoryUtils::removeDirectory($path); }
/** * Look after SVN repositories to import into USVN * * @param string $path * @param array $options array(recursive => true|false) * @todo allow to set n level of recursion in options * @throws USVN_Exception * @return array */ public static function lookAfterSVNRepositoriesToImport($path, $options = array()) { $results = array(); if (USVN_ImportSVNRepositories::canBeImported($path, $options)) { return array($path); } $folders = USVN_DirectoryUtils::listDirectory($path); foreach ($folders as $folder) { $current_path = $path . DIRECTORY_SEPARATOR . $folder; if (USVN_ImportSVNRepositories::canBeImported($current_path, $options)) { $results[] = $current_path; } else { if (isset($options['recursive']) && $options['recursive'] == true) { $results = array_merge($results, USVN_ImportSVNRepositories::lookAfterSVNRepositoriesToImport($current_path, $options)); } } } return $results; }