草庐IT

Zend_Rest_Client

全部标签

php - 在 PHP 脚本中加载 Zend Framework 及其应用程序

我需要在PHP脚本中找到ZendFramework及其MVC应用程序,这样我就可以做一些模型来查询数据库。框架和一些库是这样加载的(脚本是别人创建的):/**InitialiseZend*/define('BRIDGE_BASE_DIR',dirname(__FILE__));set_include_path(get_include_path().PATH_SEPARATOR.BRIDGE_BASE_DIR.'/../library');require_once('Zend/Loader/Autoloader.php');require_once'Zend/Config/Ini.php

php - 如何在 zend 框架中将错误从模型传递到 Controller

我正在使用zend框架,这是我的模型和Controller方法的骨架ModelClassmethods:_validateRegisterForm($postData){//validatingdatausingZend_Filter_Input//ReturnsinstanceofZend_Filter_Input}//Returntrue/falseprotected_isNumberAlreadyExists(){//Idntwanttoperformabovevalidationusingzend_validate_db_recordexists//sinceidntwantt

php - SugarCRM REST API,如何获取与帐户相关的联系人

我正在使用SugarCRMPro6.5.5。我正在尝试与另一个应用程序进行一些集成,因此我需要从该其他应用程序进行一些API调用。我正在使用RESTAPIv2。此时,我需要通过帐户ID获取与帐户相关的联系人。我已经尝试了get_relationships()和get_entry_list(),但我无法让它们中的任何一个工作。这是我对get_relationships()的输入:{"session":"eujfbfsfjgni98m0mivl6jm6r2","module_name":"帐户","module_id":"c03d0649-0525-2f90-1206-50881e87d7

php - fatal error : DOMDocument not found after Zend Server CE Update

我在Windows7(64位)系统上使用ZendServerCE。我正在使用ZendFramework2.0开发一个网站。在本网站中,我使用DOMDocument来分析外部网站(由URL给出)。我使用ZendFramework1.12和ZendServerCE4(PHP5.2)开始这个项目。现在我安装了ZendServerCE5.6.0(apache2.2、PHP5.3.14、ZF2-Support)。我用ZF2.0重建我的项目。一切正常...除了一个功能。当我尝试实例化DOMDocument时收到此错误消息(php-error.log):Fatalerror:Class'Applic

php - Zend Framework 2 - 注释形式 - 绑定(bind)不起作用

我正在使用AnnotationForms,并且我将教程中的标准编辑操作更改为使用Annotation而不是标准表单。除了$form->bind()没有填写值外,一切正常。表单字段保持为空。我检查了应该绑定(bind)的变量,它已设置且看起来不错。这是我的操作:$id=(int)$this->getEvent()->getRouteMatch()->getParam('id');if(!$id){return$this->redirect()->toRoute('album',array('action'=>'add'));}$album=$this->getEntityManager(

php - 这条线如何运作 : require_once ('Zend/Registry.php' );?

我在win7上安装了ZendFramework2(ZendFramework+ZendServer)。在Zend/Apache2/htdocs/hello1.php中,我将脚本放在下面:然后我运行http://localhost/hello1.php,它显示:我叫昆汀泽瓦斯我的问题是:对于这一行require_once('Zend/Registry.php');在htdocs文件夹下,它是dummy.php,favicon.ico,index.html,hello1.php,没有Zend文件夹,那么这条线是如何工作的呢? 最佳答案

php - 我可以在使用 Zend_Db_Adapter_Pdo_Mssql 时设置查询超时吗?

我们有一个PHP应用程序(托管在Linux上),它使用ZendFramework组件来查询MicrosoftSQLServer2008数据库。PHP应用程序托管在具有可靠互联网连接的数据中心,但SQLServer数据库位于VPN连接的远端,该连接经常断开。我们遇到的问题是,在对SQL服务器进行查询时,VPN偶尔会掉线。发生这种情况时,我们的应用程序最多可以等待2小时,然后最终引发以下异常:SQLSTATE[HY000]:Generalerror:20004Readfromtheserverfailed[20004](severity9)[(null)]我想做的是将整体查询超时和/或读取

php - Zend\Session\Container Session 验证失败异常 -- Object(Closure) ZF2

我正在尝试在ZF2应用程序中使用身份验证和session。到目前为止,我有以下代码:在我的Module.php中://(...)restofcodepublicfunctiongetServiceConfig(){returnarray('factories'=>array(//(...)Otherfactories//AuthenticationService'AuthService'=>function($sm){$dbAdapter=$sm->get('Zend\Db\Adapter\Adapter');$dbTableAuthAdapter=newDbTable($dbAdap

php - 如何将数据从 angular js 发布到 zend Controller ?

查看页面:Email:Password:主要.jsfunctionLoginCtrl($scope,$http){$scope.login={};$scope.submit=function(){$http({method:'POST',url:'/login',data:$scope.login,headers:{'Content-Type':'application/x-www-form-urlencoded'}}).success(function(response){window.location.href="/login";}).error(function(response

php - 如何从Google OAuth2 PHP Client获取用户国家和时区信息

我正在使用PHPGoogleAPIClientLibrary使用OAuth2从Google帐户检索用户信息。然而,尽管Google'sdocumentationstates,我似乎无法访问用户的国家/地区或时区信息,即使token已成功返回并且所有其他信息都可以从userinfo.profile范围。我使用了int继承人库提供的示例代码here如果我在该文件的第49行var_dump($user)得到以下输出(出于隐私考虑进行了编辑):array(10){["id"]=>string(21)"123"/*Redacted*/["email"]=>string(13)"XXX@gmail