我们正在尝试将gitflow应用到我们的工作流程中.对于修补程序,Gitflow非常简单.但是,我不清楚如何修复以前版本的系统中的错误.
例如,我们只是说我们的版本是8.1.3,我需要修改7.1.5的错误.我可以根据7.1.5标签创建一个分支,但是如何将其重新转换为master并标记它?甚至可以使用Git吗?我只想保留发布分支并在那里提交和标记,但我不确定这是否是正确的做事方式.
我真的很喜欢依赖注入的想法。我很难应用这个概念,因为我看到的大多数示例都是针对ASP.NET MVC的。
这是我得到的:WPF->服务->存储库。服务注入了存储库,而我的视图模型(至少有一个)被注入了服务。
然后在我的WPF App.xaml中,我重写了OnStartup方法。这是我创建Ninject并解决我的第一个视图的地方。
当涉及到多个视图时,我会迷路。例如,假设我将ServiceA和ServiceB注入了我的第一个视图模型(在App.xaml中)。假设我要在其他视图模型的构造函数中使用ServiceC,如何将其注入到构造函数中?
用代码来说,就像这样:
public class ViewModel1
{
private readonly IServiceA serviceA;
private readonly IServiceB serviceB;
public ViewModel1(IServiceA serviceA, IServiceB serviceB)
{
this.serviceA = serviceA;
this.serviceB = serviceB;
}
public void OpenASettingsWindow()
{
// How do I resolve this view?
var window = new View(new ViewModel2(new ServiceC()));
}
}
Run Code Online (Sandbox Code Playgroud) 我们有一个旧网站,它有自定义ACL和路由设置.我们正在慢慢地将代码库迁移到Laravel.
为了从旧站点访问页面,当前所有内容都通过调用的文件运行Modules.php,modname指定应该打开哪个页面.例如:/Modules.php?modname=hello/world显示世界页面.
我怎么能伪造laravel的路线?我想从Modules.php启动Laravel并使用modname作为路由.
所以我应该可以这样做: Route::get('/hello/world', 'MyController@hello');
现在我只是覆盖$_SERVER,但问题是获取基本URL成为一个问题.
如果有人想在将来这样做,这就是我们所做的:
$request = Request::createFromGlobals();
$request->server->set('REQUEST_URI', $_REQUEST['modname']);
$app->run($request);
Run Code Online (Sandbox Code Playgroud)
在laravel 5中,您可以通过传入$request输入内核来执行等效操作(使用public/index.php作为参考)
至于我们如何确定路线是否是laravel路线,我做了这个功能.您可以通过将json文件设置为二叉树来优化它,但我没有注意到性能问题,所以我没有打扰.
<?php
/**
* Checks if Laravel should handle the request.
*
* @param $route string The route used internally by Laravel. Ex: sss/events
* @return boolean Whether Laravel creates the response for this route
*/
function IsLaravelRoute($route)
{
// The json file is made by running `php artisan routes:dump` in Laravel
// We compile the …Run Code Online (Sandbox Code Playgroud)