本文整理汇总了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;
}
示例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];
}
示例3: init
public function init()
{
if (!$this->engine instanceof StorageContract) {
$this->engine = make($this->engine);
}
$this->engine->timeout($this->expires);
}
示例4: init
public function init()
{
$this->monolog = new MonoLogger($this->name);
foreach ($this->targets as &$target) {
$target = make($target);
$this->monolog->pushHandler($target);
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
示例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);
}
}
示例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();
}
示例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;
}
示例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());
}
示例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;
}
示例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);
}
}
}
}