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


PHP Source::create方法代碼示例

本文整理匯總了PHP中Source::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP Source::create方法的具體用法?PHP Source::create怎麽用?PHP Source::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Source的用法示例。


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

示例1: testSave

 public function testSave()
 {
     Stripe::setApiKey('sk_test_JieJALRz7rPz7boV17oMma7a');
     $s = Source::create(array('type' => 'bitcoin', 'currency' => 'usd', 'amount' => '100', 'owner[email]' => 'gdb@stripe.com'));
     $this->assertSame('bitcoin', $s->type);
     $source = Source::retrieve($s->id);
     $this->assertSame(100, $source->amount);
 }
開發者ID:freeformpdx,項目名稱:kffp-website,代碼行數:8,代碼來源:SourceTest.php

示例2: processFile

	public static function processFile($path, $name){
		$repository = Repository::create(uniqid() . "/$name");
		
		if(Source::analyzable($path)){
			$source = Source::create($path, "upload");
			$repository->add($source->id);
		}
		
		$repository->save();
		
		return $repository->id;
	}
開發者ID:nickyleach,項目名稱:OSS-Match,代碼行數:12,代碼來源:Upload.php

示例3: makeSourceFromAddress

 public function makeSourceFromAddress($xmlurl, &$resultString)
 {
     $this->init($xmlurl);
     $source = null;
     if ($this->sp->data) {
         $source = Source::create(strip_tags($this->sp->get_title()), $this->sp->get_link(), strip_tags($this->sp->get_description()), $xmlurl);
     } else {
         if ($this->sp->error()) {
             $resultString = $this->sp->error() . " on " . $xmlurl;
         } else {
             $resultString = 'Error fetching or parsing ' . $xmlurl;
         }
     }
     $this->cleanUp();
     return $source;
 }
開發者ID:mm999,項目名稱:zebrafeeds,代碼行數:16,代碼來源:sourceproxy.php

示例4: testCreate

 public function testCreate()
 {
     $this->mockRequest('POST', '/v1/sources', array('type' => 'bitcoin', 'amount' => 1000, 'currency' => 'usd', 'owner' => array('email' => 'jenny.rosen@example.com')), array('id' => 'src_foo', 'object' => 'source'));
     $source = Source::create(array('type' => 'bitcoin', 'amount' => 1000, 'currency' => 'usd', 'owner' => array('email' => 'jenny.rosen@example.com')));
     $this->assertSame($source->id, 'src_foo');
 }
開發者ID:stripe,項目名稱:stripe-php,代碼行數:6,代碼來源:SourceTest.php

示例5: Subscription

        \t<input name="tags" type="text" id="tags" size="10" value=""/>
        </div
\t</div>
\t<br />
\t<div id="saveconfig">
        <input name="subscribe" type="submit" id="subscribe" value="Subscribe"/>
\t</div>
</div>
</form>
EOD;
if (isset($_POST['subscribe']) && $_POST['subscribe'] == 'Subscribe') {
    echo '<div id="core">';
    /* Case 1: complete the subscription */
    $storage = SubscriptionStorage::getInstance();
    $sub = new Subscription();
    $source = Source::create(stripslashes($_POST['chantitle']), stripslashes($_POST['htmlurl']), stripslashes($_POST['chandesc']), $_POST['feedurl']);
    $sub->source = $source;
    $sub->shownItems = $_POST['shownnews'];
    $sub->isActive = $_POST['isactive'] == 'yes';
    $sub->tags = explode(',', $_POST['tags']);
    // TODO error handling
    $storage->storeSubscription($sub);
    displayStatus('Subscription complete');
    echo '</div>';
} elseif (isset($siteurl) && $siteurl != '') {
    /* Case 2: parse web page given in the form
                  display a form for each feed
       */
    echo '<div id="core">';
    @($fp = fopen($siteurl, "r"));
    $sitehtmldata = "";
開發者ID:mm999,項目名稱:zebrafeeds,代碼行數:31,代碼來源:addnewfeed.php


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