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


PHP make函数代码示例

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


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

示例1: get

 public static function get($class = null)
 {
     if ($class) {
         return make($class);
     }
     return $this->class ? make($this->class) : null;
 }
开发者ID:ZhangHarvey,项目名称:hzf,代码行数:7,代码来源:Instance.php

示例2: getAction

 public function getAction() : callable
 {
     if ($this->resolvedAction !== null) {
         return $this->resolvedAction;
     }
     if (!$this->routeAction instanceof ControllerCallback) {
         return $this->resolvedAction = $this->routeAction;
     }
     /** @var ControllerCallback $callback */
     $callback = $this->routeAction;
     $router = app()->getHttpRouter();
     $values = $router->bind($router->extract($router->getContext(), $this), $this->getBindings());
     $method = $callback->getMethod();
     $class = $callback->getClass();
     if ($class[0] === '@') {
         $class = substr($class, 1);
         if (!isset($values[$class])) {
             throw new \RuntimeException("Unknown controller variable '{$class}'");
         }
         $class = $values[$class]->value();
     }
     if ($method[0] === '@') {
         $method = substr($method, 1);
         if (!isset($values[$method])) {
             throw new \RuntimeException("Unknown controller variable '{$method}'");
         }
         $method = $values[$method]->value();
     }
     if (!$callback->isStatic()) {
         $class = make($class);
     }
     return $this->resolvedAction = [$class, $method];
 }
开发者ID:opis,项目名称:colibri,代码行数:33,代码来源:HttpRoute.php

示例3: init

 public function init()
 {
     if (!$this->engine instanceof StorageContract) {
         $this->engine = make($this->engine);
     }
     $this->engine->timeout($this->expires);
 }
开发者ID:hanfengyang,项目名称:framework,代码行数:7,代码来源:Manager.php

示例4: init

 public function init()
 {
     $this->monolog = new MonoLogger($this->name);
     foreach ($this->targets as &$target) {
         $target = make($target);
         $this->monolog->pushHandler($target);
     }
 }
开发者ID:hanfengyang,项目名称:framework,代码行数:8,代码来源:Logger.php

示例5: init

function init()
{
    $arg = array_slice($_SERVER['argv'], 1);
    $arg = $arg ? $arg[0] : '';
    if (in_array($arg, array('?', 'help'))) {
        exit("make.php\n");
    }
    make();
}
开发者ID:jkrecek,项目名称:coffeescript-php,代码行数:9,代码来源:make.php

示例6: handleStart

 protected function handleStart()
 {
     $pidFile = $this->blink->root . '/runtime/server.pid';
     if (file_exists($pidFile)) {
         throw new InvalidValueException('The pidfile exists, it seems the server is already started');
     }
     $server = (require $this->blink->root . '/src/config/server.php');
     $server['asDaemon'] = 1;
     $server['pidFile'] = $this->blink->root . '/runtime/server.pid';
     return make($server)->run();
 }
开发者ID:renyinew,项目名称:blink,代码行数:11,代码来源:ServerCommand.php

示例7: handleStart

 /**
  *   monitorserver start 命令
  * 
  * @return mixed
  * @throws \Kerisy\Core\InvalidConfigException
  */
 protected function handleStart()
 {
     $pidFile = APPLICATION_PATH . '/runtime/monitorserver.pid';
     if (file_exists($pidFile)) {
         throw new InvalidValueException('The pidfile exists, it seems the server is already started');
     }
     $server = config('monitorservice')->all();
     $server['asDaemon'] = 1;
     $server['pidFile'] = APPLICATION_PATH . '/runtime/monitorserver.pid';
     return make($server)->run();
 }
开发者ID:kerisy,项目名称:framework,代码行数:17,代码来源:MonitorServerCommand.php

示例8: handleStart

 protected function handleStart()
 {
     $server = $this->getServerDefinition();
     $pidFile = !empty($server['pidFile']) ? $server['pidFile'] : $this->blink->runtime . '/server.pid';
     if (file_exists($pidFile)) {
         throw new InvalidValueException('The pidfile exists, it seems the server is already started');
     }
     $server['asDaemon'] = 1;
     $server['pidFile'] = $pidFile;
     return make($server)->run();
 }
开发者ID:bixuehujin,项目名称:blink,代码行数:11,代码来源:ServerCommand.php

示例9: calling

 public function calling()
 {
     if ($this->params['supplier'] == 33) {
         $res = $this->sql->table_exist('v8_sorted');
         if (!$res) {
             make($this->sql);
         }
         return $this->sql->getByPage('v8_sorted', $this->params['start'], $this->params['limit'], ' 1 ORDER BY brand ASC, model ASC ');
     }
     return false;
 }
开发者ID:herrlosxxx,项目名称:test_parser,代码行数:11,代码来源:core.php

示例10: init

 public function init()
 {
     foreach ($this->loaders as $format => $loader) {
         $loader = make($loader);
         $this->addLoader($format, $loader);
     }
     foreach ($this->resources as $resource) {
         if (!isset($resource['format'], $resource['resource'], $resource['locale'])) {
             throw new InvalidParamException('The resource item requires format, resource and locale keys.');
         }
         $this->addResource($resource['format'], $resource['resource'], $resource['locale'], isset($resource['domain']) ? $resource['domain'] : null);
     }
 }
开发者ID:bixuehujin,项目名称:blink-i18n,代码行数:13,代码来源:Translator.php

示例11: handleStart

 protected function handleStart()
 {
     $pidFile = APPLICATION_PATH . 'runtime/server.pid';
     if (file_exists($pidFile)) {
         throw new InvalidValueException('The pidfile exists, it seems the server is already started');
     }
     $server = config('service')->all();
     $server['asDaemon'] = 1;
     $server['pidFile'] = APPLICATION_PATH . 'runtime/server.pid';
     $serv = make($server);
     isset($this->getAliases()['alias_name']) && $serv->setAliasName($this->getAliases()['alias_name']);
     return $serv->run();
 }
开发者ID:kerisy,项目名称:framework,代码行数:13,代码来源:ServerCommand.php

示例12: get

 /**
  * @param string $name
  * @return bool|ValidatorInterface
  */
 public function get(string $name)
 {
     if (!isset($this->validators[$name])) {
         if (isset($this->classes[$name])) {
             $validator = make($this->classes[$name]);
             if (!$validator instanceof ValidatorInterface) {
                 return false;
             }
             return $this->validators[$name] = $validator;
         }
     }
     return isset($this->validators[$name]) ? $this->validators[$name] : false;
 }
开发者ID:opis,项目名称:colibri,代码行数:17,代码来源:ValidatorCollection.php

示例13: run

 public function run()
 {
     $app = $this->startApp();
     $runner = new \blink\core\console\Application(['name' => 'Blink Command Runner', 'version' => Application::VERSION, 'blink' => $app]);
     foreach ($app->consoleCommands() as $command) {
         if (is_string($command)) {
             $command = ['class' => $command];
         }
         $command['blink'] = $app;
         $runner->add(make($command));
     }
     return $runner->run(new ArgvInput(), new ConsoleOutput());
 }
开发者ID:bixuehujin,项目名称:blink,代码行数:13,代码来源:CliServer.php

示例14: callMiddleware

 /**
  * Call the middleware stack.
  *
  * @throws InvalidConfigException
  */
 public function callMiddleware()
 {
     if ($this->_middlewareCalled) {
         return;
     }
     foreach ($this->middleware as $definition) {
         $middleware = make($definition);
         if (!$middleware instanceof MiddlewareContract) {
             throw new InvalidConfigException(sprintf("'%s' is not a valid middleware", get_class($middleware)));
         }
         if ($middleware->handle($this) === false) {
             break;
         }
     }
     $this->_middlewareCalled = true;
 }
开发者ID:hanfengyang,项目名称:framework,代码行数:21,代码来源:MiddlewareTrait.php

示例15: run

/**
 * make (All component)
 */
function run()
{
    global $do_chown, $builds_dir, $tests_path, $user, $jobs_dir, $jobs_tmp_dir;
    foreach (new DirectoryIterator($tests_path) as $d) {
        $name = null;
        $component = null;
        $tests = null;
        $replace_phpunitxml = false;
        if ($d->isDot() || $d->isDir() && in_array($d, array('AllTests', '_files'))) {
            continue;
        }
        if ($d->isFile() && in_array($d->getFileName(), array('DebugTest.php', 'RegistryTest.php', 'VersionTest.php'))) {
            $component = substr($d->getFilename(), 0, -8);
            $tests = "../../tests/Zend/" . $d->getFileName();
            make($component, $tests, $user, $do_chown, true, $component . '.php');
            make_job($component, $builds_dir, $jobs_tmp_dir, $user, $do_chown);
        } else {
            if ($d->getFilename() == 'Service') {
                foreach (new DirectoryIterator($d->getRealpath()) as $s) {
                    if ($s->isDot()) {
                        continue;
                    }
                    $component = "Service" . $s->getFilename();
                    $tests = "../../tests/Zend/Service/" . $s->getFilename();
                    make($component, $tests, $user, $do_chown, false, "Service/" . $s->getFilename());
                    make_job($component, $builds_dir, $jobs_tmp_dir, $user, $do_chown);
                }
            } else {
                $component = $d->getFilename();
                $tests = "../../tests/Zend/" . $d->getFileName();
                make($component, $tests, $user, $do_chown, false, $d->getFilename());
                make_job($component, $builds_dir, $jobs_tmp_dir, $user, $do_chown);
            }
        }
    }
}
开发者ID:eltonoliveira,项目名称:zf2-jenkins-builds,代码行数:39,代码来源:zf2-jenkins-builds.php


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