Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function setCredentials() {
- echo 'Coloque agora as suas Credenciais Couchbase' . PHP_EOL;
- echo 'Digite O IP do Couchbase: '. PHP_EOL;
- $ip = fgets(STDIN);
- echo 'Digite o Username do Couchbase: '. PHP_EOL;
- $user = fgets(STDIN);
- echo 'Digite a Senha do Couchbase: '. PHP_EOL;
- $senha = fgets(STDIN);
- return ['ip' => $ip, 'user' => $user, 'senha' => $senha];
- }
- // Testar Conexao Couchbase
- $credenciais = setCredentials();
- $conectou = LibCouchBase->connect($credenciais);
- while($coectou == false)
- echo 'Credenciais Invalidas, tente novamente...' . PHP_EOL;
- setCredentials();
- }
- $arquivoConfig = <<<CONFIG
- <?php
- DB_IP = "$ip";
- DB_USERNAME = "$user";
- DB_PASS = "$senha";
- ?>
- CONFIG;
- file_put_contents('Config/Config.php', $arquivoConfig);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement