PHP 8.1.33
Preview: path_helper.php Size: 2.80 KB
/home/jambtst2015/public_html/app/system/helpers/path_helper.php

<?php
/**
 * CodeIgniter
 *
 * An open source application development framework for PHP
 *
 * This content is released under the MIT License (MIT)
 *
 * Copyright (c) 2014 - 2015, British Columbia Institute of Technology
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * @package	CodeIgniter
 * @author	EllisLab Dev Team
 * @copyright	Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
 * @copyright	Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
 * @license	http://opensource.org/licenses/MIT	MIT License
 * @link	http://codeigniter.com
 * @since	Version 1.0.0
 * @filesource
 */
defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * CodeIgniter Path Helpers
 *
 * @package		CodeIgniter
 * @subpackage	Helpers
 * @category	Helpers
 * @author		EllisLab Dev Team
 * @link		http://codeigniter.com/user_guide/helpers/path_helper.html
 */

// ------------------------------------------------------------------------

if ( ! function_exists('set_realpath'))
{
	/**
	 * Set Realpath
	 *
	 * @param	string
	 * @param	bool	checks to see if the path exists
	 * @return	string
	 */
	function set_realpath($path, $check_existance = FALSE)
	{
		// Security check to make sure the path is NOT a URL. No remote file inclusion!
		if (preg_match('#^(http:\/\/|https:\/\/|www\.|ftp|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})#i', $path))
		{
			show_error('The path you submitted must be a local server path, not a URL');
		}

		// Resolve the path
		if (realpath($path) !== FALSE)
		{
			$path = realpath($path);
		}
		elseif ($check_existance && ! is_dir($path) && ! is_file($path))
		{
			show_error('Not a valid path: '.$path);
		}

		// Add a trailing slash, if this is a directory
		return is_dir($path) ? rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR : $path;
	}
}

Directory Contents

Dirs: 0 × Files: 22

Name Size Perms Modified Actions
3.40 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
7.29 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
3.75 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
18.86 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
3.25 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
4.65 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
2.63 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
11.91 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
22.24 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
9.39 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
131 B lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
6.81 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
2.52 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
2.92 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
2.80 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
3.61 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
6.74 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
7.41 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
13.84 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
3.18 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
13.54 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download
2.79 KB lrwxrwxrwx 2024-11-22 17:53:15
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).