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


PHP Domain::create方法代码示例

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


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

示例1: doInsert

function doInsert()
{
    if (isset($_POST['save'])) {
        //primary Details
        $DOMAINNAME = $_POST['domainname'];
        $DESCRIPTION = $_POST['description'];
        $SECTOR = $_POST['sector'];
        $domain = new Domain();
        $domain->domain_name = $DOMAINNAME;
        $domain->description = $DESCRIPTION;
        $domain->sector_id = $SECTOR;
    }
    if ($DOMAINNAME == "") {
        message('Domain name is required!', "error");
        redirect('index.php?view=add');
    } elseif ($DESCRIPTION == "") {
        message('Description is required!', "error");
        redirect('index.php?view=add');
    } elseif ($SECTOR == "") {
        message('Sector is required!', "error");
        redirect('index.php?view=add');
    } else {
        $domain->create();
        message('New domain addedd successfully!', "success");
        redirect('index.php?view=list');
    }
}
开发者ID:allybitebo,项目名称:ucb,代码行数:27,代码来源:controller.php

示例2: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     if (!$request->domain) {
         return Response::json(['error' => ['message' => 'Please provide a Domain']], 422);
     }
     $userId = $user->id;
     $domain = Domain::create(['domain' => $request->domains, 'sld' => $this->splitDomain($request->domain)[0], 'tld' => $this->splitDomain($request->domain)[1], 'orderType' => $request->ordertype, 'user_id' => $userId]);
     return Response::json(['message' => 'Domain created successfully', 'data' => $this->transform($domain)], 200);
 }
开发者ID:krorten,项目名称:test-rs-lrv,代码行数:15,代码来源:DomainController.php

示例3: action_query

 public function action_query($domain)
 {
     $domain = strtolower($domain);
     $index_alpha = Sitemap::get_filters();
     Log::write('check', 'whois: ' . $domain);
     //Cache::forget('whois.'.$domain);
     $whois = Cache::remember('whois.' . $domain, function () use($domain) {
         return new Whois\Whois($domain);
     }, 60 * 24);
     $data = $whois->get_all_data();
     if ($data === 0) {
         $valid = 0;
     } else {
         $valid = $data[0]->valid();
     }
     if (!$valid) {
         return View::make('whois.index')->with('valid', 0)->with('type', 'whois')->with('title', 'WHOIS Search')->with('index_alpha', $index_alpha);
     }
     $data = $whois->email_mask($data);
     $available = $whois->available();
     $domain = $data[sizeof($data) - 1];
     $domain = $domain->get_query_domain();
     $meta = array('title' => '', 'ip' => '');
     if ($valid && !$available) {
         if (!Domain::where('name', '=', $domain)->first()) {
             @Domain::create(array('name' => $domain));
         }
         $meta['title'] = Domain::get_domain_title($domain);
         $ip = gethostbyname($domain);
         if ($ip != $domain) {
             $meta['ip'] = $ip;
         }
     }
     $expires_on = $whois->expires_on();
     $created_on = $whois->created_on();
     $updated_on = $whois->updated_on();
     if (is_numeric(end($data)->get_body())) {
         Cache::forget('whois.' . $domain);
     }
     return View::make('whois.query', array('i' => 1, 'data' => $data, 'meta' => $meta, 'type' => 'whois', 'valid' => $valid, 'domain' => $domain, 'available' => $available, 'expires_on' => $expires_on, 'created_on' => $created_on, 'updated_on' => $updated_on, 'index_alpha' => $index_alpha, 'title' => $domain . '\'s whois info'));
 }
开发者ID:jinguanio,项目名称:whois,代码行数:41,代码来源:whois.php

示例4: addDomain

 /**
  * Add a domain to the project.
  *
  * @param string $name
  * @param array  $ssl
  *
  * @return Domain
  */
 public function addDomain($name, array $ssl = [])
 {
     $body = ['name' => $name];
     if (!empty($ssl)) {
         $body['ssl'] = $ssl;
     }
     return Domain::create($body, $this->getLink('domains'), $this->client);
 }
开发者ID:CompanyOnTheWorld,项目名称:platformsh-client-php,代码行数:16,代码来源:Project.php


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