Download the PHP package anax/session without Composer

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

Anax Session

Latest Stable Version Join the chat at https://gitter.im/canax/session

Build Status CircleCI

Build Status Scrutinizer Code Quality Code Coverage

Maintainability Codacy Badge

Anax Session module, for wrapping the session and providing useful helpers related to the session.

The Session module is prepared wo be used for unit testing when run in CLI environment.

Table of content

Class, interface, trait

The following classes, interfaces and traits exists.

Class, interface, trait Description
Anax\Session\Session Wrapper class for sessions.
Anax\Session\SessionInterface Interface to implement for classes what want to wrap the session.

Exceptions

There are no module specific exceptions.

Configuration file

This is a sample configuration file, it is usually stored in config/session.php.

DI service

The session is created as a framework service within $di. The following is a sample on how the session service is created.

The session can always be active, in the default configuration file this is depending on the PHP define ANAX_WITH_SESSION which is usually set in config/commons.php which is available from the module anax/commons.

The session is always started when ANAX_WITH_SESSION is defined and true.

This is how the callback works, when it creates the session service.

  1. The object is created.
  2. The configuration file, usually config/session.php, is read.
  3. The session is named.
  4. The session is created.

The service is lazy loaded and not created until it is used. However, it is always loaded when "active" => true.

Access as framework service

You can access the module as a framework service.

Start the session

The recommended way, and the default behaviour, is to start the session by defining ANAX_WITH_SESSION and set it to true. This is usually done in config/commons.php which source is available in the module anax/commons.

Setting ANAX_WITH_SESSION to false means that the session is not started by default.

As an alternative, you can start the session anywhere by activating (using) the di service. A good place to do this is in the frontkontroller index.php, after you have created $di (and $app). The session will then be available for all page requests.

The session will not start when running in CLI (for example PHPUnit), however, it will still be active and usable as means of unit testing.

Work with session variables

There are helpers to use when reading and setting values in the session.

Session flash messages

There is feature useful for flash messages. A value is retrieved from the session and is then deleted.

Debug the session

You can var_dump the session object and it will print out the content of $_SESSION.

Destroy the session

You can destroy the session which might be useful during development.

License

This software carries a MIT license. See LICENSE.txt for details.


All versions of session with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
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 anax/session contains the following files

Loading the files please wait ....