-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom source not found (in version 5.0.9) #136
Comments
I'll check |
So, this is working for me :)
<?php
use phpbu\App;
class MySource implements App\Backup\Source
{
public function setup(array $conf = [])
{
// foo
}
public function backup(App\Backup\Target $target, App\Result $result): App\Backup\Source\Status
{
$status = new App\Backup\Source\Status();
$status->uncompressedFile('foo');
return $status;
}
}
App\Factory::register('source', 'dummy', MySource::class);
<phpbu bootstrap="backup/bootstrap.php">
<backups>
<backup name="custom">
<source type="dummy">
<option name="dummy" value="dummy"/>
</source>
<target dirname="backup/dummy" filename="dummy-%Y%m%d-%H%i.txt"/>
</backup>
</backup>
</phpbu> Resulting output
|
Can you reproduce this? What kind of installation are you using? Which php version are you using? Windows Linux MacOS? |
Hi, <?xml version="1.0" encoding="UTF-8"?>
<phpbu xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpbu.de/5.0/phpbu.xsd"
bootstrap="bootstrap.php">
<backups>
<backup name="custom">
<source type="dummy">
<option name="dummy" value="dummy"/>
</source>
<target dirname="backup/dummy" filename="dummy-%Y%m%d-%H%i.txt"/>
</backup>
</backups>
</phpbu> it works. vagrant@www:/vagrant$ php vendor/tm/tooly-composer-script/bin/phpbu.phar --configuration=/vagrant/config/backup/phpbu.xml --bootstrap=/vagrant/config/backup/bootstrap.php
phpbu 5.0.9 by Sebastian Feldmann and contributors.
Time: 444 ms, Memory: 6.00MB
OK (1 backup, 0 checks, 0 crypts, 0 syncs, 0 cleanups) If i dont specify the bootstrap file (bootstrap="bootstrap.php") like this <?xml version="1.0" encoding="UTF-8"?>
<phpbu xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpbu.de/5.0/phpbu.xsd">
<backups>
<backup name="custom">
<source type="dummy">
<option name="dummy" value="dummy"/>
</source>
<target dirname="backup/dummy" filename="dummy-%Y%m%d-%H%i.txt"/>
</backup>
</backups>
</phpbu> it doesn't work. vagrant@www:/vagrant$ php vendor/tm/tooly-composer-script/bin/phpbu.phar --configuration=/vagrant/config/backup/phpbu.xml --bootstrap=/vagrant/config/backup/bootstrap.php
phpbu 5.0.9 by Sebastian Feldmann and contributors.
Time: 581 ms, Memory: 4.00MB
Exception 'phpbu\App\Exception' with message 'unknown source: dummy'
in phar:///vagrant/vendor/tm/tooly-composer-script/bin/phpbu.phar/Factory.php:104
FAILURE!
Backups: 1, failed Checks: 0, failed Crypts: 0, failed Syncs: 0, failed Cleanups: 0. But correct me if i'm wrong, but in version 5.0.8 (and before) i dont had to specifiy the bootstrap file in the configuration (https://phpbu.de/manual/current/en/extending-phpbu.html "Example 11.13: Example phpbu.xml.dist")? Thanks |
oO I'll check if i crashed the bootstrap option in 5.0.9 |
Indeed I did... fix is coming |
After fixing the adapter chicken and egg problem the bootstrap handling was moved up. That resulted in handling the bootstrap file before handling the cli bootstrap option. The bootstrap option is now handled at the right time and its value is passed to the Bootstrapper constructor.
I've just released version 5.0.10 that fixes the bootstrap cli option issue. Your hunch was absolutely right by fixing the adapter chicken and egg problem I introduced Thank you for reporting and helping to get to the bottom of this |
Hi,
i added a custom source in my bootstrap file like this
and run phpbu with --bootstrap=bootstrap.php.
Works with phpbu 5.0.8, but in version 5.0.9 i got an error "unknown source".
Looks like issue #124.
Can you verify, please?
Thanks,
Toni
The text was updated successfully, but these errors were encountered: