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 | |
namespace Holy\Example; | |
class Util | |
{ | |
public function removeFiles($dir, $removeDir = false) | |
{ | |
if (!file_exists($dir)) { | |
return; | |
} | |
if (false !== ($handle = opendir($dir))) { |
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 | |
namespace Holy\Example; | |
require_once realpath(__DIR__ . '/lime.php'); | |
class Util | |
{ | |
public static function H($data, $callback=null) | |
{ | |
if (isset($data) && strcmp($data, '') != 0) { |
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 versions 5 | |
* | |
* @copyright 2011 k-holy <[email protected]> | |
* @author [email protected] | |
* @license http://www.opensource.org/licenses/mit-license.php The MIT License (MIT) | |
*/ | |
namespace Holy\Silex\Provider; |
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 | |
set_include_path('/path/to/pear' . PATH_SEPARATOR . get_include_path()); | |
spl_autoload_register(function($className) { | |
if (false !== ($path = stream_resolve_include_path( | |
str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php')) | |
) { | |
return include $path; | |
} | |
return false; |
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 versions 5 | |
* | |
* @copyright 2011 k-holy <[email protected]> | |
* @author [email protected] | |
* @license http://www.opensource.org/licenses/mit-license.php The MIT License (MIT) | |
*/ | |
namespace Holy\Silex\Provider; |
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 versions 5 | |
* | |
* @copyright 2011 k-holy <[email protected]> | |
* @author [email protected] | |
* @license http://www.opensource.org/licenses/mit-license.php The MIT License (MIT) | |
*/ | |
namespace Holy\Silex\Provider; |
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 | |
namespace Holy\Example; | |
require_once realpath(__DIR__ . '/lime.php'); | |
$conv = function($string) { | |
$i = 0; | |
return array_sum(array_map(function($char) use (&$i) { | |
$num = strpos('ABCDEFGHIJKLMNOPQRSTUVWXYZ', $char) + 1; | |
$num *= pow(26, $i); | |
$i++; |
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 | |
namespace Holy\Example; | |
const MAP_API_URL = 'http://maps.google.com/maps/api/geocode/json?sensor=false®ion=jp'; | |
use Holy\Example\Util as U; | |
class Util { | |
public static function H($data, $default=null) |
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 | |
$constants = get_defined_constants(true); | |
$supportedImageType = function($type) { | |
$_type = 0; | |
switch ($type) { | |
case IMAGETYPE_GIF: | |
$_type = IMG_GIF; | |
break; |
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 | |
namespace Holy\Example; | |
use Holy\Example\Util as U; | |
// ユーティリティクラス | |
class Util { | |
public static function H($var, $default = '') { | |
if (isset($var) && strlen($var) >= 1) { |