original_string: public final static function create_parallel_site_links($fromrun, $torun) {
          global $CFG;
  
          // Create site symlink if necessary.
          clearstatcache();
          for ($i = $fromrun; $i <= $torun; $i++) {
              // Don't create links for specified sites, as they should be accessible.
              if (!empty($CFG->behat_parallel_run['behat_wwwroot'][$i - 1]['behat_wwwroot'])) {
                  continue;
              }
              $link = $CFG->dirroot.'/'.BEHAT_PARALLEL_SITE_NAME.$i;
              clearstatcache();
              if (file_exists($link)) {
                  if (!is_link($link) || !is_dir($link)) {
                      echo "File exists at link location ($link) but is not a link or directory!" . PHP_EOL;
                      return false;
                  }
              } else if (!symlink($CFG->dirroot, $link)) {
                  // Try create link in case it's not already present.
                  echo "Unable to create behat site symlink ($link)" . PHP_EOL;
                  return false;
              }
          }
          return true;
      }
code: public final static function create_parallel_site_links($fromrun, $torun) {
          global $CFG;
  
          // Create site symlink if necessary.
          clearstatcache();
          for ($i = $fromrun; $i <= $torun; $i++) {
              // Don't create links for specified sites, as they should be accessible.
              if (!empty($CFG->behat_parallel_run['behat_wwwroot'][$i - 1]['behat_wwwroot'])) {
                  continue;
              }
              $link = $CFG->dirroot.'/'.BEHAT_PARALLEL_SITE_NAME.$i;
              clearstatcache();
              if (file_exists($link)) {
                  if (!is_link($link) || !is_dir($link)) {
                      echo "File exists at link location ($link) but is not a link or directory!" . PHP_EOL;
                      return false;
                  }
              } else if (!symlink($CFG->dirroot, $link)) {
                  // Try create link in case it's not already present.
                  echo "Unable to create behat site symlink ($link)" . PHP_EOL;
                  return false;
              }
          }
          return true;
      }
code_tokens: public final static function create_parallel_site_links ( $ fromrun , $ torun ) { global $ CFG ; // Create site symlink if necessary. clearstatcache ( ) ; for ( $ i = $ fromrun ; $ i <= $ torun ; $ i ++ ) { // Don't create links for specified sites, as they should be accessible. if ( ! empty ( $ CFG -> behat_parallel_run [ 'behat_wwwroot' ] [ $ i - 1 ] [ 'behat_wwwroot' ] ) ) { continue ; } $ link = $ CFG -> dirroot . '/' . BEHAT_PARALLEL_SITE_NAME . $ i ; clearstatcache ( ) ; if ( file_exists ( $ link ) ) { if ( ! is_link ( $ link ) || ! is_dir ( $ link ) ) { echo "File exists at link location ($link) but is not a link or directory!" . PHP_EOL ; return false ; } } else if ( ! symlink ( $ CFG -> dirroot , $ link ) ) { // Try create link in case it's not already present. echo "Unable to create behat site symlink ($link)" . PHP_EOL ; return false ; } } return true ; }
docstring: Create parallel site links.
  
  @param int $fromrun first run
  @param int $torun last run.
  @return bool true for sucess, else false.
docstring_tokens: Create parallel site links .