大冰 2023-12-28 11:08:46

    服务器时间转北京时间
    datetime getBeiJingTime(datetime date)
    {
    MqlDateTime mql;
    TimeToStruct(date,mql);
    TimeGMT(mql);
    mql.hour =mql.hour + 8;
    return StructToTime(mql);
    }

    大冰 2020-04-20 10:53:37

    生产环境
    composer dump-autoload -o --no-dev --classmap-authoritative

    大冰 2019-10-27 15:10:55

    mysql 字母数字混合排序 LPAD(filename,10,'0')

    大冰 2019-09-24 18:17:53

    https://github.com/composer/installers

    大冰 2019-09-24 10:32:19

    快速删除vue目录里的node_modules
    cnpm install rimraf -g
    rimraf node_modules

    大冰 2019-09-18 15:32:22

    大冰 2019-09-16 11:32:12

    nohup XXX >> output.log 2>&1 &

    大冰 2019-09-11 17:03:13

    php 根据文件路径获取命名空间
    /**
    * get full qualified class name
    *
    * @param string $path_to_file
    * @return string
    * @author JBYRNE http://jarretbyrne.com/2015/06/197/
    */
    protected function get_class_from_file($path_to_file)
    {
    //Grab the contents of the file
    $contents = file_get_contents($path_to_file);

    //Start with a blank namespace and class
    $namespace = $class = "";

    //Set helper values to know that we have found the namespace/class token and need to collect the string values after them
    $getting_namespace = $getting_class = false;

    //Go through each token and evaluate it as necessary
    foreach (token_get_all($contents) as $token) {

    //If this token is the namespace declaring, then flag that the next tokens will be the namespace name
    if (is_array($token) && $token[0] == T_NAMESPACE) {
    $getting_namespace = true;
    }

    //If this token is the class declaring, then flag that the next tokens will be the class name
    if (is_array($token) && $token[0] == T_CLASS) {
    $getting_class = true;
    }

    //While we're grabbing the namespace name...
    if ($getting_namespace === true) {

    //If the token is a string or the namespace separator...
    if (is_array($token) && in_array($token[0], [T_STRING, T_NS_SEPARATOR])) {

    //Append the token's value to the name of the namespace
    $namespace .= $token[1];
    } elseif ($token === ';') {

    //If the token is the semicolon, then we're done with the namespace declaration
    $getting_namespace = false;
    }
    }

    //While we're grabbing the class name...
    if ($getting_class === true) {

    //If the token is a string, it's the name of the class
    if (is_array($token) && $token[0] == T_STRING) {

    //Store the token's value as the class name
    $class = $token[1];

    //Got what we need, stope here
    break;
    }
    }
    }

    //Build the fully-qualified class name and return it
    return $namespace ? $namespace . '\\' . $class : $class;
    }

    大冰 2019-09-06 17:18:11

    workerman文档:http://doc.workerman.net/

    大冰 2019-09-06 15:51:11

    php涉及金额相关的加减乘除,强烈建议使用高精度计算函数

联系方式

关于我

  • 来自中原的一个小城市,个性不张扬,讨厌随波逐流。