Proyectos de Subversion LeadersLinked - Services

Rev

Rev 817 | Rev 820 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 817 Rev 818
Línea 1039... Línea 1039...
1039
     * @param string $sourceFilenameToUnlink The path to the source file to unlink.
1039
     * @param string $sourceFilenameToUnlink The path to the source file to unlink.
1040
     * @return bool True on success, false on failure.
1040
     * @return bool True on success, false on failure.
1041
     */
1041
     */
1042
    private function _savePngAndCleanup($imageResource, $targetFilename, $sourceFilenameToUnlink)
1042
    private function _savePngAndCleanup($imageResource, $targetFilename, $sourceFilenameToUnlink)
1043
    {
1043
    {
1044
        $storage_root_path = $this->config['leaderslinked.storage.path'];
-
 
1045
        $target_filename_path = $storage_root_path . DIRECTORY_SEPARATOR . $targetFilename;
-
 
1046
        $save_success = imagepng($imageResource, $target_filename_path);
1044
        $save_success = imagepng($imageResource, $targetFilename);
1047
        imagedestroy($imageResource); // Clean up the image resource
1045
        imagedestroy($imageResource); // Clean up the image resource
Línea 1048... Línea 1046...
1048
 
1046
 
1049
        if ($save_success) {
1047
        if ($save_success) {
1050
            if ($sourceFilenameToUnlink && file_exists($sourceFilenameToUnlink)) {
1048
            if ($sourceFilenameToUnlink && file_exists($sourceFilenameToUnlink)) {
1051
                unlink($sourceFilenameToUnlink);
1049
                unlink($sourceFilenameToUnlink);
1052
            }
1050
            }
1053
            return true;
1051
            return true;
1054
        } else {
1052
        } else {
1055
            error_log("_savePngAndCleanup: imagepng failed to save image to {$target_filename_path}.");
1053
            error_log("_savePngAndCleanup: imagepng failed to save image to {$targetFilename}.");
1056
            return false;
1054
            return false;
1057
        }
1055
        }
Línea 1058... Línea 1056...
1058
    }
1056
    }