Skip to content

Instantly share code, notes, and snippets.

View maxout's full-sized avatar
🎯
Focusing

Heiko Bee maxout

🎯
Focusing
View GitHub Profile
@maxout
maxout / unlink.php
Created March 19, 2014 20:21
unlink all Files and Folders in current folder
@maxout
maxout / unzip
Last active August 29, 2015 13:57
unzip file
$zip = new ZipArchive;
$res = $zip->open('sw.zip');
if ($res === TRUE) {
$zip->extractTo('./');
$zip->close();
echo 'ok';
} else {
echo 'failed';
}
@maxout
maxout / Shopware Folder Permissions
Last active June 5, 2024 08:11
Set the correct directory permissions for Shopware installation
chmod 777 config.php
chmod 777 -R cache
chmod 777 -R files
chmod 777 -R media
chmod 777 -R engine/Shopware/Plugins/Community
chmod 777 -R logs
chmod 777 -R engine/Shopware/Plugins/Default
chmod 777 -R web/cache/
chmod 777 -R recovery/
chmod 777 -R themes/Frontend
@maxout
maxout / Parse HTML-Body
Created January 16, 2014 13:49
Parse HTML-Body
<?php
$d = new DOMDocument;
$mock = new DOMDocument;
$d->loadHTML(file_get_contents('http://www.telekom-stiftung.de/dts-cms/de/mobile-newsarchiv'));
$body = $d->getElementsByTagName('body')->item(0);
foreach ($body->childNodes as $child){
$mock->appendChild($mock->importNode($child, true));
}
echo $mock->saveHTML();
@maxout
maxout / build multidimensional array from string
Last active December 28, 2015 12:59
build multidimensional array from string
$ret = array_map (
function ($_) {return explode (':', $_);},
explode (';', $data)
);
@maxout
maxout / Shopware: export and import s_user_debit Db-Table
Last active December 22, 2015 19:39
Shopware: export and import s_user_debit Db-Table
-- --------------------------------------------------------
--
-- Create View in export-DB to get data by customernumber and export it to a tmp table into the import-DB
--
-- --------------------------------------------------------
DROP VIEW IF EXISTS `v_user_debit_by_customernumber`;
CREATE VIEW `v_user_debit_by_customernumber` AS select `s_user_billingaddress`.`customernumber` AS `customernumber`,`s_user_debit`.`account` AS `account`,`s_user_debit`.`bankcode` AS `bankcode`,`s_user_debit`.`bankname` AS `bankname`,`s_user_debit`.`bankholder` AS `bankholder` from (`s_user_billingaddress` join `s_user_debit`) where (`s_user_billingaddress`.`userID` = `s_user_debit`.`userID`);
-- --------------------------------------------------------