Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* simple curl
* @param string $url
* @param array $param
* @return mix
*/
function simpleCurl($url = '', $param = []) {
// params init
@wilon
wilon / app.php
Last active October 12, 2017 02:18
Add toran-proxy web authorize, and composer request not validated.
<?php
use Symfony\Component\HttpFoundation\Request;
error_reporting(0);
$uri = parse_url($_SERVER['REQUEST_URI'])['path'];
$uri = trim($uri, '/');
if (in_array($uri, [
'', 'app.php',
'settings', 'app.php/settings',
@wilon
wilon / timeDebug.php
Created November 7, 2017 06:16
Count php script run time.
<?php
/**
* PHP time debug
* @param string $mark
* @param string $separate
* @return array
*/
function timeDebug($mark, $echo = true, $separate)
{
<?php
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
date_default_timezone_set('PRC');
define('APP_PATH', dirname(__FILE__));
class CONFIG
{
const EMAIL = [
'host' => 'xxx.com',
@wilon
wilon / test-chan.go
Created December 27, 2017 10:17
test chan
package main
import (
"fmt"
"time"
)
func main() {
ch := make(chan int, 1)