Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

Apps Configuration

Requires: phpFox 4.5+

Here is the example structure of Install.php:

<?php
namespace Apps\PHPfox_Core;

use Core\App;
use Core\App\Install\Setting;

class Install extends App\App
{
    protected function setId()
    {
        $this->id = 'PHPfox_Core';//Set ID for your app. This action is required.
    }
    protected function setSupportVersion()
    {
        $this->start_support_version = '4.4.0';//Start support version
        $this->end_support_version = '4.5.0';//End support version
    }

    protected function setAlias()
    {
        //Set alias for your app
    }

    protected function setName()
    {
        $this->name = 'phpFox Core';//Set Name for your app, this name will display in manage apps (admincp)
    }

    protected function setVersion()
    {
        $this->version = '4.0.1';//Set version for your app
    }

    protected function setSettings()
    {
        //Define settings for your app
    }

    protected function setUserGroupSettings()
    {
        //Define user group settings for your app
    }

    protected function setComponent()
    {
        //Define component for your app
    }

    protected function setComponentBlock()
    {
        //Define component block for your app
    }

    protected function setPhrase()
    {
        //Add more phrase for your app. However, for mow please define in phrase.json
    }

    protected function setOthers()
    {
        //Set other information for your app
        $this->_publisher = 'phpFox'; //Your company name
        $this->_publisher_url = 'http://store.phpfox.com/';//Your company website
        // include your external paths
        $this->external_paths = [
            [
                'path' => 'PF.Base/example_folder'
                'removeable => true
            ],
            [
                'path' => 'PF.Base/example_file'
                'removeable => false
            ]
        ];
    }
}

These are all properties you can define for your app:

ID

Define

Type

Note

Version

Required?

1

id

String

This is your app ID, it must be the same folder name stored your app. Space is not allowed. This ID can't change.

4.5+

Yes

2

name

String

The name of your app, it will display in manage app in admincp

4.5+

Yes

3

version

String

Version of your app. It has to follow version naming convention.

4.5+

Yes

4

alias

String

This value is used for: admincp url, block name, component name, ajax name,... This value must be lower case and no space. If your app is simple, this value can be empty.

4.5+

No

5

icon

String

Define Icon of your app. We support 3 ways to define your app icon: Image link: Put image link of your icon here. Font awesome class: Put font awesome class here: it will display icon from font awsome. Icon image: Don't set or set empty this value, we will get file "icon.png"

4.5+

No

6

admincp_route

String

Default page of your app in admincp

4.5+

No

7

admincp_menu

String

Your app menu in admincp

4.5+

No

8

admincp_help

String

You can help admin by providing your instructions external and add your url here.

4.5+

No

9

admincp_action_menu

String

Action button of your app in admincp (The top right button)

4.5+

No

10

map

String

Support search in feed

4.5+

No

11

map_search

String

Support search in feed

4.5+

No

12

menu

Array

Add a menu for your app on main menu bar

4.5+

No

13

settings

Array

Your app's settings

4.5+

No

14

user_group_settings

Array

Your app's user groups settings

4.5+

No

15

database

Array

Define database structure for your app

4.5+

No

16

component

Array

App's components

4.5+

No

17

component_block

Array

Default blocks

4.5+

No

18

component_block_remove

Array

Old blocks that you want to remove on upgrade your app

4.5.2+

No

19

start_support_version

String

Oldest phpFox version your app can support

4.5+

No

20

end_support_version

String

Newest phpFox version your app can support

4.5+

No

21

phrase

Array

Advanced phrases

4.5+

No

22

_publisher

String

Your company name

4.5+

No

23

_publisher_url

String

Your company home page

4.5+

No

24

_apps_dir

String

Your app directory name

4.5+

No

25

_admin_cp_menu_ajax

Boolean

Set true: menu in admincp will load by ajax; false: menu will load by refresh page. Default is true

4.5+

No

26

_writable_dirs

Array

List all directories that your app need writable permission

4.5.3+

No

27

external_paths

Array

List all your external directories/files that outside your app folder. You also can define which files/directories will be removed when uninstall your app.

4.5.3+

No

  • No labels