Skip to content
argasek edited this page Jun 11, 2012 · 10 revisions

BLIPoteka – blipowa biblioteka

What's that fuss all about?

Blipoteka is an open source, web project of simple social book exchange/lending system. It empowers Blipoteka.pl site -- little community of people who know each other from Blip.pl (Polish Twitter counterpart) website.

Who's behind all of this?

Blipoteka wizards are:

  • Argasek (application code & design)
  • Luca (copywriting)

Requirements

To run or develop project you will need a following environment set up and running:

  • LAMP/MAMP stack with PHP 5.3.x, Zend Framework 1.10.5+ (tested with Zend Server CE 1.0.3; it may work on Windows, but we give no guarantee) and mod_rewrite
  • MySQL 5.1+ or PostgreSQL 8.4+
  • PEAR 1.9.1 or newer with following packages installed:
    • Doctrine 1.2.3+ (not Doctrine 2.x!)
    • WideImage 10.07.31+
    • Console_CommandLine
    • Console_ProgressBar
    • Console_Table
    • (optional) PHPUnit 3.5.0+, if you want run tests
    • (optional) PHP_UML 1.5.3+, if you want to generate documentation
    • (optional) phpQuery 0.9.5+, if you want to use import capabilities

Running the project

  1. Create a database and a user with rights to create/drop that database on your MySQL/PostgreSQL database server.
  2. When in project directory, create the file:
  touch application/configs/custom.ini
  1. Put database configuration in it. Example:
[production]

; Default database connection
db.default.adapter = "mysql"
;db.default.adapter = "pgsql"
db.default.host = "localhost"
db.default.username = "your_username"
db.default.password = "your_password"
db.default.dbname = "your_dbname"

[testing : production]

[development : production]

[cli : development]
  1. Load fixtures
  ./scripts/doctrine-cli.php load-data
  1. Import Polish cities into database
  ./scripts/import-geonames.php --verbose --path=../application/models/fixtures/geonames/ PL

...to be continued... ;-)

Testing the project

To run functional/unit tests, you will need to install the PHPUnit testing framework. Then edit yours custom.ini file and add/modify this section:

[testing : production]
db.default.dbname = "your_test_dbname"

where your_test_dbname is the name of additional database used during unit and functional tests. Warning: this database and it's contents will be trashed during tests, so choose it carefully. You may also provide any additional setup (different username & password, etc.) here. When done, run:

  ./scripts/run-testsuite.sh

If everything went smooth, you should get output similar to one below: argasek@lorelai:~/Sites/blipoteka$ ./scripts/run-testsuite.sh Environment: testing, DSN: 'pgsql:host=localhost;dbname=blipoteka_test' build-all-reload - Are you sure you wish to drop your databases? (y/n) y build-all-reload - Successfully dropped database for connection named 'default' build-all-reload - Successfully created database for connection named 'default' build-all-reload - Created tables successfully build-all-reload - Data was successfully loaded PHPUnit 3.5.0 by Sebastian Bergmann.

....

Time: 1 second, Memory: 10.00Mb

OK (4 tests, 4 assertions)