Esempio n. 1
0
 public function testRunCmd()
 {
     if (!(substr(php_uname(), 0, 7) == "Windows")) {
         $this->assertEquals(0, USVN_ConsoleUtils::runCmd("ls"));
         $this->assertEquals(1, USVN_ConsoleUtils::runCmd("test 1 = 2"));
     }
 }
Esempio n. 2
0
 public static function check()
 {
     $errors = array('safe_mode' => 'ok', 'svn' => 'ok', 'mod_rewrite' => 'ok', 'mod_dav_svn' => 'ok', 'mod_authz_svn' => 'ok', 'public' => 'ok', 'config' => 'ok');
     if (ini_get('safe_mode')) {
         $errors['safe_mode'] = 'ko';
     }
     if (USVN_ConsoleUtils::runCmd('svn --config-dir /USVN/fake --version')) {
         $errors['svn'] = 'ko';
     }
     if (php_sapi_name() != 'cli') {
         if (function_exists('apache_get_modules') && !in_array('mod_rewrite', apache_get_modules())) {
             $errors['mod_rewrite'] = 'ko';
         }
         if (function_exists('apache_get_modules') && !in_array('mod_dav_svn', apache_get_modules())) {
             $errors['mod_dav_svn'] = 'ko';
         }
         if (function_exists('apache_get_modules') && !in_array('mod_authz_svn', apache_get_modules())) {
             $errors['mod_authz_svn'] = 'ko';
         }
     }
     if (!file_exists(USVN_PUB_DIR) or !is_writable(USVN_PUB_DIR) or !is_readable(USVN_PUB_DIR)) {
         $errors['public'] = 'ko';
     }
     if (!file_exists(USVN_CONFIG_DIR)) {
         if (!@mkdir(USVN_CONFIG_DIR, 0755, true)) {
             $errors['config'] = 'ko';
         }
     }
     if (file_exists(USVN_CONFIG_DIR) and (!is_writable(USVN_CONFIG_DIR) or !is_readable(USVN_CONFIG_DIR))) {
         $errors['config'] = 'ko';
     }
     return $errors;
 }