Blueprints can have both extensions, .php or .yml (.yaml), and you can even mix them, the only difference is that if you use .php, you need to add this line at the top of your blueprints:
Trying your plugin and when I click on the button to start a new backup, it just spins forever.
What I did to install it on my localhost:
— git cloned the repo to the root of my kirby-website
— copied backup folder from kirby-website/kirby-backup/site/fields/backup to kirby-website/site/fields
—copied field from the blueprint in kirby-backup/site/blueprints to my site.php blueprint
— since I am testing it on my localhost I did not change the domain in the plugin’s .htaccess
My content folder is about 28mb, nothing huge. Running kirby 2.3.1.
Now it works but it’s throwing this error right after I click on the backup button (within the panel).
Warning: ZipArchive::close(): Failure to create temporary file: No such file or directory in /Users/name/Sites/website/site/plugins/backup/backup.php on line 149
Warning: filesize(): stat failed for backup/2016-10-23_11-39-35__fulvioosti_dev__65FnVeX3OKoBQQ4R.zip in /Users/name/Sites/website/site/plugins/backup/backup.php on line 151
Last backup created on : October 23, 2016 - 11:39:35 (n/a).
I have the feeling I still did not copy something necessary for the plugin to work.
That error is created by your server, not the plugin.
Or, well… of course it’s the plugin-code that does trigger this error but it occurs on server-level
It looks like it can not create the .zip-file, containing the back-up?
Maybe you don’t have the right permissions set on the /backup folder.
It was one of my first plugins, not the best code - sorry for that…
By the way, maybe you can delete the exact path to the file in your post? It contains information that can be mis-used (username, folders, path, etc…).
When all went good, this file must be available on your server;
I should have simply renamed the folder plugin from kirby-backup to backup.
Pretty noob, but I suggest you to write a more explanatory readme.md! (I can push a pull request if you don’t mind)
You assumed a couple of steps in the procedure to install the plugin that threw me off, even though they might be a common procedure when installing a kirby plugin.
Anyway, it works perfectly.
What’s the best way to localise it, except for translating (replace) the texts in a different language?
This was one of my first project regarding Kirby, and I am not very proud
of it (the code isn’t that good…).
I made it, because I wanted (and so did my client[s]) to be able to backup
/ download all content with the single click on a button.
But I did not write very good code… languages / functions / etc… are
all mixed - sorry for that.
The best way to localize is to edit the code yourself, I guess… or use
variables form an array?
$text = array();
$text[0] = “back this up”;
$text[1] = “delete it?”;
And use this in the code, where the original text appears, like this;
<?php echo $text[1]; ?>
(I am writing this from my phone, so no nice encoding here, sorry).
When you safe the text in a seperate file, make the $text global and
include it with include_once (“my_text.php”); you can “easily” parse the
text dynamically.
I think this plugin is quite important, I had the same client request so it’s something needed. And I’ll start to use it for my personal website as well I think.