Contact
Site: US UK AU |

What are some useful Magento scripts?

What are some useful Magento scripts? 

Overview
This article identifies a few of the most useful Magento scripts, defines them, and provides a link for more information.

Why use Magento scripts?

Magento users can often benefit from writing scripts to streamline, accelerate, or automate many of the platform’s common commands. These PHP scripts run from the command line and, if properly executed, can enhance Magento’s performance. 

This article acts as an introduction to helpful scripts; therefore, it will not provide detailed instructions on how to implement them. It will, however, provide general tips and specific links to such information. 

You can find more information about these scripts and instructions regarding their use on the Nexcess blog.

Partial list of scripts

Some useful scripts include:

  • Accelerated backups
  • Accelerated exports and imports
  • Built-in shell scripts with Magento 1.4 and later

Accelerated backups: backup.php

The script, backup.php, creates a compressed Magento database backup in the var/backups folder. It is functionally identical to running System > Tools > Backup, but faster and immune to the timeouts that often plague backup operations on very large databases. It can also be run as a cron job. 

Accelerated exports and imports

The script, “export.php,” addresses Magento’s notoriously slow import and export functions. This script runs the same export profile as the administrator control panel, but with significantly more speed and without the timeout issues known to affect browsers. 

Magento 1.4 comes with its own shell scripts. 

Built-in shell scripts with Magento 1.4 and later

Magento 1.4 comes with its own shell scripts. The MAGENTO_ROOT/shell/ directory contains four files:

  • abstract.php 
  • compiler.php
  • indexer.php
  • log.php

Abstract.php is the abstract class definition for Mage_Shell that runs the other scripts and gives you the ability to write your own.

Indexer.php is a command line interface to Magento’s index management.

Log.php manages the visitor logs. This is essential for keeping your database at a reasonable size, and by extension, your time-to-first-byte latency low.

The compiler.php script is the command line interface to Magento’s compiler. For every connection, Magento searches its categories in the following order of priority:

  1. app/code/local 
  2. app/code/community
  3. app/code/core 
  4. lib 

The Magento Compiler essentially copies all of the class and code files to a single path, include/src, and then changes the include_path accordingly. It also aggregates the most commonly used PHP files. 

 

For 24-hour assistance any day of the year, contact our Support Team by email or through the Client Portal.

Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
 
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
How to configure the Magento Product Importer (Magmi)
Added on Mon, Jan 26, 2015
What is the “Client denied by server configuration app/etc/local.xml” error?
Added on Thu, Sep 10, 2015
How to patch your Magento 1 store
Added on Thu, Oct 18, 2018
How to disable caching in Magento
Added on Tue, Nov 5, 2013
How to configure multiple Magento storefronts
Added on Mon, Jul 29, 2013
What are the benefits of dedicated IP addresses?
Added on Thu, Jan 14, 2016
How to change Magento base URLs
Added on Tue, Jun 12, 2018
What is Magento?
Added on Thu, Sep 10, 2015
How to find and remove hanging Magento cron jobs with SSH
Added on Thu, Oct 30, 2014
What is Turpentine?
Added on Thu, Aug 28, 2014