zend

Starting with Zend Tutorial - Zend_DB_Adapter throws Exception: “SQLSTATE[HY000] [2002] No such file or directory”

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i start learning Zend Framework with the Book "Zend Framework in Action" in German. Right there where it start to get interesting my PHP Unit Test throws this Error: "Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] No such file or directory" I cant find any hints at google. I did everything like in the book. Can anyone give me a hint where to search my fault? Is this a usual beginner mistake? 回答1: I would say that you have a problem connecting from PHP to MySQL... Something like PHP trying to find some socket file, and not finding it,

configure multiple databases in zf2

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How can I configure (and use) multiple databases in Zend Framework 2? Currently I have this in my global.php: return array( 'db' => array( 'driver' => 'Pdo', 'dsn' => 'mysql:dbname=my_db;host=localhost', 'driver_options' => array( PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'' ), 'username' => 'user', 'password' => '******', ), 'service_manager' => array( 'factories' => array( 'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory', ), ), ); But I do not see a way to add a second one. 回答1: If you look at the Zend\Db

Conditionally required in Zend Framework's 2 InputFilter

匿名 (未验证) 提交于 2019-12-03 02:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am making an application using Zend Framework 2. I am validating input using it's InputFilter . Is it possible, to make some Input s required conditionally? I mean I have code like that: $filter = new \Zend\InputFilter\InputFilter(); $factory = new \Zend\InputFilter\Factory(); $filter->add($factory->createInput(array( 'name' => 'type', 'required' => true ))); $filter->add($factory->createInput(array( 'name' => 'smth', 'required' => true ))); I want the field something , to be required, ONLY when type is equal 1 . Is there a built-in way to

ZF2 installation on shared hosting server

匿名 (未验证) 提交于 2019-12-03 01:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to install ZF2 on my shared hosting server. I followed these steps: Downloaded and extracted Zend Framework 2 on my computer. Created a directory on my "public_html" with the name of "zendPrj". Uploaded the "Zend" directory using Filezilla into the "zendPrj" folder. Created a "php.ini" with the following commands: include_path = ".:/usr/lib/php:/usr/local/lib/php:/home/public_html/mycpanalusername/zndPrj/Zend/library" allow_url_fopen = On allow_url_include = On and uploaded it into the "Zend" folder (which has got the

Zend Framework 2 Paginator + TableGateway

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How to use the database mapper with the paginator? I'm having a bit trouble understanding how I implement the DbSelect paginator using the code below (right now it's using the Iterator adapter which doesn't work for ResultSets). From what I can tell it's not as straight forward as I would have hoped. DbSelect is expecting a Zend\Db\Sql\Select and an adapter. The adapter is a non issue and can be retrieved with: $this->newsContents()->getAdapter() but I'm having trouble getting a Select object out from my TableGateway without duplicating my

COUNT and GROUP BY using Zend Framework 2 and tableGateway

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: In Zend Framework 2, using tableGateway, I want to run the following SQL query: SELECT categories . category_name , COUNT ( forums . forum_id ) FROM categories LEFT JOIN forums ON categories . category_id = forums . category_id GROUP BY categories . category_name ; Problem is that I simply don't know how to do it. I know how to use $select->join() for example, but I can't figure out how to also do a COUNT and GROUP BY . What I want with my SQL: I have 2 tables; categories and forums . I want to select all the categories from

Doctrine2 Update Caused AnnotationRegistry registerLoader Error in Zend Framework 3

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm working on a CMS based on Zend Framework 3.0 to manage a DB I with Doctrine. What is my problem when managing packages with composer? Recently, I updated all the packages to newest versions and sent it to server, nothing was changed in other files. After the update my site displayed the following error: Fatal error: Uncaught TypeError: Return value of Doctrine\Common\Annotations\AnnotationRegistry::registerLoader() must be an instance of Doctrine\Common\Annotations\void, none returned in /home/platne/serwer18346/vendor/doctrine

Is .zfproject.xml a must in a Zend Framework project?

匿名 (未验证) 提交于 2019-12-03 01:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Is .zfproject.xml a must in a Zend Framework project? What does it do? Is it's location absolute? 回答1: When using Zend_Tool to manage your Zend Framework project, .zfproject.xml will contain your application structure state. This is required by Zend_Tool (and only by it) to be able to work, e.g. add code to certain parts., generate things, etc. Quoting ZF Manual on Zend_Tool_Project : So, for example, if in one command you created a controller, and in the next command you wish to create an action within that controller, Zend_Tool

how to set develop environment for zend framework 1.11.11 in netbeans 7.1.1 using wamp?

匿名 (未验证) 提交于 2019-12-03 01:46:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: hey guys I need your help for setting environment for zendframe work ? I have installed my netbeans in D: drive under D:/program files/netbeans. and the zend framework is under D: drive. and my wamp package is installed under c:/wamp. now what i need is to configure these all for my development? I searched google, stackoverflow and every blog i could for the whole day. but all that I got is a error given below. '"php.exe"' is not recognized as an internal or external command, operable program or batch file. tell me how can I solve

Install multiple version of PHPUnit via composer

匿名 (未验证) 提交于 2019-12-03 01:40:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am working with ZendFramework 1.x & 2.x , unfortunately ZendFramework 1.x supports only PHPUnit 3.x & Zend Framework 2.x requires PHPUnit 4.x For this i want to install 2 versions of PHPUnit, here is the composer.json file i tried. { "repositories" : [{ "type" : "pear" , "url" : "http://pear.symfony-project.com" },{ "type" : "pear" , "url" : "http://pear.phpunit.de" }], "require-dev" : { "pear-pear.phpunit.de/PHPUnit" : "3.4.*" , "phpunit/phpunit" : "*" } } I am getting following message. Skipped installation of bin phpunit for