2023-03-28 20:52:49 +00:00
|
|
|
[![Build Status](https://ci.skobk.in/api/badges/skobkin/point-tools/status.svg)](https://ci.skobk.in/skobkin/point-tools)
|
2016-12-11 21:59:16 +00:00
|
|
|
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/b/skobkin/point-tools/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/b/skobkin/point-tools/?branch=master)
|
2017-01-11 02:22:34 +00:00
|
|
|
[![License](https://poser.pugx.org/skobkin/point-tools/license)](https://packagist.org/packages/skobkin/point-tools)
|
2016-12-11 02:41:30 +00:00
|
|
|
|
2015-06-02 04:03:58 +00:00
|
|
|
# Point Tools
|
|
|
|
|
2016-12-11 21:59:16 +00:00
|
|
|
Point Tools is a service which provides additional features for [Point.im](https://point.im/) microblog users.
|
2015-06-02 04:03:58 +00:00
|
|
|
|
2016-12-11 21:59:16 +00:00
|
|
|
# Installation
|
2015-06-02 04:03:58 +00:00
|
|
|
|
2016-12-11 21:59:16 +00:00
|
|
|
Application setup is quite simple:
|
2015-06-02 04:03:58 +00:00
|
|
|
|
2016-12-11 21:59:16 +00:00
|
|
|
## Getting the source code
|
2015-06-02 04:03:58 +00:00
|
|
|
|
2017-01-09 00:55:13 +00:00
|
|
|
### Via Git
|
|
|
|
```bash
|
2015-06-02 04:03:58 +00:00
|
|
|
git clone https://skobkin@bitbucket.org/skobkin/point-tools.git
|
|
|
|
cd point-tools
|
|
|
|
```
|
|
|
|
|
2017-01-09 00:55:13 +00:00
|
|
|
### Via Composer
|
|
|
|
```bash
|
|
|
|
composer create-project skobkin/point-tools -s dev
|
|
|
|
cd point-tools
|
|
|
|
```
|
|
|
|
|
2016-12-11 21:59:16 +00:00
|
|
|
## Setting file access privileges
|
|
|
|
Set up appropriate write privileges for `app/cache` and `app/logs`.
|
2015-06-02 04:03:58 +00:00
|
|
|
|
2017-01-09 00:55:13 +00:00
|
|
|
## Installing dependencies (not needed after installation via Composer)
|
2015-06-02 04:03:58 +00:00
|
|
|
|
2017-01-09 00:55:13 +00:00
|
|
|
```bash
|
|
|
|
# In developer environment:
|
2015-06-02 04:03:58 +00:00
|
|
|
composer install
|
2017-01-09 00:55:13 +00:00
|
|
|
# In production environment
|
2015-06-02 04:03:58 +00:00
|
|
|
composer install --no-dev --optimize-autoloader
|
|
|
|
```
|
|
|
|
|
2016-12-11 21:59:16 +00:00
|
|
|
After dependencies installation you will be asked for database credentials of PostgreSQL database and some other application parameters.
|
2015-06-02 04:03:58 +00:00
|
|
|
|
2016-12-11 21:59:16 +00:00
|
|
|
## Database initialization
|
2015-06-02 04:03:58 +00:00
|
|
|
|
2017-01-09 00:55:13 +00:00
|
|
|
```bash
|
2015-06-02 04:03:58 +00:00
|
|
|
php app/console doctrine:migrations:migrate
|
|
|
|
```
|
|
|
|
|
2016-12-11 21:59:16 +00:00
|
|
|
## Web assets installation
|
2015-06-02 04:03:58 +00:00
|
|
|
|
2017-01-09 00:55:13 +00:00
|
|
|
```bash
|
2015-06-02 04:03:58 +00:00
|
|
|
php app/console assets:install web --symlink
|
|
|
|
```
|
|
|
|
|
2016-12-11 21:59:16 +00:00
|
|
|
## Adding CRON jobs
|
2015-06-02 04:03:58 +00:00
|
|
|
|
2017-01-09 00:55:13 +00:00
|
|
|
```bash
|
2015-06-02 04:03:58 +00:00
|
|
|
crontab -e
|
|
|
|
```
|
|
|
|
|
2016-12-11 21:59:16 +00:00
|
|
|
You can use following jobs as an example:
|
2015-06-02 04:03:58 +00:00
|
|
|
|
|
|
|
```crontab
|
|
|
|
# point.skobk.in
|
|
|
|
*/10 * * * * /usr/bin/php /path/to/point-tools/app/console point:update:subscriptions --env=prod
|
2016-12-11 03:44:33 +00:00
|
|
|
0 0 * * * /usr/bin/php /path/to/point-tools/app/console point:update:subscriptions --all-users --env=prod
|
2015-06-02 04:03:58 +00:00
|
|
|
```
|
|
|
|
|
2017-01-18 01:34:24 +00:00
|
|
|
See [`app/crontab`](https://bitbucket.org/skobkin/point-tools/src/master/app/crontab) for more advanced usage.
|
|
|
|
|
2017-01-04 22:40:26 +00:00
|
|
|
## Setting Telegram webhook (to enable bot)
|
|
|
|
|
2017-01-09 00:55:13 +00:00
|
|
|
```bash
|
2017-01-15 03:29:30 +00:00
|
|
|
php app/console telegram:webhook set
|
2017-01-04 22:40:26 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Removing Telegram webhook
|
|
|
|
|
2017-01-09 00:55:13 +00:00
|
|
|
```bash
|
2017-01-04 22:40:26 +00:00
|
|
|
php app/console telegram:webhook delete
|
|
|
|
```
|
|
|
|
|
2016-12-11 21:59:16 +00:00
|
|
|
# Running tests
|
|
|
|
|
|
|
|
## Configure environment variables
|
|
|
|
|
2017-01-09 00:55:13 +00:00
|
|
|
```bash
|
2016-12-11 21:59:16 +00:00
|
|
|
export SYMFONY__TEST_DATABASE_USER=some_database_user
|
|
|
|
export SYMFONY__TEST_DATABASE_PASSWORD=some_database_password
|
|
|
|
export SYMFONY__TEST_DATABASE_NAME=some_database_name
|
|
|
|
export SYMFONY__TEST_DATABASE_PORT=postgresql_port
|
2017-01-15 03:29:30 +00:00
|
|
|
export SYMFONY_ENV=test
|
2016-12-11 21:59:16 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Load fixtures (if needed)
|
|
|
|
|
2017-01-09 00:55:13 +00:00
|
|
|
```bash
|
2016-12-11 21:59:16 +00:00
|
|
|
php app/console doctrine:fixtures:load --no-interaction
|
|
|
|
```
|
|
|
|
|
|
|
|
## Run tests
|
|
|
|
|
2017-01-09 00:55:13 +00:00
|
|
|
```bash
|
2016-12-11 21:59:16 +00:00
|
|
|
phpunit -c app/
|
|
|
|
```
|