每月彙整: 2009 年 10 月

winbind cache refresh

man winbindd

SIGHUP
Reload the smb.conf(5) file and apply any parameter changes to the
running version of winbindd. This signal also clears any cached
user and group information. The list of other domains trusted by
winbindd is also reloaded.

所以只要
[sourcecode language=’sh’]
/usr/local/etc/rc.d/samba reload
[/sourcecode]
就好了….

lib

ldd -a /usr/local/bin/mysql
ldconfig -r
/sbin/ldconfig -m /usr/local/lib

ldconfig
-m Instead of replacing the contents of the hints file with those
found in the directories specified, “merge” in new entries.
Directories recorded in the hints file by previous runs of
ldconfig are also rescanned for new shared libraries.

筆記一下…

Yii Csort With ActiveRecord

controller 部份
[sourcecode language=’php’]
$sort->attributes= array(
‘product.id’=>’productId’,
‘product.name’=>’productName’,
‘category.name’=>’categoryName’,
‘brand.name’ => ‘brandName’,
);

/*
$sort->attributes= array(
‘model中的alias.欄位’=>’網址顯示的Alias’,
);
*/
[/sourcecode]

view 部份
[sourcecode language=’php’]
< ?php echo $sort->link(‘product.id’,’編號’); ?>
//< ?php echo $sort->link(‘table.name’,’網頁顯示的名稱’); ?>
[/sourcecode]

model 部份
記得把 relations中的 alias 設好

如下
[sourcecode language=’php’]
/**
* @return array relational rules.
*/
public function relations()
{
return array(
‘brand’=>array(self::BELONGS_TO,’brand’,’brand_id’, ‘alias’=>’brand’),
‘category’=>array(self::BELONGS_TO,’category’,’category_id’, ‘alias’=>’category’),
‘series’=>array(self::BELONGS_TO,’series’,’series_id’,’alias’=>’series’),
);
}
[/sourcecode]