This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <? | |
| global $_SERVER; | |
| $_SERVER["DOCUMENT_ROOT"] = realpath(dirname(__FILE__)."/.."); | |
| // cron | |
| // echo "/opt/php83/bin/php -f ".$_SERVER["DOCUMENT_ROOT"]."/local/backup_yandex_disk.php demo"; | |
| // echo "/opt/php83/bin/php -f ".$_SERVER["DOCUMENT_ROOT"]."/local/backup_yandex_disk.php clear"; | |
| // echo "/opt/php83/bin/php -f ".$_SERVER["DOCUMENT_ROOT"]."/local/backup_yandex_disk.php"; | |
| // exit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // обрезка изображения под пропорции | |
| if (!function_exists('cropImage')) { | |
| /** | |
| * cropImage обрезаем картинку до нужных пропорций (черные поля у превью с ютюба) | |
| * @param [file] $file временный файл | |
| * @param [float] $aspect отношение сторон | |
| * @param [boolean] $youtube полосы ютюба | |
| * @return [string] ответ | |
| */ | |
| function cropImage(&$file, $aspect=1.7777, $youtube=true){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ресайз загружаемых изображений | |
| if (!function_exists('resizeUploadedImage')) { | |
| /** | |
| * resizeUploadedImage уменьшение изображения | |
| * @param [file] $file временный файл | |
| */ | |
| function resizeUploadedImage(&$file, $w=2000, $h=2000){ | |
| if (!empty($file["name"])) { | |
| list($width, $height) = getimagesize($file["tmp_name"]); | |
| if ($width > $w || $height > $h) { |
OlderNewer