當前位置: 首頁>>代碼示例>>PHP>>正文


PHP is_sae函數代碼示例

本文整理匯總了PHP中is_sae函數的典型用法代碼示例。如果您正苦於以下問題:PHP is_sae函數的具體用法?PHP is_sae怎麽用?PHP is_sae使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了is_sae函數的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: send_mail

/**
 * 係統郵件發送函數
 * @param string $to 接收郵件者郵箱
 * @param string $name 接收郵件者名稱
 * @param string $subject 郵件主題
 * @param string $body 郵件內容
 * @param string $attachment 附件列表
 * @茉莉清茶 57143976@qq.com
 */
function send_mail($to = '', $subject = '', $body = '', $name = '', $attachment = null)
{
    if (is_sae()) {
        return sae_mail($to, $subject, $body, $name);
    } else {
        return send_mail_local($to, $subject, $body, $name, $attachment);
    }
}
開發者ID:nullog,項目名稱:zhanglubao,代碼行數:17,代碼來源:vendors.php

示例2: getImageUrlByPath

/**
 * Created by PhpStorm.
 * User: caipeichao
 * Date: 14-3-10
 * Time: PM7:40
 */
function getImageUrlByPath($path, $size)
{
    //TODO 重新開啟縮略
    $thumb = getThumbImage($path, $size, $size);
    // $thumb['src']=$path;
    $thumb = $thumb['src'];
    if (!is_sae()) {
        $thumb = getRootUrl() . $thumb;
    }
    return $thumb;
}
開發者ID:fishling,項目名稱:chatPro,代碼行數:17,代碼來源:thumb.php

示例3: send_mail

/**
 * 係統郵件發送函數
 * @param string $to 接收郵件者郵箱
 * @param string $name 接收郵件者名稱
 * @param string $subject 郵件主題
 * @param string $body 郵件內容
 * @param string $attachment 附件列表
 * @茉莉清茶 57143976@qq.com
 */
function send_mail($to = '', $subject = '', $body = '', $name = '', $attachment = null)
{
    $host = C('MAIL_SMTP_HOST');
    $user = C('MAIL_SMTP_USER');
    $pass = C('MAIL_SMTP_PASS');
    if (empty($host) || empty($user) || empty($pass)) {
        return '管理員還未配置郵件信息,請聯係管理員配置';
    }
    if (is_sae()) {
        return sae_mail($to, $subject, $body, $name);
    } else {
        return send_mail_local($to, $subject, $body, $name, $attachment);
    }
}
開發者ID:ccccy,項目名稱:wuanlife,代碼行數:23,代碼來源:vendors.php

示例4: send_mail

/**
 * 係統郵件發送函數
 * @param string $to 接收郵件者郵箱
 * @param string $name 接收郵件者名稱
 * @param string $subject 郵件主題
 * @param string $body 郵件內容
 * @param string $attachment 附件列表
 * @茉莉清茶 57143976@qq.com
 */
function send_mail($to = '', $subject = '', $body = '', $name = '', $attachment = null)
{
    $host = C('MAIL_SMTP_HOST');
    $user = C('MAIL_SMTP_USER');
    $pass = C('MAIL_SMTP_PASS');
    if (empty($host) || empty($user) || empty($pass)) {
        return L('_THE_ADMINISTRATOR_HAS_NOT_YET_CONFIGURED_THE_MESSAGE_INFORMATION_PLEASE_CONTACT_THE_ADMINISTRATOR_CONFIGURATION_');
    }
    if (is_sae()) {
        return sae_mail($to, $subject, $body, $name);
    } else {
        return send_mail_local($to, $subject, $body, $name, $attachment);
    }
}
開發者ID:terrydeng,項目名稱:beimeibang1205,代碼行數:23,代碼來源:vendors.php

示例5: complete

 public function complete()
 {
     //更新緩存
     define('PLATFORM', is_sae() ? 'sae' : 'default');
     define('DILICMS_SHARED_PATH', BASEPATH . '../shared/');
     $this->load->add_package_path(DILICMS_SHARED_PATH);
     $this->load->library('platform', array('type' => PLATFORM, 'storage' => 'public'));
     $this->load->library('settings');
     $this->load->helper('common');
     $this->load->database();
     $this->load->model('cache_mdl');
     $this->cache_mdl->update_model_cache();
     $this->cache_mdl->update_category_cache();
     $this->cache_mdl->update_menu_cache();
     $this->cache_mdl->update_role_cache();
     $this->cache_mdl->update_site_cache();
     $this->cache_mdl->update_backend_cache();
     $this->cache_mdl->update_plugin_cache();
     $this->cache_mdl->update_fieldtypes_cache();
     //創建安裝鎖定文件
     if (is_sae()) {
         $this->platform->file_write('install.lock', 'Welcome to DiliCMS!');
     } else {
         $this->platform->file_write(DILICMS_SHARED_PATH . 'settings/install.lock', 'Welcome to DiliCMS!');
     }
 }
開發者ID:PoppyLi,項目名稱:DiliCMS,代碼行數:26,代碼來源:install.php

示例6: saveAvatar

 /**
  * 將頭像保存到本地
  * @param $url
  * @param $oid
  * @param $uid
  * autor:xjw129xjt
  */
 protected function saveAvatar($url, $oid, $uid, $type)
 {
     if (is_sae()) {
         $s = new \SaeStorage();
         $img = file_get_contents($url);
         //括號中的為遠程圖片地址
         $url_sae = $s->write(C('UPLOAD_SAE_CONFIG.domain'), '/Avatar/' . $type . 'Avatar/' . $oid . '.jpg', $img);
         $data['path'] = $url_sae;
     } else {
         mkdir('./Uploads/Avatar/' . $type . 'Avatar', 0777, true);
         $img = file_get_contents($url);
         $filename = './Uploads/Avatar/' . $type . 'Avatar/' . $oid . '.jpg';
         file_put_contents($filename, $img);
         $data['path'] = $type . 'Avatar/' . $oid . '.jpg';
     }
     $data['uid'] = $uid;
     $data['create_time'] = time();
     $data['status'] = 1;
     $data['is_temp'] = 0;
     D('avatar')->add($data);
 }
開發者ID:fishling,項目名稱:chatPro,代碼行數:28,代碼來源:BaseController.class.php

示例7: getAvatarPath

 public function getAvatarPath($uid, $avatarSize)
 {
     $model = D('Addons://Avatar/Avatar');
     $avatar = $model->getAvatar($uid);
     if ($avatar) {
         if (is_sae()) {
             $avatar_path = $avatar;
         } else {
             $avatar_path = "/Uploads/Avatar/{$avatar}";
         }
         return getImageUrlByPath($avatar_path, $avatarSize);
     } else {
         //如果沒有頭像,返回默認頭像
         if ($avatarSize != 0) {
             return getRootUrl() . "Addons/Avatar/default_" . $avatarSize . "_" . $avatarSize . ".png";
         } else {
             return getRootUrl() . "Addons/Avatar/default.png";
         }
     }
 }
開發者ID:Willshon,項目名稱:OLCS,代碼行數:20,代碼來源:AvatarAddon.class.php

示例8: fixAttachUrl

function fixAttachUrl($url)
{
    if (!is_sae()) {
        return getRootUrl() . substr($url, 1);
    } else {
        return $url;
    }
}
開發者ID:Willshon,項目名稱:OLCS,代碼行數:8,代碼來源:function.php

示例9: fixAttachUrl

function fixAttachUrl($url)
{
    if (!is_sae()) {
        return str_replace('//', '/', getRootUrl() . substr($url, 1));
        //防止雙斜杠的出現
    } else {
        return $url;
    }
}
開發者ID:yaomoo,項目名稱:bbs,代碼行數:9,代碼來源:thumb.php

示例10:

<blockquote>
  <p>DiliCMS 目前支持普通環境以及SAE(新浪雲平台).</p>
</blockquote>
<?php 
if (!is_sae()) {
    ?>
    <div class="alert">
        當前運行環境為: <strong>普通環境</strong> 
    </div>
    <?php 
    if (!$is_config_ok) {
        ?>
    <div class="alert alert-error">
        shared/config/platform.php <strong>未正確配置</strong>,請先正確配置shared/config/platform.php。<br />
        shared/config/platform.php必須可讀且type的值必須為default.
    </div>
    <?php 
    } else {
        ?>
    <div class="alert">
        shared/config/platform.php <strong>配置正確</strong>
    </div>
    <?php 
    }
} else {
    ?>
    <div class="alert">
        當前運行環境為: <strong>SAE</strong>, 需要開啟以下環境: 
        <ul>
            <li>Memcache</li>
            <li>MySQL</li>
開發者ID:PoppyLi,項目名稱:DiliCMS,代碼行數:31,代碼來源:platform.php

示例11: saveAvatar

 /**
  * saveAvatar  保存頭像到本地
  * @param $url
  * @param $oid
  * @param $uid
  * @param $type
  * @author:xjw129xjt(肖駿濤) xjt@ourstu.com
  */
 private function saveAvatar($url, $uid)
 {
     if (is_sae()) {
         // todo 兼容sae
     } else {
         mkdir('./Uploads/Avatar/' . $uid, 0777, true);
         $img = file_get_contents($url);
         $filename = './Uploads/Avatar/' . $uid . '/crop.jpg';
         file_put_contents($filename, $img);
         $data['path'] = '/' . $uid . '/crop.jpg';
     }
     $data['uid'] = $uid;
     $data['create_time'] = time();
     $data['status'] = 1;
     $data['is_temp'] = 0;
     D('avatar')->add($data);
 }
開發者ID:chenyongze,項目名稱:bighaha,代碼行數:25,代碼來源:BaseController.class.php

示例12: is_installed

 function is_installed()
 {
     if (is_sae()) {
         $s = new SaeStorage();
         return $s->fileExists('public', 'install.lock');
     } else {
         return @file_exists(BASEPATH . '../shared/settings/install.lock');
     }
 }
開發者ID:leamiko,項目名稱:DiliCMS,代碼行數:9,代碼來源:install_helper.php


注:本文中的is_sae函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。