vakata / user
A PHP user class
Installs: 3 551
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=8.0.0
- vakata/kvstore: 2.*
Suggests
- vakata/cache: Install if you want to speed up the performance of UserManagementDatabase
- vakata/database: Install if you plan on using UserManagementDatabase
- dev-master
- 4.4.3
- 4.4.2
- 4.4.1
- 4.4.0
- 4.3.3
- 4.3.2
- 4.3.1
- 4.3.0
- 4.2.3
- 4.2.2
- 4.2.1
- 4.2.0
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.0
- 3.6.2
- 3.6.1
- 3.6.0
- 3.5.1
- 3.5.0
- 3.4.0
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.6
- 3.2.5
- 3.2.4
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.1
- 3.1.0
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.1.1
- 2.1.0
- 2.0.1
- 2.0.0
- 1.2.1
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2024-11-06 13:11:46 UTC
README
A PHP user class.
Install
Via Composer
$ composer require vakata/user
Usage
use \vakata\database\DB; use \vakata\user\UserManagementDatabase; use \vakata\user\Group; use \vakata\user\User; $db = new DB('mysql://root@127.0.0.1/dbname'); $usrm = new UserManagementDatabase($db, [ 'tableUsers' => 'users', 'tableProviders' => 'user_providers', 'tableGroups' => 'groups', 'tablePermissions' => 'permissions', 'tableGroupsPermissions' => 'group_permissions', 'tableUserGroups' => 'user_groups' ]); // get a user by ID $user = $usrm->getUser(1); // or by a provider $user = $usrm->getUserByProviderID($provider, $providerID); // add a group $group = new Group(1, "Name", ["some", "permissions"]); $usrm->saveGroup($group); // add the new group to a user $user->addGroup($group); $usrm->saveUser($user);
Read more in the API docs
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email github@vakata.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.