Skip to content

MikyWoW/vendor-as-phar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using PHAR for composer libraries

Insted of copy vendor folder to hosting you just copy vendor.phar. All libraries are build in to one phar file. Better for fast FTP transfer speed. On your development machine you need to set phar.readonly=Off in php.ini to be able to build phar file.

Installation

composer install
php build.php

You need to run phar build always after composer commands to update phar file.

Overview

app - Folder with your PHP aplication. www - Folder with static files and index.php to boot app. build.php - Build script to convert vendor folder to phar file.

Important

By default phar files are readable as normal text files. You need configure server to block this. Otherwise anybody could read source code inside phar file.

Before uploading phar to production do not forget to composer install with all optimizations and then build phar file again. For examle:

composer install --no-ansi --no-dev --no-interaction --no-progress --no-scripts --optimize-autoloader

Performance

Be aware that phar can hit your performance. Read some articles and test it with your application.

About

Build PHP vendor folder into single phar file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages