Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    李霖
    @stelin
    加我微信 phpcrazy126
    EthanChenLi
    @EthanChenLi
    昨天QQ你问我 我回复你了 然后就没有然后了
    好了 加你了
    david2066
    @david2066
    php 7.3.11 & swoole 4.4.12 & 2.0.6版本 在ws模块下直接用\Swoft::server()->push(1, 'hi, 你好啊!'),会报致命错误
    EthanChenLi
    @EthanChenLi
    session这个模块貌似有个BUG
    david2066
    @david2066
    2.0.7 rpc 好像也有问题
    2.0.6 websockst 调用Swoft::server()几乎报错
    感觉测试不严格,就发布了
    jinsx
    @jinsx
    1
    李霖
    @stelin
    rpc 有什么问题
    DANNY
    @lifeblood
    这个框架可以用于生产环境吗
    OvO
    @sakuraovq
    当然可以啊
    Alex
    @dcdebug
    请问一下,swoft的跨域中间件怎么处理?
    我这边写的怎么没有用,域名访问还是403
     /**
     * Process an incoming server request.
     * @param ServerRequestInterface $request
     * @param RequestHandlerInterface $handler
     * @return ResponseInterface
     * @inheritdoc
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        if ('OPTIONS' === $request->getMethod()) {
            $response = context()->getResponse();
            return $this->configResponse($response);
        }
        $response = $handler->handle($request);
        return $this->configResponse($response);
    }
    
    private function configResponse(ResponseInterface $response)
    {
        return $response
            ->withHeader('Access-Control-Allow-Origin', '*')
            ->withHeader('Access-Control-Allow-Headers', 'X-Requested-With, Content-Type, Accept, Origin, Authorization')
            ->withHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, PATCH, OPTIONS');
    }
    这样写有哪里不合适吗?
    Hety
    @Hetystars
    image.png
    这样设置cron,显示每10分钟时,1秒以内会运行两次
    @stelin @inhere
    QD WEN
    @wqd1688
    没人?
    010
    talkativeYang
    @yangshen1987
    你的docker又GG了
    哥啊
    feimao90
    @feimao90
    没人?
    MadForCoding
    @madfortech
    I am a self-learner . And I'm having trouble installing semantic-ui on my project Can anyone help me
    Thien
    @duythien
    The docs on domain io is down now
    image.png
    Calnexus Kelvin
    @calnexus
    Am new to swoft but Damn i cant really find any good documentation out here.Anyone with a link, a book or any reference point i can really borrow
    Samuel Jie
    @suhanyujie
    有人吗?swoft 在开发时如何热加载呢
    代码热更新
    需要怎么配置呢
    wumahoo
    @wumahoo
    热更新就是 reload
    fabian bob
    @bobfabian66_gitlab
    我想问一下 swoft 怎么去接入 ES 搜索 ,我用原生的那种composer.json ,可是 文档写不进去
    I have a question, how can swoft access Es search? I write it in the native way, but the document cannot be written in
    no one?
    fabian bob
    @bobfabian66_gitlab
    ?
    ningjin
    @hurryking
    cool
    fabian bob
    @bobfabian66_gitlab
    什么意思?
    ningjin
    @hurryking
    没错误信息 没上下文 谁能解决
    我就是来凑个热闹 膜拜下大佬
    提问的智慧
    Ata amini
    @ata-amini

    Hi @stelin
    How to scan annotations in custom path or file in application initialize process?
    I need to create some service which they may register some routes to api application and some routes to backend application.
    In case, imagine i have a directory named UserService and have two directories like Http\Api\SomeController and Http\Backend\SomeController, when running an application with context api then this directory Http\Api\SomeController must be scanned and in backend context this directory: Http\Backend\SomeController.

    i create an annotation named Service and in ServiceParser check for input values which may be api , backend or both, then must tell swoft to scan related directories.
    is it can be done now with swoft? or sowft has any solution to achieve this idea?

    ServiceParser:

    public function parse(int $type, $annotation): array
            {
                // Check instance
                if ($type !== self::TYPE_CLASS) {
                    throw new HttpServerException('`@AbstractService` must be defined by class!');
                }
    
                // Register service
                ServiceFactory::Register($this->className, $annotation->getContexts());
    
                // Returns singleton options
                return [$this->className, $this->className, Bean::SINGLETON, ''];
            }

    ServiceFactory:

    public static function Register(string $class, array $contexts)

    In Register method 'll create an instance of given class and get its path and Swoft must be notified to scan extra path for annotations.
    Thanks a lot*

    Yang.l
    @L-Y
    The extension of 'xdebug' must be closed
    what's this mean
    evilk123
    @evilk123
    image.png
    请问下,这是什么原因? swoft 2.0.8
    @stelin
    evilk123
    @evilk123
    难道 swoft/http-client 组件,只适用于 swoft 1.X版本吗?
    朝东
    @Happydong
    hello
    BIGF
    @firstbullet
    swoft+jwt有人做过吗