ZEND2 project not working after cloned to separate machine - zend-framework2

I have cloned my office colleague's zend2 project from our server. He used zfcuser, zfcbase, and zfcadmin. But when I tried to run the project in my local machine its giving
<b>Fatal error</b>: Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException'
with message 'Module (ZfcBase) could not be initialized.' in C:\xampp\htdocs\coolshop
\vendor\ZF2\library\Zend\ModuleManager\ModuleManager.php:140
Everything is fine to me as the same project 100% working in my colleague's machine. I tried the composer as well. But no luck

This is a result of loading the ZfcBase module as a git submodule. If you fix this module you'll receive the same error for other modules or dependencies you're using in that manner. I've encountered this problem when someone tries to clone the project on a new machine or you delete the project locally and try to re-clone it.
The simple answer here is to use composer as your dependency manager, you'll have a better day. Head over to ZfcBase on Packagist and copy the require statement into your composer.json file (You'll need to run the composer script after saving your .json file). Most modules should have instructions on using composer to grab them in the README.
I should note that if you're using other modules that depend on ZfcBase, you'll likely just need to have a require statement for those, and not their dependencies (like ZfcBase).
Someone had a similar question regarding the ZfcUser module. Using composer solved his issue.

Related

How do I set up a new ejabberd server?

I'm trying to figure out how to properly setup an ejabberd project that allows for easy compilation of custom beam files- so far, we've been using an existing project that is cumbersome to manage, and uses erlide as the IDE.
I would like to set up the project in a way that I can use a more helpful IDE like vscode, and somehow streamline the compiling and copying of the beam files and updating the module on the server.
Writing code in Elixir is fine as well- I just want the project to be set up in a way that is dev friendly.
Apologies if the question is too broad, but I'm not exactly sure how else to best phrase it. If you feel like I'm missing something in my current flow, please let me know, as I've basically inherited this project. If there are any clarifications required, let me know as well.
Thanks.
easy compilation of custom beam files
somehow streamline the compiling and copying of the beam files and updating the module on the server.
If the task is about compiling and loading additional modules, a running ejabberd node can compile, load and start additional modules in runtime, see
https://docs.ejabberd.im/developer/extending-ejabberd/modules/#ejabberd-contrib
Usually the modules come from
https://github.com/processone/ejabberd-contrib
but you can tell ejabberd to download other modules from other git repositories, or you can copy modules source code and tell ejabberd to install them. And those modules can be written in Erlang or Elixir. Full example: https://docs.ejabberd.im/developer/extending-ejabberd/elixir/#elixir-module-in-ejabberd-contrib
Basically:
you write the module in your development machine, test it...
when happy with the source code, copy mod_whatever.erl to the production machine, $HOME/.ejabberd-modules/sources/mod_whatever as explained in the example mentioned earlier
run ejabberdctl module_install mod_whatever
In step 2, instead of copying the source code yourself, you can have a git repository just for your module, tell ejabberd the module's git URL, similarly to https://github.com/processone/ejabberd-contrib/tree/master/extra
BTW, for step 3, starting in ejabberd 22.10, there's a page in ejabberd webadmin to install and uninstall those modules (copying the files requires manual administration of course).
I would like to set up the project in a way that I can use a more helpful IDE like vscode
What a coincidence, these days I'm playing with VSCode variants (VSCode, VSCodium, Coder's code-server and Github Codespaces) and how to develop ejabberd using them. This is useful for step 1 that I mentioned earlier (write module and test it). If you are interested in ejabberd + VSCode, tell me.

Configuring Packer with Neovim

I'm trying to switch over my current setup for Neovim (using Vim Plug) to Packer and I'm having trouble.
My Neovim is loaded from ~/.config/nvim/init.lua which sources all of my plugin and other settings. They live mostly inside of a ~/lua folder (the "main Imports") section of my configuration, including my actual plug-plugins.lua file that references all of my plugins.
-- Main Imports
require("settings")
require("colors")
require("mappings")
require("functions")
require("autocommands")
require("plug-plugins")
...
Later in the same init.lua file, I'm sourcing plugin specific settings for all of these plugins. In order to get my directory working currently, I'm installing everything with :PlugInstall and it works fine.
...
-- Plugin-specific settings
require("plugin-settings/fzf")
require("plugin-settings/fugitive")
require("plugin-settings/ultisnips")
require("plugin-settings/coc")
require("plugin-settings/treesitter")
require("plugin-settings/miscellaneous")
require("plugin-settings/toggle-terminal")
Installing Packer
The installation steps for Packer are pretty sparse, and merely state that you should clone the repository to somewhere in your "packpath" but I'm not really clear what that means. When I'm inside Neovim, and I press :set packpath? I get the following paths:
packpath=~/.config/nvim,/etc/xdg/nvim,~/.local/share/nvim/site,/usr/local/share/nvim/site,/usr/share/nvim/site,/usr/local/Cellar/neovim/HEAD-b74916c_1/share/nvim/runtime,/usr/local/Cel
lar/neovim/HEAD-b74916c_1/lib/nvim,/usr/share/nvim/site/after,/usr/local/share/nvim/site/after,~/.local/share/nvim/site/after,/etc/xdg/nvim/after,~/.config/nvim/after
This makes me think that I'm able to just clone the respository to ~/.config/nvim which is the first path listed. I'm not really sure what to do next though, or if this is even right.
Can anyone help? What are the basic steps to getting Packer installed (I'm on MacOS 11.6).
i did recently moved from vim-plug to packer, as per docs when you do git clone of the repo the path provided in readme for installation is ~/.local/share/nvim/site/pack/packer.After successful clone you can start using packer in your plugins.lua as below.
return require('packer').startup(function()
use 'wbthomason/packer.nvim'
end)
you can check the installation by running :PackerSync this will fetch (git clone) the plugin in to the packerpath which is ~/.local/share/nvim/site/pack/packer
Hope this is what you looking for?
I had the exact same situation and it turned out to just be a naming conflict. I had named my local nvim config file lua/packer.lua and changing that fixed the issue.

Is it possible to avoid updating drupal core with composer update?

I'm trying to build a docker container where the dockerfile installs a specific version of drupal, I copy over custom copies of composer.json/composer.lock and then do a composer update to download the contributed modules specified in these composer files. I know that ideally composer would also control core, but for this project, I'm trying to avoid that.
The problem I'm having is that composer update seems to also reinstall drupal, where I want the dockerfile to be in control of this and I'd like composer to just manage the modules.
Is this something I could do by modifying the composer files (so far tests have not worked)? It seems you can't specify a package for composer to ignore and where I see you can specify specific packages to update, that's not really a viable solution for this.
Thanks
OK, it's looking like the issue was the composer.lock/json files I was adding to run composer update were initially created by using composer create-project drupal-composer/drupal-project, which installed core and thus added it to the composer.lock/json files.
It seems that by just reinstalling the contributed modules with composer in a fresh drupal site (so simplified composer files) might be the answer.

Undefined is not an object (evaluating RNRandomBytes.seed)

Long story short, I'm trying to develop an iOS app using React-Native for the front-end and MySQL for the back.
After installing the mysql module and install rn-nodeify, I wastold that I'm missing module A. After installing module A and reloading, I am missing B. After B, then C, etc etc etc. After getting past the modules, I get this error:
undefined is not an object (evaluating RNRandomBytes.seed)
Then, I installed RNPM and ran "rnpm link. Now, my app will not build and shows this error.
Am I doing something that is just fundamentally wrong, or is it this much of a pain to install the mysql module?
This also happened to me when I tried PostgreSQL.
Am I doing something that is just fundamentally wrong, or is it this much of a pain to install the mysql module? (This also happened to me when I tried PostgreSQL)
Maybe. React Native should be though of as purely client code. Similarly to how you would separate your web code from backend code.
The MySQL node module is designed to run in Node. Node is separate environment. Generally you can use one package.json file and one node_modules directory for both your server side and client code. As long as your careful not to import server code, i.e. code designed to run in node, into your client code.
Sometimes you run into versioning problems and it's best to have a separate directory with separate package.json file for the server code.
If I still don't understand your setup. Please update your question to include your directory structure, where you're calling the mysql module, and how you are running that script.
So it looks like I was doing something very fundamentally wrong. I was completely missing the middleman that is a backend server (lol). I have set up an Express server to interact with the database and have gotten it working.

Delphi distributed building failure

I've created a tiny project [0] to reproduce an error in a controlled environment. The facts, I'm using jenkins to build my project, a big one, I'd like to make some parallel builds. Let me make it graphically
[MyBasicPackage] -----> [MyPackageTester] ------> [MyBasicApp]
.
.
+-----> [...]
+-----> [...]
this is the organization I've made on [0], I have a class TMyUnit (MyBasicPackage) registered on spring container to be tested. I build it and generate its .dcu, .bpl, and so on.
The second stage I build my MyPackageTester that requires MyBasicPackage. Finally I build the app that requires MyPackageTester. So far so good.
When I try to build my MyBasicPackage on, say PC-00, get the artifacts and try to build the the MyPackageTester on PC-06 (same arch, same OS, same IDE, same spring4d version), and a nice error arise:
Unit TMyUnit was compiled with a different version of Spring.Container.Registration
so, I update my spring4d on both machines (PC-00 and PC-06) and build them. Run... and same error arise.
check the library path options (C:\Program Files (x86)\Embarcadero\Studio\14.0\Componentes\spring4d\Library\DelphiXE6\Win32\Debug), delete dcu files and build them once again on both machines, same error.
copy dcu files from PC-00 to PC-06 to avoid any kind of system configuration and the same error arise.
Probably I'm trying to do something that's not possible so far. I've googled a couple of days without luck.
Any ideas?
Please feel free to fork or pull request the example ;)
Regards
[0] https://github.com/graguirre/DelphiDepencyExample
In your case you need to build with the Spring.Core runtime package. Not only will that prevent this error but your code will actually work.
If you do not then all modules will hold their own version of the GlobalContainer instance you are using and nothing will work.
Maybe one solution is put all your libraries in a centralized repository and pull them to compile your projects. It should resolve the different version error.

Resources