View magento2.xml
<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" /> |
View dex.sh
#!/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 |
View gist:c5b6511e93d663c137ab
<?php | |
class Myentity { | |
/* ... */ | |
/** | |
* @ORM\Column(name="created_at", type="datetime") | |
*/ | |
private $createdAt; |
View foo.php
<?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 |
View gist:6997630
<?php echo $this->getLayout() | |
->createBlock('cms/block') | |
->setBlockId('my_static_block_id') | |
->toHtml(); | |
?> |
View gist:1616491
$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; |
View TranslateMagentoModule.php
<?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 |