The structure of my project is a: (I have multi-modular application)
app/ -----app/ -----------site/Module.php -----------site/controllers/IndexController.php -----------site/models/ -----------site/views/ common/ -----------common/ ----------------------library/myClass.php ----------------------library/myClass1.php ----------------------library/myClass2.php public/*
in the controller "IndexController.php" I use the library "myClass.php":
IndexController.php
namespace Phcms\Site\Controllers; use Phs\Common\Library\myClass;
$r = new myClass(); $r-> .... myClass func
further in the library such a simple code:
myClass.php
namespace Phcms\Common\Library;
class myClass extends \Phalcon\Mvc\Controller {
//and there is an entry in the log $logger = new \Phalcon\Logger\Adapter\File( $_SERVER['DOCUMENT_ROOT'] . '/log.log'); $logger->log( date("d.m.Y") );
}
1 for the launch of the class IndexController.php, the log records the two dates. I think I have something wrong, or the way it should be? The method which keeps a log is called only one time, it's 100 percent.