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


PHP SC_Utils_Ex::sfRmDupSlash方法代码示例

本文整理汇总了PHP中SC_Utils_Ex::sfRmDupSlash方法的典型用法代码示例。如果您正苦于以下问题:PHP SC_Utils_Ex::sfRmDupSlash方法的具体用法?PHP SC_Utils_Ex::sfRmDupSlash怎么用?PHP SC_Utils_Ex::sfRmDupSlash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SC_Utils_Ex的用法示例。


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

示例1: lfMakeConfigFile

function lfMakeConfigFile()
{
    global $objWebParam;
    global $objDBParam;
    $root_dir = $objWebParam->getValue('install_dir');
    $root_dir = str_replace("\\", "/", $root_dir);
    // 語尾に'/'をつける
    if (!ereg("/\$", $root_dir)) {
        $root_dir = $root_dir . "/";
    }
    $normal_url = $objWebParam->getValue('normal_url');
    // 語尾に'/'をつける
    if (!ereg("/\$", $normal_url)) {
        $normal_url = $normal_url . "/";
    }
    $secure_url = $objWebParam->getValue('secure_url');
    // 語尾に'/'をつける
    if (!ereg("/\$", $secure_url)) {
        $secure_url = $secure_url . "/";
    }
    // ディレクトリの取得
    $url_dir = ereg_replace("^https?://[a-zA-Z0-9_:~=&\\?\\.\\-]+", "", $normal_url);
    $data_path = SC_Utils_Ex::sfRmDupSlash($root_dir . HTML2DATA_DIR);
    $data_path = str_replace("\\", "/", realpath($data_path));
    // 語尾に'/'をつける
    if (!ereg("/\$", $data_path)) {
        $data_path = $data_path . "/";
    }
    $filepath = $data_path . "install.php";
    $config_data = "<?php\n" . "    define ('ECCUBE_INSTALL', 'ON');\n" . "    define ('HTML_PATH', '" . $root_dir . "');\n" . "    define ('SITE_URL', '" . $normal_url . "');\n" . "    define ('SSL_URL', '" . $secure_url . "');\n" . "    define ('URL_DIR', '" . $url_dir . "');\n" . "    define ('DOMAIN_NAME', '" . $objWebParam->getValue('domain') . "');\n" . "    define ('DB_TYPE', '" . $objDBParam->getValue('db_type') . "');\n" . "    define ('DB_USER', '" . $objDBParam->getValue('db_user') . "');\n" . "    define ('DB_PASSWORD', '" . $objDBParam->getValue('db_password') . "');\n" . "    define ('DB_SERVER', '" . $objDBParam->getValue('db_server') . "');\n" . "    define ('DB_NAME', '" . $objDBParam->getValue('db_name') . "');\n" . "    define ('DB_PORT', '" . $objDBParam->getValue('db_port') . "');\n" . "    define ('DATA_PATH', '" . $data_path . "');\n" . "    define ('MOBILE_HTML_PATH', HTML_PATH . 'mobile/');\n" . "    define ('MOBILE_SITE_URL', SITE_URL . 'mobile/');\n" . "    define ('MOBILE_SSL_URL', SSL_URL . 'mobile/');\n" . "    define ('MOBILE_URL_DIR', URL_DIR . 'mobile/');\n" . "?>";
    if ($fp = fopen($filepath, "w")) {
        fwrite($fp, $config_data);
        fclose($fp);
    }
    /* install_mobile.incは使用しない用に変更
    
        // モバイル版の設定ファイル install_mobile.inc を作成する。
        $filepath = $data_path . "install_mobile.inc";
    
        $config_data =
        "<?php\n".
        "    define ('ECCUBE_INSTALL', 'ON');\n" .
        "    define ('HTML_PATH', '" . $root_dir . "mobile/');\n" .
        "    define ('PC_HTML_PATH', '" . $root_dir . "');\n" .
        "    define ('SITE_URL', '" . $normal_url . "mobile/');\n" .
        "    define ('PC_SITE_URL', '" . $normal_url . "');\n" .
        "    define ('SSL_URL', '" . $secure_url . "mobile/');\n" .
        "    define ('PC_SSL_URL', '" . $secure_url . "');\n" .
        "    define ('URL_DIR', '" . $url_dir . "mobile/');\n" .
        "    define ('PC_URL_DIR', '" . $url_dir . "');\n" .
        "    define ('DOMAIN_NAME', '" . $objWebParam->getValue('domain') . "');\n" .
        "    define ('DB_TYPE', '" . $objDBParam->getValue('db_type') . "');\n" .
        "    define ('DB_USER', '" . $objDBParam->getValue('db_user') . "');\n" .
        "    define ('DB_PASSWORD', '" . $objDBParam->getValue('db_password') . "');\n" .
        "    define ('DB_SERVER', '" . $objDBParam->getValue('db_server') . "');\n" .
        "    define ('DB_NAME', '" . $objDBParam->getValue('db_name') . "');\n" .
        "    define ('DB_PORT', '" . $objDBParam->getValue('db_port') .  "');\n" .
        "    define ('DATA_PATH', '".$data_path."');\n" .
        "?>";
    
        if($fp = fopen($filepath,"w")) {
            fwrite($fp, $config_data);
            fclose($fp);
        }
    */
}
开发者ID:khrisna,项目名称:eccubedrm,代码行数:66,代码来源:index.php

示例2: realpath

 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
$require_php_dir = realpath(dirname(__FILE__));
require_once $require_php_dir . "/define.php";
require_once $require_php_dir . HTML2DATA_DIR . "require_base.php";
// 携帯端末の場合は mobile 以下へリダイレクトする。
if (SC_MobileUserAgent::isMobile()) {
    $url = "";
    if (SC_Utils_Ex::sfIsHTTPS()) {
        $url = MOBILE_SSL_URL;
    } else {
        $url = MOBILE_SITE_URL;
    }
    if (preg_match('|^' . URL_DIR . '(.*)$|', $_SERVER['REQUEST_URI'], $matches)) {
        $path = $matches[1];
    } else {
        $path = '';
    }
    header("Location: " . SC_Utils_Ex::sfRmDupSlash($url . $path));
    exit;
}
开发者ID:khrisna,项目名称:eccubedrm,代码行数:31,代码来源:require.php

示例3: is_array

        <?php 
                }
                ?>

      <a href="<?php 
                echo is_array($_tmp = @URL_DIR) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp);
                ?>
products/detail.php?product_id=<?php 
                echo is_array($_tmp = $this->_tpl_vars['arrBestProducts'][$this->_tpl_vars['cnt2']]['product_id']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp);
                ?>
">
        <img src="<?php 
                echo is_array($_tmp = @SITE_URL) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp);
                ?>
resize_image.php?image=<?php 
                echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['image_path']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp)) ? $this->_run_mod_handler('sfRmDupSlash', true, $_tmp) : SC_Utils_Ex::sfRmDupSlash($_tmp);
                ?>
&amp;width=48&amp;height=48" alt="<?php 
                echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['arrBestProducts'][$this->_tpl_vars['cnt2']]['name']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp)) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp);
                ?>
" />
      </a>

      <h3>
      <a href="<?php 
                echo is_array($_tmp = @URL_DIR) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp);
                ?>
products/detail.php?product_id=<?php 
                echo is_array($_tmp = $this->_tpl_vars['arrBestProducts'][$this->_tpl_vars['cnt2']]['product_id']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp);
                ?>
"><?php 
开发者ID:RyotaKaji,项目名称:eccube-2.4.1,代码行数:31,代码来源:%%F6^F6B^F6BCF831%%best5.tpl.php


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