Account.php 474 B

12345678910111213141516171819202122
  1. <?php
  2. class Account {
  3. private $binPath;
  4. public function __construct($binPath){
  5. $this->binPath = $binPath;
  6. }
  7. /**
  8. * @return array|false|mixed
  9. */
  10. public function createAccount() {
  11. $s = exec($this->binPath . ' account create -l 1 -s 1 -f std');
  12. $arrAccount = json_decode(trim($s), true);
  13. if (empty($arrAccount) || !is_array($arrAccount)) {
  14. return false;
  15. }
  16. return $arrAccount;
  17. }
  18. }