本文整理汇总了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();