Archive

Author Archive

Remove view layer label

August 30th, 2010 陈毓端 No comments
  1. <?php
  2. class view{
  3.  private $extractArray=array();
  4.  function assign($name,$valArray){
  5.    $this->extractArray[$name]=$valArray;
  6.  }
  7.  function display($html,$htmlDir=''){
  8.   global $APPConfig;
  9.   @extract($this->extractArray,EXTR_PREFIX_SAME, "wddx");
  10.   if($htmlDir!=''){
  11.    require_once($htmlDir.'/'.$html);
  12.   }else{
  13.    require_once($APPConfig['viewDir'].'/'.$html);
  14.   }
  15.  }
  16. }
  17. ?>
Categories: php Tags:

多领域不同业务模型下的开发模式选择

August 25th, 2010 陈毓端 1 comment

最近在做一个平台的开发模式设计。最关键的是业务模块的不确定性。如何实现便捷的业务模块添加,这是设计的核心点。毕竟业务随着时间的推移,也会不断的新陈代谢。

我想大家都知道传统CS软件的开发中的dll 、lib技术或多或少的可以用实现软件的升级换代,也就是我们知道的Update new version。换个思路回到基于B/S模型,如何达到业务的升级、推新目的。

来我们再来看下dll到底是一个什么东西?Dynamic Link Library 用来 实现程序模块化,是相对独立的组件。好了我们知道有这么一个好的东西,我们如何把这个好的思想用于PHP开发中呢?

我们来看下面简单的UML图


从上图或许已经可以看出它是一个比较典型的工厂模式。

我们再来学习下什么是工厂模式:提供一个获取某个对象实例的接口,同时使调用代码尽量的避免实例化。

这个例子的现实业务需求是earlylearng 早教模块和nurse 保姆模块及其它后期添加的业务模块。如何模块化的信息发布,做到无缝衔接。

有了工厂模式和dll的思想,就可以把不同的业务模型查看dll,来设计我们的系统。当然开发模式不是万能的 根据不同的业务情况去选择适合的开发模式。

Categories: 开发模式 Tags:

CYDPHP一键集成环境(一键PHP安装包) 1.0 Nginx+MySQL+PHP-CGI+Memcached 集成B/S开发工具箱

August 12th, 2010 陈毓端 18 comments

CYDPHP 一键集成环境是什么?

Construct Yare Development 构建敏捷开发环境

CYDPHP 绿色 免安装 针对Windows下快速开发PHP及B/S开发模式下日常必备功能的一键整合开发环境。

CYDPHP 功能组件

  • PHP 5.3.3
  • Nginx 0.8.39
  • MySQL 5.1.48
  • memcache 2.2.5
  • eAccelerator 0.9.6
  • Xdebug 2.1.0
  • phpMyAdmin mysql管理
  • AB 压力测试
  • javaScript 压缩工具
  • CSS 压缩工具
  • PHP 代码格式美化
  • MySQL 数据批量生成工具
  • xdebug分析工具
  • SFTP/FTP
  • Windows 常用命令
  • DOS Linux shell 模拟工具
  • 端口进程分析工具
  • 翻译工具
  • 取色工具
  • 快捷文档软件管理工具

CYDPHP 事项

  • 需解压到非中文目录下,否则部分功能无法使用(路径不能包含空格)。
  • 具有端口和进程检测功能。
  • MySQL启动选择(可以选择系统已安装的MySQL)
  • 采用多线程机制,保证部分功能的同时进行

联系方式

软件作者:  陈毓端
MSN:   yuduan2009@hotmail.com
E-mail:   thisduan@gmail.com
下载地址: 【新浪下载】 【天空下载

windows7 不支持 AllocateAndGetTcpExTableFromStack

August 8th, 2010 陈毓端 No comments

周末把开发的集成软件放在windows7环境中测试,发现iphlpapi.dll 在windows7下已经放弃支持AllocateAndGetTcpExTableFromStack,AllocateAndGetUdpExTableFromStack

没用办法只能重新修改程序进行重新编译

只能改用 GetExtendedTcpTable 。

具体参考:

http://msdn.microsoft.com/en-us/library/aa365928(VS.85).aspx

Categories: c, delphi, java, 编程语言 Tags:

php chain model

August 6th, 2010 陈毓端 No comments
<?php
class Chain {
public function edge($val){
echo ‘create ‘.__METHOD__.’: ‘.$val.’ edge’;
}
}
call_user_func_array(array(new Chain,”edge”),array(“two”));
?>
Categories: php Tags:

nginx 小记 (无法获取get post cookie)

August 4th, 2010 陈毓端 No comments

之前给朋友公司架设了nginx phpcgi 应用环境

今天告诉我无法获取get post cookie等

查了php.ini 没用问题

找了半天,原来nginx.conf 

include        fastcgi_params;

被注释了 开启。即可。

Categories: linux, php Tags:

话题区粘性/行为分析系统架构

July 25th, 2010 陈毓端 No comments

项目的重点从新闻/抓取的内容阅读转型到以话题为主,这使的话题区用户行为变得十分重要如用户粘性,访问路径。

用户行为分析包过系列的原始数据采集,仓储,挖掘,报表等。

本系统主要是针对用户访问路径,话题区核心功能的事件驱动分析。

用户行为分析简单的划分为2条收集路线

//主线 队列
 this.MainQuery   = function () {
  //第一次访问当前URL或者刷新 用来处理pv等看做的首次访问逻辑

}

//副线 事件驱动 队列
 this.EventQuery   = function () {
  this.Doc.onclick  =  function() {
   //驱动逻辑 用来收集用户的页面操作区域 点击等消息
  }
 }

 

Categories: 架构 Tags:

redhat 更新源 到centos

July 9th, 2010 陈毓端 No comments
前两天答应一朋友给他安装两台新采购服务器的LAMP环境,晚上抽时间SSH的登录。
我也没有看服务器都安装了什么。
编译mysql时候碰到
configure: error: no acceptable C compiler found in $PATH
天哪 连GCC G++ 基本库都没装
因为是redhat 习惯的
yum install gcc g++
no
This system is not registered with RHN.
RHN support will be disabled.
提示系统未注册RHN
悲哀 伪开源的约束
只能更新源的 采用centos的源
操作步骤:
cd /etc/yum.repos.d/
vi centos.repo
[base]
name=CentOS-$releasever – Base
baseurl=http://centos.ustc.edu.cn/centos/5/os/i386/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
重新安装
yum install gcc g++
Categories: linux Tags:

抽象的798

July 3rd, 2010 陈毓端 No comments

早上去医院体检,回来的时候路过798。
早就听说798,可是来北京这么多年也没用去过。
798, 一个建立在老旧工厂上,标榜艺术和潮流的圣地。
在我的脑海里,也探寻着它到底是什么样的一个地方?
不明白,
什么是艺术?
我肤浅的觉的只是社会意识形态的一种渲染和映射。
进入798,
我有意的去寻找,
极力的去伪装自己的艺术底蕴,
我仔细看着,并艰难品阅着每个自我抽象的所谓艺术品。
抽象的798,
艺术也是本身就是抽象的。
很有意思,自己的职业告诉我抽象,抽出共性,抛弃非特征本质。

Categories: 生活 Tags:

FastCGI 深入学习第二步

June 28th, 2010 陈毓端 No comments

FastCGI 学习第二步就看看example下的echo.c吧 看看到底是一个什么东西。

源码:

#ifndef lint
static const char rcsid[] = "$Id: echo.c,v 1.5 1999/07/28 00:29:37 roberts Exp $";
#endif /* not lint */

#include "fcgi_config.h"

#include <stdlib.h>

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

#ifdef _WIN32
#include <process.h>
#else
extern char **environ;
#endif

#include "fcgi_stdio.h"

static void PrintEnv(char *label, char **envp)
{
    printf("%s:<br>\n<pre>\n", label);
    for ( ; *envp != NULL; envp++) {
        printf("%s\n", *envp);
    }
    printf("</pre><p>\n");
}

int main ()
{
    char **initialEnv = environ;
    int count = 0;

    while (FCGI_Accept() >= 0) { //判断是否有请求产生
        char *contentLength = getenv("CONTENT_LENGTH");
        int len;

	printf("Content-type: text/html\r\n"
	    "\r\n"
	    "<title>FastCGI echo</title>"
	    "<h1>FastCGI echo</h1>\n"
            "Request number %d,  Process ID: %d<p>\n", ++count, getpid());

        if (contentLength != NULL) {
            len = strtol(contentLength, NULL, 10);
        }
        else {
            len = 0;
        }

        if (len <= 0) {
	    printf("No data from standard input.<p>\n");
        }
        else {
            int i, ch;

	    printf("Standard input:<br>\n<pre>\n");
            for (i = 0; i < len; i++) {
                if ((ch = getchar()) < 0) {
                    printf("Error: Not enough bytes received on standard input<p>\n");
                    break;
		}
                putchar(ch);
            }
            printf("\n</pre><p>\n");
        }

        PrintEnv("Request environment", environ);
        PrintEnv("Initial environment", initialEnv);
    } /* while */

    return 0;
}

这个demo很简单 核心代码 FCGI_Accept() 判断是否有请求产生 接下的就是写简单的业务逻辑。
Categories: 编程语言 Tags: