Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Solving issue #3077 #3203

Merged
merged 5 commits into from

3 participants

@pawzar

No description provided.

pzaremba added some commits
@pawzar pawzar referenced this pull request
Closed

Override CLocale class. #3077

@samdark samdark added this to the 1.1.15 milestone
@samdark samdark self-assigned this
@samdark samdark merged commit eb8516b into yiisoft:master
@samdark
Owner

Merged. Thanks!

@cebe
Owner

This fix is not compatible with php 5.2:

Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /home/travis/build/yiisoft/yii/framework/base/CApplication.php on line 407

travis tests are failing.

@samdark
Owner

Already fixed in master.

@pawzar

I falsly asumed 5.2 was the required PHP version. Sorry. I got mixed up as I am focusing on Yii2.

@cebe
Owner

Already fixed in master.

Ah, sry. should have checked that. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 5, 2014
  1. one more revert.

    pzaremba authored
  2. Revert "one more revert."

    pzaremba authored
    This reverts commit 91787e8.
  3. #3077

    pzaremba authored
  4. Merge origin/master

    pzaremba authored
  5. changelog for #3077

    pzaremba authored
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 4 deletions.
  1. +1 −0  CHANGELOG
  2. +11 −4 framework/base/CApplication.php
View
1  CHANGELOG
@@ -69,6 +69,7 @@ Version 1.1.15 under development
- Enh #3147: Updated Request::getIsSecureConnection() to work with lower and uppercase config values (cebe)
- Enh #3182: Added namespace support for controllers in subdirectories (Ekstazi, samdark)
- Enh #3202: Adding support for the `X-HTTP-Method-Override` header in CHttpRequest (pawzar)
+- Enh #3307: Adding attribute localeClass to CApplication (pawzar)
- Chg #3137: Upgraded HTMLPurifier to 4.6.0 (samdark)
- New #2955: Added official support for MariaDB (cebe, DaSourcerer)
View
15 framework/base/CApplication.php
@@ -97,6 +97,10 @@
* the language that the messages and view files are in. Defaults to 'en_us' (US English).
*/
public $sourceLanguage='en_us';
+ /**
+ * @var string the class used to get locale data. Defaults to 'CLocale'.
+ */
+ public $localeClass='CLocale';
private $_id;
private $_basePath;
@@ -395,11 +399,12 @@ public function findLocalizedFile($srcFile,$srcLanguage=null,$language=null)
/**
* Returns the locale instance.
* @param string $localeID the locale ID (e.g. en_US). If null, the {@link getLanguage application language ID} will be used.
- * @return CLocale the locale instance
+ * @return an instance of CLocale
*/
public function getLocale($localeID=null)
{
- return CLocale::getInstance($localeID===null?$this->getLanguage():$localeID);
+ $class=$this->localeClass;
+ return $class::getInstance($localeID===null?$this->getLanguage():$localeID);
}
/**
@@ -409,7 +414,8 @@ public function getLocale($localeID=null)
*/
public function getLocaleDataPath()
{
- return CLocale::$dataPath===null ? Yii::getPathOfAlias('system.i18n.data') : CLocale::$dataPath;
+ $class=$this->localeClass;
+ return $class::$dataPath===null ? Yii::getPathOfAlias('system.i18n.data') : $class::$dataPath;
}
/**
@@ -419,7 +425,8 @@ public function getLocaleDataPath()
*/
public function setLocaleDataPath($value)
{
- CLocale::$dataPath=$value;
+ $class=$this->localeClass;
+ $class::$dataPath=$value;
}
/**
Something went wrong with that request. Please try again.