コード例 #1
0
ファイル: index.php プロジェクト: enigma1/i-metrics-cms
        remove_directory($current_dir);
        chdir(DIR_FS_CATALOG);
        break;
    case 'license_agreement':
        $amend = '';
        if (!read_contents(FILE_LICENSE, $contents) || !read_contents(FILE_LICENSE_AMENDMENT, $amend)) {
            redirect($_SERVER['SCRIPT_NAME']);
        }
        if (!isset($_POST['license'])) {
            $error_string = ERROR_GLOBAL_LICENSE_AGREE;
            redirect($_SERVER['SCRIPT_NAME'] . '?error_string=' . $error_string);
        }
        redirect($_SERVER['SCRIPT_NAME'] . '?action=server_detect');
        break;
    default:
        if (!read_contents(FILE_LICENSE, $contents) || !read_contents(FILE_LICENSE_AMENDMENT, $amend)) {
            $errors_array[] = ERROR_GLOBAL_LICENSE_AGREE;
        }
        $contents = nl2br(htmlspecialchars($amend) . "\n<hr />\n" . htmlspecialchars($contents));
        break;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php 
echo HEADING_CAPTION;
?>
</title>
<?php 
コード例 #2
0
ファイル: functions.php プロジェクト: enigma1/i-metrics-cms
function copy_dir($src, $dst)
{
    $src = rtrim($src, '/');
    $dst = rtrim($dst, '/');
    if (empty($src) || empty($dst) || !is_dir($src)) {
        return;
    }
    if (!is_dir($dst)) {
        @mkdir($dst);
    }
    $sub_array = glob($src . '/*');
    if (empty($sub_array)) {
        return;
    }
    foreach ($sub_array as $sub) {
        $entry = basename($sub);
        if (is_file($sub)) {
            $contents = '';
            if (!read_contents($src . '/' . $entry, $contents)) {
                continue;
            }
            if (!write_contents($dst . '/' . $entry, $contents)) {
                continue;
            }
        } else {
            copy_dir($src . '/' . $entry, $dst . '/' . $entry);
        }
    }
    closedir(opendir($src));
    closedir(opendir($dst));
}
コード例 #3
0
ファイル: rss2.php プロジェクト: hudson/svnkit
  //  }
} 
                                           
$rss = new UniversalFeedCreator();
$rss->useCached("RSS2.0", $cacheFile);
$rss->title = "TMate SVNKit";
$rss->description = "TMate SVNKit Library Change Log";
$rss->link = "http://svnkit.com/";
$rss->syndicationURL = "http://svnkit.com/" . $PHP_SELF;
$rss->author = "TMate Software"; 
$rss->editor = "TMate Software"; 
$rss->authorEmail = "*****@*****.**"; 
$rss->editorEmail = "*****@*****.**"; 

$repository = "http://svn.svnkit.com/repos/svnkit/tags/";
$contents = read_contents($repository);
if (!$contents) {
   echo $rss->createFeed();
   exit;
}

$items = publish_rss20($repository, $contents, "http://www.svnkit.com/");
for($i = 0; $i < count($items); $i++) {

     $item = $items[$i];

     $rssitem = new FeedItem();

     $rssitem->title  = $item["title"];
     $rssitem->source = $item["source"];
     $rssitem->link   = $item["link"];
コード例 #4
0
ファイル: rss_util.php プロジェクト: hudson/svnkit
function publish_rss20($repository, $contents, $rss) {

if (preg_match_all("/<li><a href=\"(.*)\/\">(.*\..*\..*)(<\/a>)<\/li>/", $contents, $matches)) {

   $items = array();
   $index = 0;

   for($i = 0; $i < count($matches[1]); $i++) {
       $build = $matches[1][$i];
       $changelog_url = $repository . $build . "/changelog.txt";
       $test_url = $repository . $build . "/tests.log";
       $test_results_xml_url = $repository . $build . "/svnkit-test/python-tests-log.xml";
           
       $changelog = read_contents($changelog_url);

       if (!$changelog) {
           continue;
       }

       $standalone_name = "org.tmatesoft.svn_" . $build . ".standalone.zip";
       $eclipse_name = "org.tmatesoft.svn_" . $build . ".eclipse.zip";
       $src_name = "org.tmatesoft.svn_" . $build . ".src.zip";
       $standalone_file = $_SERVER["DOCUMENT_ROOT"] . "/" . $standalone_name;

       if (!file_exists($standalone_file)) {
          continue;  
       }

       $svn_url = $repository . $build . "/";
       $standalone_link = $rss . $standalone_name;
       $src_url    = $rss . $src_name;
       $eclipse_url    = $rss . $eclipse_name;
       $eclipse_update_url    = $rss;

       ereg("^=[^\n]+\n([^=]+).*$", $changelog, $m);
       $changelog_str = trim($m[1]);
       $date_string = date("j M Y, H:i", filemtime($standalone_file));
       
       $item_description  = "<b>" . $date_string . "</b>, version: " . $build . "<p><table style=\"font-size: 100%;\">";
       $item_description .= "<tr><td>standalone version:&nbsp;</td><td><a href=\"" . $standalone_link . "\">" . $standalone_name . "</a></td></tr>";
       $item_description .= "<tr><td>source code archive:&nbsp;</td><td><a href=\"" . $src_url . "\">" . $src_name . "</a></td></tr>";
       $item_description .= "<tr><td>source code:&nbsp;</td><td><a href=\"" . $svn_url . "\">@svn repository</a></td></tr>";
       $item_description .= "<tr><td>eclipse update site archive:&nbsp;</td><td><a href=\"" . $eclipse_url . "\">" . $eclipse_name . "</a></td></tr>";
       $item_description .= "<tr><td>eclipse update site location:&nbsp;</td><td><b>" . $eclipse_update_url . "</b></td></tr></table></p>";
       $item_description .= "<h5>ChangeLog</h5><pre>" . $changelog_str . "</pre>";
       $item_description .= "<a href=\"" . $changelog_url . "\">full changelog up to this build</a>";
       $item_description .= "<a href=\"" . $test_url . "\">tests results</a>";
       $item_description .= "<h5>Contact</h5><p>Your questions and feedback are welcome at <a href=\"mailto:support@svnkit.com\">support@svnkit.com</a></p>";


       $html_description  = "<tr><td colspan=\"2\">&nbsp;" . $date_string . ", version <b>" . $build . "</b></td></tr>";
       $html_description .= "<tr><td colspan=\"2\">&nbsp;Changelog:</td></tr>";
       $html_description .= "<tr><td colspan=\"2\"><pre>" . $changelog_str . "</pre>";
       $python_tests_url  = "/download/test-results.php?fileurl=" . $test_results_xml_url . "&build=" . $build;

       $html_description .= "<a href=\"" . $changelog_url . "\">full changelog up to this build</a>&nbsp;&nbsp;<a href=\"" . $python_tests_url . "\">tests results</a></td></tr>";
       
       $html_description .= "<tr bgcolor=\"#EAEAEA\"><td>&nbsp;Standalone Version&nbsp;</td><td><a href=\"" . $standalone_link . "\">" . $standalone_name . "</a></td></tr>";
       $html_description .= "<tr bgcolor=\"#EAEAEA\"><td>&nbsp;Source Code Archive&nbsp;</td><td><a href=\"" . $src_url . "\">" . $src_name . " </a></td></tr>";
       $html_description .= "<tr bgcolor=\"#EAEAEA\"><td>&nbsp;Eclipse Update Site Archive&nbsp;</td><td><a href=\"" . $eclipse_url . "\">" . $eclipse_name . "</a></td></tr>";
       $html_description .= "<tr bgcolor=\"#EAEAEA\"><td>&nbsp;Eclipse Update Site Location&nbsp;</td><td><b>" . $eclipse_update_url . "</b></td></tr>";
       $html_description .= "<tr bgcolor=\"#EAEAEA\"><td>&nbsp;Source Code&nbsp;</td><td><a href=\"" . $svn_url . "\">@svn repository</a></td></tr>";

       $item = array();
       $item["title"]  = "Build '" . $build . "' published";
       $item["source"] = "http://svnkit.com/";
       $item["link"]   = "http://svnkit.com/";
       $item["author"] = "TMate Software";
       $item["date"]   = filemtime($standalone_file);

       $item["rss_description"] = $item_description;
       $item["html_description"] = $html_description;

       $items[$index++] = $item;
   }
  
}
return $items;
}