Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Editing Factory.php when implementing custom adapter #124
I've implemented a custom adapter to support remotepassword.com (so that I don't have to hardcode a password in the XML file), but in order to make it work I had to add to update Factory.php as well.
The documentation says that you only need the file in /Adapter but that didn't seem to work for me. Is this a bug or am I missing something obvious?
To use a custom Adapter you have to register it at the Factory.
And within your bootstrap file register the Adapter.
<?php use phpbu\App\Factory; use phpbu\App\Adapter\RPass; require 'vendor/autoload.php'; Factory::register('adapter', 'rpass', RPass::class);
With this you can put the
<?php use phpbu\App\Factory; use My\Name\Space\RPass; require 'vendor/autoload.php'; Factory::register('adapter', 'rpass', RPass::class);
Thanks for the quick response.
I'm now using the bootstrap attribute but the file is never executed (even if I just put a die() statement there). Here's my XML:
Even when I run ./phpbu --bootstrap=file (file has a die() statement) I get:
I've tried seeing where it dies out and it's in https://github.com/sebastianfeldmann/phpbu/blob/master/src/Configuration/Loader/File.php#L73
I believe it breaks due to the tag where I set the options.
Which version of
I tried this configuration
<?xml version="1.0" encoding="UTF-8"?> <phpbu bootstrap="backup/bootstrap.php" verbose="false">
with this bootstrap file
<?php // bootstrap demo file echo "foo\n"; exit(1);
and this is the output I get
If I change the xml config to an invalid file I get the following output.
sorry for the delay. I'm using 5.0.7 and here's what I have confirmed at the moment.
When I set an actual password it works (I get "foo"):
When I use any adapter for the password, it doesn't (no "foo" for me!).
Forget what I said, I can reproduce your error now.
It's a chicken and egg problem.
Currently I create the configuration and setup the adapters first.
So ... I have to restructure some things and will fix this as soon as possible.