Carbon & Moment.js

    //  check if expired
    Carbon::parse($createdAt)->addSeconds($this->expires)->isPast();


    // diff in seconds
    $then = Carbon::now()->addMinute();
    $now = Carbon::now();

    $then->diffInSeconds($now, false) // -60
    $now->diffInSeconds($then, false) // 60

// parse string let will_end = '2019-02-01 10:00:00'; let then = moment(new Date(will_end)); // diff in seconds let then = moment().add(1, 'minute'); let now = moment(); then.diff(now, 'seconds'); // 60 now.diff(then, 'seconds'); // -60

@blog #php #js

xdebug

sudo subl /etc/php/7.1/cli/php.ini
sudo subl /etc/php/7.1/fpm/php.ini


[Xdebug]
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_handler="dbgp"
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.idekey="PHPSTORM"
xdebug.overload_var_dump=off

@blog #php

Install Xdebug for PHP Ubuntu

Prepare to install:

apt install php7.0-xdebug
php --version

Find xdebug path (latest by year):

find / -name 'xdebug.so' 2> /dev/null

Config update vi /etc/php/7.0/fpm/php.ini:

zend_extension="/usr/lib/php/20160303/xdebug.so"
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_handler="dbgp"
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.overload_var_dump=off
xdebug.idekey = PHPSTORM
xdebug.max_nesting_level = 512
xdebug.file_link_format = phpstorm://open?%f:%l

Then restart:

service php7.0-fpm restart

php #debug @blog

Projects

Tags

Capsule Servers

Lost connection to server.