Python PHP HTML C CSS Perl Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin [Vagrant] Use correct user when creating database. Oct 10, 2017
classes Make displayResult public, so debugging can call. Jul 9, 2018
commonlib @ 54e92d6 Changes to make tests pass on PHP 7 on Travis. Nov 1, 2017
conf Ignore dot in URL, so e.g. index.php not matched. Jun 21, 2018
db add fb_id to users table Oct 23, 2017
flex Update build script with new URL for SDK Jan 13, 2014
foundation @ a2a3901 Switch to using Foundation v4.2.3 via a submodule Jun 30, 2014
googleappengine copy change/ change newsletter/mailing list/URL Dec 17, 2014
scripts Move URL to autoloading class Dec 4, 2017
search Added support for setting XAPIAN_MAX_CHANGESETS Mar 6, 2017
tests Remove emailpublic field. Jul 5, 2018
uml-tests Remove most of uml-tests directory. May 31, 2013
www Revert "Banner for National Democracy Week" Jul 10, 2018
.gitignore Automatically generate documentation using PHPDoc Oct 27, 2015
.gitmodules Swap Facebook SDK to use Composer Nov 24, 2017
.scrutinizer.yml Increase code coverage timeout. May 21, 2015
.travis.yml Changes to make tests pass on PHP 7 on Travis. Nov 1, 2017
CONTRIBUTING.md Add contributing document. Jul 13, 2015
Gemfile Use bundle to install/run compass instead of gem. Mar 13, 2015
Gemfile.lock Use bundle to install/run compass instead of gem. Mar 13, 2015
INSTALL.md Move all absolute HTTP links to HTTPS. Sep 23, 2016
LICENSE.md Fix incorrect name in LICENCE.md Mar 3, 2014
README.md Update House Rules and Readme. Feb 1, 2018
Vagrantfile Restart Apache when booting Vagrant VM Jul 13, 2018
build-docs.sh Automatically generate documentation using PHPDoc Oct 27, 2015
composer.json Swap Facebook SDK to use Composer Nov 24, 2017
composer.lock Swap Facebook SDK to use Composer Nov 24, 2017
composer.phar Update to newest Composer binary Nov 24, 2017
phpdoc.dist.xml Automatically generate documentation using PHPDoc Oct 27, 2015
phpunit.xml Remove the suppression of errors causing PHPUnit hard failures. Oct 4, 2014

README.md

Hello everyone,

This is the source code that powers the TheyWorkForYou.com website. It's mainly written in PHP, although there are also some Perl scripts for database loading and indexing. The backend parser code is separate and available on GitHub. You can read more about this on TheyWorkForYou's parser info page

The TheyWorkForYou source code in this distribution is released under a BSD style license. Roughly, this means you are free to copy, use, modify and redistribute the code or binaries made from the code. Commercial or non- commercial use is allowed. However, we disclaim warranty, and expect you not to use our name without our permission. See the file LICENSE.md for exact legal information.

What is TheyWorkForYou anyway?

Everything MPs say in the UK's House of Commons is recorded in a document called Hansard; TheyWorkForYou helps make sense of this vital democratic resource. It also includes things from the House of Lords, the Scottish Parliament, and the Northern Ireland Assembly.

How on earth do I use this code?

See INSTALL.md for installation questions.

If you have questions, the best place to ask is the mySociety TheyWorkForYou email list at https://groups.google.com/a/mysociety.org/forum/#!forum/theyworkforyou

Developing with Vagrant

You will need the latest versions of VirtualBox and Vagrant, then:

  • Run vagrant up.
  • Go make a cup of tea. It may take a while whilst Vagrant and Puppet do their thing.
  • Point your web browser at http://10.11.12.13 and marvel at modern technology.

Compiling Static Assets

If you're working on a page which uses the redesign, you will need to compile static assets after changes:

  • vagrant ssh
  • cd /vagrant/theyworkforyou/www/docs/style
  • compass compile for a one-off compilation or compass watch to recompile on changes

Testing

TheyWorkForYou includes a test suite, using PHPunit. To run tests, ensure that the environment variables TWFY_TEST_DB_HOST, TWFY_TEST_DB_NAME, TWFY_TEST_DB_USER and TWFY_TEST_DB_PASS are set and contain relevant information for your testing database. The database will be stripped down and rebuilt during testing, so make sure it's not an important copy.

You may find that in some versions of PHPUnit errors are thrown regarding code coverage reports. If this is the case, the version installed by Composer and located at /vendor/bin/phpunit should run correctly.

Build Status

Build Status

Code Coverage

Scrutinizer Quality Score

mySociety Installability

Acknowledgements

Thanks to Browserstack who let us use their web-based cross-browser testing tools for this project.