src/Bandolier/Type/Paths.php
public static function curlPath($toPath, $paths = null, $dockerEnv = "")
    {
        if (!$paths) {
            $paths = new Paths();
        }

        if (!$dockerEnv) {
            $dockerEnv = self::CURL_CHECK_FILE;
        }
        $serverName = self::serverName();

        if ($paths->domainNameIsWeb($serverName)
            || ($paths->domainNameIsLocalHost($serverName) && $paths->checkForEnvironmentFile($dockerEnv))
        ) {
            $serverName = $paths->getDomainNameWeb();
        }

        return self::httpProtocol() . '://' . $serverName . DIRECTORY_SEPARATOR . ltrim($toPath, DIRECTORY_SEPARATOR);
    }
public static function curlPath($toPath, $paths = null, $dockerEnv = "")
    {
        if (!$paths) {
            $paths = new Paths();
        }

        if (!$dockerEnv) {
            $dockerEnv = self::CURL_CHECK_FILE;
        }
        $serverName = self::serverName();

        if ($paths->domainNameIsWeb($serverName)
            || ($paths->domainNameIsLocalHost($serverName) && $paths->checkForEnvironmentFile($dockerEnv))
        ) {
            $serverName = $paths->getDomainNameWeb();
        }

        return self::httpProtocol() . '://' . $serverName . DIRECTORY_SEPARATOR . ltrim($toPath, DIRECTORY_SEPARATOR);
    }
public static function curlPath ( $ toPath , $ paths = null , $ dockerEnv = "" ) { if ( ! $ paths ) { $ paths = new Paths ( ) ; } if ( ! $ dockerEnv ) { $ dockerEnv = self :: CURL_CHECK_FILE ; } $ serverName = self :: serverName ( ) ; if ( $ paths -> domainNameIsWeb ( $ serverName ) || ( $ paths -> domainNameIsLocalHost ( $ serverName ) && $ paths -> checkForEnvironmentFile ( $ dockerEnv ) ) ) { $ serverName = $ paths -> getDomainNameWeb ( ) ; } return self :: httpProtocol ( ) . '://' . $ serverName . DIRECTORY_SEPARATOR . ltrim ( $ toPath , DIRECTORY_SEPARATOR ) ; }
Check to see what curl path should be used. If running in
localhost or currently run inside a container use web,
otherwise use the current SERVER_NAME

@param string $toPath    Path to start from
@param Paths  $paths     Instance of Path (or mock)
@param string $dockerEnv Path to environment file that should exist if we're in a docker container

@return string
Check to see what curl path should be used . If running in localhost or currently run inside a container use web otherwise use the current SERVER_NAME