Commit 62d76ced authored by alexm98's avatar alexm98

Created empty run methods on classes that commands should not be run by users

parent b9e2e807
<?php
class Botcommand implements Command{
public function run(){
}
}
?>
\ No newline at end of file
......@@ -2,4 +2,4 @@
interface Command{
public function run($context);
}
?>
\ No newline at end of file
?>
<?php ini_set('user_agent','Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0');
class Commitlog{
public function run($channel){
$config = require('config.php');
$conn = Connection::getInstance();
$handle = fopen('gitrepos.txt', 'r');
while(($line = fgets($handle)) !== false){
$commits = file_get_contents(rtrim($line, "\n\r") . $config['gitlab_token']);
$commits = json_decode($commits);
$latest = 'Commit ' . $commits[0]->id . ' created at ' . $commits[0]->created_at . ' by ' . $commits[0]->author_name . ' - ' .$commits[0]->title;
$conn->sendData($channel, $latest);
}
fclose($handle);
}
}
?>
......@@ -10,6 +10,10 @@
echo "Connected\n";
}
public function run(){
// Should not be implemented for this is not a usable function by a user.
}
public function GetInstance(){
static $instance;
......
......@@ -9,6 +9,10 @@
$this->db = new PDO('sqlite:./'.$this->config['database'].'sqlite3');
}
public function run(){
// Should not be implemented for this is not a usable function by a user.
}
public function getInstance(){
static $instance;
......
<?php ini_set('user_agent','w3m/0.5.3+cvs-1.1055');
class Linkanalyzer{
public function run(){
// Should not be implemented for this is not a usable function by a user.
}
public function match($message){
$regex = '(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9]\.[^\s]{2,})';
preg_match($regex,$message,$link);
......
......@@ -5,6 +5,10 @@
private function __construct(){
}
public function run(){
// Should not be implemented for this is not a usable function by a user.
}
public function getInstance(){
static $instance;
......
......@@ -15,6 +15,10 @@
$this->timestamp = date('r');
}
public function run(){
// Should not be implemented for this is not a usable function by a user.
}
public function toString(){
echo $this->timestamp.' '.$this->sender.' '.$this->verb.' '.$this->channel.' '.$this->message."\n";
}
......@@ -47,4 +51,4 @@
return $cleardata;
}
}
?>
\ No newline at end of file
?>
<?php
class Ponger{
public function run(){
// Should not be implemented for this is not a usable function by a user.
}
public function pongBack($socket,$optdata = false){
if($optdata){
fputs($socket, "PONG ".$optdata."\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment