编译php-5.3.28

1. 下载php-5.3.28

2. 编译/安装

  ./configure --prefix=/usr/local/php --enable-fpm --enable-maintainer-zts --with-curl

 

 

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>结果数据</title>
</head>
<body>
	


<?php
$path = $_POST['path'];
$langs = $_POST['langs'];
$key = $_POST['lang-key'];

/**
* load lang files
*/
  class lang_thread_run extends Thread   
  {  
      public $lang;  
      public $path;  
      public $key;  
      public $data;  
  
      public function __construct($lang, $path, $key)  
      {  
          $this->lang = $lang;  
          $this->path = $path;  
          $this->key = $key;  
      }  
  
      public function run()  
      {  
          if(($path = $this->path))  
          {  
          	require_once($path);
              $this->data = constant($this->key);  
          }  
      }  
  } 

function zen_href_link($value='')
{
	return "";
}

if (!ini_get('display_errors')) {
    ini_set('display_errors', '1');
}
if (!empty($langs) && !empty($key))  {
	if (empty($path))  {
		$file_path = '$.php';
	} else {
		$file_path = '$/'.$path;
	}

	$langs = explode(',', $langs);
	$res = array();
	$thread_array = array();

	// get  lang by key
	foreach ($langs as  $value) {
		$thread_array[$value] = new lang_thread_run($value, str_replace('$', $value, $file_path), $key);
		$thread_array[$value]->start();
	}

	foreach ($thread_array as $thread_array_key => $thread_array_value)   
	      {  
	          while($thread_array[$thread_array_key]->isRunning())  
	          {  
	              usleep(10);  
	          }  
	          if($thread_array[$thread_array_key]->join())  
	          {  
	              $data_res[$thread_array_key] = $thread_array[$thread_array_key]->data;  
	          }  
	      }

      	foreach ($langs as  $value) {
      		$res[$value] = $data_res[$value];
      	}

      	echo implode(',', $res);
}

?>
</body>
</html>

  

转载于:https://www.cnblogs.com/javawer/p/4798004.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值