如何成为Yii2贡献者?

时间:2018-09-29 06:55:26

标签: git yii2 open-source

由于天气寒冷,我决定成为开源贡献者。我选择了Yii2项目并阅读了doc

我完成的步骤: 1.使用所有必需的php-extensions创建虚拟主机 2.派生Yii2存储库并将其克隆到主机上 3.添加上游,运行composer和npm 4. php build / build dev / app高级

第4步后,我在控制台中收到错误:

<!DOCTYPE html>
<html>
<body>

<?php
$servername = 'localhost';
$username = 'root';
$password = 'XXXXXXXX';
$conn = new mysqli($servername, $username, $password);
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 
echo "Connected successfully";
?>
</body>
</html>

原来,该脚本尝试执行PHP Warning 'yii\base\ErrorException' with message 'chdir(): No such file or directory (errno 2)' in /home/ghopper/Projects/yii2.test/build/controllers/DevController.php:178 ,但该文件夹不存在。因此,我自己创建了它,并解决了问题。

我偶然发现“现在您有一个可以在Yii 2上进行黑客攻击的游乐场”。在文档中,但我认为我的仓库有问题。

首先,我的目录结构与original repo中的目录结构完全相同。没有前端和后端目录。第二个问题是关于cd apps/advanced的-我应该从哪里得到?

更新:

我指定了回购网址并收到新错误:

apps/advanced

ghopper@farm /var/www/yii2.test (master) $ php build/build dev/app advanced https://github.com/yiisoft/yii2-app-advanced.git cloning application repo 'advanced' from 'https://github.com/yiisoft/yii2-app-advanced.git'... Cloning into '/var/www/yii2.test/apps/advanced'... remote: Enumerating objects: 7, done. remote: Counting objects: 100% (7/7), done. remote: Compressing objects: 100% (5/5), done. remote: Total 6293 (delta 2), reused 4 (delta 2), pack-reused 6286 Receiving objects: 100% (6293/6293), 1.32 MiB | 204.00 KiB/s, done. Resolving deltas: 100% (3389/3389), done. Checking out files: 100% (270/270), done. done. cleaning up application 'advanced' vendor directory... done. updating composer for app 'advanced'... Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 66 installs, 0 updates, 0 removals - Installing yiisoft/yii2-composer (dev-master f4cb50d): Downloading (100%) - Installing sebastian/version (2.0.1): Downloading (100%) - Installing sebastian/object-reflector (dev-master 7707193): Downloading (100%) - Installing sebastian/recursion-context (dev-master dbe1869): Downloading (100%) - Installing sebastian/object-enumerator (dev-master 06d95dc): Downloading (100%) - Installing sebastian/global-state (dev-master 30367ea): Downloading (100%) ... codeception/base suggests installing stecman/symfony-console- completion (For BASH autocompletion) codeception/base suggests installing symfony/phpunit-bridge (For phpunit-bridge support) Writing lock file Generating autoload files done. linking framework and extensions to 'advanced' app vendor dir... Removing dir /var/www/yii2.test/apps/advanced/vendor/yiisoft/yii2. Creating symlink for /var/www/yii2.test/apps/advanced/vendor/yiisoft/yii2. Removing dir /var/www/yii2.test/apps/advanced/vendor/yiisoft/yii2-gii. Creating symlink for /var/www/yii2.test/apps/advanced/vendor/yiisoft/yii2-gii. cloning extension repo 'gii' from 'git@github.com:yiisoft/yii2-gii.git'... Cloning into '/var/www/yii2.test/extensions/gii'... git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. done. cleaning up extension 'gii' vendor directory... done. updating composer for extension 'gii'... PHP Warning 'yii\base\ErrorException' with message 'chdir(): No such file or directory (errno 2)' in /var/www/yii2.test/build/controllers/DevController.php:233 是什么意思?

1 个答案:

答案 0 :(得分:0)

这不是真的:

  

fork是存储库派生的URL,例如   git@github.com:my_nickname / yii2-app-basic.git。如果你是核心   您可以跳过指定fork的框架贡献者。

首先,您必须指定存储库(yii2-app-basic.git或yii2-app-advanced.git)!

第二个-您必须add SSH密钥到github。

此后,一切正常,您将在apps/advanced目录中获得代码