Skip to content

Issue with port other than 80? #53

@phpPhil

Description

@phpPhil

Hi,

What is this feature about (expected vs actual behaviour)?

Expected: When specifying a port for the Doctrine connection the driver will request the REST service on the given port
Actual: The REST service is requested on the default HTTP port and I receive a message:

Failed to connect() to host or proxy

I swear everything is running :)

How can I reproduce it?

Specify a custom port (e.g. 8000) in Symfony 3 config.yml:

# Doctrine Configuration
doctrine:
    dbal:
        default_connection: restservices
        connections:
            restservices:
                driver_class: "Circle\\DoctrineRestDriver\\Driver"
                host: http://127.0.0.1
                port: 8000

Then use the REST entity manager to fetch a record:

class MyController extends Controller
{
    /**
     * @Route("/")
     *
     */
    public function indexAction()
    {
        $singleresult = $this->getDoctrine()->getRepository('MyBundle:MyEntity')->find(1);        
        if ($singleresult == null) {
            return new View("Country not found", Response::HTTP_NOT_FOUND);
        }
        return $singleresult;
    }
}

Does it take minutes, hours or days to fix?

Unsure, but it sounds like a isolated problem.

Additional Information

I got this to work with REST API on port 80.

Thanks for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions