Skip to content

Instantly share code, notes, and snippets.

@Djuki
Created October 22, 2015 10:18
Show Gist options
  • Save Djuki/d3c6b2a769709f5c39cf to your computer and use it in GitHub Desktop.
Save Djuki/d3c6b2a769709f5c39cf to your computer and use it in GitHub Desktop.
Guide How to develop company packages

Packages development Guide

Intro

Our company has private packages which are shared between projects. We use composer to install our private packages.

Our static composer repository is located on this URL:http://45.33.79.118/satis/web/

To add our composer packages repository to composer.json add this lines:

{
    "repositories": [
        {
            "type": "composer",
            "url": "http://45.33.79.118/satis/web"
        }
    ]
}

Install private package

In console run: composer require "jackborn/payplan"

Install private package when you want to make changes on package

  • Delete the vendor/jackborn/paylan folder if you want to change payplan package. Delete just this package folder
  • run composer install "jackborn/payplan" --prefer-source This will install package with git inside. This will allow you to go into the package folder and commit, push and pull changes from this package.

When you make desired chanegs you need to commit and push them liek this:

  • cd vendor/jackborn/payplan
  • git branch to make sure which branch is active
  • git add specific_file.php and never use add . because you want to be sure what are you commiting
  • git push origin master to push changes to package repository
  • cd .... if you use zsh or get back four steps to be located into project root.
  • Now you are into your main project but your project need to get latest package version and write it down into composet.lock file
  • composer update "jackborn/payplan" --prefer-source
  • git add composer.lock
  • git commit -m "Describe why we update payplan package"
  • If you want to push now run git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment