如果您的PHP代码使用了全局变量,那么应该更新它。
If your PHP code USES global variables, you should update it.
你可以用另一种方式登录,在你的一个场景中同时接受用户名和口令,它会应用到全局,甚至是代码。
You can rephrase login to take both username and password in one of your scenarios, and it will globally apply, even for the code.
在这种情况下,与其在每个组件中包含代码片段来检查,还不如强制实行一个全局标准更为容易。
In such a case, instead of including code snippets to do this check at each component, enforcing a global standard is easier.
这样做不仅使代码变得更具可测试性,而且也使它不依赖于方法的全局变量。
Doing this not only has made the code more testable, but also made it not depend on the global variables in the method.
通过使用全局转发,只要逻辑引用名不变,我们就不必因为URI有所变动而修改我们的代码。
Using global forwards, we protect our code from changes to the URI as long as the logic reference name remains constant.
除了其他事情外,它定义一个全局错误处理程序,在此将放置在执行主应用程序逻辑之前要运行的特定于平台的代码。
Among other things, it defines a global error handler, and it is where you would place any platform-specific code to run before executing main application logic.
但是,默认的情况是,EMF代码生成器只为全局元素生成映射条目,而不为局部元素生成。
However, by default, the EMF code generator only generates mapping entries for global elements, not for local elements.
当在某个进程的上下文中执行以此模式运行的代码时,它不仅对全局内核地址空间具有读写访问权限,还将对该进程中的内核数据也具有读写访问权限。
Code operating in this mode has read and write access to the global kernel address space and kernel data in the process region when executing within the context of a process.
在代码部分,定义了一个函数地址,方法同上述定义全局变量的相同——只需在它们的名称之后跟上一个冒号。
In the code section, you define a function's address the same way you defined addresses for global variables above — just put their name followed by a colon.
可以定义任意数量的全局装备,因此可以把初始化代码分割为多个部分。
You can define any number of global fixtures, which allows splitting up of initialization code.
这些模板被编码为RPG全局变量,以便允许将来重用通用模板名称并最小化代码修改。
These are coded as RPG global variables to allow subsequent reuse of the generic template names and minimize code modification.
一种更为复杂的技术是以全局数据不被破坏的方式生成中间代码。
A more sophisticated technique is to generate intermediate code in such a way that the global data doesn't get mangled.
代码从全局上下文获取表单变量,并检查是否已经填充。
The code gets the form variables from the Global Context and checks whether they have been filled out.
此代码将全局变量设置为文档通用ID的值加上两项的值。
This code sets global variables to the value of the universal ID of the document plus the values of the two items.
这使得我们能够对代码进行重构,不再使用全局变量。
This can open up the possibility of refactoring this code down the road to not use the global variables at all.
新代码确实非常快,但是在每次测量中它都会长时间独占cpu并使用更多的全局CPU时间。
The newer code does complete more quickly, but by every measure it also severely monopolizes the CPU for long periods of time and USES more overall CPU time.
下面的代码提供了一个为全局对象创建模板并且设置全局函数的例子。
The following code provides an example of creating a template for the global object and setting the built-in global functions.
如果跟踪模式没有被设为OFF(即默认情况),那么将使用下面的名称和格式,把每个入口、出口和非零s QL代码都记录到一个全局临时表中。
If the trace mode is not set to OFF (which is the default), then each entry, exit and non-zero SQL code will be logged in a global temp table with the following name and format.
另一方面,Expandos本质上是全局的:一旦expando代码执行,这些改变将会出现在应用程序的其余部分中。
Expandos, on the other hand, are global in nature: Once the expando code has executed, those changes appear for the rest of the application.
清单4中所示的Ruby代码通过在HTML响应中对此全局上下文进行序列化展示了其完整内容。
The Ruby code in Listing 4 shows the entire contents of the global context by serializing it within the HTML response.
通过使用 sys_nerr全局变量和strerror()函数,将可以很轻松地快速编写一些代码(请参见清单5)以打印出系统的所有内置错误消息。
Using the sys_nerr global variable and the strerror() function, you can easily whip up some code (see Listing 5) to print out all of the built-in error messages of the system.
我们将能够使用Zero全局上下文来访问Groovy代码中的这组名称-值对。
We will be able to access this set of name-value pairs in our Groovy code using Zero's global context.
您应当十分熟悉用于填充带有 Flex应用程序引用的 flexApp全局变量的代码。
You should be familiar with the code used to populate the global flexApp variable with a reference to the Flex application.
该代码在一个Web应用程序(Servlet)中,或者位于在全局事务边界内未执行的EJB方法中。
This code is either in a Web application (servlet) or in an EJB method that is not executed in a global transaction boundary.
我们讨论了如何使用模板继承来向servlet代码透明的添加行为(比如启动和提交全局事务)。
We discussed how template inheritance can be used to add behaviors (like starting and committing a global transaction) transparently to the servlet code.
调用Web服务时,运行代码来以恰当的值初始化所有全局枚举对象(在本例中是创建一个BookTypeInitializer类的实例来完成的)。
When the Web service is called, run code to initialize all the global enumeration objects with proper values (in our case, by creating an instance of the BookTypeInitializer class).
正如清单5中的“mandatoryinitialization”代码行所示,在使用前,必须初始化这个全局的google对象。
As indicated by the "mandatory initialization" line in Listing 5, you have to initialize the global Google object before using it.
历史应用程序(即很过时的遗留代码)有时会直接引用这些全局变量,但会在编译过程中产生错误,因为它们的声明并不一致。
Historical applications (that is, horribly outdated legacy code) sometimes refer to these directly, but produce errors during compilation because they're declared inconsistently.
最终,为了避免破坏代码的可读性ThoughtWorks的工程通常避免使用编程语言特有的语法(例如Ruby语言中匿名全局变量)。
To this end, ThoughtWorks projects generally avoid the more magical features of languages (like the implicit global variables in Ruby, for example) because it hurts readability.
这可以通过在信号处理程序代码中设置一个全局标志并在完成关键部分的代码之后检查这个标志来实现。
This can be achieved by setting a global flag in the handler code and checking for the flag after completion of the critical part.
应用推荐