VIM and PHP

To make VIM work more like VSCode, you really want to install VIM plugin called CoC. It adds LSP features to VIM and makes it easy to port VSCode extensions to Vim, and it has great, mature ecosystem: https://github.com/neoclide/coc.nvim To get PHP language server features, you want to install a PHP language server extension for CoC: https://github.com/marlonfan/coc-phpls This extension uses Intelephense in the background and makes it so that you can jump to definitions etc....

October 25, 2022

PHP: Curl vs file_get_contents benchmark

I benchmarked curl vs file_get_contents in getting headers only and returning the HTTP Status Code. Here are the results: kevinkivi@server:~/my/secret/directory$ php curlvsfgctest.php Testing curl speed Domain: http://google.com Status: 301 Domain: http://yahoo.com Status: 301 Domain: http://nytimes.com Status: 301 Domain: http://theguardian.com Status: 301 Domain: http://wikipedia.org Status: 301 Curl speed was 0.35739207267761 Testing file\_get\_contents speed Domain: http://google.com Status: HTTP/1.0 301 Moved Permanently Domain: http://yahoo.com Status: HTTP/1.0 301 Moved Permanently Domain: http://nytimes.com Status: HTTP/1.1 301 Moved Permanently Domain: http://theguardian....

August 13, 2018

PHP: Namecheap.com API Class

I built a simple to use class in PHP for the namecheap.com API. It supports all of Namecheap’s API methods. I released the code on GitHub. Example of usage: <?php require 'namecheap.class.php'; $username = 'YOUR USERNAME'; $apiKey = 'YOUR API KEY'; $clientIp = 'IP WHERE THIS YOUR SCRIPT IS HOSTED'; $namecheap = new Namecheap ($username, $apiKey, $clientIp) ; $data\["Command"\] = "namecheap.ssl.getList"; $returned = $namecheap->request($data); print\_r($returned) ?> GitHub release: https://github.com/nake89/namecheap

May 16, 2017