当前位置: 首页>>代码示例>>PHP>>正文


PHP phutil_register_library函数代码示例

本文整理汇总了PHP中phutil_register_library函数的典型用法代码示例。如果您正苦于以下问题:PHP phutil_register_library函数的具体用法?PHP phutil_register_library怎么用?PHP phutil_register_library使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了phutil_register_library函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: phutil_register_library

<?php

phutil_register_library('rtplinter', __FILE__);
开发者ID:bsimser,项目名称:rise-to-power,代码行数:3,代码来源:__phutil_library_init__.php

示例2: dirname

$root = dirname(__FILE__);
require_once $root . '/moduleutils/core.php';
require_once $root . '/moduleutils/PhutilBootloader.php';
require_once $root . '/moduleutils/PhutilBootloaderException.php';
require_once $root . '/moduleutils/PhutilLibraryConflictException.php';
function __phutil_autoload($class_name)
{
    // Occurs in PHP 5.2 with `call_user_func(array($this, 'self::f'))`.
    if ($class_name === 'self' || $class_name === 'parent') {
        return;
    }
    try {
        $loader = new PhutilSymbolLoader();
        $symbols = $loader->setType('class')->setName($class_name)->selectAndLoadSymbols();
        if (!$symbols) {
            throw new PhutilMissingSymbolException($class_name, 'class or interface', "the class or interface '{$class_name}' is not defined in the library " . "map for any loaded phutil library.");
        }
    } catch (PhutilMissingSymbolException $ex) {
        // If there are other SPL autoloaders installed, we need to give them a
        // chance to load the class. Throw the exception if we're the last
        // autoloader; if not, swallow it and let them take a shot.
        $autoloaders = spl_autoload_functions();
        $last = end($autoloaders);
        if ($last == __FUNCTION__) {
            throw $ex;
        }
    }
}
spl_autoload_register('__phutil_autoload', $throw = true);
phutil_register_library('phutil', __FILE__);
开发者ID:lsubra,项目名称:libphutil,代码行数:30,代码来源:__phutil_library_init__.php

示例3: phutil_register_library

<?php

// Copyright 2004-present Facebook.  All rights reserved.
phutil_register_library('jcommon', __FILE__);
开发者ID:tigerqiu712,项目名称:jcommon,代码行数:4,代码来源:__phutil_library_init__.php


注:本文中的phutil_register_library函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。