cakephp 2.0.4 DebugKit does nothing - cakephp-2.0

I can see that the DebugKit plugin is loaded by doing
debug (CakePlugin::loaded() );
echo CakePlugin::path('DebugKit');
but its not doing anything. I am not using scaffolding. Debug is set to 2. It is DebugKit v 2.0. Is there something else I am supposed to do that was left out of the documentation?
A weird thing is if I purposely put a syntax error in class DebugKitDebugger , un unstyled panel displays with the syntax error of course.

Debug kit looks for the body tag which I did not have in my default layouts

Related

react-i18next backendConnector: loading namespace failed failed parsing /locales/de-DE/

I'm using react i18next like described in the step by step guide https://react.i18next.com/latest/using-with-hooks
Everything works fine I think, but if I browse my site in Google Chrome I get the Warning
i18next::backendConnector: loading namespace nav for language de-DE failed failed parsing /locales/de-DE/nav.json to json
So there is no folder de-DE under locales, but when I create this folder the warning is gone.
In Firefox there is no warning, so in my opinion it's the way the browser submits the preferred locale of the user. (Chrome sends de-DE and FF sends de)
So I only want to have on folder for translations (locales/de)
Is it possible to avoid the Warnings?
Thanks in advance
I have searched the internet but does not found any solution
Looks like your configuration allows all languages,
Try to set the supportedLngs array to be ['de'], and enable the nonExplicitSupportedLngs option,
if true, will consider variants as supported when the main language is. E.g. en-US will be valid if en is in supportedLngs.
For more options, checkout docs

['type aliases' can only be used in a .ts file]

I use command react-native init "name project" then open vscode appear to have error message code. (image)
This is what you need to do with VS Code, observe the gif carefully
Steps to resolve error
1. Go to extension
2. Click on more (...) and select Show Built-in extension
3. Search "TypeScript and JavaScript Language Features" - yellow & blue icon
4. Click on Setting icon of extension and select Disable (workspace)
5. Click on Reload / Restart Required
If you are getting this in React Native its probably a known bug in VSCode, that when Google Flow (which competes with MS Typescript) is coded, shows errors erroneously mentioning Typescript.
Your current .js code is supposed to be preprocessed by Flow into another .js file with "proper" js.
So make sure Flow is installed and then disable the Typescript parsing support. Here's the official answer on the Flow installation webpage:
Set javascript.validate.enable option to false or completely disable
the built-in TypeScript extension for your project (see gif below)...
Otherwise, you may want to stay as is and just change your code as suggested by C2P1 on March 19, 2018 on the github issue 631
To disable the [js] parser (connected to Typescript),
In VSCode menu: File -> Preferences -> User settings, (or ctrl+,) and add the following line
"javascript.validate.enable": false,
This answer was completed after seeing Idan Dagan's answer (Not the accepted answer) here: js 'types' can only be used in a .ts file - Visual Studio Code using #ts-check
And here's an excellent albeit old page about setting up the react-native environment, from Hackernoon. (You also have the VSCode React-native-full plugin)
Just disable built-in extension for TypeScript in VSCode. On the VSCode Extensions choose "Show Built-in Extensions" and then search for "TypeScript and JavaScript Language Features", Click disable then reload the VSCode. It works for me
In VScode
Press
CTRL + SHIFT + P
Use this command
Open User Settings
copy and paste the next line in the search bar in settings
#ext:vscode.typescript-language-features
ready uncheck JavaScript validation
Helped me to resolve
To disable the [js] parser (connected to Typescript),
In VSCode menu: File -> Preferences -> User settings, (or ctrl+,) and add the following line
"javascript.validate.enable": false,
This is what you are looking for. Unfortunately I haven't Googled a proper solution but we have to disable some JS checking.
https://github.com/Microsoft/vscode-react-native/issues/631
I've solved this with a plugin for VSCode "Flow Language Support". It will control the errors of the code instead of the plug-in TS-JS (built-in plugin of VS Code). In Details of plugin, guides you how to disable the original plugin TS-JS VSCode.
instead of disabling Typescript and Javascript language features extension, you can go to the extension settings, find the option Javascript > Validate: Enable, and uncheck it to remove any warnings.

CakePHP cms tutorial missing Helpers

Just starting with CakePHP and started the cms tutorial.
Install and configure went fine, but when I get to load the site for the first time there is a missing HTML Helper error.
When checking the View/Helper directory, it is empty: so obviously not installed.
What do I need to do to get the Helpers installed?
The issue was incorrect code in the ctp file (a stray character), and I incorrectly read the Error message as a missing Helper.
Core Helper was not actually missing, I just needed to read the Directory to discover the difference between core helpers and application helpers :-/

PHPStorm plugin query

I have the following line of code in an AngularJS project
$scope.listOfServices = ([].concat(...arrayOfResults.map(item =>item.data.trainServices))).filter(item => item);
This code works perfectly, however PHPStorm is kicking off saying its full of errors and it expects a new line and so on. This means on the rare occasion I reformat my code as I had a late night coding and got messy, PHPStorm moves the code around and breaks it.
I have AngularJS plugins, JavaScript plugins etc. What plugin can I install to STOP PHPStorm thinking the above line is broken.
You are right!!!
myFunction(...iterableObj); = Spread-Operator - This should be supported by PHPStorm JavaScript syntax validator.
You may going to create a bug issue over here: youtrack.jetbrains.com. PHPStorm supports JavaScript highlight / syntax autfill / validations so there should be no need for a third party plugin.

Class 'SqlFormatter' is missing CAKEPHP 3 DebugKit

I've just installed the latest Debugkit from https://github.com/cakephp/debug_kit.
Everything is working. However, when I clicked on the "SQL Log", the CakePHP logo keeps spinning. I tried to debug by opening up the console.log and saw an 500 error. It shows the below.
Error: Class 'SqlFormatter' not found
File /Applications/MAMP/htdocs/App/vendor/cakephp/debug_kit/src/Template/Element/sql_log_panel.ctp
Line: 24
From my understanding, SqlFormatter class is not found in sql_log_panel.ctp. How can I add/declare the SqlFormatter class?
Just install it via composer, problem very likely solved then.
https://getcomposer.org/doc/00-intro.md
http://book.cakephp.org/3.0/en/installation.html#installing-cakephp
I highly recommend you to become familiar with composer, it is a standard tool for php developers for some time now. Composer will automatically install the dependencies for you.
Your second best option would be to download the SqlFormatter package manually from where ever it comes from and set your autoloading or include manually up.

Resources