项目作者: theimpossibleastronaut

项目描述 :
Basic SAMv3 implementation for I2P in PHP
高级语言: PHP
项目地址: git://github.com/theimpossibleastronaut/php-sam.git
创建时间: 2019-07-25T15:52:41Z
项目社区:https://github.com/theimpossibleastronaut/php-sam

开源协议:MIT License

下载


License
SourceLevel
Latest Stable Version
Latest Unstable Version
PHP Stan
PHP Composer

php-sam

Implementation for the SAMv3 bridge in PHP.

(Based on the article “So you want to write a SAM library”)

Most basic features are implemented. Go ahead and play with the examples.
It’s very basic as well. Requires PHP 7.2+.

  1. <?php
  2. require_once( "lib/php-sam.php" );
  3. $sam = new \PHP_SAM\SAM3();
  4. $sam->connect( false );
  5. $sam->commandSAM( "HELLO VERSION MIN=3.0 MAX=3.1 \n" );

You can also use composer for this.

  1. composer require theimpossibleastronaut/php-sam

And then use the autoloader:

  1. <?php
  2. require __DIR__ . '/vendor/autoload.php';
  3. $sam = new \PHP_SAM\SAM3();
  4. $sam->connect( false );
  5. $sam->commandSAM( "HELLO VERSION MIN=3.0 MAX=3.1 \n" );

In order to run the tests, enable zend.assertions in your php.ini (don’t do that in production) and run

  1. php test/assert.php