http://rmcreative.ru/blog/post/vstrecha-razrabotchikov--voronezh-1--apdeyt
16 марта, 12:00. Бенефит-плаза, кафе «Маруся».
| <?php | |
| class Wrapper { | |
| private $value; | |
| private $isHit; | |
| function __construct($isHit, $value) | |
| { | |
| $this->isHit = $isHit; | |
| $this->value = $value; | |
| } |
| <?php | |
| $start = microtime(true); | |
| function get_cache_value() { | |
| return rand(0, 100).'test'; | |
| } | |
| $results = array(); | |
| for ($i=0; $i<1000; $i++) { | |
| $results[] = get_cache_value(); |
| <?php | |
| /** | |
| * Clear assets Command | |
| * | |
| * Deletes all published assets. | |
| * | |
| * Usage: | |
| * yiic clearassets | |
| * | |
| * @author Alexander Makarov |
http://rmcreative.ru/blog/post/vstrecha-razrabotchikov--voronezh-1--apdeyt
16 марта, 12:00. Бенефит-плаза, кафе «Маруся».
| <?php | |
| class X | |
| { | |
| private $_b; | |
| private $_e; | |
| } | |
| class Y | |
| { | |
| private $_behaviors; |
| /** | |
| * Get criteria to limit query to match any of tags specified | |
| * @access private | |
| * @param array $tags | |
| * @return CDbCriteria | |
| */ | |
| protected function getFindByAnyTagsCriteria($tags) { | |
| $criteria = new CDbCriteria(); | |
| $pk = $this->getOwner()->tableSchema->primaryKey; |
| <?php | |
| function cidr_match($ip, $ranges) | |
| { | |
| $ranges = (array)$ranges; | |
| foreach($ranges as $range) { | |
| list($subnet, $mask) = explode('/', $range); | |
| if((ip2long($ip) & ~((1 << (32 - $mask)) - 1)) == ip2long($subnet)) { | |
| return true; | |
| } | |
| } |
| <?php | |
| function render_level_list($items) | |
| { | |
| $level=0; | |
| foreach($items as $item) | |
| { | |
| if($item->level==$level) { | |
| echo "</li>\n"; | |
| } |
| <?php | |
| /** | |
| * Escapes values | |
| * | |
| * @param array $values array of values to escape | |
| * @return string string ready to be included into SQL statement | |
| * @throws CException if one of the values isn't a scalar | |
| */ | |
| function escape($values) | |
| { |
| <?php | |
| /** | |
| * Object class file. | |
| * | |
| * @link http://www.yiiframework.com/ | |
| * @copyright Copyright © 2008-2012 Yii Software LLC | |
| * @license http://www.yiiframework.com/license/ | |
| */ | |
| namespace yii\base; |