PHP code example of square1 / gwitlog

1. Go to this page and download the library: Download square1/gwitlog library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

square1 / gwitlog example snippets



/**
 * A simple script to read a git log from a file and render the timeline to screen
 */
itlog->setRepoName('Gwitlog');
// Provide remote repo base (Optional, but it allows us link commits back to the web GUI)
// Currently support bitbucket and github urls
$gwitlog->setRemoteHost('https://github.com/square1-io/gwitlog');

// Log file generated based on git log command:
// git log --pretty=format:'%H -%d %s (%ad) <%an:%ae>' > git.log
$gwitlog->setInputFile('git.log');

// Generate output and render to screen
$gwitlog->render();



/**
 * A simple script to read a git log from a file and render the timeline to a file
 */
itlog->setRepoName('Gwitlog');
// Provide remote repo base (Optional, but it allows us link commits back to the web GUI)
// Currently support bitbucket and github urls
$gwitlog->setRemoteHost('https://github.com/square1-io/gwitlog');

// Log file generated based on git log command:
// git log --pretty=format:'%H -%d %s (%ad) <%an:%ae>' > git.log
$gwitlog->setInputFile('git.log');

// Write to file timeline.html
$gwitlog->outputToFile('timeline.html');



/**
 * A simple script to read a git log from stdin and render the timeline to screen
 */
witlog->setRepoName('Gwitlog');
// Provide remote repo base (Optional, but it allows us link commits back to the web GUI)
// Currently support bitbucket and github urls
$gwitlog->setRemoteHost('https://github.com/square1-io/gwitlog');

// Read from input stream
$input = fopen('php://stdin', 'r');
$gwitlog->setInputStream($input);

// Generate output and render to screen
$gwitlog->render();



/**
 * A simple script to read a git log from stdin and render the timeline to screen, using
 * customised views
 */
g');
// Provide remote repo base (Optional, but it allows us link commits back to the web GUI)
// Currently support bitbucket and github urls
$gwitlog->setRemoteHost('https://github.com/square1-io/gwitlog');

// Use our custom templates
$gwitlog->setViewDirectory(__DIR__ . '/../views/gwitlog');

// Read from input stream
$input = fopen('php://stdin', 'r');
$gwitlog->setInputStream($input);

// Generate output and render to screen
$gwitlog->render();