Skip to content

Sandeep-source/Live_php_editer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

23 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Live Php Editor

This Editer ๐Ÿ–Š is created with the help of java โ˜•. It presents the use of simple java IO โœ to make some creative Apps. Basic understanding of java and javafx is enough to customize ๐Ÿ›  this accourding to your needs.

Requirements

  • JDK 9 โ˜• or any JDK with openfx lib (Some changes in import code section is needed in order to use openfx)
  • Php

Feature

  • Handle multiple ๐Ÿ”ข tab at a time
  • Very lightweight ๐Ÿƒ
  • Uses simple java IO โœ

Source code structure

./Editer.css
./PHPServer.java
./phpe2.png
...

Ignore any extra files in source code. Let's take a look att code.

  1. Editer.css - This defines css ๐ŸŽจ for application. Javafx supports css integration in code this provides javafx an edge over other GUI tool such as Swing or AWT.
  2. PHPServer.java - This is main class to handle all action from taking input to rendering output and showing to the user.
  3. phpe2.png - It's only logo for application .

Working

So how all this works ? So answer is very simple, just using java IO โœ. There are mainly two componets in GUI of application.

  1. TextArea GUI components
  2. WebView GUI components

When user type Php code ๐Ÿ‘จโ€๐Ÿ’ป into TextArea the corresponding result is shown in the WebView components. Let's take a look at the process behind the the seen.

  1. The code written by the user is fetched by the application and written to a temporary php file ๐Ÿ“ after every keystroke.
  2. The generated temporary php file๐Ÿ“ then executedโš™ by the php program to generate equaivalent html code which is saved to another temporary html file๐Ÿ“.
  3. The generated temporary Html response file ๐Ÿ“ by php code is loaded into WebView.
  4. That's all ๐ŸŽฏ.

Note:- If the local file ๐Ÿ“ is opend instead of creating new file then at the end when user press Ctrl+S or choose save from menu the current state of file in saved to opened local file. As it should be.

Ruuning Application

Just run โ–ถ the PHPServer.java as normal java program and You will be all set to use this lightweight app.

javac PHPServer.java
java PHPServer

Screenshot

What can be improved

  • Syntax highlighting
  • Links ๐Ÿ”— opening behaivour, Mainly for target="_blank"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published