src/Security/Member.php
public static function create_new_password()
    {
        $words = Security::config()->uninherited('word_list');

        if ($words && file_exists($words)) {
            $words = file($words);

            list($usec, $sec) = explode(' ', microtime());
            mt_srand($sec + ((float)$usec * 100000));

            $word = trim($words[random_int(0, count($words) - 1)]);
            $number = random_int(10, 999);

            return $word . $number;
        } else {
            $random = mt_rand();
            $string = md5($random);
            $output = substr($string, 0, 8);

            return $output;
        }
    }
public static function create_new_password()
    {
        $words = Security::config()->uninherited('word_list');

        if ($words && file_exists($words)) {
            $words = file($words);

            list($usec, $sec) = explode(' ', microtime());
            mt_srand($sec + ((float)$usec * 100000));

            $word = trim($words[random_int(0, count($words) - 1)]);
            $number = random_int(10, 999);

            return $word . $number;
        } else {
            $random = mt_rand();
            $string = md5($random);
            $output = substr($string, 0, 8);

            return $output;
        }
    }
public static function create_new_password ( ) { $ words = Security :: config ( ) -> uninherited ( 'word_list' ) ; if ( $ words && file_exists ( $ words ) ) { $ words = file ( $ words ) ; list ( $ usec , $ sec ) = explode ( ' ' , microtime ( ) ) ; mt_srand ( $ sec + ( ( float ) $ usec * 100000 ) ) ; $ word = trim ( $ words [ random_int ( 0 , count ( $ words ) - 1 ) ] ) ; $ number = random_int ( 10 , 999 ) ; return $ word . $ number ; } else { $ random = mt_rand ( ) ; $ string = md5 ( $ random ) ; $ output = substr ( $ string , 0 , 8 ) ; return $ output ; } }
Generate a random password, with randomiser to kick in if there's no words file on the
filesystem.

@return string Returns a random password.
Generate a random password with randomiser to kick in if there s no words file on the filesystem .