Thursday, 28 November 2024

How to release PHP package from github

Create tag and release the tag.

How to list and create a tag

Steps to make a release

Assume release version 2.0.1

  1. Check out the desired branch and create a tag v2.0.1 in local.
    git tag -a v2.0.1 -m "create tag message"
  2. push tag.
    git push origin V2.0.1
  3. go to github and view all tags
  4. in the row of tag v2.0.1, click three dots
  5. choose make a release, and give title v2.0.1
  6. push release
  7. Go to Packagist to confirm the release

Thursday, 21 November 2024

PHP error report

find current error report level

Use error_reporting() with no parameters. It will return the current error level.

 //get current error level
if(!defined('STDOUT')) define('STDOUT', fopen('php://stdout', 'wb'));
fwrite(STDOUT, "\nerror level:" . var_export(error_reporting(), true) . "\n");

error level:30711 (the number 30711 is the magic number for the E_ALL error code.)

Settin error level for different env

//show all errors except e_notice and e_strict. It will show deprecated error
//this can be used in sandbox or local
error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE);

//the following will not show depecated warning. This fits to production
error_reporting(E_ERROR | E_WARNING | E_PARSE);

Friday, 8 November 2024

Ethereum Blockchain Development

IDE

remix

Deploy a smart contract on Linea Sepolia testnet

  • When compile, choose EVM to be london
  • When deploy, choose envirnment to be "Injected Provider - MetaMask"
  • One deployed contract