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


PHP Browser::warn方法代码示例

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


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

示例1: minify

 public function minify()
 {
     if (FIRST_RELOAD || RX_MODE_DEBUG || self::$cache->isEmpty()) {
         foreach ($this->scripts as $key => $value) {
             $newName = self::$BUILD_PATH . $value["file"];
             $this->scripts[$key]["exists"] = file_exists(PROJECT_ROOT_DIR . $value["file"]);
             $this->scripts[$key]["build_path"] = $newName;
             if ($this->const['RX_JS_MIN'] && !$this->scripts[$key]["remote"]) {
                 $this->scripts[$key]["minified"] = $this->minified->minify(PROJECT_ROOT_DIR . $value["file"], $newName);
                 $this->scripts[$key]["link"] = CONTEXT_PATH . str_replace(self::$BUILD_PATH, "", $this->scripts[$key]["minified"]);
             } else {
                 if (!$this->scripts[$key]["remote"]) {
                     \RudraX\Utils\FileUtil::build_copy($value["file"], ResourceUtil::$RESOURCE_DIST_DIR . "/" . $value["file"]);
                 }
             }
         }
         foreach ($this->css as $key => $value) {
             if ($this->const['RX_JS_MIN'] && !$this->css[$key]["remote"]) {
                 Browser::warn("minifying...", $this->css[$key]["minified"], file_exists(PROJECT_ROOT_DIR . $value["file"]), $value["file"]);
                 $newName = self::$BUILD_PATH . $value["file"];
                 $this->css[$key]["exists"] = file_exists($value["file"]);
                 $this->css[$key]["build_path"] = $newName;
                 $inputFile = PROJECT_ROOT_DIR . $value["file"];
                 $inputFileExists = file_exists($inputFile);
                 if ($inputFileExists) {
                     $this->css[$key]["minified"] = $this->minified->minify($inputFile, $newName);
                 } else {
                     $this->css[$key]["minified"] = $newName;
                 }
                 $this->css[$key]["link"] = CONTEXT_PATH . str_replace(self::$BUILD_PATH, "", $this->css[$key]["minified"]);
             }
         }
     }
 }
开发者ID:rudraks,项目名称:core,代码行数:34,代码来源:Header.php

示例2: rx_scan_dir

function rx_scan_dir($annotations, $dir)
{
    $allController = ClassUtil::getControllerArray();
    $dir_iterator = new RecursiveDirectoryIterator($dir);
    $iterator = new RecursiveIteratorIterator($dir_iterator, RecursiveIteratorIterator::SELF_FIRST);
    // could use CHILD_FIRST if you so wish
    foreach ($iterator as $filename => $file) {
        if ($file->isFile()) {
            if (fnmatch("*/handler/*.php", $file->getPathname()) || fnmatch("*\\\\handler\\\\*.php", $file->getPathname())) {
                require_once $file->getPathname();
                $className = str_replace(".php", "", $file->getFilename());
                $scan = true;
                if (ClassUtil::getMTime($className) >= $file->getMTime()) {
                    $scan = false;
                }
                if ($scan && class_exists($className)) {
                    $result = $annotations->getClassAnnotations($className);
                    if (isset($result["Handler"]) && isset($result["Handler"][0]) && !empty($result["Handler"][0])) {
                        ClassUtil::setHandler($result["Handler"][0], array("className" => $className, "filePath" => $file->getPathname(), "mtime" => $file->getMTime(), "requestParams" => isset($result["RequestParams"])));
                        Browser::warn("HandleScanned::", ClassUtil::getHandler($result["Handler"][0]));
                        ClassUtil::setMTime($className, $file->getMTime());
                    }
                }
            } else {
                if (fnmatch("*/controller/*.php", $file->getPathname()) || fnmatch("*\\\\controller\\\\*.php", $file->getPathname())) {
                    require_once $file->getPathname();
                    $className = str_replace(".php", "", $file->getFilename());
                    $scan = true;
                    if (ClassUtil::getMTime($className) >= $file->getMTime()) {
                        $scan = false;
                    }
                    if ($scan && class_exists($className)) {
                        $methods = get_class_methods($className);
                        foreach ($methods as $method) {
                            $result = $annotations->getMethodAnnotations($className, $method);
                            Browser::error("ControllerScanned::", $result);
                            if (isset($result["RequestMapping"]) && isset($result["RequestMapping"][0]) && isset($result["RequestMapping"][0]["url"])) {
                                $allController[] = array("className" => $className, "method" => $method, "filePath" => $file->getPathname(), "mtime" => $file->getMTime(), "mappingUrl" => $result["RequestMapping"][0]["url"], "requestParams" => isset($result["RequestParams"]), "cache" => isset($result["RequestMapping"][0]["cache"]) ? $result["RequestMapping"][0]["cache"] : FALSE, "type" => isset($result["RequestMapping"][0]["type"]) ? $result["RequestMapping"][0]["type"] : NULL, "requestMethod" => isset($result["RequestMapping"][0]["method"]) ? strtoupper($result["RequestMapping"][0]["method"]) : NULL);
                            }
                        }
                        Browser::warn("ControllerScanned::", $allController[$result["RequestMapping"][0]["url"]]);
                        ClassUtil::setMTime($className, $file->getMTime());
                    }
                } else {
                    if (fnmatch("*/model/*.php", $file->getPathname()) || fnmatch("*\\\\model\\\\*.php", $file->getPathname())) {
                        require_once $file->getPathname();
                        $className = str_replace(".php", "", $file->getFilename());
                        $scan = true;
                        if (ClassUtil::getMTime($className) >= $file->getMTime()) {
                            $scan = false;
                        }
                        if ($scan && class_exists($className)) {
                            $result = $annotations->getClassAnnotations($className);
                            if (isset($result["Model"]) && isset($result["Model"][0]) && !empty($result["Model"][0])) {
                                ClassUtil::setModel($result["Model"][0], array("className" => $className, "filePath" => $file->getPathname(), "mtime" => $file->getMTime(), "type" => $result["Model"][0]));
                                Browser::warn("ModelScanned::", ClassUtil::getModel($result["Model"][0]));
                                ClassUtil::setMTime($className, $file->getMTime());
                            }
                        }
                    }
                }
            }
        }
    }
    ClassUtil::setControllerArray($allController);
}
开发者ID:rudraks,项目名称:core,代码行数:66,代码来源:rx_scan_classes.php


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