Download the PHP package natilosir/auth without Composer

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

Auth-PHP

A simple library for creating and managing users and authentication in PHP The Library provides a simple and effective way to handle user authentication in your PHP applications. It allows for user registration, login, logout, and session management using cookies. This library also hashes passwords for secure storage.

Installation

You can install this package via Composer:

Usage

Ensure that you have the required dependencies for cookie management and database operations.

Hashing Passwords The library provides a hashing function to securely hash passwords using MD5. You can call this function directly:

Registering a User

To register a new user, use the register method:

This method returns an array indicating the status of the registration.

Logging In

To log in a user, use the attempt method:

Logging Out

To log out the current user, simply call:

Checking User Status

To check if a user is logged in and retrieve their information:

Getting All Users

To retrieve all registered users:

Retrieving User from Cookie

To get the currently logged-in user from the cookie:

Getting User ID

To retrieve the ID of the currently logged-in user:

Functions

hash($password) Hashes the provided password using MD5 and returns a substring of the hash from the 5th to the 15th character.

Auth::attempt($username, $password) Attempts to log in a user with the provided username (email or username) and password.

Auth::register($username, $password) Registers a new user with the specified username (email or username) and password.

Auth::logout() Logs out the current user by deleting the user cookie.

Auth::check() Checks the authentication status of the user and returns user information.

Auth::getUserFromCookie() Retrieves the username from the cookie.

Auth::getAllUsers() Returns an array of all registered users.

Auth::user() Returns the currently logged-in user.

Auth::id() Returns the ID of the currently logged-in user.

Auth::login($user) Logs in a user by setting the user cookie.

Auth::loginUsingId($id) Logs in a user using their ID.


All versions of auth with dependencies

PHP Build Version
Package Version
Requires natilosir/jalali Version ^1.0
natilosir/session Version ^1.0
natilosir/cookie Version ^1.0
natilosir/orm Version ^1.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 natilosir/auth contains the following files

Loading the files please wait ...