I installed Twig, it works well - however, I chose a different method of install:
curl -s getcomposer.org/installer | php -d detect_unicode=Off
and everything is in vendor/Twig directory.
However, what I'm wondering is, can you install extensions for Twig via yml without using Symfony - mine is a plain Composer-downloaded Twig install?
I was considering installing this extension but can't figure out how to get the path() function to work - I checked on Google (only related to Symfony) and little in Twig's manual - so what should I do - my simple PDO/PHP/MySQL list of employees [test data] works but I am trying to paginate this.
Any help is appreciated!
Related
I am getting this Argument list too long error whenever, I run any command in VS code.
All commands are working in the Linux default terminal but nothing is working in VS code terminal.
Here is the error-
I read a few solutions but I didn't understand all of them. Those are:
Remove the entire directory and recreate it.
How this can be a solution because this error is happening in all projects. Would I remove all project directories and recreate them?
Mass delete files using the find method?
My all projects are cloned from git. Even if I delete all files of a project then to recreate them, I need to re-clone which I tried, and that is not working.
Change the limit using the command - ulimit -s <any_number_greater_than_current_limit>
It didn't work.
I checked my max limit of arguments, using those two commands-
What am I doing wrong or misunderstood?
As I mentioned in the question, I tried several ways which didn't work for me.
In my case, I checked the .bashrc file and found that the PATH variable was exported almost 10000+ times like that-
export PATH="$PATH:$HOME/.composer/vendor/bin/
export PATH="$PATH:$HOME/.composer/vendor/bin/
export PATH="$PATH:$HOME/.composer/vendor/bin/
export PATH="$PATH:$HOME/.composer/vendor/bin/
...
...
...
That is what consumed the space and make the memory full to run any further commands even with 0 arguments.
I removed all and added the following script to define PATH only when not added already.
[[ $PATH =~ (^|.*:)"$HOME/.composer/vendor/bin"($|:.*) ]] || PATH=$PATH:$HOME/.composer/vendor/bin
I reload the shell then and it worked.
Thanks, #CharlesDuffy for your suggestions.
I have installed 2 PHP version in my DirectAdmin environment: php5.5 (php1_release) and php7.1 (php2_release). Now I have one user set to php 7.1 with the PHP Versions Selector under Domain Setup. On the website in the browser it seems to work well, phpinfo tells me that php7.1 is running for this domain. But when I use composer from the command line it gives an error because it detects php5.5:
Any ideas how to solve this?
Try compiling with the full path of the php binary - "/usr/local/php70/bin/php70" - instead of just "php". Now command will be like that.
/usr/local/php70/bin/php70 composer.phar update
Important note : PHP binary Path will be different for each server.
As a workaround for a problem that I face when deploying code using central version control throughout various sites in the company I work, I need, in all sites, to run Ruby from (say):
#!/foo1/bin/ruby -w
However, in just 1 location, ude to an I.T. issue, which may or may not be resolved, I need to use (say):
#!/foo2/bin/ruby -w
This needs to work for ALL users in ALL sites, and I cannot enforce the setup of environment variables. One can of course, use a bash script to split the 2, (a bash script calling either of the locations), but I was hoping for just 1 process, and 1 script. Any ideas?
There are many options to solve that but the simples that I'm familair with is:
Make sure that ruby is accesible by the PATH environment variable.
Instad of using the full path to ruby you can use the /bin/env command that comes in all Linux bundles:
#!/bin/env ruby
I'm new to Play framework. Please explain the meaning of the below warning.
Warning: node.js detection failed, sbt will use the Rhino based Trireme JavaScript engine instead to run JavaScript assets compilation, which in some cases may be orders of magnitude slower than using node.js
I don't want anything that slow down my application so please advice if I should change the JS Engine to Node.js, but my PlayFramework project is using Java on the server side.
You need to install Node.js and then tell the sbt/java engine to use it.
brew install node
Edit .bash_profile and add:
export SBT_OPTS="${SBT_OPTS} -Dsbt.jse.engineType=Node -Dsbt.jse.command=$(which node)"
This eliminated the warning for me on OSX
In Windows:
Install node.js
Go to Control Panel - System and Security - System - Advanced system settings
Click Environment Variables...
Search in System variables for SBT_OPTS
If such exists, click Edit... and concatenate -Dsbt.jse.engineType=Node to Variable value
If such does NOT exist, click New... and write SBT_OPTS to Variable name and -Dsbt.jse.engineType=Node to Variable value
Click OK - OK - OK
Restart any command prompt (cmd, PowerShell) that is currently running Play Framework
in ubuntu
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y nodejs
then add as above to your .profile in your home directory
export SBT_OPTS="${SBT_OPTS} -Dsbt.jse.engineType=Node -Dsbt.jse.command=$(which node)"
then
. ./.profile
to reload your .profile
For a more flexible install using node version manager check the following tutorial:
how to install node js on an ubuntu 14.04 server
Build again and the warning about using the Trireme stuff should be gone.
As an alternative to setting the environment variable, you can add this line to your build.sbt file:
JsEngineKeys.engineType := JsEngineKeys.EngineType.Node
See: https://github.com/sbt/sbt-js-engine
sbt plugins requiring a JS engine are used only in the build process, and so missing Node.js only slows down assets building stages if you use any.
The built application is not affected.
Anyway, you may want to install node.js to your PATH, where it should be auto-detected.
in Windows 10:
Install node.js from https://nodejs.org/en/
(The installer automatically adds node.js to your PATH)
then add:
export SBT_OPTS="$SBT_OPTS -Dsbt.jse.engineType=Node"
to your plugins.sbt in
. ./project/plugins.sbt
Worked for me - the warning has disappeared!
EDIT:
Apparently plugins.sbt was the wrong place to add the
export SBT_OPTS="$SBT_OPTS -Dsbt.jse.engineType=Node"
...although the warning disappeared when loading my app, it led to an error when relaunching the app a couple of hours later:
error: not found: value export
I would be glad if anyone could help and tell me where to put the export.
I have a node.js project and I am using I18next to localize it, with the gettext http://i18next.com/node/pages/doc_init.html#gettext backend.
My template engine i am using with this project is https://github.com/bminer/node-blade which is similar to jade.
Then I use the https://www.npmjs.org/package/i18next-parser library with i18next -r -o ../tmp -l en command to extract all the msgid's and create a dev.json file.
Once this is done, i use i18next-conv -l en -s ../dev.json -t dev.po to convert this to a gettext format.
From this I would create a fr.po file and then get this translated to french, as an example.
So far this process works fine, the question is, how best to keep all the msgid's should for example, I need to add new strings to the catalog and then merge these into the fr.po file without loosing any strings which have already been translated?
any advice much appreciated.