本文整理匯總了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);
}
示例2: init
/**
* Static initialization
*/
public static function init()
{
self::$services = new DependencyInjection();
}
示例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();