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


PHP resolve函数代码示例

本文整理汇总了PHP中resolve函数的典型用法代码示例。如果您正苦于以下问题:PHP resolve函数的具体用法?PHP resolve怎么用?PHP resolve使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: main

 /**
  * The entry method.
  *
  * @return  void
  */
 public function main()
 {
     $run = 'hoa://Data/Variable/Run';
     while (false !== ($c = $this->getOption($v))) {
         switch ($c) {
             case 'r':
                 $run = $v;
                 break;
             case 'h':
             case '?':
                 return $this->usage();
             case '__ambiguous':
                 $this->resolveOptionAmbiguity($v);
                 break;
         }
     }
     $this->parser->listInputs($workerId);
     if (null === $workerId) {
         return $this->usage();
     }
     $run = resolve($run);
     $protocol = Protocol::getInstance();
     $protocol['Data']['Variable']['Run']->setReach("\r" . $run . DS);
     $password = $this->readPassword('Password: ');
     $sw = new Worker\Backend\Shared($workerId, $password);
     $sw->stop();
     return;
 }
开发者ID:haskel,项目名称:Worker,代码行数:33,代码来源:Stop.php

示例2: getResolved

 protected function getResolved()
 {
     $router = $this->router->get();
     $data = $this->router->get('data');
     if (isset($router['resolvers'])) {
         foreach ($router['resolvers'] as $urlKey => $resolver) {
             $resolved = resolve($resolver)->resolve($router[$urlKey] ?? $this->router->getCleanUri());
             if (is_string($urlKey)) {
                 $data[$urlKey] = $resolved;
             }
             $data[] = $resolved;
             if (!is_int($urlKey)) {
                 $this->router->resolve($urlKey, $resolved);
                 /**
                  * Remove resolved key.
                  * Why? Can we delete it?
                  */
                 if (isset($data[$urlKey])) {
                     //unset($data[$urlKey]);
                 }
             }
         }
     }
     return $data;
 }
开发者ID:pckg,项目名称:framework,代码行数:25,代码来源:LoadView.php

示例3: execute

 /**
  * @throws Exception
  */
 public function execute(callable $next)
 {
     /**
      * Skip database initialization if connections are not defined.
      */
     if (!$this->config->get('database')) {
         return $next();
     }
     $configs = $this->config->get('database');
     foreach ($configs as $name => $config) {
         if (isset($config['lazy'])) {
             continue;
         }
         $repository = null;
         if ($config['driver'] == 'faker') {
             $repository = new RepositoryFaker(Factory::create());
         } elseif ($config['driver'] == 'middleware') {
             $repository = resolve($config['middleware'])->execute(function () {
             });
         } else {
             $repository = $this->initPdoDatabase($config, $name);
         }
         if ($repository) {
             $this->context->bindIfNot(Repository::class, $repository);
             $this->context->bind(Repository::class . '.' . $name, $repository);
         }
     }
     return $next();
 }
开发者ID:pckg,项目名称:database,代码行数:32,代码来源:InitDatabase.php

示例4: resolve

 private function resolve($value = null)
 {
     if (null !== $this->result) {
         return;
     }
     $this->settle(resolve($value));
 }
开发者ID:bangordailynews,项目名称:bdnindex,代码行数:7,代码来源:Promise.php

示例5: resolve

function resolve($op, &$z)
{
    $ops = explode(' ', $op);
    if (count($ops) === 1) {
        if (isset($z[$ops[0]]) && !is_numeric($ops[0])) {
            return $z[$ops[0]] = (int) resolve($z[$ops[0]], $z);
        }
        return $z[$ops[0]] = (int) $ops[0];
    }
    if (count($ops) === 2) {
        return $z[$ops[1]] = ~(int) resolve($ops[1], $z);
    }
    $a = resolve($ops[0], $z);
    $b = resolve($ops[2], $z);
    switch ($ops[1]) {
        case 'AND':
            $r = $a & $b;
            break;
        case 'OR':
            $r = $a | $b;
            break;
        case 'LSHIFT':
            $r = $a << $b;
            break;
        case 'RSHIFT':
            $r = $a >> $b;
            break;
        default:
            throw new Exception('Unknown op: ' . $ops[1]);
    }
    return (int) $r;
}
开发者ID:jamosaur,项目名称:advent,代码行数:32,代码来源:day7.php

示例6: always

 public function always(callable $onFulfilledOrRejected)
 {
     return $this->then(function ($value) use($onFulfilledOrRejected) {
         return resolve($onFulfilledOrRejected())->then(function () use($value) {
             return $value;
         });
     });
 }
开发者ID:hazaveh,项目名称:mySQLtoes,代码行数:8,代码来源:FulfilledPromise.php

示例7: shouldPreserveTheOrderOfArrayWhenResolvingAsyncPromises

 /** @test */
 public function shouldPreserveTheOrderOfArrayWhenResolvingAsyncPromises()
 {
     $mock = $this->createCallableMock();
     $mock->expects($this->once())->method('__invoke')->with($this->identicalTo([1, 2, 3]));
     $deferred = new Deferred();
     all([resolve(1), $deferred->promise(), resolve(3)])->then($mock);
     $deferred->resolve(2);
 }
开发者ID:reactphp,项目名称:promise,代码行数:9,代码来源:FunctionAllTest.php

示例8: always

 public function always(callable $onFulfilledOrRejected)
 {
     return $this->then(null, function ($reason) use($onFulfilledOrRejected) {
         return resolve($onFulfilledOrRejected())->then(function () use($reason) {
             return new RejectedPromise($reason);
         });
     });
 }
开发者ID:lewishealey,项目名称:confetti,代码行数:8,代码来源:RejectedPromise.php

示例9: test_update_configuration_replaces_user_and_group_in_config_file

 public function test_update_configuration_replaces_user_and_group_in_config_file()
 {
     copy(__DIR__ . '/files/fpm.conf', __DIR__ . '/output/fpm.conf');
     resolve(StubForUpdatingFpmConfigFiles::class)->updateConfiguration();
     $contents = file_get_contents(__DIR__ . '/output/fpm.conf');
     $this->assertTrue(strpos($contents, 'user = ' . user()) !== false);
     $this->assertTrue(strpos($contents, 'listen.owner = ' . user()) !== false);
 }
开发者ID:jmarcher,项目名称:valet-linux,代码行数:8,代码来源:PhpFpmTest.php

示例10: test_update_domain_removes_old_resolver_and_reinstalls

 public function test_update_domain_removes_old_resolver_and_reinstalls()
 {
     $cli = Mockery::mock(CommandLine::class);
     $cli->shouldReceive('quietly')->with('rm /etc/resolver/old');
     $dnsMasq = Mockery::mock(DnsMasq::class . '[install]', [resolve(Brew::class), $cli, new Filesystem()]);
     $dnsMasq->shouldReceive('install')->with('new');
     $dnsMasq->updateDomain('old', 'new');
 }
开发者ID:larawhale,项目名称:valet4win,代码行数:8,代码来源:DnsMasqTest.php

示例11: always

 public function always(callable $onFulfilledOrRejected) : ExtendedPromiseInterface
 {
     return $this->then(function ($value) use($onFulfilledOrRejected) {
         return resolve($onFulfilledOrRejected())->then(function () use($value) {
             return $value;
         });
     });
 }
开发者ID:ThrusterIO,项目名称:promise,代码行数:8,代码来源:FulfilledPromise.php

示例12: case_splFileClassInfo

 public function case_splFileClassInfo()
 {
     $this->given($splFileInfo = 'Hoa\\Iterator\\SplFileInfo', $root = resolve('hoa://Test/Vfs/Root?type=directory'), resolve('hoa://Test/Vfs/Root/a?type=file'), resolve('hoa://Test/Vfs/Root/b?type=file'), resolve('hoa://Test/Vfs/Root/c?type=file'), resolve('hoa://Test/Vfs/Root/d?type=file'), resolve('hoa://Test/Vfs/Root/e?type=file'), resolve('hoa://Test/Vfs/Root/f?type=file'), $iterator = new LUT\FileSystem($root, LUT\FileSystem::CURRENT_AS_FILEINFO, $splFileInfo), $result = [])->when(function () use($iterator, $splFileInfo, &$result) {
         foreach ($iterator as $file) {
             $this->object($file)->isInstanceOf($splFileInfo);
             $result[] = $file->getFilename();
         }
     })->then->array($result)->isEqualTo(['a', 'b', 'c', 'd', 'e', 'f']);
 }
开发者ID:samrahman,项目名称:providence,代码行数:9,代码来源:FileSystem.php

示例13: test_drivers_directory_is_created_with_sample_driver_if_it_doesnt_exist

 public function test_drivers_directory_is_created_with_sample_driver_if_it_doesnt_exist()
 {
     $files = Mockery::mock(Filesystem::class . '[isDir,mkdirAsUser,putAsUser]');
     $files->shouldReceive('isDir')->with(VALET_HOME_PATH . '/Drivers')->andReturn(false);
     $files->shouldReceive('mkdirAsUser')->with(VALET_HOME_PATH . '/Drivers');
     $files->shouldReceive('putAsUser');
     swap(Filesystem::class, $files);
     resolve(Configuration::class)->createDriversDirectory();
 }
开发者ID:jmarcher,项目名称:valet-linux,代码行数:9,代码来源:ConfigurationTest.php

示例14: getSerializerInstance

 private function getSerializerInstance($something)
 {
     if (!$something) {
         return new JsonSerializer();
     }
     $serializer = is_string($something) ? resolve($something) : $something;
     if ($serializer instanceof SerializerAbstract) {
         return $serializer;
     }
 }
开发者ID:pmall,项目名称:formatter,代码行数:10,代码来源:Formatter.php

示例15: then

 public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
 {
     if (null === $this->promise) {
         try {
             $this->promise = resolve(call_user_func($this->factory));
         } catch (\Exception $exception) {
             $this->promise = new RejectedPromise($exception);
         }
     }
     return $this->promise->then($onFulfilled, $onRejected, $onProgress);
 }
开发者ID:jreinert,项目名称:RuneUI,代码行数:11,代码来源:LazyPromise.php


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