You are here

function _path_redirect_generate_url in Path redirect 6

1 call to _path_redirect_generate_url()
path_redirect_generate_redirects in generate/path_redirect_generate.module

File

generate/path_redirect_generate.module, line 108

Code

function _path_redirect_generate_url($external = FALSE, $max_levels = 2) {
  $url = array();
  if ($external) {
    $tlds = array(
      'com',
      'net',
      'org',
    );
    $url[] = 'http://www.example.' . $tlds[array_rand($tlds)];
  }
  $max_levels = mt_rand($external ? 0 : 1, $max_levels);
  for ($i = 1; $i <= $max_levels; $i++) {
    $url[] = devel_generate_word(mt_rand(6 / $i, 8));
  }
  return implode('/', $url);
}