| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- /**
- * @package Dolphin Core
- * @copyright Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license CC-BY - http://creativecommons.org/licenses/by/3.0/
- */
- defined('BX_DOL') or die('hack attempt');
- class BxDolIO extends BxDol {
- function BxDolIO() {
- parent::BxDol();
- }
- public static function isExecutable($sFile) {
- clearstatcache();
- $aPathInfo = pathinfo(__FILE__);
- $sFile = $aPathInfo['dirname'] . '/../../' . $sFile;
- return (is_file($sFile) && is_executable($sFile));
- }
- public static function isWritable($sFile, $sPrePath = '/../../') {
- clearstatcache();
- $aPathInfo = pathinfo(__FILE__);
- $sFile = $aPathInfo['dirname'] . '/../../' . $sFile;
- return is_readable($sFile) && is_writable($sFile);
- }
- public static function getPermissions($sFileName) {
- $sPath = isset($GLOBALS['logged']['admin']) && $GLOBALS['logged']['admin'] ? BX_DIRECTORY_PATH_ROOT : '../';
- clearstatcache();
- $hPerms = @fileperms($sPath . $sFileName);
- if($hPerms == false) return false;
- $sRet = substr( decoct( $hPerms ), -3 );
- return $sRet;
- }
- }
|