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


PHP getClassName函数代码示例

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


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

示例1: scanFile

function scanFile($directory)
{
    $arr = array();
    $mydir = dir($directory);
    while ($file = $mydir->read()) {
        if (in_array($file, array('phptemplate'))) {
            continue;
        }
        if (is_dir("{$directory}/{$file}") && $file != "." && $file != ".." && $file != "smarty" && $file != "Public" && $file != "project_tools" && $file != ".svn" && $file != 'Include') {
            $res = scanFile("{$directory}/{$file}");
            $arr = array_merge($arr, $res);
        } else {
            if ($file != "." && $file != "..") {
                $file_path = $directory . "/" . $file;
                $file_info = pathinfo($file_path);
                if (isset($file_info['extension']) && $file_info['extension'] == 'php') {
                    $classes = getClassName($file_path);
                    foreach ($classes as $class) {
                        $arr[$class] = $file_info['dirname'] . '/' . $file_info['basename'];
                    }
                }
            }
        }
    }
    $mydir->close();
    return $arr;
}
开发者ID:pangudashu,项目名称:samframe,代码行数:27,代码来源:sam_install.php

示例2: getSnippet

/**
 * Returns snippet for Class of the current file
 *
 * @param string $filename returns file name
 * @param string $filepath returns file path
 * @return string snippet
 * @author Konstantin Kudryashov <ever.zet@gmail.com>
 */
function getSnippet()
{
    $baseClass = sfBundle::getBaseClassForCurrentFile();
    $packageName = getPackageName($baseClass);
    $snippet = sprintf(<<<SNIPPET
/*
 * This file is part of the \$1.
 * (c) \${2:%s} \${3:\${TM_ORGANIZATION_NAME}}
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 * \${4:%s} \${5:does things}.
 *
 * @package    \${6:\$1}
 * @subpackage \${7:%s}
 * @author     \$3
 * @version    \${8:1.0.0}
 */
class \$4%s
{
  \$0
}
SNIPPET
, date('Y', time()), getClassName(TextMate::getEnv('filename'), TextMate::getEnv('filepath')), $packageName ? $packageName : 'custom', $baseClass ? sprintf(" extends \${9:%s}", $baseClass) : '');
    return $snippet;
}
开发者ID:everzet,项目名称:sfSymfony-tmbundle,代码行数:37,代码来源:expander.php

示例3: __construct

 /**
  * Construct an abstract element with the given options
  * Sets the url property to the current url for convenience
  * @param array $options Array of key => value options to use with this element
  */
 public function __construct(array $options = array())
 {
     // Set the name of this button
     $this->name = strtolower(substr(get_called_class(), strrpos(get_called_class(), '\\') + 1));
     // Most buttons take a url, add it for convenience
     $options = array_merge(array('url' => getCurrentUrl()), $options);
     foreach ($options as $name => $value) {
         $this->{$name} = $value;
     }
     $this->templateDir = __DIR__ . '/../../../templates/' . strtolower(getClassName($this));
 }
开发者ID:faceleg,项目名称:php-socializer,代码行数:16,代码来源:AbstractElement.php

示例4: login

 /**
  * 验证登录
  */
 public function login($params = array())
 {
     $db = Yii::$app->db;
     // validate
     if (!$this->load($params) && !$this->validate()) {
         return false;
     }
     $model_name = getClassName(get_class($this));
     $data = $params[$model_name];
     if (!$data['captcha'] || $data['captcha'] != getSession('__captcha/login/captcha')) {
         //showMessage('验证码错误!');
         return false;
     }
     $sql = 'select username from forum_account where username="' . $data['username'] . '" and password = "' . md5($data['password']) . '" limit 1';
     $command = $db->createCommand($sql);
     $data = $command->queryOne();
     if ($data) {
         setSession('username', $data['username']);
         return true;
     } else {
         return false;
     }
 }
开发者ID:keltstr,项目名称:forum-1,代码行数:26,代码来源:AccountModel.php

示例5: scanFile

function scanFile($directory)
{
    $arr = array();
    $mydir = dir($directory);
    while ($file = $mydir->read()) {
        if (is_dir("{$directory}/{$file}") && $file != "." && $file != ".." && $file != "smarty" && $file != "myinclude" && $file != ".svn") {
            $res = scanFile("{$directory}/{$file}");
            $arr = array_merge($arr, $res);
        } else {
            if ($file != "." && $file != "..") {
                $file_path = $directory . "/" . $file;
                $file_info = pathinfo($file_path);
                if ($file_info['extension'] == 'php') {
                    $classes = getClassName($file_path);
                    foreach ($classes as $class) {
                        $arr[$class] = $file_info['dirname'] . '/' . $file_info['basename'];
                    }
                }
            }
        }
    }
    $mydir->close();
    return $arr;
}
开发者ID:pangudashu,项目名称:samframe,代码行数:24,代码来源:classmap.php

示例6: trim

 if ($class->isTrait()) {
     $title = 'trait ' . $className;
 } else {
     if ($class->isInterface()) {
         $title = 'interface ' . $className;
     } else {
         $modifiers = Reflection::getModifierNames($class->getModifiers());
         $title = trim(join(' ', $modifiers) . ' class ' . $className);
         $parentClass = $class->getParentClass();
         if ($parentClass && !$parentClass->isInterface()) {
             $title .= ' extends ' . getClassName($parentClass->getName(), $ns);
         }
         $implements = $class->getInterfaceNames();
         if (!empty($implements)) {
             $title .= ' implements ' . join(', ', array_map(function ($implement) use($ns) {
                 return getClassName($implement, $ns);
             }, $implements));
         }
     }
 }
 $line[] = $title . " {";
 $constants = $class->getConstants();
 foreach ($constants as $name => $value) {
     $line[] = "\t" . getConstantStr($name, $value);
 }
 $defaultProperties = $class->getDefaultProperties();
 foreach ($class->getProperties(ReflectionProperty::IS_PUBLIC | ReflectionProperty::IS_PROTECTED) as $property) {
     if (!isInheritProperty($property, $parentClass)) {
         $line[] = "\t" . getPropertyStr($property, $defaultProperties);
     }
 }
开发者ID:leo108,项目名称:php_extension_autocomplete_generator,代码行数:31,代码来源:generator.php

示例7: renderTitle

 public function renderTitle()
 {
     return getClassName(get_class($this));
 }
开发者ID:danack,项目名称:imagick-demos,代码行数:4,代码来源:Example.php

示例8: foreach

        }
    }
}
// layouts
$classType = 'Block';
$layouts = $utilityFiles->getLayoutFiles([], false);
foreach ($layouts as $file) {
    $xml = simplexml_load_file($file);
    $classes = \Magento\Framework\App\Utility\Classes::collectLayoutClasses($xml);
    $factoryNames = array_filter($classes, 'isFactoryName');
    if (!$factoryNames) {
        continue;
    }
    foreach ($factoryNames as $factoryName) {
        list($module, $name) = getModuleName($factoryName, $compositeModules);
        $map[$classType][$factoryName] = getClassName($module, $classType, $name);
    }
}
echo Zend_Json::prettyPrint(Zend_Json::encode($map));
/**
 * Get combined array from similar files by pattern
 *
 * @param string $dirPath
 * @param string $filePattern
 * @return array
 */
function getFilesCombinedArray($dirPath, $filePattern)
{
    $result = [];
    $directoryIterator = new DirectoryIterator($dirPath);
    $patternIterator = new RegexIterator($directoryIterator, $filePattern);
开发者ID:shabbirvividads,项目名称:magento2,代码行数:31,代码来源:get_aliases_map.php

示例9: file_get_contents

    $tpl = file_get_contents(CLASS_TPL);
    while ($resultSet = DBCore::bindResults($stmt)) {
        $tableName = $resultSet['TABLE_NAMES']['Tables_in_' . conf\Config::getDBConfigParam('DBNAME')];
        OutputStream::msg(OutputStream::MSG_INFO, "Reading structure for table '" . $tableName . "'...");
        $idFieldName = 'id';
        $fieldsListStr = "";
        $fieldsList = DBCore::getTableFieldsList($tableName);
        if (!empty($fieldsList)) {
            foreach ($fieldsList as $field => $attributes) {
                if ($attributes['key'] === 'PRI') {
                    $idFieldName = $field;
                }
                $fieldsListStr .= "        " . DBCore::getPrintableFieldString($field, $attributes);
            }
            $fieldsListStr = substr($fieldsListStr, 0, strlen($fieldsListStr) - 1);
            $className = getClassName($tableName);
            $content = str_replace(array('{{CLASS_NAME}}', '{{TABLE_NAME}}', '{{PRIMARY_KEY}}', '{{FIELDS_LIST}}', '{{YEAR}}', '{{AUTHOR}}', '{{EMAIL}}'), array($className, $tableName, $idFieldName, $fieldsListStr, date("Y"), AUTHOR, EMAIL), $tpl);
            file_put_contents(RESULTS_PATH . $className . ".php", $content);
            OutputStream::msg(OutputStream::MSG_SUCCESS, "Class '" . RESULTS_PATH . $className . ".php' generated.");
        } else {
            OutputStream::msg(OutputStream::MSG_ERROR, "Can't read structure for table '" . $tableName . "'.");
        }
    }
    $stmt->close();
} else {
    OutputStream::msg(OutputStream::MSG_ERROR, "Can't read tables list.");
}
OutputStream::close();
function getClassName($tableName)
{
    $underlinesReplaced = preg_replace_callback("/_([a-zA-Z]{1})/", function ($matches) {
开发者ID:asymptix,项目名称:framework,代码行数:31,代码来源:beans_generator.php

示例10: _moveFiles

 function _moveFiles(&$man, &$input)
 {
     $result = new Moxiecode_ResultSet("status,fromfile,tofile,message");
     $config = $man->getConfig();
     if (!$man->isToolEnabled("rename", $config) && !$man->isToolEnabled("cut", $config)) {
         trigger_error("{#error.no_access}", FATAL);
         die;
     }
     for ($i = 0; isset($input["frompath" . $i]); $i++) {
         $fromFile =& $man->getFile($input["frompath" . $i]);
         $fromType = $fromFile->isFile() ? MC_IS_FILE : MC_IS_DIRECTORY;
         if (isset($input["toname" . $i])) {
             $toFile =& $man->getFile($fromFile->getParent(), $input["toname" . $i], $fromType);
         } else {
             if (isset($input["topath" . $i])) {
                 $toFile =& $man->getFile($input["topath" . $i], "", $fromType);
             } else {
                 $toFile =& $man->getFile($input["topath"], $fromFile->getName(), $fromType);
             }
         }
         // User tried to change extension
         if ($fromFile->isFile() && getFileExt($fromFile->getName()) != getFileExt($toFile->getName())) {
             $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#error.move_failed}");
             continue;
         }
         if (!$fromFile->exists()) {
             $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#error.no_from_file}");
             continue;
         }
         if ($toFile->exists()) {
             $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#error.tofile_exists}");
             continue;
         }
         $toConfig = $toFile->getConfig();
         if (checkBool($toConfig['general.demo'])) {
             $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#error.demo}");
             continue;
         }
         if ($man->verifyFile($toFile, "rename") < 0) {
             $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), $man->getInvalidFileMsg());
             continue;
         }
         if (!$toFile->canWrite()) {
             $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#error.no_write_access}");
             continue;
         }
         if (!checkBool($toConfig["filesystem.writable"])) {
             $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#error.no_write_access}");
             continue;
         }
         // Check if file can be zipped
         if (getClassName($toFile) == 'moxiecode_zipfileimpl') {
             if ($man->verifyFile($fromFile, "zip") < 0) {
                 $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), $man->getInvalidFileMsg());
                 continue;
             }
         }
         // Check if file can be unzipped
         if (getClassName($fromFile) == 'moxiecode_zipfileimpl') {
             if ($man->verifyFile($toFile, "unzip") < 0) {
                 $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), $man->getInvalidFileMsg());
                 continue;
             }
         }
         if ($fromFile->renameTo($toFile)) {
             $result->add("OK", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#message.move_success}");
         } else {
             $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#error.move_failed}");
         }
     }
     return $result->toArray();
 }
开发者ID:anunay,项目名称:stentors,代码行数:72,代码来源:FileManagerPlugin.php

示例11: getTotalClass

    echo "you have to specify a directory: 'A', 'B', 'C' ...\n";
    exit;
}
$indexFileName = "./index/{$class}/_result_{$class}.log";
$totalClass = getTotalClass($indexFileName);
$curClass = 1;
if (!file_exists($indexFileName)) {
    echo "file {$indexFileName} not exists \n";
    exit;
}
$fp = fopen($indexFileName, "r");
while ($line = readLine($fp)) {
    if (strlen(trim($line)) == 0) {
        continue;
    }
    $className = getClassName($line);
    $code = getClassCode($line);
    if (!$code || !$className) {
        echo "{$className} code empty\n";
        continue;
    }
    $indexURL = getIndexURL($code);
    //首页地址
    $cookieURL = getCookieURL($code);
    //初始化cookie,防止被识破
    $indexURL = cleanIndexURL($indexURL);
    //exit;
    if (!$className || !$indexURL || !$cookieURL) {
        echo "Usage: \$php main.php";
        exit;
    }
开发者ID:highestgoodlikewater,项目名称:cnkispider,代码行数:31,代码来源:main.php

示例12: renameTo

 /**
  * Renames/Moves this file to the specified file instance.
  *
  * @param File $dest File to rename/move to.
  * @return boolean true- success, false - failure
  */
 function renameTo(&$dest)
 {
     // If move within the same zip
     if (getClassName($dest) == 'moxiecode_zipfileimpl' && $this->_zipPath == $dest->_zipPath) {
         $zip =& $this->_getZip();
         $zip->open();
         $zip->moveEntry($this->_innerPath, $dest->_innerPath);
         $zip->commit();
         $zip->close();
     } else {
         // Copy and delete
         $this->copyTo($dest);
         $this->delete(true);
     }
     return true;
 }
开发者ID:manis6062,项目名称:sagarmathaonline,代码行数:22,代码来源:ZipFileImpl.php

示例13: trigger_error

            if (empty($className)) {
                $className = 'unknown';
            }
            trigger_error('Object not found: ' . $objectid . ' (' . $className . ')', E_USER_ERROR);
        } else {
            $object = new smdoc_error($foowd, ERROR_TITLE);
            $foowd->template->assign_by_ref('objectList', $objects);
            $result = $foowd->method($object, 'bad_workspace');
            $methodName = 'object_bad_workspace';
            $className = 'smdoc_error';
        }
    }
} else {
    $foowd->debug('msg', 'fetch and call class method');
    if (!isset($className)) {
        $className = getClassName($classid);
    }
    if (!isset($method)) {
        $method = $foowd->config_settings['site']['default_class_method'];
    }
    $result = $foowd->method($className, $method);
    $methodName = 'class_' . $method;
}
/*
 * Display results using appropriate template
 */
if ($result === TRUE) {
    $tplName = $foowd->getTemplateName($className, $methodName);
    $foowd->debug('msg', 'display result using template: ' . $tplName);
    $foowd->template->display($tplName);
} else {
开发者ID:teammember8,项目名称:roundcube,代码行数:31,代码来源:index.php

示例14: createSpellDetails


//.........这里部分代码省略.........
            echo '<td>n/a</td>';
        }
        echo '</tr>';
    }
    // Вывод требований форм
    $stances = $spell['Stances'];
    $stancesNot = $spell['StancesNot'];
    if ($stances or $stancesNot) {
        echo '<tr>';
        echo '<th>Req form</th>';
        if ($stances) {
            echo '<td>' . getAllowableForm($stances) . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '<th>Not in form</th>';
        if ($stancesNot) {
            echo '<td>' . getAllowableForm($stancesNot) . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '</tr>';
    }
    // Вывод требований одетого снаряжения
    $itemClass = $spell['EquippedItemClass'];
    $itemSubClass = $spell['EquippedItemSubClassMask'];
    $inventoryTypeMask = $spell['EquippedItemInventoryTypeMask'];
    if ($itemClass >= 0 or $inventoryTypeMask) {
        echo '<tr>';
        echo '<th>Req item</th>';
        if ($itemClass >= 0) {
            echo '<td>';
            if ($itemSubClass) {
                echo getClassName($itemClass, 0) . ': ' . getSubclassList($itemClass, $itemSubClass);
            } else {
                echo getClassName($itemClass);
            }
            echo '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '<th>Inv type</th>';
        if ($inventoryTypeMask) {
            echo '<td>' . getInventoryTypeList($inventoryTypeMask) . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '</tr>';
    }
    // Вывод тотм категорий и спеллфокуса
    $totem1 = $spell['TotemCategory_1'];
    $totem2 = $spell['TotemCategory_2'];
    $focus = $spell['RequiresSpellFocus'];
    if ($totem1 or $totem2 or $focus) {
        echo '<tr>';
        echo '<th>Tools</th>';
        if ($totem1 or $totem2) {
            echo '<td>';
            if ($totem1) {
                echo getTotemCategory($totem1);
            }
            if ($totem2) {
                echo ', ' . getTotemCategory($totem2);
            }
            echo '</td>';
        } else {
开发者ID:BACKUPLIB,项目名称:Infinity_MaNGOS,代码行数:67,代码来源:spell_details.php

示例15: getClassName

echo getClassName($assistanceIdsFilter);
?>
">
                    <strong><?php 
echo CHtml::encode(CvList::model()->getAttributeLabel('assistanceIds'));
?>
</strong><br />
                    <input type="text" name="assistanceFilter" class="filter" size="10" />
                    <div class="div-overflow narrow">
                        <?php 
echo CHtml::checkBoxList('assistanceIds', $assistanceIdsFilter, CHtml::listData(AssistanceTypes::model()->findAll(array('order' => getOrder($assistanceIdsFilter) . 'name ASC')), 'id', 'name'), array('template' => '{beginLabel}{input} {labelTitle}{endLabel}', 'separator' => ''));
?>
                    </div>
                </td>
                <td class="<?php 
echo getClassName($licensesIdsFilter);
?>
">
                    <strong><?php 
echo CHtml::encode(CvList::model()->getAttributeLabel('driverLicensesIds'));
?>
</strong><br />
                    <input type="text" name="licensesFilter" class="filter" size="10" />
                    <div class="div-overflow narrow">
                        <?php 
echo CHtml::checkBoxList('licensesIds', $licensesIdsFilter, CHtml::listData(DriverLicenses::model()->findAll(array('order' => getOrder($licensesIdsFilter) . 'name ASC')), 'id', 'name'), array('template' => '{beginLabel}{input} {labelTitle}{endLabel}', 'separator' => ''));
?>
                    </div>
                </td>
            </tr>
        </table>
开发者ID:jerichozis,项目名称:portal,代码行数:31,代码来源:index.php


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