Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with port other than 80? #53

Open
phpPhil opened this issue Apr 22, 2017 · 1 comment
Open

Issue with port other than 80? #53

phpPhil opened this issue Apr 22, 2017 · 1 comment

Comments

@phpPhil
Copy link

phpPhil commented Apr 22, 2017

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.

@phpPhil phpPhil changed the title Port is ignored Issue with ports not on port 80? Apr 22, 2017
@phpPhil phpPhil changed the title Issue with ports not on port 80? Issue with port other than 80? Apr 22, 2017
@TobiasHauck
Copy link
Member

Hey Phil, this one is a bug, you're right. The only thing you can actually do to use other ports than 80 is setting a complete URL to the host parameter (This is what I've done in the function test to use port 3000). I'll inform you when the issue is solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants