Skip to content

Instantly share code, notes, and snippets.

View rintoug's full-sized avatar

Rinto George rintoug

View GitHub Profile
@rintoug
rintoug / facebook.php
Last active March 23, 2017 13:04
Gettting facebook events in php and curl
$access_token = '398021147245479|1e3e221bc154a0fdbbf5372d80a35318';
$graph_url= "https://graph.facebook.com/TheToyStore.ME/events";
$post_datta = "access_token=" .$access_token."&method=get&fields=cover,description,name";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $graph_url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_datta);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
@ananth-iyer
ananth-iyer / CsrfValidatorSkip.php
Last active October 30, 2023 10:33
Magento 2.3.0: Implement below code to skip the CSRF check on your custom route called outside Magento environment. This implementation does not break core frontend/adminhtml routes, Magento 2.3/2.2/2.1 web stores.
<?php
namespace Vendor\Module\Plugin;
class CsrfValidatorSkip
{
/**
* @param \Magento\Framework\App\Request\CsrfValidator $subject
* @param \Closure $proceed
* @param \Magento\Framework\App\RequestInterface $request
* @param \Magento\Framework\App\ActionInterface $action