2024-09-29 15:43:18 +08:00

54 lines
1.3 KiB
PHP

<?php
namespace app\kami\controller\getcookie;
use app\channel\service\ChannelService;
use app\gateway\service\AuthService;
use app\gateway\service\RedisService;
use app\merchant\service\MerchantService;
use app\merchant\service\OrderHistoryService;
use app\merchant\service\OrderService;
use dever\Log;
use think\admin\Controller;
use think\exception\HttpResponseException;
use think\facade\Http;
class Core extends Controller
{
public function cookiePatch($chanel)
{
$path = root_path();
$path = $path . "extend/" . 'data/cookie' . DIRECTORY_SEPARATOR;
// var_dump($path);die;
//return $path;
self::createPath($path);
if ($chanel) {
$path .= $chanel . DIRECTORY_SEPARATOR;
}
self::createPath($path);
return $path;
}
private static function createPath($path)
{
try{
if(!is_dir($path)){
mkdir($path,0700);
@chmod($path, 0755);
@shell_exec('chmod -R 777 ' . $path);
}
}catch(\Exception $e){
while($e->getMessage()){
self::createPath($path);
}
}
// if (!is_dir($path)) {
// mkdir($path);
// @chmod($path, 0755);
// @system('chmod -R 777 ' . $path);
// }
}
}