-
Notifications
You must be signed in to change notification settings - Fork 296
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
Switch to full object links DB #445
Comments
A dedicated
|
I'm starting to have a viable solution in early stage of development which would let us work on multiple open issues more easily due to the following changes:
However, all of this requires breaking backward compatibility changes. I don't see any way to do this using the Updater because previous update methods/functions touching the data store won't work any more (except, maybe, by keeping a lot of dead code). This means that users willing to update would have to either (let's assume that's for
IMHO, this needs to be done before switching to Slim controllers, and without it Shaarli's refactoring won't go a lot further. @virtualtam @nodiscc Do you think this acceptable? |
👍 Regarding backwards compatibility, we could keep the current datastore loader as a
This might require to also have a
|
I've pushed the current state in a609ded. It's really an early stage, and not really working yet, but you'll get the idea:
Your update suggestion should work, I'll try to do something like this. |
This is interesting, from what I understand your original problems are:
Right?
(If there are non-backward-compatible changes, we should bump the major version number (eg 1.x) as per https://github.com/shaarli/Shaarli/blob/master/CHANGELOG.md -> http://semver.org/) @ArthurHoaro Moving the current code to Having a Can you explain shortly how it would change things regarding:
Thanks a lot |
Yes, those were my original problems. But also, I've tried to work on a few issues I mentioned, and the current LinkDB needs to be refactored if we don't want to end up with a class handling too much logic (and again too many lines, a lot of if/else, etc.). So I'd like to do it in a proper way.
Currently, links are mostly formatted in controllers using functions, then these functions are rolled back in the markdown plugin to apply markdown rendering (e.g. add I still have to figure out how to make |
Disclaimer: this is technical.
LinkDB
currently implements theArrayAccess
interface. It means that we have an object which behave like an array and works fine with our datastore file. Brilliant idea! In theory.From SO:
This leads to my issue because our data structure is a multidimensional array. I encountered issues setting data in this array and, most importantly, I couldn't run some
array_*
functions. So it kinda loses its initial goal.I think it would be better to have a
LinkDB
class which managesLink
objects. And then only ourread/writeDB()
functions handle the object <-> array <-> file interface.The text was updated successfully, but these errors were encountered: