小编Tom*_*ght的帖子

期待声明?

我创建了一个包含常规函数的文件.此文件的目标是将其包含在主文件中并使用其中可用的功能.

无论如何,所以<?phpPhpStorm回归:

期待遗体

这是什么意思?

文件结构的一个例子:

<?php //here the problem


public function getTimeStamp()
{
    $originalTime = microTime(true);
    $micro = sprintf("%06d", ($originalTime - floor($originalTime)) * 1000000);
    $date = new DateTime(date('d-m-Y H:i:s' . $micro, $originalTime));

    return $date->format($this->settings['dateFormat']);

} //and also here

 ...

?>
Run Code Online (Sandbox Code Playgroud)

我做错了什么?

php phpstorm

10
推荐指数
1
解决办法
2万
查看次数

无法在CentOS上安装PHP包

我无法在我的数字海洋托管服务器上通过yum重新安装PHP.

我安装了PHP 5.4但想要5.6.我添加/启用了remi repo,运行yum -y remove php*然后尝试重新安装php.

当我跑步时,yum -y install php我得到以下内容:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.centos.webair.com
 * epel: mirrors.coreix.net
 * extras: mirrors.centos.webair.com
 * remi: remi.check-update.co.uk
 * remi-php56: remi.check-update.co.uk
 * updates: mirrors.centos.webair.com
 * webtatic: uk.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.6.8-1.el6.remi will be installed
--> Processing Dependency: php-common(x86-64) = 5.6.8-1.el6.remi for package: php-5.6.8-1.el6.remi.x86_64
--> Processing Dependency: php-cli(x86-64) = 5.6.8-1.el6.remi for package: php-5.6.8-1.el6.remi.x86_64
--> Processing Dependency: httpd-mmn …
Run Code Online (Sandbox Code Playgroud)

php linux centos yum

8
推荐指数
2
解决办法
2万
查看次数

将List Iterator传递给Java中的多个线程

我有一个包含大约200K元素的列表.

我能够将此列表的迭代器传递给多个线程并让它们遍历整个批次,而没有任何访问相同的元素吗?

这就是我现在想到的.

主要:

public static void main(String[] args)
{
    // Imagine this list has the 200,000 elements.
    ArrayList<Integer> list = new ArrayList<Integer>();

    // Get the iterator for the list.
    Iterator<Integer> i = list.iterator();

    // Create MyThread, passing in the iterator for the list.
    MyThread threadOne = new MyThread(i);
    MyThread threadTwo = new MyThread(i);
    MyThread threadThree = new MyThread(i);

    // Start the threads.
    threadOne.start();
    threadTwo.start();
    threadThree.start();
}
Run Code Online (Sandbox Code Playgroud)

MyThread的:

public class MyThread extends Thread
{

    Iterator<Integer> i;

    public MyThread(Iterator<Integer> i)
    { …
Run Code Online (Sandbox Code Playgroud)

java multithreading iterator listiterator

6
推荐指数
1
解决办法
5958
查看次数

Composer Satis Repository 似乎指的是源 URL 而不是 dist URL

我有一个设置了基本 HTTP 身份验证的 Satis 服务器。

配置文件如下所示:

{
    "name": "MySatisServer",
    "homepage": "https:\/\/satis.example.co.uk",
    "repositories": [
        {
            "type": "git",
            "url": "git@github.com:Org\/Repo1.git"
        },
        {
            "type": "git",
            "url": "git@github.com:Org\/Repo2.git"
        },
        {
            "type": "git",
            "url": "git@github.com:Org\/Repo3.git"
        },
        {
            "type": "git",
            "url": "git@github.com:Org\/Repo4.git"
        }
    ],
    "require-all": true,
    "require-dependencies": true,
    "require-dev-dependencies": true,
    "archive": {
        "directory": "dist",
        "format": "zip",
        "prefix-url": "https://satis.example.co.uk"
    }
}
Run Code Online (Sandbox Code Playgroud)

我已经运行了 satis 构建,它使用packages.json看起来正确的文件创建了我的 dist 目录。

我可以https://satis.example.co.uk在我的浏览器中访问并下载我想要的任何版本的存储库作为 ZIP 并且它工作正常。

当我尝试通过 Composer 使用 repo 时出现问题。

我的composer.json文件看起来像这样:

{
    "name": "some/project",
    "description": "",
    "license": …
Run Code Online (Sandbox Code Playgroud)

php github composer-php satis

5
推荐指数
1
解决办法
1455
查看次数