本文整理汇总了PHP中get_dir_file_info函数的典型用法代码示例。如果您正苦于以下问题:PHP get_dir_file_info函数的具体用法?PHP get_dir_file_info怎么用?PHP get_dir_file_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_dir_file_info函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: profile
public function profile()
{
$this->load->helper('file');
$this->data['avatars'] = get_dir_file_info('../public/admin/avatars', FALSE);
$this->data['admin'] = $this->data['user_info'];
$this->load->view('index/profile', $this->data);
}
示例2: create
/**
* Create Database
*
* Creates database tables and fields.
*
* @access public
* @return bool
*/
function create()
{
/**
* This is a dirty hack.
*
* SQLite doesn't support database listing as each
* database is a different file.
*
* The code below gets file information from the root
* directory and looks at the filesize of "database.db".
*
* If "database.db" has a filesize of 0 (i.e. it
* has not been written to) private functions setup
* the database.
*/
$this->load->helper('file');
$this->load->helper('error');
$info = get_dir_file_info('./', $top_level_only = true);
if ($info['db.sqlite3']['size'] > 0) {
// Database is already setup
return error('Database was already setup');
} else {
$this->_create_posts();
$this->_create_sitemap();
return true;
}
}
示例3: get_languages
function get_languages()
{
$theme_folders = get_dir_file_info(dirname(dirname(__FILE__)).'/language');
//unset($la_folders[$this->get('admin_theme')]);
unset($theme_folders['index.html']);
return $theme_folders;
}
示例4: getNewImages
public function getNewImages()
{
$this->CI->load->helper(array('file', 'gallery'));
$this->CI->load->model('photo_model');
$exif_availabale = is_exif_available();
$files = get_dir_file_info($this->CI->config->item('image_dir', 'gallery'), true);
$i = 0;
$images = array();
$photos = $this->CI->photo_model->getFilenames();
foreach($files as $file)
{
$fn = $file['name'];
if(!in_array($fn, $photos) && preg_match('/\.jpg/i', $fn))
{
if($exif_availabale)
{
$images[$i]['exif'] = exif_read_data($this->CI->config->item('image_folder', 'gallery').$fn);
}
$images[$i]['filename'] = $fn;
$i++;
}
}
return $images;
}
示例5: restore
public function restore($sqlfile = '')
{
$data['title'] = '数据库还原';
$data['act'] = $this->uri->segment(3);
$data['sqlfiles'] = get_dir_file_info(FCPATH . 'data/db', $top_level_only = TRUE);
//echo var_dump($data['sqlfiles']);
if ($_POST) {
$sqlfiles = array_slice($this->input->post(), 0, -1);
//echo var_export($sqlfiles);
foreach ($sqlfiles as $k => $v) {
unlink(FCPATH . 'data/db/' . $v);
}
$this->session->set_flashdata('error', '删除sql文件成功!');
redirect('admin/db_admin/restore');
}
if ($sqlfile) {
$sql = file_get_contents(FCPATH . 'data/db/' . $sqlfile);
if ($this->run_sql($sql)) {
$this->session->set_flashdata('error', '还原sql文件成功!');
redirect('admin/db_admin/restore');
}
}
$data['csrf_name'] = $this->security->get_csrf_token_name();
$data['csrf_token'] = $this->security->get_csrf_hash();
$this->load->view('db_admin', $data);
}
示例6: backups
public function backups()
{
// Get a list of existing backup files
$this->load->helper('file');
Template::set('backups', get_dir_file_info($this->backup_folder));
Template::set('toolbar_title', lang('db_database_backups'));
Template::render();
}
示例7: banner
function banner()
{
$banners = get_dir_file_info('./images/banners', TRUE);
$banners = array_values($banners);
$count = count($banners);
$i = rand(0, $count - 1);
return $banners[$i]['name'];
}
示例8: check_is_install_folder_exist
function check_is_install_folder_exist()
{
if (get_dir_file_info('./application/modules/install')) {
return true;
} else {
return false;
}
}
示例9: index
function index()
{
$this->load->helper('file');
$this->load->helper('inflector');
$data->page_name = 'Options';
$theme_folder = get_dir_file_info(BASEPATH . 'application/views/themes', FALSE, TRUE);
foreach ($theme_folder as $key => $value) {
if (is_dir(BASEPATH . 'application/views/themes/' . $key)) {
$themes[$key]->folder = $key;
$themes[$key]->name = humanize($key);
}
}
$data->themes = $themes;
if ($_POST) {
$this->load->library('validation');
$fields['lifestream_title'] = 'Lifestream Title';
$fields['admin_email'] = 'Admin Email';
$fields['new_password'] = 'New Password';
$fields['new_password_confirm'] = 'New Password Confirm';
$fields['per_page'] = 'Items Per Page';
$this->validation->set_fields($fields);
$rules['lifestream_title'] = "trim|required";
$rules['admin_email'] = "trim|required|valid_email";
$rules['new_password'] = "trim|matches[new_password_confirm]";
$rules['new_password_confirm'] = "trim";
$rules['per_page'] = "numeric";
$this->validation->set_rules($rules);
if ($this->validation->run() == FALSE) {
$data->errors = $this->validation->error_string;
$this->load->view('admin/_header', $data);
$this->load->view('admin/options', $data);
$this->load->view('admin/_footer');
} else {
//set new password if required
if ($this->validation->new_password && $this->validation->new_password != '') {
$password = md5($this->validation->new_password);
$this->db->update('users', array('user_pass' => $password), array('ID' => $this->data->user->ID));
}
//set admin email
$this->db->update('users', array('user_email' => $this->validation->admin_email), array('ID' => $this->data->user->ID));
unset($_POST['new_password']);
unset($_POST['new_password_confirm']);
//save options
foreach ($_POST as $key => $value) {
$option_array[$key]->option_name = $key;
$option_array[$key]->option_value = $value;
}
foreach ($option_array as $option) {
$this->option_model->add_option($option);
}
header('Location: ' . $this->config->item('base_url') . 'admin/options');
}
} else {
$this->load->view('admin/_header', $data);
$this->load->view('admin/options', $data);
$this->load->view('admin/_footer');
}
}
示例10: __construct
public function __construct()
{
$this->class =& get_instance();
$this->class->load->helper("file");
$m = get_dir_file_info(APPPATH . "models/", false);
$c = get_dir_file_info(APPPATH . "controllers/", false);
$this->model_ = $this->SetWrite($m, "models\\");
$this->controller_ = $this->SetWrite($c, "controllers\\");
}
示例11: importar_data
protected function importar_data()
{
$ruta = "//199.69.69.93\\interfaces_cedentes\\Cargas Procesos\\APLICACIONES\\UVM_CARSIT\\ENTRADA";
$listado = get_dir_file_info($ruta);
foreach ($listado as $key => $value) {
$r = $listado[$key];
$this->data[$r["name"]] = load_file($r["server_path"], null, "dia");
}
}
示例12: up
function up()
{
// fix the fuckup from version 0.7 caching comic entries
$all_files = get_dir_file_info('content/comics', FALSE);
if (is_array($all_files)) {
foreach ($all_files as $key => $file) {
if (strtolower(substr($file["name"], -4) == ".zip")) {
// remove every zip
unlink($file["relative_path"] . $file["name"]);
}
}
}
// remove also all the database entries
$this->db->query("TRUNCATE TABLE `" . $this->db->dbprefix('archives') . "`");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('archives') . "` ADD INDEX ( `size` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('archives') . "` ADD INDEX ( `chapter_id` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('archives') . "` CHANGE `edited` `updated` DATETIME NOT NULL");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('chapters') . "` ADD INDEX ( `comic_id` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('chapters') . "` ADD INDEX ( `team_id` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('chapters') . "` ADD INDEX ( `joint_id` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('chapters') . "` ADD INDEX ( `chapter` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('chapters') . "` ADD INDEX ( `subchapter` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('chapters') . "` ADD INDEX ( `volume` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('chapters') . "` ADD INDEX ( `language` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('chapters') . "` ADD INDEX ( `stub` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('chapters') . "` ADD INDEX ( `uniqid` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('chapters') . "` ADD INDEX ( `updated` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('comics') . "` ADD INDEX ( `stub` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('comics') . "` ADD INDEX ( `uniqid` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('comics') . "` ADD INDEX ( `hidden` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('comics') . "` ADD INDEX ( `created` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('joints') . "` ADD INDEX ( `joint_id` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('joints') . "` ADD INDEX ( `team_id` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('licenses') . "` ADD INDEX ( `comic_id` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('licenses') . "` ADD INDEX ( `nation` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('memberships') . "` ADD INDEX ( `team_id` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('memberships') . "` ADD INDEX ( `user_id` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('memberships') . "` ADD INDEX ( `is_leader` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('memberships') . "` ADD INDEX ( `accepted` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('memberships') . "` ADD INDEX ( `requested` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('memberships') . "` ADD INDEX ( `applied` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('memberships') . "` ADD INDEX ( `created` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('memberships') . "` CHANGE `edited` `updated` DATETIME NOT NULL");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('memberships') . "` ADD INDEX ( `updated` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('profiles') . "` ADD INDEX ( `user_id` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('profiles') . "` ADD INDEX ( `group_id` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('teams') . "` ADD INDEX ( `name` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('teams') . "` ADD INDEX ( `stub` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('teams') . "` ADD INDEX ( `created` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('teams') . "` ADD INDEX ( `updated` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('users') . "` ADD INDEX ( `username` )");
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('users') . "` ADD INDEX ( `created` )");
//create a new field in chapters for the custom chapter titles
$this->db->query("ALTER TABLE `" . $this->db->dbprefix('comics') . "` ADD `customchapter` VARCHAR( 32 ) NOT NULL AFTER `thumbnail`");
}
示例13: list_items
function list_items($limit = null, $offset = 0, $col = 'name', $order = 'asc')
{
$CI =& get_instance();
$CI->load->helper('array');
$CI->load->helper('convert');
if (!isset($this->filters['group_id'])) {
return array();
}
$group_id = $this->filters['group_id'];
// not encoded yet... then decode
if (!$this->_encoded) {
$this->filters['group_id'] = uri_safe_encode($group_id);
// to pass the current folder
$this->_encoded = TRUE;
} else {
$group_id = uri_safe_decode($group_id);
}
$asset_dir = $this->get_dir($group_id);
$assets_path = $CI->asset->assets_server_path . $asset_dir . DIRECTORY_SEPARATOR;
$tmpfiles = directory_to_array($assets_path, TRUE, $CI->config->item('assets_excluded_dirs', 'fuel'), FALSE);
$files = get_dir_file_info($assets_path, TRUE);
$cnt = count($tmpfiles);
$return = array();
$asset_type_path = WEB_PATH . $CI->config->item('assets_path') . $asset_dir . '/';
//for ($i = $offset; $i < $cnt - 1; $i++)
for ($i = 0; $i < $cnt; $i++) {
if (!empty($tmpfiles[$i]) && !empty($files[$tmpfiles[$i]])) {
$key = $tmpfiles[$i];
if (empty($this->filters['name']) || !empty($this->filters['name']) && (strpos($files[$key]['name'], $this->filters['name']) !== FALSE || strpos($key, $this->filters['name']) !== FALSE)) {
$file['id'] = uri_safe_encode(assets_server_to_web_path($files[$tmpfiles[$i]]['server_path'], TRUE));
//$file['filename'] = $files[$key]['name'];
$file['name'] = $key;
$file['preview/kb'] = $files[$key]['size'];
$file['link'] = NULL;
$file['last_updated'] = english_date($files[$key]['date'], true);
$return[] = $file;
}
}
}
$return = array_sorter($return, $col, $order, TRUE);
// do a check for empty limit values to prevent issues found where an empty $limit value would return nothing in 5.16
$return = empty($limit) ? array_slice($return, $offset) : array_slice($return, $offset, $limit);
// after sorting add the images
foreach ($return as $key => $val) {
if (is_image_file($return[$key]['name'])) {
$return[$key]['preview/kb'] = $return[$key]['preview/kb'] . ' kb <div class="img_crop"><a href="' . $asset_type_path . $return[$key]['name'] . '" target="_blank"><img src="' . $asset_type_path . $return[$key]['name'] . '" border="0"></a></div>';
$return[$key]['link'] = '<a href="' . $asset_type_path . $return[$key]['name'] . '" target="_blank">' . $asset_dir . '/' . $return[$key]['name'] . '</a>';
} else {
$return[$key]['preview/kb'] = $return[$key]['preview/kb'];
$return[$key]['link'] = '<a href="' . $asset_type_path . $return[$key]['name'] . '" target="_blank">' . $asset_dir . '/' . $return[$key]['name'] . '</a>';
}
}
return $return;
}
示例14: index
public function index()
{
$this->load->library('inc');
$this->load->helper('my');
$this->load->helper('file');
$this->load->model('sys_db_m');
$data['js'] = array('system/sys_db_restore.js');
$data['Menus'] = $this->inc->getMenuAdmin($this);
$data['file'] = get_dir_file_info($this->config->config['backup'], false);
$this->inc->adminView($this, 'system/db/restore/index', $data);
}
示例15: database_backup
public function database_backup()
{
$this->data['ignore_tabls'] = $this->ignore_tabls;
$this->data['items'] = $this->db->list_tables();
$this->load->helper('file');
$files = get_dir_file_info('./db_backup', TRUE);
//只遍历一层
unset($files['index.html']);
$this->data['files'] = $files;
$this->load->view('tools/database_backup', $this->data);
}