Git Product home page Git Product logo

php-msf-demo's People

Contributors

pinguo-xiaoshiyong avatar pinguo-xudianyang avatar pinguo-zhanglu avatar shellvon avatar xudianyang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-msf-demo's Issues

Docker镜像下output小数 BUG

运行环境:Docker镜像

运行代码:

namespace App\Controllers;
use PG\MSF\Controllers\Controller;
class Welcome extends Controller
{
    public function actionIndex()
    {
        $divide = 58/100;
        $this->output($divide);
    }
}

输出结果:0.57999999999999996

期待结果:0.58

后来发现是Docker镜像下的php版本问题。在Docker环境里面运行下面的代码就会出现上述问题。

<?php
$total = 58;
echo json_encode($total/100.00, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
$ php test.php
0.57999999999999996

看来要更新下Docker镜像的PHP版本。

RESTful的配置不生效

按开发文档,可以进行路由映射配置,但不知道应该怎么样配置?

如下配置在config/params.php 或者 config/docker/params.php
直接访问/users/ask 依然回提示找不到方法

$config['rest']['route']['rules'] = [
'GET,POST /groups' => '/account/profile',
'GET /users/ask' => 'user/apply',
'GET /users' => 'user/index',
'GET /users/uid:\d+' => 'user/view',
'PUT /users/method:\w+' => 'user/',
'DELETE /users/uid:\d+' => 'user/delete',
]

outputJson传入错误HttpCode导致阻塞

开了Rest\Controller,使用outputJson输出,如果传入的HttpCode是错误的,访问会一直阻塞

use PG\MSF\Rest\Controller;                                                                                                                                     
use App\Models\Demo as DemoModel;                                                                                                                               

class Redis extends Controller                                                                                                                                  
{
	// Redis连接池读写示例
	public function actionPoolSetGet()
	{
		yield $this->getRedisPool('p1')->set('key1', 'val1');
		$val = yield $this->getRedisPool('p1')->get('key1'); 
		$this->outputJson($val, "test error", 800);
	}
}

使用registry.cn-hangzhou.aliyuncs.com/pinguo-ops/php-msf-docker:latest镜像无法使用

操作步骤如下:

  1. git clone [email protected]:pinguo/php-msf-demo.git && cd php-msf-demo

此时目录为
qq 20170929181203

  1. 继续 sudo docker run -d --name php-msf -p 8808:8000 -p 2202:22 -v $(pwd):"/home/worker/data/www" registry.cn-hangzhou.aliyuncs.com/pinguo-ops/php-msf-docker
    此时返回
    qq 20170929181306

  2. 登陆容器sshd ssh -p 2202 [email protected] 执行composer install 和 supervisorctl update status如下:
    qq 20170929181553

请问docker上面提供的image不能直接用吗,需要先运行项目根目录下的build.sh才行

demo无法使用

这个demo直接git下来build无法使用, 只能把代码拷贝到php-msf下面去测试。server.php代码是windows换行符,执行会报错:
[worker@newdev php-msf-demo]$ ./server.php
-bash: ./server.php: /home/worker/php/bin/php^M: bad interpreter: No such file or directory

改为unix换行符,执行没有报错,但无任何反应,启动失败。
[worker@newdev php-msf-demo]$ ./server.php
[worker@newdev php-msf-demo]$

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.