Include global partial from a Symfony 1.4 plugin - plugins

Is it possible to include a global partial from a Symfony 1.4 plugin from within a module? If so, how?
I know one can include a partial from a module from a plugin, but how to include a global template?
So suppose my Symfony application has the following file structure.
/config
/lib
/apps
/backend
/config
/modules
/aModule
/config
/templates
/aTemplateWithinAModule.php
/actions
/actions.class.php
/templates
/plugins
/examplePlugin
/lib
/config
/modules
/templates
/_aGlobalPluginPartial.php
How can I include the 'aGlobalPluginPartial' from within aTemplateWithinAModule.php?
I have tried:
include_partial('global/aGlobalPluginPartial')
include_partial('examplePlugin/global/aGlobalPluginPartial')
include_partial('examplePlugin/aGlobalPluginPartial')
So far none of the above work.
My plugin is enabled in the project configuration.

You should put it in a module.
/plugins
/examplePlugin
/lib
/config
/modules
/example
/templates
/_aGlobalPluginPartial.php
And then include it using:
include_partial('example/aGlobalPluginPartial');
Do not forget to enable the module example in your settings.yml file (in enabled_modules).

Related

doxygen using absolute file path instead of symlinked(original) path

When doxygen is generating a File List it will be using the absolute path of the included files instead of the symlinked (original) path and the generated output file list is a bit ugly because of the absolute path of the files.
I have tried to use FULL_PATH_NAMES and STRIP_FROM_PATH but I would need something like REPLACE_PATH_NAMES
I have a project with following structure:
/home/user/workspace/myproject
- src
- inc
- usercode
- src
- inc
- mylibs
- my_awsome_external_lib1 --> /home/user/workspace/somecoollib
- my_awsome_external_lib2 --> /home/user/workspace/wherever/lib2
- my_awsome_external_lib3 --> /home/user/wherever3/lib3
So for example a file in one of the libs:
/home/user/workspace/myproject/mylibs/my_awsome_external_lib1/src/source.c --> /home/user/workspace/somecoollib/src/source.c
Will be included as
somecoollib/src/source.c
instead of
my_awsome_external_lib1/src/source.c
I don't really want to refactor my directory structure or use hard links.
Anyone has any idea how can I solve this issue?
Thanks

Symfony4 Deployment with Encore

The current documentation says, that I only need the files under public/build, created with ./node_modules/.bin/encore production, when I want to deploy for production. But also to add public/build to git ignore. Do I have to copy the content of public/build manually?
In Symfony3 my deploy looked like that:
git pull
bin/php bin/console cache:clear --env=prod --no-debug
bin/php bin/console assets:install --env=prod
bin/php bin/console assetic:dump --env=prod --no-debug
FYI, Using assetic was the »old« way, and starting Symfony 2.8 Assetic is not included in the standard framework anymore (but you can still add it).
Regarding public/build you misunderstood it a bit - the actual source files should be somewhere else, for example in assets/css/app.scss and assets/js/app.js. Using Webpack Encore, running ./node_modules/.bin/encore production will minify, uglify, etc (whatever you configure in webpack.config.js) these source files and then copy the generated files to public/build. So public/build will only contain the generated stuff and thus can be safely added to .gitignore (but you also need to run the encore script in production).
Your JavaScript file (i.e. in this case app.js) should include
require('../css/app.scss');
so that the app.scss is actually a dependency of app.js and you only need to tell the webpack.config.js to include the JavaScript file. The basic configuration of webpack.config.js might look like this:
// webpack.config.js
var Encore = require('#symfony/webpack-encore');
Encore
// this will put all your compiled stuff into public/build, that’s
// why you can put this into .gitignore, because you can re-build this
// from the source files.
.setOutputPath('public/build/')
// the public path used by the web server to access the previous directory
.setPublicPath('/build')
// this will create public/build/app.js, and also public/build/app.css
// since the scss file is a dependency of app.js
.addEntry('app', './assets/js/app.js')
// allow sass/scss files to be processed
.enableSassLoader()
[...]
;
// export the final configuration
module.exports = Encore.getWebpackConfig();
You can find some more explanation under https://symfony.com/doc/current/frontend/encore/simple-example.html (first example) or https://symfony.com/doc/current/frontend.html (overview)

Play change default packaging system

I am on play 2.5.2
I know that the default packaging system do expect something like :
app/
controllers/
models/
views/
But I would like it to be :
app/
foo/
controllers/
models/
views/
How can I achieve this ?
Over there : https://www.playframework.com/documentation/2.5.x/Anatomy
They do say that :
Note that in Play, the controllers, models and views package name conventions are now just that and can be changed if needed (such as prefixing everything with com.yourcompany).
But that doesn't tell me how.
Thanks
You can just place your controllers, models and views in the desired package. No additional configuration is needed. When writing your routes file you will have to prefix the entries with the package though. So instead of writing
/foo controllers.FooController.bar()
You'll have to write:
/foo foo.controller.FooController.bar()

Gigaspaces: set directory with runtime dependecies for PUs

My processing units have runtime dependencies and if I put them into $GigaSpaces_root/lib/required then my PUs deploys fine.
But I'd like to keep GS root distr unattached (even owned by root) and put these libs into some other custom dir. But I can't find a way to configure GS to look for dependencies in my custom dir. PRE_CLASSPATH, CLASSPATH, POST_CLASSPATH don't help. Other useful variables are overwritten by setenv.sh on GS initialization. What I'v done:
strings -a /proc/{GSC_PID}/environ | grep tmp
POST_CLASSPATH=/tmp/lib
PRE_CLASSPATH=/tmp/lib
CLASSPATH=/tmp/lib
The question is how to configure GS to look for libraries in custom directory?
Solution is here: http://docs.gigaspaces.com/sbp/moving-into-production-checklist.html#runtime-files-location
export GSC_JAVA_OPTIONS="$GSC_JAVA_OPTIONS -Dcom.gs.pu-common=YOUR_DIR_FOR_LIB"

Custom deployment with sbt

I have a Scala application and i want to setup a deployment process result similar to one Akka sbt plugin gives, but i it requires project to be a microkernel. Sbt-assembly is a very cool plugin, but i want to have a free access to my config files, basically i want to have the following app structure:
/app/bin - start script bash file
/config - all my application .conf files
/deploy - my project .jar with classes
/lib - all my dependencies .jar files
/logs - log files
I we checked typesafe sbt-native-packager, it's better, but it could place my .conf file and logs out of jars. All those settings in SBT looks confusing to me, what can i do to with this?
Actually this is not hard to update akka-sbt-plugin to make it work in general, add this file to your project folder and somewhere in your build the following settings:
.settings(Distribution.distSettings: _*)
.settings(mappings in Compile in packageBin ~= { _.filter(!_._1.getName.endsWith(".conf")) })
The first line adds all dist settings to your project and the second one excludes all .conf files from your .jar and reads them from config folder.
Now you have to commands: dist - creates a folder with a structure you've discribed and zipDist which packs it all into .zip file, later you can add this to you publish setting:
addArtifact(Artifact(someName, "zip", "zip"), zipDist)