new pisilinux web sites
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
<?php namespace Project\Controllers;
|
||||
use Import, Method,DB, XML, DBForge, URI, CURL, Regex, Folder, File, Json;
|
||||
|
||||
class Package extends Controller{
|
||||
|
||||
function main(){
|
||||
|
||||
|
||||
$link = "https://repology.org/api/v1/project/arduino";
|
||||
$kr = curl($link);
|
||||
$krjson = Json::decode($kr->content);
|
||||
|
||||
output($kr->content);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function repology(){
|
||||
$b = [];
|
||||
|
||||
$link = "https://repology.org/api/v1/project/arduino";
|
||||
$kr = curl($link);
|
||||
$krjson = Json::decode($kr->content);
|
||||
|
||||
output($kr);
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
DBForge::truncate('packageUpdate');
|
||||
|
||||
foreach (pList() as $key ) {
|
||||
$link = "https://repology.org/api/v1/project/".seo($key->name);
|
||||
//$kr=file_get_contents($link);
|
||||
$kr = curl($link);
|
||||
|
||||
|
||||
$KrJson=Json::decode($kr->content);
|
||||
|
||||
|
||||
|
||||
foreach ($KrJson as $key1){
|
||||
if ($key1->status == 'newest' ) {
|
||||
if (packageStableVersion(seo($key->name)) != $key1->version) {
|
||||
DB::insert('packageUpdate',[
|
||||
'name' => seo($key->name),
|
||||
'visiblename' => $key1->visiblename,
|
||||
'newVersion' => $key1->version,
|
||||
'oldVersion' => packageStableVersion(seo($key->name))
|
||||
|
||||
]);
|
||||
|
||||
$b[] = seo($key->name).' | '.$key1->visiblename.' | Old Version: '.packageStableVersion(seo($key->name)).' | New Version: '.$key1->version;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//redirect('package/packageUpdateList');
|
||||
|
||||
//view::a($KrJson);
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
function packageUpdateList(){
|
||||
$list = DB::groupBy('name')->get('packageUpdate');
|
||||
$count = $list->totalRows();
|
||||
$list = $list->result();
|
||||
view::list($list)->count($count);
|
||||
}
|
||||
|
||||
function search(){
|
||||
$repolist = '';
|
||||
$total = '1';
|
||||
if (Method::post()) {
|
||||
$repolist = Method::post('Repolist');
|
||||
$list = DB::where('reponame',$repolist)->packageResult();
|
||||
View::list($list);
|
||||
}
|
||||
|
||||
if (Method::get()) {
|
||||
$get = Uri::get('search');
|
||||
if ($get) {
|
||||
$result = DB::orderBy('name', 'asc')->whereStartLike('name',$get)->package();
|
||||
$list = $result->result();
|
||||
$total = $result->totalRows(true);
|
||||
}else{
|
||||
$total='0';
|
||||
$list = '';
|
||||
}
|
||||
View::list($list)->total($total);
|
||||
}
|
||||
}
|
||||
|
||||
function depoekle(){if(method::post()){$this->package_model->depoekle(method::post());}}
|
||||
|
||||
}// class end
|
||||
Reference in New Issue
Block a user