test.php 972 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace loyalsoft;
  3. include __DIR__ . '/main.php';
  4. //require_once ROOTDIR . '/Util/OpenSSLVerify.php'; # Ps. 这个文件和类名没有对应关系.
  5. //header('X-Accel-Buffering: no'); # nginx 控制头, 关闭buffer
  6. //set_time_limit(15); # 设置执行超时时间
  7. echoLine("phpver:" . PHP_VERSION);
  8. class ABC extends HashSaver {
  9. public $name;
  10. public $age = 35;
  11. public function __construct($args) {
  12. parent::__construct($args);
  13. // $this->LoadFrom(array('name' => "wanggangzero"));
  14. $url = "http://115.159.121.129/SweepAllTower/CDN/hi.txt";
  15. $newVer = HttpUtil::makeRequest($url, array(), array(), array(), "get"); # 取CDN上版本列表
  16. $this->name = $newVer;
  17. }
  18. }
  19. $arr = array(
  20. 'name' => '王刚'
  21. );
  22. $obj = new ABC($arr);
  23. var_dump($obj);
  24. $obj->updateData("test-hash");