Skip to content

Commit

Permalink
bug
Browse files Browse the repository at this point in the history
  • Loading branch information
东流 committed Jul 3, 2018
1 parent c1e3337 commit e222778
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
5 changes: 5 additions & 0 deletions App.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public function run($params)
$item['service'] = $params[1]??'';
$item['command'] = $params[2]??'';
$item['env'] = $params[3]??'';

if ($item['service']!="-h" && $item['service']!="-t") {
return true;
}

DI::set("port", $params[4]??'');
$this->configure($item['env']);
if ($item['service'] == '--help') {
Expand Down
28 changes: 14 additions & 14 deletions Common/CommonFun.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* CommonFun 公用方法
*
*
* @package ultraman\Tools
* @copyright Copyright (c) 2017, ultraman
*/
Expand All @@ -13,22 +13,22 @@ class CommonFun
{
/**
* 数据过滤
* @param array $keys
* @param array $params
* @param array $keys
* @param array $params
*/

public static function FilterNULL($keys,$params)
public static function FilterNULL($keys, $params)
{
if(count($keys) == 0 || count($params) == 0 ){
if (count($keys) == 0 || count($params) == 0) {
return $params;
}

$item = [];
foreach ($keys as $key => $value) {
if(!isset($params[$value])){
if (!isset($params[$value])) {
continue;
}
if($params[$value] !== ""){
if ($params[$value] !== null) {
$item[$value] = $params[$value];
}
}
Expand All @@ -40,7 +40,7 @@ public static function FilterNULL($keys,$params)
* 类型转换
*/

public static function Types($params,$types)
public static function Types($params, $types)
{
switch ($types) {
case 'int':
Expand Down Expand Up @@ -72,10 +72,10 @@ public static function Types($params,$types)
* 重新封装分割
*/

public static function explode_keys($key,$params)
public static function explode_keys($key, $params)
{
$items = [];
if($params == ""){
if ($params == "") {
return $items;
}

Expand All @@ -91,9 +91,9 @@ public static function explode_keys($key,$params)
* 为参数或字段加引号 或者特殊符号
*/

public static function Quotes($keys,$params)
public static function Quotes($keys, $params)
{
if($keys == ""){
if ($keys == "") {
$keys = "'";
}

Expand All @@ -113,5 +113,5 @@ public static function microtime()
{
list($usec, $sec) = explode(' ', microtime());
return ((float)$usec + (float)$sec);
}
}
}
}

0 comments on commit e222778

Please sign in to comment.