mnapoli / phpBeanstalkdAdmin

[UNMAINTAINED] Beanstalkd admin interface
http://mnapoli.github.com/phpBeanstalkdAdmin/
Other
132 stars 15 forks source link

double port error on connect fail with custom port #1

Closed circulon closed 11 years ago

circulon commented 12 years ago

Hi

Nice Interface, Makes my development sooo much simpler.

Ok this is a minor aesthetic issue but confusing to the beanstalk noob

if you type an invalid ip with a custom port in the server box you will get an error stating a socket connect failure to the ip followed by the custom port followed by :11300.

eg Socket error 60: Operation timed out (connecting to 192.168.42.10:23267:11300)

This seems to be due to the Job controller passing the server and port as a single string.

I fixed it by changing the connection setup of the getListAction() in the job controller to

    $server = $this->_getParam("server");
    $exp=explode(":", $server);
    $server = (isset($exp[0]))?$exp[0]:"localhost";
    $port =  (isset($exp[1]))?$exp[1]:"11300";
    $data = array ();
    try {
        // Connect to the server and get job list
        $messageQueue = new Pheanstalk_Pheanstalk($server,$port);

You may have a better method but this works for me

Thanks