Exemplo n.º 1
0
 /**
  * @param string Path to repository
  * @param int Number of revision (0 = no limit)
  * @return array  Key are revision number example:
  *        array(
  *            1 => array("author" => "duponc_j", "msg" => "Test", date=> 1265413),
  *            2 => array("revision" => "crivis_s", "msg" => "Test2", date=>4565654)
  *        )
  *
  * Date are unix timestamp
  */
 public static function log($repository, $limit = 25, $start = 0, $end = 0)
 {
     $repository = SVNUtils::getRepositoryPath($repository);
     if ($limit) {
         $limit = escapeshellarg($limit);
         $limit = "--limit {$limit}";
     } else {
         $limit = "";
     }
     if ($start) {
         $revision = "-r {$start}";
         if ($end) {
             $revision .= ":{$end}";
         }
     } else {
         $revision = "";
     }
     $message = ConsoleUtils::runCmdCaptureMessageUnsafe(SVNUtils::svnCommand("log --xml {$revision} {$limit} {$repository}"), $return);
     if ($return) {
         throw new Exception("Can't get subversion repository logs: " . $message);
     }
     return SVNLog::parseOutput($message);
 }
Exemplo n.º 2
0
                        <?php 
    require_once __DIR__ . '/administration/_summary.php';
    ?>

                    </td>
                    <td valign="top">
                        <table width="100%">
                            <tr>
                                <td id="sectPeople" width="74%" class="sectionDetail" colspan="3"><span class="headerPageText sectionDetailTitle">Activity Stream (last 25 commits)</span></td>
                            </tr>
                            <tr>
                                <td id="svn_activity_stream">
                                    <?php 
    $log = null;
    try {
        $log = SVNLog::log(UbirimiContainer::get()['subversion.path'] . Util::slugify($session->get('client/company_domain')) . '/' . Util::slugify($svnRepo['name']));
    } catch (Exception $e) {
    }
    ?>

                                    <table>
                                        <?php 
    if ($log) {
        ?>
                                            <?php 
        $i = 0;
        ?>

                                            <?php 
        foreach ($log as $key => $revision) {
            ?>