Comunidad Joomla! Spanish
Comunidad Joomla! Spanish
 
#1  
Old 25-05-2010, 09:22 PM
Avatar de shacker
shacker shacker is offline
Joomla! Spanish full time
 
Registrado: Nov 2005
Location: Barcelona-Catalunya-Spain
Posts: 2,277
shacker has a reputation beyond reputeshacker has a reputation beyond reputeshacker has a reputation beyond reputeshacker has a reputation beyond reputeshacker has a reputation beyond reputeshacker has a reputation beyond reputeshacker has a reputation beyond reputeshacker has a reputation beyond reputeshacker has a reputation beyond reputeshacker has a reputation beyond reputeshacker has a reputation beyond repute
Send a message via Skype™ to shacker
Medallero
Exclamation Otro problema del instalador de extensiones de Joomla

Hay un problema con la función de PHP gunzip () que en las primeras versiones de PHP 5 se sabe que hace demanda de mucha memoria e innecesaria en algunas circunstancias.
Este error es susceptible por Joomla en algunas versiones en el rango de PHP 5.1.x .
Además, hay un problema con una parte del código de Joomla.

Además, para los sitios usando PHP 5.2.0 o posterior Joomla usaría funciones de PHP para descomprimir archivos zip, pero con versiones anteriores se utiliza el código de Joomla.
Un problema se presenta finalmente a la clase JFile y su método de lectura. Se puede encontrar en la ruta del root de joomla ..../libraries/joomla/filesystem/file.php. El método de lectura viejo es:

Código PHP:
function read($filename$incpath false$amount 0
    
$chunksize 8192$offset 0)
    {
            
// Initialize variables
            
$data null;
            if(
$amount && $chunksize $amount) { $chunksize $amount; }
            if (
false === $fh fopen($filename'rb'$incpath)) {
                    
JError::raiseWarning(21'JFile::read: '.
                    
JText::_('Unable to open file') . ": '$filename'");
                    return 
false;
            }
            
clearstatcache();
            if(
$offsetfseek($fh$offset);
            if (
$fsize = @ filesize($filename)) {
                    if(
$amount && $fsize $amount) {
                            
$data fread($fh$amount);
                    } else {
                            
$data fread($fh$fsize);
                    }
            } else {
                    
$data '';
                    
$x 0;
                    
// While its:
                    // 1: Not the end of the file AND
                    // 2a: No Max Amount set OR
                    // 2b: The length of the data is less than the max amount 
                    // we want
                    
while (!feof($fh) && (!$amount || strlen($data) < $amount)) {
                            
$data .= fread($fh$chunksize);
                    }
            }
            
fclose($fh);

            return 
$data;
    } 
Esto no esta especialmente bien escrito, y podemos ver que no funciona correctamente para un archivo de más de 8192 bytes. Puede ser sustituido por:

Código PHP:
function read($filename$incpath false$amount 0
$chunksize 8192$offset 0)
{
    
// Initialize variables
    
if (false === $fh fopen($filename'rb'$incpath)) {
        
JError::raiseWarning(21'JFile::read: '.
        
JText::_('Unable to open file') . ": '$filename'");
        return 
false;
    }
    if(
$offsetfseek($fh$offset);
    
$data '';
    
// While its:
    // 1: Not the end of the file AND
    // 2a: No Max Amount set OR
    // 2b: The length of the data is less than the max amount we want
    
while (!feof($fh) AND $trysize $amount 
    
min($chunksize, ($amount strlen($data))) : $chunksize) {
        
$data .= fread($fh$trysize);
    }
    
fclose($fh);

    return 
$data;

que parece proporcionar la funcionalidad deseada. Con este código en su lugar, se puede instalar cualquiera de los archivos zip o tar.gz.

Fuente:: Martin Brampton

Un saludo
__________________
Promoción, Desarrollo, Soporte y Extensiones para Joomla!
Joomla! Spanish | Joomla! Spanish Foros | Centro de ayuda Joomla! Spanish | Centro de Extensiones Joomla! Spanish | Proyecto top 3 en Joomlacode|
Las preguntas sobre soporte no se atenderán por mensajes privados (2005-2010)


Citar y responder
 


Herramientas
Estilo

Reglas del foro
not puedes iniciar una discusión
not puedes responder a una discusión
not puedes agregar archivos adjuntos
not puedes editar tus posts

El código vB está activado
Emotíconos está activado
El código [IMG] está activado
El código HTML está desactivado
Ir a

Discusiones similares
Discusión Iniciada por Foro Respuestas Último post
Problema instalador de componentes searga Foro general (1.0) 0 20-11-2009 03:32 PM
Problema al acceder al instalador de mambot zedmix Mambots (1.0) 1 17-04-2009 01:59 AM
Problema con instalador Shanecito Foro general (1.5) 0 18-05-2008 02:33 PM
Problema de instalador|templates... PelotaCaliente Foro general (1.0) 2 02-09-2007 07:53 PM
Problema con instalador serbaumo Administración (1.0) 0 31-07-2006 07:01 AM


Todas las horas son GMT. La hora es 10:54 AM.
TP-JSContáctanos
[ Inicio dominio | Ir arriba ]
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Portal Foros Archivo
Host: Joomla! Spanish | Patrocinado por: Web Empresa | Código de conducta | Aviso legal
Page copy protected against web site content infringement by Copyscape

The Joomla!(R) name is used under a limited license from Open Source Matters in the United States and other countries. Joomla!Spanish is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.