php++i和i++区别
In the last part we looked at why the IBM i (AS/400, System i, i) is not a dinosaur but instead a very powerful machine that can function as either a standalone mainframe or as a very cost effective and scalable server. Just remember what will happen if you don’t believe that; I will track you down and fight you in a bar. Forewarned is forearmed as Cacciaguida once said.
在最后一部分中,我们研究了为什么IBM i(AS / 400,System i,i)不是恐龙,而是功能强大的机器,既可以充当独立的大型机,又可以充当非常经济高效的可扩展服务器。 只要记住,如果不相信会发生什么? 我会追踪您并在酒吧与您搏斗。 正如卡恰圭达曾说过的那样,预先警告。
We also talked about what this has to do with you, a freaked out web programmer: many people in the i world do not have time to learn PHP (and HTML and CSS and JavaScript and jQuery, etc.) and so there’s a real opportunity for you to market your skills to an RPG-oriented IBM i shop that wants to do some PHP (and everyone wants to do something to overcome the fact that IBM has failed to provide the i with a native GUI interface other than Java).
我们还谈到了这与一个疯狂的Web程序员有什么关系:i世界中的许多人没有时间学习PHP(以及HTML,CSS,JavaScript和jQuery等),因此确实有机会让您向想做一些PHP的面向RPG的IBM i商店推销您的技能(每个人都想做些事情来克服IBM未能为i提供Java以外的本机GUI接口这一事实)。
In this somewhat risqué episode, we’ll look at just what you need to be able to do development work on the i. Many people in the i world will that PHP is native to the i, but I don’t think that’s really true. To me, native means that it just runs, no problems or questions asked, nothing special needs to be done, it just sort of happens like when you see someone across a crowded room and know she/he is “the one”. That’s not the way it works with PHP and the i.
在这个颇有风险的情节中,我们将介绍您需要能够在i上进行开发工作的内容。 i世界中的许多人会认为PHP是i的本机,但是我认为这不是真的。 对我而言,原生意味着它可以运行,没有问题或问题,不需要做任何特殊的事情,就像发生在拥挤的房间里看到某人并且知道他/他是“那个”那样时,这种事情就发生了。 那不是与PHP和i一起工作的方式。
RPG is a native language on the i, but PHP has been added and with the appropriate bridges you can run PHP just as easily (more or less) as RPG. The tool for RPG is the RPG compiler, supplied by IBM (as a chargeable item of course). The bridge that lets PHP run on the i is the Zend package (server/studio/framework) provide by Zend.
RPG是i上的一种本地语言,但是已经添加了PHP,并且使用适当的桥,您可以像运行RPG一样容易(或多或少)运行PHP。 RPG的工具是IBM提供的RPG编译器(当然是收费项目)。 让PHP在i上运行的桥梁是Zend提供的Zend包(服务器/工作室/框架)。
Yes, those are the people who more or less have become the corporate face of PHP, and they’ve struck an uncommonly close relationship with IBM. They go on vacation with Tom Watson, and otherwise worship at the IBM shrine in Armonk. In return, IBM has given them the PHP keys to the i. Zend is pretty much the exclusive vendor if you want to use PHP on the i. I say pretty much because Aura also has a PHP stack that you can purchase, but there is very little doubt that the Zend implementation is the cat’s meow, the bee’s knees, and all that jazz. The thing that makes the Zend implementation superior is not the PHP stuff, but rather the extra things that they have written that help PHP interface more smoothly and more natively with the i. Things like an asynchronous i interface that allows you to create PHP programs that will run not just online as they would on the web, but also in batch mode as they might need to run in a true mainframe.
是的,这些人或多或少已成为PHP的企业形象,他们与IBM之间的关系异常罕见。 他们与汤姆·沃森(Tom Watson)一起度假,或者在Armonk的IBM神社里崇拜。 作为回报,IBM为他们提供了iPHP密钥。 如果您想在i上使用PHP,Zend几乎是独家供应商。 我之所以这么说是因为Aura还有一个可以购买PHP堆栈,但是毫无疑问,Zend的实现是猫的叫声,蜜蜂的膝盖和爵士乐。 使Zend实现更出色的不是PHP方面的东西,而是他们编写的可帮助PHP与i更加流畅和本地化地交互的多余内容。 诸如异步i界面之类的东西使您可以创建PHP程序,这些程序不仅可以像在Web上一样在线运行,而且可以批处理模式运行,因为它们可能需要在真正的大型机中运行。
The bottom line is this: if you want to do PHP, significant PHP, on the i, you need to be using the Zend package on the i. And that means when you approach an i shop, that they need to have the Zend package installed on their machine. The fact is that there is not a reasonable alternative to Zend on the i.
底线是:如果要在i上进行PHP(重要PHP),则需要在i上使用Zend包。 这意味着当您访问网上商店时,他们需要在其计算机上安装Zend软件包。 事实是,在i上没有替代Zend的合理选择。
Some shops may already have Zend installed, but most may not. And they may tell you that they don’t have budget approval to purchase additional software (and so they may want you to just be able to do it from the web, which is not possible so forget that). Fortunately, Zend has an agreement with IBM for all i users under maintenance (which would be almost all i users and you don’t want to get mixed up with anyone who is not on maintenance), to be able to get free versions of the Zend product.
有些商店可能已经安装了Zend,但大多数商店可能没有。 而且他们可能会告诉您他们没有预算许可来购买其他软件(因此,他们可能希望您仅能够从网络上购买它,而这是不可能的,因此请忘记这一点)。 幸运的是,Zend与IBM达成了一项协议,要求所有处于维护状态的i用户(几乎是所有i用户,并且您不希望与不处于维护状态的任何人混为一谈),以便能够获得免费版本的Zend产品。
The Zend product itself consists of three components. The first is Zend Server, which provides the stack required to run PHP on the i (the PHP language, an instance of the Apache server, and the SQL database). Zend Server also includes any of the additional modules written to make life with the i simpler. The agreement provides a version of the Zend Server, specifically the Zend Server Community Edition, that can be downloaded onto the i for free. This is not the premium version, of course, but most of the things missing from it are associated with deploying large scale PHP applications and are not required until you have grown your PHP application to the point an enterprise-oriented version is required. By that time the shop is hooked and having to buy a version, it would already have a solid ROI attached to it.
Zend产品本身包含三个组件。 第一个是Zend Server,它提供在i上运行PHP所需的堆栈(PHP语言,Apache服务器的实例和SQL数据库)。 Zend Server还包括为使i的生活更简单而编写的任何其他模块。 该协议提供了Zend Server的一个版本,特别是Zend Server社区版,可以免费下载到i上。 当然,这不是高级版本,但是它缺少的大多数东西都与部署大型PHP应用程序有关,并且直到您将PHP应用程序扩展到需要面向企业的版本时才需要。 到那个时候,商店已经迷上了,不得不购买一个版本,它已经有了稳定的投资回报率。
The second component is Zend Studio. This is something that would run not on the i per se, but on the PCs attached to it. It’s basically the IDE that you develop your PHP scripts on instead of a text editor. It consists of a text editor, of course, but also incorporates a debugger and testing software.
第二个组件是Zend Studio。 这不是在本身上而是在与其连接的PC上运行的东西。 基本上是在IDE上开发PHP脚本,而不是在文本编辑器上。 它当然包含一个文本编辑器,但还包含一个调试器和测试软件。
The community edition of Zend Server is something that is available on any platform that uses Zend to provide it’s stack, but the version of Zend Studio is specific to the i, and so is the arrangement that Zend has with IBM. You can download Zend Studio for free as an i user, but the caveat is that once you download it, you can’ download any updates or new versions. You are stuck on that version until you decide to pay for a new version.
Zend Server社区版是在使用Zend提供堆栈的任何平台上都可以使用的,但是Zend Studio的版本特定于i,因此Zend与IBM的安排也是如此。 您可以i用户的身份免费下载Zend Studio,但要注意的是,一旦下载Zend Studio,就不能下载任何更新或新版本。 在您决定为新版本付费之前,您一直停留在该版本上。
The third component is the Zend Framework, which provides the kind of things that any other framework does. This can also be downloaded with Zend Studio.
第三个组件是Zend框架,它提供了其他任何框架都可以做的事情。 也可以使用Zend Studio下载。
One question that you may have is where to put the scripts that you develop. If you are dealing with RPG programs, they go in special files, like QRPGLESRC, QCLSRC, etc. depending on what type of program you are developing. These are kept within the data base for the i itself. But PHP scripts are kept somewhere else.
您可能要解决的一个问题是将开发的脚本放在哪里。 如果您正在处理RPG程序,则它们会放入特殊文件中,例如QRPGLESRC , QCLSRC等,具体取决于您正在开发的程序类型。 这些信息保存在i本身的数据库中。 但是PHP脚本保留在其他位置。
In every i there is something called the IFS. Many i people don’t know too much about it, but it is basically a windows oriented area where you can set up folders (the i uses libraries, not folders) and store documents. This is where your PHP scripts will be stored; in /htdocs/*.
在每个我中都有一个称为IFS的东西。 我中的许多人对此并不了解太多,但是基本上它是一个面向Windows的区域,您可以在其中设置文件夹(我使用库,而不是文件夹)并存储文档。 这是您PHP脚本的存储位置; 在/htdocs/* 。
There is one other thing that we should talk about; namely the fact that you will be developing not just a PHP/JavaScript/CSS web application, but an RPG application. That is, like I said in the previous article, RPG is not a dead language. It is actually a very superior language in which to write business applications. It does a great job of handling business logic and has a built in database language simpler than SQL (although you can use SQL with RPG). The old knock against RPG was that it was positional in nature and thereby weird (the latest versions of RPG eliminates this and provides a more English-like language syntax.) To make sense, any application would have to be a combination of RPG and PHP, with modules of each type.
我们应该谈谈另一件事。 也就是说,您将不仅在开发PHP / JavaScript / CSS Web应用程序,而且还在开发RPG应用程序。 就是说,就像我在上一篇文章中所说的那样,RPG并非一成不变的语言。 实际上,这是编写业务应用程序时使用的一种非常出色的语言。 它在处理业务逻辑方面做得很好,并且具有比SQL更简单的内置数据库语言(尽管您可以将SQL与RPG一起使用)。 反对RPG的陈旧说法是,它本质上是定位性的,因此很奇怪(最新版本的RPG消除了这一点,并提供了更像英语的语言语法。)要说得通,任何应用程序都必须是RPG和PHP的组合,以及每种类型的模块。
It makes sense to do the C and M part of MVC in RPG and the V in PHP. Why am I saying this? I am at heart a mainframe programmer (Cobol first because it was the language that God used to create the world and RPG second because everything that has happened since 1810 has been done in RPG).
在RPG中完成MVC的C和M部分,在PHP中完成V的想法是有意义的。 我为什么这么说呢? 我从本质上说是大型机程序员(Cobol首先是因为上帝是上帝用来创造世界的语言,其次是RPG,因为自1810年以来发生的所有事情都在RPG中完成)。
RPG people are used to creating a single RPG program that combines all three into one simple monolithic mess that was almost guaranteed to be unmaintainable once the original programmer had moved on. As a result, the first thing you’ll have to do is get the i people to start with an MVC type design. This was something that was very difficult in an RPG environment until about a decade ago, but now with ILE and RPG/Free, it’s something that can be done.
RPG人员习惯于创建一个单一的RPG程序,将所有三个程序合并为一个简单的整体混乱,几乎可以肯定,一旦原始程序员继续工作,该混乱便无法维护。 结果,您要做的第一件事就是让i人开始使用MVC类型设计。 直到大约十年前,这在RPG环境中还是很困难的,但是现在有了ILE和RPG / Free,这是可以做到的。
And that’s about it. At least to begin with. The last of our series is just around the corner, and we’ll talk about what goes into developing good business screens. In the meantime, good luck!
就是这样。 至少从开始。 我们系列的最后一部分就在眼前,我们将讨论开发良好的业务屏幕的过程。 同时祝您好运!
Image via Fotolia
图片来自Fotolia
翻译自: https://www.sitepoint.com/php-and-the-i-2/
php++i和i++区别