From 8ca1caecbee4eff7f3959539dba9fe44131fbe97 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Thu, 30 May 2013 15:52:29 -0400 Subject: [PATCH] CC-5194: Fail to execute phone_home_stat -fixed by using native Zend autoloader --- utils/phone_home_stat.php | 90 ++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 54 deletions(-) diff --git a/utils/phone_home_stat.php b/utils/phone_home_stat.php index 3de05a8da..d09d85c49 100644 --- a/utils/phone_home_stat.php +++ b/utils/phone_home_stat.php @@ -1,4 +1,17 @@ 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); @@ -88,6 +82,7 @@ if(Application_Model_Preference::GetSupportFeedback() == '1'){ 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'; @@ -113,16 +108,3 @@ if(Application_Model_Preference::GetPlanLevel() == 'disabled'){ curl_close($ch); } -/** - * Ensures that the user is running this PHP script with root - * permissions. If not running with root permissions, causes the - * script to exit. - */ -function exitIfNotRoot() -{ - // Need to check that we are superuser before running this. - if(posix_geteuid() != 0){ - echo "Must be root user.\n"; - exit(1); - } -}