Welcome Guest, Not a member yet? Register   Sign In
Database Configuration for ClearDB
#1

I'm trying to deploy my CI4 app using Heroku and ClearDB for my database. I found a post for that tutorial but its still using CI3, it says i need to fill in my ClearDB setups in app/config/database.php. I store them in the $default class, but i have some trouble in setting the url for : $url = parse_url(getenv("CLEARDB_DATABASE_URL"));. I tried to set it in @var string as a public variable but its giving me error 'contains not valid' exception. Is there anyway I can do this? 
Reply
#2

Can you share your DB config file?

The 'contains not valid expression' error means you cannot use non-compilable values in the class properties. This means that those values which can only be determined at run time would not be accepted. In this case, your use of functions `parse_url` and `getenv` are not allowed. You must use scalar types only. You can however get away with this by setting the $url in the constructor of your config.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB