An open API service indexing awesome lists of open source software.

https://github.com/ampproject/px-toolbox-php


https://github.com/ampproject/px-toolbox-php

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          


Page Experience Toolbox for PHP



Tooling to get the best possible page experience results out of your PHP-powered web properties.


Explore the docs »




Report Bug
·
Request Feature


Table of Contents



  1. About The Project


  2. Getting Started


  3. Usage

  4. Roadmap

  5. Contributing

  6. License

## About The Project

The Page Experience Toolbox for PHP regroups tooling and library code that enables you to maximize your page experience results for any PHP-powered web properties.

Currently included in the toolbox:

* [**Page Experience Engine** - Higher-level library that aggregates and normalizes multiple tools to provide analysis and optimization functionality.](/docs/pxe/README.md#readme)
* [**PageSpeed Insights API** - API wrapper for PHP to run audits through the Google PageSpeed Insights API.](/docs/psi/README.md#readme)
* [**PX CLI tool** - `px` binary to run the above tooling through the console.](/docs/px/README.md#readme)

```mermaid
%%{init: {'theme': 'neutral'}}%%
graph
subgraph PXT[PX Toolbox]

PSI[PageSpeed Insights API Client

API wrapper for PHP to run audits through
the Google PageSpeed Insights API]
PXE[Page Experience Engine

Higher-level library that aggregates and
normalizes multiple tools to provide
analysis and optimization functionality]
PX[PX CLI Tool

Console px binary to run the
PX Toolbox tools through the CLI]

PX --provides CLI interface for--> PSI
PX --provides CLI interface for--> PXE
PSI --powers audits in--> PXE
end

classDef package fill:#005af0,stroke:#002080,stroke-width:1px,color:#fff;
class PX,PXE,PSI package;

click PX "https://github.com/ampproject/px-toolbox-php/tree/main/docs/px/README.md#readme" "Documentation for the PX CLI Tool"
click PSI "https://github.com/ampproject/px-toolbox-php/tree/main/docs/psi/README.md#readme" "Documentation for the PageSpeed Insights API Client"
click PXE "https://github.com/ampproject/px-toolbox-php/tree/main/docs/pxe/README.md#readme" "Documentation for the Page Experience Engine"
```

(back to top)

## Getting Started

This is an example of how you may give instructions on setting up your project locally.
To get a local copy up and running follow these simple example steps.

### Prerequisites

The following requirements need to be fulfilled by your PHP installation to make use of the toolbox:

* PHP 5.6+
* Active PHP extensions:
* `curl`
* `json`
* `zip`
* Remote connectivity for API requests against the Google PageSpeed Insights API

### Installation

The toolbox can be pulled into your project via Composer:

```sh
composer require ampproject/px-toolbox
```

In case you're only interested in making use of the `px` binary without integrating the library code into an existing project, you can also install the toolbox as a global Composer package:

```sh
composer global require ampproject/px-toolbox
```

(back to top)

## Usage

Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.

_For more examples, please refer to the [Documentation](https://example.com)_

(back to top)

## Roadmap

The project is currently in its very early stages, with the main focus lying on making the main functionality work as expected.

The initial end-user integration this library is being coded against is the [PX Plugin for WordPress](https://github.com/ampproject/amp-wp).

```mermaid
%%{init: {'theme': 'neutral'}}%%
graph
subgraph pxwp[px-wp]
rest[REST API]
devtools[Developer Tools]

devtools -.-> rest
end

subgraph pxtb[px-toolbox-php]
pxe[PX Engine]
end

subgraph amptb[amp-toolbox-php]
sanitizer[Sanitizer]
validator[Validator]
optimizer[Optimizer]
linter[Linter]
spec[AMP Spec]

sanitizer -.-> spec
validator -.-> spec
optimizer -.-> spec
end

pxe -.-> sanitizer
pxe -.-> validator
pxe -.-> optimizer
pxe -.-> linter

rest -.-> pxe
devtools -.-> pxe

classDef cplugin fill:#33aa00,stroke:#002080,stroke-width:1px,color:#fff;
classDef cpx fill:#9955f0,stroke:#002080,stroke-width:1px,color:#fff;
classDef camp fill:#005af0,stroke:#002080,stroke-width:1px,color:#fff;
class rest,devtools cplugin;
class pxe,psi cpx;
class sanitizer,validator,optimizer,linter,spec camp;
```

The roadmap will be further fleshed out as we approach the first feature-complete release.

(back to top)

## Contributing

Please see [the CONTRIBUTING file](/CONTRIBUTING.md) for information on contributing to the Page Experience Toolbox for PHP.

(back to top)

## License

The PHP Page Experience Toolbox is licensed under the [Apache License, Version 2.0](/LICENSE).

(back to top)