GithubHelp home page GithubHelp logo

Comments (8)

zeruniverse avatar zeruniverse commented on July 20, 2024

OK, I can give you a full analysis about this issue, so you can see why I don't want to implement it. To be short, this feature is very hard to implement (you can't simply read/write files, you have to do concurrent access control, disk and memory synchronization... just like what you need to consider for implementing a database manager) and the use case is very limited. You can argue there're SQLite / Berkeley DB. But if you can run those database management software, why you can't run MySQL?

Below is a longer analysis:

There're two options for this feature:

  • Implement database functions with native PHP, which involves reading files, storing data, etc. This requires significant amount of work. But you can then use a simplest PHP internal server.
  • Use SQLite or Berkeley DB. Then I don't know what's the difference between this option and using MySQL. Since you need to run an additional program (SQLite or Berkeley DB) anyway.

For three advantages mentioned:

  • [1]If you want to run a portable version of password manager, KeePass might be a better choice. This way you even skip PHP. PHP is rarely installed in PC.
  • [2]To backup the whole system, you only need to backup your data. Because you can always download the program from GitHub. For now, you can simply export CSV or generate a backup file in the Password-Manager. It contains all your data and the recovery process is independent from the config file. Then you can come to GitHub release page and download the version you want to reinstall and then import. So I don't see why you think the backup function currently doesn't let you backup the whole system.
    If you mean backing up the data for all users, you can still do it with a simple mysqldump command.
    Anyway, to reinstall, you only need to backup a single file instead of a zip file. If you, for some reason, must backup the whole folder, you can simply attach the data file into your zip backup.
  • [3]This is the only reason I see why MySQL is not good. However, then we need to substitute MySQL database with either option 1 or 2 mentioned above. Usually, if you only have limited amount of databases, you are running Password-Manager on a WEB-HOSTING, where you don't have ssh access. In this case, running SQLite or Berkeley DB are not possible. So we can only use PHP to implement our own version of database. This involves a lot of work (not only as simple as insert/delete. But requires implementation of B+ tree structure, consistency control, file & memory synchronization) and I definitely don't want to do that.

from password-manager.

nickbe avatar nickbe commented on July 20, 2024

Well, that's not completely true. At least if we're talking about the same SQLite database:
https://sqlite.org/

SQlite is a PHP extension and not a server side database and you don't need shell access to use it. in fact I never had to do anything when an installation offered me to choose SQLite instead of mySQL.

So far all hosters I know have included it in their PHP installations. It's stable and quite fast and all web applications I know of that are currently using SQlite are basically portable and can indeed be run/moved wherever I want.

you end up with a simple .sqlite file where all your data is being stored. I think it would be perfect for this application and would help a lot if we could find a simple way to be able to select either SQLite or MySQL.

btw. Keepass for windows. has corrupted my data when I was using it. That's why I choose this project and I would never go back here. When that happened I was furious. Lately this also happened to a client of mine. Again keepass. It has severe flaws and I don't recomment it to anyone anymore at least not for windows.

from password-manager.

BenjaminHae avatar BenjaminHae commented on July 20, 2024

I think sqlite is a nice addition but not strictly necessary. Doing so should be easy maybe you could implement it yourself @nickbe .

I would strongly oppose using files. I once wrote a small address book manager using plain text files - this was not a very good idea.

from password-manager.

zeruniverse avatar zeruniverse commented on July 20, 2024

Well. If SQLite works like what you said, it's probably good and easy to
implement. But I never used SQLite before so I can't say for now. And yes,
you don't want to use plain files as making this work smoothly needs too
much work.

On Monday, 22 August 2016, Benjamin Häublein [email protected]
wrote:

I think sqlite is a nice addition but not strictly necessary. Doing so should
be easy http://php.net/manual/de/ref.pdo-sqlite.php maybe you could
implement it yourself @nickbe https://github.com/nickbe .

I would strongly oppose using files. I once wrote a small address book
manager using plain text files - this was not a very good idea.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#73 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEbvNAHJ6bSfxnbUmeLeCB7ua_x-w4Chks5qiekYgaJpZM4Jpb9u
.

from password-manager.

nickbe avatar nickbe commented on July 20, 2024

No flat file database then :) Got it.

Well as for the SQLite database.... I know the basic mechanics and I also think it's easy to switch if the database you're working with is not too complicated (which I suppose is the case here). But as much as I'd like to see it work with SQLite I'm afraid I don't have the time right now to dig into the password manager sources.

from password-manager.

zeruniverse avatar zeruniverse commented on July 20, 2024

Hi @nickbe ,

I did some short research on SQLite. It uses the same query sentence structure as MySQL. To switch from MySQL to SQLite, you only need to modify the sqllink() function in src/function/sqllink.php. Currently it creates a PDO instance with MySQL interface, switching it to SQLite is all you need to do. That said, you don't need to know anything about password manager before you can do this. sqllink() is the only place in the whole project where database connector API is called.

Since you mentioned you know SQLite, I'll leave the implementation to you. You can upload the SQLite version to GitHub under your account if you find it works smoothly and I'll be happy to mention your project in README of this project.

I'll close this issue since I don't plan to switch from MySQL to SQLite in my project. You can send me an email if you finally finish implementing SQLite feature and want me to mention it in my project.

from password-manager.

nickbe avatar nickbe commented on July 20, 2024

Ok I'll do my best and let you review the version when I'm done testing.
You can decide if this should be part of the official release then.
Thanks

from password-manager.

zeruniverse avatar zeruniverse commented on July 20, 2024

And for you mentioned, there is exactly easy way to switch databases. In the whole project, only sqllink() function in src/function/sqllink.php is database dependent. That said, as long as your target database uses the standard SQL query, you can switch to that by only editing this function. No matter it's SQLite or MS SQL or anything like this.

from password-manager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.