✅ #تیکه_کد
💎 کار این تیکه کد اینه که از پوشه data بکاپ میگیره و براتون ارسال میکنه.
💻 فانکشن های زیر رو در سورس قرار بدین👇
function Ziper($folder_to_zip_path, $destination_zip_file_path){
$rootPath = realpath($folder_to_zip_path);
$zip = new ZipArchive();
$zip->open($destination_zip_file_path, ZipArchive::CREATE | ZipArchive::OVERWRITE);
$files = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($rootPath),
RecursiveIteratorIterator::LEAVES_ONLY);
foreach ($files as $name => $file){
if(!$file->isDir()){
$filePath = $file->getRealPath();
$relativePath = substr($filePath, strlen($rootPath) + 1);
$zip->addFile($filePath, $relativePath);
}
}
$zip->close();
}
وسپس تیکه کد زیر را قرار بدین 👇
elseif ($text == 'پشتیبان گیری' && $chat_id == $admin){
Ziper('data','backup.zip');
bot('sendDocument',[
'chat_id'=>$chat_id,
'document'=>new CURLFile('backup.zip'),
'caption'=>'کل دیتای ربات 👆🏻👆🏻',
]);
unlink('backup.zip');
}
🌟 : @Star_Sourcee
Post #184
1.14K