本文整理汇总了PHP中files::get方法的典型用法代码示例。如果您正苦于以下问题:PHP files::get方法的具体用法?PHP files::get怎么用?PHP files::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类files
的用法示例。
在下文中一共展示了files::get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
function edit()
{
events::observe('save', 'templates', 'apps', '_save');
events::observer();
$tmpl_file = events::get('tmpl_file');
$app = events::get('app');
if (events::detect('restore')) {
self::restoreVersion($app, $tmpl_file, events::get('restore'));
}
admin::components('tabs', 'validator');
f::set('app', $app);
f::set('tmpl_file', $tmpl_file);
s::set('app', $app);
s::set('tmpl_file', $tmpl_file);
$file = SYS_ROOT . 'tmpls/' . ADMIN_SITE . '/' . $app . '/' . $tmpl_file;
$code = files::get($file);
f::set('tmpl_code', $code);
self::getApps();
/*
Load versions
*/
db::table('templates_versions');
db::where('app', $app);
db::where('tmpl_file', $tmpl_file);
db::order('version_date', 'DESC');
$res = db::select();
while ($row = mysql_fetch_assoc($res)) {
$row['version_date'] = dt::date2print('%H:%i %d.%m.%Y', $row['version_date']);
$row['version_code'] = '{non}' . htmlspecialchars($row['version_code']) . '{/non}';
s::roll('versions', $row);
}
}
示例2: die
return;
}
// stop crawlers
if (Surfer::is_crawler()) {
Safe::header('Status: 401 Unauthorized', TRUE, 401);
die(i18n::s('You are not allowed to perform this operation.'));
}
// some input is mandatory
if (!isset($_REQUEST['file']) && !isset($_REQUEST['target'])) {
Safe::header('Status: 400 Bad Request', TRUE, 400);
die(i18n::s('Request is invalid.'));
}
// préparation de la variable de sortie
$output = array('success' => null);
// get file to move
$file = new File(files::get($_REQUEST['file']));
// get target
$target = Anchors::get($_REQUEST['target']);
// check again
if (!isset($file->item) || !isset($target->item)) {
Safe::header('Status: 400 Bad Request', TRUE, 400);
die(i18n::s('Request is invalid.'));
}
// remember last parent
$last_parent = $file->anchor;
// check rights
if (!$file->is_assigned() || !$target->is_assigned()) {
Safe::header('Status: 401 Unauthorized', TRUE, 401);
die(i18n::s('You are not allowed to perform this operation.'));
}
// target may override work
示例3: adapter
function adapter()
{
$adapter_file = APPS . self::$map['app'] . '/adapter.ini';
$array = ini::parse($adapter_file);
$action = self::$map['module'] . '.' . self::$map['action'];
if (self::$apps_excl) {
if (self::$map['app'] != 'system' || $action != 'profile.view') {
if (!isset(self::$apps_excl[self::$map['app']][$action])) {
return self::loadErrorPage();
}
}
}
if (!$array) {
return self::loadErrorPage();
}
if (!isset($array[$action])) {
return self::loadErrorPage();
}
$mtabs = $tabs = false;
foreach ($array as $k => $v) {
if (isset($v['rule'])) {
$rule = explode(',', $v['rule']);
$continue = true;
foreach ($rule as $u) {
$u = trim($u);
if ($u == RULE || $u == 'all') {
$continue = false;
}
}
if ($continue) {
continue;
}
}
if (arrays::testKey($v, 'ico')) {
$ico = 'tab_ico tab_ico_' . $v['ico'];
} else {
$ico = '';
}
if (arrays::testKey($v, 'mtab')) {
$active = false;
if ($action == $k) {
$active = true;
}
if ($v['mtab'] == 1) {
$name = $v['title'];
} else {
$name = $v['mtab'];
}
$list = explode('.', $k);
$link = SYS_DIR . self::$map['app'] . '/' . $list[0] . '/' . $list[1] . '/';
if (isset($v['right'])) {
if ($active) {
$addtabs[$list[0]][] = array('tab' => '<span class="' . $ico . '">' . $name . '</span>');
} else {
$addtabs[$list[0]][] = array('tab' => '<a href="' . $link . '" class="' . $ico . '">' . $name . '</a>');
}
} else {
if ($active) {
$mtabs[$list[0]][] = array('tab' => '<span class="' . $ico . '">' . $name . '</span>');
} else {
$mtabs[$list[0]][] = array('tab' => '<a href="' . $link . '" class="' . $ico . '">' . $name . '</a>');
}
}
} else {
if (arrays::testKey($v, 'tab')) {
$active = false;
if ($action == $k) {
$active = true;
}
if ($v['tab'] == 1) {
$name = $v['title'];
} else {
$name = $v['tab'];
}
$list = explode('.', $k);
$link = SYS_DIR . self::$map['app'] . '/' . $list[0] . '/' . $list[1] . '/';
if (isset($v['right'])) {
if ($active) {
$addtabs[] = array('tab' => '<span class="' . $ico . '">' . $name . '</span>');
} else {
$addtabs[] = array('tab' => '<a href="' . $link . '" class="' . $ico . '">' . $name . '</a>');
}
} else {
if ($active) {
$tabs[] = array('tab' => '<span class="' . $ico . '">' . $name . '</span>');
} else {
$tabs[] = array('tab' => '<a href="' . $link . '" class="' . $ico . '">' . $name . '</a>');
}
}
}
}
}
if (isset($mtabs[self::$map['module']]) && $mtabs[self::$map['module']]) {
s::rollArray('admin_tabs', $mtabs[self::$map['module']]);
s::set('admin_tabs', files::get(ROOT . STYLE_PATH . 'tmpls/tabs.html'));
if (isset($addtabs[self::$map['module']])) {
s::rollArray('admin_right_tabs', $addtabs[self::$map['module']]);
}
} else {
if ($tabs) {
//.........这里部分代码省略.........
示例4: uploadFile
function uploadFile()
{
$content = '';
$content = files::get($_FILES['file']['tmp_name']);
buffer::set('{non}' . htmlspecialchars($content) . '{/non}');
}