Download the PHP package yangliuxin/utils without Composer

On this page you can find all versions of the php package yangliuxin/utils. 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 utils

utils

WeChat Callback Controller

public function paymentNotify()
{
    $request = $this->request->all();
    $app = new Application(config('wechat.payment'));
    try {
        $server = $app->getServer();
        $message = $server->getRequestMessage($request);
        $out_trade_no = $message['out_trade_no']; // 商户订单号
        $order = Orders::getOrderInfoByOutTradeNo($out_trade_no);
        if (empty($order)) {
            return true;
        }
        if ($message['trade_state'] === 'SUCCESS') { // return_code 表示通信状态,不代表支付状态
            //加入自己支付完成后该做的事
            Orders::setOrderStatus($order['id'], Orders::STATUS_PAYED);
            Orders::where('id',$order['id'])->update(['pay_at'=> date("Y-m-d H:i:s")]);
            //给卖主发通知发货
            foreach ($order['goods'] as $key => $val){
                //作品状态置为已售
                Product::where('id',$val['good_id'])->update(['status' => Product::STATUS_SOLD, 'is_recommend' => 0, 'is_discount' => 0]);
            }

        }
        return true;
    } catch (InvalidArgumentException|\ReflectionException|\Throwable $e) {
        return false;
    }
}

public function paymentRefundNotify()
{
    $request = $this->request->all();
    Log::get()->info('WECHAT_REFUND_NOTIFY_DATA_REQUEST', $request);
    $app = new Application(config('wechat.payment'));
    try {
        $server = $app->getServer();
        $message = $server->getRequestMessage($request);
        $out_refund_no = $message['out_refund_no']; // 商户订单号
        $order = Orders::getOrderInfoByOutRefundNo($out_refund_no);
        if (empty($order)) {
            return true;
        }
        if ($message['refund_status'] === 'SUCCESS') { // return_code 表示通信状态,不代表支付状态
            //加入自己支付完成后该做的事
            Orders::setOrderStatus($order['id'], Orders::STATUS_CANCEL);
            Orders::where('id',$order['id'])->update(['refund_at' =>  date("Y-m-d H:i:s")]);
            $this->queueService->push(['type' => 'Notification',  'class' => 'OrderRefundNotification', 'from' => 0, 'to' => $order['uid'], 'data' => [$order['order_id']]]);
            //给卖主发通知发货
            foreach ($order['goods'] as $key => $val){
                //作品状态置为已售
                Product::where('id',$val['good_id'])->update(['status' => Product::STATUS_DEFAULT, 'is_recommend' => 1, 'is_discount' => 1]);
            }

        }
        return true;
    } catch (InvalidArgumentException|\ReflectionException|\Throwable $e) {
        Log::get()->info('PAY_REFUND_NOTIFY_DATA_EXCEPTION',[ $e->getMessage()]);
        return false;
    }
}

Patch

### php文件代码

! defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__.'/../', 1));
spl_autoload_register(function ($cls) {
$map = [
    'Hyperf\HttpServer\CoreMiddleware' => BASE_PATH . '/patch/CoreMiddleware.php',
];

if (isset($map[$cls])) {
    include $map[$cls];
    return true;
}
return true;
}, true, true);

### composer.json

"autoload": {
    "files": [
        "patch/autoload.php"
    ]
},

All versions of utils with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
alibabacloud/smsintl Version ^1.8
guzzlehttp/guzzle Version ^7.8
lcobucci/jwt Version ^4.3
aliyuncs/oss-sdk-php Version ^2.7
w7corp/easywechat Version ^6.7
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 yangliuxin/utils contains the following files

Loading the files please wait ....