本文整理汇总了Python中lib.drupy.DrupyPHP.require_once方法的典型用法代码示例。如果您正苦于以下问题:Python DrupyPHP.require_once方法的具体用法?Python DrupyPHP.require_once怎么用?Python DrupyPHP.require_once使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.drupy.DrupyPHP
的用法示例。
在下文中一共展示了DrupyPHP.require_once方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _registry_check_code
# 需要导入模块: from lib.drupy import DrupyPHP [as 别名]
# 或者: from lib.drupy.DrupyPHP import require_once [as 别名]
def _registry_check_code(type_, name):
"""
Helper for registry_check_{interface, class}.
"""
file = db_result(db_query("SELECT filename FROM {registry} WHERE name = '%s' AND type = '%s'", name, type_))
if file:
php.require_once(file)
registry_mark_code(type_, name)
return True
示例2: registry_load_path_files
# 需要导入模块: from lib.drupy import DrupyPHP [as 别名]
# 或者: from lib.drupy.DrupyPHP import require_once [as 别名]
def registry_load_path_files(return_=False):
"""
registry_load_path_files
"""
php.static(registry_load_path_files, "file_cache_data", [])
if return_:
sort(registry_load_path_files.file_cache_data)
return registry_load_path_files.file_cache_data
menu = menu_get_item()
cache = cache_get("registry:" + menu["path"], "cache_registry")
if not php.empty(cache.data):
for file in php.explode(";", cache.data):
php.require_once(file)
registry_load_path_files.file_cache_data.append(file)
示例3: load_include
# 需要导入模块: from lib.drupy import DrupyPHP [as 别名]
# 或者: from lib.drupy.DrupyPHP import require_once [as 别名]
def load_include(type_, plugin_, name = None):
"""
Load a plugin include file.
@param type
The include file's type (file extension).
@param plugin
The plugin to which the include file belongs.
@param name
Optionally, specify the file name. If not set, the plugin's name is used.
"""
if (php.empty(name)):
name = plugin_
file = './' + drupal_get_path('plugin', plugin) + "/name.type"
if (php.is_file(file)):
php.require_once( file )
return file
else:
return False