New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor active record meta data to be static field #2265
Refactor active record meta data to be static field #2265
Conversation
…t the static field.
This fix reduces memory usage a little.
Original memory usage delta 966960. |
return $this->_md=self::model(get_class($this))->_md; | ||
$className=get_class($this); | ||
if(!array_key_exists($className,self::$_md)) | ||
self::$_md[$className]=new CActiveRecordMetaData($this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we change this, there shouldn't be a reference to the first model creating a MetaData object in CActiveRecordMetaData.
Should be refactored to store only the class name instead of the model as it is not needed there anyway.
See CActiveRecordMetaData line 2300, 2361 and constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
* Rupert-RR-2131-add-accept-header-parsing: php doc adjustments after yiisoft#2132 Yii code style correction Removed unnecessary spaces. Transferred data for unit tests from the test functions into data providers. Undo accidental permissions change on bootstrap.php Added unit test file for CHttpRequest for the methods parseAcceptHeader() and compareAcceptTypes(). Modified the regexp in parseAcceptHeader() to accept wildcards in the path. Modified the description of compareAcceptTypes() to better reflect the comparison result (higher preference returns lower value, so that most preferred is first in the array). parseAcceptHeader() function description tidy up. Typo corrections and code tidy up. Altered parseAcceptHeader() to use only one regexp. Thanks to Ka on StackExchange for this expression. Typo corrections Separated out parse and compare functions. Reduced regular expression count to 2 from 3. Modified MIME type array map structure. Added yiisoft#135 back in changelog, which got lost somehow.. Moved position of line to follow numerical order. Enh yiisoft#2131: Added Accept header parsing to CHttpRequest to give an array of accepted types in order of preference
…imov-paul/yii into 2251-refactor-active-record-meta-data
PR update. |
Possibly. This one should be merged manually it least with verifying that everything is OK. |
Migrated to #2269 |
Don't think there is a problem with it, git will handle it just right, only thing is a weird behavior of github which shows commits that do not belong here. reported it to GH support. |
Active Record meta data has been refactored to be static field.
Note about overriding "CActiveRecord::__construct()" has been added.
Relates to #2251