Skip to content

Instantly share code, notes, and snippets.

View VijitCoder's full-sized avatar

Valery Kravtsov VijitCoder

View GitHub Profile
@VijitCoder
VijitCoder / determine-images-similarity.php
Last active August 1, 2023 09:19 — forked from akosnikhazy/compare-images-class
PHP class for comparing two images and determine how much they similar, in percentages.
<?php
/**
* Compare two images and determine how much they similar, in percentages.
*/
class ImagesComparator
{
private const ACCEPTED_IMAGE_TYPES = [IMAGETYPE_JPEG, IMAGETYPE_PNG];
/**
* Calculate the images similarity in percentages.
@VijitCoder
VijitCoder / session-life-cycle.md
Created September 29, 2017 07:03 — forked from mindplay-dk/session-life-cycle.md
Complete overview of the PHP SessionHandler life-cycle

This page provides a full overview of PHP's SessionHandler life-cycle - this was generated by a set of test-scripts, in order to provide an exact overview of when and what you can expect will be called in your custom SessionHandler implementation.

Each example is a separate script being run by a client with cookies enabled.

To the left, you can see the function being called in your script, and to the right, you can see the resulting calls being made to a custom session-handler registed using session_set_save_handler().