项目作者: galvao

项目描述 :
Manipulate DOM HTML trees, powered by PHP's DOM extension.
高级语言: PHP
项目地址: git://github.com/galvao/gerdr.git
创建时间: 2019-09-30T08:56:44Z
项目社区:https://github.com/galvao/gerdr

开源协议:MIT License

下载


Gerdr

Gerdr Logo

Manipulate DOM HTML trees, powered by PHP’s DOM extension.

Install

  1. composer require galvao/gerdr

Usage

  • As an application
  1. /path/to/gerdr/bin/gerdr -c /path/to/config.json -d /path/to/dom.html

As an application Gerdr outputs the modified DOM HTML so it can be piped, forwarded, etc… to any bash application.

  • In your project:
  1. try {
  2. $gerdr = new Gerdr($dom, $config);
  3. } catch (\Exception $e) {
  4. // Treat the exception
  5. }
  6. try {
  7. $gerdr->process();
  8. } catch (\Exception $e) {
  9. // Treat the exception
  10. }
  11. $result = $gerdr->getModifiedDom();

Dependencies

Actions

As of now Gerdr only removes elements/attributes with the remove action.

Acknowledgements