本文整理汇总了PHP中get_packages函数的典型用法代码示例。如果您正苦于以下问题:PHP get_packages函数的具体用法?PHP get_packages怎么用?PHP get_packages使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_packages函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: find_max
$max = find_max($lines, "/{$package}/", "/^.*{$package}-([\\d\\.]*\\d)\\.tar.*\$/");
return $max;
}
function get_pattern($line)
{
global $start;
// Set up specific patter matches for extracting book versions
$match = array();
$match = array(array('pkg' => 'automoc', 'regex' => "/^.*automoc4-(\\d[\\d\\.]+).*\$/"), array('pkg' => 'polkit-qt', 'regex' => "/^.*polkit-qt-1-(\\d[\\d\\.]+).*\$/"), array('pkg' => 'polkit-kde-agent', 'regex' => "/^.*polkit-kde-agent-1-(\\d[\\d\\.]+).*\$/"));
foreach ($match as $m) {
$pkg = $m['pkg'];
if (preg_match("/{$pkg}/", $line)) {
return $m['regex'];
}
}
return "/\\D*(\\d.*\\d)\\D*\$/";
}
get_current();
// Get what is in the book
// Get latest version for each package
foreach ($book as $pkg => $data) {
$book_index = $pkg;
$base = $data['basename'];
$url = $data['url'];
$bver = $data['version'];
echo "book index: {$book_index} {$bver} {$url}\n";
$v = get_packages($book_index, $url);
$vers[$book_index] = $v;
}
html();
// Write html output
开发者ID:renodr,项目名称:blfs-currency,代码行数:31,代码来源:blfs-chapter27.php
示例2: get_packages
<span class="icon-prev"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
<span class="icon-next"></span>
</a>
</div>
<div class="empty" style="height:50px;"></div>
<div class="row">
<?php
function get_packages($heading)
{
global $connection;
$query = "select * from package_names where heading='{$heading}'";
foreach ($connection->query($query) as $values) {
echo " <p><a href=\"itinerary.php?package={$values['2']}\">{$values['2']}</a></p>";
}
}
$query = "select heading,photo_location from info where name='{$package}'";
$res1 = $connection->prepare($query);
$res1->execute();
while ($values = $res1->fetch()) {
echo " <div class=\"col-md-6\"> \n <div class=\"panel panel-default\">\n <div class=\"panel-heading\">\n <h3 class=\"panel-title\">{$values['0']}</h3>\n </div>\n <div class=\"panel-body\">\n <div class=\"col-md-6\">\n <div class=\"panel panel-default\">\n <div class=\"panel-body\">";
get_packages($values[0]);
echo "</div></div></div>\n<div class=\"col-md-6\">\n<div class=\"panel panel-default\">\n <div class=\"panel-body\">\n <img src=\"{$values['1']}\" />\n </div>\n </div>\n </div>\n</div></div></div>\n";
}
?>
</div><!-- row -->
</div> <!--End of Container -->
<?php
include "footer.php";
开发者ID:bharadwajanup,项目名称:himalaya.0fees.net,代码行数:31,代码来源:packages.php
示例3: find_max
$max = find_max($lines, "/{$package}/", "/^.*{$package}-([\\d\\.]*\\d)\\.tar.*\$/");
return $max;
}
function get_pattern($line)
{
// Set up specific patter matches for extracting book versions
$match = array();
//$match[ 0 ] = array( 'pkg' => 'ntfs',
// 'regex' => "/ntfs-3g_ntfsprogs-(\d.*\d)\D*$/" );
foreach ($match as $m) {
$pkg = $m['pkg'];
if (preg_match("/{$pkg}/", $line)) {
return $m['regex'];
}
}
return "/\\D*(\\d.*\\d)\\D*\$/";
}
get_current();
// Get what is in the book
// Get latest version for each package
foreach ($book as $pkg => $data) {
$book_index = $pkg;
$base = $data['basename'];
$url = $data['url'];
$bver = $data['version'];
echo "book index: {$book_index} {$bver} {$url}\n";
$v = get_packages($base, $url);
$vers[$book_index] = $v;
}
html();
// Write html output
开发者ID:JamesLinus,项目名称:BLFS,代码行数:31,代码来源:blfs-chapter06.php
示例4: die
<?php
# ScriptUpdate - get packed file/do update
# $Id: pack.php,v 1.7 2007/10/29 08:20:33 nobu Exp $
include '../../../include/cp_header.php';
include_once '../package.class.php';
$res = $xoopsDB->query("SELECT * FROM " . UPDATE_PKG . " WHERE pversion='HEAD' ORDER BY pkgid");
if (!$res) {
die($xoopsDB->error());
}
$pkgs = get_packages('all', true);
$buf = "";
$pkgn = 0;
$op = isset($_GET['op']) ? $_GET['op'] : 'update';
$date = formatTimestamp(time(), "Ymd");
$updatedir = "update-{$date}";
$backupdir = "backup-{$date}";
ob_start();
if ($xoopsDB->getRowsNum($res)) {
// force clean work files
$work = XOOPS_UPLOAD_PATH . "/update/work";
if (is_dir("{$work}/{$updatedir}")) {
system("rm -rf '{$work}/{$updatedir}'");
}
if (is_dir("{$work}/{$backupdir}")) {
system("rm -rf '{$work}/{$backupdir}'");
}
while ($data = $xoopsDB->fetchArray($res)) {
$pkg = new InstallPackage($data);
$pkg->load();
$pname = $pkg->getVar('pname');
开发者ID:nbuy,项目名称:xoops-modules-update,代码行数:31,代码来源:pack.php
示例5: header
header('CacheControl: no-cache, must-revalidate');
header('Expires: Tue, 1 Jan 1980 00:00:00 GMT');
header('Pragma: no-cache');
header('Content-Type: application/json');
// Get json raw data sent
$request_data = json_decode(file_get_contents("php://input"));
if (isset($whitelist)) {
$api_key = get_request('api-key');
if (!$api_key || !in_array($api_key, $whitelist)) {
// http_response_code(403);
print json_encode(array('error' => 'Access denied', 'reason' => 'Not in whitelist'));
die;
}
}
// get packages from loader
$packages = function_exists('get_packages') ? get_packages() : array();
// Get user agent
// $user_agent = $_SERVER['HTTP_USER_AGENT'];
// Get action
$action = strtolower(get_request('action'));
if ($action == 'list_all') {
print json_encode($packages);
die;
}
// Get data
$data = get_request('data');
if (is_a($data, 'StdClass')) {
$data = object2array($data);
}
// TODO : check data is array or string...
function get_latest_version($slug)
开发者ID:pemiu01,项目名称:wp-automatic-theme-plugin-update,代码行数:31,代码来源:index.php
示例6: html
function html()
{
global $date;
global $vers;
global $dirs;
echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'\n 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>\n<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>\n<head>\n<title>LFS Package Currency Check - {$date}</title>\n<style type='text/css'>\nh1, h2 {\n text-align : center;\n}\n\ntable {\n border-width : 1px;\n border-spacing : 0px;\n border-style : outset;\n border-color : gray;\n border-collapse : separate;\n background-color: white;\n margin : 0px auto;\n}\n\ntable th {\n border-width : 1px;\n padding : 2px;\n border-style : inset;\n border-color : gray;\n background-color: white;\n}\n\ntable td {\n border-width : 1px;\n padding : 2px;\n border-style : inset;\n border-color : gray;\n background-color: white;\n}\n</style>\n\n</head>\n<body>\n<h1>BLFS Package Currency Check</h1>\n<h2>As of {$date} GMT</h1>\n\n<table>\n<tr><th>LFS Package</th> <th>LFS Version</th> <th>Latest</th> <th>Flag</th></tr>\n";
// Get the latest version of each package
foreach ($dirs as $pkg => $dir) {
$v = get_packages($pkg, $dir);
$flag = $vers[$pkg] != $v ? "*" : "";
echo "<tr><td>{$pkg}</td> <td>{$vers[$pkg]}</td> <td>{$v}</td> <td>{$flag}</td></tr>\n";
}
echo "</table>\n</body>\n</html>\n";
}
开发者ID:JamesLinus,项目名称:BLFS,代码行数:14,代码来源:blfs-latest.php
示例7: array_shift
array_shift($argv);
while ($arg = array_shift($argv)) {
switch ($arg) {
case "-n":
$info['name'] = array_shift($argv);
break;
case "-h":
$info['host'] = array_shift($argv);
break;
case "-d":
$info['desc'] = array_shift($argv);
break;
case "-m":
$mirrors = get_mirrors(array_shift($argv));
break;
case "-f":
$pkglist = array_merge($pkglist, file(array_shift($argv)));
break;
case "-p":
$flags['pkgdir'] = array_shift($argv);
break;
default:
$pkglist[] = $arg;
}
}
if (!$info['name'] or !$info['host']) {
fwrite(STDERR, "WARNING: No information set for this repository!\n");
}
list($packages, $pkgdb) = get_packages($pkglist);
print dump_xml_config_pkg($xmlout, "pkgrepo");
}
开发者ID:rootsghost,项目名称:pfsense-tools,代码行数:31,代码来源:repomaker.php
示例8: reg_set_packages
function reg_set_packages()
{
global $xoopsDB;
$active = get_active_list();
$pkgs = get_packages('all');
if (file_exists(ROLLBACK)) {
unlink(ROLLBACK);
}
// expired
$del = "DELETE FROM " . UPDATE_PKG . " WHERE pkgid=%u";
$sel = "SELECT pkgid FROM " . UPDATE_PKG . " WHERE vcheck=%s AND pversion='HEAD'";
$succ = 0;
$pnames = isset($_POST['pname']) ? $_POST['pname'] : array();
foreach ($pkgs as $pkg) {
$dirname = $pkg['vcheck'];
if (array_search($dirname, $active)) {
$res = $xoopsDB->query(sprintf($sel, $xoopsDB->quoteString($dirname)));
$pkgid = 0;
if ($xoopsDB->getRowsNum($res) > 0) {
list($pkgid) = $xoopsDB->fetchRow($res);
}
$pname = $pkg['pname'];
if ($pkgid && !in_array($dirname, $pnames)) {
// unchecked? (removed)
if ($xoopsDB->query(sprintf($del, $pkgid))) {
$xoopsDB->query("DELETE FROM " . UPDATE_FILE . " WHERE pkgref={$pkgid}");
$succ++;
}
}
clean_pkginfo();
// garbege collection
}
}
$ins = "INSERT INTO " . UPDATE_PKG . "(parent,pname,pversion,vcheck) VALUES(%u,%s,'HEAD',%s)";
foreach ($pnames as $dirname) {
if (!in_array($dirname, $active)) {
if (isset($pkgs[$dirname])) {
$pkg = $pkgs[$dirname];
} else {
$pkg = PackageList::selectPackage($dirname);
}
$par = empty($pkg['pkgid']) ? 0 : $pkg['pkgid'];
if (register_detail($pkg['pname'], $dirname)) {
$succ++;
}
}
}
if ($succ) {
clear_get_cache(0, 'list');
}
return $succ;
}
开发者ID:nbuy,项目名称:xoops-modules-update,代码行数:52,代码来源:pkgadmin.php
示例9: check_packages
function check_packages()
{
global $xoopsDB, $xoopsModuleConfig, $xoopsConfig;
$res = $xoopsDB->query("SELECT p1.*, p2.vcheck dirname, p2.pversion ppversion FROM " . UPDATE_PKG . " p1 LEFT JOIN " . UPDATE_PKG . " p2 ON p1.parent=p2.pkgid WHERE p1.pversion='HEAD' ORDER BY p1.vcheck");
$pkgs = get_packages('all', false);
echo "<h3>" . _AM_CHECK_LIST . "</h3>\n";
echo "<table cellspacing='1' class='outer'>\n";
echo "<tr><th>" . _AM_PKG_PNAME . "</th><th>" . _AM_PKG_CURRENT . "</th><th>" . _AM_PKG_DIRNAME . "</th><th>" . _AM_PKG_NEW . "</th><th>" . _AM_PKG_DTIME . "</th><th>" . _AM_CHANGES . "</th><th>" . _AM_MODIFYS . "</th><th></th></tr>\n";
$n = 0;
$update = false;
// find update package?
$modify = false;
$errors = array();
$module_handler =& xoops_gethandler('module');
while ($data = $xoopsDB->fetchArray($res)) {
$pname = $data['pname'];
$dirname = $data['vcheck'];
// real dirname
$pdir = empty($data['dirname']) ? $dirname : $data['dirname'];
$bg = $n++ % 2 ? 'even' : 'odd';
$id = $data['pkgid'];
$newpkg = isset($pkgs[$pdir]) ? $pkgs[$pdir] : array();
if (empty($newpkg)) {
foreach ($pkgs as $pkg) {
// find by name
if ($pname == $pkg['pname']) {
$newpkg = $pkg;
break;
}
}
}
$newver = isset($newpkg['pversion']) ? $newpkg['pversion'] : '';
$curver = get_current_version($pname, $dirname);
$modver = $curver[1];
// version string (0: normalize, 1: raw)
if (empty($data['parent']) || !in_array($data['ppversion'], $curver)) {
$par = import_new_package($pname, $modver, $pdir);
if (empty($par)) {
$errors[] = "{$pname} {$modver}: " . _AM_PKG_NOTFOUND;
} else {
$pid = $data['parent'] = $par->getVar('pkgid');
$pnm = $data['name'] = $par->getVar('name');
$ctm = $data['ctime'] = time();
$data['ppversion'] = $par->getVar('pversion');
$xoopsDB->queryF("UPDATE " . UPDATE_PKG . " SET parent={$pid}, name=" . $xoopsDB->quoteString($pnm) . ", mtime=0, ctime={$ctm} WHERE pkgid={$id}");
}
}
if (!empty($data['ppversion'])) {
$pversion = $data['ppversion'];
$past = time() - $data['mtime'];
if ($past > $xoopsModuleConfig['cache_time']) {
$pkg = new InstallPackage($data);
$pkg->load();
$count = count($pkg->checkFiles());
if (!$count) {
$xoopsDB->queryF("UPDATE " . UPDATE_PKG . " SET mtime=" . time() . " WHERE pkgid=" . $id);
}
} else {
$count = 0;
}
$opt = "&pkgid={$id}";
if (!$count) {
$opt .= "&view=yes";
}
$op = "<a href='index.php?op=detail{$opt}'>" . ($count ? _AM_MODIFY : _AM_DETAIL) . "</a>";
} else {
// no manifesto
$pversion = "";
$op = "";
$count = 0;
}
if ($count) {
$modify = true;
}
if (!empty($newpkg)) {
$newver = $newpkg['pversion'];
$newdate = formatTimestamp($newpkg['dtime'], "m");
} else {
$newver = '-';
$newdate = '-';
}
$mcount = count_modify_files($data['pkgid']);
if ($pversion != $newver) {
$bg = 'up';
$uppkg = import_new_package($pname, $newver);
if ($uppkg) {
$pid = $uppkg->getVar('pkgid');
$newver = "<a href='index.php?op=detail&pkgid={$id}&new={$pid}&view=yes'>" . htmlspecialchars($newver) . "</a>";
$update = true;
}
} else {
$newver = htmlspecialchars($newver);
}
if ($count) {
$bg = 'fix';
}
// check module update
$vers = htmlspecialchars($modver);
if (!empty($dirname)) {
$module = $module_handler->getByDirname($dirname);
//.........这里部分代码省略.........
开发者ID:nbuy,项目名称:xoops-modules-update,代码行数:101,代码来源:index.php
注:本文中的get_packages函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论