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


PHP Services::services方法代碼示例

本文整理匯總了PHP中Services::services方法的典型用法代碼示例。如果您正苦於以下問題:PHP Services::services方法的具體用法?PHP Services::services怎麽用?PHP Services::services使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Services的用法示例。


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

示例1: addService

 public function addService($arr)
 {
     Services::$services = array_merge(Services::$services, $arr);
 }
開發者ID:rpromore,項目名稱:astrobeats,代碼行數:4,代碼來源:services.php

示例2: init

 /**
  * Static initialization
  */
 public static function init()
 {
     self::$services = new DependencyInjection();
 }
開發者ID:elvisdandrea,項目名稱:ag3,代碼行數:7,代碼來源:Services.php

示例3: file_exists

}
$page = 'pages' . DIRECTORY_SEPARATOR . $_GET['page'] . '.php';
$page = file_exists($page) ? $page : 'pages' . DIRECTORY_SEPARATOR . '404.php';
if (isset($_GET['action']) && isset($_GET['username']) && isset($_GET['password'])) {
    if ($ssh->login($_GET['username'], $_GET['password'])) {
        $action = $_GET['action'];
        if ($action == 'reboot') {
            echo "Action: " . $_GET["action"] . "\\nSuccessfully perfomed ";
            $ssh->exec("sudo shutdown -r now");
        } else {
            if ($action == 'shutdown') {
                echo "Action: " . $_GET["action"] . "\\nSuccessfully perfomed ";
                $ssh->exec("sudo shutdown -h now");
            } else {
                if ($action == 'changeservicestatus') {
                    $services = Services::services();
                    for ($i = 0; $i < sizeof($services); $i++) {
                        if ($services[$i]['name'] == $_GET['servicename']) {
                            if ($services[$i]['status'] == '+') {
                                $ssh->exec("sudo service " . $services[$i]['name'] . " stop");
                                echo "Service: " . $services[$i]['name'] . " stopped";
                            } else {
                                $ssh->exec("sudo service " . $services[$i]['name'] . " start");
                                echo "Service: " . $services[$i]['name'] . " started";
                            }
                            break;
                        }
                    }
                } else {
                    if ($action == 'changepartitionstatus') {
                        $disks = Disks::disks();
開發者ID:oyassine,項目名稱:RaspMonitor,代碼行數:31,代碼來源:index.php


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