Posts

Showing posts from March, 2014

php develop tools super tools–zip web

  1.What     This super zip web tool is made by pkrss.com     It is writed by php,need rewrite module,and can worked in apache and iis. 2.Introduction     domain: http://api.pkrss.com (base dir is /demo/zipweb/)     filelist:             wwwroot\                       index.html                     zip.php                     zip\                        a.zip                   ...

zend framework 2 develop error log for phpcloud – 2 .htaccess

  1.today i upload one application to zend 2 free php cloud. after my previous fixed module name case sensitive problem. then i continute access the phpcloud website ,it output bellow message: [Tue Mar 11 01:17:09 2014] [error] [client 172.17.255.254] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.   and by my google search, i fixed it in public/.htaccess. old .htaccess file content: RewriteEngine On # The following rule tells Apache that if the requested filename # exists, simply serve it. RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] # The following rewrites all other queries to index.php. The # condition ensures that if you are using Apache aliases to do # mass virtual hosting, the base path will be prepended to # allow...

zend framework 2 develop error log for phpcloud

1.today i upload one application to zend 2 free php cloud. all is upload ok.and access the url,it is blank.and i see error in phpcloud –> application –> Overview –> Logs,in left function panel tree,i clicked error.and there is no error. then i clicked php,it output bellow message: [10-Mar-2014 01:53:08 GMT] PHP Fatal error: Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException' with message 'Module (local) could not be initialized.' in /usr/local/zend/var/libraries/Zend_Framework_2/2.2.2/library/Zend/ModuleManager/ModuleManager.php:175 Stack trace: #0 /usr/local/zend/var/libraries/Zend_Framework_2/2.2.2/library/Zend/ModuleManager/ModuleManager.php(149): Zend\ModuleManager\ModuleManager->loadModuleByName(Object(Zend\ModuleManager\ModuleEvent)) #1 /usr/local/zend/var/libraries/Zend_Framework_2/2.2.2/library/Zend/ModuleManager/ModuleManager.php(90): Zend\ModuleManager\ModuleManager->loadModule( 'local' ) #2 [ internal function]: Ze...

zend framework 2 develop log 4 – multi language i18n translate

1.plan 1.1 why write this blog because i want to share my experience  for your. 1.2 what purpose my zend framework 2 index will detect user browser language,and intelligent redirect to other uri ex: xxx/controller/action/uilang/data locale id/other params. 2. do 2.1 designer draft a. the detect user browser is implement in project/Application/view/application/index/index.phtml view file.it will used user browser header value $uilang = $_SERVER["HTTP_ACCEPT_LANGUAGE"].then give my mysql locale table,select localeid from localetable where locale=$uilang.and redirect to default target url. b.default target url page will parse uilang and localeid param,when process data or redirect other uri,can used these value. c.look up zend framework 2 route mechanism,and finished these step. 2.2 code project/module/Application/src/Application/Controller/IndexController.php file source: <?php namespace Application\Controller; use Zend\Mvc\Controller\AbstractActionController; us...

zend2 framework develop log 3– redirect router or url

  1. what i want to redirect url in zend framework 2,and after my search,i found bellow method: way 1 return $ this ->redirect()->toUrl( 'YOUR_URL' ); way 2 return $ this ->redirect()->toRoute( 'ModuleName' , array( 'controller' =>$controllerName, 'action' => $actionName, 'params' =>$ params )); way 3 return $ this ->redirect()->toRoute( 'dns-search' , array( 'companyid' => $ this -> params ()->fromRoute( 'companyid' ) )); Where dns-search is the route I want to redirect to and companyid are the url params. In the end the URL becomes /dns/search/1 (for example) way 4 header( "Location: " . "other url" ); exit(); 2. error i get bellow error message: An error occurred An error occurred during execution; please try again later. Additional information: Zend\ServiceManager\Exception\ServiceNotFoundException File: D:\work\zend2\.metadata\.p...

zend2 framework develop log 2– render many partial layout

1.introduction i want to dynamic use js and css file in layout.layout. My origin method is design(bellow way-2,but way-1 is easy and useful): there are two layout files: Application\view\layout\:                                         layout.layout                                         rank.layout and my view want to render rank.layout,and rank.layout will partial layout.layout. 3.code 3.1 way 1 – view –> call layout module/Application/view/application/rank/index.phtml: <?php $baseResPath = $ this ->basePath(); $ this ->headLink() ->appendStylesheet($baseResPath . '/css/bo...