<?php/*** iCMS - i Content Management System* Copyright (c) 2007-2017 iCMSdev.com. All rights reserved.** @author icmsdev <master@icmsdev.com>* @site https://www.icmsdev.com* @licence https://www.icmsdev.com/LICENSE.html*/$_SERVER = array_merge($_SERVER, ['SERVER_SOFTWARE' => 'iCMS SHELL/8.0.0 (CLI)', // 服务器软件'SERVER_NAME' => 'localhost', // 服务器名称'SERVER_ADDR' => '127.0.0.1', // 服务器 IP 地址'SERVER_PORT' => '80', // 服务器端口'REMOTE_ADDR' => '127.0.0.1', // 客户端 IP 地址'DOCUMENT_ROOT' => __DIR__, // 文档根目录'REQUEST_SCHEME' => 'run', // 请求协议 (http 或 https)'REQUEST_METHOD' => 'shell', // 请求方法 (GET, POST, etc.)'REQUEST_URI' => '/run.php', // 请求的 URI// 'QUERY_STRING' => '', // 查询字符串'HTTP_HOST' => 'localhost', // HTTP Host 头'HTTP_USER_AGENT' => 'iCMS SHELL/5.0', // 用户代理'HTTP_ACCEPT' => 'text/html', // Accept 头'HTTP_ACCEPT_LANGUAGE' => 'en-US', // Accept-Language 头'HTTP_CONNECTION' => 'keep-alive', // Connection 头'SCRIPT_FILENAME' => __FILE__, // 脚本文件名'SCRIPT_NAME' => '/run.php', // 脚本名称'PHP_SELF' => '/run.php', // 当前脚本路径]);require __DIR__ . '/iCMS.php';function shutdown_pid(){if (!isset($GLOBALS['shutdown_pid'])) {return 'Shutdown PID not defined.';}$pfile = $GLOBALS['shutdown_pid'];if ($pfile && file_exists($pfile)) {echo "$pfile delete;" . PHP_EOL;@unlink($pfile);} else {return 'PID file does not exist.';}}if (!function_exists('pcntl_signal')) {function pcntl_signal($a = null, $b = null){return;}}declare(ticks=1);defined('SIGTERM') or define('SIGTERM', 15);defined('SIGHUP') or define('SIGHUP', 1);defined('SIGINT') or define('SIGINT', 2);pcntl_signal(SIGTERM, 'sig_handler');pcntl_signal(SIGHUP, 'sig_handler');pcntl_signal(SIGINT, 'sig_handler');//信号处理函数function sig_handler($signo){switch ($signo) {case SIGTERM:// 处理killecho PHP_EOL . 'kill' . PHP_EOL;shutdown_pid();exit;break;case SIGHUP://处理SIGHUP信号break;case SIGINT://处理ctrl+cecho PHP_EOL . 'ctrl+c' . PHP_EOL;shutdown_pid();exit;break;default:// 处理所有其他信号}}function shutdown(){shutdown_pid();}register_shutdown_function('shutdown');Utils::buffer();iCMS::cli();
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型