Download the PHP package jsalam/ugrpm without Composer

On this page you can find all versions of the php package jsalam/ugrpm. 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 ugrpm

UGRPM

A simple and easy to use PHP object oriented library to manage (Users,Groups,Roles).

This library use MySql database and PDO Object to connect.

It's work with user as his id and don't care what the table you had made or its columns.

You must have a database connection and pass it as PDO connection object to the UGRPM constructor.

Built by Salam Aljehni (https://aljehni.github.io)

Library home: (https://aljehni.github.io/ugrpm/)

Github link (https://github.com/salamj/ugrpm)

Installation

OR

If you would use try ... catch you must use exceptions classes.

Exceptions using will be discuss below.

Usage

Suppose you create PDO object like this:

Then, create UGRPM object:

Roles

Create Role

Role class constructor accept two parameters, id and role , to create a new Role instance use:

Default value to id is 0 and "" to role.

If Role not exists in the database and you want to create one do not pass id.

After that you can work with $role object by it's methods:

Work With Roles

Insert role to database, retrieve role(s) by (id,role,class,method,class and method) ,get all roles and remove role.

Groups

UGRPM enable you to create groups with (id,name,description) properties, then, you may work with them like add role to groups , add users to group, update groups ...

Create Group

Group class constructor accept three parameters, id and groupName, description , to create a new Group instance use:

Default value to id is 0 and "" to groupName and description. If group not exists in the database and you want to create one do not pass id. After that you can work with $group object by it's methods:

Work With Groups

Insert group to database, retrieve group(s) by (id,groupName) ,get all groups and remove group.

Group Roles

In this section you will learn how to work with (Role-Group) methods. We will make example contains groups and roles and make relations between them.

User Roles

Like (Group-Roles) we can add ,retrieve and remove roles to users or users to roles. Without many examples, these are the methods you can use:

User Group

Since users may belongs to groups, we can add user(s) to group(s) and retrieve group's users or user's group , and removing in the way.

These method are available to use.

There are Role several exceptions to use, namespaces for them are:

Exceptions

Group Exceptions

Catched when trying to create a group with a name that already existing.

Catched when trying to get group that's not found in database using getGroupById or getGroupByGroupName.

Catched when passing array of groups that contain item with invalid Group Object or Integer value (group id).

Like createRoleGroups($role,[ARRAY_OF_GROUPS]).

Role Exceptions

Catched when create a role with role property that already exists in database using createRole() method.

Catched when create a role with role invalid property, role must be classNamespace then @ then method name.

Catched when trying to get role that's not found in database using getRoleById or getRolesByClass...

Catched when passing array of roles that contain item with invalid Role Object or Integer value (role id).

Like createGroupRoles($group,[ARRAY_OF_ROLES])

Group Role Exceptions

Catched when trying to add role(s) to group(s) that already have that role(s).

User Group Exceptions

Catched when trying to add user(s) to group(s) where already in that group role(s).

User Role Exceptions

Catched when trying to add role(s) to user(s) where already have that role(s).

Credit

Salam Aljehni, salam[at]gmail.com, link: (aljehni.github.io)[https://aljehni.github.io]


All versions of ugrpm with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
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 jsalam/ugrpm contains the following files

Loading the files please wait ....