Download the PHP package goutte/wordpress-bundle without Composer
On this page you can find all versions of the php package goutte/wordpress-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package wordpress-bundle
What is it ?
This is a bridge between WordPress and Symfony2.
This bundle will allow you to :
- find published posts/pages
- all of them
- by slug
- find attachments by mime-type, specifically images
That's all !
Inspired (a lot!) by :
- https://github.com/kayue/WordpressBundle
- and its active fork https://github.com/101medialab/WordpressBundle
- https://github.com/PolishSymfonyCommunity/PSSBlogBundle
I re-did the bundle from scratch because I wanted working and clean tests at all times. Plus, it's a learner's project.
You should not use this bundle, as using both WordPress AND Symfony2 is a bad practice, but until the CMF is media-ready this is a good enough alternative in some fast-food cases.
How to use
- Create your wordpress as usual
- Add this bundle to your composer.json
- Register this bundle in your AppKernel.php
-
Configure in app/config.yml
- Configure your parameters.yml to point towards the wordpress database
Usage examples
You'll need the Entity Manager
Posts
Will only fetch posts, not pages nor attachments. (see below on how to get those)
Pages
Images
Attachments
How to setup tests
- Copy phpunit.xml.dist to phpunit.xml
- Configure KERNEL_DIR
- Register this bundle in your AppKernel.php
-
Update your composer.json, as we are using Doctrine Mocks. This is not optimized, how can I restrict this to the test env ?
- /!\ Make sure you have another database setup for your tests, because the suite will ruin the database !
- Run !
Requirements
- WordPress >=3.4.2 and <=3.5
Caveats
- WordPress assumes it will be run in the global scope, so some of its code doesn't even bother explicitly globalising variables. The required version of WordPress core marginally improves this situation (enough to allow us to integrate with it), but beware that other parts of WordPress or plugins may still have related issues.
All versions of wordpress-bundle with dependencies
doctrine/data-fixtures Version dev-master
stof/doctrine-extensions-bundle Version dev-master