Skip to content

Instantly share code, notes, and snippets.

View Homezonic's full-sized avatar

Akande Joshua Homezonic

View GitHub Profile
@Homezonic
Homezonic / .phpcsfixer
Last active April 11, 2023 00:43 — forked from sarthaksavvy/.phpcsfixer
PHP CS Fixer for latest version compatibility (tested upto v3.16.0)
<?php
return (new PhpCsFixer\Config())
->setRules([
'@PSR2' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_unsets' => true,
'phpdoc_separation' => true,
'multiline_whitespace_before_semicolons' => true,
@Homezonic
Homezonic / autologout.php
Last active June 21, 2019 18:00 — forked from psdtohtml5/gist:6090113
PHP : Auto expire session / Auto logout after specific time
<?php
//on pageload, we have to start the session.
session_start();
$idletime=60;// after 60 seconds the user gets logged out, put your time in seconds.
if (time()-$_SESSION['timestamp']>$idletime){
session_destroy();
session_unset();
header('Location: ../index.php'); //then redirect the user away from the current page to a lockscreen page or index.