惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Blog — PlanetScale
Blog — PlanetScale
PCI Perspectives
PCI Perspectives
K
Kaspersky official blog
T
Tenable Blog
Help Net Security
Help Net Security
Vercel News
Vercel News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
F
Fortinet All Blogs
罗磊的独立博客
P
Palo Alto Networks Blog
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
人人都是产品经理
人人都是产品经理
L
LangChain Blog
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
博客园_首页
D
Darknet – Hacking Tools, Hacker News & Cyber Security
H
Help Net Security
S
Secure Thoughts
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Project Zero
Project Zero
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
V
V2EX
Last Week in AI
Last Week in AI
H
Heimdal Security Blog
U
Unit 42
Y
Y Combinator Blog
The GitHub Blog
The GitHub Blog
SecWiki News
SecWiki News
量子位
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
NISL@THU
NISL@THU
S
Securelist
P
Proofpoint News Feed
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
云风的 BLOG
云风的 BLOG
I
Intezer
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园 - Franky
Cisco Talos Blog
Cisco Talos Blog
小众软件
小众软件
C
CXSECURITY Database RSS Feed - CXSecurity.com

博客园 - 尘梦

calude code 2.188 根据cli.map还原 centos6 安装gcc 多版本 自定义编译bulma 神通mysql模式转 mysql ai数学书籍 chromedriver 网络安全渗透测试写法 编译php需要的扩展 python 合并同列数据 组合 新的excel vue table 表格记录选中 linux wktohtmlpdf 结合/tmp路径 无法创建问题 c语言开发 php扩展 sm4 macos php 如何链接神通数据库aci layui table tr a标签倒计时 操作 刷新以后继续倒计时 使用c# 开发 php的com组件 世界级地图数据处理 及 联动效果 python 部署chatglm2b macos 下连接php 人大金仓pdo_kdb问题 php curl 多次发送
php 结合pcntl_fork导出excel数据 使用
尘梦 · 2023-10-26 · via 博客园 - 尘梦
// 任务列表

  $userInfo = $this->user->getUserInfo(0, 50000);
  // 存储子进程的PID
  $childPids = [];

  for ($i = 1; $i <= 20; $i++) {
   $pid = pcntl_fork();

   if ($pid == -1) {
    die("无法创建子进程");
   } elseif ($pid == 0) {
    $is = ($i - 1) * 1000;
    $test = array_slice($userInfo, $is, 1000);

    foreach ($test as $key => $vals) {
     $childPids[] = array(
      'name' => decryptInfo($vals['name']),
      'hash' => $this->pub->decrypt($vals['hash'], $keypws),
      'dzyj' => decryptInfo($vals['dzyj']),
      'sj' => decryptInfo($vals['sj'])
     );
    }
    file_put_contents(APPPATH . 'data/test.json', json_encode($childPids), FILE_APPEND);
    exit(); // 子进程执行完毕后退出
   }
  }

  // 父进程等待所有子进程完成
  while (pcntl_waitpid(0, $status) != -1) {
   $status = pcntl_wexitstatus($status);
   echo "子进程 {$status} 已完成\n";
  }
``