JFactory::getStream() and JVersion #1540

Closed
johnathanhair opened this Issue Sep 20, 2012 · 2 comments

Comments

Projects
None yet
4 participants

I believe I found an issie with JFactory::getStream() where it tries to use class JVersion. This is my first issue post. Please let me know how I can post issues better.

Version 12.1
File: factory.php
Line: 726

---- Current Code ---
726 $version = new JVersion;

728 // Set the UA for HTTP and overwrite for FTP
729 $context['http']['user_agent'] = $version->getUserAgent($ua, $uamask);

--- Proposed Code ---
726 // Set the UA for HTTP and overwrite for FTP
727 $context['http']['user_agent'] = someMethod($ua, $uamask);

function someMethod( $ua, $uamask )
{
// do something similar to
http://docs.joomla.org/API16:JVersion/getUserAgent
}

--- Other Notes ---

You can call new JStream() directly to get around but you have to define your own context

Member

realityking commented Sep 20, 2012

It's an issue alright.

That said, maybe we should define an interface for JVersion and allow injecting it. That way the platform can pick up the name and version number of the application where necessary.

Contributor

elinw commented Oct 26, 2012

@johnathanhair Would you want to go ahead and send a pull request for this?

eddieajau closed this Apr 5, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment