Symfony 2.1 - %kernel.debug% does not exist - symfony

I've inherited an old Symfony 2.1 project and having issues getting it up and running - I don't really have the time or budget to go through and upgrade it to something a bit more modern.
When trying to run php app/console I get the following error message:
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
The service definition "kernel.debug" does not exist.
I've been going round in circles trying to find the cause but can't seem to resolve it - any pointers or help would be great.

Try grep -r 'kernel.debug' app/ to locate where it's being used. Make sure that the provided code was working with a supplied vendor/ directory, or you have the result of running composer install nowadays. You can even rename the vendor/ directory (as a kind of quick backup, regardless any other you may have) and run composer install to get rid of other possible inconsistencies.

Turns out it was a large amount of incompatible packages in my composer.json - some of the original packages were looking for alpha and dev builds as the project was cutting edge, 5 years ago. Now pulling alphas and betas broke loads of things. Went through npm to build a set of compatible packages from what I had and it worked.

Related

Trouble Installing Certain Modules

I'm having issues getting some modules to install. I've been able to get mod-1v1-arena and mod-npc-free-professions working, but I haven't been able to get these other modules to work:
mod-new-character-perks
mod-learn-spells
mod-quick-teleport
Can someone please confirm I have the correct workflow, or advise on what steps I'm missing.
Clone module folder from git to .\azerothcore-wotlk\modules
Run Git CLI: ./acore.sh docker build
Copy mod_learnspells.conf to .\azerothcore-wotlk\env\docker\etc\modules
I see instructions about rebuilding with CMake, is that necessary if I'm using docker build...? I tried CMake too and I got an error immediately with the software setup, so haven't pursued it further.
I'm also a bit confused by the .conf files, which folder does the server read them from?
.\azerothcore-wotlk\env\docker\etc\modules or .\azerothcore-wotlk\modules\mod-learn-spells\conf
I would try to install without any modules to check for the core stability and then work up from there one by one.
This way, if there's a module that's currently not working due to recent PR's like the Autobalance and possibly mod-learn-spells you can report an issue and work without it until It's back up.
AzerothCore Continuous Integration build with modules is currently failing aswell if you check the Readme notes where it says

Codeception/Symfony4 Environment variable not found: "DATABASE_URL"

I have a project in Symfony4 with doctrine DB, everything flies.
I would like to add some functional and unit testing with Codeception. I followed the docs and added this to my functional.suite.yml:
actor: FunctionalTester
modules:
enabled:
- Symfony:
app_path: 'src'
environment: 'test'
- Doctrine2:
depends: Symfony
# cleanup: true
- \Helper\Functional
# - Db
step_decorators: ~
However, when running vendor/bin/codecept run I get an ugly:
In EnvVarProcessor.php line 131:
Environment variable not found: "DATABASE_URL".
I can't see anything else related in the docs, so not sure what I'm missing.
Does your codeception.yml configuration file have this section:
params:
- .env
- .env.test
- ...
If it has, you need to check the last .env file on the list and make sure that it has the DATABASE_URL variable set.
The other solution is that you remove every file from the list except the .env your app is using. (I don't suggest it)
When each file from this list loads, it overrides the variables that are present in the previous file.
I can't unfortunately explain the mechanisms behind it, but to resolve it I had to add DATABASE_URL environment variable to my OS.
export DATABASE_URL='mysql: ...';
This seemed very weird solution to me (which, again, I have no idea why Codeception would require this), so I kept digging. Something I discovered later, but seems actually cause the whole situation is how I installed Codeception. If you go to codeception docs you can read:
If you don't plan to do acceptance testing, you can get minimal installation of Codeception by requiring codeception/base
EDIT July 2020: Information about minimal install was removed from the linked website, looks like Codeception doesn't provide that option anymore.
This was how I had it installed. After playing around a lot I pulled a version of my code before codeception and installed using composer require codeception/codeception --dev (so the full version). After installing this way I had no issues.

Reinstall Active Meteor Project

Background
I suddenly started getting a Meteor error:
~/.meteor/packages/meteor-tool/.1.4.0-1.1b1o7uq++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/bin/darwin-x64-v8-4.5/fibers.node is missing. Try reinstalling node-fibers?`
After extensive searching, I came to the conclusion that there isn't a known, straight-forward solution to this problem.
Possible Solution
I created a new Meteor project and that works. This is because it is at the latest version of Meteor, and fibers.node is properly installed in the 1.6 (latest version) directory.
The best solution looks to be removing my live project directory and recreating it with the same name (at Meteor's latest version) and then retrieving all the packages, settings and files (HTML, JS, CSS)
Question
What is the best way to do this so that:
I preserve all the packages that I have installed (there are many)
I preserve all the custom settings that have changed from default
I am able to bring all my files (I am assuming this will be simple copy of *.html, *.css and *.js from the original project)
I was able to resolve the error:
~/.meteor/packages/meteor-tool/.1.4.0-1.1b1o7uq++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/bin/darwin-x64-v8-4.5/fibers.node is missing. Try reinstalling node-fibers?
so did not need to go down the reinstalling project path.
I followed the steps in the accepted answer on this thread:
How can I completely uninstall and then reinstall Meteor.js?
Specifically:
mv .meteor .meteor.bak
sudo rm /usr/local/bin/meteor
sudo chown -R $(whoami) ~/.npm/
curl https://install.meteor.com/ | sh
meteor --version -> This will pull the required package for the version your project is at.

How to install vendor bundle WITHOUT composer (corporate network)

First of all, I can't use composer because Im under a corporate network. I tried everything to get composer working :
HTTP_PROXY, HTTPS_PROXY, HTTPS_FULLURI ... Nothing is working. Composer diag gives an OK status for http packagist but FAILS for https connectivity. The error it gives me is:
SSL : Handshake timed out.
But that's not my question, I spent to much time trying to get composer working (But if you got a solution, you'll make my day )
My real question is the following : How to install bundles manually
I want to install this bundle : http://knpbundles.com/pierredup/MenuBundle.
What I did to try installing the bundle :
Registering the bundle in appKernel.php :
new \CS\MenuBundle\CSMenuBundle()
Tried to add it in the autoload.php :
$loader->add('CS', __ DIR __.'/../vendor/CS/CSMenuBundle.php');
(Dont know how to add php code properly ... )
But it doesn't work, got the following error :
Attempted to load class "CSMenuBundle" from namespace "CS\MenuBundle".
Did you forget a "use" statement for another namespace?
And then, even if it is not a good practise, I tried to add it to autoload_namespaces.php and did a dump-autoload after that :
'CS\MenuBundle' => array($vendorDir. '/CS/')
I still have an error, but not exactly the same one :
Attempted to load class "CSMenuBundle" from namespace "CS\MenuBundle".
Did you forget a "use" statement for "CS\MenuBundle\CSMenuBundle"?
Now I'm a bit frustrating, I saw many posts (not on Stack) where people scream because we have to use composer to manage dependencies. I totally agree with that, but I can't, so I'm trying to find another way, and as I can't find any clear tutorial which explains how to install vendors without composer, here I am.
Note that I commented on the problems I see with your approach on your question directly.
However, I looked at the package you want to use to see if there would be ANY chance installing it somehow (preferring Composer). I don't think it is possible or feasible.
composer require customscripts/menubundle:dev-master - this would be the easy command for Composer to do everything. However there are problems:
The package you want to use is not registered on packagist.org, so there is no way to simply use Composer on a machine properly connected to the internet, grab the packages, zip them and transfer them to the place you need it.
To work around this, you'd manually add the repository to the composer.json file - this might actually work (however it takes way too much time on my VM). You'll end up with code that was last edited in the year 2012!
The dependencies of that code will likely not work anymore. The composer.json of that package lists "require": {"knplabs/knp-menu-bundle": "dev-master", "symfony/framework-bundle": ">=2.0,<2.3-dev", "jms/di-extra-bundle": "1.1.*"} - even the first "knplabs/knp-menu-bundle" will never work. Remember that the code of this package is from 2012 - now we are in 2016, so "knp-menu-bundle" has seen four years of development on the master branch. There simply is NO WAY of knowing which commit had been used of this package. You'd have to reverse-engineer this lost information.
Additionally, you see why Composer is awesome and doing it manually is bad: In addition to your wished package, you have to download the three additional packages mentioned here.
But detecting packages that have to be added is a recursive task: knp-menu-bundle has a dependency on knp-menu (with no further dependencies) and symfony/framework-bundle (already added). symfony/framework-bundle itself has a dependency on 9 more Symfony packages and doctrine/common... and so on. You have to detect every single package of this and download the correct version manually if you cannot use Composer.
Skipping your original package because that installation wasn't finishing while I was typing my answer, I tried to install knp-menu-bundle to see how many packages would be installed. Composer installed 20 packages, some of them using Symfony in 2.8 (it SHOULD be compatible with Symfony 2.2 stuff, shouldn't it) - and I simply ran composer require knplabs/knp-menu-bundle:1.1.1 to grab a similarly old version of knp-menu-bundle from 2012.
The strength of using Composer is that it supports rapid development by allowing updating quickly, downgrading reliably (if you commit your composer.lock file and always use tagged versions), and simply allowing to add new packages instantly. Not being able to use Composer is a very severe limitation for you as a PHP developer. Talk to your boss or team lead about your company's situation with the HTTPS proxy, and find a solution to use Composer. The alternative is to develop everything from scratch on your own or waste plenty of hours trying to fiddle with manual downloads that don't fit together easily.

Symfony 2.0 bundle installation

So I am a new to doctrine, but I am not able to install a bundle at all. I am following the guide, but the "error" which I am getting is very unusual.
Anyhow, I add this lines into deps file:
[FOSRestBundle]
git=http://github.com/FriendsOfSymfony/FOSRestBundle.git
target=bundles/FOS/RestBundle
Then I do:
./bin/vendors install
And I get:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/sqlite.so' - /usr/lib/php5/20090626+lfs/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
Your project seems to be based on a Standard Edition that includes vendors.
Try to run ./bin/vendors install --reinstall
So on this standard way I am not able to install it at all. Can somebody explain me what is the problem, because to me it looks like, the symfony vendors script doesnt recognize changes in deps file at all.
This happens when you've downloaded the Symfony2 Standard Edition from the website. The vendor install script checks to see if the vendor directories are git repositories, and if not, will throw this error. You can fix the situation in one of two ways:
you can either run the command that it suggests: php bin/vendors install --reinstall
or, you can remove the vendors directory, then run php bin/vendors install, which amounts to about the same thing
No need to install that. Just follow the steps in the url : http://mmoreramerino.github.com/GearmanBundle/installation.html

Resources