Download the PHP package modulusphp/hibernate without Composer

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

Modulus Hibernate Component

This component is responsible for Modulus' caching, handling Queues and also extends Eloquent Models.

Install

This package is automatically installed with the Modulus Framework.

Getting Started

Session (alpha)

A more secure session handler. Hibernate's session handler is more secure and supports more Store Driver's than Modulus's default Blulight Session handler.

To switch to Hibernate's session handler, go to the index.php file in the public directory, and remove Blulight.

Then register the following middleware's in the HttpFoundation class:

Once that has been done, head over to the VerifyCsrfToken class and extend Hibernate's VerifyCsrfToken class:

Note, this may not work

Now, update the session.php config file with the following content:

And you're done!

Note, this is still a work in progress, so do not use it in production

Logging

Hibernate's logger, is meant to be a replacement of @atlantisphp's telemonlog package. Built on top Monolog, you get a more stable and widely supported logging library.

See the config logging.php for more information

Queue Worker (alpha)

The Queue Worker allows you to easily execute tasks in the background. This is done by using Supervisor.

Before you can start creating or executing queues, you need to create a new table that will hold your queues.

Create a migration:

If you are using sqlite as your default Database driver for Queues (which you should be), you will need to create a new .queues file:

See config/queue.php and .env for more information.

Don't worry about having your queues stored in a sqlite file, all queues are encrypted using the APP_KEY.

Run the migration:

To create a new Job, simply run the following command:

To execute the newely created job:

You can also delay a Job by minutes, hours, days, months or even years. This means, you can execute a job that will only run when you want it to run

This Job will run after 10 minutes.

Note: your supervisor worker must call craftsman queue:work --process=1

Hibernate Cache

Hibernate Cache is a simple caching system that allows you to store objects, collections, arrays, and other object types. The Hibernate Cache allows you cache forever or specify when a cache should be removed or when it should expire.

The code above will keep the user array until we decide to remove it.

If we wanted to wanted to keep the user array for a month, all we would need to do, is simply add a Carbon instance as a 3rd argument:

Now, the user array will be automatically removed from the cache after a month.

Note: you must add a cron that executes craftsman schedule:run every minute (* * * * *)

Configuration

Out of the box, Hibernate Cache can use both redis and/or file based caching. file based caching is used as the default caching driver. You can easily use redis as the default caching driver by simply setting HIBERNATE_CACHE to redis in the .env.

Methods

Here are some methods to help you get started.

Name Helper Method Arguments Return Description
Cache::set() cache($key, $value, $expiration) string $key, mixed $value, ?Carbon $expiration bool Set or overwrite cache
Cache::forever() cache($key, $value) string $key, mixed $value bool Cache forever
Cache::get() cache($key) string $key mixed Get cached key
Cache::has() string $key bool Check if item is cached
Cache::forget() string $key bool Remove cached item
Cache::pull() string $key mixed Remove cached item

Hibernate Mail

Sending emails has never been this easy. Hibernate Mail is a Mailer package built on top of PHPMailer. Creating layouts and sending emails is a lot easier and smoother.

The code above, will send a welcome email to "[email protected]" in the background.

Getting Started with Hibernate Mailer

You can create a new Email Class Template by running the following command:

Your Email Class Template should look like:

Before you can do anything else, you will need to create a new Email View Template in your views:

After that, we can start designing our Email View Template. Here is a quick example:

The {% email_layout %} directive will add all the necessary css styling and html code to make your view look decent.

The {% email_layout %} directive includes the main and footer section. The {% email_footer %} directive will add a copyright text at the bottom of all the emails sent from your application. The env('APP_NAME') (name of your application) will be used here.

You can also include action buttons in your Email View Templates. The {% email_action("title", "url", "alginment") %} helps you add a button in your views:

You can set the alginment to "right", "left" or "center".

To make your Email Class Template load the Email View Template you just created, you just need to specify the view from the build method:

You can also pass variables from your Email Class Template to your Email View Template using the with method:

Then you can access the variables like:

Testing Email Templates

You can easily test your Email Templates by returning an instance of a Email Class Template from a route:

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.


All versions of hibernate with dependencies

PHP Build Version
Package Version
Requires illuminate/database Version 5.8.*
modulusphp/support Version 1.9.*
monolog/monolog Version ^2.0
phpmailer/phpmailer Version ^6.0
predis/predis Version ^1.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 modulusphp/hibernate contains the following files

Loading the files please wait ....