我尝试在我的新机器上运行PHPUnit测试,我收到此错误:
PHP致命错误:带有消息'RecursiveDirectoryIterator :: __ construct(/ usr/lib/php/pear/File/Iterator)的未捕获异常'UnexpectedValueException':无法打开dir:/ usr/lib/php/pear中的打开文件过多/File/Iterator/Factory.php:114
旧机器上的相同代码运行良好......
新机器环境:PHP版本:PHP 5.3.21(cli)旧版本:PHP 5.3.14
每次PHPUnit输出:
................EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 65 / 66 ( 98%)
E
Time: 34 seconds, Memory: 438.50Mb
There were 50 errors:
1) XXXXXXXXXXX
PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(/usr/lib/php/pear/File/Iterator): failed to open dir: Too many open files' in /usr/lib/php/pear/File/Iterator/Factory.php:114
Run Code Online (Sandbox Code Playgroud) 我正在尝试从Jenkins和Angularjs提供的api休息中检索有关一个作业构建的信息.
在Jenkins上实际上禁用了Jsonp:
所以这段代码不能工作:
var url = 'http://jenkins-server:8080/job/job-name/api/json?jsonp=callback';
$http.jsonp(url).success(function (data) {
console.log(data);
});
Run Code Online (Sandbox Code Playgroud)
扔:
Uncaught SyntaxError: Unexpected token :
Run Code Online (Sandbox Code Playgroud)
默认情况下不启用Cors ...说实话我找不到安装此插件的方法:
而且这段代码不能正常工作
var url = 'http://jenkins-server:8080/job/job-name/api/json'
$http({url: url, method: 'GET'}).success(function(data){console.log(data)})
Run Code Online (Sandbox Code Playgroud) 我正在使用cordova 3.5.0-0.2.6(最后一个稳定版本).我在锁定iPad设备的方向时遇到问题.在iPhone上它正常工作,但在iPad上方向没有锁定.
我想锁定整个应用程序,而不仅仅是页面.
这是我当前的config.xml:
<?xml version="1.0" encoding="utf-8"?>
<widget id="com.domain"
version="version"
xmlns="http://www.w3.org/ns/widgets">
<name>xxx</name>
<description>Lorem ipsum</description>
<access origin="*"/>
<author email="x@x" href="https://x.com">x</author>
<content src="index.html?platform=cordova"/>
<feature ...></feature>
<preference name="permissions" value="none"/>
<preference name="orientation" value="portrait"/>
<preference name="show-splash-screen-spinner" value="true"/>
<preference name="auto-hide-splash-screen" value="true"/>
<preference name="prerendered-icon" value="true"/>
<preference name="disallowoverscroll" value="true"/>
<preference name="webviewbounce" value="false"/>
<preference name="StatusBarOverlaysWebView" value="false"/>
<preference name="StatusBarBackgroundColor" value="#000000"/>
</widget>
Run Code Online (Sandbox Code Playgroud)
生成的plist文件如下所示:
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations¨ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
Run Code Online (Sandbox Code Playgroud) 如何在默认的Symfony login_check中添加额外的检查?大多数文档都是关于如何自定义登录表单,但在这种情况下我只想添加一个额外的检查用户是否具有status活动状态.
我假设我必须将路由重定向pattern: /login_check到我自己的安全检查,但这个功能应该是什么样的?好像我找不到任何相关的文档.
我正在尝试从Jenkins框中部署Symfony2应用程序.我正在为2个不同的环境使用capifony多级部署系统:dev和uat.
当我放
before "symfony:cache:warmup", "symfony:doctrine:migrations:migrate"
Run Code Online (Sandbox Code Playgroud)
在我的dev.rb文件中,我收到了capifony的错误
`symfony:doctrine:migrations:migrate' is only run for servers matching {:roles=>:app, :only=>{:primary=>true}, :except=>{:no_release=>true}}, but no servers matched
Run Code Online (Sandbox Code Playgroud)
我如何使用capifony自动部署和执行迁移?
我正在用Symfony2和Sonata Admin Bundle做一个项目.如何在动作configureShowFields中应用twig过滤器(显示格式化文本)?
我不会覆盖Sonata模板......
我的configureShowFields的代码:
protected function configureShowFields(ShowMapper $showMapper)
{
$showMapper
->add('active')
->add('title')
->add('subtitle') // I need this field with twig RAW filter
->add('description') //I need this field with twig RAW filter
->add('url')
->add('date')
->add('tags')
->add('file');
}
Run Code Online (Sandbox Code Playgroud) 我有简单的UserInterface实体:
function getRoles()
{
return $this->roles->toArray();
}
Run Code Online (Sandbox Code Playgroud)
与Role Entity接口有很多很多关系
/**
* @ORM\ManyToMany(targetEntity="Role", inversedBy="users", cascade={"persist"})
*/
protected $roles;
Run Code Online (Sandbox Code Playgroud)
当我尝试使用表单类型管理用户角色时
public function buildForm(FormBuilder $builder, array $options)
{
$builder->add('roles');
}
Run Code Online (Sandbox Code Playgroud)
Symfony给我一个错误:
期望参数类型为"Doctrine\Common\Collections\Collection","array"
我知道错误是在实体User的getRoles方法中返回一个数组,但我也知道getRoles是接口的一个方法,必须返回一个数组!
谁有一个很好的解决方案?
很简单:
我有一个实体机构
/**
* @var \Rewards\LocationBundle\Entity\Address
*
* @ORM\ManyToOne(targetEntity="\Acme\xxBundle\Entity\Address", cascade={"persist"})
* @ORM\JoinColumn(name="address_id", referencedColumnName="id")
*/
protected $address;
Run Code Online (Sandbox Code Playgroud)
我有一个创建表单的AgencyType:
$builder
->add('name')
->add('address');
Run Code Online (Sandbox Code Playgroud)
我也有AddressType
$builder
->add('street')
->add('zipCode')
->add('city')
->add('country');
Run Code Online (Sandbox Code Playgroud)
有了这个配置,如果我把:
{{ form_widget(form) }}
Run Code Online (Sandbox Code Playgroud)
在twig模板中我只查看'Select'表单小部件,但我想查看AgencyType AddressType形式的所有字段.
我怎么能这样做?
symfony ×5
php ×2
angularjs ×1
capifony ×1
cordova ×1
cors ×1
doctrine-orm ×1
ios ×1
ipad ×1
jenkins ×1
jsonp ×1
login ×1
many-to-one ×1
orientation ×1
phpunit ×1
security ×1
symfony-2.1 ×1
twig ×1