epicsweb / php-account
2.0.0
2021-11-24 17:15 UTC
Requires
- php: >=5.6
README
这个库准备数据并发送到API以管理账户
安装
使用composer安装此库
composer require epicsweb/php-account
配置
CodeIgniter
账户
在您的code igniter应用程序文件夹中创建或编辑文件,并设置这些变量: /application/config/config.php
<?php if( !defined('BASEPATH')) exit('No direct script access allowed'); $config['api_epics'] = array( 'server' => 'https://api.url.com', 'http_user' => 'Http_User', 'http_pass' => 'Http_Pass', );
跟踪器
在您的code igniter应用程序文件夹中创建文件并设置这些变量: /application/config/epicsweb.php
<?php if( !defined('BASEPATH')) exit('No direct script access allowed'); $config['tracker'] = [ 'server' => 'http://tracker.epics/', 'companies_tokens' => '3a532acb04cc795c97c518e327a278a9' ];
Laravel
在您的 .env 文件中设置
账户
AE_URL=YOUR_BASE_URL_API
AE_USER=YOUR_PWD_USERS
AE_PASS=YOUR_PWD_PASSWORD
跟踪器
AET_URL=YOUR_BASE_URL_API
AET_TOKENR=YOUR_COMPANIE_TOKEN
用法
CodeIgniter
更改文件 /application/config/config.php
$config['composer_autoload'] = FALSE; ↓ $config['composer_autoload'] = realpath(APPPATH . '../vendor/autoload.php');
账户
使用类似唯一参数的数组调用此库的 "account_create 或 account_login" 函数
$account = new PhpAccount( 'laravel' ); // 'laravel' framework params $account = new Epicsweb\PhpAccount( 'ci' ); // 'ci' framework params (default) $create = [ 'email' => 'user@account.com', 'password' => 'password_encrypted', //SEND PASSWORD (ENCRYPTED) OR IDFACEBOOK 'idFacebook' => '001122334455' // ** 'name' => 'User Name', ]; $account->account_create( $create ); $login = [ 'email' => 'user@account.com', 'password' => 'password_encrypted', //SEND PASSWORD(ENCRYPTED) OR IDFACEBOOK 'idFacebook' => '001122334455' // ** ]; $account->account_login( $login )
跟踪器
$tracker = new PhpAccount( 'laravel' ); // 'laravel' framework params $tracker = new Epicsweb\PhpTracker( 'ci' ); // 'ci' framework params (default) $insert = [ 'application_id' => 0, // int (11) req, your application internal id 'users_id' => 0, // int (11) req you account user id 'identifier_id' => 0, // int (11) opt, contract id, user id, your control 'resgiter_id' => 0, // int (11) opt, page id, item id, your control 'tag' => '', // string (25) opt, control your tags 'social_media_id' => 0, // int (04) opt, id for you control your social media actions 'companies_token' => '', // string(32) opt, can be used in config ]; $tracker->insert( $insert );
许可证
本项目采用MIT许可证 - 有关详细信息,请参阅 LICENSE.md 文件