germania-kg / users-retailers
1.0.8
2022-03-30 10:24 UTC
Requires
- php: ^7.0
- psr/log: ^1.0
Requires (Dev)
- monolog/monolog: ^1.16
- php-coveralls/php-coveralls: ^2.0
- phpunit/dbunit: ^2.0|^3.0|^4.0
- phpunit/phpunit: ^5.7|^6.0
README
Installation with Composer
$ composer require germania-kg/users-retailers
MySQL users may install the table users_retailers using users_retailers.sql.txt
in sql/
directory.
Find a retailer number
<?php use Germania\UsersRetailers\RetailerNumberFinder; // These are pptional $table = 'users_retailers'; $logger = new Monolog; $finder = new RetailerNumberFinder( $pdo); $finder = new RetailerNumberFinder( $pdo, $logger, $table); $user_id = 1; $retailer_number = $finder( $user_id );
Development
$ git clone https://github.com/GermaniaKG/UsersRetailers.git
$ cd UsersRetailers
$ composer install
Develop using develop
branch, using Git Flow.
Unit tests
Either copy phpunit.xml.dist
to phpunit.xml
and adapt to your needs, or leave as is. Run PhpUnit test or composer scripts like this:
$ composer test # or $ vendor/bin/phpunit
MySQL Setup
Setup a MySQL table users\_retailers
as in sql/users_retailers.sql.txt
.
In phpunit.xml
, edit the database credentials:
<php> <var name="DB_DSN" value="mysql:host=127.0.0.1;dbname=DBNAME;charset=utf8" /> <var name="DB_USER" value="DBUSER" /> <var name="DB_PASSWD" value="DBPASS" /> <var name="DB_DBNAME" value="DBNAME" /> <var name="DB_SETUP" value="sql/users_retailers.sql.txt" /> </php>