-
First, you have to open your terminal ;)
-
You have to install homebrew if it's not already done :
$ brew install grep
- Once homebrew downloaded, just enter this command in a terminal :
Simply remplace YOUR EMAIL and YOUR NAME. Be carefull, this command will change all head branch commits user.
$ git filter-branch -f --env-filter " GIT_AUTHOR_NAME='YOUR NAME'GIT_AUTHOR_EMAIL='YOUR EMAIL' GIT_COMMITTER_NAME='YOUR NAME' GIT_COMMITTER_EMAIL='YOUR EMAIL' " HEAD
Then, force push $ git push -f
Assuming that you want to add my_custom_input_field to your order and add a field to your admin create order page (to add the field to the frontend you just need to add the input field to the front template and double check the observer)
In /app/code/local/MageIgniter/CustomOrderStatus/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<MageIgniter_CustomOrderStatus>
<version>1.1</version>
</MageIgniter_CustomOrderStatus>
Fatal error: Uncaught Error: Function name must be a string app\code\core\Mage\Core\Model\Layout.php:555
It happens because in PHP 7 you need to clarify that you are going to call the $callback variable as a method (function). So, the original line of the code looks like the following (file app/code/core/Mage/Core/Model/Layout.php
):
$out .= $this->getBlock($callback[0])->$callback[1]();
In order to make it work on the latest PHP version we need to replace this piece of code by this one:
$out .= $this->getBlock($callback[0])->{$callback[1]}();
<?php | |
/** @var string $path */ | |
$path = 'semaphores/'; | |
echo '<h3>Semaphores files will be created in '.$path.' folder.</h3>'; | |
echo '<h4>Creating files :</h4>'; | |
for ($second = 0; $second < 60; $second++){ | |
/** @var string $file */ | |
$file = 'test_201808240710'.$second.'.csv.ok'; | |
if ($second < 10){ | |
/** @var string $file */ |
<?php | |
/** @var string $path */ | |
$path = 'import-files/'; | |
/** @var string $file */ | |
$file = 'test.csv'; | |
/** @var string $realFile */ | |
$realFile = $path.$file; | |
function putCSVLineSeparatorToLF($file){ | |
if (!file_exists($file)){ |
/** | |
* Receives CSV string and returns as an array. | |
* Based on code by fab at tradermail dot info at http://php.net/manual/en/function.str-getcsv.php#119666 | |
* ************************************************************************* | |
* | |
* @param $csv | |
* @param $delimiter | |
* @param $header_line | |
* | |
* @return array | boolean |
<?php | |
$folder = "files/"; | |
$handle = opendir($folder); | |
# Making an array containing the files in the current directory: | |
while ($file = readdir($handle)){ | |
if( $file != ".." && $file != "." ){ | |
$key = filemtime($file); | |
$files[$key] = $file ; | |
} |
DELETE FROM myTable | |
WHERE (col1, col2, col2, col3) | |
IN ( | |
SELECT * FROM ( | |
SELECT col1, col2, col2, col3 | |
FROM myTable | |
GROUP BY col1, col2, col2, col3 | |
HAVING count(*) > 1 | |
) AS T | |
-- remove this where condition if you want to delete all duplicate rows |