GithubHelp home page GithubHelp logo

cdtweb / pharven Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 2.0 19 KB

Pharven bundles your vendor directory into a PHP Archive (PHAR)

Home Page: https://github.com/cdtweb/pharven

License: MIT License

PHP 96.15% HTML 3.85%
composer php phar

pharven's Introduction

Pharven

Build Status

If you have ever needed to commit your vendor/ directory into your project repository then Pharven was built for you.

Pharven bundles your vendor directory into a single PHP Archive (PHAR) and allows you to commit and deploy a single file instead of your entire vendor/ directory.

Installation

Add Pharven to your project using Composer:

composer require cdtweb/pharven

Usage

Add pharven.json to your project root with the following content:

{
    "mount_dirs": [
        "src"
    ]
}

mount_dirs are very important if you are using Composer to autoload your project classes. .phar files act as their own file system, so if your classes aren't mounted, they won't be visible to the Composer autoloader and you will run into problems.

Run Pharven to create/update your PHAR file:

php vendor/bin/pharven

A file named pharven.phar will be added to the working directory. Update your bootstrap to include ./pharven.phar instead of vendor/autoload.php and you're good to go.

<?php
require __DIR__ . '/pharven.phar';

At this point you can add vendor/ to your .gitignore file and commit your pharven.phar file instead.

pharven's People

Contributors

cdtweb avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

pharven's Issues

Add information about the mount_dirs setting to README.md

The mount_dirs setting is important if you are autoloading your project classes through the composer autoloader. Because PHAR files act as their own file system, any classes that you are autoloading through composer need to be "mounted" to the PHAR file, or they won't be found.

Auto-include the vendor directory

Right now the vendor directory is mapped using the include_dirs setting in pharven.json, but it should be automatically included because the primary function of this project is to bundle the vendor/ directory, so it shouldn't be optional.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.