PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon Aug 20, 2018 2:15 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Thu Mar 19, 2015 7:10 pm 
Offline
Forum Contributor
User avatar

Joined: Tue Oct 03, 2006 2:25 pm
Posts: 385
Location: 127.0.0.1
I have tried several ways to acheive this and each time I receive the error
Quote:
Fatal error: Uncaught exception 'Zend\View\Exception\RuntimeException' with message 'No base path provided' in \vendor\zendframework\zendframework\library\Zend\View\Helper\BasePath.php on line 38


First I tried:

Syntax: [ Download ] [ Hide ]
    'service_manager' => array(
        'invokables' => array(
            'request' => 'Application\Http\Request',
        ),
    ),
 


That told me I could not override the class. So I tried this:

Syntax: [ Download ] [ Hide ]
    public function onBootstrap(MvcEvent $e)
    {
        $serviceManager        = $e->getApplication()->getServiceManager();
        $serviceManager->setAllowOverride(true)
            ->setInvokableClass('request', 'Application\Http\Request')
            ->setAllowOverride(false);
    }
 


The whole reason I'm doing this is because I have the need for "per-instance variables", variables that only last for that single HTTP GET execution. Essentially, I wish to have an access log built into my system but I do not wish for it to log EVERY AJAX query yet I do need SOME AJAX queries logged. For instance, I don't want calls to AjaxController\getCompanyListingAction() to be logged but I would like AjaxController\createNewCompanyAction() to be logged.

Would anyone please be kind enough to point me in the right direction? :D

I have already extended Zend\Http\Request with "getInstanceParam()" and "setInstanceParam()" functions and just wish to plug-it-in but I am open to alternative options.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group