?? ?????
?? ??? ?????? ThinkPHP ????? ? ?????? ???? ??? ????? ??? ?? ??? ?????? ???? ????? Smarty, Zend ? ?? ???? ??? ?????? ?? ?? ??? ?? ???? ?????.
??? ?? ?? ?? ???? ??? ???? ??? ??? ?????? ?? ThinkPHP ??? .class.php? ???? ???? ????. ??? ???? ?? ?? ???? ????? ?? ???? ???.
??? ? ?? ??? ?????? ?? ??? ??? ?? ??? ?? ???? php?? ??? ? ????. ?? ????? ? ???? ??? ?????? ?? ???? ?? ThinkPHP? ??? ?? ??? ?????? ???? ??? ?????. ?? ??? ?????? ThinkPHP ??? ????/Vendor ??? ???? ???? ???? ???? ???? ?????.
??? ??
??:
boolenvendor(class,baseUrl,ext)
???? ??:
???? ??
?????? ???? ??? ??? ?????? ???? ???? ?????.
baseUrl? ??????, ??? ?? ???? ThinkPHP ??? ????/Vendor ????? ?????.
ext? ?????? ??? ??? ????? ???? ?????. ???? .php???.
??? ???? ???? ?? ???? ?? ??? ??? ThinkPHP ??? ????/Vendor ??????, ?? ???? ??.php?? ????.
???? ?? ??:
ThinkPHP? ?? ?? ??? ????? ??? ?? ?? ?? ??? ThinkPHP ??? ?? ???? ?? ?? Library/Vendor ????? ?? ?? ??? ???? ???. ?? ?? ThinkPHP3????. .2.?, ??? ?? ?? ??? ?????.
?? ?? ????? ???? ?? ??? ???? ?? ?? Vendor() ???? ?? ???? ?? ??? ? ????.
?? ????? ???? ??:
??? ??? ??:
? ?? ??:
????('Phpqrcode.phpqrcode');
??? ??
??? ??
?/**
*QR?? ??
*@paramstring$urlurl ??
*@paraminteger$size ??? ?? ?????
?*/
functionqrcode($url,$size=4){
????('Phpqrcode.phpqrcode');
?if(strpos($url,'http')===false){
?$url='http://'.$url;
?}
QRcode::png($url,false,QR_ECLEVEL_L,$size,2,false,0xFFFFFF,0x000000);
?}
??? ??
??? ??
? ?? ??:
require'./ThinkPHP/Library/Org/Nx/class.phpmailer.php';
require'./ThinkPHP/Library/Org/Nx/class.smtp.php';
??? ??
??? ??
?/**
*??? ???
*@paramstring$address ?? ??? ?? ??? ??? ?? ???? ???? ???
*@paramstring$??
*@paramstring$content ???
?*@returnboolean? ??????
?*/
?functionsend_email($address,$subject,$content){
?$email_smtp=C('EMAIL_SMTP');
?$email_username=C('EMAIL_USERNAME');
?$email_password=C('EMAIL_PASSWORD');
?$email_from_name=C('EMAIL_FROM_NAME');
?if(?? ??($email_smtp)||?? ??($email_username)||?? ??($email_password)||?? ??($email_from_name)){
returnarray("error"=>1,"message"=>'??? ??? ???? ?????.');
?}
require'./ThinkPHP/Library/Org/Nx/class.phpmailer.php';
require'./ThinkPHP/Library/Org/Nx/class.smtp.php';
?$phpmailer=newPhpmailer();
//SMTP ??? ???? ???? ???? PHPMailer? ?????
?$phpmailer->IsSMTP();
//html ???? ??
?$phpmailer->IsHTML(true);
//???? ?? ??? ??'
?$phpmailer->CharSet='UTF-8';
//SMTP ??? ?????.
?$phpmailer->???=$email_smtp;
//"?? ??"? ??
?$phpmailer->SMTPAuth=true;
//??? ?? ??
?$phpmailer->??? ??=$email_username;
//???? ??
?$phpmailer->????=$email_password;
//??? ??? ?? ?? ??? ?????.
?$phpmailer->From=$email_username;
//??? ?? ??
?$phpmailer->FromName=$email_from_name;
//??? ??? ?????. ?? ???? ???? ? ?? ? ??? ? ????
?if(is_array($address)){
?foreach($addressas$addressv){
?$phpmailer->?? ??($addressv);
?}
?}???{
?$phpmailer->?? ??($address);
?}
//??? ?? ??
?$phpmailer->??=$subject;
//??? ?? ??
?$phpmailer->Body=$content;
//???? ??.
?if(!$phpmailer->Send()){
?$phpmailererror=$phpmailer->ErrorInfo;
returnarray("error"=>1,"message"=>$phpmailererror);
?}???{
returnarray("error"=>0);
?}
?}
??? ??
??? ??
? ?? ??:
Alipay ????? ???? ??
Vendor('Alipay.AlipaySubmit','','.class.php');
??: ????? ???? ?? ???? .php
???. ???? 1: ??, ?????? ???? ???? ??? ??? ?????? ?????
???? 2: ????, ????? ?? ??? ?????. ??? ?? ???? ThinkPHP ??? ????/Vendor ????? ?????.
???? 3: ????. ??? ??? ????? ???? ?????. ???? .php???.
Alipay ?3? ??? ??:
??? ??
??? ??
?/**
* ????? Alipay? ?????
*@paramarray$order ?? ????? out_trade_no(????), ??(????), ??(??? ??)? ????? ???
?*/
???ipay($order){
Vendor('Alipay.AlipaySubmit','','.class.php');
//?? ????
?$config=C('ALIPAY_CONFIG');
?$data=??(
"_input_charset"=>$config['input_charset'],//??? ??
"logistics_fee"=>"0.00",//???
"logistics_paid"=>"SELLER_PAY", //?? ?? ?? SELLER_PAY(???? ??? ??), BUYER_PAY(???? ??? ??)
"logistics_type"=>"EXPRESS",//?? ?? EXPRESS(??), POST(??), EMS(EMS)
"notify_url"=>$config['notify_url'], //?? ?? ??? ?????? ?? ? ?? ??
"out_trade_no"=>$order['out_trade_no'],//?? ??
"partner"=>$config['partner'],//???? ??? ?? ?????? ???? ????
"??_??"=>"1",//?? ??? ??? Payment_type ????? ???? ??? ?????. ?? 1
?? ????? "price"=>$order['price'],//?? ?? ??? ??
//"??"=>0.01,////???? ?? ?? ??
"??"=>"1",//?? ? ??? total_fee? ??? ? ????. ?, total_fee? ??? ??? ??? ??? ? ??, ??? ??? ??? total_fee? ??? ? ????. (???? ?????. ?????. ? ????? ?????.)
"receive_address"=>'1',//???? ??? ?? ?????. ? ????? ?????
"receive_mobile"=>'1',//??? ????? ???? ??? ?? ?????
"receive_name"=>'1',//??? ???? ???? ??? ?????
"receive_zip"=>'1',//??? ???? ?? ?? ??? ?????
"return_url"=>$config['return_url'], //??? ?? ??? ?? ??? ?? Alipay? ??? ??? ? ?? ???? ???? ??? ?????? ??? ???? http ??? ?????.
"seller_email"=>$config['seller_email'],//???? Alipay ??? ?? ?????? ??????
"service"=>"create_direct_pay_by_user", //????? ??? create_direct_pay_by_user
? ?????. "show_url"=>$config['show_url'], //?? ?? URL, ?? ???? ?? ??? ?? ????????.
"subject"=>$order['subject']//???, ???/???/???/?? ??? ?
);
?$alipay=newAlipaySubmit($config);
?$new=$alipay->buildRequestPara($data);
?$go_pay=$alipay->buildRequestForm($new,'get','pay');
echo$go_pay;
?}
??? ??
??? ??
??? Vendor ????? PHPMailer? ??? ? ????? ??? ???????. ??? ????? ??? ????? ? ??? "PHPMailer"? ?? ? ??? ???? ?? ???? ? ????? ?? ???????. ??? ??! ?? ?????? ? ? ??? ?? Vendor('PHPMailer.class#PHPMailer');
? ?????. ? ?? ?? PHPMailer? ?????. ?????? PHPMailer ???? ?? ? ???? ?? ???? ???? ???? ???? ?????. ? ?????
Vendor() ???? ?? ??? ????? ??? ??, Vendor() ???? ??? import() ???? ????? ??? ?? ?? import() ???? ?? ????? ??? ?? ?????. import() ???? ?? ??? ???? import() ????? ?? ?? ???? ??? ??? ’.’ ? ’#’? ????? ?? ? ? ????. ;.'? ???? Vendor ????? ???? baseurl? ???? ?????. ??? ?? Vendor() ???? ????? ?? ?? ????? ?? ?????.
??????/????/PHPMailer/class.PHPMailer.php
PHPMailer ?? ??? ?? ???? ??? ??? ????:
??????/????/phpmailer/class.phpmailer.php
??? ?????! ??? Linux ??? ???? ?? ??? ???? ???? ???? ???? ??? ? ???? ????? import? ?? ????. ???? Vendor()? ???? ??? ?? ???? ????.
????(‘phpmailer.class#phpmailer’)
?? PHPMailer? ??? ? ? ?? ???? ? ?? PHPMailer? SMTP? ???? ???? ??? ?? PHP? fsockopen? ???? ??? fscokopen? ????? php.ini? ????_??? ???? ???. ??? ??? ?? ??? ?????.
?fsockopen()? ?????????
PHPMailer? ErrorInfo ??? ?? ?? ? ????!
? ??? ThinkPHP?? ?? ?????? ???? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

ThinkPHP ????? ????? ??? ?????: Composer? ????, ???? ????? ???? php bin/console? ????, ?? ???? ??? http://localhost:8000? ?????.

ThinkPHP?? ??? PHP ????? ??? ?? ??? ????. ??? ???? 3.2, 5.0, 5.1, 6.0? ????, ??? ??? ??? ???? ??? ??? ???? ? ?????. ?? ?? ??? ThinkPHP 6.0.16???. ??? ??? ? PHP ??, ?? ?? ?? ? ???? ??? ??????. ??? ??? ??? ???? ?? ?? ??? ???? ?? ????.

ThinkPHP Framework? ???? ???? ??: ThinkPHP Framework? ?? ????? ?????? ??? ???. ThinkPHP ?? ????? ???? ?? ???(?? ??)? ????. ?????? ?? ????? ?????. ? ??? ?????. ThinkPHP ??????? ??????. ThinkPHP ?????? URL? ???? ?????.

Laravel? ThinkPHP ?????? ?? ??: ThinkPHP? ????? ??? ? ??? ??? ?? Laravel?? ??? ????. Laravel? ? ????? ??? ??????? ?? ThinkPHP? ? ??? ? ????.

ThinkPHP ?? ??: PHP, Composer ? MySQL ??? ?????. Composer? ???? ????? ????. ThinkPHP ?????? ???? ?????. ?????? ??? ?????. ?????? ??? ?????. ??????? ???? http://localhost:8000? ?????.

ThinkPHP? ?? ????, ?? ???, ?? ?? ? ?????? ???? ?? ??? ?? ??? PHP ????????. ?? ?? ???? ??? ?? 10,000? ??? ??? ??? ? ??? JD.com, Ctrip? ?? ??? ? ??? ? ?????? ????? ?? ?? ?????? ?? ?????.

?? ??: API ??? ?? ThinkPHP ?????? ???? ?? ???? ????? ????? API(?? ????? ?????)? ???? ?? ? ??? ????. API? ??? ??, ?? ?? ? ?? ??? ??? ? ??? ????? ??? ???? ?? ?? ??? ?????. ??? PHP ?? ?????? ThinkPHP ?????? ????? ?? ???? ???? ????.

"?? ??: ThinkPHP ?????? ???? ??? ??? ???? ??" ??? ??? ??? ???? ?? ? ?? ????? ?? ?? ?? ??? ??? ???? ??? ???? ?? ?? ??? ?? ? ??????. ??? ??? ??? ??? ????? ?? ???? ??? ???, ?? ??? ??, ??? ?? ?? ?? ??? ?? ??? ??? ???? ?? ??? ??? ???? ?? ?? ?????. PHP ???? ?? ???? ?? ?????? ThinkPHP ?????? ??? ??? ???? ? ?? ??? ??? ?????.
