Giter Site home page Giter Site logo

Comments (5)

crazywhalecc avatar crazywhalecc commented on May 18, 2024

zend可能很难支持了,目前只支持标准的pecl扩展。

from static-php-cli.

TNT-ma avatar TNT-ma commented on May 18, 2024

zend可能很难支持了,目前只支持标准的pecl扩展。

pecl 现在是支持了的吗?pecl似乎也行,如果用C++ 编写一个加密代码扩展,有源代码的情况下,是不是能将这个自定义扩展的文件编译内置在 sfx 里面

from static-php-cli.

crazywhalecc avatar crazywhalecc commented on May 18, 2024

如果用C++ 编写一个加密代码扩展,有源代码的情况下,是不是能将这个自定义扩展的文件编译内置在 sfx 里面

是,也不是。首先编写扩展需要注意的第一点就是扩展如果依赖了别的库,那个被依赖的库也必须能以静态模式编译;其次编写扩展也必须插入 in-tree 构建的几行代码(我不知道这个怎么叫,就印象中 dixyes 大佬是这么叫的,反正就是能让扩展放到 php 源码中一起编译进去)。

pecl 现在是支持了的吗

pecl 扩展都是提供源码的,而且大部分似乎并不需要依赖外部的扩展,所以理论上只要类似 redis、mongodb 这类 pecl 扩展,都是可以直接编译的。少部分没有编写 in-tree 构建的头文件,例如 event,最后也是通过给上游开发者提 PR 来解决。所以最大的问题还是在于扩展本身依赖的其他库问题,而不是扩展本身的问题。

from static-php-cli.

dixyes avatar dixyes commented on May 18, 2024

https://github.com/dixyes/phpmicro/blob/master/patches/static_opcache_83.patch

但这个有点邪恶 只支持了opcache, 什么xdebug就甭想用了

(你可以参考这个patch把你的zend扩展改一改编译进去,如果是别人的.so/dll就别想了,触发你够闲自己写ELF/PE loader

(但你都能在改PHP源码了,还纠结什么扩展,加密直接做到PHP解释器里不好吗

from static-php-cli.

TNT-ma avatar TNT-ma commented on May 18, 2024

https://github.com/dixyes/phpmicro/blob/master/patches/static_opcache_83.patch

但这个有点邪恶 只支持了opcache, 什么xdebug就甭想用了

(你可以参考这个patch把你的zend扩展改一改编译进去,如果是别人的.so/dll就别想了,触发你够闲自己写ELF/PE loader

(但你都能在改PHP源码了,还纠结什么扩展,加密直接做到PHP解释器里不好吗

你发的这个是啥意思? 我还没看懂

from static-php-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.