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
<code_scheme name="Magento 2" version="173"> | |
<PHPCodeStyleSettings> | |
<option name="ALIGN_KEY_VALUE_PAIRS" value="true" /> | |
<option name="ALIGN_PHPDOC_PARAM_NAMES" value="true" /> | |
<option name="ALIGN_PHPDOC_COMMENTS" value="true" /> | |
<option name="ALIGN_ASSIGNMENTS" value="true" /> | |
<option name="PHPDOC_BLANK_LINES_AROUND_PARAMETERS" value="true" /> | |
<option name="PHPDOC_WRAP_LONG_LINES" value="true" /> | |
<option name="LOWER_CASE_BOOLEAN_CONST" value="true" /> | |
<option name="LOWER_CASE_NULL_CONST" value="true" /> |
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
#!/bin/sh | |
# Feel free to create a bash alias to this file or place it in /usr/local/bin | |
# | |
# Usage: dex php to run "bash" in interactive mode on any container that contains php in it's name | |
CONTAINER="$(docker ps -f name=$1 | sed -n 2p)" | |
CONTAINER_NAME=`echo $CONTAINER | awk '{ print $NF }'` | |
# Make sure some argument is set |
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 Myentity { | |
/* ... */ | |
/** | |
* @ORM\Column(name="created_at", type="datetime") | |
*/ | |
private $createdAt; |
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 is tested with PHP 5.3.10 (Ubuntu), 5.5.14 (OS X) 5.5.9 (Ubuntu). | |
* Instead of opendir-function you should use "DirectoryIterator" class. | |
* | |
* Save the file in /tmp/foo.php and create the following folders | |
* | |
* mkdir -p /tmp/1/2/3 | |
* touch /tmp/1/2/3/first |
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 echo $this->getLayout() | |
->createBlock('cms/block') | |
->setBlockId('my_static_block_id') | |
->toHtml(); | |
?> |
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
$url = parse_url($_SERVER['REQUEST_URI']); | |
if (isset($url['query'])) { | |
parse_str($url['query'], $params); | |
if (isset($params['session'])) { | |
$_GET['session'] = $params['session']; | |
$_REQUEST['session'] = $params['session']; | |
} | |
foreach ($params as $key => $value) { | |
$_GET[$key] = $value; | |
$_REQUEST[$key] = $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
<?php | |
/** | |
* Get translatable strings for Magento modules | |
* | |
* Tested on Mac & Linux | |
* | |
* Usage: | |
* | |
* 1. Change the $path variable to where your module is located | |
* 2. php TranslateMagentoModule.php |