Space-Desktop Documentation

Version of the Documentation 1.0.1 (Space-Desktop v.1.0.1)


Introduction


Welcome everyone, I appreciate your desire to use my application and hope that together we will get a useful instrument for PHP and Python development.
All updates will be published on the official website and GitHub page. Updates of the Documentation will be published if an update change main apps files too much.

This documentation is important to show you each step of customization of the application. Please go through the documentation carefully to understand how this application is made and how to edit this properly. Basic HTML, JS and CSS knowledge is required to customize this application.

Requirements

You will need the following sofwares to customize this template.

  1. Code Editing Software (eg: Dreamweaver, Sublime Text or Notepad)
  2. Web Browser for testing (eg: Google Chrome or Mozilla Firefox)
  3. OS Windows 64 is necessary
  4. Other OS will be added in near future

You can help to this project with many ways.
Your patronage will help the project in future, Patreon link is down below
--Patreon Page--
Contact with me SpaceDesktopMail@gmail.com if you have some ideas.
Or help with translation of this Documentation. Download link is down below
--Space-Desktop GitHub--
Send me your translation on my email and I will publish it for everyone.
--SpaceDesktopMail@gmail.com--

Getting Started #back to top

To start the application first of all you need to download the newest version from Space-Desktop Website. Unpack the ZipArchive on your PC, USB or External Hard Drive.

PHP For Windows

On Windows OS you need to open the folder and run "space-desktop.exe" file. After few seconds you will see "WELCOME" message (if "standart" theme is enabled) and the application will be ready.

windows-screen welcome

With enabled "standart" theme you will see a customized window of the application and information about PHP version and settings.

startapp

Structure of Space-Desktop application

For easier navigation I will give structure of the application's folders.

                                  -desktop (your PHP application must be placed here)
                                  ---index.php
                                  ---php folder and other files
                                  ---CSS and HTML includes
                                  -documentaion (application manual)
                                  -licenses (licenses and dependencies)
                                  -node_modules (included npm modules)
                                  -php (the folder with PHP build)
                                  -phpini (Folder for custom php.ini)
                                  ---php.ini (Created custom-generated php.ini file, will be created after launch)
                                  -themes (here you can find your themes)
                                  ---ThemeName (name of the theme)
                                  ------index.html (main file to run the theme)
                                  ------css (folder for CSS styles)
                                  ------js (folder for JS includes)
                                  ------img (folder for images and other includes)
                                  -Commands.txt (Commands for Space-Desktop through Node.js command prompt)
                                  -Generateini.js (NODE.JS script to generate custom php.ini with relative pathes)
                                  -package.json (JSON file)
                                  -package-lock.json (npm dependencies tree)
                                  -README.txt
                                  -Starter.js (It is main file in package.json, it starts an application)
                                  -StartUsual.js (Start the application with OS default window)
                                  -StartTheme.js (Start the application with custom theme)
                                  -Structure.txt
                                

How to start PHP app#back to top

Add your own PHP code

First of all you need to open "Space-Desktop Folder\resources\app\desktop" folder and create your own index.php file. One is already inside, you can use this one for editing

startapp

Example of PHP code if you need to get information about PHP version.

                        phpinfo();
                        

Let's try make some simple message, classic "Hello world" and count how many letters in words.

                          $select = "Hello world!";
                          echo $select;
                          echo "
"; echo strlen($select); // outputs 12

Here is the result. Launch the application.

startapp

Change the PHP version

You van select PHP version for your application. First of all go to the official website PHP and download your version.Open the "Space-Desktop Folder\resources\app\php" folder and delete all files there. Unpack the downloaded PHP version to this folder. New version of PHP is ready.

php

php.ini configuration#back to top

Summary

Space-Desktop has two main options for php.ini configuration. The first option is usual php.ini settings, you edit php.ini in you php folder and run the application. The second option is to use "custom generated" php.ini from "phpini" folder. This one can use more options for modules with variable paths (usually you need set direct path to file in php.ini).

Usual php.ini

Open "php" folder and find your php.ini or create it. Open the php.ini file and set settings from official PHP manual. Restart the application (close and open again). New PHP settings will be active now. You can edit the php.ini file with simple note editor (I prefer Notepad++)

phpini

"Custom" php.ini

In Space-Desktop you can use variable paths and changeable settings for PHP modules and libraries (like PEAR or PECL), it possible with NODE.JS syntax but impossible in usual php.ini. syntax. First you need to open the Space-Desktop folder and find "Generateini.js" file.
In this file you will find examples and structure of "custom generated" php.ini file.

                          /*
                            STRUCTURE
                          - INCLUDES-LOCAL --------------- Include php.ini strings and options
                          - EXAMPLE-LOCAL ---------------- Example of options
                          - OPTIONS-LOCAL ---------------- Included options
                          - CONTENT-BUILDER-LOCAL -------- Build php.ini with selected options
                          - FINISH-LOCAL ----------------- Create php.ini
                          - EXPORT-FUNCTION-LOCAL -------- Export local JS functions
                          */
                        

You can edit php.ini settings in different ways. Here is some examples for you.

                          // EXAMPLE-LOCAL

                          // Here how you can write title to php.ini content -------------------------------
                          const title_1 = '[PHP]';

                          // Example of options with standart JS functions, without 'multiline' module -----
                          const content_1_1 = function(){/*
                          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                          ; About custom-generated php.ini ;
                          ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                          */}.toString().slice(14,-3);

                          // Example of options with 'multiline' module ------------------------------------
                          const content_1_2 = multiline(()=>{/*
                          ;This php.ini was been created with Javascript and NODE.JS functions
                          ;You can change the generated php.ini in generateini.js
                          ;Open the generateini.js and edit 'iniCompileFunction' options
                          */});

                          // Usual text, one string can be placed ----------------------------------------
                          const content_1_3 = '; Use PHP documentation to configure php.ini ';

                          // Use '__dirname' to set relative path on php.ini option line -------------------
                          // IMPORTANT ---------------------------------------------------------------------
                          // On Windows you use '\\' to directories ----------------------------------------
                          // When php.ini is ready, you will get '\USE\PATH' as an example------------------
                          // Example: ----------------------------------------------------------------------
                          // const content_1_4 = __dirname + '\\USE\\PATH';
                          const content_1_4 = ';' + __dirname + '\\USE\\PATH';

                          // This 'const' can be used to set number-----------------------------------------
                          //const content_1_5 = 0;
                          const content_1_5 = ';' + 0;
                        

You can see a lot of methods. Use them attentively and don't forget to activate them on "CONTENT-BUILDER-LOCAL" line in "Generateini.js" file.

                          const arr = [
                          title_1, content_1_1, content_1_2, content_1_3, content_1_4, content_1_5,]
                        

When you run Space-Desktop app for the first time, "custom generated" php.ini will be created in "phpini" folder. You will get there php.ini file. Now you need to switch between usual and generated version. phpini

Switch between php.ini versions

Open "StartTheme.js" and "StartUsual.js" in Space-Desktop folder and find the same string in both of them:

                          // Settings for PHP Local Server
                          appser.use (php({
                            execPath: __dirname + '/php/php.exe', // Path to php.exe
                            // If none of "iniFile" selected, PHP Local Server will use default settings
                            iniFile: __dirname + '/php/php.ini', // Select php.ini from /php Folder
                            //iniFile: 'D:/Electron/Space-Desktop/phpini/php.ini', // Select custom-generated php.ini from /phpini Folder
                            root: __dirname + '/desktop', // Folder to your php application and index.php
                            address: '127.0.0.1', // Address interface for PHP Local Server
                            port: '8000', // Port for PHP Local Server ---------------------------------------- will auto-detect a free port otherwise
                            //ini: { max_execution_time: 60, error_log: '...' } // Show logs in Command line
                          }));
                        

You need to switch between "iniFile options", make it from this:

                          iniFile: __dirname + '/php/php.ini', // Select php.ini from /php Folder
                          //iniFile: 'D:/Electron/Space-Desktop/phpini/php.ini', // Select custom-generated php.ini from /phpini Folder
                        

To this one:

                          //iniFile: __dirname + '/php/php.ini', // Select php.ini from /php Folder
                          iniFile: 'D:/Electron/Space-Desktop/phpini/php.ini', // Select custom-generated php.ini from /phpini Folder
                        

Restart Space-Desktop app to use new settings. Be carefull with "__dirname" line, this needs to open current Space-Desktop folder (It is a relative path).

PHP local options#back to top

PHP local server

To start a PHP application first of all you need an interpreter or a local server. Space-Desktop use both of them but local server is still necessary. Open "StartTheme.js" and "StartUsual.js" in Space-Desktop folder and find the same string in both of them:

                          // Settings for PHP Local Server
                          appser.use (php({
                            execPath: __dirname + '/php/php.exe', // Path to php.exe
                            // If none of "iniFile" selected, PHP Local Server will use default settings
                            iniFile: __dirname + '/php/php.ini', // Select php.ini from /php Folder
                            //iniFile: 'D:/Electron/Space-Desktop/phpini/php.ini', // Select custom-generated php.ini from /phpini Folder
                            root: __dirname + '/desktop', // Folder to your php application and index.php
                            address: '127.0.0.1', // Address interface for PHP Local Server
                            port: '8000', // Port for PHP Local Server ---------------------------------------- will auto-detect a free port otherwise
                            //ini: { max_execution_time: 60, error_log: '...' } // Show logs in Command line
                          }));
                        

Here you can see all available options for editing. Change them as you need and save files.

Window options#back to top

Edit options

To edit window options, you need to open "StartTheme.js" and "StartUsual.js" in Space-Desktop folder and find the same string in both of them:

                                  // Application window settings
                                  // Uses Electron BrowserWindow options from https://electronjs.org/docs/api/browser-window
                                  mainWindow = new BrowserWindow({
                                	titleBarStyle: 'hidden',
                                	title: "Space Desktop",
                                	icon: 'icon.ico',
                                    //useContentSize: true,
                                	width: 1000,
                                	height: 650,
                                	minWidth: 575,
                                    minHeight: 450,
                                	frame: false,
                                    show: false
                                  });
                                

To edit the window you need to use Electron settings, open the official manual website page and use necessary options from there. "StartTheme.js" and "StartUsual.js" use different settings in "mainWindow" string!

Some of them can be used only in current OS. Read documentation attentively!

Change Theme#back to top

Switch between Window mods

You can select how to start application, with classic style of OS window or with custom theme. To edit the window's mode open "Starter.js" file.

                          var modalmode = './StartUsual.js';
                          // var modalmode = './StartTheme.js';
                          const myModule = require( modalmode );
                          let val = myModule.startappmode(); // Run the selected mode
                          
phptheme

All what you need to do is edit this line (OS window style):

                          var modalmode = './StartUsual.js';
                          // var modalmode = './StartTheme.js';
                          
phptheme

To this one (Theme window style):

                          //var modalmode = './StartUsual.js';
                          var modalmode = './StartTheme.js';
                          

Switch between Themes

You can switch between themes in "StartTheme.js" file, open it and find current string:

                            // Functions for external using
                            // Link for launching a theme
                            function IndexHTML () {
                              var themename = 'Standart'; // Theme's name
                              var linklocal = './themes/' + themename + '/index.html'; // Folder with themes
                              return linklocal;
                            };
                          

Here you can see Theme's name and folder. I recommend to save all your themes inside "themes" folder and change the name on "thename" string. Name of a theme is similar to theme's folder. This means if your theme is inside of "Standart" folder, you must write in code 'Standart'.
Save all changes and reload the application

Guide how to make a simple Theme #back to top

Comming soon - #back to top

I will add a nice instructions how to use NODE.JS, Electron and JS syntax to create nice themes with navigation, modal windows and loading screens.

Files & Sources #back to top

Included Stylesheets of Documentation

These are the primary CSS files used for general front-end styling. Use these to customize your theme even further. All included JavaScript codes under yourthemename/css/

  • 1. style.css - Primary stylesheet
  • 2. bootstrap.css - Bootstrap stylesheet
  • 3. owl-carousel.css - OWL Carousel
  • 4. fontawesome.css - FontAwesome Font Icons stylesheet
  • 5. custom.css - Pathos Color Schemes stylesheet
  • 6. prettyPhoto.css - Lightbox effect css file
  • 7. flexslider.css - Flexslider css file
  • 8. et-line.css - Elegant icons css file
  • 9. carousel.css - OWL Carousel css file
  • 10. animate.css - CSS3 animations css file
Included JavaScript

These are the various attribution inks to the Javascript files included or modified to work with in this theme. All included JavaScript codes under yourthemename/js/

  • 1. bootstrap.js - Bootstrap JavaScript
  • 2. custom.js - All JavaScript Plugins
  • 3. retina.js - Retina JavaScript
  • 4. jquery.js - Base JavaScript
  • 5. prettyPhoto.js - Lightbox JavaScript
  • 6. owl-carousel.js - Lightbox JavaScript
  • 7. revslider.js - Revolution Slider JavaScript
  • 8. flexslider.js - Flexslider JavaScript
  • 9. awesome-grid.nin.js - Awesome grid portfolio JavaScript
  • 10. circle.js - Coming soon page JavaScript
  • 11. contact.js - Contact form validate JavaScript
  • 12. isotope.js - Masonry Portfolio JavaScript
  • 13. progress.js - Progress bar JavaScript
  • 14. rotate.js - Text rotate effect JavaScript
  • 15. wow.js - CSS3 animation JavaScript

Copyright and License #back to top

MIT

Copyright (c) 2019 Space-Desktop.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

THE AUTHOR'S COMMENT
YOU NEED TO NOTE THE AUTHOR'S NAME IN A PROJECT AND ADD A NOTE
"BASED ON SPACE-DESKTOP" INSIDE OF YOUR APPLICATION