| 首页 |
可 始内容在这方面的工作,只是其中最受欢迎的创作共用许可 站由 团此博客 2.0饲料 原子1.0饲料 球的php 500万-特里斋 期一,朱莉27 。 2009年 iphone窗口的http流媒体直播服务器- ioncannon 期一,朱莉27 。 2009年 工作不可靠的api -德米安特纳 期一,朱莉27 。 2009年 帮助联合国informed.org -卢卡斯史密斯 期一,朱莉27 。 2009年 道歉之终结? 我认为zend_openid恨我... 讨厌它回来了! -帕德莱克布雷迪 期日,朱莉26 。 2009年 设立pear2和pear结帐随着svn 1.5 + -官方博客梨组/梨主席 samstag ,朱莉25 。 2009年 php的工作: php的'大师'的立场在旧金山-特里斋 雷塔格,朱莉24 。 2009年 加入五月花在facebook - thinkphp的/ dev /博客- php的 雷塔格,朱莉24 。 2009年 该greedyness非贪婪的正则表达式- liip 雷塔格,朱莉24 。 2009年 使生活更好地声压级自动-布兰登萨维奇 雷塔格,朱莉24 。 2009年 计 次进入: 2009年7月27日01:50 394项书面 1320年已经作出的评论 | 关标签 apache的纨裤子弟 应用安全 docbook 文件 的mvc 梨 的php php的一般 php安全 教程 zend框架 期三, 11月12日。 2008年
写作专业外观...发布的帕德莱克布雷迪在php安全上17:13 评论( 6 ) 引用( 0 ) 义的标签对此条目: apache的纨裤子弟 , docbook , 文件 , phing , php安全 , 补习 , zend框架 写作专业外观的单据docbook , php中, phing和apache维克多:第1部分:使用入门言件。 个词illicits混合恐惧和抑郁症,即使在最坚硬的程序员。 许多人来说这是一个艰难的通过无休止的无聊各地发生的,或在年底,发展进程。 件从来都不是最简单的任务。 好的文件需要时间,耐心,许多问题的主题事项(无论多么熟悉你认为你是与主题事项,你可以放心你有一些误解) ,并有一定程度的能力在冷凝知识的一种形式的人可以即时连接。 是,即使当你这样做有它的问题是如何分配! 个流行的选择是html -这是因为每个人都携带有一个浏览器,并作为web开发人员,我们都熟悉的语法。 一种较常见的选择是纯文本,因为“别人”可以随时转移到另一种格式下的线。 些人甚至认为,其娱乐依靠内置的源代码评论依靠技能的用户破译其个性化的编码方式,思维过程,并意图。 文一系列建议使用docbook xml作为最终来源的所有文件格式。 间的差异最格式和docbook ,是docbook可用于产生无数最后格式。 种灵活性和质量,它的产量大大解释docbook的流行文件作者。 果您怀疑它的能力,牢记有出版商已通过docbook谁! 的一系列介绍程序员的php面向出版过程使用docbook xml作为基础生成专业外观的html和pdf输出。 说php的导向,因为unix的“工具”普遍参与的docbook的xml已取代几乎完全由php 。 是有用的,因为用php的力量为您撰写各种过滤器来处理的东西像php源代码突出非常简单。 足的成分!docbook的xmldocbook标准似乎声誉正在复杂。 是一个完全没有基础的误解-格式是广泛的,有数以百计的可能的标签,但在这浅标记以外的其他伯爵非常简单。 docbook是一个简单的xml格式的子集在一个小的标准语法是足够了99 %的要求。 这么简单的html和纯老有几个优秀的编辑,这样你不坚持手工编辑的xml (这应该避免,因为它的...痛苦) 。 是我不建议设置的shell书(见manual.xml进一步)的手和使用的编辑个别章节/附录,因为它使我们的生活更方便地把同一个巨大的文件! 点是,你必须至少了解的基本标签和了解,如同所有的xml ,所有元素做巢,所有docbook xml文件需要验证的标准。 xml的编辑依赖于知识和嵌套标签的一致性-他们节省时间,因为你不写标签和担心审定,外观和另一方面编辑疼痛。 此之外,它是一个简单的工作在实践中学习,我离开的读者。 会看到一些样品后给你的感觉的基本语法。 可以阅读机当然比上http://opensource.bureau-cornavin.com/crash-course/en/introduction.html但充分参考手册是一个伟大的处理更大,更全面。 存在着一些有用的例子php社区包括zend framework的参考手册和phpunit的袖珍指南,仅举几个例子,您可以结帐从各自的版本控制库。 因docbook变得如此流行的技术手册,参考书籍,甚至更短的文章和一些杂志是docbook是不可知的最后分派格式。 任何docbook源可以产生html格式,支持xhtml的rtf , html格式,中草药( microsoft帮助)的postscript , tex代码和格式的作品等等。 是自己的中介xml语法这是很容易产生成pdf格式表格使用处理器(如apache维克多,我们会满足后) 。 有这些目标的格式可从一个单一的源文件可以很容易地看到, docbook提供您的灵活性。 什么撰写的rtf或html ,当docbook还为您提供这些,而且,以最小的事? 提及的是,只有需要的工具docbook处理所有恰好是自由和开放源码? php 5中docbook的xml转化成其他格式,需要工具。 准设置是安装docbook dtds ,该docbook xsl样式表(其中指示转化来源docbook成不同格式的xml ) ,并收集了gnu工具在linux像xsltproc 。 是有时被称为“新方式” ,因为它的简单比较合理了什么之前,在linux的世界。 理的是在魔眼杀机然而 php5配备的dom和xsl扩展,这些都具有所有必要功能驱动是完全的php驱动的docbook工具。 有人们需要的是在php编程工具,以便它可以重复使用。 运的是, phing (一个项目的基础上建立系统的apache蚂蚁) ,包括预先写好的任务和过滤器服务于这一目的钦佩。 要指出这些人的贡献,造福于所有的php倾向于docbook用户条例草案karwin ,前zend framework的大师。 谢比尔! 他方面的php工具是,它使程序员编写的php自定义phing任务和过滤器可以帮助自定义输出。 们会看到我的php源突出的例子之后。 phingphing是其中的一个低估图书馆黯然失色喜欢的apache蚂蚁或红宝石耙各自的语言。 phing存在的理由是为了让php的编程说明重复任务在xml语法,使他们能够自动重新运行命令行只要你想要的。 如,每当我要生成文件docbook ,我只是发出命令“ phing文件”的控制台! phing是用把php5 ,这主要的原因,我使用它。 可以创建自定义任务和过滤器在php没有顺藤摸瓜与java或着手探讨庆典脚本(如果你通常喜欢makefiles中) 。 用一些自定义任务微调整个加工过程,基本上是php类进口phing 。 phing考虑的痛苦了,你的php应用知识的任务,创造和操纵docbook xml和它的任何中间人或最后格式。 一边的phing是简单的自动化。 不是凭一个控制台两分钟,我可以编码docbook运行phing的xml语法,并让它自动执行的所有任务,我确定,我的顺序确定他们。 分钟不超过无数运行phing增加和删除的烦恼从我的编程生活。 擅长自动化高度重复的任务。 帕奇维克多xslt处理不能显然,直接生成pdf 。 pdf文件是必须有一个中间格式xsl格式化对象(表油)所创建的xslt处理器从docbook来源。 中间格式就可以改变自己在第二阶段由一个适当的xsl油处理器为pdf , postscript和其他一些较少使用的格式。 apache的fop是选为处理器几个原因。 易于安装和使用。 可以轻松地配置它嵌入自订(或基地14 )字体为pdf 。 是用java编写的,可以在命令行,运行在windows xp / vista的努力很少。 ,而且是免费的。 应该不支付的xsl油处理器! 管多么简单的广告承诺,使之! 装所有这些废物而不疯狂果你头旋压从海量的信息,休息一下,从事一些低贱的安装任务。 php 5中要承担您可以放心地安装php 5没有我持有你的手。 只要确定还包括梨! 果您需要安装pear单独的文档在http://pear.php.net 。 phing装phing是从命令行使用梨。 问phing的位置在网络上的用户手册存在,如果你打算尝试非梨安装。 里通常需要采取的步骤: 通道发现pear.phing.info 还可以安装一个phing任务予释放自己的渠道来处理梨php源强调在html输出。 通道发现pear.phpspec.org 际上我使用两个自定义任务。 一个突出的php代码的html /的xhtml文件产生docbook和发现的phpspec梨渠道。 二个是在zfblog subversion仓库在http://svn.astrumfutura.org/zfblog/branches/phing/phpfohighlightertask.php ,应当抄送梨/ phing /任务/转/目录中的系统。 项任务涉及突出php源代码中的xsl ,光纤输出,以便在pdf格式的内容是适当突出(参考此代码,如html版本,是根据新的许可证bsd许可证除非另有说明) 。 里有一个拷贝审查-它使用一种变异的php脚本的html突出重写申请表油使用php的dom : “ ?的php require_once ' phing / task.php ' ; 一流的 phpfohighlightertask延伸工作 ( 营$ _file = 无效 ; 共职能 setfile ( $档案 ) ( $本 - “ _file = $文件 ; ) 共职能的init ( ) ( ) 共职能的main ( ) ( $本 - “ _highlightfile ( $本 - ” _file ) ; $本 - “ 日志 ( ' php在样式油强调' ) ; ) 营功能 _highlightfile ( $档案 ) ( $大教堂 = 新 domdocument ( ) ; $大教堂 - “ 负载 ( $文件 ) ; $的xpath = 新 domxpath ( $大教堂 ) ; = $ $元素的xpath - “ 查询 ( ” / /为:块[ @ phing = ' phpfohighlightertask ' ] “ ) ; foreach ( $ 内容 $块 ) ( 我: : _highlightblock ( $块 , $大教堂 ) ; $块 - “ removeattribute ( ' phing ' ) ; ) $大教堂 - > “ 保存 ( $文件 ) ; ) 营静态 功能 _highlightblock ( $块 , $为 ) ( $ tohighlight = str_replace ( 阵列 ( ' > “ , ” < ' , ' & ' , ' “ ' ) , 阵列 ( ' > “ , ” < ' , ' & ' , ' “ ' ) , $块 - “ nodevalue ) ; / /这基本上防止突出非 / / html , xml 和php源代码。 注:所有php来 / /这种方式强调必须有“ ?的php顶部 如果 ( substr ( $ tohighlight , 0 , 5 ) ! == “ < ?的php ' & & substr ( $ tohighlight , 0 , 9 ) ! == “ < !文档' & & ! preg_match ( "/^<[^>]*>/" , $ tohighlight ) ) ( 返回 ; ) / /为什么突出手动时的内置入php ! / /编辑 php.ini 或添加配置改变颜色 $代码 = highlight_string ( $ tohighlight , 真实 ) ; $代码 = str_replace ( 阵列 ( '的<code> ' , “ < /编号> ” , ' ' , ' <br /> ' , “ \ r ”开始) , 阵列 ( '' , '' , ' ' , “ \ n ”的, “ \ n ”的) , $代码 ) ; $代码 = preg_replace ( “ ! \ n \ n已\的n + ! ” , “ \ n \ n已” , $代码 ) ; $代码 = 修剪 ( $代码 ) ; $大教堂 = 新 domdocument ; $大教堂 - “ loadxml ( $代码 ) ; $的xpath = 新 domxpath ( $大教堂 ) ; $ parentspan = $的xpath - “ 查询 ( ' /跨度' ) - ” 项目 ( 0 ) ; $风格 = $ parentspan - “ getattributenode ( '风格' ) - > ”数据; $肤色 = substr ( $风格 , 7 , 7 ) ; $内容 = $ parentspan - “ nodevalue ; $ inlineparent = $为 - “ createelement ( '为:内联' ) ; $ inlineparent - “ setattribute ( '颜色' , $肤色 ) ; = $ $节点的xpath - “ 查询 ( ' /跨度/节点( ) ' ) ; foreach ( $节点节点 美元 ) ( 如果 ( $节点 - “ 的nodetype == xml_element_node ) ( 我: : _appendinlinechild ( $节点 , $ inlineparent , $为 ) ; 其他 ( ) $儿童 = $为 - “ importnode ( $节点 , 真实 ) ; $ inlineparent - “ appendchild ( $儿童 ) ; ) ) / /不良反应的xsl油复杂是奇数空白宽框 / /这条出来-的一种替代方法。 意味着此代码可 / /得到改善一点 , 使剥离不需要开始! 如果 ( preg_match ( “ / ^ \县 + $ / ” , $ inlineparent - “ firstchild - ” textcontent ) ) ( $ inlineparent - “ removechild ( $ inlineparent - ” firstchild ) ; ) foreach ( $块 - “ 子 节点 美元 ) ( $块 - “ removechild ( $节点 ) ; ) $块 - “ appendchild ( $ inlineparent ) ; ) 营静态 功能 _appendinlinechild ( $跨度 , $ inlineparent , $为 ) ( $风格 = $跨度 - “ getattributenode ( '风格' ) - > ”数据; $肤色 = substr ( $风格 , 7 , 7 ) ; $内容 = $跨度 - “ nodevalue ; $ inlinechild = $为 - “ createelement ( '为:内联' , $内容 ) ; $ inlinechild - “ setattribute ( '颜色' , $肤色 ) ; $ inlineparent - “ appendchild ( $ inlinechild ) ; ) ) phing安装-我们的php环境已经完成。 我们抓住现在的其余内容。 继续阅读“写作专业外观的单据docbook , php中, phing和apache维克多:第1部分:入门” 期三, 5月14日。 2008年
例如zend framework的博客...发布的帕德莱克布雷迪在一般的php , php安全 , zend framework的在12:39 评论( 24 ) 引用( 0 ) 义的标签对此条目: 应用安全 , mvc模式 , phing , php的 , 一般的php , php安全 , zend框架 例如zend framework的博客应用教程:第8部分:创建和编辑博客条目破折号的htmlpurifier 有什么能比得上一个运作的应用中出现的混乱,我们知道控制的发展进程。 第八部分正在进行佐贺说明如何建立一个真正的世界博客申请使用zend framework的,我们终于到达那一点上我们专注于博客条目。 本月底,我们将能够创建和编辑的条目,准备第9部分,当我们将探讨展示给世界! 前: 范例zend framework的博客应用教程-第7部分:授权与zend_acl和修订造型 示项目的原因是这里没有处理也很简单。 示需要大量的zend_view工作是值得的一篇文章对自己在我们走得太远。 几个你已经注意到在对我们的可疑缺乏查看助手使用 此,对与节目了! 1步:添加一个条目控制器及加入动作模板一步,以创造新的条目将被写admin_entrycontroller级(需要的前缀是因为它坐落在管理模块)与addaction ( )方法和相应的模板。板将利用新的zend_form物件收集的投入用于建立一个新项目,并提供编辑检视。 们将开始与控制器,再加上 /application/admin/controllers/entrycontroller.php : “ ?的php 一流的 admin_entrycontroller延伸zend_controller_action ( 共职能 addaction ( ) ( ) 共职能 listaction ( ) ( ) 共职能 editaction ( ) ( ) 共职能 deleteaction ( ) ( ) ) entrycontroller需要四个基本方法。 们打算创建,编辑和删除条目,以及列出所有参赛作品的作者,选择这些选项。 们将集中精力addaction ( )的方法,所以让我们添加一个适当的模板在 /application/admin/views/scripts/entry/add.phtml了一位老朋友提到: <p>如果我不理解,应得出的结论是非常有用的东西和深刻的是下面的措辞。 <br />的<em> -乔纳森斯威夫特“ /时间” “ /人” “ ? 两套 (这一点 - ” failedvalidation ) : ? “ <p 级 = "error" “若干问题的发现提交的形式。 ” /人“ “ ?的php endif ; ? ” “ ? php的 回声 $本 - ” entryform ? “ 我们陪伴我们的博客条目形式少乔纳森斯威夫特的启示 我们的设计同步我们打算形式输出,将以下内容添加到 /public/css/style.css : 本( 宽度 : 76 % ; 身高 : 30em ; ) 应该提供一个体面的造型为textareas大多数的浏览器。 至safari中,我注意到最近显示的是我的一些文字栏位不佳。 2步:组装的报名表与zend_form们已经进行了相当详细的看看zend_form在第六部分,当我们写了一类包含一些标准和具体的装修阵列形式的内容,并建立我们的登录表单的例子。 同样的原则也适用于这里很少变化。 们再次使用的是短阵列为基础的语法多个方法调用。 中一个分歧注意的是,我用两个新的选项attribs和value而没有任何形式的开发可以活不! 们将开始一个新的类称为zfblog_form_entryadd位于 /library/zfblog/form/entryadd.php : “ ?的php 一流的 zfblog_form_entryadd延伸zfblog_form ( 共职能的init ( ) ( $本 - “ setaction ( ' /管理/项目/添加' ) ; / /显示组# 1 :读数据 $本 - “ addelement ( '文' , '标题' , 阵列 ( '装修' = “ $本 - ” _standardelementdecorator , '标签' = > “ 标题: ' , ' attribs ' = “ 阵列 ( '最大长度' = “ 200 , '大小' = “ 80 ) , '校验器' = “ 阵列 ( 阵列 ( ' stringlength ' , 虚假 , 数组 ( 3 , 200 ) ) ) , '需要' = “ 真正 ) ) ; $本 - “ addelement ( '文' , '日期' , 阵列 ( '装修' = “ $本 - ” _standardelementdecorator , '标签' = > “ 日期: ' , ' attribs ' = “ 阵列 ( '最大长度' = “ 16 , '大小' = “ 16 ) , '价值' = “ zend_date : : 现在 ( ) - ” tostring ( '格式yyyy - mm -日时时:分分' ) , '校验器' = “ 阵列 ( 阵列 ( '日期' , 虚假 , 阵列 ( '格式yyyy - mm -日时时:分分' , '恩' ) ) ) , '需要' = “ 真正 ) ) ; $本 - “ addelement ( '文字' , ' entrybody ' , 阵列 ( '装修' = “ $本 - ” _standardelementdecorator , '标签' = > “ 入学团体: ' , '需要' = “ 真正 ) ) ; $本 - “ addelement ( '文字' , ' entrybodyextended ' , 阵列 ( '装修' = “ $本 - ” _standardelementdecorator , '标签' = > “ 扩展团体: ' ) ) ; $本 - “ adddisplaygroup ( 阵列 ( '标题' , '日期' , ' entrybody ' , ' entrybodyextended ' ) , ' entrydata , 阵列 ( ' disableloaddefaultdecorators ' = “ 真正的 , '装修' = “ $本 - ” _standardgroupdecorator , '传奇' = > “ 项目' ) ) ; / /显示组# 2 :提交 $本 - “ addelement ( '提交' , '提交' , 阵列 ( '装修' = “ $本 - ” _buttonelementdecorator , '标签' = > “ 保存' ) ) ; $本 - “ adddisplaygroup ( 阵列 ( '提交' ) , ' entrydatasubmit ' , 阵列 ( ' disableloaddefaultdecorators ' = “ 真正的 , '装修' = “ $本 - ” _buttongroupdecorator , '级' = > “ 提出' ) ) ; ) ) 扔在上面洒的zend_date格式当前日期的格式兼容mysql数据库。 zend_date也用于背景的zend_validator_date级这就是为什么日期格式是相同的,两者兼而有之。 注意,格式不能在php经常使用的样式的日期( )函数,而是使用的iso格式说明符。 提供了一个很大的灵活性,如果您想格式化以外mysql的日期。 后指出,没有“必要”旗帜的“ entrybodyextended ”内容的扩展,因为机构是可选的。 们还没有完全做到。 们两个textareas的讨论,早在第1部分,正在设计的html输入接受,因为我真的不能不屑于玩自定义格式标签等。 显然提高了风险,我的另一个作者,或谁是猜到我的密码可能,要么错误或意图,增加了一些跨站点脚本( xss )的混合和介绍了破坏性的安全漏洞。 们不能有,现在! 3步:过滤条目使用htmlpurifier根据自定义过滤器们现在要做的就是将附加自定义过滤器的textareas包含的条目的数据,清除任何html投入,消除跨站脚本,并作为奖金转换任何非html格式的html投入。 一点,例如,包括我们的文字段落包裹在<p>标签。 最喜爱的图书馆为实现这一目标是htmlpurifier我认为其中的很多下利用图书馆在php 。 我所知,没有什么有击败其综合功能。 最好的功能是,它实际上理解的html多个标准。 入tokenised ,剖析,通过白名单(相反的检测黑名单) ,完全正确的改革作为有效的输出,然后可以选择总结的东西一样的纯文本文件的段落。 切为了您的首选的dtd 。 论您使用的是htmlpurifier ,或者您使用的是一些第二次或第三次率,我毫无顾忌地指出,无论作为一个事实。 不能称赞这个图书馆较高。 始,您需要下载htmlpurifer 3.1.0rc1 (这是最新的版本在编写本报告时) ,并复制的内容包的 /library目录到我们的博客应用程序的/library 。 htmlpurifer如下梨类命名公约和文件的位置,我们需要作任何改变,我们include_path中。 果你愿意,你也可以安装htmlpurifer从梨频道所描述的下载页面。 然这是一个发布的候选版本我还没有遇到任何问题以外的其他使用习惯,我无法解释拼错htmlpurifier作为htmlpurifer导致了一些令人沮丧的头发拉的时刻! htmlpurifier的完善并非没有表现成本。 提高性能,将利用一个html定义缓存。 加新的基本目录在 /cache/htmlpurifier和授予权限足以让网络服务器写入文件存在。 要太赶上了安全性能不是一个地区要发挥scrooge不必要的 我们介绍我们的自定义过滤器类。 保存使用镜像的目录结构的zend framework的一如往常。 里的标准是我通常使用htmlpurifier保存到 /library/zfblog/filter/htmlpurifier.php : “ ?的php 一流的 zfblog_filter_htmlpurifier实现zend_filter_interface ( 护$ _htmlpurifier = 无效 ; 共职能 __construct ( $选项 = 无效 ) ( $的config = 无效 ; 如果 ( ! is_null ( $选项 ) ) ( $的config = htmlpurifier_config : : createdefault ( ) ; foreach ( $ 选择 $选项 ) ( $配置 - “ 设置 ( $选择 [ 0 ] , $选择 [ 1 ] , $选择 [ 2 ] ) ; ) ) $本 - “ _htmlpurifier = 新 htmlpurifier ( $配置 ) ; ) 共函数滤波器( $值 ) ( 返回 $本 - “ _htmlpurifier , ” 净化 ( $值 ) ; ) ) htmlpurifier选项有三个不同的内容,我们可以通过这个过滤器的一个数组。 们可以在这里停留,通过过滤器选择各种形式,但这是一个非常笼统的过滤器类的唯一宗旨就是要通过选择到htmlpurifier ,所以让我们添加一个子类的具体的html文本输入与预先选择 /library/zfblog/filter/htmlbody.php : “ ?的php 一流的 zfblog_filter_htmlbody延伸zfblog_filter_htmlpurifier ( 共职能 __construct ( $ newoptions = 无效 ) ( $选项 = 阵列 ( 阵列 ( '缓冲区' , ' serializerpath ' , 助: : $根 。 ' /缓存/ htmlpurifier ' ) , 阵列 ( '的html ' , '文档' , '严格的xhtml 1.0 ' ) , 阵列 ( '的html ' , '宠物' , '磷,时间, h1型,氢气,蛋白h3 , h4灯口, h5病毒,强有力的,是[ href ] ,美国ul ,醇,李鹏,代码前, ' 。 '引用, img公司[ src中|转氨酶|高度|宽度] ,亚,涉' ) , 阵列 ( '自动' , ' linkify ' , '真正的' ) , 阵列 ( '自动' , ' autoparagraph ' , '真正的' ) ) ; 如果 ( ! is_null ( $ newoptions ) ) ( / /我会告诉htmlpurifier覆盖原来的选择 / /使用新的过滤器 , 而不是他们自己 $选项 = array_merge ( $选择 , $ newoptions ) ; ) 长: : __construct ( $选项 ) ; ) ) 个新的子类通行证具体选择htmlpurifier 。 们提供的路径缓存目录以前创建,通知我们的输出图书馆应符合严格的xhtml 1.0 ,添加白名单允许的标记和属性,并最终使两个可选格式佣工自动段输出(包裹着与 <p>标签)和转变成超文本链接的网址。 果zfblog_filter_htmlbody需要进一步的调整,我们可以通过它选择此过滤器时,附加的表单元素。 确实是如何htmlpurifer工程。 过合理的默认值,使用前的配置非常简单。 我们的两个自定义过滤器在拖,我们现在需要确保zend framework的实际上可以找到它们! 们已经做到了这一点实际上以前注册时自订的装修路径zend_form 。 我们重复这个过程。 下是更新zfblog_form级由 /library/zfblog/form.php : “ ?的php 一流的 zfblog_form延伸zend_form ( 护$ _standardelementdecorator = 阵列 ( ' viewhelper ' , 阵列 ( ' labelerror ' , 阵列 ( '逃跑' = “假) ) , 阵列 ( ' htmltag ' , 阵列 ( '标记' = > “ 李' ) ) ) ; 护$ _buttonelementdecorator = 阵列 ( ' viewhelper ' ) ; 护$ _standardgroupdecorator = 阵列 ( ' formelements ' , 阵列 ( ' htmltag ' , 阵列 ( '标记' = > “ 醇' ) ) , ' fieldset ' ) ; 护$ _buttongroupdecorator = 阵列 ( ' formelements ' , ' fieldset ' ) ; 护$ _noelementdecorator = 阵列 ( ' viewhelper ' ) ; 共职能 __construct ( $选项 = 无效 ) ( / /路径设置为自定义类必须始终是第一次! $本 - “ addelementprefixpath ( ' zfblog_form_decorator ' , ' zfblog /表格/装饰/ ' , '装修' ) ; $本 - “ addelementprefixpath ( ' zfblog_filter ' , ' zfblog /滤镜/ ' , '过滤器' ) ; $本 - “ _setuptranslation ( ) ; 长: : __construct ( $选项 ) ; $本 - “ setattrib ( '可接受的字符集' , ' utf - 8的' ) ; $本 - “ setdecorators ( 阵列 ( ' formelements ' , '表' ) ) ; ) 护功能 _setuptranslation ( ) ( 如果 (自: : getdefaulttranslator ( ) ) ( 返回 ; ) $路径 =自助: : $根 。 ' /翻译/ forms.php ' ; $翻译 = 新 zend_translate ( '阵' , $路径 , '恩' ) ; 我: : setdefaulttranslator ( $翻译 ) ; ) ) 在zend_form可以使用我们的自定义过滤器。 去的事情,我们要做的就是重视我们的新htmlbody自定义过滤器的新形式以及其他一些过滤器的良好措施: “ ?的php 一流的 zfblog_form_entryadd延伸zfblog_form ( 共职能的init ( ) ( $本 - “ setaction ( ' /管理/项目/添加' ) ; / /显示组# 1 :读数据 $本 - “ addelement ( '文' , '标题' , 阵列 ( '装修' = “ $本 - ” _standardelementdecorator , '标签' = > “ 标题: ' , ' attribs ' = “ 阵列 ( '最大长度' = “ 200 , '大小' = “ 80 ) , '校验器' = “ 阵列 ( 阵列 ( ' stringlength ' , 虚假 , 数组 ( 3 , 200 ) ) ) , '过滤器' = “ 数组 ( ' stringtrim ' ) , '需要' = “ 真正 ) ) ; $本 - “ addelement ( '文' , '日期' , 阵列 ( '装修' = “ $本 - ” _standardelementdecorator , '标签' = > “ 日期: ' , ' attribs ' = “ 阵列 ( '最大长度' = “ 16 , '大小' = “ 16 ) , '价值' = “ zend_date : : 现在 ( ) - ” tostring ( '格式yyyy - mm -日时时:分分' ) , '校验器' = “ 阵列 ( 阵列 ( '日期' , 虚假 , 阵列 ( '格式yyyy - mm -日时时:分分' , '恩' ) ) ) , '需要' = “ 真正 ) ) ; $本 - “ addelement ( '文字' , ' entrybody ' , 阵列 ( '装修' = “ $本 - ” _standardelementdecorator , '标签' = > “ 入学团体: ' , '过滤器' = “ 数组 ( ' htmlbody ' ) , '需要' = “ 真正 ) ) ; $本 - “ addelement ( '文字' , ' entrybodyextended ' , 阵列 ( '装修' = “ $本 - ” _standardelementdecorator , '标签' = > “ 扩展团体: ' , '过滤器' = “ 数组 ( ' htmlbody ' ) ) ) ; $本 - “ adddisplaygroup ( 阵列 ( '标题' , '日期' , ' entrybody ' , ' entrybodyextended ' ) , ' entrydata , 阵列 ( ' disableloaddefaultdecorators ' = “ 真正的 , '装修' = “ $本 - ” _standardgroupdecorator , '传奇' = > “ 新项目' ) ) ; / /显示组# 2 :提交 $本 - “ addelement ( '提交' , '提交' , 阵列 ( '装修' = “ $本 - ” _buttonelementdecorator , '标签' = > “ 保存' ) ) ; $本 - “ adddisplaygroup ( 阵列 ( '提交' ) , ' entrydatasubmit ' , 阵列 ( ' disableloaddefaultdecorators ' = “ 真正的 , '装修' = “ $本 - ” _buttongroupdecorator , '级' = > “ 提出' ) ) ; ) ) 我们这种形式附在查看现在。 继续阅读“为例zend framework的博客应用教程:第8部分:创建和编辑博客条目破折号的htmlpurifier ” 期四, 10月25日。 2007年
这样做的事情称为梨: ...发布的帕德莱克布雷迪在一般的php , php安全上22:58 评论( 6 ) 引用( 0 ) 义的标签对此条目: 梨 , phing , php的 , 一般的php , php的安全 这样做的事情称为梨:包装的源代码分布梨 吧然后! 看过去博客条目倡导梨 (或发现它在本周 1 。 不必提出一个包梨这样做。 2 。 不必创建一个梨形“通道”虽然这是非常建议(另一个未来博客帖子毫无疑问) 。 3 。 并不需要大量的努力。 您的源代码,并创造一个梨形软件包是一个相对简单的任务。 软件包是一个gzip或包使用。 tgz扩展名。 包含的源代码进行安装,并且程序包定义文件, package.xml 。 package.xml档案是如何知道梨安装哪些文件复制下,除其他外像包细节,安装任务,安装后的脚本。 想要一个简单的后package.xml档案说明,但是这将是一个有点沉闷(可怕的xml ! )和我们不会修改任何xml反正(谁做了吗? ) 。 论如何,内包将成为源代码的目录里面反映您的图书馆/应用程序名称和package.xml定义。 一切听起来有趣了! 此,让我们挖出英寸由于编辑xml是一种肮脏的交易,我们要尽一切让梨的辛勤工作。 们真的需要是安装php脚本来产生package.xml动态。 是比较容易的获得pear_packagefilemanager (其中包括第2版的经理更现代的2.0 package.xml文件) 。 可以安装这个管理器使用: 安装pear_packagefilemanager 将假定您已经安装梨。 果你有它,这是一个旧的副本运行此第一; ) : 级梨梨 在,我们会使用管理脚本的php文件生成我们package.xml 。 先,这将复杂的,但它实际上并不困难。 部分的东西应该是很明显。 照意见的更多信息,并将该文件保存在根目录中的源代码。 们假设一个目录布局(在cvs / svn )的: 干 果您的源代码,与此不匹配准确,你可以修改dir_roles下面的选项, 档案: generate_package_xml.php “ ?的php require_once ( ' pear/packagefilemanager2.php ' ) ; : : seterrorhandling ( pear_error_die ) ; $选项 = 阵列 ( ' filelistgenerator ' = > “ 个人简历' , / /这个副本我们的源代码是一个cvs结帐 ' simpleoutput ' = “ 真正的 , ' baseinstalldir ' = > “ / ' , / /梨目录安装位置 ' packagedirectory ' = “ dirname ( <u>项目__file__ ” / ü “ ) , / /我们已经把这个文件的源代码的根目录 ' clearcontents ' = “ 真正的 , / /转储岁package.xml任何内容(一套虚假附加释放) / /没有捆绑简历/ svn文件或本发电机档案 '忽略' = “ 数组 ( ' generate_package_xml.php ' , ' 。 svn ' , ' 。个人简历* ' ) , ' dir_roles ' = “ 阵列 ( / /设置角色的一些目录;默认是php '文件' = > “ 文件' , '例子' = > “ 文件' , '试验' = > “ 测试' , ) , ) ; / /奇怪的是,这是一个php源代码包... $packagexml = &pear_packagefilemanager2:: importoptions ( $packagefile , $options ) ; $packagexml -> setpackagetype ( 'php' ) ; // package name, summary and longer description $packagexml -> setpackage ( 'mycoollibrary' ) ; $packagexml -> setsummary ( 'mycoollibrary does x, y and z' ) ; $packagexml -> setdescription ( "mycoollibrary does x, y and z. it follows specification w 1.0." ) ; // the channel where this package is hosted. since we're installing from a local // downloaded file rather than a channel we'll pretend it's from pear. $packagexml -> setchannel ( 'pear.php.net' ) ; // add some release notes! $notes = <<<eot - fixed bugs 1 , 3 , 6 , 9 - added documentation - implemented directory and file filtering with spl filteriterator eot; $packagexml -> setnotes ( $notes ) ; // add any known dependencies such as php version, extensions, pear installer $packagexml -> setphpdep ( '5.1.4' ) ; $packagexml -> setpearinstallerdep ( '1.4.0' ) ; $packagexml -> addpackagedepwithchannel ( 'required' , 'pear' , 'pear.php.net' , '1.4.0' ) ; // other info, like the lead developers. license, version details and stability type $packagexml -> addmaintainer ( 'lead' , 'padraic' , 'pádraic brady' , 'padraic@example.net' ) ; $packagexml -> setlicense ( 'new bsd license' , 'http://opensource.org/licenses/bsd-license.php' ) ; $packagexml -> setapiversion ( '0.0.1a' ) ; $packagexml -> setreleaseversion ( '0.0.1a' ) ; $packagexml -> setreleasestability ( 'alpha' ) ; $packagexml -> setapistability ( 'alpha' ) ; // add this as a release, and generate xml content $packagexml -> addrelease ( ) ; $packagexml -> generatecontents ( ) ; // pass a "make" flag from the command line or browser address to actually write // package.xml to disk, otherwise just debug it for any errors if ( isset ( $_get [ 'make' ] ) || ( isset ( $_server [ 'argv' ] ) && @ $_server [ 'argv' ] [ 1 ] == 'make' ) ) { $packagexml -> writepackagefile ( ) ; } else { $packagexml -> debugpackagefile ( ) ; ) ye gods! this stuff is just too complicated! yes, it's really that simple now comes the really hard part. visit this file in a browser adding "?make=1" to the url, or with the command line: php generate_package_xml.php make if you recheck the directory (the output will give it away) you'll see a new package.xml file. you can open it up to see why hand editing xml is such a bore. the pear_packagefilemanager2 is a massive time saver, and adds automation (secret ingredient to avoiding complex repetitive tasks). the next step is generating the pear installable package. this requires three steps: 1 。 validate package.xml 2 。 generate the package tarball 3 。 test install the package or, from the command line: pear package-validate package.xml pear package pear install --force mycoollibrary-1.0.0a.tgz [use --force if similar version is already installed] if you can follow these simple steps, you would be able to generate a pear package in seconds. then the whole world can download your package file, and run "pear install" on it. in my next visit to the world of pear, i'll add a little more automation (yes, more) using php's answer to java ant or the gnu's infamous make - phing . « previous page (page 1 of 1, totaling 3 entries) next page » 首页 view as pdf: this month | full blog | 历
quicksearch论 格雷格比弗约道歉到什么时候结束? 我认为zend_openid恨我... 讨厌它回来了! 周一, 2009年7月27日15:39 ...或者你可以提交你刚才乌拉圭回合代码pear2和快乐。你唯一需要的是他的能力吨 , 以符合[...] 布鲁斯weirdan约zend_feed_writer和zend_pubsubhubbub提案队列 mon, 27.07.2009 06:44 谢谢,只是想澄清。 btw ,为什么地球上的b日志不发送电子邮件至c omment作者时someo [...] kowalikus about zend_feed_reader promoted to zend framework trunk (watch out for zf 1.9!) thu, 23.07.2009 14:03 是啊! very helpful! alexis about zend_feed_writer and zend_pubsubhubbub in proposal queue mon, 20.07.2009 19:17 您好-这是非常酷! 你看你rabbithub为乌拉圭回合pshb实施? this will let you hook into b [...] padraic about zend_feed_writer and zend_pubsubhubbub in proposal queue sun, 19.07.2009 23:18 i'm already on the mailing lis t - i've mostly lurked anonymo usly as a non-member but recen tly joined - i'll raise [...] 布雷特slatkin约zend_feed_writer和zend_pubsubhubbub提案队列 sun, 19.07.2009 22:58 really happy to hear you're in terested in adding pubsubhubbu b support to the zend framewor k! that would be huge! d [...] padraic about zend_feed_writer and zend_pubsubhubbub in proposal queue sun, 19.07.2009 20:20 我应该说,更新的entr处可请求中的t , 他订户的端点。 padraic about zend_feed_writer and zend_pubsubhubbub in proposal queue sun, 19.07.2009 20:19 用户必须提供一个回调端点-集线器连接nds的通知(这是一个脓小时,而不是退出议定书) [...] 布鲁斯weirdan约zend_feed_writer和zend_pubsubhubbub提案队列 sun, 19.07.2009 19:48 in this protocol, does subscri ber polls the hub, or is it hu b that connects to the subscri ber and tells it somethi [...] franco about volunteer translators for zend framework: surviving the deep end wanted 星期六, 2009年7月18号20:22 i can help with the translatio n into spanish (i'm from argen tina), my english speaking isn 't very good, but i unde [...] thorsteb约zend_feed_reader晋升为zend framework的躯干(提防采埃孚1.9 ! ) thu, 16.07.2009 20:53 great news! 我知道他们的痛苦ÿ欧正经历像我一样相同的事情连词温。 looking forward for [...] 西蒙约zend_feed_reader晋升为zend framework的躯干(提防采埃孚1.9 ! ) 周四, 2009年7月16号14点14 当我长大了,我要力é你。 谢谢! miboo约zend_feed_reader晋升为zend framework的躯干(提防采埃孚1.9 ! ) wed, 15.07.2009 23:48 greaaaat ,非常有用 padraic about zend_feed_reader promoted to zend framework trunk (watch out for zf 1.9!) wed, 15.07.2009 22:17 yep - my mistake earlier. i've contacted some planet-php sta ff over twitter and helgi very kindly deleted the earl [...] padraic about zend_feed_reader promoted to zend framework trunk (watch out for zf 1.9!) wed, 15.07.2009 22:13 it's something of a loose end - it's simply not possible for me to replicate what zend_dat e does so the dependency [...] 类案 2009年7月 2009年6月 2009年5月 recent... older... 门引用show tagged entries application security astrum futura atom bdd behavior-driven development behaviour-driven development 书 dependency injection design patterns devnetwork docbook 文件 eve online 游戏 htmlpurifier inversion of control irish php user group irishisms maugrim microformat mock objects model mutateme mutation testing mvc模式 oauth 的openid openid and yadis pc gaming pear phing php的 php game development php games php general php security phpmock phpspec phpunit qgl quantum game library quantum star se rantings 的rss simpletest snarl solar empire surviving the deep end symfony tdd 教程 unit testing xp programming xrd xrds yadis yaml zend framework zf proposal | |||||||||||||||||||||||||||||||||||||||||||||||||
站由s9y -设计的卡尔