當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CommonFunctions類代碼示例

本文整理匯總了PHP中CommonFunctions的典型用法代碼示例。如果您正苦於以下問題:PHP CommonFunctions類的具體用法?PHP CommonFunctions怎麽用?PHP CommonFunctions使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CommonFunctions類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: save

 public function save(Doctrine_Connection $conn = null)
 {
     $cls_commonfunction = new CommonFunctions();
     $path = $cls_commonfunction->basepath();
     $file = $_FILES;
     if ($file['avatar']['name']['avt_image'] != '') {
         if (move_uploaded_file($file['avatar']['tmp_name']['avt_image'], $path . "uploads/avatar/" . time() . "_" . $file['avatar']['name']['avt_image'])) {
             $this->setAvtImage(time() . "_" . $file['avatar']['name']['avt_image']);
         }
     } else {
         $this->getAvtImage("");
     }
     return parent::save($conn);
 }
開發者ID:rohitbatra1987,項目名稱:ruckus_dev,代碼行數:14,代碼來源:Avatar.class.php

示例2: save

 public function save(Doctrine_Connection $conn = null)
 {
     $cls_commonfunction = new CommonFunctions();
     $path = $cls_commonfunction->basepath();
     $file = $_FILES;
     if ($file['book_series']['name']['series_icon'] != '') {
         if (move_uploaded_file($file['book_series']['tmp_name']['series_icon'], $path . "uploads/book_series/" . time() . "_" . $file['book_series']['name']['series_icon'])) {
             $this->setSeriesIcon(time() . "_" . $file['book_series']['name']['series_icon']);
         }
     } else {
         $this->getSeriesIcon("");
     }
     return parent::save($conn);
 }
開發者ID:rohitbatra1987,項目名稱:ruckus_dev,代碼行數:14,代碼來源:BookSeries.class.php

示例3: __construct

 /**
  * read the data into an internal array and also call the parent constructor
  *
  * @param String $enc encoding
  */
 public function __construct($enc)
 {
     parent::__construct(__CLASS__, $enc);
     switch (strtolower(PSI_PLUGIN_UPDATENOTIFIER_ACCESS)) {
         case 'command':
             if (PSI_PLUGIN_UPDATENOTIFIER_UBUNTU_LANDSCAPE_FORMAT === true) {
                 CommonFunctions::executeProgram("/usr/lib/update-notifier/apt-check", "--human-readable", $buffer_info);
             } else {
                 CommonFunctions::executeProgram("/usr/lib/update-notifier/apt-check", "2>&1", $buffer_info);
             }
             break;
         case 'data':
             if (defined('PSI_PLUGIN_UPDATENOTIFIER_FILE') && is_string(PSI_PLUGIN_UPDATENOTIFIER_FILE)) {
                 CommonFunctions::rfts(PSI_PLUGIN_UPDATENOTIFIER_FILE, $buffer_info);
             } else {
                 CommonFunctions::rfts("/var/lib/update-notifier/updates-available", $buffer_info);
             }
             break;
         default:
             $this->global_error->addConfigError("__construct()", "PSI_PLUGIN_UPDATENOTIFIER_ACCESS");
             break;
     }
     // Remove blank lines
     $this->_filecontent = preg_split("/\r?\n/", $buffer_info, -1, PREG_SPLIT_NO_EMPTY);
 }
開發者ID:FleuryK,項目名稱:phpsysinfo,代碼行數:30,代碼來源:class.updatenotifier.inc.php

示例4: getAction

 public function getAction()
 {
     $apiparameters = $this->view->apiparams();
     //print_r($apiparameters);
     if (!array_key_exists('apicall', $apiparameters)) {
         echo "{'error':'No method was called!'}";
     } elseif (!array_key_exists('apikey', $apiparameters)) {
         echo "{'error':'Api Key missing!'}";
     } else {
         $db = Zend_Registry::get('db');
         $sql = 'SELECT * FROM pclive_apikeys where apikey="' . $apiparameters['apikey'] . '"';
         $result = $db->query($sql);
         $record = $result->FetchAll();
         if (count($record) == 1) {
             $request = '[' . json_encode($apiparameters) . ']';
             $url = $this->view->serverUrl() . $this->view->baseUrl() . '/api/';
             //$url ='http://localhost/projects/evendor/api';
             $params = array('jsondata' => $request);
             // key value pairs
             $response = CommonFunctions::processRequest($url, $params);
             //$this->getResponse()->appendBody("From getAction() returning the requested article");
             echo "<pre>";
             print_r($response);
             //print_r(json_decode($response));
             echo "</pre>";
             //exit;
         } else {
             echo "{'apikey_error':'Invalide Apikey'}";
             //exit;
         }
     }
 }
開發者ID:vmangla,項目名稱:evendor,代碼行數:32,代碼來源:IndexController_02_april_2013.php

示例5: protectPageForbidSuperadmin

 /**
  *	@author Anthony Boutinov
  */
 public function protectPageForbidSuperadmin()
 {
     if ($this->database->is_superadmin()) {
         Notification::addNextPage('Вы не имеете право доступа к странице, на которую пытались перейти.', 'warning');
         CommonFunctions::redirect($this->adminMainPage);
     }
 }
開發者ID:anthonyboutinov,項目名稱:WiFiAuth,代碼行數:10,代碼來源:Protector.php

示例6: __construct

 public function __construct()
 {
     parent::__construct();
     switch (defined('PSI_SENSOR_SPEEDFAN_ACCESS') ? strtolower(PSI_SENSOR_SPEEDFAN_ACCESS) : 'command') {
         case 'command':
             if (CommonFunctions::executeProgram("SpeedFanGet.exe", "", $buffer, PSI_DEBUG) && strlen($buffer) > 0) {
                 if (preg_match("/^Temperatures:\\s+(.+)\$/m", $buffer, $out)) {
                     $this->_filecontent["temp"] = $out[1];
                 }
                 if (preg_match("/^Fans:\\s+(.+)\$/m", $buffer, $out)) {
                     $this->_filecontent["fans"] = $out[1];
                 }
                 if (preg_match("/^Voltages:\\s+(.+)\$/m", $buffer, $out)) {
                     $this->_filecontent["volt"] = $out[1];
                 }
             }
             break;
         case 'data':
             if (CommonFunctions::rfts(APP_ROOT . '/data/speedfan.txt', $buffer) && strlen($buffer) > 0) {
                 if (preg_match("/^Temperatures:\\s+(.+)\$/m", $buffer, $out)) {
                     $this->_filecontent["temp"] = $out[1];
                 }
                 if (preg_match("/^Fans:\\s+(.+)\$/m", $buffer, $out)) {
                     $this->_filecontent["fans"] = $out[1];
                 }
                 if (preg_match("/^Voltages:\\s+(.+)\$/m", $buffer, $out)) {
                     $this->_filecontent["volt"] = $out[1];
                 }
             }
             break;
         default:
             $this->error->addConfigError('__construct()', 'PSI_SENSOR_SPEEDFAN_ACCESS');
             break;
     }
 }
開發者ID:FleuryK,項目名稱:phpsysinfo,代碼行數:35,代碼來源:class.speedfan.inc.php

示例7: _network

 /**
  * get network information
  *
  * @return void
  */
 private function _network()
 {
     if (CommonFunctions::executeProgram('netstat', '-nibd | grep Link', $netstat, PSI_DEBUG)) {
         $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
         foreach ($lines as $line) {
             $ar_buf = preg_split("/\\s+/", $line);
             if (!empty($ar_buf[0])) {
                 $dev = new NetDevice();
                 $dev->setName($ar_buf[0]);
                 if (strlen($ar_buf[3]) < 15) {
                     $dev->setTxBytes($ar_buf[8]);
                     $dev->setRxBytes($ar_buf[5]);
                     $dev->setDrops($ar_buf[10]);
                     $dev->setErrors($ar_buf[4] + $ar_buf[7]);
                 } else {
                     $dev->setTxBytes($ar_buf[9]);
                     $dev->setRxBytes($ar_buf[6]);
                     $dev->setErrors($ar_buf[5] + $ar_buf[8]);
                     $dev->setDrops($ar_buf[11]);
                 }
                 $this->sys->setNetDevices($dev);
             }
         }
     }
 }
開發者ID:kamaulynder,項目名稱:Ushahidi_Chile,代碼行數:30,代碼來源:class.FreeBSD.inc.php

示例8: __construct

 public function __construct()
 {
     global $configEtude;
     //Controleur d'instanciation
     $this->m_ctrl = new instanciation();
     CommonFunctions::__construct($configEtude, $this->m_ctrl);
 }
開發者ID:ThomasPerraudin,項目名稱:ALIX-EDC-SOLUTIONS,代碼行數:7,代碼來源:getAE.php

示例9: __construct

 /**
  * fill the private content var through command or data access
  */
 public function __construct()
 {
     parent::__construct();
     switch (defined('PSI_SENSOR_LMSENSORS_ACCESS') ? strtolower(PSI_SENSOR_LMSENSORS_ACCESS) : 'command') {
         case 'command':
             if (CommonFunctions::executeProgram("sensors", "", $lines)) {
                 // Martijn Stolk: Dirty fix for misinterpreted output of sensors,
                 // where info could come on next line when the label is too long.
                 $lines = str_replace(":\n", ":", $lines);
                 $lines = str_replace("\n\n", "\n", $lines);
                 $this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
             }
             break;
         case 'data':
             if (CommonFunctions::rfts(APP_ROOT . '/data/lmsensors.txt', $lines)) {
                 $lines = str_replace(":\n", ":", $lines);
                 $lines = str_replace("\n\n", "\n", $lines);
                 $this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
             }
             break;
         default:
             $this->error->addConfigError('__construct()', 'PSI_SENSOR_LMSENSORS_ACCESS');
             break;
     }
 }
開發者ID:CrusherXRay,項目名稱:phpsysinfo,代碼行數:28,代碼來源:class.lmsensors.inc.php

示例10: __construct

 /**
  * read the data into an internal array and also call the parent constructor
  *
  * @param String $enc encoding
  */
 public function __construct($enc)
 {
     $buffer = "";
     parent::__construct(__CLASS__, $enc);
     switch (strtolower(PSI_PLUGIN_DMRAID_ACCESS)) {
         case 'command':
             if (PSI_OS == 'FreeBSD') {
                 CommonFunctions::executeProgram("graid", "list", $buffer);
             } else {
                 CommonFunctions::executeProgram("dmraid", "-s -vv 2>&1", $buffer);
             }
             break;
         case 'data':
             CommonFunctions::rfts(APP_ROOT . "/data/dmraid.txt", $buffer);
             break;
         default:
             $this->global_error->addConfigError("__construct()", "PSI_PLUGIN_DMRAID_ACCESS");
             break;
     }
     if (trim($buffer) != "") {
         if (PSI_OS == 'FreeBSD') {
             $this->_filecontent = preg_split("/Consumers:\r?\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
         } else {
             $this->_filecontent = preg_split("/(\r?\n\\*\\*\\* )|(\r?\n--> )/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
         }
     } else {
         $this->_filecontent = array();
     }
 }
開發者ID:FleuryK,項目名稱:phpsysinfo,代碼行數:34,代碼來源:class.dmraid.inc.php

示例11: __construct

 /**
  * read the data into an internal array and also call the parent constructor
  *
  * @param String $enc encoding
  */
 public function __construct($enc)
 {
     parent::__construct(__CLASS__, $enc);
     CommonFunctions::rfts(PSI_PLUGIN_UPDATENOTIFIER_FILE, $buffer_info);
     // Remove blank lines
     $this->_filecontent = preg_split("/\n/", $buffer_info, -1, PREG_SPLIT_NO_EMPTY);
 }
開發者ID:KingNoosh,項目名稱:Teknik,代碼行數:12,代碼來源:class.updatenotifier.inc.php

示例12: __construct

 /**
  * get all information from all configured ups and store output in internal array
  */
 public function __construct()
 {
     parent::__construct();
     if (defined('PSI_UPS_NUT_LIST') && is_string(PSI_UPS_NUT_LIST)) {
         if (preg_match(ARRAY_EXP, PSI_UPS_NUT_LIST)) {
             $upses = eval(PSI_UPS_NUT_LIST);
         } else {
             $upses = array(PSI_UPS_NUT_LIST);
         }
         foreach ($upses as $ups) {
             CommonFunctions::executeProgram('upsc', '-l ' . trim($ups), $output, PSI_DEBUG);
             $ups_names = preg_split("/\n/", $output, -1, PREG_SPLIT_NO_EMPTY);
             foreach ($ups_names as $ups_name) {
                 CommonFunctions::executeProgram('upsc', trim($ups_name) . '@' . trim($ups), $temp, PSI_DEBUG);
                 if (!empty($temp)) {
                     $this->_output[trim($ups_name) . '@' . trim($ups)] = $temp;
                 }
             }
         }
     } else {
         //use default if address and port not defined
         CommonFunctions::executeProgram('upsc', '-l', $output, PSI_DEBUG);
         $ups_names = preg_split("/\n/", $output, -1, PREG_SPLIT_NO_EMPTY);
         foreach ($ups_names as $ups_name) {
             CommonFunctions::executeProgram('upsc', trim($ups_name), $temp, PSI_DEBUG);
             if (!empty($temp)) {
                 $this->_output[trim($ups_name)] = $temp;
             }
         }
     }
 }
開發者ID:phpsysinfo,項目名稱:phpsysinfo,代碼行數:34,代碼來源:class.nut.inc.php

示例13: __construct

 /**
  * call the parent constructor and check for needed extensions
  */
 public function __construct()
 {
     CommonFunctions::checkForSVN();
     CommonFunctions::checkForExtensions();
     $this->error = Error::singleton();
     $this->_checkConfig();
 }
開發者ID:sorrowchen,項目名稱:openfiler-cn,代碼行數:10,代碼來源:class.Output.inc.php

示例14: __construct

 /**
  * fill the private content var through tcp or file access
  */
 public function __construct()
 {
     parent::__construct();
     switch (strtolower(PSI_SENSOR_ACCESS)) {
         case 'tcp':
             $fp = fsockopen("localhost", 411, $errno, $errstr, 5);
             if ($fp) {
                 $lines = "";
                 while (!feof($fp)) {
                     $lines .= fread($fp, 1024);
                 }
                 $this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
             } else {
                 $this->error->addError("fsockopen()", $errno . " " . $errstr);
             }
             break;
         case 'command':
             CommonFunctions::executeProgram('mbmon', '-c 1 -r', $lines, PSI_DEBUG);
             $this->_lines = preg_split("/\n/", $lines, -1, PREG_SPLIT_NO_EMPTY);
             break;
         default:
             $this->error->addConfigError('__construct()', 'PSI_SENSOR_ACCESS');
             break;
     }
 }
開發者ID:sorrowchen,項目名稱:openfiler-cn,代碼行數:28,代碼來源:class.MBMon.inc.php

示例15: socdiscoo

 function socdiscoo($tblConfig, $SubjectKey)
 {
     CommonFunctions::__construct($tblConfig, null);
     $this->addLog("socdiscoo->socdiscoo(,{$SubjectKey})", INFO);
     $this->m_tblLocks = array();
     $this->initContext($SubjectKey);
 }
開發者ID:bluedrone,項目名稱:ALIX-EDC-SOLUTIONS,代碼行數:7,代碼來源:class.socdiscoo.inc.php


注:本文中的CommonFunctions類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。