Download the PHP package sanatorium/githelper without Composer

On this page you can find all versions of the php package sanatorium/githelper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package githelper

sanatorium/githelper

Extension to manage versioned extensions & dependencies

Documentation

Helper for managing git packages within your Cartalyst Platform.

Configuration

You can setup paths to your extensions or any other packages in config/sanatorium-githelper.php

/*
|--------------------------------------------------------------------------
| Paths
|--------------------------------------------------------------------------
|
| Following paths will be scanned by this extension to find
| versioned extensions. These will be available in admin
| area for automated operations.
|
*/

'paths' => [
    'extensions/sanatorium',
    '../langs',
]

Updating extensions directly from git

Now when you are syncing extensions to git, you might want to always keep your extensions at the latest version. Following artisan command (php artisan dev) is made for that:

<?php

/**
 * Class Dev
 *
 * Enables you to clone git repositories
 * instead of the composer packages,
 * Meant for development envs.
 *
 * To enable, set environment variable
 * PREFER_GIT=1
 * PREFER_GIT_VENDORS=acme,sanatorium
 *
 *
 * NOTICE OF LICENSE
 *
 * @package    App\Console\Commands
 * @version    1.0.0
 * @author     Sanatorium
 * @license    WTFPL
 * @copyright  (c) 2015-2016, Sanatorium
 * @link       http://sanatorium.ninja
 */

namespace App\Console\Commands;

use Illuminate\Console\Command;

class Dev extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'dev';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Enables clone git repositories instead of composer';

    /**
     * Checks if current environment configuration
     * is set to prefer git packages, if TRUE
     * triggers cloneGitComposerPackages()
     *
     * @return mixed
     */
    public function handle()
    {
        if ( env('PREFER_GIT') == 1 ) {

            $this->cloneGitComposerPackages();

        }
    }

    /**
     * Takes composer required, scans for packages,
     * checks them against the allowed regular
     * expression found in environment.
     *
     * @see PREFER_GIT_REGEX
     * @example PREFER_GIT_REGEX=/sanatorium\/((?!lang).)*$/
     * @return void
     */
    public function cloneGitComposerPackages()
    {
        $regex = env('PREFER_GIT_REGEX');

        $composerPath = base_path('composer.json');

        $composer = json_decode( file_get_contents( $composerPath ), true );

        foreach ($composer['require'] as $package => $version) {

            if ( preg_match($regex, $package) ) {

                $this->clonePackage($package);

            }

        }
    }

    /**
     * Git clones package using git command.
     * Function exec() has to be enabled.
     *
     * @param $package Full name of composer package
     */
    public function clonePackage($package)
    {
        // @todo make this configurable
        $prefix = 'platform-';

        $gitRepo = '[email protected]:' . str_replace('/', '/' . $prefix, $package)  . '.git';

        $targetPath = base_path('extensions/' . $package);

        if (exec('echo test') == 'test') {
            // Delete the original directory
            exec('rm -rf ' . $targetPath);

            // Clone the package to target directory
            exec('git clone ' . $gitRepo . ' ' . $targetPath);
        } else {
           $this->error('Can\'t use git repositories, as exec() function is disabled' . PHP_EOL);
        }

    }
}

Changelog

Support

Point all questions/issues to github Issues, we will attend to them asap.


All versions of githelper with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
cartalyst/composer-installers Version 1.2.*
platform/foundation Version >=2.0 <5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sanatorium/githelper contains the following files

Loading the files please wait ...