public function editActivity(string $servicename):Renderer
    {
        $status = $this->get("request")->get("status");
        $namespace = $this->get("request")->get("namespace");

        if ($status == "" || !in_array($status, array("enabled", "disabled"))) {
            return ((new Renderer())->jsonRenderer(array("code" => 500, "msg" => "Undefined status : $status")));
        }

        if ($namespace == "") {
            return ((new Renderer())->jsonRenderer(array("code" => 500, "msg" => "Undefined namespace : $namespace")));
        }


        $f = json_decode(file_get_contents(FEnv::get("framework.config.core.services.file")));

        foreach ($f as $one => $val) {
            if ($one == $servicename) {
                $val->namespace = trim(($namespace));
                $val->status = trim($status);
                break;
            }
        }
        $f = json_encode($f, JSON_PRETTY_PRINT);
        file_put_contents(FEnv::get("framework.config.core.services.file"), $f);

        return ((new Renderer())->jsonRenderer(array("code" => 200, "msg" => "OK")));
    }
public function editActivity(string $servicename):Renderer
    {
        $status = $this->get("request")->get("status");
        $namespace = $this->get("request")->get("namespace");

        if ($status == "" || !in_array($status, array("enabled", "disabled"))) {
            return ((new Renderer())->jsonRenderer(array("code" => 500, "msg" => "Undefined status : $status")));
        }

        if ($namespace == "") {
            return ((new Renderer())->jsonRenderer(array("code" => 500, "msg" => "Undefined namespace : $namespace")));
        }


        $f = json_decode(file_get_contents(FEnv::get("framework.config.core.services.file")));

        foreach ($f as $one => $val) {
            if ($one == $servicename) {
                $val->namespace = trim(($namespace));
                $val->status = trim($status);
                break;
            }
        }
        $f = json_encode($f, JSON_PRETTY_PRINT);
        file_put_contents(FEnv::get("framework.config.core.services.file"), $f);

        return ((new Renderer())->jsonRenderer(array("code" => 200, "msg" => "OK")));
    }
public function editActivity ( string $ servicename ) : Renderer { $ status = $ this -> get ( "request" ) -> get ( "status" ) ; $ namespace = $ this -> get ( "request" ) -> get ( "namespace" ) ; if ( $ status == "" || ! in_array ( $ status , array ( "enabled" , "disabled" ) ) ) { return ( ( new Renderer ( ) ) -> jsonRenderer ( array ( "code" => 500 , "msg" => "Undefined status : $status" ) ) ) ; } if ( $ namespace == "" ) { return ( ( new Renderer ( ) ) -> jsonRenderer ( array ( "code" => 500 , "msg" => "Undefined namespace : $namespace" ) ) ) ; } $ f = json_decode ( file_get_contents ( FEnv :: get ( "framework.config.core.services.file" ) ) ) ; foreach ( $ f as $ one => $ val ) { if ( $ one == $ servicename ) { $ val -> namespace = trim ( ( $ namespace ) ) ; $ val -> status = trim ( $ status ) ; break ; } } $ f = json_encode ( $ f , JSON_PRETTY_PRINT ) ; file_put_contents ( FEnv :: get ( "framework.config.core.services.file" ) , $ f ) ; return ( ( new Renderer ( ) ) -> jsonRenderer ( array ( "code" => 200 , "msg" => "OK" ) ) ) ; }
edit one service
@param string $servicename Service name
@return Renderer JSON render
@throws \Exception
edit one service