我正在开发Laravel 5.0中的一个网站,并在Windows Server2012中托管.
我遇到了一个问题,即我从另一个函数A调用控制器中的函数B,我希望调用另一个函数B的函数A不等待函数B的完成.并且功能B在后台完成并独立形成用户终止页面和功能A返回.
我搜索了这个,发现这可以通过cron中的作业来实现,如windows中的作业,pcntl_fork()和laravel中的队列功能.我是初学者.
请帮忙!提前致谢.
目前,我正在laravel5上做一个项目.
我使用socialize进行Facebook身份验证,但我得到了cURL错误,如下所述.
RequestException in CurlFactory.php line 162:
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
Run Code Online (Sandbox Code Playgroud)
我在互联网上搜索并完成了以下更改,但没有帮助
我在控制器中的代码
public function fb()
{
return Socialize::with('facebook')->redirect();
}
public function cb() //callback for facebook
{
$user = Socialize::with('facebook')->user();
var_dump($user);
}
Run Code Online (Sandbox Code Playgroud) 我是PHP开发的新手.
今天我偶然发现了有趣的主题URL碎片,特别是URL的"#"部分.
我搜索了它说它就像www.example.com\foo.html#bar.
但我不明白为什么需要这个"#bar".以及如何通过PHP阅读它?
这是用于查找二叉树最大深度的伪代码:
maxDepth(Node N)
1. If Nodes is leaf node then return 0
2. Else
(a) Get the max depth of left subtree recursively i.e.,
call maxDepth( N->left-subtree)
(a) Get the max depth of right subtree recursively i.e.,
call maxDepth( N->right-subtree)
(c) Get the max of max depths of left and right
subtrees and add 1 to it for the current node.
max_depth = max(max dept of left subtree,
max depth of right subtree)
+ 1
(d) Return max_depth
Run Code Online (Sandbox Code Playgroud)
我对这个算法的最坏情况感到困惑.这个伪代码的复杂性将是O(n).这个算法的最坏情况是什么?为什么?