コード例 #1
0
ファイル: Install.php プロジェクト: CrashfortStudios/Sirus
 /**
  * Encrypts our database settings
  *
  * @param $settings_payload
  *
  * @return bool
  */
 public function EncryptDatabaseSettings($settings_payload)
 {
     /**
      * Lets check our data
      */
     if (is_array($settings_payload) == false) {
         return false;
     }
     /**
      * Do we have all the keys?
      */
     foreach ($this->database_keys as $key => $value) {
         if (isset($settings_payload[$value])) {
             continue;
         }
         /**
          * Return false, we've not got all our keys!
          */
         return false;
     }
     /**
      * Great, I guess we have all our keys, lets encrypt this array!
      */
     $encrypted_array = Cyphers::EncryptArray($settings_payload, true);
     /**
      * Then, lets write this to file
      */
     JsonWriter::WriteFile('Json/database_settings.json', $encrypted_array);
     /**
      * Then, lets return true
      */
     return true;
 }