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


PHP AmazonS3::disable_ssl_verification方法代码示例

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


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

示例1: setLatinaPresenterDataFile

 public function setLatinaPresenterDataFile($var_name = "presente_data", $market_id = 1)
 {
     try {
         $db = $this->Presenter->getDataSource();
         $query = $db->fetchAll("SELECT\n\t\t\t\t\t\tp.id as presenter_id\n\t\t\t\t\t\t, p.presenter_sequence_id as presenter_sequence_id\n\t\t\t\t\t\t, geo.lat as lat\n\t\t\t\t\t\t, geo.lng as lng\n\t\t\t\t\t\t, MAX(pt.presentertypes_id) as presntertype_id\n\t\t\t\t\t\t, s.abbrev as state\n\t\t\t\t\t\t, a.city as city\n\t\t\t\t\t\tFROM presenters p\n\t\t\t\t\t\tLEFT JOIN users u on u.id=p.user_id\n\t\t\t\t\t\tLEFT JOIN addresses a on a.user_id=u.id AND a.address_type_id = 1\n\t\t\t\t\t\tLEFT JOIN address_geocodes geo on geo.address_id=a.id\n\t\t\t\t\t\tLEFT JOIN states s on s.id = a.state_id\n\t\t\t\t\t\tLEFT JOIN presenter_types as pt on pt.presenter_id = p.id\n\t\t\t\t\t\tWHERE p.presenter_status_id = " . PresenterStatus::COMPLETE . "\n\t\t\t\t\t\t\tAND p.market_id = {$market_id}\n\t\t\t\t\t\t\t AND p.default_locale = 'es_US'\n\t\t\t\t\t\tGROUP BY p.id\n\t\t\t\t\t\tORDER BY a.id DESC, geo.id DESC");
         foreach ($query as $value) {
             $results[] = array('presenter_id' => $value['p']['presenter_id'], 'lat' => $value['geo']['lat'], 'lng' => $value['geo']['lng'], 'presentertype_id' => $value['0']['presntertype_id'], 'city' => $value['a']['city'], 'state' => $value['s']['state']);
         }
     } catch (Exception $e) {
         $this->out("Error getting list of Presenters.");
     }
     //create the file
     $string = 'var ' . $var_name . ' = {"code":200,"result":';
     $string .= json_encode($results);
     $string .= "};";
     if (YOUNIQUE_TESTSERVER === true) {
         $filename = "test_latina_presenter_data_{$market_id}";
     } else {
         $filename = "latina_presenter_data_{$market_id}";
     }
     try {
         $s3 = new AmazonS3(array("key" => "AKIAJVCBLQ3VQQS3DJHA", "secret" => "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"));
         $s3->disable_ssl_verification();
         $bucket = "younique-map-data";
         if ($s3->if_bucket_exists($bucket)) {
             $result = $s3->create_object($bucket, $filename, array('body' => $string, 'contentType' => 'text/plain', 'length' => strlen($string), 'acl' => AmazonS3::ACL_PUBLIC));
             if ($result->isOK()) {
                 $this->out("Presenter map updated for market " . $market_id);
             } else {
                 $this->out("AS3 error:" . var_export($result->body->Message, true));
             }
         } else {
             $this->out("AS3 error:" . "No bucket");
         }
     } catch (Exception $e) {
         $this->out("AS3 error:" . var_export($e->getMessage(), true));
     }
 }
开发者ID:kameshwariv,项目名称:testexample,代码行数:38,代码来源:PresenterDataShell.php

示例2: mgm_get_s3file_info

/**
 * get s3 file info
 */
function mgm_get_s3file_info($fileurl)
{
    // system
    $system_obj = mgm_get_class('system');
    // set keys
    $aws_key = $system_obj->get_setting('aws_key');
    $aws_secret_key = $system_obj->get_setting('aws_secret_key');
    // Include the SDK
    require_once MGM_LIBRARY_DIR . 'third_party/awssdk/sdk.class.php';
    // s3 object
    $s3 = new AmazonS3($aws_key, $aws_secret_key);
    // disable ssl verification if no ssl
    if (!extension_loaded('openssl')) {
        $s3->disable_ssl_verification();
    }
    // get urlpath
    $urlpath = parse_url($fileurl, PHP_URL_PATH);
    // get parts
    $url_parts = explode('/', $urlpath);
    // get bucket from url
    do {
        $bucket = array_shift($url_parts);
    } while (empty($bucket));
    // filename, including path
    $filename = implode('/', $url_parts);
    // object
    $s3_info = new stdClass();
    // set vars
    $s3_info->s3 = $s3;
    $s3_info->bucket = $bucket;
    $s3_info->filename = $filename;
    // return
    return $s3_info;
}
开发者ID:jervy-ez,项目名称:magic-members-test,代码行数:37,代码来源:mgm_misc_functions.php


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