Skip to content

Commit

Permalink
prepare for 1.1.12 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
qiangxue committed Aug 19, 2012
1 parent ad47786 commit b600af6
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 32 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Yii Framework Change Log
========================

Version 1.1.12 work in progress
-------------------------------
Version 1.1.12 August 19, 2012
------------------------------
- Bug #190: WSDL return tag was not generated by CWsdlGenerator when Macintosh line endings were used inside service describing docblock (resurtm)
- Bug #1066: CMemCache: expiration time higher than 60*60*24*30 (31536000) seconds led the value to expire right away after saving (resurtm)
- Bug #1072: Fixed the problem with getTableAlias() in defaultScope() (creocoder)
Expand Down
9 changes: 6 additions & 3 deletions UPGRADE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Upgrading Instructions for Yii Framework v1.1.12
Upgrading Instructions for Yii Framework v1.1.13
================================================

!!!IMPORTANT!!!
Expand All @@ -9,15 +9,18 @@ if you want to upgrade from version A to version C and there is
version B between A and C, you need to following the instructions
for both A and B.

General upgrade intructions
---------------------------
General upgrade instructions
----------------------------
- Make a backup.
- Clean up your 'assets' folder.
- Replace 'framework' dir with the new one or point GIT to a fresh
release and update.
- Check if everything is OK, if not — revert from backup and post
issues to Yii issue tracker.

Upgrading from v1.1.12
----------------------

Upgrading from v1.1.11
----------------------
- Changes in CCookieCollection::add() (introduced in 1.1.11) were reverted as they were triggering E_STRICT on some old PHP-versions
Expand Down
2 changes: 1 addition & 1 deletion framework/YiiBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class YiiBase
*/
public static function getVersion()
{
return '1.1.12-dev';
return '1.1.12';
}

/**
Expand Down
68 changes: 42 additions & 26 deletions framework/yiilite.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class YiiBase
private static $_logger;
public static function getVersion()
{
return '1.1.11';
return '1.1.12';
}
public static function createWebApplication($config=null)
{
Expand Down Expand Up @@ -837,7 +837,7 @@ public function raiseEvent($name,$event)
}
public function evaluateExpression($_expression_,$_data_=array())
{
if(is_string($_expression_) && !function_exists($_expression_))
if(is_string($_expression_))
{
extract($_data_);
return eval('return '.$_expression_.';');
Expand Down Expand Up @@ -2683,24 +2683,14 @@ protected function getCookies()
}
return $cookies;
}
public function add($name,$cookie=null)
public function add($name,$cookie)
{
if($name instanceof CHttpCookie)
if($cookie instanceof CHttpCookie)
{
$cookieName=$name->name;
$cookieObject=$name;
}
else
{
$cookieName=(string)$name;
$cookieObject=$cookie;
}
if($cookieObject instanceof CHttpCookie)
{
$this->remove($cookieName);
parent::add($cookieName,$cookieObject);
$this->remove($name);
parent::add($name,$cookie);
if($this->_initialized)
$this->addCookie($cookieObject);
$this->addCookie($cookie);
}
else
throw new CException(Yii::t('yii','CHttpCookieCollection can only hold CHttpCookie objects.'));
Expand Down Expand Up @@ -2776,7 +2766,7 @@ protected function processRules()
if(isset($cache))
$cache->set(self::CACHE_KEY,array($this->_rules,$hash));
}
public function addRules($rules, $append=true)
public function addRules($rules,$append=true)
{
if ($append)
{
Expand All @@ -2785,6 +2775,7 @@ public function addRules($rules, $append=true)
}
else
{
$rules=array_reverse($rules);
foreach($rules as $pattern=>$route)
array_unshift($this->_rules, $this->createUrlRule($route,$pattern));
}
Expand Down Expand Up @@ -4894,7 +4885,7 @@ public static function ajax($options)
$options['data']=new CJavaScriptExpression('jQuery(this).parents("form").serialize()');
foreach(array('beforeSend','complete','error','success') as $name)
{
if(isset($options[$name]) && (!($options[$name] instanceof CJavaScriptExpression) || strpos($options[$name],'js:')!==0))
if(isset($options[$name]) && !($options[$name] instanceof CJavaScriptExpression))
$options[$name]=new CJavaScriptExpression($options[$name]);
}
if(isset($options['update']))
Expand Down Expand Up @@ -5414,8 +5405,8 @@ public static function resolveValue($model,$attribute)
{
if($pos===0) // [a]name[b][c], should ignore [a]
{
if(preg_match('/\](.*)/',$attribute,$matches))
$attribute=$matches[1];
if(preg_match('/\](\w+(\[.+)?)/',$attribute,$matches))
$attribute=$matches[1]; // we get: name[b][c]
if(($pos=strpos($attribute,'['))===false)
return $model->$attribute;
}
Expand Down Expand Up @@ -6886,9 +6877,12 @@ public function defaultScope()
{
return array();
}
public function resetScope()
public function resetScope($resetDefault=true)
{
$this->_c=new CDbCriteria();
if($resetDefault)
$this->_c=new CDbCriteria();
else
$this->_c=null;
return $this;
}
public static function model($className=__CLASS__)
Expand Down Expand Up @@ -7360,7 +7354,7 @@ public function applyScopes(&$criteria)
{
$c->mergeWith($criteria);
$criteria=$c;
$this->_c=null;
$this->resetScope(false);
}
}
public function getTableAlias($quote=false, $checkScopes=true)
Expand Down Expand Up @@ -7414,7 +7408,7 @@ public function findBySql($sql,$params=array())
$this->beforeFind();
if(($criteria=$this->getDbCriteria(false))!==null && !empty($criteria->with))
{
$this->_c=null;
$this->resetScope(false);
$finder=new CActiveFinder($this,$criteria->with);
return $finder->findBySql($sql,$params);
}
Expand All @@ -7429,7 +7423,7 @@ public function findAllBySql($sql,$params=array())
$this->beforeFind();
if(($criteria=$this->getDbCriteria(false))!==null && !empty($criteria->with))
{
$this->_c=null;
$this->resetScope(false);
$finder=new CActiveFinder($this,$criteria->with);
return $finder->findAllBySql($sql,$params);
}
Expand Down Expand Up @@ -7754,6 +7748,28 @@ public function mergeWith($criteria,$fromScope=false)
}
class CManyManyRelation extends CHasManyRelation
{
private $_junctionTableName=null;
private $_junctionForeignKeys=null;
public function getJunctionTableName()
{
if ($this->_junctionTableName===null)
$this->initJunctionData();
return $this->_junctionTableName;
}
public function getJunctionForeignKeys()
{
if ($this->_junctionForeignKeys===null)
$this->initJunctionData();
return $this->_junctionForeignKeys;
}
private function initJunctionData()
{
if(!preg_match('/^\s*(.*?)\((.*)\)\s*$/',$this->foreignKey,$matches))
throw new CDbException(Yii::t('yii','The relation "{relation}" in active record class "{class}" is specified with an invalid foreign key. The format of the foreign key must be "joinTable(fk1,fk2,...)".',
array('{class}'=>$this->className,'{relation}'=>$this->name)));
$this->_junctionTableName=$matches[1];
$this->_junctionForeignKeys=preg_split('/\s*,\s*/',$matches[2],-1,PREG_SPLIT_NO_EMPTY);
}
}
class CActiveRecordMetaData
{
Expand Down

0 comments on commit b600af6

Please sign in to comment.