|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesyaf_dispatcher_setDefault.patch (last revision 2018-04-13 11:10 UTC by fanjiapeng at 126 dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-09-15 16:28 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 23:00:02 2025 UTC |
Description: ------------ Involves three methods, Yaf_Dispatcher::setDefaultModule, Yaf_Dispatcher::setDefaultController, Yaf_Dispatcher::setDefaultAction Test script: --------------- /* Bootstrap.php */ <?php class Bootstrap extends Yaf_Bootstrap_Abstract { public function _initConfig(Yaf_Dispatcher $dispatcher) { $dispatcher->setDefaultModule("index") ->setDefaultController("admin")->setDefaultAction("login"); } } /* index.php */ <?php $config = array( "application" => array( "directory" => realpath(dirname(__FILE__)) . "/application/", "modules" => "Index,User,Admin", ), ); $app = new Yaf_Application($config); $app->bootstrap()->run(); /* /www/application/controllers/Admin.php */ <?php class AdminController extends Yaf_Controller_Abstract { public function loginAction() { echo "index::admin::login", PHP_EOL; return false; } } Expected result: ---------------- index::admin::login Actual result: -------------- index::admin::login [Fri Apr 13 19:00:40 2018] Script: '/www/index.php' /usr/local/php/php-7.2.4/Zend/zend_operators.c(2548) : Freeing 0x000000010c604028 (6 bytes), script=/www/index.php Last leak repeated 2 times [Fri Apr 13 19:00:40 2018] Script: '/www/index.php' /usr/local/php/include/php/Zend/zend_string.h(134) : Freeing 0x000000010c66fb80 (32 bytes), script=/www/index.php === Total 4 memory leaks detected ===