This file contains hidden or 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 | |
| namespace App\Http\Controllers; | |
| use App\Services\YClientsService; | |
| use Illuminate\Http\JsonResponse; | |
| use Illuminate\Http\Request; | |
| use Illuminate\Support\Facades\Log; | |
| use Throwable; |
This file contains hidden or 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 | |
| if(defined('WP_CRON_CUSTOM_HTTP_BASIC_USERNAME') && defined('WP_CRON_CUSTOM_HTTP_BASIC_PASSWORD')) { | |
| function http_basic_cron_request($cron_request) { | |
| $headers = array('Authorization' => sprintf('Basic %s', base64_encode(WP_CRON_CUSTOM_HTTP_BASIC_USERNAME . ':' . WP_CRON_CUSTOM_HTTP_BASIC_PASSWORD))); | |
| $cron_request['args']['headers'] = isset($cron_request['args']['headers']) ? array_merge($cron_request['args']['headers'], $headers) : $headers; | |
| return $cron_request; | |
| } |
This file contains hidden or 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 | |
| add_action( 'init', function() { | |
| ini_set( 'memory_limit', '2048M' ); | |
| set_time_limit( 0 ); | |
| $posts = get_posts( [ | |
| 'post_type' => 'product', | |
| 'posts_per_page' => -1 | |
| ] ); | |
| $count = 0; |
This file contains hidden or 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
| function dump($var) { | |
| ob_start(); | |
| var_dump($var); | |
| $output = ob_get_clean(); | |
| echo preg_replace("/=>(\s+)/m", ' => ', $output); | |
| } |