本文整理汇总了PHP中Lib::classes方法的典型用法代码示例。如果您正苦于以下问题:PHP Lib::classes方法的具体用法?PHP Lib::classes怎么用?PHP Lib::classes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lib
的用法示例。
在下文中一共展示了Lib::classes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_classes
/**
* ライブラリのクラス一覧を返す
* @param $in_vendor
* @return array
*/
function get_classes($in_vendor = false)
{
return Lib::classes(true, $in_vendor);
}
示例2: __setup_def__
/**
* 定義名のリスト
* @param Request $req
* @param string $value
*/
public static function __setup_def__(Request $req, $value)
{
$libs = array_keys(Lib::classes(true, true));
$list = array();
foreach ($libs as $path) {
$ref = new InfoClass($path, false);
foreach ($ref->def() as $def) {
$list[$def->name()] = '(' . $def->fm_type() . ') ' . $def->document();
}
}
$len = Text::length(array_keys($list));
self::info_print("Define list:");
foreach ($list as $k => $v) {
self::println(" " . str_pad($k, $len) . " : " . $v);
}
}
示例3: lib
private static function lib($repository)
{
if (!$repository->start("lib")) {
return;
}
foreach (Lib::classes(true) as $class_path => $class) {
$i = new InfoClass($class_path, false);
$base_dir = Lib::path();
$search_path = File::absolute($base_dir, str_replace(".", "/", $i->package()));
$target = is_file($search_path . ".php") ? $search_path . ".php" : (is_file($search_path . "/" . basename($search_path) . ".php") ? $search_path : null);
if ($target !== null) {
$tgz_filename = $repository->tgz_path($i->package());
File::tgz($tgz_filename, $target, $base_dir);
touch($tgz_filename, File::last_update($target));
$repository->add($i->package(), $i->name(), File::last_update($i->path()), $i->document());
}
}
}
示例4: verifies
/**
* ディエクトリパスを指定してテストを実行する
* @param string $path
* @return Test
*/
public static final function verifies()
{
foreach (Lib::classes(true) as $path => $class) {
self::verify($path);
}
if (is_dir(self::path())) {
foreach (File::ls(self::path(), true) as $f) {
$dir = str_replace(self::path(), "", $f->directory());
if (substr($dir, 0, 1) == "/") {
$dir = substr($dir, 1);
}
if (substr($dir, -1) == "/") {
$dir = substr($dir, 0, -1);
}
self::verify(str_replace("/", ".", empty($dir) ? "" : $dir . ".") . preg_replace("/_test\$/", "", $f->oname()));
}
}
return new self();
}
示例5: vendors_update
/**
* vendorsを更新する
*/
public static function vendors_update()
{
self::set_path();
if (is_dir(self::$vendor_path)) {
File::rm(self::$vendor_path, false);
}
foreach (Lib::classes(true, true) as $key => $class) {
Lib::import($key);
}
foreach (File::ls(App::path()) as $f) {
if ($f->is_ext('php')) {
$src = File::read($f);
if (preg_match_all("/[^\\w](import|R|C)\\(([\"\\'])(.+?)\\2\\)/", $src, $match)) {
foreach ($match[3] as $path) {
try {
self::import(trim($path));
} catch (Exception $e) {
}
}
}
if (Tag::setof($tag, $src, 'app')) {
if (preg_match_all("/[^\\w]class=([\"\\'])(.+?)\\1/", $src, $match)) {
foreach ($match[2] as $path) {
try {
self::import(trim($path));
} catch (Exceptions $e) {
}
}
}
}
}
}
}