123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- /**
- * 监控配置中心
- */
- class TCommand extends CConsoleCommand {
-
- public function actionIndex($img=''){
- if(!$img) {
- $this->showMsg('img required');
- exit;
- }
- $image_array = getimagesize($img);
- print_r($image_array);
- }
- public function actionC($url){
- if(!$url) {
- $this->showMsg('url required');
- exit;
- }
- $curl = @curl_init();
- if ($curl) {
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
- curl_setopt($curl, CURLOPT_TIMEOUT, 3);
- curl_setopt($curl, CURLOPT_URL, $url);
- curl_setopt($curl, CURLOPT_POST, 0);
- curl_setopt($curl, CURLOPT_HTTPHEADER, array(
- 'Content-Type: application/json',
- ));
- $response = curl_exec($curl);
- curl_close($curl);
- }
- print_r($response);
- }
- /**
- * 显示信息
- * @param $status
- * @param $msg
- */
- protected function showMsg($msg)
- {
- echo $msg . PHP_EOL;
- }
- }
|