Hi there, please advice, I am currently preparing an on demand backup of the db my nette app works on. Unfortunetally my hosting doesn't allow any fancy tools so i will need to do it via php
I am thinking of using this: dg/MySQL-dump
The object needs a mysqli object to be constructed. I want to ask you, what is the best practice for converting a nette\database\connection to mysqli?
Should I really manually parse the dsn of the connection? and (stupid question follows) how do I retrieve the username and password from the nette\database\connection object?
Thanks in advance
Ok, I thought so. But what still bothers me (shame on me) is that I cannot extract the username, password and dns from the \Nette\Database\Connection object. I pass the database to my model, but the params of the connection are private. could you please advice how to? I am expecting something like $this->database->connection->params. But thats not it.
Thanks a lot
Yes, thats the approach I understand :). But I have still some fundamental unknowledge :)
I dont want to define my DB parameters again, but use the ones I have already defined under
development: nette: database: dsn: sdfsdfsdf user: sdkl pass: sdfsg
production: nette: database: dsn: hkhjhjk user: hjk pass: hjk
according to the current scope (on production use the production credentials etc..).
Just to clarify what i need and it doesnt work is this:
services: - MySQLDump - mysqli( %nette.database.host%, %nette.database.username%, %nette.database.password%, %nette.database.scheme% )
Last edited by pistols (2014-09-19 10:01)
petr: I dont want to create a new section under parameters to keep my credentials. I have already defined them in config.local.neon
development: nette: database: dsn: ...
production: nette: database: dsn: ....
and thats the place from where I want to take them… (in other words I don't want to define the same information in two separate places)
Last edited by pistols (2014-09-19 10:48)