当前位置: 首页>>代码示例>>PHP>>正文


PHP tep_is_writable函数代码示例

本文整理汇总了PHP中tep_is_writable函数的典型用法代码示例。如果您正苦于以下问题:PHP tep_is_writable函数的具体用法?PHP tep_is_writable怎么用?PHP tep_is_writable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了tep_is_writable函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: osc_is_writable

function osc_is_writable($file)
{
    if (strtolower(substr(PHP_OS, 0, 3)) === 'win') {
        if (file_exists($file)) {
            $file = realpath($file);
            if (is_dir($file)) {
                $result = @tempnam($file, 'osc');
                if (is_string($result) && file_exists($result)) {
                    unlink($result);
                    return strpos($result, $file) === 0 ? true : false;
                }
            } else {
                $handle = @fopen($file, 'r+');
                if (is_resource($handle)) {
                    fclose($handle);
                    return true;
                }
            }
        } else {
            $dir = dirname($file);
            if (file_exists($dir) && is_dir($dir) && tep_is_writable($dir)) {
                return true;
            }
        }
        return false;
    } else {
        return is_writable($file);
    }
}
开发者ID:wrtcoder,项目名称:mini_isp,代码行数:29,代码来源:general.php

示例2: getMessage

 function getMessage()
 {
     if (STORE_SESSIONS == '') {
         if (!is_dir(tep_session_save_path())) {
             return WARNING_SESSION_DIRECTORY_NON_EXISTENT;
         } elseif (!tep_is_writable(tep_session_save_path())) {
             return WARNING_SESSION_DIRECTORY_NOT_WRITEABLE;
         }
     }
 }
开发者ID:othreed,项目名称:osCommerce-234-bootstrap-wADDONS,代码行数:10,代码来源:session_storage.php

示例3: tep_opendir

function tep_opendir($path)
{
    $path = rtrim($path, '/') . '/';
    $exclude_array = array('.', '..', '.DS_Store', 'Thumbs.db');
    $result = array();
    if ($handle = opendir($path)) {
        while (false !== ($filename = readdir($handle))) {
            if (!in_array($filename, $exclude_array)) {
                $file = array('name' => $path . $filename, 'is_dir' => is_dir($path . $filename), 'writable' => tep_is_writable($path . $filename), 'size' => filesize($path . $filename), 'last_modified' => strftime(DATE_TIME_FORMAT, filemtime($path . $filename)));
                $result[] = $file;
                if ($file['is_dir'] == true) {
                    $result = array_merge($result, tep_opendir($path . $filename));
                }
            }
        }
        closedir($handle);
    }
    return $result;
}
开发者ID:katapofatico,项目名称:Responsive-osCommerce,代码行数:19,代码来源:define_language.php

示例4: Copyright

  Copyright (c) 2014 osCommerce

  Released under the GNU General Public License
*/
require 'includes/application_top.php';
$action = isset($_GET['action']) ? $_GET['action'] : '';
if (tep_not_null($action)) {
    if ($action == 'reset') {
        tep_reset_cache_block($_GET['block']);
    }
    tep_redirect(tep_href_link(FILENAME_CACHE));
}
// check if the cache directory exists
if (is_dir(DIR_FS_CACHE)) {
    if (!tep_is_writable(DIR_FS_CACHE)) {
        $messageStack->add(ERROR_CACHE_DIRECTORY_NOT_WRITEABLE, 'error');
    }
} else {
    $messageStack->add(ERROR_CACHE_DIRECTORY_DOES_NOT_EXIST, 'error');
}
require DIR_WS_INCLUDES . 'template_top.php';
?>

    <table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php 
echo HEADING_TITLE;
?>
开发者ID:tiansiyuan,项目名称:oscommerce2,代码行数:30,代码来源:cache.php

示例5: tep_redirect

                $store_logo->set_filename('store_logo.png');
                if ($store_logo->save()) {
                    $messageStack->add_session(SUCCESS_LOGO_UPDATED, 'success');
                } else {
                    $error = true;
                }
            } else {
                $error = true;
            }
            if ($error == false) {
                tep_redirect(tep_href_link(FILENAME_STORE_LOGO));
            }
            break;
    }
}
if (!tep_is_writable(DIR_FS_CATALOG_IMAGES)) {
    $messageStack->add(sprintf(ERROR_IMAGES_DIRECTORY_NOT_WRITEABLE, tep_href_link(FILENAME_SEC_DIR_PERMISSIONS)), 'error');
}
require DIR_WS_INCLUDES . 'template_top.php';
?>

    <table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php 
echo HEADING_TITLE;
?>
</td>
            <td class="pageHeading" align="right"><?php 
echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT);
开发者ID:Sibzsolutions,项目名称:Savostore,代码行数:31,代码来源:store_logo.php

示例6: tep_redirect

        case 'deleteconfirm':
            if (strstr($_GET['file'], '..')) {
                tep_redirect(tep_href_link(FILENAME_BACKUP));
            }
            tep_remove(DIR_FS_BACKUP . '/' . $_GET['file']);
            if (!$tep_remove_error) {
                $messageStack->add_session(SUCCESS_BACKUP_DELETED, 'success');
                tep_redirect(tep_href_link(FILENAME_BACKUP));
            }
            break;
    }
}
// check if the backup directory exists
$dir_ok = false;
if (is_dir(DIR_FS_BACKUP)) {
    if (tep_is_writable(DIR_FS_BACKUP)) {
        $dir_ok = true;
    } else {
        $messageStack->add(ERROR_BACKUP_DIRECTORY_NOT_WRITEABLE, 'error');
    }
} else {
    $messageStack->add(ERROR_BACKUP_DIRECTORY_DOES_NOT_EXIST, 'error');
}
require DIR_WS_INCLUDES . 'template_top.php';
?>

    <table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php 
开发者ID:tiansiyuan,项目名称:oscommerce2,代码行数:31,代码来源:backup.php

示例7: Copyright

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2010 osCommerce

  Released under the GNU General Public License
*/
require 'includes/application_top.php';
$type = isset($HTTP_GET_VARS['type']) ? $HTTP_GET_VARS['type'] : '';
$banner_extension = tep_banner_image_extension();
// check if the graphs directory exists
$dir_ok = false;
if (function_exists('imagecreate') && tep_not_null($banner_extension)) {
    if (is_dir('images/graphs')) {
        if (tep_is_writable('images/graphs')) {
            $dir_ok = true;
        } else {
            $messageStack->add(ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE, 'error');
        }
    } else {
        $messageStack->add(ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST, 'error');
    }
}
$banner_query = tep_db_query("select banners_title from " . TABLE_BANNERS . " where banners_id = '" . (int) $HTTP_GET_VARS['bID'] . "'");
$banner = tep_db_fetch_array($banner_query);
$years_array = array();
$years_query = tep_db_query("select distinct year(banners_history_date) as banner_year from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . (int) $HTTP_GET_VARS['bID'] . "'");
while ($years = tep_db_fetch_array($years_query)) {
    $years_array[] = array('id' => $years['banner_year'], 'text' => $years['banner_year']);
}
开发者ID:katapofatico,项目名称:Responsive-osCommerce,代码行数:30,代码来源:banner_statistics.php

示例8: atleastOneFolderWritable

function atleastOneFolderWritable($dir)
{
    global $writable_folders_found;
    $ffs = scandir($dir);
    foreach ($ffs as $ff) {
        if ($ff != '.' && $ff != '..' && is_dir($dir . '/' . $ff)) {
            if (tep_is_writable($dir . '/' . $ff)) {
                $writable_folders_found = true;
                break;
            }
            atleastOneFolderWritable($dir . '/' . $ff);
        }
    }
    return $writable_folders_found;
}
开发者ID:othreed,项目名称:osCommerce-234-bootstrap-wADDONS,代码行数:15,代码来源:general.php

示例9: unlink

                if (is_file(DIR_WS_IMAGES . 'graphs/banner_daily-' . $banners_id . '.' . $banner_extension)) {
                    if (tep_is_writable(DIR_WS_IMAGES . 'graphs/banner_daily-' . $banners_id . '.' . $banner_extension)) {
                        unlink(DIR_WS_IMAGES . 'graphs/banner_daily-' . $banners_id . '.' . $banner_extension);
                    }
                }
            }
            $messageStack->add_session(SUCCESS_BANNER_REMOVED, 'success');
            tep_redirect(tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page']));
            break;
    }
}
// check if the graphs directory exists
$dir_ok = false;
if (function_exists('imagecreate') && tep_not_null($banner_extension)) {
    if (is_dir(DIR_WS_IMAGES . 'graphs')) {
        if (tep_is_writable(DIR_WS_IMAGES . 'graphs')) {
            $dir_ok = true;
        } else {
            $messageStack->add(ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE, 'error');
        }
    } else {
        $messageStack->add(ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST, 'error');
    }
}
require DIR_WS_INCLUDES . 'template_top.php';
?>

<script type="text/javascript"><!--
function popupImageWindow(url) {
  window.open(url,'popupImageWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}
开发者ID:tiansiyuan,项目名称:oscommerce2,代码行数:31,代码来源:banner_manager.php

示例10: check_destination

 function check_destination()
 {
     global $messageStack;
     if (!tep_is_writable($this->destination)) {
         if (is_dir($this->destination)) {
             if ($this->message_location == 'direct') {
                 $messageStack->add(sprintf(ERROR_DESTINATION_NOT_WRITEABLE, $this->destination), 'error');
             } else {
                 $messageStack->add_session(sprintf(ERROR_DESTINATION_NOT_WRITEABLE, $this->destination), 'error');
             }
         } else {
             if ($this->message_location == 'direct') {
                 $messageStack->add(sprintf(ERROR_DESTINATION_DOES_NOT_EXIST, $this->destination), 'error');
             } else {
                 $messageStack->add_session(sprintf(ERROR_DESTINATION_DOES_NOT_EXIST, $this->destination), 'error');
             }
         }
         return false;
     } else {
         return true;
     }
 }
开发者ID:othreed,项目名称:osCommerce-234-bootstrap-wADDONS,代码行数:22,代码来源:upload.php

示例11: pass

 function pass()
 {
     return file_exists(DIR_FS_CATALOG . 'includes/configure.php') && !tep_is_writable(DIR_FS_CATALOG . 'includes/configure.php');
 }
开发者ID:othreed,项目名称:osCommerce-234-bootstrap-wADDONS,代码行数:4,代码来源:config_file_catalog.php

示例12: Copyright

/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2009 osCommerce

  Released under the GNU General Public License
*/
require 'includes/application_top.php';
$htaccess_array = null;
$htpasswd_array = null;
$authuserfile_array = array('##### OSCOMMERCE ADMIN PROTECTION - BEGIN #####', 'AuthType Basic', 'AuthName "osCommerce Online Merchant Administration Tool"', 'AuthUserFile ' . DIR_FS_ADMIN . '.htpasswd_oscommerce', 'Require valid-user', '##### OSCOMMERCE ADMIN PROTECTION - END #####');
if (file_exists(DIR_FS_ADMIN . '.htpasswd_oscommerce') && tep_is_writable(DIR_FS_ADMIN . '.htpasswd_oscommerce') && file_exists(DIR_FS_ADMIN . '.htaccess') && tep_is_writable(DIR_FS_ADMIN . '.htaccess')) {
    $htaccess_array = array();
    $htpasswd_array = array();
    if (filesize(DIR_FS_ADMIN . '.htaccess') > 0) {
        $fg = fopen(DIR_FS_ADMIN . '.htaccess', 'rb');
        $data = fread($fg, filesize(DIR_FS_ADMIN . '.htaccess'));
        fclose($fg);
        $htaccess_array = explode("\n", $data);
    }
    if (filesize(DIR_FS_ADMIN . '.htpasswd_oscommerce') > 0) {
        $fg = fopen(DIR_FS_ADMIN . '.htpasswd_oscommerce', 'rb');
        $data = fread($fg, filesize(DIR_FS_ADMIN . '.htpasswd_oscommerce'));
        fclose($fg);
        $htpasswd_array = explode("\n", $data);
    }
}
开发者ID:respencer,项目名称:oscommerce2,代码行数:30,代码来源:administrators.php


注:本文中的tep_is_writable函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。