toInt를 더 튼튼하게 개선. ROOT가 지정되었으므로 강제 지정하는 코드 해제
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
if(!defined('ROOT')){
|
||||
define('ROOT', '../..');
|
||||
}
|
||||
|
||||
class AppConf{
|
||||
private static $serverList = null;
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
if(!defined('ROOT')){
|
||||
define('ROOT', '../..');
|
||||
}
|
||||
class Lock {
|
||||
private static $l = ROOT.'/d_log/lock.txt';
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
if(!defined('ROOT')){
|
||||
define('ROOT', '../..');
|
||||
}
|
||||
|
||||
/**
|
||||
* Session Wrapper. 내부적으로 $_SESSION을 이용
|
||||
*
|
||||
|
||||
+8
-2
@@ -42,7 +42,10 @@ class Util extends \utilphp\util{
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public static function toInt($val, $force=false){
|
||||
public static function toInt($val, $silent=false){
|
||||
if(!isset($val)){
|
||||
return null;
|
||||
}
|
||||
if($val === null){
|
||||
return null;
|
||||
}
|
||||
@@ -56,7 +59,10 @@ class Util extends \utilphp\util{
|
||||
return null;
|
||||
}
|
||||
|
||||
if($force){
|
||||
if($silent){
|
||||
if($val == null){
|
||||
return null;
|
||||
}
|
||||
return intval($val);
|
||||
}
|
||||
throw new InvalidArgumentException('올바르지 않은 타입형 :'.$val);
|
||||
|
||||
Reference in New Issue
Block a user