Skip to content

Instantly share code, notes, and snippets.

View t10u's full-sized avatar

Toni Grigoriu t10u

View GitHub Profile
~$ sudo pear channel-discover pear.magetool.co.uk
Discovering channel pear.magetool.co.uk over http:// failed with message: channel-add: Cannot open "http://pear.magetool.co.uk/channel.xml" (File http://pear.magetool.co.uk:80/channel.xml not valid (received: HTTP/1.1 404 Not Found
))
Trying to discover channel pear.magetool.co.uk over https:// instead
Discovery of channel "pear.magetool.co.uk" failed (channel-add: Cannot open "https://pear.magetool.co.uk/channel.xml" (Connection to `pear.magetool.co.uk:443' failed: Connection timed out))
<?xml version="1.0"?>
<config>
<!-- ... -->
<global>
<models>
<foobar>
<class>Foo_Bar_Model</class>
</foobar>
</models>
</global>
@t10u
t10u / gist:1035684
Created June 20, 2011 14:22
Magneto
$ curl -I http://magnetocommerce.com
HTTP/1.1 302 Found
Cache-Control: private
Content-Length: 147
Content-Type: text/html; charset=utf-8
Location: http://www.magentocommerce.com
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Mon, 20 Jun 2011 14:20:18 GMT
--- app/code/core/Mage/Core/Block/Template.php (revision 96724)
+++ app/code/core/Mage/Core/Block/Template.php (revision 102008)
@@ -34,6 +34,9 @@
*/
class Mage_Core_Block_Template extends Mage_Core_Block_Abstract
{
+ const XML_PATH_DEBUG_TEMPLATE_HINTS = 'dev/debug/template_hints';
+ const XML_PATH_DEBUG_TEMPLATE_HINTS_BLOCKS = 'dev/debug/template_hints_blocks';
+ const XML_PATH_TEMPLATE_ALLOW_SYMLINK = 'dev/template/allow_symlink';
<?php
require 'app/Mage.php';
Mage::app('admin')->setUseSessionInUrl(false);
try {
$client = new Zend_Soap_Client('http://local.magento/api/soap/?wsdl');
// login
$sessionId = $client->login('user', 'pass');
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect('name');
$collection->addAttributeToFilter('my_custom_attribute', array('notnull' => ''));
foreach ($collection as $product) {
echo $product->getId(). ' '. $product->getName();
}
cd <MAGENTO DIR>
mkdir -p mage_tmp
./pear config-set mage_dir $PWD/mage_tmp
./pear config-set mage_etc_dir $PWD/mage_tmp/etc
./pear config-set mage_community_dir $PWD/mage_tmp/app/code/community
./pear config-set mage_design_dir $PWD/mage_tmp/app/design
./pear config-set mage_lib_dir $PWD/mage_tmp/lib
./pear config-set mage_local_dir $PWD/mage_tmp/app/code/local
<img src="{{media url="dir1/dir2/image.png"}}" alt="" />
<?xml version="1.0" encoding="UTF-8"?>
<package packagerversion="1.7.1" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0^M
http://pear.php.net/dtd/tasks-1.0.xsd^M
http://pear.php.net/dtd/package-2.0^M
http://pear.php.net/dtd/package-2.0.xsd">
<name>Tonigrigoriucom_Scp</name>
<channel>pear.tonigrigoriu.com</channel>
<summary>Makes the admin category products list sortable</summary>
<description>Makes the admin category products list sortable</description>
<lead>
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="top.links">
<remove name="checkout_cart_link"/>
<block type="checkout/links" name="checkout_cart_link_custom">
<action method="addCheckoutLink"></action>
</block>
<action method="addLink" translate="label title" module="customer">
<label>My Cart</label>