• Resolved ddur

    (@ddur)


    Fix to handle host defined as `localhost:/var/run/mysql/mysql.sock

        //parse out port number if exists
        $port = 3306;//default
        if(stripos($arr_cfg['db.host'],':')) {
            // port or socket?
            $port = is_numeric($port) && ((0+$port) > 0) && ((0+$port) <= PHP_INT_MAX) ? (0+$port) : null;
            if (is_null($port)) {
                // sock
                $port = 3306; //default
            } else {
                // remove port
                $arr_cfg['db.host'] = substr($arr_cfg['db.host'], 0, stripos($arr_cfg['db.host'],':'));
            }
        }
    
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Support Linux Socket connection’ is closed to new replies.