当前位置: 首页>>代码示例>>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;未经允许,请勿转载。