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


PHP Reflection::export方法代码示例

本文整理汇总了PHP中Reflection::export方法的典型用法代码示例。如果您正苦于以下问题:PHP Reflection::export方法的具体用法?PHP Reflection::export怎么用?PHP Reflection::export使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Reflection的用法示例。


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

示例1: __construct

 public function __construct($class, $test_func)
 {
     // buffer output and collect it for later use.
     $this->test_start($class);
     $this->test_start("Reflection", true);
     // create the reflector
     $this->reflector = new ReflectionClass($class);
     Reflection::export($this->reflector);
     echo $this->test_end("Reflection");
     // run test function
     $this->test_set_success($class, $test_func($this, $this->reflector));
     $this->buffer = $this->test_end($class);
     //var_dump($this->tests);
     //$this->buffer = $this->tests[$class]['buffer'];
 }
开发者ID:AaronAsAChimp,项目名称:gfonted,代码行数:15,代码来源:test_harness.php

示例2: serve

 /**
  * This method calls functions on the implementation class and returns the output or Fault object in case of error to client
  *
  * @return unknown
  */
 function serve()
 {
     if (empty($_REQUEST['method']) || !method_exists($this->implementation, $_REQUEST['method'])) {
         if (empty($_REQUEST['method'])) {
             echo '<pre>';
             Reflection::export(new ReflectionClass(get_class($this->implementation)));
         } else {
             $er = new SoapError();
             $er->set_error('invalid_call');
             $this->fault($er);
         }
     } else {
         $method = $_REQUEST['method'];
         return $this->implementation->{$method}();
     }
     // else
 }
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:22,代码来源:SugarRest.php

示例3: _update

 function _update(KISS_DataObject $pKDO)
 {
     $keys = $pKDO->get_keys();
     foreach ($keys['primary'] as $key => $value) {
         $sub_sql[] = "{$value['column']}=:{$value['column']}";
     }
     $columns = $pKDO->get_columns();
     foreach ($columns as $key => $value) {
         $sub_sql1[] = "{$key}=:{$key}";
     }
     $sql = sprintf(self::SQL_UPDATE, 'student', implode(',', $sub_sql1), implode(' and ', $sub_sql));
     $db = new PDO('mysql:host=127.0.0.1;dbname=test', 'web', 'develop');
     $stmt = $db->prepare($sql);
     foreach ($columns as $key => $value) {
         $stmt->bindParam($key, $pKDO->{$key});
     }
     Reflection::export(new ReflectionObject($stmt));
     //$stmt->execute();
 }
开发者ID:iwater,项目名称:kissphp,代码行数:19,代码来源:SQLObject.php

示例4: test

<?php

class CdProduct
{
    public $data;
    public function test()
    {
        return true;
    }
}
//
print_r(get_class_methods('CdProduct'));
//反射
$prod_class = new ReflectionClass('CdProduct');
Reflection::export($prod_class);
开发者ID:cdandy,项目名称:code-lib,代码行数:15,代码来源:test1.php

示例5: ReflectionClass

<?php

/**
 * Created by PhpStorm.
 * User: Nigel
 * Date: 2016/1/14
 * Time: 20:46
 */
use Nigel\NEU\AAO;
include "autoload.php";
Reflection::export(new ReflectionClass(new stdClass()));
开发者ID:j178,项目名称:crack-neu-php,代码行数:11,代码来源:tmp.php

示例6: ReflectionClass

<?php

class just_constants
{
    const BOOLEAN_CONSTANT = true;
    const NULL_CONSTANT = null;
    const STRING_CONSTANT = 'This is a string';
    const INTEGER_CONSTANT = 1000;
    const FLOAT_CONSTANT = 3.14159265;
}
Reflection::export(new ReflectionClass('just_constants'));
开发者ID:badlamer,项目名称:hhvm,代码行数:11,代码来源:bug29986.php

示例7: classInfo

 public static function classInfo($classname)
 {
     echo "<pre>";
     Reflection::export(new ReflectionClass($classname));
     echo "</pre>";
 }
开发者ID:Grapheme,项目名称:dada,代码行数:6,代码来源:Helper.php

示例8: foo

<?php

function foo()
{
}
class bar
{
    private function foo()
    {
    }
}
Reflection::export(new ReflectionFunction('foo'));
Reflection::export(new ReflectionMethod('bar', 'foo'));
?>
===DONE===
开发者ID:gleamingthecube,项目名称:php,代码行数:15,代码来源:ext_reflection_tests_bug41061.php

示例9: my_error_handler

<?php

function my_error_handler($errno, $errstr, $errfile, $errline)
{
    echo "Error: {$errstr}\n";
}
set_error_handler('my_error_handler');
class Setting extends ReflectionObject
{
}
Reflection::export(simplexml_load_string('<test/>', 'Setting'));
Reflection::export(simplexml_load_file('data:,<test/>', 'Setting'));
?>
===DONE===
开发者ID:badlamer,项目名称:hhvm,代码行数:14,代码来源:bug37565.php

示例10: printf

printf("%s is %sabstract.<br />\n", $rc->getName(), $rc->isAbstract() ? '' : 'not ');
printf("%s is %sfinal.</p>\n", $rc->getName(), $rc->isFinal() ? '' : 'not ');
$constants = $rc->getConstants();
$num_constants = count($constants);
printf("%s defines %d constant%s", $rc->getName(), $num_constants == 0 ? 'no' : $num_constants, $num_constants != 1 ? 's' : '');
if ($num_constants > 0) {
    printf(":<pre>%s</pre>", print_r($constants, TRUE));
}
$props = $rc->getProperties();
$num_props = count($props);
printf("%s defines %d propert%s", $rc->getName(), $num_props == 0 ? 'no' : $num_props, $num_props == 1 ? 'y' : 'ies');
if ($num_props > 0) {
    print ':';
    foreach ($props as $prop) {
        print "<pre>";
        Reflection::export($prop);
        print "</pre>";
    }
}
$methods = $rc->getMethods();
$num_methods = count($methods);
printf("%s defines %d method%s<br />\n", $rc->getName(), $num_methods == 0 ? 'no' : $num_methods, $num_methods != 1 ? 's' : '');
if ($num_methods > 0) {
    print '<p>';
    foreach ($methods as $method) {
        printf("%s%s%s%s%s%s() ", $method->isFinal() ? 'final ' : '', $method->isAbstract() ? 'abstract ' : '', $method->isPublic() ? 'public ' : '', $method->isPrivate() ? 'private ' : '', $method->isProtected() ? 'protected ' : '', $method->getName());
        $params = $method->getParameters();
        $num_params = count($params);
        printf("has %s parameter%s%s", $num_params == 0 ? 'no' : $num_params, $num_params != 1 ? 's' : '', $num_params > 0 ? ': ' : '');
        if ($num_params > 0) {
            $names = array();
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:31,代码来源:reflection-example-2.php

示例11: sayHello

<pre>
<?php 
function sayHello($name, $h)
{
    static $count = 0;
    return "<h{$h}>Hello, {$name}</h{$h}>";
}
// Обзор функции
Reflection::export(new ReflectionFunction('sayHello'));
// Создание экземпляра класса ReflectionFunction
$func = new ReflectionFunction('sayHello');
// Вывод основной информации
printf("<p>===> %s функция '%s'\n" . "     объявлена в %s\n" . "     строки с %d по %d\n", $func->isInternal() ? 'Internal' : 'User-defined', $func->getName(), $func->getFileName(), $func->getStartLine(), $func->getEndline());
// Вывод статических переменных, если они есть
if ($statics = $func->getStaticVariables()) {
    printf("<p>---> Статическая переменная: %s\n", var_export($statics, 1));
}
// Вызов функции
printf("<p>---> Результат вызова: ");
$result = $func->invoke("John", "1");
echo $result;
?>
</pre>
开发者ID:sydorenkovd,项目名称:features_for_phpoopsecond.local,代码行数:23,代码来源:01-function.php

示例12: ReflectionFunction

<?php

Reflection::export(new ReflectionFunction('htmlspecialchars'));
Reflection::export(new ReflectionFunction('get_html_translation_table'));
开发者ID:gleamingthecube,项目名称:php,代码行数:4,代码来源:ext_standard_tests_strings_bug61116.php

示例13: __construct

    /**
     * My constructor
     * @param string $name
     */
    public function __construct($name)
    {
        $this->name = $name;
    }
    public function getName()
    {
        return $this->name;
    }
    public function setSpouse(Person $spouse)
    {
        $this->spouse = $spouse;
    }
    private function setPassword($password)
    {
        $this->password = $password;
    }
}
$reflectionClass = new ReflectionClass('Person');
echo Reflection::export($reflectionClass, true);
$firstMethod = $reflectionClass->getMethods()[0];
$firstProperty = $reflectionClass->getProperties()[0];
var_dump($reflectionClass->getMethods(), $reflectionClass->hasMethod('getName'), $firstMethod->getDocComment(), $firstMethod->getParameters(), $reflectionClass->getProperties(), $firstProperty->isPublic());
echo '<hr />';
ReflectionObject::export(new Person('Reflection'));
?>
</pre>
开发者ID:milanchheda,项目名称:php-certification-training,代码行数:30,代码来源:Reflection.php

示例14: foo

<pre>
<?php 
abstract class MyClass
{
    public $a = 1;
    protected $b = 2;
    private $c = 3;
    public static $cnt = 0;
    const HANDS = 2;
    abstract function foo();
    public static function bar()
    {
        //Что-то делаем
    }
    public function sayHello($name, $h = "1")
    {
        static $count = 0;
        return "<h{$h}>Hello, {$name}</h{$h}>";
    }
}
// Обзор пользовательского класса
Reflection::export(new ReflectionClass('MyClass'));
exit;
// Обзор встроенного класса
Reflection::export(new ReflectionClass('Exception'));
?>
</pre>
开发者ID:kapsilon,项目名称:Specialist,代码行数:27,代码来源:04-class-1.php

示例15: reflectionClass

 /**
  * Возвращает структуру класса
  *
  * @param string $var
  *
  * @return string
  */
 protected function reflectionClass($var)
 {
     $classInfo = new \ReflectionClass($var);
     return \Reflection::export($classInfo, true);
 }
开发者ID:abc-framework,项目名称:abc-framework,代码行数:12,代码来源:TraceClass.php


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