Install ZF2 modules on windows 7 by using composer.json - zend-framework

I have just started to explore zf2 and trying to install modules. have downloaded zip for ZfcAdmin and ZfcUser and added them manually but no luck. I think it can be installed by using composer.phar but how I have skeleton application running perfectly.
I know php composer.phar self-update / install but how to write composer.json is my question

You open the composer.json file with a text-editor of your choice. Then you'll be able to see the json formatted data, that will be passed to composer.phar
If you wish to add new modules, you'll see the require: {} block, to which you simply add the namespaces/modules you wish to include. For example extend your composer.json to something like this:
"minimum-stability": "alpha",
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": "2.*",
"zendframework/zend-developer-tools": "dev-master",
"doctrine/doctrine-orm-module": "0.*"
}
Seeing this i install both zend-developer-tools and zendframework from the zendframework Git-Repositories and additionally i install doctrine-orm-module from doctrine-repository.
A little catch: Some repositories / modules are under heavy development and there will be no stable version yet. Personally i run with the additional parameter "minimum-stability": "alpha", to tell composer to include all alpha repositories for downloading.
If you just need a single alpha-version, you'd much likely need to re-write the composer.json a couple of times.
Last but not least, php composer.phar update will do the trick and you'll always be up to date with the repositories.
Some additional notes for windows users
Sometimes Write-Permissions may be missing from command line. You can change this by running the command line with administrator privileges.
If the PHP Command is not found, you may need to add the PATH to the PHP-Executable into your Environment-Variable PATH
I wrote a detailed blog-post on how to keep ZF2 running via command line with git for windows 7 myself, so far this has covered most problems, you may want to check out my Blogpost
Hope this gets you running ;)

Related

PyPI install_requires direct links

I have a Python library (https://github.com/jcrozum/PyStableMotifs) that I want to publish on PyPI. It depends on another library (https://github.com/hklarner/PyBoolNet) that I do not control and that is only available on GitHub, and in particular, it is not available on PyPI. My setup.py looks like this:
from setuptools import
setup(
... <other metadata> ...,
install_requires=[
'PyBoolNet # git+https://github.com/hklarner/PyBoolNet#2.3.0',
... <other packages> ...
]
)
Running pip install git+https://github.com/jcrozum/PyStableMotifs works perfectly, but I can't upload this to PyPI because of the following error from twine:
Invalid value for requires_dist. Error: Can't have direct dependency: 'PyBoolNet # git+https://github.com/hklarner/PyBoolNet#2.3.0'
My understanding is that direct links are forbidden by PyPI for security reasons. Nonetheless, PyBoolNet is a hard requirement for PyStableMotifs. What do I do? Give up on PyPI?
I just want pip install PyStableMotifs to work for my users. Ideally, this command should install the dependencies and I should not have to maintain two versions of setup.py.
Failing that, I have considered creating a "dummy" package on PyPI directing users to install using the command pip install git+https://github.com/jcrozum/PyStableMotifs. Is this a bad idea (or even possible)?
Are there already established best practices for this situation or other common workarounds?
EDIT:
For now, I have a clunky and totally unsatisfying workaround. I'm keeping two versions; a GitHub version that works perfectly, and a PyPI version that has the PyBoolNet requirement removed. If the user tries to import PyStableMotifs without PyBoolNet installed, an error message is shown that has install instructions for PyBoolNet. This is far from ideal in my mind, but it will have to do until I can find a better solution or until PyPI fixes this bug (or removes this feature, depending on who you ask).
My recommendation would be to get rid of the direct URL in install_requires, and tell your users where they can find that dependency PyBoolNet since it is not on PyPI. Don't force them on a specific installation method, but show them an example.
Maybe simply tell your users something like:
This project depends on PyBoolNet, which is not available on PyPI. One place where you can find it is at: https://github.com/hklarner/PyBoolNet.
One way to install PyStableMotifs as well as its dependency PyBoolNet is to run the following command:
python -m pip install 'git+https://github.com/hklarner/PyBoolNet#2.3.0#egg=PyBoolNet' PyStableMotifs
You could additionnally prepare a requirements.txt file and tell your users:
Install with the following command:
python -m pip install --requirement https://raw.githubusercontent.com/jcrozum/PyStableMotifs/master/requirements.txt
The content of requirements.txt could be something like:
git+https://github.com/hklarner/PyBoolNet#2.3.0#egg=PyBoolNet
PyStableMotifs
But in the end, you should really let your users choose how to install that dependency. Your project only need to declare that it depends on that library but not how to install it.

How to install a NetBeans plugin via CLI?

Question:
Is there a way to install a downloaded NBM (Netbeans Module) into an already installed Netbeans IDE via CLI?
Current setup
Netbeans 12.3 with Windows 10
Netbeans 12.3 with Linux Mint 20.1
Relevant scenario
If the question comes to your mind 'why aren't you just using the GUI?' or anything like that. Think of the following scenario. When working on an air gapped network with 50 computers you're the one having to install Netbeans plugins on all of that PCs. You're able to put files on those PCs and execute a command via console and you don't want to run around all the buildings and clicking through the process.
Thank you very much in advance.
I think I found a solution. I'll post it here to reflect my research because I've never found a answer on stackoverflow.
When Netbeans is already installed you can use the --help parameter like:
C:\Program Files\NetBeans\netbeans\bin\netbeans64.exe --help
This lists lot of available parameters (which I haven't found a list of on the web) like (shortened):
General options:
--help show this help
--jdkhome <path> path to JDK
--console new open new console for output
Module reload options:
--reload /path/to/module.jar install or reinstall a module JAR file
Additional module options:
--modules
--refresh Refresh all catalogs
--list Prints the list of all modules, their versions and enablement status
--install <arg1>...<argN> Installs provided JAR files as modules
--disable <arg1>...<argN> Disable modules for specified codebase names
--enable <arg1>...<argN> Enable modules for specified codebase names
--update <arg1>...<argN> Updates all or specified modules
--update-all Updates all modules
Core options:
--fontsize <size> set the base font size of the user interface, in points
--userdir <path> use specified directory to store user settings
--nosplash do not show the splash screen
In my case the solution was to use the --install parameter pointing to the jar file to install.Be aware that the NBM files are just containers containing the jar file and some more meta data files like config xml files. You're able to open it via 7zip for example. And you'll have to take care of all the dependencies yourself.

Error on Yum update

I'm unfortunately not very experienced in CentOS administration, and was hoping someone might be able to help me understand and get past a small hurdle. I was hoping to run yum update on the system, but ran into some Transaction Check Errors:
file /etc/php.ini from install of php55-common-5.5.11-1.el6.x86_64 conflicts with file from package php-common-5.3.3-40.el6_6.x86_64
file /usr/lib64/php/modules/curl.so from install of php55-common-5.5.11-1.el6.x86_64 conflicts with file from package php-common-5.3.3-40.el6_6.x86_64
file /usr/lib64/php/modules/fileinfo.so from install of php55-common-5.5.11-1.el6.x86_64 conflicts with file from package php-common-5.3.3-40.el6_6.x86_64
file /usr/lib64/php/modules/phar.so from install of php55-common-5.5.11-1.el6.x86_64 conflicts with file from package php-common-5.3.3-40.el6_6.x86_64
file /usr/lib64/php/modules/pdo.so from install of php55-pdo-5.5.11-1.el6.x86_64 conflicts with file from package php-pdo-5.3.3-40.el6_6.x86_64
file /usr/lib64/php/modules/pdo_sqlite.so from install of php55-pdo-5.5.11-1.el6.x86_64 conflicts with file from package php-pdo-5.3.3-40.el6_6.x86_64
file /usr/lib64/php/modules/sqlite3.so from install of php55-pdo-5.5.11-1.el6.x86_64 conflicts with file from package php-pdo-5.3.3-40.el6_6.x86_64
It sort of looks like it's saying that some newer version files are conflicting with older version files. Is there a standard way to fix this? I was mainly just trying to update so that I could install Java later, but wasn't expecting to run into these errors. If it helps, the server is mainly being used for hosting a few websites with apache and mysql. Thanks so much for any help, it's greatly appreciated.
Edit: To add some more clarification, I had previously edited the baseurl variable in the /etc/yum.repos.d/centalt.repo file, which was originally set to
baseurl=centos.alt.ru/repository/centos/6/$basearch
The reason I changed the location was because I was previously getting an error when trying to run yum update, mentioned in this other stackoverflow question https://unix.stackexchange.com/questions/132674/repository-metadata-repomd-xml-for-repository-mratwork-centalt which had an answer recommending replacing the URL with
baseurl=mirror.sysadminguide.net/centalt/repository/centos/6/$basearch
Is there a different url I should be using instead?
You have a non-official repository which provides the php55-* packages which conflict with the official php-* packages.
You currently have the php-* versions installed.
If you want to switch you can try manually installing the matching php55-* package for every php-* package you have installed in one yum command (though that may not work).
If it doesn't, you might need to remove all the php packages you have installed first and then install the php55 versions after that.

I Can't install Laravel 4's package

I just started learn Laravel 4, i have problem when install laravel's package, in this case it is: http://packalyst.com/packages/package/greggilbert/recaptcha
I do all steps, but it always display: Class 'Greggilbert\Recaptcha\RecaptchaServiceProvider' not found
I think problem is i don't know where to put recaptcha-master.zip, root folder? or in Vendor folder? i don't know :(
Please help, thank you so much :(
First you need to add "greggilbert/recaptcha": "dev-master" to the require section of your composer.json file found in the Laravel root.
Once thats done you then need to install composer globally or download a copy of composer.phar and move it to your Laravel root.
Once either of those methods have been completed, you then need to run either composer update if you installed composer globally or php composer.phar update in order to install the new packages.
After, and only after composer has updated with the new dependencies you should then add the service providers and other configurations to Laravel.
Heres a link to the composer site. http://getcomposer.org/

Installing 3rd party packages in kickstart on redhat

I have been trying to work out how to add my own packages as part of a kickstart install (specifically mondo packages) but using the %packages directive as opposed to rpm commands in the post scripts. I tried adding them to the packages file with my %include statement in the kickstart file, and copied the RPM's to the RH linux/Packages directory, however these packages don't get installed. I read something about comps.xml but dont have that file in the RHEL distribution, or know what the procedure is.
Essentially I have a package list which I include like this:
# cat packages.txt
openssh-clients
openssh-server
afio-2.5-1.rhel6.x86_64.rpm
buffer-1.19-4.rhel6.x86_64.rpm
mindi-2.1.7-1.rhel6.x86_64.rpm
mindi-busybox-1.18.5-3.rhel6.x86_64.rpm
mondo-3.0.4-1.rhel6.x86_64.rpm
All the rpms from afio down are custom ones not part of the RH installation.
Could someone tell me how this can be done?
thanks
All kickstart files should have a section near the top where they define available repos. An example repo line would look like this:
repo --name=a-base --baseurl=http://mirror.centos.org/centos/6/os/$basearch
This tells the kickstart system that there is a usable rpm repo at the given url
In order to add your own rpms you need to create a custom repo and point your kickstart files to it by adding a new repo line. Then you can list the core rpm package names in your %packages directive and they will be picked up.
So for you it would be something like:
...
repo --name=a-base --baseurl=http://my.domain.org/customrepo/path/here
%packages
openssh-clients
openssh-server
afio
buffer
mindi
mindi-busybox
mondo
...