Jump to content

Daniel290499

New Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by Daniel290499

  1. Yeah, I tried proc_.

    I couldn't get it to work.

    Have you got a working example?

     

    This is why I say, it's not about git.

    I'll setup my git properly, no problem.

    But this now is about learning something new :)

    That's why the title is about entering data in an executed command.

    It just so happens that I stumbled upon this, while fiddling with a local git server.

    Regardless of whether I use this for git, I want to add more knowledge to my PHP tool belt.

    You get what I'm saying?

  2. You can use array_push() to add elements to an array.

    $newArray = array();
    $newArray['boss'] => $row['bossid'];
    $newArray['tasks'] => $row['tasks'];
    $newArray['timeframe'] => $row['tframe'];
    
    array_push($_SESSION['users'] , $newArray);

    Instead of creating $newArray, you can just insert $row into the array.

    I did it this way because I don't know what else is in $row.

    It's a personal choice, but I break up my code a lot.

    I hope this helps :)

  3. Hello all

     

    I'm new to this forum.

    I've been struggling on this problem for a few days now.

    I’m writing a script to automatically push code to a git server.
    I’m using php and running the script via the command line.
    After asking the user to enter the branch and commit message, the following code runs:
     

    exec(‘git config user.name "’ . $userName . ‘"’);
    exec(‘git config user.email "’ . $userEmail . ‘"’);
    
    exec('git checkout -b ’ . $branch);
    exec(‘git add --all’);
    exec(‘git commit -m "’ . $message . ‘"’);
    
    exec('git push origin  . $branch);

     

    When running the last command, the script stops and asks for a user name, then a password.
    How can I enter that username and password via the script?
    I don’t want to have to type in the user name and password each time.
    As I said, I've been stuck on this for 2 days now.

    I tried other forums, searching the net.

    I'm frustrated...

    Thanks in advance.
    Have a lovely day.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.