Failing to install moodle plugin - plugins

I am new to moodle I created a new plugin and now I am trying to install it.
I get this error:
Plugin "admin_report" is installed in incorrect location "$CFG->dirroot/admin/tool/bbb", expected location is ""
What am I missing?

You need to make sure that your plugin's version.php correctly declares the component - in this case (based on your install location) it would be:
$version->component = "tool_bbb";
See https://docs.moodle.org/dev/version.php for more details.

Related

How do you install a specific package version with Spago?

With tools like npm we can install a specific version
npm install foo#1.2.0
How do you install a specific version using spago install?
Firstly, that's not what spago install does. Instead of "adding a package to your project", spago install downloads all packages that are currently referenced in your spago.dhall file.
Secondly, the idea with Spago is that you don't choose a specific package version. Instead what you choose is a "snapshot", which is a collection of certain versions of all available packages that are guaranteed to compile and work together. This is a measure intended to prevent version conflicts and versioning hell (and this is similar to how Haskell stack works)
The snapshot is defined in your packages.dhall file, and then you specify the specific packages that you want to use in spago.dhall. The version for each package comes from the snapshot.
But if you really need to install a very specific version of a package, and you really know what you're doing, then you can modify the snapshot itself, which is described in packages.dhall.
By default your packages.dhall file might look something like this:
let upstream =
https://raw.githubusercontent.com/purescript/package-sets/psc-0.13.5-20200103/src/packages.dhall sha256:0a6051982fb4eedb72fbe5ca4282259719b7b9b525a4dda60367f98079132f30
let additions = {=}
let overrides = {=}
in upstream // additions // overrides
This is the default template that you get after running spago new.
In order to override the version for a specific package, add it to the overrides map like this:
let overrides =
{ foo =
upstream.foo // { version = "v1.2.0" }
}
And then run spago install. Spago should pull in version 1.2.0 of the foo package for you.

PHP Fatal error: Class 'RemoteWebElement' not found in

I have a symfony project that run normal in command line:
php app/console server:run
But, I want to run inside PhpStorm. When I try to do this, it gives the fatal error:
PHP Fatal error: Class 'RemoteWebElement' not found in
I already tried to look the oficial documentation of the classe:
http://facebook.github.io/php-webdriver/classes/RemoteWebElement.html. But I didn't found information that culd help me.
I also added the compose dependency:
composer require facebook/webdriver
But had no effect!
=======================================
I'll explain step-step how to get this the bug (It will be very long!):
I have:
PHP 5.5.9
PhpStorm 10.0.3
composer 1.0-dev (7117a5775ffdcdfd31bbd52a138a6f9c65e7e3c2) 2016-02-03
So, create a new symfony project (current version 3.0) and add composer dependencies:
symfony new project
cd project
composer update
Then, open this project inside of phpstorm and I configure settings for to run the project:
Settings -> Languages & Frameworks -> PHP
"PHP language level": 5.5
"Interpreter": 5.5.9
Add through plus(+) the PHP folder:
/usr/share/php
Click 'OK'
Now, try to run de project through PhpStorm by the shortcut:
Ctrl+Shif+F10.
Will appear the bug:
PHP Fatal error: Class
'Symfony\Bundle\FrameworkBundle\Test\WebTestCase' not found in
Solve this by this way inside of PhpStorm:
Settings -> Languages & Frameworks -> PHP -> PHPUnit
Choose: "Use custom autoloader"
And, in the field "Path to script", informe the autoloader's address. For example:
/home/murilo/git/slu/app/autoload.php. Click 'OK'.
Again, try to run de project through PhpStorm by the shortcut:
Ctrl+Shif+F10
Will appear the bug:
PHP Fatal error: Class 'Doctrine\Tests\Common\Cache\CacheTest' not
found in
Solve this through this command inside the project folder:
composer require maslosoft/cachetest:dev-master -n --no-progress
For the last time, try to run de project through PhpStorm by the shortcut:
Ctrl+Shif+F10
Will appear the bug:
PHP Fatal error: Class 'RemoteWebElement' not found in
I'm at this bug.
Please, someone knows how I can overcome this bug? o.O
I struggled with the same exact issue as you have described. After breaking my head for most of the day with this problem, I found the issue.
When you execute the command php app/console server:run in command line, it sets up a server and runs the website. However, when you run the project in PHPStorm, it doesn't actually run it as a server but runs it as a PHPUnit. What you need to do is configure a PHP Web Application in PHPStorm and run that.
Check the image below where I have configured the website. When I run the Web Application, it will run by the url and it will show up in your browser.

Composer cannot find package for a Symfony2 bundle

I'm creating a Symfony2 bundle hosted on GitHub. I suppose that everything is configured well! However, when I try to install it something goes wrong.
Here follows a summary of the key info.
First, in my Symfony2 app I update the composer.json as follows:
"require": {
...,
"bundle-name": "dev-master"
},
When I try to install the bundle through the command php composer.phar update, I get the following error:
Loading composer repositories with package information
Installing dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package bundle-name could
not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according
to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion>
for more details.
Any idea?
You have to add repository for "bundle-name".
I couldn't find it on packagist, so register it first.

Symfony2 : How to make the php_intl extension available for Symfony2?

I'm trying to follow this documentation on Symfony : http://symfony.com/doc/current/book/forms.html
ok so here is my thing, I've externalised my form and created a specific form class for handling the process and being able to reuse it.
So what happen when I submit the form, whatever the info are okay or not for my class, I get this fatal Error :
Fatal error: Call to a member function setAttribute() on a non-object
in C:\Program Files
(x86)\wamp\www\QNetworks\vendor\symfony\src\Symfony\Component\Form\Extension\Core\DataTransformer\NumberToLocalizedStringTransformer.php
on line 130 Call Stack
I'm running with php 5.3.9 and my intl extension is installed and activated BUT when I run the app/check.php command I see :
[[WARNING]] Checking that the intl extension is available: FAILED
* Install and enable the intl extension (used for validators) *
So I don't understand what the problem with this extension. Should I reinstall it ?
When I go here : http://php.net/manual/en/intl.requirements.php
I see tht i can install the PECL or the ICU library, but i don't know if I should and if there is any relation with my problem ..
Your Intl extention must be configured propertly.
Check on your server if this really activated using phpinfo()
then on your php.ini activate logging:
[intl]
intl.error_level = E_WARNING
extension=php_intl.dll
and check logs
If it's activated maybe it's a malfunction. Try to redownload the dll into c:\PHP\ext\php_intl.dll
take care you have two php.ini :
*wamp\bin\php\php5.3.13
*wamp\bin\apache\apache2.2.22\bin
you should uncomment extension=php_intl.dll in both.
After enable intl extension, you need copy some files to apache bin directory. It could help you: http://www.youtube.com/watch?v=gtIcpdPzXiE

Problem with p2.inf file when building eclipse product

I have an eclipse product that depends on a feature. Now I would like to be able to update this feature. I would also like to be able to start the application with a predefined update site. I have created a p2.inf file which contains (based on: http://aniefer.blogspot.com/2009/07/composing-and-updating-custom-eclipse.html):
requires.0.name = com.application.feature.group
requires.0.range = [1.0.0.qualifier, 2.0.0.qualifier)
instructions.configure=\
addRepository(type:0,location:https${#58}//ccp.com/);\
addRepository(type:1,location:https${#58}//ccp.com/);
But the updatesite ccp.com does not shown when I go to the install manager in the build product (it works fine if I remove the 'requires' commands).
Are there anything wrong with the above p2.inf file?
I have now tried:
requires.0.namespace=org.eclipse.equinox.p2.iu
requires.0.name = com.application.feature.group
requires.0.range = [1.0.0.qualifier, 2.0.0.qualifier)
instructions.configure=\
addRepository(type:0,location:https${#58}//ccp.com/);\
addRepository(type:1,location:https${#58}//ccp.com/);
but when I build it I get the error:
Cannot complete the install because one or more required items could not be found.
Software being installed:
MyProduct 1.0.0.201102161136 (com.application.product 1.0.0.201102161136) Missing requirement:
MyProduct 1.0.0.201102161136 (com.application.product 1.0.0.201102161136) requires 'com.application.feature.group [1.0.0.qualifier,2.0.0.qualifier)'
but it could not be found
Application failed, log file location: ...
I have also tried to remove the qualifier from the p2.inf file in the version range and on my feature, but get the same error. Any ideas?
Try adding
requires.0.namespace=org.eclipse.equinox.p2.iu
I suspect that not specifying the namespace leaves it as null in the p2.inf parser, eventually leading to an assertion failure on a Assert.isNotNull(namespace), or an NPE. Either of these would probably cause the entire p2.inf file to be ignored.
I found that I needed to use the p2.context.repos option to pass in the repositories containing the items referred to in p2.inf. Using this and pluginPath in tandem was the key.