$ curl -s -o /dev/null -w "Status: %{http_code} Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" www.site-domain.com
Status: 200 Connect: 0,688 TTFB: 1,523 Total time: 2,756
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
<?php | |
/** | |
* A simple fix for a shell execution on preg_match('/[0-9]\.[0-9]+\.[0-9]+/', shell_exec('mysql -V'), $version); | |
* The only edit that was done is that shell_exec('mysql -V') was changed to mysql_get_server_info() because not all | |
* systems have shell access. XAMPP, WAMP, or any Windows system might not have this type of access. mysql_get_server_info() | |
* is easier to use because it pulls the MySQL version from phpinfo() and is compatible with all Operating Systems. | |
* @link http://www.magentocommerce.com/knowledge-base/entry/how-do-i-know-if-my-server-is-compatible-with-magento | |
* @author Magento Inc. | |
*/ |
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
#!/bin/sh | |
echo "Generate dump?(yes)" | |
read godump | |
if [ $godump = 'yes' ] || [ $godump = 'y' ]; then | |
read -p "mysql user: " YOUR_USER | |
read -p "mysql password: " YOUR_PASSWORD | |
read -p "mysql host: " YOUR_HOST |
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
<?php | |
include_once "app/Mage.php"; | |
umask(0); | |
Mage::app()->loadArea('frontend'); | |
$layout = Mage::getSingleton('core/layout'); | |
//load default xml layout handle and generate blocks | |
$layout->getUpdate()->load('default'); | |
$layout->generateXml()->generateBlocks(); |
##Magento errors and causes
###Error: Not valid template file
CRIT (2): Not valid template file: frontend/base/default/template/path/to/template.phtml
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
<?php | |
error_reporting(E_ALL); | |
ini_set('display_errors', 1); | |
require_once 'app/Mage.php'; | |
Mage::app(); | |
echo "Testando<br>"; | |
$order = Mage::getModel('sales/order')->loadByIncrementId('100045842'); |
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
<?php | |
public function addToAction() | |
{ | |
$cart = Mage::getSingleton('checkout/cart'); | |
$cart->addProductsByIds( | |
array( | |
$this->getRequest()->getParam('currentproduct'), | |
$this->getRequest()->getParam('relatedproduct') |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>Forms with Prototype</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<meta http-equiv="pragma" content="no-cache" /> | |
<script type="text/javascript" src="js/prototype.js"></script> | |
<script type="text/javascript"> |
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
<?php | |
error_reporting(E_ALL); | |
require_once '../../../../../Mage.php'; | |
Mage::app(); | |
require_once './Garantia.php'; | |
$productModel = Mage::getModel('catalog/product'); |