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


PHP spl_classes函数代码示例

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


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

示例1: getClass

/**
 * 获得spl的所有class
 */
function getClass()
{
    $spl_classes = spl_classes();
    foreach ($spl_classes as $key => $val) {
        echo $key . '=>' . $val . '<br />';
    }
}
开发者ID:ray0916,项目名称:learn,代码行数:10,代码来源:base.php

示例2: testCanMockAllSplClasses

 function testCanMockAllSplClasses()
 {
     if (!function_exists('spl_classes')) {
         return;
     }
     foreach (spl_classes() as $class) {
         $mock_class = "Mock{$class}";
         Mock::generate($class);
         $this->assertIsA(new $mock_class(), $mock_class);
     }
 }
开发者ID:sebs,项目名称:simpletest,代码行数:11,代码来源:interfaces_test.php

示例3: testCanMockAllSplClasses

 public function testCanMockAllSplClasses()
 {
     static $classesToExclude = ['SplHeap'];
     foreach (spl_classes() as $class) {
         // exclude classes
         if (in_array($class, $classesToExclude)) {
             continue;
         }
         $mock_class = "Mock{$class}";
         Mock::generate($class);
         $this->assertIsA(new $mock_class(), $mock_class);
     }
 }
开发者ID:simpletest,项目名称:simpletest,代码行数:13,代码来源:interfaces_test.php

示例4: testCanMockAllSplClasses

 function testCanMockAllSplClasses()
 {
     if (!function_exists('spl_classes')) {
         return;
     }
     foreach (spl_classes() as $class) {
         if ($class == 'SplHeap') {
             continue;
         }
         if (version_compare(PHP_VERSION, '5.1', '<') && $class == 'CachingIterator' || $class == 'CachingRecursiveIterator' || $class == 'FilterIterator' || $class == 'LimitIterator' || $class == 'ParentIterator') {
             // These iterators require an iterator be passed to them during
             // construction in PHP 5.0; there is no way for SimpleTest
             // to supply such an iterator, however, so support for it is
             // disabled.
             continue;
         }
         $mock_class = "Mock{$class}";
         Mock::generate($class);
         $this->assertIsA(new $mock_class(), $mock_class);
     }
 }
开发者ID:ningcaichen,项目名称:laravel-4.1-quick-start-cn,代码行数:21,代码来源:interfaces_test.php

示例5: register

 public static function register()
 {
     $autoloads = spl_autoload_functions();
     $callback = array(__CLASS__, 'loadClass');
     //@codeCoverageIgnoreStart
     if (!in_array($callback, $autoloads)) {
         spl_autoload_register($callback);
     }
     if (is_null(self::$splClasses)) {
         self::$splClasses = array();
         foreach (spl_classes() as $splClass) {
             if (false !== strpos($splClass, 'Exception')) {
                 if (!in_array($splClass, self::$splClasses)) {
                     self::$splClasses[$splClass] = $splClass;
                 }
             }
         }
     }
     if (is_null(self::$template)) {
         self::$template = file_get_contents(__DIR__ . '/resources/exception.tpl', LOCK_EX);
     }
     //@codeCoverageIgnoreEnd
 }
开发者ID:dayax,项目名称:dayax,代码行数:23,代码来源:ExceptionFactory.php

示例6: foreach

<?php

/**
 *
 * Host php file to Chapter6 classes
 *
 */
include_once 'class.directoryiteratorexample.php';
/*----------  Available SPL Objects  ----------*/
foreach (spl_classes() as $key => $value) {
    echo $value, "<br>";
}
/*----------  DirectoryIterator SPL  ----------*/
$run = new DirectoryIteratorExample("/var/www/exercises/public_html/php_exercises/");
$run->getAllDirectoryFiles();
开发者ID:wdarking,项目名称:php_exercises,代码行数:15,代码来源:run.php

示例7: isPHPInternalClass

 /**
  * Get a list of PHP defined classes
  *
  * @param $nameOrObject
  * @return bool
  */
 public static function isPHPInternalClass($nameOrObject)
 {
     return in_array(ltrim((string) static::getClass($nameOrObject), '\\'), spl_classes());
 }
开发者ID:phpthinktank,项目名称:blast-orm,代码行数:10,代码来源:Support.php

示例8: foreach

<?php

foreach (spl_classes() as $name) {
    echo $name . '<br>';
}
开发者ID:ralf000,项目名称:PHP4,代码行数:5,代码来源:01-spl.php

示例9: array_merge

<?php

//-----------------------------------------------------------
// settings
//-----------------------------------------------------------
$base_path = "d:/www/htdocs/zend/";
$source_dir = $base_path . "library/";
$packed_dir = $base_path . "packed/";
$compiled_dir = $base_path;
$compiled_file = $compiled_dir . "zend_framework_min.php";
$ADD_SOURCE_FILE_NAMES = 1;
$pattern_require = "/(require_once[\\s\t]*[\"\\'\\(]+([^\\'\"\\(\\)]+?)[\\'\"\\)]+[\\s\t]*;[\\s\t]*)/ims";
//-----------------------------------------------------------
$GLOBALS['CLASSES'] = [];
$GLOBALS['CLASSES_PATHS'] = [];
$GLOBALS["BUILT_IN_CLASSES"] = array_merge(get_declared_classes(), spl_classes(), get_declared_interfaces());
$GLOBALS["INHERIT_TREE"] = [];
$GLOBALS["INHERIT_CHILDREN"] = [];
$GLOBALS["INHERIT_PARENTS"] = [];
$GLOBALS["INHERIT_TOP"] = [];
$GLOBALS["INHERIT_NONE"] = [];
$GLOBALS["ABSTRACT_CLASSES"] = [];
$GLOBALS["INTERFACES"] = [];
//-----------------------------------------------------------
$time_start = array_sum(explode(" ", microtime()));
//-----------------------------------------------------------
/**
* Put string contents to the file
*/
if (!function_exists("file_put_contents")) {
    function file_put_contents($filename, $data)
开发者ID:yfix,项目名称:yf,代码行数:31,代码来源:pack_zend.php

示例10: var_dump

<?php

/**
 * Created by PhpStorm.
 * User: USER
 * Date: 26/5/2015
 * Time: 10:27
 */
var_dump(spl_classes());
开发者ID:JohnsonCheung,项目名称:try,代码行数:9,代码来源:spl_classes.php

示例11: var_dump

<?php

var_dump(is_array(spl_classes()));
开发者ID:badlamer,项目名称:hhvm,代码行数:3,代码来源:spl_classes.php

示例12: spl_classes

<?php

$classes = spl_classes();
foreach ($classes as $classe) {
    $rc = new ReflectionClass($classe);
    print $classe . PHP_EOL;
    foreach ($rc->getMethods() as $method) {
        print ' ' . $method->getName();
        print '(';
        $paramNames = array();
        $parameters = $method->getParameters();
        if (count($parameters) > 0) {
            foreach ($parameters as $parameter) {
                if ($parameter->isOptional()) {
                    $paramNames[] = '[' . $parameter->getName() . ']';
                } else {
                    $paramNames[] = $parameter->getName();
                }
            }
        }
        print implode(', ', $paramNames);
        print ')';
        print '<br>' . PHP_EOL;
    }
}
开发者ID:jmoliver,项目名称:php-programando-com-orientacao-a-objeto,代码行数:25,代码来源:reclection_docs.php

示例13: print_r

<?php

print_r(spl_classes());
开发者ID:GrUSP,项目名称:php_best_practices,代码行数:3,代码来源:spl_classes.php


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