private function fetchLastCommitTimes()
  {
    // Execute command for get list with file name and mtime from GIT log
    $command = "git log --format='format:%ai' --name-only";
    exec($command, $output, $return);
    if ($return!=0) $this->logError("Can not execute command %s in exec", $command);

    // Find latest mtime for each file from $output.
    // Note: Each line is either:
    //       * an empty line
    //       * a timestamp
    //       * a filename.
    $commit_date = '';
    foreach ($output as $line)
    {
      if ((preg_match('/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} [+\-]\d{4}$/', $line)))
      {
        $commit_date = strtotime($line);
      }
      else if ($line!=='')
      {
        $filename = $line;
        if (isset($this->myLastCommitTimes[$filename]) && $this->myLastCommitTimes[$filename]<$commit_date)
        {
          $this->myLastCommitTimes[$filename] = $commit_date;
        }
      }
    }
  }
private function fetchLastCommitTimes()
  {
    // Execute command for get list with file name and mtime from GIT log
    $command = "git log --format='format:%ai' --name-only";
    exec($command, $output, $return);
    if ($return!=0) $this->logError("Can not execute command %s in exec", $command);

    // Find latest mtime for each file from $output.
    // Note: Each line is either:
    //       * an empty line
    //       * a timestamp
    //       * a filename.
    $commit_date = '';
    foreach ($output as $line)
    {
      if ((preg_match('/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} [+\-]\d{4}$/', $line)))
      {
        $commit_date = strtotime($line);
      }
      else if ($line!=='')
      {
        $filename = $line;
        if (isset($this->myLastCommitTimes[$filename]) && $this->myLastCommitTimes[$filename]<$commit_date)
        {
          $this->myLastCommitTimes[$filename] = $commit_date;
        }
      }
    }
  }
private function fetchLastCommitTimes ( ) { // Execute command for get list with file name and mtime from GIT log $ command = "git log --format='format:%ai' --name-only" ; exec ( $ command , $ output , $ return ) ; if ( $ return != 0 ) $ this -> logError ( "Can not execute command %s in exec" , $ command ) ; // Find latest mtime for each file from $output. // Note: Each line is either: //       * an empty line //       * a timestamp //       * a filename. $ commit_date = '' ; foreach ( $ output as $ line ) { if ( ( preg_match ( '/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} [+\-]\d{4}$/' , $ line ) ) ) { $ commit_date = strtotime ( $ line ) ; } else if ( $ line !== '' ) { $ filename = $ line ; if ( isset ( $ this -> myLastCommitTimes [ $ filename ] ) && $ this -> myLastCommitTimes [ $ filename ] < $ commit_date ) { $ this -> myLastCommitTimes [ $ filename ] = $ commit_date ; } } } }
Fetches last commit time of each file in the Git repository.
Fetches last commit time of each file in the Git repository .