This file contains 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 | |
namespace MyApp\MyBundle\DependencyInjection; | |
use Symfony\Component\Security\Core\User\User; | |
use Symfony\Component\Security\Core\User\UserInterface; | |
use Symfony\Component\Security\Core\User\UserProviderInterface; | |
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; | |
class UserProvider implements UserProviderInterface { |
This file contains 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 | |
namespace MyApp\MyBundle\DependencyInjection; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; | |
use Symfony\Component\Config\FileLocator; | |
class InformationContainer { |
This file contains 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 | |
// maybe it is too much, but it works :-) | |
$design = Mage::getSingleton('core/design_package'); | |
$design->setArea(Mage_Core_Model_Design_Package::DEFAULT_AREA) | |
->setTheme( | |
array( | |
'layout' => Mage_Core_Model_Design_Package::DEFAULT_THEME, | |
'template' => Mage_Core_Model_Design_Package::DEFAULT_THEME, | |
'skin' => Mage_Core_Model_Design_Package::DEFAULT_THEME, | |
'locale' => Mage_Core_Model_Design_Package::DEFAULT_THEME |
This file contains 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 | |
/** | |
* This script imports the ticket-entries from tickspot, changes the format to the TimeLog-XML-format | |
* (which GrandTotal can read) and prints it out. | |
* | |
* Tickspot only saves hours, so the day starts at 9:30 and the entries are concatenated. No rest between | |
* or something. | |
* | |
* If this code is useful for you, use it! If you earn money with it, and you want to say thank you: | |
* https://flattr.com/thing/424316/Fabianikono-on-Twitter |
This file contains 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 | |
class Klasse { | |
public static function switchIndexingOff() { | |
$processes = Mage::getSingleton('index/indexer')->getProcessesCollection(); | |
$processes->walk('setMode', array(Mage_Index_Model_Process::MODE_MANUAL)); | |
$processes->walk('save'); | |
} | |
public static function rebuildIndices() { | |
$processes = Mage::getSingleton('index/indexer')->getProcessesCollection(); |
This file contains 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 | |
namespace Linkofy\CommonBundle\Menu; | |
use Knp\Menu\FactoryInterface; | |
use Symfony\Component\DependencyInjection\ContainerAware; | |
class Builder extends ContainerAware | |
{ | |
public function mainMenu(FactoryInterface $factory, array $options) |
This file contains 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 | |
// save the old id | |
$oldStoreId = Mage::app()->getStore()->getId(); | |
// set the store to be admin | |
Mage::app()->getStore()->setId(Mage_Core_Model_App::ADMIN_STORE_ID); | |
// set the orig data | |
$product->setOrigData(); | |
// save the product | |
$product->save(); | |
// reset the store id |
This file contains 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 | |
class Observer { | |
protected function _collectionShouldLoadWidthAndHeight(Mage_Catalog_Model_Resource_Product_Collection $collection) | |
{ | |
$reflection = new ReflectionProperty($collection, '_selectAttributes'); | |
$reflection->setAccessible(true); | |
$value = $reflection->getValue($collection); | |
return array_key_exists('original_height', $value) || array_key_exists('original_width', $value); | |
} | |
} |
This file contains 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
UPDATE | |
catalog_product_entity_int | |
SET | |
value = 1 -- new value | |
WHERE | |
attribute_id = 85 AND -- attribute_id you want to change | |
entity_id IN ( | |
SELECT DISTINCT product_id FROM catalog_product_super_link | |
); |
This file contains 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 | |
namespace MyNamespaceForFunctions; | |
use FPDF; | |
require_once 'fpdf.php'; | |
error_reporting(E_ALL); | |
ini_set('display_errors', 1); | |
function utf8_decode($string) | |
{ |
OlderNewer