First, Lets find out what version of PHP we're running (To find out if it's the default version).
To do that, Within the terminal, Fire this command:
which php
if (isset($_SERVER['REMOTE_ADDR'])) { | |
if ($_SERVER['REMOTE_ADDR'] == '1.1.1.1') { // Your IP-addrese | |
header('HTTP/1.1 503 Service Temporarily Unavailable'); | |
header('Status: 503 Service Temporarily Unavailable'); | |
header('Retry-After: 300'); //300 seconds | |
exit; | |
} | |
} |
# /etc/nginx/sites-enabled/magento | |
server { | |
listen 80; | |
server_name ec2-184-72-68-219.compute-1.amazonaws.com; | |
root /var/www/magento/; | |
access_log /var/log/nginx/magento-access_log; | |
error_log /var/log/nginx/magento-error_log; | |
location / { |
<?php | |
/** | |
* Replace img tag with amp-img | |
* | |
* <amp-img src="[src]" | |
* width="[width]" | |
* height="[height]" | |
* layout="responsive" | |
* alt="[alt]"> | |
* </amp-img> |
rffr | |
<?php if(!Mage::getSingleton('customer/session')->isLoggedIn()): | |
$groupPrice = $_product->getData('group_price'); | |
if($groupPrice && is_array($groupPrice) && isset($groupPrice[1]) && isset($groupPrice[1]['price'])): | |
if($_product->getData('final_price') > floatval($groupPrice[1]['price'])): ?> | |
<div class="price-block-for-nonclient"> | |
<span class="client-price"> |
#!/bin/sh | |
# | |
# Install Varnish via Homebrew | |
# | |
# You need to add /usr/local/sbin in your PATH | |
# vcl files are in /usr/local/etc/varnish | |
# | |
# Usage : |
<?php | |
namespace Vendor\ModuleName\Controller\Adminhtml\Export; | |
use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection; | |
use Magento\Backend\App\Action\Context; | |
use Magento\Ui\Component\MassAction\Filter; | |
use Magento\Sales\Model\ResourceModel\Order\CollectionFactory; | |
Open a terminal and type php -v
to see the current version of php.
Determine the path for the wanted php version of mamp (YOUR VERSION ON YOUR COMPUTER!)
Type in the terminal cd ~
to change the current directory (in your home)
<pre> | |
<?php | |
$ids = '900035163, 900024565, 900033949, 900030745, 900027462, 900048395, 900023229, 900027885'; | |
$ids = explode(',',$ids); | |
$idsArray = array(); | |
foreach ($ids as $id) { | |
$idsArray[trim($id)] = trim($id); | |
} |
<!DOCTYPE html> | |
<html> | |
<head><meta charset="utf-8"></head> | |
<body> | |
<?php | |
use Magento\Framework\App\Bootstrap; | |
require __DIR__ . './../app/bootstrap.php'; | |
$params = $_SERVER; |