The purpose of this document is to provide a complete overview of the PHP session
handler life cycle updated to version 7.0 or above. In particular, I want to
emphasize what methods and in what order are called when the native PHP functions
are used for session management.
I created this document because the information on the web and the official
documentation are very superficial on this topic, in particular on what
concerns the implementation of a safe and stable session handler.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// _oo0oo_ | |
// o8888888o | |
// 88" . "88 | |
// (| -_- |) | |
// 0\ = /0 | |
// ___/`---'\___ | |
// .' \\| |// '. | |
// / \\||| : |||// \ | |
// / _||||| -:- |||||- \ |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- phpMyAdmin SQL Dump | |
-- version 2.10.3 | |
-- http://www.phpmyadmin.net | |
-- | |
-- 主機: localhost | |
-- 建立日期: Mar 12, 2013, 03:16 PM | |
-- 伺服器版本: 5.0.51 | |
-- PHP 版本: 5.2.6 | |
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This is an example of a practical encoder and decoder for base-62 data in PHP | |
* It differs from the majority of examples in that it's fast enough for moderate data sizes, unlike multiprecision converters | |
* To be practical, base-62 encoding needs to use internal chunking and padding because base-62 does not fit exactly into any integral number of bits | |
* This means the output is not quite compatible with multiprecision conversions, | |
* but the encoded data retains all the desirable properties of base-62, so (unlike any base-64 encoding) it's URL, DNS, email address and pathname safe | |
* @author Marcus Bointon <marcus@synchromedia.co.uk> | |
* @copyright 2011 Marcus Bointon | |
* @license http://www.opensource.org/licenses/mit-license.html MIT License |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// copied from python code at https://stackoverflow.com/a/23221582/3103058 | |
function base32_decode($key) { | |
// https://www.php.net/manual/en/function.base-convert.php#122221 | |
$key = strtoupper($key); | |
list($t, $b, $r) = array("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", "", ""); | |
foreach(str_split($key) as $c) | |
$b = $b . sprintf("%05b", strpos($t, $c)); | |
foreach(str_split($b, 8) as $c) | |
$r = $r . chr(bindec($c)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @package Article Form override for Joomla 3 | |
* @copyright Copyright (c) 2014 Sander Potjer - www.perfectwebteam.nl | |
* @license GNU General Public License version 3 or later | |
*/ | |
defined('_JEXEC') or die; | |
JHtml::_('behavior.keepalive'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select.form-control + .chosen-container.chosen-container-single .chosen-single { | |
display: block; | |
width: 100%; | |
height: 34px; | |
padding: 6px 12px; | |
font-size: 14px; | |
line-height: 1.428571429; | |
color: #555; | |
vertical-align: middle; | |
background-color: #fff; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Script that shows how to insert a basepath on HTML tags | |
* It looks for link, script and img tags that do not contain the | |
* determined basepath or a external URL | |
*/ | |
// BasePath to insert in string when necessarry | |
$basePath = "/project/site/"; | |
$escapedBasePath = str_replace("/", "\/", $basePath); |
My first take at a 3D particle system. Using three.js the particles jump between having targets in a sphere shape and a (filled) box shape.
A Pen by Pål Smitt-Amundsen on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Gets individual core information */ | |
function GetCoreInformation() { | |
$data = file('/proc/stat'); | |
$cores = array(); | |
foreach( $data as $line ) { | |
if( preg_match('/^cpu[0-9]/', $line) ) | |
{ | |
$info = explode(' ', $line ); | |
$cores[] = array( |
NewerOlder