zend-framework

ZendFatal error: Class 'Zend\\Ldap\\Ldap' not found

爷,独闯天下 提交于 2019-12-08 19:26:28
So, i'm trying to make a Ldap authentication, following the docs in https://zf2.readthedocs.org/en/latest/user-guide/skeleton-application.html I just replace the 'Album' module with a 'Auth' module and use the sample code for Ldap autentication https://zf2.readthedocs.org/en/latest/modules/zend.authentication.adapter.ldap.html but i'm getting this error where Zend can't find the Ldap class when i submit the form with the login data. Fatal error: Class 'Zend\Ldap\Ldap' not found in C:\wamp\www\sade\vendor\zendframework\zend-authentication\src\Adapter\Ldap.php on line 139 I'm using composer, for

Zend / Apache2: Getting 302 Found when requesting url several times

谁说胖子不能爱 提交于 2019-12-08 19:21:27
问题 I am programming a REST API with Zend framework . When calling the url several times (e.g. 1000 times with 1 request per second), in about 0.2 % of the cases instead of getting 200 OK as a response I get 302 Found - so a redirect to a different page. Here is the entire server response: 302 Found Date: Mon, 04 Mar 2013 11:56:04 GMT Server: Apache/2.2.17 (Ubuntu) X-Powered-By: PHP/5.3.5-1ubuntu7.11 Set-Cookie: PHPSESSID=ui9r8jqa63dbom8osknso6eea5; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT

AuthSub target path prefix does not match the provided “next” URL

*爱你&永不变心* 提交于 2019-12-08 19:15:43
问题 I am trying to use the Gcal API in PHP. I am using the ZEND framework function getAuthSubUrl($company) { $next = "http://$company.mysite.com"; $scope = 'http://www.google.com/calendar/feeds/'; $secure = false; $session = true; return (Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session)); } $authSubUrl = getAuthSubUrl(); echo "<a href=\"$authSubUrl\">login to your Google account"</a> I am not sure what I am doing wrong here. I am following the google example almost exactly

zend framework can't find Model classes?

≯℡__Kan透↙ 提交于 2019-12-08 17:21:10
问题 Yall: I have a simple question, it might be a simple configuration issue, but I have a Model defined, and when I try to access it from a controller it fails. The Model is in the model directory, and when I look at the quickstart app, it seems like this should work. Here is my model: <?php class Application_Model_User { protected $_user; protected $_password; protected $_userId; // very simple right } ?> My controller just stops.. here is the controller code: <?php class UserController extends

Zend Form Rendering and Decorators (Use correctly with bootstrap)

荒凉一梦 提交于 2019-12-08 16:27:33
The Bootstrap Example Code http://getbootstrap.com/css/#forms Copying a simple email input element from getbootstrap.com suggests we format the HTML in the following way: <div class="form-group"> <label for="exampleInputEmail1">Email address</label> <input id="exampleInputEmail1" class="form-control" type="email" placeholder="Email"> </div> Above we have a <label> tag that closes straight after it's text content, "Email address". I would now like to create the same form group using Zend Framework. module/MyApp/src/MyModule/Form/MyForm.php namespace MyModule\Form; use Zend\Form\Form; class

What should resources be in an ACL? Models of objects or the instances of the objects?

*爱你&永不变心* 提交于 2019-12-08 14:28:22
问题 Please help me implement access control lists for my PHP web application. I'm using Zend_ACL specifically. I want fine grained, application wide control over what specific entity (be it a user or group) has access to what resource. I would like to be able to grant access to a particular resource instance, but also to all resources of that type. For example: User #1 has editing privileges on all posts User #2 is a guest editor and has edit privileges on post ID #5 Group #1 (guest) has read

Query regarding subdomain redirection in Zend Framework

浪尽此生 提交于 2019-12-08 13:26:33
I was looking for an approach using Zend Framework - similar to sites like bit.ly and tinyurl - where I can take a request to a subdomain and store the subdomain in a variable. For instance, a request to localhost/abcdef will return $s = abcdef. I'm not sure how to accomplish this in ZF, where a request to localhost/abcdef will return the init() of the abcdef controller. Thanks for all the help! Just use a regex route. $routeitem = new Zend_Controller_Router_Route_Regex('(.*)', array(1 => '', 'controller' => 'redir', 'action' => 'view'), array(1 => 'hash'), '%s' ); You can then get your "hash"

Zend_Form - multiple forms on same page

こ雲淡風輕ζ 提交于 2019-12-08 12:41:32
Having multiple forms in one page, when i submit one of them, how can i tell wich one was submitted? I thought about generating uniqe ids for each from, and saving them as hidden fields and to the user-session - while this is a solution, the problem with it is that there is no good place to remove old ids from the session. Any better ideas how to solve this problem? Thanks in advance! First of all: have you considered sending the two forms to two different actions? That way you can handle each form separately in an action each. This should be the "best-pratice" if you're using the Zend MVC

Zend Framework and SQL Server

丶灬走出姿态 提交于 2019-12-08 12:28:55
问题 I'm trying to use Zend Framework with SQL server 2005 express (through Pdo_Mssql with wamp installation) but seem that pdo can't connect to SQL. This is my code: require '../application/bootstrap.php'; try { $db = Zend_Db::factory('Pdo_Mssql', array( 'host' => 'localhost', 'username' => 'sa', 'password' => 'verystrongpass', 'dbname' => 'msdb' )); $db->getConnection(); } catch (Zend_Db_Adapter_Exception $e) { $e->getMessage(); } catch (Zend_Exception $e) { $e->getMessage(); } $sql = 'SELECT *

doctrine 2, unable to insert to database when relation is present

本秂侑毒 提交于 2019-12-08 11:54:18
问题 I have two entites: 1) Service /** * @Id @Column(name="id", type="integer") * @GeneratedValue */ private $id; /** @Column(length=255) */ private $name; /** @Column(length=255) */ private $description; /** @Column(type="integer") */ private $parent; /** * @OneToMany(targetEntity="Lead", mappedBy="service",cascade={"persist"}) **/ protected $leads; 2) Lead /** * @Id @Column(name="id", type="integer") * @GeneratedValue */ private $id; /** @Column(type="integer") */ private $user_id; /** @Column