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


PHP F::file_exists方法代码示例

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


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

示例1: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Check', function ($Call) {
    return F::file_exists(Root . '/locks/' . $Call['ID']);
});
setFn('Toggle', function ($Call) {
    return F::file_exists(Root . '/locks/' . $Call['ID']) ? unlink(Root . '/locks/' . $Call['ID']) : touch(Root . '/locks/' . $Call['ID']);
});
开发者ID:trickyplan,项目名称:codeine,代码行数:14,代码来源:Lock.php

示例2: setFn

        }
    }
    return null;
});
setFn('Filename', function ($Call) {
    $Call = F::Hook('beforeFileSystemOperation', $Call);
    return DS . array_pop($Call['Where']['ID']);
});
setFn('Exist', function ($Call) {
    $Call = F::Hook('beforeFileSystemOperation', $Call);
    if (empty($Call['Where']['ID'])) {
        $Call['Result'] = false;
    } else {
        foreach ($Call['Where']['ID'] as $ID) {
            $Filename = F::findFile($Call['Link'] . DS . $ID);
            $Call['Result'] = F::file_exists($Filename);
        }
    }
    $Call = F::Hook('afterFileSystemOperation', $Call);
    return $Call['Result'];
});
setFn('Status', function ($Call) {
    $Call = F::Hook('beforeFileSystemOperation', $Call);
    $ic = 0;
    $Directory = new RecursiveDirectoryIterator(Root . '/' . $Call['Path']);
    $Iterator = new RecursiveIteratorIterator($Directory);
    $Regex = new RegexIterator($Iterator, '/' . $Call['Prefix'] . '(.+)' . $Call['Postfix'] . '$/i', RecursiveRegexIterator::GET_MATCH);
    foreach ($Regex as $File) {
        $ic++;
    }
    $Call = F::Hook('afterFileSystemOperation', $Call);
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:FileSystem.php

示例3: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description Exec Parslet 
 * @package Codeine
 * @version 6.0
 */
setFn('Parse', function ($Call) {
    foreach ($Call['Parsed'][2] as $Ix => $Match) {
        if (empty($Match)) {
            $Match = '';
        } else {
            if (F::file_exists($Filename = Root . '/Data/' . $Match)) {
                $Pathinfo = pathinfo($Match);
                $Filesize = F::Run('Formats.Number.Filesize', 'Do', ['Value' => filesize($Filename)]);
                // FIXME
                $Data = ['URL' => $Match, 'Filename' => $Pathinfo['basename'], 'Filesize' => $Filesize, 'Extension' => $Pathinfo['extension']];
                $Match = F::Run('View', 'Load', $Call, ['Scope' => 'View/HTML/Parslets', 'ID' => 'File', 'Data' => $Data]);
            } else {
                $Match = '';
            }
        }
        $Call['Output'] = str_replace($Call['Parsed'][0][$Ix], $Match, $Call['Output']);
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:27,代码来源:File.php

示例4: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Do', function ($Call) {
    $Call['Layouts'][] = ['Scope' => 'Project', 'ID' => 'Status'];
    if (F::file_exists(Root . '/Options/Version.json')) {
        $Call[$Call['Project']['ID']]['MTime'] = filemtime(Root . '/Options/Version.json');
    }
    return $Call;
});
setFn('Menu', function ($Call) {
    $Call['Project'] = F::Live(F::loadOptions('Project'));
    $Call['Version'] = F::loadOptions('Version');
    if (isset($Call['Version'])) {
        return ['Count' => $Call['Version'][$Call['Project']['ID']]['Major'] . '.' . $Call['Version'][$Call['Project']['ID']]['Minor']];
    } else {
        return null;
    }
});
开发者ID:trickyplan,项目名称:codeine,代码行数:24,代码来源:Control.php

示例5: setFn

        return null;
    }
});
setFn('Exist', function ($Call) {
    if (!isset($Call['Scope'])) {
        $Call['Scope'] = 'Default';
    } else {
        if (is_array($Call['Scope'])) {
            $Call['Scope'] = implode(DS, $Call['Scope']);
        }
    }
    $Postfix = isset($Call['Postfix']) ? $Call['Postfix'] : '';
    $Prefix = isset($Call['Prefix']) ? $Call['Prefix'] : '';
    if (!empty($Call['Where']['ID'])) {
        $Filename = F::findFile($Call['Link'] . '/' . $Call['Scope'] . '/' . $Prefix . $Call['Where']['ID'] . $Postfix);
        return F::file_exists($Filename);
    } else {
        return false;
    }
});
setFn('Status', function ($Call) {
    if (!isset($Call['Scope'])) {
        $Call['Scope'] = 'Default';
    } else {
        if (is_array($Call['Scope'])) {
            $Call['Scope'] = implode(DS, $Call['Scope']);
        }
    }
    $Postfix = isset($Call['Postfix']) ? $Call['Postfix'] : '';
    $Prefix = isset($Call['Prefix']) ? $Call['Prefix'] : '';
    $Path = $Call['Link'] . '/' . $Call['Scope'] . '/';
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:OldDirectory.php

示例6: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description: 
 * @package Codeine
 * @version 8.x
 * @date 13.08.11
 * @time 22:37
 */
setFn('Open', function ($Call) {
    if (F::file_exists($Call['Directory'] . '/' . $Call['Filename'])) {
        $Call['Link'] = (array) jd(file_get_contents($Call['Directory'] . '/' . $Call['Filename']), true);
    } else {
        $Call['Link'] = [];
    }
    return $Call['Link'];
});
setFn('Read', function ($Call) {
    $Result = array_shift($Call['Link']);
    file_put_contents($Call['Directory'] . '/' . $Call['Filename'], j($Call['Link'], JSON_NUMERIC_CHECK | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
    return $Result;
});
setFn('Write', function ($Call) {
    array_push($Call['Link'], $Call['Data']);
    return file_put_contents($Call['Directory'] . '/' . $Call['Filename'], j($Call['Link'], JSON_NUMERIC_CHECK | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
});
setFn('Count', function ($Call) {
    return count($Call['Link']);
});
setFn('Close', function ($Call) {
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:JSON.php


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