mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-17 13:55:35 +08:00
Compare commits
3 Commits
be576a93d3
...
2.7.6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b05bdcd83d | ||
|
|
6a4ad34324 | ||
|
|
f1d1d4fe10 |
@@ -756,6 +756,18 @@
|
|||||||
"apcu"
|
"apcu"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"snmp": {
|
||||||
|
"support": {
|
||||||
|
"Windows": "wip",
|
||||||
|
"BSD": "wip"
|
||||||
|
},
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type-unix": "with",
|
||||||
|
"arg-type-windows": "with",
|
||||||
|
"lib-depends": [
|
||||||
|
"net-snmp"
|
||||||
|
]
|
||||||
|
},
|
||||||
"soap": {
|
"soap": {
|
||||||
"support": {
|
"support": {
|
||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
@@ -988,6 +1000,14 @@
|
|||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"build-with-php": true
|
"build-with-php": true
|
||||||
},
|
},
|
||||||
|
"trader": {
|
||||||
|
"support": {
|
||||||
|
"BSD": "wip",
|
||||||
|
"Windows": "wip"
|
||||||
|
},
|
||||||
|
"type": "external",
|
||||||
|
"source": "ext-trader"
|
||||||
|
},
|
||||||
"uuid": {
|
"uuid": {
|
||||||
"support": {
|
"support": {
|
||||||
"Windows": "wip",
|
"Windows": "wip",
|
||||||
|
|||||||
@@ -697,6 +697,17 @@
|
|||||||
"libncurses.a"
|
"libncurses.a"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"net-snmp": {
|
||||||
|
"source": "net-snmp",
|
||||||
|
"pkg-configs": [
|
||||||
|
"netsnmp",
|
||||||
|
"netsnmp-agent"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"openssl",
|
||||||
|
"zlib"
|
||||||
|
]
|
||||||
|
},
|
||||||
"nghttp2": {
|
"nghttp2": {
|
||||||
"source": "nghttp2",
|
"source": "nghttp2",
|
||||||
"static-libs-unix": [
|
"static-libs-unix": [
|
||||||
|
|||||||
@@ -233,6 +233,16 @@
|
|||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ext-trader": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://pecl.php.net/get/trader",
|
||||||
|
"path": "php-src/ext/trader",
|
||||||
|
"filename": "trader.tgz",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
"ext-uuid": {
|
"ext-uuid": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://pecl.php.net/get/uuid",
|
"url": "https://pecl.php.net/get/uuid",
|
||||||
@@ -810,6 +820,14 @@
|
|||||||
"path": "COPYING"
|
"path": "COPYING"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"net-snmp": {
|
||||||
|
"type": "ghtagtar",
|
||||||
|
"repo": "net-snmp/net-snmp",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "COPYING"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nghttp2": {
|
"nghttp2": {
|
||||||
"type": "ghrel",
|
"type": "ghrel",
|
||||||
"repo": "nghttp2/nghttp2",
|
"repo": "nghttp2/nghttp2",
|
||||||
|
|||||||
219
docs/.vitepress/components/Contributors.vue
Normal file
219
docs/.vitepress/components/Contributors.vue
Normal file
@@ -0,0 +1,219 @@
|
|||||||
|
<template>
|
||||||
|
<div class="contributors-container">
|
||||||
|
<div class="contributors-header">
|
||||||
|
<h2>Contributors</h2>
|
||||||
|
<p class="contributors-description">
|
||||||
|
Thanks to all the amazing people who have contributed to this project!
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="loading" class="loading-state">
|
||||||
|
<div class="spinner"></div>
|
||||||
|
<p>Loading contributors...</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else-if="error" class="error-state">
|
||||||
|
<p>{{ error }}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else class="contributors-grid">
|
||||||
|
<a
|
||||||
|
v-for="contributor in contributors"
|
||||||
|
:key="contributor.id"
|
||||||
|
:href="contributor.html_url"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
class="contributor-card"
|
||||||
|
:title="contributor.login"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
:src="contributor.avatar_url"
|
||||||
|
:alt="contributor.login"
|
||||||
|
class="contributor-avatar"
|
||||||
|
loading="lazy"
|
||||||
|
/>
|
||||||
|
<div class="contributor-name">{{ contributor.login }}</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted } from 'vue';
|
||||||
|
|
||||||
|
interface Contributor {
|
||||||
|
id: number;
|
||||||
|
login: string;
|
||||||
|
avatar_url: string;
|
||||||
|
html_url: string;
|
||||||
|
contributions: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
const contributors = ref<Contributor[]>([]);
|
||||||
|
const loading = ref(true);
|
||||||
|
const error = ref('');
|
||||||
|
|
||||||
|
const fetchContributors = async () => {
|
||||||
|
try {
|
||||||
|
loading.value = true;
|
||||||
|
error.value = '';
|
||||||
|
|
||||||
|
const response = await fetch(
|
||||||
|
'https://api.github.com/repos/crazywhalecc/static-php-cli/contributors?per_page=24'
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error('Failed to fetch contributors');
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = await response.json();
|
||||||
|
contributors.value = data;
|
||||||
|
} catch (err) {
|
||||||
|
error.value = 'Failed to load contributors. Please try again later.';
|
||||||
|
console.error('Error fetching contributors:', err);
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
fetchContributors();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.contributors-container {
|
||||||
|
margin: 48px auto;
|
||||||
|
padding: 32px 24px;
|
||||||
|
max-width: 1152px;
|
||||||
|
background: linear-gradient(135deg, var(--vp-c-bg-soft) 0%, var(--vp-c-bg) 100%);
|
||||||
|
border-radius: 16px;
|
||||||
|
border: 1px solid var(--vp-c-divider);
|
||||||
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.contributors-header {
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contributors-header h2 {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
font-weight: 700;
|
||||||
|
margin: 0 0 8px 0;
|
||||||
|
background: linear-gradient(120deg, var(--vp-c-brand-1), var(--vp-c-brand-2));
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
|
background-clip: text;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contributors-description {
|
||||||
|
font-size: 0.95rem;
|
||||||
|
color: var(--vp-c-text-2);
|
||||||
|
margin: 0;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-state,
|
||||||
|
.error-state {
|
||||||
|
text-align: center;
|
||||||
|
padding: 40px 20px;
|
||||||
|
color: var(--vp-c-text-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.spinner {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
margin: 0 auto 16px;
|
||||||
|
border: 4px solid var(--vp-c-divider);
|
||||||
|
border-top-color: var(--vp-c-brand-1);
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: spin 1s linear infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes spin {
|
||||||
|
to {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.contributors-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contributor-card {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
padding: 12px;
|
||||||
|
background: var(--vp-c-bg);
|
||||||
|
border-radius: 12px;
|
||||||
|
border: 1px solid var(--vp-c-divider);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
text-decoration: none;
|
||||||
|
color: var(--vp-c-text-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.contributor-card:hover {
|
||||||
|
transform: translateY(-4px);
|
||||||
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
||||||
|
border-color: var(--vp-c-brand-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.contributor-avatar {
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 2px solid var(--vp-c-divider);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contributor-card:hover .contributor-avatar {
|
||||||
|
border-color: var(--vp-c-brand-1);
|
||||||
|
transform: scale(1.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.contributor-name {
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
text-align: center;
|
||||||
|
word-break: break-word;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.contributors-container {
|
||||||
|
margin: 32px 16px;
|
||||||
|
padding: 24px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contributors-header h2 {
|
||||||
|
font-size: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contributors-description {
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contributors-grid {
|
||||||
|
grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contributor-card {
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contributor-avatar {
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contributor-name {
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -4,19 +4,15 @@
|
|||||||
max-width: 1000px !important;
|
max-width: 1000px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Custom brand color */
|
|
||||||
:root {
|
.vp-doc .contributors-header h2 {
|
||||||
--vp-c-brand-1: #9d7a47;
|
padding-top: 0;
|
||||||
--vp-c-brand-2: #b08f59;
|
border-top: none;
|
||||||
--vp-c-brand-3: #c8a16e;
|
|
||||||
--vp-c-brand-soft: rgba(157, 122, 71, 0.14);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark {
|
.vp-doc .sponsors-header h2 {
|
||||||
--vp-c-brand-1: #c8a16e;
|
padding-top: 0;
|
||||||
--vp-c-brand-2: #b08f59;
|
border-top: none;
|
||||||
--vp-c-brand-3: #9d7a47;
|
|
||||||
--vp-c-brand-soft: rgba(176, 143, 89, 0.16);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark .VPImage.logo {
|
.dark .VPImage.logo {
|
||||||
|
|||||||
@@ -14,14 +14,11 @@ hero:
|
|||||||
link: ./guide/
|
link: ./guide/
|
||||||
|
|
||||||
features:
|
features:
|
||||||
- icon: 🚀
|
- title: Static CLI Binary
|
||||||
title: Static CLI Binary
|
|
||||||
details: You can easily compile a standalone php binary for general use. Including CLI, FPM sapi.
|
details: You can easily compile a standalone php binary for general use. Including CLI, FPM sapi.
|
||||||
- icon: 📦
|
- title: Micro Self-Extracted Executable
|
||||||
title: Micro Self-Extracted Executable
|
|
||||||
details: You can compile a self-extracted executable and build with your php source code.
|
details: You can compile a self-extracted executable and build with your php source code.
|
||||||
- icon: 🔧
|
- title: Dependency Management
|
||||||
title: Dependency Management
|
|
||||||
details: static-php-cli comes with dependency management and supports installation of different types of PHP extensions.
|
details: static-php-cli comes with dependency management and supports installation of different types of PHP extensions.
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -37,7 +34,7 @@ const sponsors = [
|
|||||||
|
|
||||||
<div class="sponsors-section">
|
<div class="sponsors-section">
|
||||||
<div class="sponsors-header">
|
<div class="sponsors-header">
|
||||||
<h2>💝 Special Sponsors</h2>
|
<h2>Special Sponsors</h2>
|
||||||
<p class="sponsors-description">
|
<p class="sponsors-description">
|
||||||
Thank you to our amazing sponsors for supporting this project!
|
Thank you to our amazing sponsors for supporting this project!
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -17,14 +17,11 @@ hero:
|
|||||||
link: /zh/
|
link: /zh/
|
||||||
|
|
||||||
features:
|
features:
|
||||||
- icon: 🚀
|
- title: Static CLI Binary
|
||||||
title: Static CLI Binary
|
|
||||||
details: You can easily compile a standalone php binary for general use. Including CLI, FPM sapi.
|
details: You can easily compile a standalone php binary for general use. Including CLI, FPM sapi.
|
||||||
- icon: 📦
|
- title: Micro Self-Extracted Executable
|
||||||
title: Micro Self-Extracted Executable
|
|
||||||
details: You can compile a self-extracted executable and build with your php source code.
|
details: You can compile a self-extracted executable and build with your php source code.
|
||||||
- icon: 🔧
|
- title: Dependency Management
|
||||||
title: Dependency Management
|
|
||||||
details: static-php-cli comes with dependency management and supports installation of different types of PHP extensions.
|
details: static-php-cli comes with dependency management and supports installation of different types of PHP extensions.
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -40,7 +37,7 @@ const sponsors = [
|
|||||||
|
|
||||||
<div class="sponsors-section">
|
<div class="sponsors-section">
|
||||||
<div class="sponsors-header">
|
<div class="sponsors-header">
|
||||||
<h2>💝 Special Sponsors</h2>
|
<h2>Special Sponsors</h2>
|
||||||
<p class="sponsors-description">
|
<p class="sponsors-description">
|
||||||
Thank you to our amazing sponsors for supporting this project!
|
Thank you to our amazing sponsors for supporting this project!
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 630 KiB After Width: | Height: | Size: 965 KiB |
@@ -14,14 +14,11 @@ hero:
|
|||||||
link: ./guide/
|
link: ./guide/
|
||||||
|
|
||||||
features:
|
features:
|
||||||
- icon: 🚀
|
- title: 静态 CLI 二进制
|
||||||
title: 静态 CLI 二进制
|
|
||||||
details: 您可以轻松地编译一个独立的 PHP 二进制文件以供通用使用,包括 CLI、FPM SAPI。
|
details: 您可以轻松地编译一个独立的 PHP 二进制文件以供通用使用,包括 CLI、FPM SAPI。
|
||||||
- icon: 📦
|
- title: Micro 自解压可执行文件
|
||||||
title: Micro 自解压可执行文件
|
|
||||||
details: 您可以编译一个自解压的可执行文件,并将 PHP 源代码与二进制文件打包在一起。
|
details: 您可以编译一个自解压的可执行文件,并将 PHP 源代码与二进制文件打包在一起。
|
||||||
- icon: 🔧
|
- title: 依赖管理
|
||||||
title: 依赖管理
|
|
||||||
details: static-php-cli 附带依赖项管理,支持安装不同类型的 PHP 扩展。
|
details: static-php-cli 附带依赖项管理,支持安装不同类型的 PHP 扩展。
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -37,7 +34,7 @@ const sponsors = [
|
|||||||
|
|
||||||
<div class="sponsors-section">
|
<div class="sponsors-section">
|
||||||
<div class="sponsors-header">
|
<div class="sponsors-header">
|
||||||
<h2>💝 特别赞助商</h2>
|
<h2>特别赞助商</h2>
|
||||||
<p class="sponsors-description">
|
<p class="sponsors-description">
|
||||||
感谢我们出色的赞助商对本项目的支持!
|
感谢我们出色的赞助商对本项目的支持!
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
29
src/SPC/builder/extension/snmp.php
Normal file
29
src/SPC/builder/extension/snmp.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
|
use SPC\builder\Extension;
|
||||||
|
use SPC\store\FileSystem;
|
||||||
|
use SPC\util\CustomExt;
|
||||||
|
use SPC\util\PkgConfigUtil;
|
||||||
|
|
||||||
|
#[CustomExt('snmp')]
|
||||||
|
class snmp extends Extension
|
||||||
|
{
|
||||||
|
public function patchBeforeBuildconf(): bool
|
||||||
|
{
|
||||||
|
// Overwrite m4 config using newer PHP version
|
||||||
|
if ($this->builder->getPHPVersionID() < 80400) {
|
||||||
|
FileSystem::copy(ROOT_DIR . '/src/globals/extra/snmp-ext-config-old.m4', "{$this->source_dir}/config.m4");
|
||||||
|
}
|
||||||
|
$libs = implode(' ', PkgConfigUtil::getLibsArray('netsnmp'));
|
||||||
|
FileSystem::replaceFileStr(
|
||||||
|
"{$this->source_dir}/config.m4",
|
||||||
|
'PHP_EVAL_LIBLINE([$SNMP_LIBS], [SNMP_SHARED_LIBADD])',
|
||||||
|
"SNMP_LIBS=\"{$libs}\"\nPHP_EVAL_LIBLINE([\$SNMP_LIBS], [SNMP_SHARED_LIBADD])"
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
12
src/SPC/builder/linux/library/net_snmp.php
Normal file
12
src/SPC/builder/linux/library/net_snmp.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\linux\library;
|
||||||
|
|
||||||
|
class net_snmp extends LinuxLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\net_snmp;
|
||||||
|
|
||||||
|
public const NAME = 'net-snmp';
|
||||||
|
}
|
||||||
@@ -78,7 +78,7 @@ class openssl extends LinuxLibraryBase
|
|||||||
if (!str_contains($file = FileSystem::readFile(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc'), 'prefix=')) {
|
if (!str_contains($file = FileSystem::readFile(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc'), 'prefix=')) {
|
||||||
FileSystem::writeFile(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc', 'prefix=' . BUILD_ROOT_PATH . "\n" . $file);
|
FileSystem::writeFile(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc', 'prefix=' . BUILD_ROOT_PATH . "\n" . $file);
|
||||||
}
|
}
|
||||||
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc', '/Libs.private:.*/m', 'Libs.private: ${libdir}/libz.a');
|
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc', '/Libs.private:.*/m', 'Requires.private: zlib');
|
||||||
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/cmake/OpenSSL/OpenSSLConfig.cmake', '/set\(OPENSSL_LIBCRYPTO_DEPENDENCIES .*\)/m', 'set(OPENSSL_LIBCRYPTO_DEPENDENCIES "${OPENSSL_LIBRARY_DIR}/libz.a")');
|
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/cmake/OpenSSL/OpenSSLConfig.cmake', '/set\(OPENSSL_LIBCRYPTO_DEPENDENCIES .*\)/m', 'set(OPENSSL_LIBCRYPTO_DEPENDENCIES "${OPENSSL_LIBRARY_DIR}/libz.a")');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
12
src/SPC/builder/macos/library/net_snmp.php
Normal file
12
src/SPC/builder/macos/library/net_snmp.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\macos\library;
|
||||||
|
|
||||||
|
class net_snmp extends MacOSLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\net_snmp;
|
||||||
|
|
||||||
|
public const NAME = 'net-snmp';
|
||||||
|
}
|
||||||
@@ -63,7 +63,7 @@ class openssl extends MacOSLibraryBase
|
|||||||
if (!str_contains($file = FileSystem::readFile(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc'), 'prefix=')) {
|
if (!str_contains($file = FileSystem::readFile(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc'), 'prefix=')) {
|
||||||
FileSystem::writeFile(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc', 'prefix=' . BUILD_ROOT_PATH . "\n" . $file);
|
FileSystem::writeFile(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc', 'prefix=' . BUILD_ROOT_PATH . "\n" . $file);
|
||||||
}
|
}
|
||||||
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc', '/Libs.private:.*/m', 'Libs.private: ${libdir}/libz.a');
|
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc', '/Libs.private:.*/m', 'Requires.private: zlib');
|
||||||
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/cmake/OpenSSL/OpenSSLConfig.cmake', '/set\(OPENSSL_LIBCRYPTO_DEPENDENCIES .*\)/m', 'set(OPENSSL_LIBCRYPTO_DEPENDENCIES "${OPENSSL_LIBRARY_DIR}/libz.a")');
|
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/cmake/OpenSSL/OpenSSLConfig.cmake', '/set\(OPENSSL_LIBCRYPTO_DEPENDENCIES .*\)/m', 'set(OPENSSL_LIBCRYPTO_DEPENDENCIES "${OPENSSL_LIBRARY_DIR}/libz.a")');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
49
src/SPC/builder/unix/library/net_snmp.php
Normal file
49
src/SPC/builder/unix/library/net_snmp.php
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\unix\library;
|
||||||
|
|
||||||
|
use SPC\store\FileSystem;
|
||||||
|
use SPC\util\executor\UnixAutoconfExecutor;
|
||||||
|
|
||||||
|
trait net_snmp
|
||||||
|
{
|
||||||
|
public function patchBeforeBuild(): bool
|
||||||
|
{
|
||||||
|
if (PHP_OS_FAMILY === 'Linux') {
|
||||||
|
FileSystem::replaceFileStr("{$this->source_dir}/configure", 'LIBS="-lssl ${OPENSSL_LIBS}"', 'LIBS="-lssl ${OPENSSL_LIBS} -lpthread -ldl"');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function build(): void
|
||||||
|
{
|
||||||
|
// use --static for PKG_CONFIG
|
||||||
|
UnixAutoconfExecutor::create($this)
|
||||||
|
->setEnv(['PKG_CONFIG' => getenv('PKG_CONFIG') . ' --static'])
|
||||||
|
->configure(
|
||||||
|
'--disable-mibs',
|
||||||
|
'--without-nl',
|
||||||
|
'--disable-agent',
|
||||||
|
'--disable-applications',
|
||||||
|
'--disable-manuals',
|
||||||
|
'--disable-scripts',
|
||||||
|
'--disable-embedded-perl',
|
||||||
|
'--without-perl-modules',
|
||||||
|
'--with-out-mib-modules="if-mib host disman/event-mib ucd-snmp/diskio mibII"',
|
||||||
|
'--with-out-transports="Unix"',
|
||||||
|
'--with-mib-modules=""',
|
||||||
|
'--enable-mini-agent',
|
||||||
|
'--with-default-snmp-version="3"',
|
||||||
|
'--with-sys-contact="@@no.where"',
|
||||||
|
'--with-sys-location="Unknown"',
|
||||||
|
'--with-logfile="/var/log/snmpd.log"',
|
||||||
|
'--with-persistent-directory="/var/lib/net-snmp"',
|
||||||
|
'--with-openssl=' . BUILD_ROOT_PATH,
|
||||||
|
'--with-zlib=' . BUILD_ROOT_PATH,
|
||||||
|
)->make(with_install: 'installheaders installlibs install_pkgconfig');
|
||||||
|
$this->patchPkgconfPrefix();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -40,7 +40,7 @@ class LinuxToolCheckList
|
|||||||
'tar', 'unzip', 'gzip', 'gcc', 'g++',
|
'tar', 'unzip', 'gzip', 'gcc', 'g++',
|
||||||
'bzip2', 'cmake', 'patch', 'which',
|
'bzip2', 'cmake', 'patch', 'which',
|
||||||
'xz', 'libtool', 'gettext-devel',
|
'xz', 'libtool', 'gettext-devel',
|
||||||
'patchelf',
|
'patchelf', 'file',
|
||||||
];
|
];
|
||||||
|
|
||||||
public const TOOLS_ARCH = [
|
public const TOOLS_ARCH = [
|
||||||
|
|||||||
@@ -115,6 +115,12 @@ class UnixAutoconfExecutor extends Executor
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setEnv(array $env): static
|
||||||
|
{
|
||||||
|
$this->shell->setEnv($env);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function appendEnv(array $env): static
|
public function appendEnv(array $env): static
|
||||||
{
|
{
|
||||||
$this->shell->appendEnv($env);
|
$this->shell->appendEnv($env);
|
||||||
|
|||||||
92
src/globals/extra/snmp-ext-config-old.m4
Normal file
92
src/globals/extra/snmp-ext-config-old.m4
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
PHP_ARG_WITH([snmp],
|
||||||
|
[for SNMP support],
|
||||||
|
[AS_HELP_STRING([[--with-snmp[=DIR]]],
|
||||||
|
[Include SNMP support. Use PKG_CONFIG_PATH (or SNMP_CFLAGS and SNMP_LIBS)
|
||||||
|
environment variables, or alternatively the optional DIR argument to
|
||||||
|
customize where to look for the net-snmp-config utility of the NET-SNMP
|
||||||
|
library.])])
|
||||||
|
|
||||||
|
if test "$PHP_SNMP" != "no"; then
|
||||||
|
snmp_found=no
|
||||||
|
AS_VAR_IF([PHP_SNMP], [yes],
|
||||||
|
[PKG_CHECK_MODULES([SNMP], [netsnmp >= 5.3], [snmp_found=yes], [:])])
|
||||||
|
|
||||||
|
AS_VAR_IF([snmp_found], [no], [
|
||||||
|
AS_VAR_IF([PHP_SNMP], [yes],
|
||||||
|
[AC_PATH_PROG([SNMP_CONFIG], [net-snmp-config],, [/usr/local/bin:$PATH])],
|
||||||
|
[SNMP_CONFIG="$PHP_SNMP/bin/net-snmp-config"])
|
||||||
|
|
||||||
|
AS_IF([test ! -x "$SNMP_CONFIG"],
|
||||||
|
[AC_MSG_ERROR(m4_text_wrap([
|
||||||
|
Could not find net-snmp-config binary. Please check your net-snmp
|
||||||
|
installation.
|
||||||
|
]))])
|
||||||
|
|
||||||
|
snmp_version=$($SNMP_CONFIG --version)
|
||||||
|
AS_VERSION_COMPARE([$snmp_version], [5.3],
|
||||||
|
[AC_MSG_ERROR(m4_text_wrap([
|
||||||
|
Net-SNMP version 5.3 or greater required (detected $snmp_version).
|
||||||
|
]))])
|
||||||
|
|
||||||
|
SNMP_PREFIX=$($SNMP_CONFIG --prefix)
|
||||||
|
SNMP_CFLAGS="-I${SNMP_PREFIX}/include"
|
||||||
|
SNMP_LIBS=$($SNMP_CONFIG --netsnmp-libs)
|
||||||
|
SNMP_LIBS="$SNMP_LIBS $($SNMP_CONFIG --external-libs)"
|
||||||
|
|
||||||
|
AS_IF([test -z "$SNMP_LIBS" || test -z "$SNMP_PREFIX"],
|
||||||
|
[AC_MSG_ERROR(m4_text_wrap([
|
||||||
|
Could not find the required paths. Please check your net-snmp
|
||||||
|
installation.
|
||||||
|
]))])
|
||||||
|
])
|
||||||
|
|
||||||
|
PHP_EVAL_INCLINE([$SNMP_CFLAGS])
|
||||||
|
PHP_EVAL_LIBLINE([$SNMP_LIBS], [SNMP_SHARED_LIBADD])
|
||||||
|
SNMP_LIBNAME=netsnmp
|
||||||
|
|
||||||
|
dnl Test build.
|
||||||
|
PHP_CHECK_LIBRARY([$SNMP_LIBNAME], [init_snmp],
|
||||||
|
[AC_DEFINE([HAVE_SNMP], [1],
|
||||||
|
[Define to 1 if the PHP extension 'snmp' is available.])],
|
||||||
|
[AC_MSG_FAILURE([SNMP sanity check failed.])],
|
||||||
|
[$SNMP_SHARED_LIBADD])
|
||||||
|
|
||||||
|
dnl Check whether shutdown_snmp_logging() exists.
|
||||||
|
PHP_CHECK_LIBRARY([$SNMP_LIBNAME], [shutdown_snmp_logging],
|
||||||
|
[AC_DEFINE([HAVE_SHUTDOWN_SNMP_LOGGING], [1],
|
||||||
|
[Define to 1 if SNMP library has the 'shutdown_snmp_logging' function.])],
|
||||||
|
[],
|
||||||
|
[$SNMP_SHARED_LIBADD])
|
||||||
|
|
||||||
|
CFLAGS_SAVE=$CFLAGS
|
||||||
|
LIBS_SAVE=$LIBS
|
||||||
|
CFLAGS="$CFLAGS $SNMP_CFLAGS"
|
||||||
|
LIBS="$LIBS $SNMP_LIBS"
|
||||||
|
|
||||||
|
AC_CHECK_DECL([usmHMAC192SHA256AuthProtocol],
|
||||||
|
[AC_DEFINE([HAVE_SNMP_SHA256], [1],
|
||||||
|
[Define to 1 if SNMP library has the 'usmHMAC192SHA256AuthProtocol'
|
||||||
|
array.])],
|
||||||
|
[],
|
||||||
|
[
|
||||||
|
#include <net-snmp/net-snmp-config.h>
|
||||||
|
#include <net-snmp/net-snmp-includes.h>
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_CHECK_DECL([usmHMAC384SHA512AuthProtocol],
|
||||||
|
[AC_DEFINE([HAVE_SNMP_SHA512], [1],
|
||||||
|
[Define to 1 if SNMP library has the 'usmHMAC384SHA512AuthProtocol'
|
||||||
|
array.])],
|
||||||
|
[],
|
||||||
|
[
|
||||||
|
#include <net-snmp/net-snmp-config.h>
|
||||||
|
#include <net-snmp/net-snmp-includes.h>
|
||||||
|
])
|
||||||
|
|
||||||
|
CFLAGS=$CFLAGS_SAVE
|
||||||
|
LIBS=$LIBS_SAVE
|
||||||
|
|
||||||
|
PHP_NEW_EXTENSION([snmp], [snmp.c], [$ext_shared])
|
||||||
|
PHP_ADD_EXTENSION_DEP(snmp, spl)
|
||||||
|
PHP_SUBST([SNMP_SHARED_LIBADD])
|
||||||
|
fi
|
||||||
@@ -23,15 +23,15 @@ $test_php_version = [
|
|||||||
|
|
||||||
// test os (macos-15-intel, macos-15, ubuntu-latest, windows-latest are available)
|
// test os (macos-15-intel, macos-15, ubuntu-latest, windows-latest are available)
|
||||||
$test_os = [
|
$test_os = [
|
||||||
// 'macos-15-intel', // bin/spc for x86_64
|
'macos-15-intel', // bin/spc for x86_64
|
||||||
// 'macos-15', // bin/spc for arm64
|
'macos-15', // bin/spc for arm64
|
||||||
// 'ubuntu-latest', // bin/spc-alpine-docker for x86_64
|
'ubuntu-latest', // bin/spc-alpine-docker for x86_64
|
||||||
// 'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
|
'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
|
||||||
// 'ubuntu-24.04', // bin/spc for x86_64
|
'ubuntu-24.04', // bin/spc for x86_64
|
||||||
// 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
|
'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
|
||||||
// 'ubuntu-24.04-arm', // bin/spc for arm64
|
'ubuntu-24.04-arm', // bin/spc for arm64
|
||||||
// 'windows-2022', // .\bin\spc.ps1
|
// 'windows-2022', // .\bin\spc.ps1
|
||||||
'windows-2025',
|
// 'windows-2025',
|
||||||
];
|
];
|
||||||
|
|
||||||
// whether enable thread safe
|
// whether enable thread safe
|
||||||
@@ -50,7 +50,7 @@ $prefer_pre_built = false;
|
|||||||
|
|
||||||
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
||||||
$extensions = match (PHP_OS_FAMILY) {
|
$extensions = match (PHP_OS_FAMILY) {
|
||||||
'Linux', 'Darwin' => 'pdo_pgsql',
|
'Linux', 'Darwin' => 'trader',
|
||||||
'Windows' => 'bcmath,bz2,calendar,ctype,curl,dba,dom,exif,ffi,fileinfo,filter,ftp,iconv,libxml,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pdo,pdo_mysql,pdo_sqlite,pdo_sqlsrv,phar,session,shmop,simdjson,simplexml,soap,sockets,sqlite3,sqlsrv,ssh2,sysvshm,tokenizer,xml,xmlreader,xmlwriter,yaml,zip,zlib',
|
'Windows' => 'bcmath,bz2,calendar,ctype,curl,dba,dom,exif,ffi,fileinfo,filter,ftp,iconv,libxml,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pdo,pdo_mysql,pdo_sqlite,pdo_sqlsrv,phar,session,shmop,simdjson,simplexml,soap,sockets,sqlite3,sqlsrv,ssh2,sysvshm,tokenizer,xml,xmlreader,xmlwriter,yaml,zip,zlib',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user