PHP Minifier Plugin - plugins

I a, using code minimiser with net-beans since long time. Though I am succeeded with finding it for JS & CSS plug-ins. but few days back When I google for PHP Minimizer to protect whole of my code I came across this link http://customhost.com.ua/php-minify/ Is their any other plug-in or any other source to implement this to net-beans so I can minify and protect my code through single click. Is their any plug-in in development or already developed.

I don't think minify php will work
PHP is a server-side scripting language
so when it comes to client side it will displayed in html
you can't inspect php code both locally and hosted so what is need of minify php
as you mentioned above php minify
minify this
<?php
//process login form if submitted
$username = filter_input(INPUT_POST, 'username');
$password = filter_input(INPUT_POST, 'password');
echo $username;
echo $password;
?>
minifyed
<?php
$username=filter_input(INPUT_POST,'username');$password=filter_input(INPUT_POST,'password');echo $username;echo $password;?>
even after minify above php code will just display username and password

Related

How to integrate Facebook AccountKit with Parse Server

The new Facebook AccountKit, looks like a great way to add passwordless authentication to a mobile app.
Parse Server is fast becoming a de-facto choice for mobile back-ends.
Is adding AccountKit support underway somewhere with Parse Server? If so where? Where should I look or ask? (Yes, I've tried!)
Any suggestions for how to get started? E.g. is it possible to add to the existing oauth support in Parse Server?
Just trying to make sure that this doesn't exist somewhere obvious already and/or that efforts aren't underway before I jump in... (or, possibly, that this is just a dumb idea and that's why I can't find it!)
Sorry for being late
Yes its possible you can use a new parse server module called "parse-server-accountkit-auth"
In the parse-server-example folder run
npm install -S parse-server-accountkit-auth
This will make install this module in node_modules folder. Don't change anything in the module.
Edit the index.js file in parse-server-example and configure ParseServer with oauth, you can find this in parse server docs
Then use this code where you are defining your data (e.g in your index.js of parse-server-example)
oauth: {
accountkit: {
module: 'parse-server-accountkit-auth',
appSecret: 'YOUR_APP_SECRET'
},},
Hope this helps.

Embed CSRF token into Ember CLI application

I'm designing my new Ember CLI application. I gonna use Ember Simple Auth for authorisation. And I also need to use CSRF protection. I know how to inject the token to requests. The problem is how to embed the token to the application in a right way.
It is required the token to be generated on the backend side and to be embedded into the page. And it should be the same one that API uses to verify requests.
In my case API and Ember application would be served by the same web server (most likely Microsoft IIS, since API is build with .NET MVC). So the web server should generate the token and embed it somehow into the Ember application once its index file requested.
But Ember CLI generates static index.html file during its build process. And I see just two ways of embedding the token.
The first one is to parse Ember's index.html file on each request and embed CSRF token metatag to the proper place. I don't really like this way.
The second one is to make Ember CLI produce index.aspx instead of index.html during the build process. In this case web server would put the token automatically. I like this way better, but i'm not sure if it's possible. And if it is then how to do this?
Maybe, there is another better way? Any help and advices would be appreciated.
It is possible to implement your second idea. You need to specify options.outputPaths.app.html property of EmberApp in ember-cli-build.js:
const app = new EmberApp({
outputPaths: {
app: {
html: 'index.aspx'
}
}
});
Doing this will result in Ember CLI writing index.aspx instead of index.html to filesystem:
You can read more about configuring output paths of your Ember CLI application in user-guide.
You can also dig directly in Ember CLI's ember-app.js source code to see if you can adjust options more to your needs.
Is it possible to make it environment-dependent? It works perfectly
for production build. But it doesn't work for development since Ember
CLI can not serve .aspx files. So it would be nice to overwrite output
files for production builds only and use generic ones for development
and test environments.
You can achieve this by checking value of app.env. So, in ember-cli-build.js, instead of passing outputPaths as argument, use following technique:
const app = new EmberApp();
if (app.env === 'production') {
app.options.outputPaths.app.html = 'index.aspx';
}
This way you still get index.aspx in dist/ when building for production, but development and test environments' outputPaths options are untouched and live development/testing works.

How to compile Coffeescript in visual studio 2013 express?

I followed this,
Go download and install VS Web Essentials
Add a new Item to your project, pick CoffeeScript as the item type
Write your CoffeeScript code, when you build the project or Solution, it will create the JavaScript code.
But, it does not create any compiled JS file.
How can I compile coffeescript? Do I need to install node.js?
I haven't tried Web Essentials for VS yet because it's easier for me to just include the coffee-script.js file using a script tag and compile it using the browser. I also console.log the compiled JavaScript output to the browser to see what it is generating. Here are a few examples using this technique:
https://github.com/jabdal/coffee-script-examples
Remarkably, it will sometimes find errors in the resultant JavaScript and go to the line with the error.
I'm guessing you could then send the JS back to the server and save that to a JS file (along with a checksum of the original coffeescript file). Then instead of compiling next time, you could include the JS file that is on the server if it is the same version (compare checksum before compiling on client).
I've read somewhere there is a .NET implementation of JavaScript that might work with the coffeescript compiler so that you could compile on the server without having to use Node but I don't think it would hurt to offload it on the client. A nice way would be a runat="server" tag for script type="text/coffeescript" tag so that the server would replace the coffeescript tags with javascript tags along with the compiled code and also generate corresponding js files where there are coffee files.

SAPUI5 Local Installation

I am trying to install SAPUI5 on my local machine using XAMPP.
I copied the files to htdocs.
Starting localhost in Chrome I get the SAPUI5 SDK - Demo Kit Overview page.
After that I copied a sample code of the "HowTo in 20 seconds" code to notepad and saved it as HTML-Document.
Running this file in the browser only brings a white page.
I looked for the developer tools in Chrome and saw something like this:
"failed to preload 'sap.ui.core.library-preload': Not Found - sap.ui.ModuleSystem"
I hope you can help me fix this problem, so I can start with SAPUI5
Useful links regarding this topic, which I could recommend:
Describes how to run UI5 App locally: http://scn.sap.com/community/developer-center/front-end/blog/2014/01/13/ui5-mobile-splitapp-boilerplate
Describes to local Development with Eclipse: http://blog.mypro.de/2014/01/14/ui5-boilerplate-with-eclipse/
They both use the UI5 SplitApp Boilerplate from Github, which is an example app, with a base application structure: https://github.com/6of5/UI5SplitApp-Boilerplate
Perhaps this helps you to start local developement
Open a new notepad file. Save below code with html extension, eg: helloworld.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>SAPUI5 in 20 Seconds</title>
<!- 1.) Load SAPUI5, select theme and control library ->
<script id="sap-ui-bootstrap"
type="text/javascript"
src="https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-theme="sap_goldreflection"
data-sap-ui-libs="sap.ui.commons"></script>
<!- 2.) Create a UI5 button and place it onto the page ->
<script>
// create the button instance
var myButton = new sap.ui.commons.Button("btn");
// set properties, e.g. the text
myButton.setText("Hello World!");
// attach an action to the button's "press" event (use jQuery to fade out the button)
myButton.attachPress(function() { $("#btn").fadeOut(); });
// place the button into the HTML element defined below
myButton.placeAt("uiArea");
// an alternative, more jQuery-like notation for the same is:
/*
$(document).ready(function() {
$("#uiArea").sapui("Button", "btn", {
text:"Hello World!",
press: function(){ $("#btn").fadeOut(); }
});
});
*/
</script>
</head>
<body class="sapUiBody">
<!- This is where you place the UI5 button ->
<div id="uiArea"></div>
</body>
</html>
Now open the file with any modern browser. FYI, We don't need any server to test this
You can configure Eclipse to work with SAPUI5 and use Apache Tomcat to run your application when working in a local environment.
Install Eclipse - http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/lunasr2
Install the Java Runtime Enviromnet - http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html
Install Apache Tomcat - http://tomcat.apache.org/download-80.cgi
Install SAPUI5 tools in Eclipse
Eclipse > Help > Install New Software
Add a new site in the "Available Software Sites" with the url:https://tools.hana.ondemand.com/luna
Select the new site in the Work with selection.
Expand the UI Development Toolkit for HTML5 & Select UI Development Toolkit for HTML5 (Developer Edition)
Next & Install (An Eclipse restart may be required)
Now that you have the SAPUI5 Tools installed. If you create a new Project, you now get a SAPUI5 Application Development option available.
Configure Apache Tomcat in the Servers
Add a Server, Window > Preferences > Server > Runtime Environment > Add
Select Apache Tomcat 8.0( or whichever version you are using) & select Next.
Select Tomcat installation directory & Finish.
Now you are all set to go. Create a new SAPUI5 Project(say myProject), add some code. To run it on tomcat, right-click on the Project, Run As > Run On Server. Select your Tomcat server, Next & Finish. You project will be up & running on your server at http://localhost:8080/myProject/
The "failed to preload" messges should not be fatal errors; the library preload files are an optional bundled optimization in order to reduce the number of HTTP requests.
https://github.com/SAP/openui5/issues/119
I think you can just ignore this warning. And I encounter Cross origin requests problem when loading Component.js, solved this problem using python -m SimpleHTTPServer. What you need is just a server , choose whatever you like.
Daniel I recommend you SAPUI Walkthrough as a starting point. This is a step by step guide / tutorial on how to build SAPUI5 applications, contains explanation about the cornerstones and best practices. For the basics you will only need an editor and a browser (no webserver). This git repo contains all the Walkthrough steps as separate branches.
SAP UI5 is only bunch of UI libraries that are used to develop your front end, just like other libraries like jQuery. Now, the question is how do you configure your Apache to serve these files? This is a basic Apache configuration to serve files, this page might be a good starting point.

how do I comment out php code in netbeans 7.1

If i want to comment out php code in netbeans i have to do it manually as i haven't found a way of doing it from a netbeans command ?
so if i have this code example:
<?php bloginfo('template_url') ?>
I would manual type:
<?php /*<?php bloginfo('template_url') ?> */?>
Using the insert comment button only seems to include // 0r
<!-- --> which does not comment out php code ?
in dreamweaver you also have the option of php comment , is this function available in netbeans ?
Many thanks
The server will interpret the php file before hand, <!-- --> is used to comment once the php is converted to HTML.
So you may use :
<?php /*bloginfo('template_url')*/ ?>
Which only comment the php code and so won't be executed on php compilation