コード例 #1
0
ファイル: file.func.php プロジェクト: ChainBoy/wxfx
function file_tree($path)
{
    $files = array();
    $ds = glob($path . '/*');
    if (is_array($ds)) {
        foreach ($ds as $entry) {
            if (is_file($entry)) {
                $files[] = $entry;
            }
            if (is_dir($entry)) {
                $rs = file_tree($entry);
                foreach ($rs as $f) {
                    $files[] = $f;
                }
            }
        }
    }
    return $files;
}
コード例 #2
0
ファイル: model.php プロジェクト: wisemyth/weizan
function tpl_wappage_editor($editorparams = '', $editormodules = array())
{
    global $_GPC;
    $content = '';
    load()->func('file');
    $filetree = file_tree(IA_ROOT . '/addons/fm_photosvote/template/designer/wapeditor');
    if (!empty($filetree)) {
        foreach ($filetree as $file) {
            if (strexists($file, 'widget-')) {
                $fileinfo = pathinfo($file);
                $_GPC['iseditor'] = false;
                $display = template('../../../addons/fm_photosvote/template/designer/wapeditor/' . $fileinfo['filename'], TEMPLATE_FETCH);
                $_GPC['iseditor'] = true;
                $editor = template('../../../addons/fm_photosvote/template/designer/wapeditor/' . $fileinfo['filename'], TEMPLATE_FETCH);
                $content .= "<script type=\"text/ng-template\" id=\"{$fileinfo['filename']}-display.html\">" . str_replace(array("\r\n", "\n", "\t"), '', $display) . "</script>";
                $content .= "<script type=\"text/ng-template\" id=\"{$fileinfo['filename']}-editor.html\">" . str_replace(array("\r\n", "\n", "\t"), '', $editor) . "</script>";
            }
        }
    }
    return $content;
}
コード例 #3
0
ファイル: tools.ctrl.php プロジェクト: 7demo/we7
<?php

/**
 * [WeEngine System] Copyright (c) 2014 WE7.CC
 * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
 */
$_W['page']['title'] = '工具 - 系统管理';
$dos = array('bom', 'scan');
$do = in_array($do, $dos) ? $do : 'bom';
if ($do == 'bom') {
    if (checksubmit()) {
        set_time_limit(0);
        load()->func('file');
        $path = IA_ROOT;
        $tree = file_tree($path);
        $ds = array();
        foreach ($tree as $t) {
            $t = str_replace($path, '', $t);
            $t = str_replace('\\', '/', $t);
            if (preg_match('/^.*\\.php$/', $t)) {
                $fname = $path . $t;
                $fp = fopen($fname, 'r');
                if (!empty($fp)) {
                    $bom = fread($fp, 3);
                    fclose($fp);
                    if ($bom == "") {
                        $ds[] = $t;
                    }
                }
            }
        }
コード例 #4
0
<?php

/**
 * [WeEngine System] Copyright (c) 2014 WE7.CC
 * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
 */
load()->func('file');
load()->model('cloud');
load()->func('communication');
if ($do == 'check') {
    $filetree = file_tree(IA_ROOT);
    $modify = array();
    $unknown = array();
    $lose = array();
    $pars = _cloud_build_params();
    $pars['method'] = 'application.build';
    $pars['extra'] = cloud_extra_data();
    $dat = cloud_request('http://v2.addons.we7.cc/gateway.php', $pars);
    $file = IA_ROOT . '/data/application.build';
    $ret = _cloud_shipping_parse($dat, $file);
    foreach ($ret['files'] as $value) {
        $clouds[$value['path']]['path'] = $value['path'];
        $clouds[$value['path']]['checksum'] = $value['checksum'];
    }
    foreach ($filetree as $filename) {
        $file = str_replace(IA_ROOT, '', $filename);
        $ignore_list = array(strpos($file, '/data/tpl/') === 0, substr($file, -8) == 'map.json', strpos($file, '/data/logs') === 0, strpos($file, '/attachment') === 0, $file == '/data/config.php', strpos($file, '/data') === 0 && substr($file, -4) == 'lock', strpos($file, '/app/themes/default') === 0, $file == '/framework/version.inc.php');
        if (in_array(true, $ignore_list)) {
            continue;
        }
        if (preg_match('/\\/addons\\/([a-zA-Z_0-9\\-]+)\\/.*/', $file, $match)) {
コード例 #5
0
ファイル: tools.ctrl.php プロジェクト: aspnmy/weizan
<?php

/**
 * [Weizan System] Copyright (c) 2014 012WZ.COM
 * Weizan is NOT a free software, it under the license terms, visited http://www.012wz.com/ for more details.
 */
$_W['page']['title'] = '工具 - 系统管理';
$dos = array('bom', 'scan');
$do = in_array($do, $dos) ? $do : 'bom';
if ($do == 'bom') {
    if (checksubmit('submit')) {
        set_time_limit(0);
        load()->func('file');
        $path = IA_ROOT;
        $trees = file_tree($path);
        $bomtree = array();
        foreach ($trees as $tree) {
            $tree = str_replace($path, '', $tree);
            $tree = str_replace('\\', '/', $tree);
            if (strexists($tree, '.php')) {
                $fname = $path . $tree;
                $fp = fopen($fname, 'r');
                if (!empty($fp)) {
                    $bom = fread($fp, 3);
                    fclose($fp);
                    if ($bom == "") {
                        $bomtree[] = $tree;
                    }
                }
            }
        }