Download the PHP package timeshow/ucenter without Composer

On this page you can find all versions of the php package timeshow/ucenter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ucenter

Ucenter Client For The Laravel

说明

本项目在参考了多个相关类似项目的基础上修改调整。 官方UCenter 1.6.0 版本不存在手机号码、用户标识等字段, 使用官方安装包请获取V0.5.6版本, 使用composer require timeshow/ucenter "0.5.6"安装扩展包 从V0.6.0版本开始新增手机号、用户标识、父类ID等字段,需在数据表members中添加mobile,UnionID,parent_id相关字段

安装

只要在你的 composer.json 文件require中加入下面内容,就能获得最新版.

"timeshow/ucenter": "dev-master"

然后需要运行 "composer update" 来更新你的项目

或运行

composer require timeshow/ucenter

安装完后,在 config/app.php 文件中找到 providers 键,

'providers' => [

    TimeShow\UCenter\UCenterServiceProvider::class

]

找到 aliases 键,

'aliases' => [

    'UCenter' => TimeShow\UCenter\UCenterServiceProvider::class

]

配置

运行以下命令发布配置文件

php artisan vendor:publish  --provider="TimeShow\UCenter\UCenterServiceProvider"

ucenter配置项

//config.php
'url'       => '', // 网站UCenter接收数据的Api地址前缀,一般默认留空。
'connect'   => 'mysql', // 连接 UCenter 的方式: mysql/NULL, 默认为空时为 fscoketopen()
'dbhost'    => 'localhost', // UCenter 数据库主机
'dbuser'    => 'root', // UCenter 数据库用户名
'dbpw'      => 'root', // UCenter 数据库密码
'dbname'    => 'ucenter', // UCenter 数据库名称
'dbcharset' => 'utf8',// UCenter 数据库字符集
'dbtablepre'=> '`uc`.uc_', // UCenter 数据库表前缀
'key'       => '666cLXgFsrl6TcvDflhrvdcziY8SnhP1eexl1eQ', // 与 UCenter 的通信密钥, 要与 UCenter 保持一致
'charset'   => 'utf-8', // UCenter 的字符集

'api'       => 'http://localhost/ucenter', // UCenter 的 URL 地址, 在调用头像时依赖此常量
'ip'        => '127.0.0.1', // UCenter 的 IP, 当 UC_CONNECT 为非 mysql 方式时, 并且当前应用服务器解析域名有问题时, 请设置此值
'appid'     => 1, //当前应用的 ID
'ppp'       => 20, //当前应用的 ID

'apifilename'    => env('UC_APIFILENAME', 'uc'),   //这里是uc_server调用你的程序的接口,配置成uc的话,将会和前面的UC_URL配置一起形成这样的地址 url/api/uc
'service'        => env('UC_SERVICE', 'TimeShow\UCenter\Services\Api'),   //这里如果要异步登陆,可以直接继承这个类实现其中的方法,也可以创建app/Service/UCenter.php(文件放哪里都可以,这里只是推荐) 实现该类实现的接口【*】

环境变量

.env 环境变量中配置:

UC_CONNECT=mysql
UC_DBHOST=localhost
UC_DBUSER=root
UC_DBPW=root
UC_DBNAME=ucenter
UC_DBTABLEPRE=`ucenter`.uc_
UC_KEY=123456789
UC_API=http://localhost/uc_server
UC_IP=127.0.0.1
UC_APPID=1

UC_APIFILENAME=uc

把配置项添加到 .env 文件底部

路由

routes/web.php中写入:

use TimeShow\UCenter\Facades\UCenter;
UCenter::routes();

这个会添加一个api地址,用于同步登陆和退出

使用

例如:获取用户名为test的信息

$result = UCenter::uc_get_user('test');
var_dump($result);

更多函数请参考 Ucenter 文档Github 参考文档

帮助

1、ucenter 在PHP 7以上版本出现错误

修正不兼容php7+,mysql_connect()不可用等问题
使用 mysqli_connect 方式连接

2、UCenter 后台应用管理列表通信失败问题

一、查看以上配置是否正确
二、在 routes/web.php 中修改
//$result = UCenter::uc_get_user('test');
//var_dump($result);

联系我

有问题,请提交issue


All versions of ucenter with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package timeshow/ucenter contains the following files

Loading the files please wait ....