Pregunta

Cuando se piensa en la optimización de la velocidad de Magento, hay varias posibilidades como el almacenamiento en caché (PHP, base de datos, incluso de página completa cachés) para acelerar su sitio.

Otra posibilidad es reducir la cantidad de procesamiento que se realiza, es decir, reducir el número de módulos que se ejecutan en su tienda.

Recientemente, me he preguntado si es posible / segura para desactivar el módulo Mage_Reports.

Esto es en el archivo como app/etc/modules/Mage_All.xml

<Mage_Reports>
    <active>true</active>
    <codePool>core</codePool>
    <depends>
        <Mage_Customer/>
        <Mage_Catalog/>
        <Mage_Sales/>
        <Mage_Cms/>
    </depends>
</Mage_Reports>

Así que viene incluido con el núcleo y depende de varios otros módulos.

Sin embargo, no veo otros módulos que tiene Mage_Reports como dependencia.

Me desactivó en una tienda de prueba y todo parece funcionar bien.

question => ¿Es cierto, que además de perder los datos de los informes, por supuesto, la tienda puede funcionar bien sin este módulo?

o hay puntos en los que romperá mi tienda cuando este módulo no se activa?

¿Fue útil?

Solución

Your store might work, that's true, as long as you have admin panel Graphs also disabled. In reality though it's all up to programmers and how they're handling situations with modules being disabled. The issue is, that Magento 1.x does not have a handling mechanism that would automatically solve that problem for you. If you look at

public function getResourceModelInstance($modelClass='', $constructArguments=array())
{
    $factoryName = $this->_getResourceModelFactoryClassName($modelClass);
    if (!$factoryName) {
        return false;
    }
    return $this->getModelInstance($factoryName, $constructArguments);
}

it will return false when module is disabled. Which means all Mage::getModel('reports/.. will be false and whatever method you'll try to call on that (supposed to be) object will throw you a Call to a member function on a non-object php Fatal error.

While Magento team did their job done (well, they didn't actually, if you enable Charts your admin should break on Dashboard for example), you can't know how 3rd party extensions will handle those situations in case they try to use the Reports module.

So, if you make sure you're handling all the situations where reports are called, then you can disable it. Otherwise, better not to.

Otros consejos

I can't tell you what will happen if you disable the module but I can tell you how you can (likely) stop its processing impact without disabling it.

All of its processing cost comes from observers. And probably a Xeon job but that isn't relevant here. If you can stop the observing of the events you can eliminate the overhead.

The naive way would be to edit the config.xml and comment them out. Don't do that.

The right way would be to create your own module that depends on Mage_Reports and just have a config.xml. In that define a front end tag and copy in all the observers from Mage_Reports. Then change the event they are observing to some nonsense not real event that will never get fired. Then add a tag under the observer named type with a value of disabled.

If you look in dispatch event in App.php you will be able to see that it works. You overwrite theirs with a disabled observer. Nothing gets called and nothing breaks!

Licenciado bajo: CC-BY-SA con atribución
No afiliado a magento.stackexchange
scroll top