From 03d1215833eb78d6b351abeb1515d5d3a751d1e0 Mon Sep 17 00:00:00 2001 From: Lucas Bickel Date: Sun, 14 Oct 2018 23:09:34 +0200 Subject: [PATCH] :fire: Remove dead phone_home_stat --- .../application/helpers/AirtimeInstall.php | 9 -- utils/phone_home_stat | 34 ------ utils/phone_home_stat.php | 108 ------------------ 3 files changed, 151 deletions(-) delete mode 100755 utils/phone_home_stat delete mode 100644 utils/phone_home_stat.php diff --git a/airtime_mvc/tests/application/helpers/AirtimeInstall.php b/airtime_mvc/tests/application/helpers/AirtimeInstall.php index f9c059171..c61816856 100644 --- a/airtime_mvc/tests/application/helpers/AirtimeInstall.php +++ b/airtime_mvc/tests/application/helpers/AirtimeInstall.php @@ -310,15 +310,6 @@ class AirtimeInstall echo "* Removing logs directory ".$path.PHP_EOL; exec("rm -rf \"$path\""); } - public static function CreateCronFile(){ - echo "* Creating Cron File".PHP_EOL; - // Create CRON task to run every day. Time of day is initialized to a random time. - $hour = rand(0,23); - $minute = rand(0,59); - $fp = fopen('/etc/cron.d/airtime-crons','w'); - fwrite($fp, "$minute $hour * * * root /usr/lib/airtime/utils/phone_home_stat\n"); - fclose($fp); - } public static function removeVirtualEnvDistributeFile(){ echo "* Removing distribute-0.6.10.tar.gz".PHP_EOL; if(file_exists('/usr/share/python-virtualenv/distribute-0.6.10.tar.gz')){ diff --git a/utils/phone_home_stat b/utils/phone_home_stat deleted file mode 100755 index ff52674b2..000000000 --- a/utils/phone_home_stat +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2011 Sourcefabric O.P.S. -# -# This file is part of the Airtime project. -# http://airtime.sourcefabric.org/ -# -# Airtime is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Airtime 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Airtime; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- -#------------------------------------------------------------------------------- -# This script send data to data collection server -# -# Absolute path to this script -SCRIPT=`readlink -f $0` -# Absolute directory this script is in -SCRIPTPATH=`dirname $SCRIPT` - -invokePwd=$PWD -cd $SCRIPTPATH - -php -q phone_home_stat.php "$@" || exit 1 \ No newline at end of file diff --git a/utils/phone_home_stat.php b/utils/phone_home_stat.php deleted file mode 100644 index 7b0498073..000000000 --- a/utils/phone_home_stat.php +++ /dev/null @@ -1,108 +0,0 @@ -registerNamespace('Application_'); - -$resourceLoader = new Zend_Loader_Autoloader_Resource(array( - 'basePath' => $CC_CONFIG['phpDir'].'/'.'application', - 'namespace' => 'Application', - 'resourceTypes' => array( - 'model' => array( - 'path' => 'models/', - 'namespace' => 'Model', - ), - 'common' => array( - 'path' => 'common/', - 'namespace' => 'Common', - ), - ), -)); - -$infoArray = Application_Model_Preference::GetSystemInfo(true); - -if(Application_Model_Preference::GetSupportFeedback() == '1'){ - $url = 'http://stat.sourcefabric.org/index.php?p=airtime'; - //$url = 'http://localhost:9999/index.php?p=airtime'; - - $ch = curl_init(); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, 1); - curl_setopt($ch, CURLOPT_URL, $url); - - $data = json_encode($infoArray); - - $dataArray = array("data" => $data ); - - curl_setopt($ch, CURLOPT_POSTFIELDS, $dataArray); - $result = curl_exec($ch); - curl_close($ch); -} - -// Get latest version from stat server and store to db -if(Application_Model_Preference::GetPlanLevel() == 'disabled'){ - $url = 'http://stat.sourcefabric.org/airtime-stats/airtime_latest_version'; - //$url = 'http://localhost:9999/index.php?p=airtime'; - - $ch = curl_init(); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_URL, $url); - $result = curl_exec($ch); - - if(curl_errno($ch)) { - echo "curl error: " . curl_error($ch) . "\n"; - } else { - $resultArray = explode("\n", $result); - if (isset($resultArray[0])) { - Application_Model_Preference::SetLatestVersion($resultArray[0]); - } - if (isset($resultArray[1])) { - Application_Model_Preference::SetLatestLink($resultArray[1]); - } - } - - curl_close($ch); -}