Yii Framework Forum: ECurrencyHelper - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

ECurrencyHelper Currency Conversion Class based on the European Central Bank daily rat Rate Topic: -----

#1 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 12 September 2011 - 10:20 AM

Just submitted a new extension to the repository. The extension works with the European Central Bank daily feed rates. Should be the most accurate as it is coming from an official institution and most importantly: is free.

Please, use this topic to improve/report/suggest on this extension.

Cheers

PS: To download the extension go to :http://www.yiiframew...currencyhelper/
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#2 User is offline   Ruganin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 04-September 11

Posted 02 December 2011 - 08:16 PM

In many hosting shows error - "CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set"
For extansion thanks in handy.
0

#3 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 02 December 2011 - 08:30 PM

View PostRuganin, on 02 December 2011 - 08:16 PM, said:

In many hosting shows error - "CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set"
For extansion thanks in handy.


Thanks for the tip, I think that by removing that option will be ok... Will update asap.

Cheers
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#4 User is offline   Ruganin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 04-September 11

Posted 13 December 2011 - 07:33 PM

Recently http://www.ecb.europ...fxref-daily.xml often not available. Under this extension gives a fatal error (Fatal error: Call to a member function convert() on a non-object in), apparently there is no check on the availability of data.
0

#5 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 13 December 2011 - 08:01 PM

View PostRuganin, on 13 December 2011 - 07:33 PM, said:

Recently http://www.ecb.europ...fxref-daily.xml often not available. Under this extension gives a fatal error (Fatal error: Call to a member function convert() on a non-object in), apparently there is no check on the availability of data.


There is none as it is the European Central Bank Data... would do the check on availability...

Thanks again Ruganin, will update asap...
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#6 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 13 December 2011 - 08:05 PM

View PostRuganin, on 13 December 2011 - 07:33 PM, said:

Recently http://www.ecb.europ...fxref-daily.xml often not available. Under this extension gives a fatal error (Fatal error: Call to a member function convert() on a non-object in), apparently there is no check on the availability of data.


mmm.... that error, Call to a member function convert() on a non-object... doesn't mean there was the wrong data but that you use an object that is not set and then call a function name convert(). Don't you think is weird?
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#7 User is offline   Ruganin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 04-September 11

Posted 13 December 2011 - 09:19 PM

Hmm, I'm new to php, probably made ​​a mistake.
my code

Config main
'ecur'=>array(
            'class'=>'application.extensions.eCurrency.ECurrencyHelper'
        ),


Extensions
class ECurrencyHelper extends CWidget
{
//...


Widget
class CurrencyWidget extends CWidget {
	public function run() {	   
	$usd = round(Yii::app()->ecur->convert('CZK','USD',1000),3);
        $eur = round(Yii::app()->ecur->convert('CZK','EUR',1000),3);
        $rub = round(Yii::app()->ecur->convert('CZK','RUB',1000),1);
        		
		$this->render('currencyWidget',array('usd'=>$usd, 'eur'=>$eur, 'rub'=>$rub));
  }
}


layouts
$this->widget('application.components.CurrencyWidget');


views
 echo $usd;
//...


The error appears when unavailable url BCE.
Or when problems in the channel hosting.
0

#8 User is offline   Ruganin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 04-September 11

Posted 14 December 2011 - 10:33 AM

It seems have found why appeared (Fatal error: Call to a member function convert () on a non-object in).
The site on which the error occurred, the extension is specified:

class ECurrencyHelper extends CApplicationComponent
{
//...


When correcting for (extends CWidget) problem has been resolved.
Forgot to update the file after creating a widget.

I apologize for the inconvenience, and not the correct information.
0

#9 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 17 December 2011 - 01:53 PM

View PostRuganin, on 02 December 2011 - 08:16 PM, said:

In many hosting shows error - "CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set"
For extansion thanks in handy.


I have corrected this issue, new version allows CURLOPT_FOLLOWLOCATION for open_basedir off and has a workaround when this restriction is set.

Cheers
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#10 User is offline   Ruganin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 04-September 11

Posted 18 December 2011 - 04:38 AM

Fatal error: Call to undefined function init_get() in ...\ECurrencyHelper.php on line 424

What's the problem? How to decide?
0

#11 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 18 December 2011 - 05:01 AM

View PostRuganin, on 18 December 2011 - 04:38 AM, said:

Fatal error: Call to undefined function init_get() in ...\ECurrencyHelper.php on line 424

What's the problem? How to decide?

Ohh man, what a silly mistype error!!! just change it to ini_get !!!!
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#12 User is offline   Ruganin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 04-September 11

Posted 18 December 2011 - 05:20 AM

View PostAntonio Ramirez, on 18 December 2011 - 05:01 AM, said:

Ohh man, what a silly mistype error!!! just change it to ini_get !!!!

Hmm, that's a line from the downloaded new Extensions 1.0.2 of 16 December
if (init_get('open_basedir') == '' && ini_get('safe_mode') == 'Off')


Redownload of December 18, there is this bug is already fixed, it works.
0

#13 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 19 December 2011 - 07:16 AM

View PostRuganin, on 18 December 2011 - 05:20 AM, said:

Hmm, that's a line from the downloaded new Extensions 1.0.2 of 16 December
if (init_get('open_basedir') == '' && ini_get('safe_mode') == 'Off')


Redownload of December 18, there is this bug is already fixed, it works.


Great man... thanks for your feedback!
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#14 User is offline   Cheesy 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 22-May 12

Posted 07 August 2012 - 06:29 AM

hey! im very new at yii!! i need help to install this extension!! im lost!!
thanks
0

#15 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 12 August 2012 - 12:13 AM

View PostCheesy, on 07 August 2012 - 06:29 AM, said:

hey! im very new at yii!! i need help to install this extension!! im lost!!
thanks

Isnt it clear at its wiki? http://www.yiiframew...currencyhelper/

Just drop it on your extensions folder and you are ready to go, you just need to import it before use.
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users