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


PHP F::findFile方法代码示例

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


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

示例1: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description: 
 * @package Codeine
 * @version 8.x
 * @date 13.08.11
 * @time 22:37
 */
setFn('Open', function ($Call) {
    return jd(file_get_contents(F::findFile($Call['Filename'])), true);
});
setFn('Read', function ($Call) {
    if (isset($Call['Where']['ID'])) {
        return $Call['Link'][$Call['Where']['ID']];
    } else {
        return $Call['Link'];
    }
});
setFn('Write', function ($Call) {
});
setFn('Close', function ($Call) {
    return true;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:25,代码来源:JSON.php

示例2: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Get', function ($Call) {
    $Call['HTTP']['Headers']['Access-Control-Allow-Origin:'] = '*';
    // FIXME
    $Call['Output']['Content'] = F::findFile('/Assets/' . strtr($Call['Asset'], '.', DS) . DS . $Call['Scope'] . DS . $Call['ID'] . '.' . $Call['Extension']);
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:14,代码来源:Asset.php

示例3: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description: 
 * @package Codeine
 * @version 8.x
 * @date 13.08.11
 * @time 22:37
 */
setFn('Open', function ($Call) {
    return file(F::findFile($Call['Filename']));
});
setFn('Read', function ($Call) {
    if (isset($Call['Where']['ID'])) {
        return $Call['Link'][$Call['Where']['ID']];
    } else {
        return $Call['Link'];
    }
});
setFn('Write', function ($Call) {
    if (isset($Call['Where']['ID'])) {
        $Call['Link'][$Call['Where']['ID']] = implode(PHP_EOL, $Call['Data']);
    } else {
        $Call['Link'] = implode(PHP_EOL, $Call['Data']);
    }
    if ($Call['Link'] === null) {
        return unlink($Call['Filename']);
    } else {
        return file_put_contents(Root . $Call['Filename'], $Call['Link']);
    }
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:File.php

示例4: 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++;
    }
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:FileSystem.php

示例5: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Run', function ($Call) {
    $Test = jd(file_get_contents(F::findFile('Tests/' . $Call['Test']['Name'] . '.json')));
    $Call['Test']['Report'] = [];
    $Call['Test']['Name'] = str_replace('.json', '', $Call['Test']['Name']);
    $Call['Test']['Name'] = strtr($Call['Test']['Name'], '/', '.');
    if (isset($Test) && isset($Test['Suites'])) {
        F::Log('Test *' . $Call['Test']['Name'] . '* loaded', LOG_INFO);
        foreach ($Test['Suites'] as $SuiteName => $Suite) {
            foreach ($Suite as $CaseName => $Call['Case']) {
                $Call['Case']['Result']['Actual'] = F::Live($Call['Case']['Run'], $Call);
                if (isset($Call['Case']['Output']['Content'])) {
                    $Call['Case']['Result']['Actual'] = print_r($Call['Return']['Output']['Content'], true);
                }
                foreach ($Call['Case']['Assert'] as $Assert => $Call['Checker']) {
                    $TestTime = microtime(true);
                    // FIXME
                    $Call['Decision'] = F::Run('Test.Assert.' . $Assert, 'Do', $Call);
                    $TestTime = microtime(true) - $TestTime;
                }
                if (isset($Call['Case']['Result Key'])) {
                    $Call['Case']['Result']['Actual'] = F::Dot($Call['Case']['Result']['Actual'], $Call['Case']['Result Key']);
                }
                $Call['Test']['Report'][$Call['Test']['Name'] . $SuiteName . $CaseName] = [$Call['Test']['Name'], $SuiteName, $CaseName, '<pre>' . j($Call['Case']['Result']['Actual']) . '</pre>', round($TestTime, 5) * 1000, '_Class' => $Call['Decision'] ? 'success' : 'danger'];
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:Test.php

示例6: setFn

    } else {
        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'] : '';
开发者ID:trickyplan,项目名称:codeine,代码行数:31,代码来源:OldDirectory.php

示例7: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Get', function ($Call) {
    $Country = strtolower(F::Run('System.GeoIP', 'Country', $Call));
    $Flag = F::findFile('Assets/Country/img/flags/' . $Country . '.png');
    if ($Flag) {
    } else {
        $Flag = F::findFile('/Assets/Country/img/flags/un.png');
    }
    $Call['Output']['Content'] = $Flag;
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:18,代码来源:FlagByIP.php

示例8: setFn

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Check', function ($Call) {
    list($Asset, $ID) = F::Run('View', 'Asset.Route', ['Value' => $Call['CSS Name']]);
    $LESS = F::Run('IO', 'Execute', ['Execute' => 'Exist', 'Storage' => 'LESS', 'Scope' => [$Asset, 'less'], 'Where' => $ID]);
    if ($LESS === null) {
        F::Log('LESS *not found* ' . Root . '/Assets/' . $Asset . '/less/' . $ID . '.less', LOG_DEBUG, 'Developer');
    } else {
        $LESSVersion = F::Run('IO', 'Execute', ['Execute' => 'Version', 'Storage' => 'LESS', 'Scope' => [$Asset, 'less'], 'Where' => $ID]);
        $CSSVersion = F::Run('IO', 'Execute', ['Execute' => 'Version', 'Storage' => 'CSS', 'Scope' => [$Asset, 'css'], 'Where' => $ID]);
        if ($LESSVersion > $CSSVersion or isset($Call['HTTP']['Request']['Headers']['Pragma']) && $Call['HTTP']['Request']['Headers']['Pragma'] == 'no-cache') {
            // FIXME! Temporary decision.
            if ($LessPath = F::findFile('/Assets/' . $Asset . '/less/' . $ID . '.less')) {
                $Command = 'lessc ' . $LessPath;
                // $Command = 'lessc --clean-css ' .Root.'/Assets/'.$Asset.'/less/'.$ID.'.less > '.Root.'/Assets/'.$Asset.'/css/'.$ID.'.min.css';
                // shell_exec($Command);
                F::Log('LESS *processed* ' . Root . '/Assets/' . $Asset . '/less/' . $ID . '.less', LOG_INFO, 'Developer');
                F::Log($Command, LOG_INFO, 'Developer');
                $Call['CSS']['Styles'][$Call['CSS Name']] = shell_exec($Command);
            }
        } else {
            F::Log('LESS *skipped* ' . Root . '/Assets/' . $Asset . '/css/' . $ID . '.css', LOG_INFO, 'Developer');
        }
    }
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:30,代码来源:LESS.php

示例9: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Before', function ($Call) {
    $Call['Where'] = F::Live($Call['Where']);
    $Call['Data'] = F::Run('Entity', 'Read', $Call, ['One' => true, 'Limit' => ['From' => 0, 'To' => 1]]);
    return $Call;
});
setFn('Do', function ($Call) {
    $Call['Output']['Content'] = F::findFile('Data/' . $Call['Entity'] . '/File/' . $Call['Data']['File']);
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:17,代码来源:Download.php

示例10: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description Date() engine 
 * @package Codeine
 * @version 8.x
 */
setFn('Format', function ($Call) {
    $Values = file(F::findFile('Assets/Formats/Date/Verbal/Locale/ru/values.csv'));
    $H = date('H', $Call['Value']);
    $M = date('m', $Call['Value']);
    $IX = $H * 60 + $M;
    if (isset($Values[$IX])) {
        $Variants = explode(',', $Values[$IX]);
        return mb_strtolower($Variants[array_rand($Variants)]);
    } else {
        return null;
    }
});
开发者ID:trickyplan,项目名称:codeine,代码行数:20,代码来源:Verbal.php

示例11: setFn

<?php

/* Codeine
 * @author bergstein@trickyplan.com
 * @description  
 * @package Codeine
 * @version 8.x
 */
setFn('Do', function ($Call) {
    $Call['Output']['Content'] = F::findFile($Call['Project']['Beacon']['URL']);
    return $Call;
});
开发者ID:trickyplan,项目名称:codeine,代码行数:12,代码来源:Beacon.php


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