Announcement

Collapse
No announcement yet.

how to decode/encode database connection

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to decode/encode database connection

    hello, last year we finished our deploy for an app with scriptcase, and I used a trick back then, to avoid for each deploy to have to re insert the connection details.

    As I deploy the app with Docker, I create a file "prod.config.php" with the DB connection values, so after the deploy it automatically retrieves the connection.

    Now we are changing connection server, so the connection data will be different, and I just wanted to quickly update the encoded string connection,

    usually I would need change the code of my Docker container and remove the "prod.config.php" part, then redeploy and recreate the new connection, SSH into my docker container and copy the string in the generated "prod.config.php" file to have the new encoded connection info.

    To avoid all this, I could simply decode the current prod.config.php string, change the connection value, and encode it back.

    But I don't know what encoding is scriptcase using! The string format is:

    "<?php /*a:2:{s:7:"PROFILE";a:1:{s:14:"xxxxxxxxxxxxx";a:29 :{s:8:"USE_HOST";s:1:"Y";s:..................."

    I want to decode this, change some value, and encode it back, but how?

  • #2
    isn't using the standard url for editing connections in production environmets feasible for you?
    _lib/prod/lib/php/nm_ini_manager2.php

    Comment


    • #3
      Originally posted by robydago View Post
      isn't using the standard url for editing connections in production environmets feasible for you?
      _lib/prod/lib/php/nm_ini_manager2.php
      We deploy frequent updates and we have different versions connected to different SQL servers,
      Our Docker code automatically creates the correct prod.config.php file based on the selected server,
      and I assume they use a scriptcase method to encode/decode, so it would be much easier for me to have that method and just decode and encode back the strings, instead of looking for them by myself after deploy, inside my docker container

      Comment


      • #4
        so nobody from Scripcase can just tell me what php file is used to encode and decode?

        Comment

        Working...
        X