Download the PHP package mouf/security.userfiledao without Composer

On this page you can find all versions of the php package mouf/security.userfiledao. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package security.userfiledao

UserFileDao

TL;DR?

This package is part of the Mouf PHP framework. You need this package if you want to authenticate users but you don't have a database to store your users. This package contains a "DAO" that stores your users in a file instead of a database table.

Why should I care about this package?

The Mouf PHP framework comes with a library to manage the authentication of users: the UserService. The UserService does not make any assumption on where the users are stored. They could be stored in a relational database like MySQL or in an object oriented database like MongoDB, etc... The only thing the UserService requires is a UserDao that is in charge of retrieving the users and checking the password.

This is where this package and the UserFileDao comes into play.

This package contains an implementation of a UserDao that stores the application users in a simple PHP file. It can be used together with the UserService to provide easy access management to an application. Since the users are stored in a PHP file, this very special DAO does not require a database at all!

Installing

This package comes as a composer package:

How does it work?

Simply create a UserFileDao instance in Mouf and bind it to the userService instance.

The only property you need to configure is the $userFile constructor argument. It contains a path to the file that contains the list of users. The path is relative to the root of your project.

Registering a user

In order to create the file and add a user in it, you can use the registerUser() and write() methods.

Removing a user

Use the removeUser() method.

Checking whether a file containing users exists or not

There is a utility function to detect if a file containing users is available or not:

Good to know

This package is internally used by Mouf to store your credentials to log into the admin interface of Mouf. If you happen to loose those credentials, you can simply delete the user file. For the Mouf PHP framework, this file is stored in [root path]/mouf/no_commit/MoufUsers.php.


All versions of security.userfiledao with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1 || ^8.0
mouf/security.userservice Version ^3
thecodingmachine/funky Version ^1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mouf/security.userfiledao contains the following files

Loading the files please wait ....