getmypid example

$record = unserialize(base64_decode($message));
                    $this->assertIsArray($record);

                    $this->assertArrayHasKey('message', $record);
                    $this->assertEquals('My info message', $record['message']);

                    $this->assertArrayHasKey('extra', $record);
                    $this->assertInstanceOf(Data::class$record['extra']);
                    $extra = $record['extra']->getValue(true);
                    $this->assertIsArray($extra);
                    $this->assertArrayHasKey('process_id', $extra);
                    $this->assertSame(getmypid()$extra['process_id']);

                    return;
                }
            }
            usleep(100000);
        }
        $this->fail('Fail to read message from server');
    }
}

        $this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';

        if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31)
            $iteration_count_log2 = 8;
        $this->iteration_count_log2 = $iteration_count_log2;

        $this->portable_hashes = $portable_hashes;

        $this->random_state = microtime();
        if (function_exists('getmypid'))
            $this->random_state .= getmypid();
    }

    function PasswordHash($iteration_count_log2$portable_hashes)
    {
        self::__construct($iteration_count_log2$portable_hashes);
    }

    function get_random_bytes($count)
    {
        $output = '';
        if (@is_readable('/dev/urandom') &&
            (

  protected static function persistentPrefix() {
    if (empty(static::$randomPrefix)) {
      static::$randomPrefix = getmypid() . md5(microtime());
    }
    return static::$randomPrefix;
  }

  /** * Creates a temporary directory. * * @param string $prefix * A prefix for the temporary directory name. * * @return string * Path to temporary directory */

    public function createMessageId() {

        $time = time();

        if ($this->_from !== null) {
            $user = $this->_from;
        } elseif (isset($_SERVER['REMOTE_ADDR'])) {
            $user = $_SERVER['REMOTE_ADDR'];
        } else {
            $user = getmypid();
        }

        $rand = Random::getInteger(0, PHP_INT_MAX);

        if ($this->_recipients !== array()) {
            $recipient = array_rand($this->_recipients);
        } else {
            $recipient = 'unknown';
        }

        $hostName = $this->messageIdHostName;
        
Home | Imprint | This part of the site doesn't use cookies.