本文整理汇总了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;
});
示例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;
});
示例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']);
}
示例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++;
}
示例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'];
示例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'] : '';
示例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;
});
示例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;
});
示例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;
});
示例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;
}
});
示例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;
});