src/Command/SelfUpdateCommand.php
protected function determineLocalFileName()
    {
        // First: try to convert server argv 0 to a real path first (absolute path to a phar).
        if (false !== ($localFilename = realpath($_SERVER['argv'][0]))) {
            return $localFilename;
        }

        // Second: try the currently running phar file now.
        if ($localFilename = \Phar::running(false)) {
            return $localFilename;
        }

        // Fall back to server argv 0 (retaining relative path) and hope best.
        return $_SERVER['argv'][0];
    }
protected function determineLocalFileName()
    {
        // First: try to convert server argv 0 to a real path first (absolute path to a phar).
        if (false !== ($localFilename = realpath($_SERVER['argv'][0]))) {
            return $localFilename;
        }

        // Second: try the currently running phar file now.
        if ($localFilename = \Phar::running(false)) {
            return $localFilename;
        }

        // Fall back to server argv 0 (retaining relative path) and hope best.
        return $_SERVER['argv'][0];
    }
protected function determineLocalFileName ( ) { // First: try to convert server argv 0 to a real path first (absolute path to a phar). if ( false !== ( $ localFilename = realpath ( $ _SERVER [ 'argv' ] [ 0 ] ) ) ) { return $ localFilename ; } // Second: try the currently running phar file now. if ( $ localFilename = \ Phar :: running ( false ) ) { return $ localFilename ; } // Fall back to server argv 0 (retaining relative path) and hope best. return $ _SERVER [ 'argv' ] [ 0 ] ; }
Determine the local file name of the current running phar.

@return string

@SuppressWarnings(PHPMD.Superglobals)
@SuppressWarnings(PHPMD.CamelCaseVariableName)
Determine the local file name of the current running phar .