當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。