Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ You can also lock it in to a specific commit or tag:
}
```

If you are running the libraries in a non-WordPress environment, e.g. a PHPUnit test suite that
tests your code without loading WordPress, you'll need to polyfill the WordPress APIs used by
the php-toolkit libraries:

```php
require_once __DIR__ . '/vendor/autoload.php';
polyfill_wordpress_apis();
```

For now, there is no way to cherry-pick just the one library you need. It's all or nothing.

Note that the composer.json example above downloads more files than the required minimum, e.g. markdowns, unit tests, the `plugins` directory, etc. That's about 50MB of code in total and, most likely, it's not a big deal for your project. If you want a smaller package, the Data Liberation plugin referenced above ships a minified phar file that's about ~500KB compressed.
Expand Down
2 changes: 2 additions & 0 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
*/

require_once __DIR__ . '/vendor/autoload.php';

polyfill_wordpress_apis();
Loading
Loading