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


PHP static::object方法代码示例

本文整理汇总了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';
 }
开发者ID:ForAEdesWeb,项目名称:AEW3,代码行数:16,代码来源:StorageTest.php

示例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;
 }
开发者ID:bileji,项目名称:async,代码行数:8,代码来源:Logger.php

示例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();
 }
开发者ID:lastzero,项目名称:riak-php-client,代码行数:13,代码来源:ObjectOperationsTest.php

示例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;
    }
开发者ID:Vrian7ipx,项目名称:cascadadev,代码行数:18,代码来源:MediaObject.php

示例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();
 }
开发者ID:ZerGabriel,项目名称:joomla-framework,代码行数:19,代码来源:MemcachedTest.php

示例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;
     }
 }
开发者ID:sunkangtaichi,项目名称:php-log,代码行数:17,代码来源:Log.php

示例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);
         }
     }
 }
开发者ID:alpineio,项目名称:atlas,代码行数:13,代码来源:PiklistAutofields.php

示例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();
 }
开发者ID:basho,项目名称:riak-php-client,代码行数:17,代码来源:SecondaryIndexOperationsTest.php

示例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();
 }
开发者ID:RetroscopeCreative,项目名称:RouterunnerCMS,代码行数:14,代码来源:Tunnel.php

示例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();
 }
开发者ID:basho,项目名称:riak-php-client,代码行数:20,代码来源:ObjectOperationsTest.php

示例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();
 }
开发者ID:lzpfmh,项目名称:dotplant2,代码行数:22,代码来源:CategoryMovementsAction.php

示例12: init

 public static function init($object)
 {
     static::$object = $object;
 }
开发者ID:bileji,项目名称:async,代码行数:4,代码来源:Config.php

示例13: setObject

 /**
  * Setando o objeto 
  * 
  * @access public 
  * @param object $object 
  * @return void 
  */
 public static function setObject($object)
 {
     static::$object = $object;
 }
开发者ID:escapework,项目名称:cache,代码行数:11,代码来源:Cache.php

示例14: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     static::$object = new \stdClass();
     static::$object->str = 'coincoin';
 }
开发者ID:pigroupe,项目名称:SfynxSpecificationBundle,代码行数:5,代码来源:RulerTest.php


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