baidu(); // Logger::setLog("cdb@meitu.com","test2",'sentry'); die(); // var_dump(Postgres::getInstance()->count("t_article")); // $data=Postgres::getInstance()->select('t_article'); $data=Postgres::getInstance()->postgres->count('t_article'); var_dump($data); } public function baidu(){ $word=$this->getQuery()->string("q",'你好!'); $appId = "10537047"; $apiKey = "7OzniBlSCMEjEouv61Ayeu2K"; $secretKey = "adG7sz1UHrjbep4VvfTN4xrdLFjf9Aws"; $baiduAip = new AipOcr($appId, $apiKey, $secretKey); $result = $baiduAip->basicGeneral(file_get_contents('/www/xjy.png')); var_dump($result); } public function test($count){ $prev = 0; $current = 1; for ($i = 0; $i < $count; ++$i) { $next = $prev + $current; $prev = $current; $current = $next; yield $prev; } } public function xrange($start,$end,$step=1){ for ($i = $start; $i <= $end; $i += $step) { yield $i; } } }