opcvm360 / sdk-symfony2
OPCVM360 API的Symfony2 Bundle - https://github.com/OPCVM360/sdk-php的封装
此包的官方仓库似乎已不存在,因此该包已被冻结。
dev-master
2014-02-17 14:01 UTC
Requires
- php: >=5.2.1
- opcvm360/sdk-php: dev-master
- symfony/framework-bundle: >=2.2
This package is not auto-updated.
Last update: 2019-12-13 14:30:47 UTC
README
#Symfony2 OPCVM360 包装包
关于
这只是一个官方SDK的包装器。
安装
将以下内容添加到您的composer.json
文件中
"require": { "OPCVM360/sdk-symfony2": "dev-master", }
将此包添加到app/AppKernel.php
$bundles = array( // ... other bundles new OPCVM360\WrapperBundle\OPCVM360WrapperBundle(), );
配置
将以下内容添加到您的config.yml
opcvm360: #(Required) Your Login from http://www.opcvm360.com login: 'My_OPCVM360_Login' #(Required) Your Password from http://www.opcvm360.com password: 'My_OPCVM360_Password' #(Optional, default: 'http://services.opcvm360.com/api-v1/') OPCVM360 base url base_url: 'http://services.opcvm360.com/api-v1/'
用法
在控制器内部
class TelephoneController extends Controller { public function callAction($me, $maybee) { //returns an instance of OPCVM360\WrapperBundle\Service\OPCVM360Wrapper $opcvm360 = $this->get('opcvm360.api'); //inputs $isin="LU0068578508"; //FIRST EAGLE AMUNDI INTERNATIONAL $HistoryFrom="2013-01-01"; //from jan 1st 2013 $HistoryTo=Null; //till now //retrieve the fundShare by its ISIN $fundShare = $opcvm360->getFundShareByIsin($isin); //retrieve history of that fundShare, for the specified range of dates //the $fundShareHistory object act as an iterator $fundShareHistory = $fundShare->getHistoryRange($HistoryFrom,$HistoryTo); .... } }
在控制台命令内部
class SomeCommand extends ContainerAwareCommand { protected function configure() { $this ->setName('some:comand') ->setDescription('A command') ; } protected function execute(InputInterface $input, OutputInterface $output) { //returns an instance of OPCVM360\WrapperBundle\Service\OPCVM360Wrapper $opcvm360 = $this->getContainer()->get('opcvm360.api'); ..... } }
版权 / 许可证
请参阅LICENSE