mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 02:14:13 +00:00
Added the ablity to search the contesting master scp database.
This commit is contained in:
35
application/controllers/lookup.php
Normal file
35
application/controllers/lookup.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
|
||||
Data lookup functions used within Cloudlog
|
||||
|
||||
*/
|
||||
|
||||
class Lookup extends CI_Controller {
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function scp($string) {
|
||||
$file = 'updates/masterscp.txt';
|
||||
|
||||
$lines = file($file, FILE_IGNORE_NEW_LINES);
|
||||
|
||||
$input = preg_quote($string, '~');
|
||||
|
||||
$result = preg_grep('~' . $input . '~', $lines, 0);
|
||||
|
||||
$copy = $result;
|
||||
foreach ($result as &$value) {
|
||||
echo $value;
|
||||
|
||||
if (next($copy )) {
|
||||
echo ', '; // Add comma for all elements instead of last
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
37245
updates/masterscp.txt
Normal file
37245
updates/masterscp.txt
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user