Skip to content
This repository was archived by the owner on Nov 14, 2023. It is now read-only.
This repository was archived by the owner on Nov 14, 2023. It is now read-only.

Installation #3

Description

@volomike

Please explain how the config.php.sample is customized.

Activity

  1. luisvegaa commented on May 23, 2021

    @luisvegaa

    // re name file to config.php

    // change url base example:
    // http://hostname/git/repo.git
    $url_base = '/git';

    // Repositories
    $repos = array(
    // repo create by git init, never use git init --bare
    array("/repo.git", "/home/user/repo/.git")
    );

    // sorry for my bad english

  2. Edgepath commented on Jan 23, 2023

    @Edgepath

    Hello,

    1. first off: COOL that it is (IN THEORY) possible to implement a git-server in PHP :)

    2. problem: this implementation seems

    2.1.) HIGHLY incomplete (no push, just get)

    2.2.) seems to require a webserver that has access to the git command

    1. the config.php.sample actually DOES NOT WORK :(

    check out this bit of code:

    
    foreach ($repos as $repo)
    {
        $search_for_this = '~^' . $url_base . $repo[0] . '(/.*)~';
        //                              in this
        if(preg_match($search_for_this, $url_path, $matches))
        {
    
    

    with the above config from luisveega that would result in:

    
    $search_for_this = ~^/git/repo.git(/.*)~	
    $url_path = /php-git-server/index.php
    
    

    which will result in $matches being EMPTY as the pattern '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/git/repo.git' can not be found in /php-git-server/index.php

    maybe getting something wrong here... but this implementation seems completely broken.

    it might be an "wow it could be done" repo.

    but right now it does not seem to be of any use in this state?

    so in theory the user could do a:

    git clone http://localhost/php-git-server/index.php (? but how to pass parameter which repo to clone?)

    and it will issue this command to the server:

    $_REQUEST Array [1] service=git-upload-pack

    which equals to calling:

    http://localhost/php-git-server/index.php?service=git-upload-pack

    if someone is really good at git (which in itself is complex) and would like to make a better actually working git php-sever let me know :D (imho COULD do the php part)

    check out: https://git-scm.com/docs/gitprotocol-v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions