composer require nelexa/zip:^2.0
$password = 'ChangeMe';
$zipFile = \PhpZip\ZipOutputFile::create();
$zipFile->addFromString('filename.txt', 'Data content');
// установите пароль для нужного алгоритма шифрования
$zipFile->setPassword($password); // для WinZip AES шифрования
// или
$zipFile->setPassword($password, \PhpZip\Model\ZipEntry::ENCRYPTION_METHOD_TRADITIONAL); // для традиционного шифрования
$zipFile->outputAsAttachment('archive.zip');
setStatus("2", identificator);
curl 'http://profiwm.ru/log.in.php?login' -H 'Host: profiwm.ru' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36')' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Language: ru,en-US;q=0.7,en;q=0.3' --compressed -H 'Referer: http://profiwm.ru/log.in.php' -H 'Cookie: profiwm=osjp2bn58b61v5cloivn32rie3' --data 'type=nick&nick=YOUR_NICK&pass=YOUR_PASSWORD&chislo=YOUR_CAPTCHA_CODE'
$cacheDuration = 60; // 1 min
$country_id = Country::getDb()->cache(function ($db) {
return Country::find()->select('id')->asArray()->where(['name' => $matches[1]])->limit(1)->scalar();
}, $cacheDuration);
@frontend - frontend web application directory.
@backend - backend web application directory.
$ids = [963, 963, 70];
$inQuery = implode(',', array_fill(0, count($ids), '?'));
$stmt = $db->prepare('
SELECT `id` FROM `article` WHERE id IN(' . $inQuery . ')
');
foreach ($ids as $k => $id)
$stmt->bindValue(($k+1), $id, \PDO::PARAM_INT);
$stmt->execute();
$allResult = $stmt->fetchAll();
* * * * * ls -l >> /tmp/cron.ls.log
composer require nelexa/zip
public function getDownloadAllPassport($passports)
{
$passports = explode(',', $passports);
$name = uniqid();
$zipFile = \PhpZip\ZipOutputFile::create();
foreach ($passports as $passport) {
$user_name = VisaOrder::findOrFail($passport)->name;
if (Upload::getFiles('passport', $user_name)) {
$recursive = true;
$toZipPath = $name . '/';
$zipFile->addDir("upload/passport/$user_name", $recursive, $toZipPath);
}
}
$zipFile->outputAsAttachment('passport.zip');
}