HumHub install by own project composer - yii2

I want to install HumHub (github.com/humhub/humhub) with my own composer file. But composer do not install humhub dependencies.
Here is my composer.json:
{
"name": "my-project",
"type": "project",
"repositories": [
{
"type": "package",
"package": {
"name": "humhub/humhub",
"version": "1.1.1",
"source": {
"url": "https://github.com/humhub/humhub.git",
"type": "git",
"reference": "master"
}
}
}
],
"require": {
"humhub/humhub": "1.1.1"
}
}

Do you get any error messages? Are you trying to get humhub using git, not packagist or so? If you are fetching directly from github, try
"repositories": [{ "type": "git", "url": "https://github.com/humhub/humhub.git"}]
and leave "require" as you have it now.
EDIT: I just noticed, that there is nothing tagged as "1.1.1" on humhub's repository. You can find a tag "v1.1.1", therefore change your "require" to:
"require": {"humhub/humhub": "dev-master#v1.1.1"}

According to the composer documentation, here is how add a git repository as a composer dependency.
I've modified their example to use the humhub library.
{
"name": "my-project",
"type": "project",
"require": {
"humhub/humhub": "dev-master#1.1.1"
},
"repositories": [
{
"type": "vcs",
"url": "git#bitbucket.org:humhub/humhub.git"
}
]
}

you can also try the humhub composer installer: https://github.com/move-elevator/humhub-composer-installer

Related

Reference a variabled in tasks.json that was defined in launch.json

I'm trying to configure my project in Visual Studio Code.
I am using CMake+make to build my project. CMake needs to know the project configuration (Debug/Release) and architecture (x64/x86) before it can generate the make files.
I could define 4 tasks and 4 launch configurations to achieve this (each hardcoding both options), but that is a lot of duplication.
Instead, I would like to use environment variables to basically "pass down" the parameters from the launch configuration to a single task.
However, VScode doesn't seem to forward what I define in the launch configuration to the task.
Here is what I have:
// launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug (x64)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/bin/debug/x64/executable",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "proj_configuration",
"value": "Debug"
},
{
"name": "proj_platform",
"value": "x64"
}
],
// "variables": {
// "proj_configuration": "Debug",
// "proj_platform": "x64"
// },
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "Make Project",
}
]
}
// tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "Build Project",
"type": "shell",
"command": "cmake",
"args": [
"-B${workspaceFolder}/build",
"-H${workspaceFolder}",
"-DCMAKE_BUILD_TYPE=${proj_configuration}",
"-DCMAKE_GENERATOR_PLATFORM=${proj_platform}"
],
"group": {
"kind": "build",
"isDefault": false
}
},
{
"label": "Make Project",
"type": "shell",
"command": "make",
"group": {
"kind": "build",
"isDefault": true
},
"dependsOn": ["Build Project"],
}
]
}
When I try to run my project, I get
Executing task: cmake -B/home/user/project/build -H/home/user/project/ -DCMAKE_BUILD_TYPE=${proj_configuration} -DCMAKE_GENERATOR_PLATFORM=${proj_platform}
As you can see, the 2 variables are not replaced.
I've also tried using the property "variables", but no luck using that either.
So, is it possible to do what I described, or do I have to define multiple tasks instead?
with the extension Command Variable you can save a number of strings in a store and use these in launch.json and task.json. See example in the link

Create a json file from other json files

I have 2 json files:
User.json:
{
"users": [
{
"username": "User1",
"app": "Git",
"role": "Manager"
},
{
"username": "user2",
"app": "Git",
"role": "Developer"
}
]
}
App.js:
{
"apps": [
{
"appName": "Git",
"repo": "http://repo1..."
},
{
"appName": "Jenkins",
"repo": "htpp://repo2..."
}
]
}
I'm working on an Angular-CLI apllication for the first time and I want to generate a new json file called infos.json containing the content of the 2 files (User.json + App.json) without redundancy.
Expected file:
Infos.json:
{
"infos": [
{
"username": "User1",
"appName": "GIT",
"role": "Manager",
"repo": "http://repo1..."
},
{
"username": "User2",
"appName": "Jenkins",
"role": "Developer",
"repo": "htpp://repo2..."
}
]
}
How can I do it in my Angular-CLI app ?
You can do this by creating task in task runner. Some of the task runner are Grunt, gulp etc.
Grunt and gulp have different inbuilt packages.
Grunt: npm i grunt-merge-json
Gulp: npm i gulp-merge-json
If you are using web-pack so there is a inbuilt package called merge-webpack-plugin

Get Composer to install local package with path type of repository

I have a yii2 project with a local extension:
home/
packages/
yii2-unipv-gii/ < my extension
composer.json (1)
projects/
my-project/ < my project
composer.json (2)
I would like to install the extension in the Yii2 project with the use of path type of repository that create a symlink with the extension folder.
I have composer.json (1)
{
"name": "unipvsag/yii2-unipv-gii",
"type": "yii2-extension",
"keywords": ["yii2","extension","unipv"],
"license": "MIT",
"minimum-stability": "dev",
"require": {
"yiisoft/yii2": "~2.0.0"
},
"autoload": {
"psr-4": {
"unipvsag\\unipvgii\\": ""
}
},
"extra": {
"bootstrap": "unipvsag\\unipvgii\\Bootstrap"
}
}
and composer.json (2)
{
"name": "unipv/accesso-Programmato",
"type": "project",
"license": "BSD-3-Clause",
"minimum-stability": "dev",
"prefer-stable": true,
"repositories":[
{
"type": "path",
"url": "../../packages/yii2-unipv-gii"
}
],
"require": {
----other packages----
"unipvsag/yii2-unipv-gii": "dev-master"
},
"config": {
"process-timeout": 1800
},
"extra": {
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
},
"scripts": {
}
}
The problem is on composer update I receive this error:
[InvalidArgumentException]
Unknown downloader type: . Available types: git, svn, fossil, hg, perforce, zip, rar, tar, gzip, xz, phar, file, path.
It is a problem of the project or of the extension?

Openshift: Unresolved Image

i'm stuck with Openshift (Origin) and need some help.
Let's say i want to add a grafana deployment via CLI to a new started cluster.
What i do:
Upload a template to my openshift cluster (oc create -f openshift-grafana.yml)
Pull the necessary image from the docker hub (oc import-image --confirm grafana/grafana)
Build a new app based on my template (oc new-app grafana)
These steps creates the deployment config and the routes.
But then i'm not able to start a deployment via CLI.
# oc deploy grafana
grafana deployment #1 waiting on image or update
# oc rollout latest grafana
Error from server (BadRequest): cannot trigger a deployment for "grafana" because it contains unresolved imagesenter code here
In the openshift web console it looks like this:
The images is there, even the link is working. In the web console i can click "deploy" and it's working. But nevertheless i'm not able to rollout a new version via command line.
The only way it works is editing the deployment yml so openshift recognizes a change a starts a deployment based on "config change" (hint: i'm was not changing the image or image name)
There is nothing special in my template, it was just an export via oc export from a working config.
Any hint would be appreciated, i'm pretty much stuck.
Thanks.
I had this same issue and I solved it by adding:
lastTriggeredImage: >-
mydockerrepo.com/repo/myimage#sha256:xxxxxxxxxxxxxxxx
On:
triggers:
- type: ImageChange
imageChangeParams:
Of the deploymentconfig yaml. Looks like if it doesn't know what the last triggered image is, it wont be able to resolve it.
Included below is the template you can use as a starter. Just be aware that the grafana image appears to require it be run as root, else it will not startup. This means you have to override the default security model of OpenShift and enable allowing running of images as root in the project. This is not recommended. The grafana images should be fixed so as not to require they be run as root.
To enable running as root, you would need to run as a cluster admin:
oc adm policy add-scc-to-user anyuid -z default -n myproject
where myproject is the name of the project you are using.
I applied it to the default service account, but better you create a separate service account, apply it to that and then change the template so that only grafana runs as that service account.
It is possible that the intent is that you override the default settings through the grafana.ini file so it uses your mounted emptyDir directories and then it isn't an issue. I didn't attempt to provide any override config.
The template for grafana would then be as follows. Note I have used JSON as I find it easier to work with JSON, but also to avoid indenting being screwed up making the YAML impossible to use.
Before you use this template, you should obviously create the corresponding config map where name is of form ${APPLICATION_NAME}-config where ${APPLICATION_NAME} is grafana unless you override it when using the template. The key in the config map should be grafana.ini and then have as value the config file contents.
{
"apiVersion": "v1",
"kind": "Template",
"metadata": {
"name": "grafana"
},
"parameters": [
{
"name": "APPLICATION_NAME",
"value": "grafana",
"from": "[a-zA-Z0-9]",
"required": true
}
],
"objects": [
{
"apiVersion": "v1",
"kind": "ImageStream",
"metadata": {
"name": "${APPLICATION_NAME}-img",
"labels": {
"app": "${APPLICATION_NAME}"
}
},
"spec": {
"tags": [
{
"name": "latest",
"from": {
"kind": "DockerImage",
"name": "grafana/grafana"
}
}
]
}
},
{
"apiVersion": "v1",
"kind": "DeploymentConfig",
"metadata": {
"name": "${APPLICATION_NAME}",
"labels": {
"app": "${APPLICATION_NAME}",
"type": "monitoring"
}
},
"spec": {
"replicas": 1,
"selector": {
"app": "${APPLICATION_NAME}",
"deploymentconfig": "${APPLICATION_NAME}"
},
"template": {
"metadata": {
"labels": {
"app": "${APPLICATION_NAME}",
"deploymentconfig": "${APPLICATION_NAME}",
"type": "monitoring"
}
},
"spec": {
"containers": [
{
"name": "grafana",
"image": "${APPLICATION_NAME}-img:latest",
"imagePullPolicy": "Always",
"livenessProbe": {
"failureThreshold": 3,
"httpGet": {
"path": "/",
"port": 3000,
"scheme": "HTTP"
},
"periodSeconds": 10,
"successThreshold": 1,
"timeoutSeconds": 1
},
"ports": [
{
"containerPort": 3000,
"protocol": "TCP"
}
],
"volumeMounts": [
{
"mountPath": "/etc/grafana",
"name": "grafana-1"
},
{
"mountPath": "/var/lib/grafana",
"name": "grafana-2"
},
{
"mountPath": "/var/log/grafana",
"name": "grafana-3"
}
]
}
],
"volumes": [
{
"configMap": {
"defaultMode": 420,
"name": "${APPLICATION_NAME}-config"
},
"name": "grafana-1"
},
{
"emptyDir": {},
"name": "grafana-2"
},
{
"emptyDir": {},
"name": "grafana-3"
}
]
}
},
"test": false,
"triggers": [
{
"type": "ConfigChange"
},
{
"imageChangeParams": {
"automatic": true,
"containerNames": [
"grafana"
],
"from": {
"kind": "ImageStreamTag",
"name": "${APPLICATION_NAME}-img:latest"
}
},
"type": "ImageChange"
}
]
}
},
{
"apiVersion": "v1",
"kind": "Service",
"metadata": {
"name": "${APPLICATION_NAME}",
"labels": {
"app": "${APPLICATION_NAME}",
"type": "monitoring"
}
},
"spec": {
"ports": [
{
"name": "3000-tcp",
"port": 3000,
"protocol": "TCP",
"targetPort": 3000
}
],
"selector": {
"deploymentconfig": "${APPLICATION_NAME}"
},
"type": "ClusterIP"
}
},
{
"apiVersion": "v1",
"kind": "Route",
"metadata": {
"name": "${APPLICATION_NAME}",
"labels": {
"app": "${APPLICATION_NAME}",
"type": "monitoring"
}
},
"spec": {
"host": "",
"port": {
"targetPort": "3000-tcp"
},
"to": {
"kind": "Service",
"name": "${APPLICATION_NAME}",
"weight": 100
}
}
}
]
}
For me, I had the image name incorrectly under 'from':
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- alcatraz-ha
from:
kind: ImageStreamTag
name: 'alcatraz-haproxy:latest'
namespace: alcatraz-ha-dev
type: ImageChange
I had name: 'alcatraz-ha:latest' so it could not find the image
Make sure that spec.triggers.imageChangeParams.from.name exists as image stream
triggers:
- imageChangeParams:
from:
kind: ImageStreamTag
name: 'myapp:latest' # Does "myapp" exist if you run oc get is ????!!!

Failed to execute git clone in composer

I'm trying to install something that I created on git in my laravel site and I keep getting this error when I hit composer update I have git version 2.0.1 and my mac is version 10.8.5
[RuntimeException]
Failed to execute git clone --no-checkout 'git#bitbucket.org:PATH-TO-REPO.git' '/Applications/MAMP/htdocs/test-modules/vendor/test/tinymce' && cd '/Applications/MAMP/htdocs/test-modules/vendor/test/tinymce' && git
remote add composer 'git#bitbucket.org:PATH-TO-REPO.git' && git fetch composer
dyld: lazy symbol binding failed: Symbol not found: ___strlcpy_chk
Referenced from: /usr/local/git/bin/git
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: ___strlcpy_chk
Referenced from: /usr/local/git/bin/git
Expected in: /usr/lib/libSystem.B.dylib
sh: line 1: 504 Trace/BPT trap: 5 git clone --no-checkout 'git#bitbucket.org:PATH-TO-REPO.git' '/Applications/MAMP/htdocs/test-modules/vendor/test/tinymce'
In my composer.json I have
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"laravel/framework": "4.2.6",
"test/tinymce": "dev-master",
"test/uploadify": "dev-master",
"mews/captcha": "dev-master"
},
"require-dev": {
"way/generators": "~2.0"
},
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php",
"app/modules"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "stable",
"repositories": [
{
"type": "composer",
"url": "http://localhost:8888/test-modules/packages.json"
}
]
}
and in my packages.json
{
"packages": {
"test/tinymce": {
"dev-master": {
"name": "test/tinymce",
"version": "dev-master",
"source": {
"url": "git#bitbucket.org:PATH-TO-REPO.git",
"type": "git",
"reference": "master"
}
}
},
"test/uploadify": {
"dev-master": {
"name": "test/uploadify",
"version": "dev-master",
"source": {
"url": "git#bitbucket.org:PATH-TO-REPO.git",
"type": "git",
"reference": "master"
}
}
}
}
}
dyld: Symbol not found: ___strlcpy_chk
You need to re-install your Git. On macOS, use Brew, e.g.: git reinstall git. This is usually the issue when your program points to the wrong or outdated libraries.