프로젝트 디렉토리에서 실행
composer.phar이 없으면 가지고 온다.curl -sS https://getcomposer.org/installer | php
guzzle 설치./composer.phar require guzzlehttp/guzzle
index.php 에 추가$container['guzzleHttp'] = function ($container) { $client = new \GuzzleHttp\Client(); return $client; };
사용은 이런식으로..echo $container['guzzleHttp']->get('http://www.naver.com')->getBody();
주의 : AWS SDK를 사용한다면 이미 AWS SDK에서도 guzzle을 로드하기때문에 충돌난다.
이럴때는 그냥 AWS SDK에 포함되어있는 guzzle을 사용하면된다.
참조 : http://docs.guzzlephp.org/en/latest/quickstart.html
$var_array = array_values(array_filter($var_array));
CURLOPT_POSTFIELDS |
The full data to post in a HTTP "POST" operation. To post a file, prepend a filename with @ and use the full path. The filetype can be explicitly specified by following the filename with the type in the format ';type=mimetype'. This parameter can either be passed as a urlencoded string like 'para1=val1¶2=val2&...' or as an array with the field name as key and field data as value. If value is an array, the Content-Type header will be set to multipart/form-data. As of PHP 5.2.0,value must be an array if files are passed to this option with the @ prefix. As of PHP 5.5.0, the @ prefix is deprecated and files can be sent using CURLFile. The@ prefix can be disabled for safe passing of values beginning with @ by setting the CURLOPT_SAFE_UPLOAD option to TRUE . |
if ( ! preg_match("/^[a-z0-9:_\/-]+$|/i", $str)) { exit('Disallowed Key Characters.'. $str); }
$_config[0] =& $config; return $_config[0];
Monolog supports the logging levels described by RFC 5424.
DEBUG (100): Detailed debug information.
INFO (200): Interesting events. Examples: User logs in, SQL logs.
NOTICE (250): Normal but significant events.
WARNING (300): Exceptional occurrences that are not errors. Examples: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.
ERROR (400): Runtime errors that do not require immediate action but should typically be logged and monitored.
CRITICAL (500): Critical conditions. Example: Application component unavailable, unexpected exception.
ALERT (550): Action must be taken immediately. Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up.
EMERGENCY (600): Emergency: system is unusable.
if(!preg_match('/^[0-9a-zA-Z]([\-.\w]*[0-9a-zA-Z\-_+])*@([0-9a-zA-Z][\-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9}$/', $email)) { // 통과못했을경우 }
cd languages wget http://nblang.nibbleblog.com/download/thebe/language/ko_KR.bit
location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. #try_files $uri $uri/ =404; try_files $uri $uri/ @rewrites; } location @rewrites { rewrite ^/category/([^/]+)page-([0-9+])$ /index.php?controller=blog&action=view&category=$1&number=$2 last; rewrite ^/category/([^/]+)/$ /index.php?controller=blog&action=view&category=$1&number=0 last; rewrite ^/tag/([^/]+)/page-([0-9]+)$ /index.php?controller=blog&action=view&tag=$1&number=$2 last; rewrite ^/tag/([^/]+)/$ /index.php?controller=blog&action=view&tag=$1&number=0 last; rewrite ^/page-([0-9]+)$ /index.php?controller=blog&action=view&number=$1 last; rewrite ^/post/([^/]+)/$ /index.php?controller=post&action=view&post=$1 last; rewrite ^/post-([0-9]+)/(.*)$ /index.php?controller=post&action=view&id_post=$1 last; rewrite ^/page/([^/]+)/$ /index.php?controller=page&action=view&page=$1 last; rewrite ^/feed/$ /feed.php last; rewrite ^/([^/]+)/$ /index.php?controller=page&action=$1 last; }