If you switch from PHP 5.x to 7.1 you will get the following message:
"Function mcrypt_encrypt() is deprecated"
Now it is the right time to refactor this old function :-)
function encrypt(string $data, string $key, string $method): string
# ================================================ | |
# PHP 7.2 | |
# | |
# See https://www.colinodell.com/blog/201711/installing-php-72 | |
# ================================================ | |
apt-get install -y apt-transport-https lsb-release ca-certificates | |
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg | |
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list | |
apt-get update | |
apt-get install -y php7.2-cli php7.2-gd php7.2-mbstring php7.2-curl php7.2-xml php7.2-zip |
#!/bin/bash | |
HTTPADDR=http://acraiz.icpbrasil.gov.br/credenciadas/CertificadosAC-ICP-Brasil/ACcompactado.zip | |
DEST=/etc/ssl/certs/icp-brasil | |
mkdir -p ${DEST} | |
cd ${DEST} | |
rm -f *.crt | |
rm -f *.zip |
# encoding: utf-8 | |
s = "Blah \xe9 blah 헌글" | |
puts "BEFORE" | |
puts "encoding: #{s.encoding}" | |
puts "valid : #{s.valid_encoding?}" | |
puts "text : #{s}" | |
s = s. |