private function addFile(Phar $phar, SplFileInfo $file, $strip = false)
    {
        // Forçar tirar espaços de PHP.
        $strip = ($file->getExtension() == 'php') ? true : $strip;

        $this->fireEvent($file->getRealPath());

        $path = str_replace($this->pathBase, '', $file->getRealPath());
        $content = $this->files->get($file);

        // Tratar espacos?
        if ($strip) {
            $content = $this->stripWhitespace($content);
        }

        // Eh arquivo de licenca?
        if ('LICENSE' === basename($file)) {
            $content = "\n" . $content . "\n";
        }

        // Tratar parametros
        foreach ($this->params as $pk => $pv) {
            $pk = sprintf('@%s@', $pk);
            $content = str_replace($pk, $pv, $content);
        }
        $phar->addFromString($path, $content);
    }
private function addFile(Phar $phar, SplFileInfo $file, $strip = false)
    {
        // Forçar tirar espaços de PHP.
        $strip = ($file->getExtension() == 'php') ? true : $strip;

        $this->fireEvent($file->getRealPath());

        $path = str_replace($this->pathBase, '', $file->getRealPath());
        $content = $this->files->get($file);

        // Tratar espacos?
        if ($strip) {
            $content = $this->stripWhitespace($content);
        }

        // Eh arquivo de licenca?
        if ('LICENSE' === basename($file)) {
            $content = "\n" . $content . "\n";
        }

        // Tratar parametros
        foreach ($this->params as $pk => $pv) {
            $pk = sprintf('@%s@', $pk);
            $content = str_replace($pk, $pv, $content);
        }
        $phar->addFromString($path, $content);
    }
private function addFile ( Phar $ phar , SplFileInfo $ file , $ strip = false ) { // Forçar tirar espaços de PHP. $ strip = ( $ file -> getExtension ( ) == 'php' ) ? true : $ strip ; $ this -> fireEvent ( $ file -> getRealPath ( ) ) ; $ path = str_replace ( $ this -> pathBase , '' , $ file -> getRealPath ( ) ) ; $ content = $ this -> files -> get ( $ file ) ; // Tratar espacos? if ( $ strip ) { $ content = $ this -> stripWhitespace ( $ content ) ; } // Eh arquivo de licenca? if ( 'LICENSE' === basename ( $ file ) ) { $ content = "\n" . $ content . "\n" ; } // Tratar parametros foreach ( $ this -> params as $ pk => $ pv ) { $ pk = sprintf ( '@%s@' , $ pk ) ; $ content = str_replace ( $ pk , $ pv , $ content ) ; } $ phar -> addFromString ( $ path , $ content ) ; }
Adicionar arquivo tratado no phar.

@param Phar $phar
@param SplFileInfo $file
@param bool $strip
Adicionar arquivo tratado no phar .