Mit dem Linux-Bash-Tool ls kann man in diversen Variationen Dateien & Ordner sortieren, hier eine Übersicht der wichtigsten Kommandos:
ls -trl
Dateien nach Zeit der Dateierzeugung anzeigen lassen
ls -turl
Zeigt die Dateien an, auf die zuletzt zugegriffen wurde
ls -c
Dateien nach Datum der letzten Änderung der Satusinformationen anzeigen lassen
ls -f
Deaktiviert die Standardsortierung und Zeigt auch . und .. an
ls -S
Sortiert nach Dateigröße
ls -t
Sortiert nach dem Datum der letzten Änderung
ls -U
Keine Sortierung
ls -u
Sortiert nach Zugriffszeit
ls -X
Sortiert nach Dateierweiterung
To delete a system attribute in Magento, you must first have to make it user defined.
- Go to phpmyadmin
- Go to your magento installation database
- Go to eav_attribute table
- Browse table with attribute_code ‘YOUR_ATTRIBUTE_CODE’ OR browse the table with the attribute_id of your attribute (‘your attribute’ means the attribute which you want to remove as system attribute)
- Edit the table row of your attribute
- Find the field “is_user_defined” and set the value to 1
- save the attribute
Now your attribute no longer remains System Attribute
Now you can delete it from Attribute manager
send email in magento (php-code) :
$template_var_array = array(
'var_1' => 'value 1',
'var_2' => 'value 2'
);
$sender = array('name' => 'name', 'email' => 'email@adresse.com');
$translate = Mage::getSingleton('core/translate');
$translate->setTranslateInline(false);
$emailTemplate = Mage::getModel('core/email_template');
$emailTemplate->setDesignConfig(array('area' => 'backend'))
->sendTransactional(
Mage::getStoreConfig('core/email_template'),
Mage::getStoreConfig('general'), // alternate $sender
Mage::getStoreConfig('general'), // absender
null,
$template_var_array;
}
}
Magento reads the rows from the database table admin_role in the wrong” order. That is it reads the user entry before the parent group (the role) is loaded. This happends because the user rows has a tree_level = 1, when they should have tree_level = 2 or more.
Solution:
To fix a broken admin-interface, run the following query in the magento database:
UPDATE admin_role SET tree_level = 2 WHERE role_type = “U”;
To prevent the error from happening again:
Open up the file app/code/core/Mage/Admin/Model/Mysql4/User.php
On line 162 (or close to that line) you find a row that says:
‘tree_level’ => $row[’tree_level’] + 1,
change this line to:
‘tree_level’ => $row[’tree_level’] + 2,
If you want redirect mobile clients to an own domain, you can do this about the .htaccess file with the following code:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} !^.mobile\.domain\.de$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_USER_AGENT} "acs|alav|alca|amoi|audi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "dang|doco|eric|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|sage|sams|sany" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "wapp|wapr|webc|winw|winw|xda|xda-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "up.browser|up.link|windowssce|iemobile|mini|mmp" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "symbian|midp|wap|phone|pocket|mobile|pda|psp" [NC]
RewriteCond %{HTTP_USER_AGENT} "!(macintosh|ipad)" [NC]
RewriteRule ^(.*)$ http://mobile.domain.de/ [L,R=302]
</IfModule>
Ein kostenlosen (GPL) Plattformunabhängigen (auf Adobe Air Basis) Ipad Emulator könnt ihr bei Google Code laden unter:
http://code.google.com/p/ibbdemo2/downloads/list
geht über die Server-Variable “HTTP_X_FORWARDED_FOR” wie folgt:
echo $_SERVER["HTTP_X_FORWARDED_FOR"];
Das Caching könnt ihr in Magento wie folgt beeinflussen:
protected function _construct()
{
$this->addData(array(
'cache_lifetime' => 900,
'cache_tags' => array(Mage_Catalog_Model_Product::CACHE_TAG),
'cache_key' => $this->getCacheKey()
));
}
public function getCacheKey()
{
return $this->getRequest()->getRequestUri().$this->getCacheCurrencyCode();
}
//retreive current currency code
public function getCacheCurrencyCode()
{
return Mage::app()->getStore()->getCurrentCurrencyCode();
}
De-Aktivieren könnt ihr das Caching wie folgt:
protected function _construct()
{
$this->addData(array(
'cache_lifetime' => null,
'cache_tags' => array(Mage_Catalog_Model_Product::CACHE_TAG)
));
}
Find and remove file (about name)
find . -name "FILE-TO-FIND"-exec rm -rf {} \;
Find and remove file (about file type)
find . -type f -name "FILE-TO-FIND" -exec rm -f {} \;
Find all *.bak files in current directory and removes them with confirmation from user:
$ find . -type f -name "*.bak" -exec rm -i {} \;
Find all core files and remove them:
find / -name core -exec rm -f {} \;
Zwar ist ZendDebugger beim Zend-Server integriert, allerdings habe ich ihn mit phpStorm nicht zum laufen bekommen, von d.h. hier ein kurzes HowTo wie ihr xDebug in ZendServer integrieren könnt:
Ladet die Datei php_xdebug-2.1.1-5.2-vc6-nts.dll (ggf. höhere Version, nts-version ist für die non-thread-saved apache – version … phpinfo erkennt ihr welche Version ihr benötigt, alternativ testen
von http://xdebug.org/files/ und packt sie in das entsprechende Verzeichnis, z.b. C:\Program Files\Zend\ZendServer\lib\phpext
Wenn ihr XDebug einsetzt, müsst ihr vorher den Zend Debugger deaktiviert, das geht über die Zend-Server Adminoberfläche wie folgt::
- Login auf der Benutzeroberfläche: http://localhost/ZendServer
- zum Reiter Server Setup wechseln
- Den Zend Debugger durch Klick auf den Button Turn off deaktivieren
- PHP neu starten (Button rechts unten)
Jetzt noch in der php.ini xdebug einbinden (liegt unter C:\Programme\Zend\ZendServer\etc):
zend_extension=”C:\Program Files\Zend\ZendServer\lib\phpext\php_xdebug-2.1.1-5.2-vc6-nts.dll”
zend_extension=”C:\Program Files\Zend\ZendServer\lib\ZendExtensionManager.dll”
Achtung: ZendExtensionManager.dll darf nur nach der php_xdebug.dll eingebunden werden!
Jetzt noch Server neu starten und xdebug sollte verfügbar sein. Prüft dazu die phpinfo ob xdebug dort auftaucht!