我开发了一个供内部使用的作曲家软件包。
在主项目 composer.json 中,我设置为
"repositories":[
{
"type": "vcs",
"url": "git@bitbucket.org:company_dev/package_name_dev.git"
}
],
"require": {
"company/package": "dev-master"
},
由于公司程序的影响,开发人员所做的一切工作都将在 dev 帐户中,然后合并到生产回购中,然后再部署到服务器。
是否可以将company_dev/package_name_dev.git
映射到company/package
?
因为我定义了软件包 composer.json
"name": "company/package",
运行composer install
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Nothing to install or update
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: barryvdh/laravel-debugbar
Discovered Package: barryvdh/laravel-ide-helper
Discovered Package: cybercog/laravel-optimus
Discovered Package: facade/ignition
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Discovered Package: propaganistas/laravel-phone
Discovered Package: rtconner/laravel-tagging
Discovered Package: stechstudio/laravel-php-cs-fixer
Package manifest generated successfully.
什么都没有改变。我没有看到任何错误,也没有太多信息。
答案 0 :(得分:0)
删除锁定文件,然后重新运行componentDidMount
解决了我的问题
sing System.Data.Entity;
using System.Data.Entity.Core.Common.CommandTrees;
using System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder;
using System.Data.Entity.Core.Metadata.Edm;
using System.Data.Entity.Infrastructure.Interception;
using System.Linq;
namespace gist
{
/// Adapted from https://stackoverflow.com/questions/20133696/how-can-i-configure-entity-framework-to-automatically-trim-values-retrieved-for/27504530#27504530
/// and https://stackoverflow.com/questions/42845669/idbcommandtreeinterceptor-for-exact-dbcontext/42861024#42861024
internal class StringTrimmerInterceptor<T> : IDbCommandTreeInterceptor where T : DbContext
{
public void TreeCreated(DbCommandTreeInterceptionContext interceptionContext)
{
if (interceptionContext.OriginalResult.DataSpace == DataSpace.SSpace && interceptionContext.DbContexts.All(e => e.GetType() == typeof(T)))
{
if (interceptionContext.Result is DbQueryCommandTree queryCommand)
{
var newQuery = queryCommand.Query.Accept(new StringTrimmerQueryVisitor());
interceptionContext.Result = new DbQueryCommandTree(queryCommand.MetadataWorkspace, queryCommand.DataSpace, newQuery);
}
}
}
}
internal class StringTrimmerQueryVisitor : DefaultExpressionVisitor
{
private static readonly string[] TypesToTrim = { "nvarchar2", "nvarchar", "varchar", "char", "nchar" };
public override DbExpression Visit(DbNewInstanceExpression expression)
{
var arguments = expression.Arguments.Select(a =>
{
if (a is DbPropertyExpression propertyArg && TypesToTrim.Contains(propertyArg.Property.TypeUsage.EdmType.Name))
{
return a.Trim();
}
return a;
});
return expression.ResultType.New(arguments);
}
}
}