Open the file app/config/session.php and change the driver to database.
We need to create the sessions table, so use the following artisan command
php artisan session:table to generate the migration file.
| <?php | |
| /** | |
| * The Signal class is the smallest and fastest observer written in PHP 5.6 and | |
| * using some new features such as the variadic functions and the arguments | |
| * unpacking. | |
| * | |
| * ...and it fits in a tweet. | |
| * | |
| * @author Quentin Schuler aka Sukei <[email protected]> |
| <?php | |
| function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);} |
Use $this to refer to the current object. Use self to refer to the current class. In other words, use $this->member for non-static members, use self::$member for static members.
Source: When to use self vs this -stackoverflow
| #!/bin/sh | |
| WORLD='world' | |
| SERVER='localhost' | |
| PASSWD='mcrcon-password' | |
| MCUSER='minecraft' | |
| MCPATH='/srv/minecraft' | |
| BACKUPPATH='/srv/minecraft/backup/worlds' | |
| REMOTE_BACKUPSERVER=example.com | |
| REMOTE_USER=foo | |
| REMOTE_BACKUPPATH='/home/foo/backup/minecraft/worlds' |
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
| function random_text( $type = 'alnum', $length = 8 ) | |
| { | |
| switch ( $type ) { | |
| case 'alnum': | |
| $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
| break; | |
| case 'alpha': | |
| $pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
| break; | |
| case 'hexdec': |
If you love deploying websites using Github, but for some reason want to use your own server, this script might be exactly what you need.
github.php somewhere on your PHP-enabled web server, and make it
accessible for the outside world. Let's say for now the script lives
on http://example.com/github.php