k = $k; $this->route = $this->k->getRootDir().'/Net15/SecurityApplicationBundle/Resources/data'; } public function compileWordlist(){ $password = []; $files = ['female_names.json','frequent_passwords.json','male_names.json','surnames.json','us_tv_and_film.json']; foreach($files as $file){ $str = file_get_contents($this->route.'/'.$file); $jsonArray = json_decode($str,true); foreach($jsonArray['passwords'] as $arr){ $password['passwords'][] = array( 'password' => $arr['password'], 'frequency' => $arr['frequency'], ); } } file_put_contents($this->route.'/total_wordlist.json',json_encode($password)); } }