View xmlconv.php
<?php | |
/** | |
* XE 구버전의 PHP 언어파일이나 라이믹스의 PHP 언어파일을 | |
* lang.xml 형식으로 변환하는 프로그램 | |
* | |
* Copyright (c) 2016 Kijin Sung <kijin@kijinsung.com> | |
* License: MIT | |
*/ |
View fixcloudflare.php
<?php | |
/** | |
* CloudFlare 사용시 실제 방문자 IP 및 SSL 사용 여부를 | |
* 정확하게 파악하지 못하는 문제를 해결하는 클래스 | |
* 웹서버에 mod_cloudflare를 설치하기 곤란한 경우 사용한다 | |
* | |
* Written by 기진곰 <kijin@kijinsung.com> | |
* License: Public Domain | |
* |
View pbkdf2.compat.php
<?php | |
/* | |
* Password Hashing with PBKDF2 (http://crackstation.net/hashing-security.htm). | |
* Copyright (c) 2013, Taylor Hornby | |
* All rights reserved. | |
* | |
* Modified to Work with Older Versions of PHP | |
* Copyright (c) 2014, Kijin Sung | |
* All rights reserved. | |
* |
View korean_inflection.php
<?php | |
// License: Public Domain | |
// | |
// 마지막 글자에 받침이 있으면 0보다 큰 정수를 반환하고 | |
// 받침이 없으면 0을 반환한다. | |
// | |
// 예: | |
// $word = '깃허브'; | |
// echo $word . (has_batchim($word) ? '을' : '를'); |
View attachment.php
<?php | |
/** | |
* PHP 파일 다운로드 함수. | |
* Version 1.3 | |
* | |
* Copyright (c) 2014 성기진 Kijin Sung | |
* | |
* License: MIT License (a.k.a. X11 License) | |
* http://www.olis.or.kr/ossw/license/license/detail.do?lid=1006 |
View rsa_encrypt.php
<?php | |
// 비대칭 알고리듬인 RSA를 사용하여 문자열을 암호화하는 법. | |
// 개인키 비밀번호는 암호화할 때는 필요없고 복호화할 때만 입력하면 되므로 | |
// 서버에 저장할 필요 없이 그때그때 관리자가 입력하도록 해도 된다. | |
// PHP 5.2 이상, openssl 모듈이 필요하다. | |
// RSA 개인키, 공개키 조합을 생성한다. | |
// 키 생성에는 시간이 많이 걸리므로, 한 번만 생성하여 저장해 두고 사용하면 된다. | |
// 단, 비밀번호는 개인키를 사용할 때마다 필요하다. |
View aes_encrypt.php
<?php | |
// AES-256과 HMAC을 사용하여 문자열을 암호화하고 위변조를 방지하는 법. | |
// 비밀번호는 서버만 알고 있어야 한다. 절대 클라이언트에게 전송해서는 안된다. | |
// PHP 5.2 이상, mcrypt 모듈이 필요하다. | |
// 문자열을 암호화한다. | |
function aes_encrypt($plaintext, $password) | |
{ |
View ezpdo.php
<?php | |
/** | |
* Easy PDO for PHP 5.x | |
* Version 1.2 | |
* | |
* Copyright (c) 2009-2014 Kijin Sung <kijin@kijinsung.com> | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal |
View gist:5829736
// 웹사이트에서 다운받아 적당한 곳에 압축 푸세요. | |
require_once('/경로/htmlpurifier/library/HTMLPurifier.auto.php'); | |
// 기본 설정을 불러온 후 적당히 커스터마이징을 해줍니다. | |
$config = HTMLPurifier_Config::createDefault(); | |
$config->set('Attr.EnableID', false); | |
$config->set('Attr.DefaultImageAlt', ''); | |
// 인터넷 주소를 자동으로 링크로 바꿔주는 기능 | |
$config->set('AutoFormat.Linkify', true); |
View string.php
<?php | |
// String Object | |
// Copyright (c) 2010 Kijin Sung <kijin@kijinsung.com> | |
// License: WTFPL <http://www.wtfpl.net/> | |
class String | |
{ | |
// Some properties. | |