Skip to content

Instantly share code, notes, and snippets.

<?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.
*/
@avoelkl
avoelkl / TransportBuilder.php
Last active December 16, 2019 09:02
TransportBuilder
<?php
/**
* Mail Template Transport Builder
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
namespace Magento\Framework\Mail\Template;
@avoelkl
avoelkl / de_DE.csv
Last active February 22, 2018 12:23 — forked from peterjaap/de_DE.csv
Algolia
label Bezeichnung
Base Image Basisbild
Small Image Kleines Bild
Thumbnail Miniaturansicht
None Keine
AllOptional Alle optional
LastWords letztes Wort
FirstWords erstes Wort
Search for products, categories Suche nach Produkten, Kategorien
Search Suche
@avoelkl
avoelkl / gist:0cacdb354c7c45c6157be44676e825aa
Last active September 7, 2016 14:51
addGroupPriceData() is missing in Mage_Catalog_Model_Resource_Product_Collection
<?php
/**
* Created by PhpStorm.
* User: Anna Völkl <[email protected]>
* Date: 07.09.2016
* Time: 16:01
add this to config.xml
<models>
<catalog_resource>
@avoelkl
avoelkl / loadcustomer.php
Last active August 17, 2016 11:54
Testing efficient way of loading customer data
<?php
require_once '../app/Mage.php';
Mage::app();
umask(0);
$customerId = 575420;
$start = microtime();
$memory1 = memory_get_usage();
$customer = Mage::getModel('customer/customer')->load($customerId);
$firstname = $customer->getFirstname();
@avoelkl
avoelkl / composer.json
Created August 12, 2016 12:34
Sample composer.json file
{
"name": "vendor/modulename",
"type": "magento-module",
"license":"OSL-3.0",
"description":"Helps you doing cool stuff",
"authors":[
{
"name":"Firstname Lastname",
"email":"[email protected]"
}
src/app/code/community/Vendor/* app/code/community/Vendor/
src/app/etc/modules/* app/etc/modules/
@avoelkl
avoelkl / checks.md
Last active June 16, 2016 17:09
PayPal Security Update on June 17th 2016

So, here's the thing: PayPal is rolling out a security update on June 17th 2016. A friday, for the joy of all developers and agencies I think. Those who are not prepared and did not check the requirements first will have websites/shops with a non-working PayPal integration after June 17th.

The main 2 points are:

Support SHA-256

PayPal is upgrading SSL certificates on all Live and Sandbox endpoints from SHA-1 to the stronger and more robust SHA-256 algorithm. You will need to update your integration to support certificates using SHA-256.

Discontinue use of the VeriSign G2 Root Certificate

@avoelkl
avoelkl / create_website_scope.php
Last active December 14, 2015 10:39 — forked from yireo/create_website_scope.php
Magento script to create a new Website, new Store Group, new Store View and new Root Catalog - all linked together.
<?php
$name = 'Shop:Name';
$code = 'shop';
// Create the root catalog
$category = Mage::getModel('catalog/category');
$category->setStoreId(Mage_Core_Model_App::ADMIN_STORE_ID);
$category->setData('name', $name);
$category->setData('url_key', $code);
$category->setData('display_mode', 'PRODUCTS');
@avoelkl
avoelkl / upgrade-0.1.67-0.1.68.php
Last active December 2, 2015 10:44
SUPEE-6788 variable + block setup script. 1.) Create a new module or extend a current one. 2.) Create a new install or setup script with the variables and blocks which are not whitelisted yet.
<?php
/**
* Created by PhpStorm.
* User: a.voelkl
* Date: 30.10.2015
* Time: 13:21
*/
/** @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;