当我尝试在我的服务器上构建它时,我在symfony2中创建了一个小项目,在解压缩symfony时总是失败.构建是好的,突然作曲家不会解压缩symfony,我没有改变任何东西.我尝试使用Jenkins构建,也尝试使用bash手动构建相同的结果.这不是权限问题,我的服务器上的互联网连接也没问题.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing symfony/symfony (v2.3.4)
Downloading: 100%
[Symfony\Component\Process\Exception\ProcessTimedOutException]
The process "unzip '/path/vendor/symfony/symfony/6116f6f3
d4125a757858954cb107e64b' -d 'vendor/composer/b2f33269' && chmod -R u+w 'vendor/composer/b2f33269'" exceeded the timeout of 300 seconds.
Run Code Online (Sandbox Code Playgroud) 我正在用angularjs和laravel构建应用程序4.一切都很好但我现在只需要允许XHR请求.
这就是我在控制器开头所拥有的.但这种说法总是错误的.
if (!\Request::ajax())
{
return Response::json(array('halt'=>Request::ajax()));
};
Run Code Online (Sandbox Code Playgroud)
在角度我使用标准的$ http服务.
angular.module('APP')
.factory("API", ($http,$q,appClient,apiURL) ->
class FB
constructor:->
this.deferredData = $q.defer();
info: (reload)->
$http(
method: "get"
url: apiURL+'game/'+appClient+"/info"
).success((res)->
dostuff()
)
Run Code Online (Sandbox Code Playgroud) 我想做一个简单的思考.在循环中使用ng-include将多个html页面包含在渲染页面中.
<div ng-controller="pageCTRL">
<div ng-repeat="mod in modules">
<div ng-include src='partials/{{mod}}.html'></div>
</div>
</div>
$scope.modules = ["mod_nav","mod_feature","mod_footer"];
Run Code Online (Sandbox Code Playgroud)
但我得到的就是这个.
Error: Syntax Error: Token 'mod' is unexpected, expecting [:] at column 12 of the expression [partials/{{mod}}.html] starting at [mod}}.html].
at Error (<anonymous>)
at throwError (angular.js:6066:11)
at consume (angular.js:6104:7)
at object (angular.js:6394:9)
at primary (angular.js:6278:17)
at unary (angular.js:6265:14)
at multiplicative (angular.js:6251:39)
at additive (angular.js:6239:16)
at relational (angular.js:6230:16)
at equality (angular.js:6221:16) <div ng-include="" src="partials/{{mod}}.html">
Run Code Online (Sandbox Code Playgroud)
你有解决方法怎么做?
呈现的代码如下所示:
<div ng-include="" src="partials/mod_nav.html"></div>
Run Code Online (Sandbox Code Playgroud)
所以我不明白我做错了什么
我有像这样的角度嵌套对象.有没有办法过滤它的嵌套属性
<li ng-repeat="shop in shops | filter:search">
search.locations.city_id = 22
Run Code Online (Sandbox Code Playgroud)
我只显示父元素,但想要同时过滤它们,例如:
search =
category_id: 2
locations:
city_id: 368
[
name: "xxx"
category_id: 1
locations: [
city_id: 368
region_id: 4
,
city_id: 368
region_id: 4
,
city_id: 368
region_id: 4
]
,
name: "xxx"
category_id: 2
locations: [
city_id: 30
region_id: 4
,
city_id: 22
region_id: 2
]
]
Run Code Online (Sandbox Code Playgroud) 我正在寻找一种方法来在菜单中向用户显示他在页面上的位置。每个菜单项都有指向另一个元素和 IntersectionObserver 的锚链接,IntersectionObserver 设置项目的背景宽度,以及项目是否从底部或顶部显示(背景上的左右)
let options = {
root: null,
rootMargin: "0px",
threshold: []
}
for (let i = 0; i <= 1.0; i += 0.01) {
options.threshold.push(i)
}
this.observer = new IntersectionObserver(entries => {
const item = entries[0]
if (item.isIntersecting) {
let visiblePct = Math.floor(item.intersectionRatio * 100)
this.pageProgressOpt.width =
(this.$el.getBoundingClientRect().width / 100) * visiblePct
this.pageProgressOpt.align =
item.boundingClientRect.top < 0 ? "right" : "left"
} else {
this.pageProgressOpt.width = 0
}
}, options)
Run Code Online (Sandbox Code Playgroud)
但是,当元素高度大于可见窗口的高度并且视图位于元素中间时,不会触发回调。这有点明显,因为达到了阈值 1.0。但我正在寻找继续观察元素的方法。我想在发生这种情况时附加到滚动条上,但无法说明是否发生这种情况。
我应该为此使用滚动事件还是有任何解决方法?
//编辑:这是我正在做的视频https://drive.google.com/file/d/1gPrIWgcLTJ3vhquyrUnyyh9IlTuZiDRJ/view
如何从字符串中删除除空格,数字和其他字符之外的所有字符?像这样的东西:
oneLine.gsub(/[^ULDR0-9\<\>\s]/i,'')
Run Code Online (Sandbox Code Playgroud)
我只需要: 0-9 l d u r < > <space>
另外,有没有关于在Ruby中使用正则表达式的好文档,比如带有示例的特殊字符列表?
我有包含多张照片的实体:
/**
* related images
* @ORM\OneToMany(targetEntity="Photo", mappedBy="entity",cascade={"persist"})
* @ORM\OrderBy({"uploaded_at" = "ASC"})
*/
private $photos;
Run Code Online (Sandbox Code Playgroud)
照片与实体有ManyToOne关系
/**
* @ORM\ManyToOne(targetEntity="Acme\AppBundle\Entity\Entity", inversedBy="photos")
* @ORM\JoinColumn(name="entity_id", referencedColumnName="id", onDelete="CASCADE")
*/
private $entity;
Run Code Online (Sandbox Code Playgroud)
我设置了symfony集合文档:http ://symfony.com/doc/current/reference/forms/types/collection.html
表格类型:
->add('photos', 'collection', array(
'type' => new PhotoFormType(),
'allow_add' => true,
'by_reference' => false,
'allow_delete' => true,
'prototype' => true
))
Run Code Online (Sandbox Code Playgroud)
相片类型:
$builder
->add('title', null, ['label' => 'front.photo.title', 'required' => true])
->add('image', 'file', array('required' => false))
;
Run Code Online (Sandbox Code Playgroud)
对于上载,我使用的是vichUploadableBundle,图像保存得很好,但是entity_id不保存并且为空。我不知道我在这里错过了什么。
我正在将我的gitlab实例移动到另一台服务器,我遇到了问题.克隆工作正常,但推送错误,我无法弄清问题在哪里.在gitlab中,日志没有用.
git push
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 351 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: GitLab: You are not allowed to access master!
remote: error: hook declined to update refs/heads/master
To git@server:user/repo.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'git@server:user/repo.git'
Run Code Online (Sandbox Code Playgroud)
我不知道问题在哪里,我改变了一点配置.Repos和satelites在以前的服务器符号链接到/media/data/git/repositories现在的/home/git符号链接到/media/disk/git但我不认为这是问题.
编辑:// gitlab:检查是一切还好gitlab-shell检查还可以
我正在用laravel 4做休息api,我收到了这个错误:
Unable to generate a URL for the named route "regions.index"
as such route does not exist.
Run Code Online (Sandbox Code Playgroud)
我的路由器:
Route::group(array('prefix' => 'api/v1'), function(){
Route::get('regions', 'RegionsController@index');
Route::get('regions/{id}', 'RegionsController@getOne');
Route::get('regions/{id}/cities', 'RegionsController@getCities');
});
Run Code Online (Sandbox Code Playgroud)
api/v1/regions和api/v1/regions/1/cities工作正常
但是api/v1/regions/1不起作用而且异常,我真的不知道为什么,也找不到如何让它工作.
angularjs ×3
php ×3
javascript ×2
laravel-4 ×2
symfony ×2
ajax ×1
coffeescript ×1
composer-php ×1
doctrine-orm ×1
filter ×1
git ×1
gsub ×1
laravel ×1
linux ×1
regex ×1
routing ×1
ruby ×1
ssh ×1
timeout ×1