这里给出最终解决方案;
将原来的register方法修改成如下:
    $config =& Config::getConfig();
    $this->cacheFolder = $config->getValue('temp_folder');
    $this->cacheFolder = $this->cacheFolder.'/authimage/'.$this->blogInfo->getId();
    if( !File::exists( $this->cacheFolder )) {
      File::createDir( $this->cacheFolder );
    }
          
    $blogSettings = $this->blogInfo->getSettings();
    $this->pluginEnabled = $blogSettings->getValue( "plugin_authimage_enabled" );
    $this->length = $this->_getSetting( "plugin_authimage_length" , 4);
    $this->key = $this->_getSetting( "plugin_authimage_key" , "pLog");
    $this->expiredTime = $this->_getSetting("plugin_authimage_expiredtime", 3600);
    $this->default = $this->_getSetting( "plugin_authimage_default", "marble.gif");
    if ( empty($this->pluginEnabled) ) {
      $blogSettings->setValue( "plugin_authimage_enabled", true );
      $blogSettings->setValue( "plugin_authimage_length", $this->length );
      $blogSettings->setValue( "plugin_authimage_key", $this->key );
      $blogSettings->setValue( "plugin_authimage_expiredtime", $this->expiredTime );
      $blogSettings->setValue( "plugin_authimage_default", $this->default );
      
      $this->blogInfo->setSettings( $blogSettings );
      $blogs = new Blogs();
      $blogs->updateBlog( $this->blogInfo->getId(), $this->blogInfo );
      $this->pluginEnabled = $blogSettings->getValue( "plugin_authimage_enabled" );
再添加如下方法:
  function _getSetting($key, $defaultValue)
  {
    $value = $this->blogInfo->_settings->getValue($key);
    return empty($value) ? $defaultValue : $value;
  }
应该可以工作了, 不过还是有的小毛病
1。 blogsetting段在pluginauthimageupdateconfigaction.class.php中也出现了, 所以有点重复, 可以提取出来
2。 默认值在pluginauthimage.class.php 中和pluginauthimageconfigview.class.php中同时出现, 应该可以提取出来
3。 pluginauthimage.class.php中的updateBlog没有判断是否成功,没有相关错误处理。
4。最大的一个缺点是, 没有办法关闭这个plugin了
因为register这个方法在每个action触发中都会被调用, 所以当pluginauthimageupdateconfigaction被调用时候, register方法又一次被调用, 导致每次写入的都是register方法里设定的值。 参考adminaction.class.php 的setCommonData()方法。
问题还不少,如何改进就留给读者了吧。。。