Хранилища Subversion ant

Редакция

Редакция 79 | Авторство | Сравнить с предыдущей | Последнее изменение | Открыть журнал | Скачать | RSS

<?php

/**
 * Project:     Ant: sources.list generator
 * File:        classic.php
 *
 * This application is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This application is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */



require_once "lib/init.php";
$status = abs(intval($_GET["step"]));
$dist   = abs(intval($_GET["d"]));
$vers   = abs(intval($_GET["v"]));

$query =& $db->query("SELECT * FROM settings WHERE opt LIKE 'version'");
$query->fetchInto($antv, DB_FETCHMODE_ASSOC);
$antversion = $antv["optvalue"];

$query =& $db->query("SELECT * FROM distribution");
while ($query->fetchInto($data, DB_FETCHMODE_ASSOC)) {
        $linux .= "<p><input type='radio' name='d' value='".$data["dist_id"]."'><span class='".stripslashes($data["distua"])."'>".stripslashes($data["distname"])."</span></p>\n";
}

if (!isset($status)) { $status = 0; };

if (isset($dist)) {
        $query =& $db->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id WHERE v.dist_id='$dist'");
        $distvers = "<p><input type='hidden' name='d' value='".$dist."'></p>\n";
        while ($query->fetchInto($version, DB_FETCHMODE_ASSOC)) {
                if ($version["vname"]!="") {
                        $distname = "&#8220;".stripslashes($version["vname"])."&#8221;";
                } else {
                        $distname = "";
                }
                $distvers .= "<p><input type='radio' name='v' value='".$version["version_id"]."' /><span class='".stripslashes($version["distua"])."'>".stripslashes($version["distname"])." ".stripslashes($version["version"])." ".$distname."</span></p>\n";
        }
}

if (isset($vers)) {
        $query =& $db->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id JOIN dtype p ON d.disttype=p.type_id WHERE v.dist_id='$dist' AND v.version_id='$vers'");
        $query->fetchInto($infodist, DB_FETCHMODE_ASSOC);
        $distname = "";
        if ($infodist["vname"]!="") {
                $distname = "&#8220;".stripslashes($infodist["vname"])."&#8221;";
        }
        $info = "<h2>Доступные репозитории для <em class='".stripslashes($infodist["distua"])."-em'>".stripslashes($infodist["distname"])." ".stripslashes($infodist["version"])." ".$distname."</em></h2>";
        $result = "<p>Скопируйте эти строки в файл <span id='sourceslist'>/etc/apt/sources.list</span>:</p><pre>";
        $result .= $core->getRepList($dist,$vers,$db);
        $result .= "</pre>";
        $result = $info.$result."<p><a href='./get.php?id=".$dist.",".$vers."'>Получить sources.list файлом</a></p>";
}

$smarty->assign('status',$status);
$smarty->assign('linux',$linux);
$smarty->assign('version',$distvers);
$smarty->assign('result',$result);
$smarty->assign('antversion',$antversion);
$smarty->assign('interface'," &bull; ".$core->getInterfacesList($_SERVER["REQUEST_URI"],$db));
$smarty->assign('style',$core->getCSSList($db));

$smarty->display('classic.tpl');

?>