本文整理汇总了PHP中static::object方法的典型用法代码示例。如果您正苦于以下问题:PHP static::object方法的具体用法?PHP static::object怎么用?PHP static::object使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类static
的用法示例。
在下文中一共展示了static::object方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
/**
* Sets up the fixture.
*
* This method is called before a test is executed.
*
* @return void
*
* @since 1.0
*/
protected function setUp()
{
// Dummy object for testing
static::$object = $this;
parent::setUp();
static::$className = '\\Joomla\\Session\\Storage';
}
示例2: init
public static function init($channel, $filename)
{
$logger = new MongoLog($channel);
$stream = new RotatingFileHandler($filename, 0, MongoLog::DEBUG);
$stream->setFormatter(new LineFormatter("%datetime% [%channel%] %level_name% %message% %context%\n", "Y-m-d H:i:s"));
$logger->pushHandler($stream);
static::$object = $logger;
}
示例3: testFetchOk
/**
* @depends testStoreNewWithKey
*/
public function testFetchOk()
{
$command = (new Command\Builder\FetchObject(static::$riak))->buildLocation(static::$key, 'users')->build();
$response = $command->execute();
$this->assertEquals('200', $response->getCode());
$this->assertInstanceOf('Basho\\Riak\\Object', $response->getObject());
$this->assertEquals('some_data', $response->getObject()->getData());
$this->assertNotEmpty($response->getObject()->getVclock());
static::$object = $response->getObject();
}
示例4: create
/**
* Statically creates a new MediaObject instance
*
* @param string $content Its content
* @param string $media Its media
* @param array $attributes The media object's attributes
* @return MediaObject
*/
public static function create($content, $media = null, $attributes = array())
{
static::$object = new static($content);
if ($media) {
static::$object->with_image($media);
}
if ($attributes) static::$object->attributes = $attributes;
return static::$object;
}
示例5: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*
* @since 1.0
*/
protected function setUp()
{
if (!class_exists('Memcached')) {
$this->markTestSkipped('The Memcached class does not exist.');
return;
}
// Create the caching object
static::$object = Storage::getInstance('Memcached');
// Parent contains the rest of the setup
parent::setUp();
}
示例6: open
/**
* 启用日志
*
* @param array $arr
* @return void
*/
static function open($arr = null)
{
if (!isset(static::$object)) {
static::init();
static::$object = true;
}
static::$open = true;
if ($arr) {
static::$enable = $arr;
}
}
示例7: generate
public static function generate(Reflectable $object)
{
static::$object = $object;
static::$reflection = $object::getReflection();
$factory = DocBlockFactory::createInstance();
$docblock = $factory->create(static::$reflection->getDocComment());
if ($docblock->hasTag('property')) {
$properties = $docblock->getTagsByName('property');
foreach ($properties as $property) {
static::renderField($property);
}
}
}
示例8: testFetchObjectWithIndexes
/**
* @depends testStoreObjectWithIndexes
*/
public function testFetchObjectWithIndexes()
{
$command = (new Command\Builder\FetchObject(static::$riak))->buildLocation(static::$key, 'Users', static::LEVELDB_BUCKET_TYPE)->build();
$response = $command->execute();
$this->assertEquals('200', $response->getCode());
$this->assertInstanceOf('Basho\\Riak\\Object', $response->getObject());
$this->assertEquals('person', $response->getObject()->getData());
$this->assertNotEmpty($response->getObject()->getVClock());
$indexes = $response->getObject()->getIndexes();
$this->assertEquals($indexes['lucky_numbers_int'], [42, 64]);
$this->assertEquals($indexes['lastname_bin'], ['Knuth']);
static::$object = $response->getObject();
static::$vclock = $response->getObject()->getVClock();
}
示例9: reset
public static function reset()
{
static::$object = null;
$clname = function_exists('get_called_class') ? get_called_class() : static::$class;
$class = new ReflectionClass($clname);
$arr = array_keys($class->getStaticProperties());
unset($arr[array_search('class', $arr)], $arr[array_search('stack', $arr)], $arr[array_search('object', $arr)], $arr[array_search('container', $arr)], $arr[array_search('variables', $arr)]);
static::$variables = $arr;
unset($arr[array_search('stack', $arr)]);
foreach ($arr as $var) {
static::${$var} = null;
}
static::$container = array();
}
示例10: testFetchOk
/**
* @depends testStoreNewWithKey
*/
public function testFetchOk()
{
$command = (new Command\Builder\FetchObject(static::$riak))->buildLocation(static::$key, 'users')->build();
$response = $command->execute();
$this->assertEquals('200', $response->getCode());
$this->assertInstanceOf('Basho\\Riak\\Object', $response->getObject());
$this->assertEquals('some_data', $response->getObject()->getData());
$this->assertNotEmpty($response->getObject()->getVclock());
// confirm we are using the HTTP api bridge
if (static::$riak->getApi() instanceof \Basho\Riak\Api\Http) {
$headers = static::$riak->getApi()->getResponseHeaders();
$this->assertNotEmpty($headers);
$this->assertNotEmpty($headers["Last-Modified"]);
$this->assertNotEmpty(new \DateTime($headers["Last-Modified"]));
}
static::$object = $response->getObject();
}
示例11: init
/**
* @throws NotFoundHttpException
* @throws ServerErrorHttpException
*/
public function init()
{
if (false === Yii::$app->request->isAjax) {
throw new NotFoundHttpException('Page not found');
}
$catId = Yii::$app->request->post('cat-id');
if (null !== Category::findOne(['id' => $catId])) {
$this->categoryId = $catId;
} else {
throw new ServerErrorHttpException("Can't find Category with id {$catId}");
}
if (true === empty(static::$object)) {
static::$object = Object::getForClass(Product::className());
}
$this->action = Yii::$app->request->post('action', '');
$this->items = Yii::$app->request->post('mc-items', []);
parent::init();
}
示例12: init
public static function init($object)
{
static::$object = $object;
}
示例13: setObject
/**
* Setando o objeto
*
* @access public
* @param object $object
* @return void
*/
public static function setObject($object)
{
static::$object = $object;
}
示例14: setUpBeforeClass
public static function setUpBeforeClass()
{
static::$object = new \stdClass();
static::$object->str = 'coincoin';
}