2017 © Pedro Peláez
 

project selifa-core

Selifa Core is a basic PHP framework for any application type. It offers only a PSR-4 class autoloader, a configuration management and an exception management. It's configuration differs from most other PHP framework since it only load specific configuration file or spesific class. This version of Selifa is a major rewrite of my previous Selifa Framework which contains a full framework.

image

rbs1518/selifa-core

Selifa Core is a basic PHP framework for any application type. It offers only a PSR-4 class autoloader, a configuration management and an exception management. It's configuration differs from most other PHP framework since it only load specific configuration file or spesific class. This version of Selifa is a major rewrite of my previous Selifa Framework which contains a full framework.

  • Tuesday, June 13, 2017
  • by rbs1518
  • Repository
  • 0 Watchers
  • 0 Stars
  • 4 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Selifa Core

Introduction

Selifa Core is a basic PHP framework for any application type. It offers only a PSR-4 class autoloader, a configuration management and an exception management. It's configuration differs from most other PHP framework since it only load specific configuration file or spesific class. This version of Selifa is a major rewrite of my previous Selifa Framework which contains a full framework., (*1)

Version 1.0, (*2)

Usage Instructions

Download or pull this repository into your project. Selifa Core only have a few files so it won't make your project bigger. For a simple project, you can specify SELIFA_ROOT_PATH constant and include selifa.php file in folder selifa. That's all. Now your project have capability to use PSR-4 autoloader. Just put all of your classes into libraries folder., (*3)

define('SELIFA_ROOT_PATH',dirname(__FILE__));
include('selifa/selifa.php`);

Advanced usage requires you to create your own selifa initialization. Don't worry, it's not that hard., (*4)

  1. First, you need to define some constants. Put these constants before everything else.
define('SELIFA_TIME_STARTED',microtime(true));
define('SELIFA','v1.0');
define('SELIFA_NAME','Selifa');
  1. Then you need to define where is selifa location in your filesystem. Create SELIFA_ROOT_PATH constants pointing at your project's base directory.
    Usually we use dirname to automate the value of this constant, but you can manually specify the exact path.
    Note: full pathname is required.
define('SELIFA_ROOT_PATH',dirname(__FILE__));
// or
define('SELIFA_ROOT_PATH','/var/www/yourproject');
  1. Then include Selifa's core class file. You can use SELIFA_ROOT_PATH or manually specify the file.
include(SELIFA_ROOT_PATH.'/selifa/core/Core.php');
// or
include(SELIFA_ROOT_PATH.'/var/www/yourproject/selifa/core/Core.php');
  1. Next, initialize the Selifa itself. Use SELIFA_ROOT_PATH as RootPath value, and specify any folder within RootPath for configuration files.
    For single application type (this is for most of the case):
\RBS\Selifa\Core::Initialize(array(
    'RootPath' => SELIFA_ROOT_PATH,
    'ConfigDir' => 'configs/',
    'LoadComponents' => array(
        '\RBS\Selifa\XM' //this must be preloaded at the beginning.
    )
));

For multi application type:, (*5)

\RBS\Selifa\Core::Initialize(array(
    'RootPath' => SELIFA_ROOT_PATH,
    'ConfigDir' => 'apps/yourapplicationid/configs/',
    'LoadComponents' => array(
        '\RBS\Selifa\XM'
    )
));

You can specify more than one class that need to be loaded at the beginning. By default, Selifa Core only load class file as soon as they are required somewhere within your application. Putting this class inside LoadComponents array will preload it whether you use it or not., (*6)

  1. Finish! you can start write your code.

Credits

Rinardi B. Sarean, rinardi_1518_sarean@hotmail.com., (*7)

License

The MIT License (MIT), (*8)

Copyright (c) 2015-2017. Rinardi B. Sarean, (*9)

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:, (*10)

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

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., (*12)

The Versions

13/06 2017

dev-master

9999999-dev https://bitbucket.org/rbs1518/selifa-core

Selifa Core is a basic PHP framework for any application type. It offers only a PSR-4 class autoloader, a configuration management and an exception management. It's configuration differs from most other PHP framework since it only load specific configuration file or spesific class. This version of Selifa is a major rewrite of my previous Selifa Framework which contains a full framework.

  Sources   Download

MIT

The Requires

 

by Avatar rbs1518

13/06 2017

1.0.3

1.0.3.0 https://bitbucket.org/rbs1518/selifa-core

Selifa Core is a basic PHP framework for any application type. It offers only a PSR-4 class autoloader, a configuration management and an exception management. It's configuration differs from most other PHP framework since it only load specific configuration file or spesific class. This version of Selifa is a major rewrite of my previous Selifa Framework which contains a full framework.

  Sources   Download

MIT

The Requires

 

by Avatar rbs1518

19/05 2017

1.0.2

1.0.2.0 https://bitbucket.org/rbs1518/selifa-core

Selifa Core is a basic PHP framework for any application type. It offers only a PSR-4 class autoloader, a configuration management and an exception management. It's configuration differs from most other PHP framework since it only load specific configuration file or spesific class. This version of Selifa is a major rewrite of my previous Selifa Framework which contains a full framework.

  Sources   Download

MIT

by Avatar rbs1518

19/05 2017

1.0.1

1.0.1.0 https://bitbucket.org/rbs1518/selifa-core

Selifa Core is a basic PHP framework for any application type. It offers only a PSR-4 class autoloader, a configuration management and an exception management. It's configuration differs from most other PHP framework since it only load specific configuration file or spesific class. This version of Selifa is a major rewrite of my previous Selifa Framework which contains a full framework.

  Sources   Download

MIT

by Avatar rbs1518

17/05 2017

1.0.0

1.0.0.0 https://bitbucket.org/rbs1518/selifa-core

Selifa Core is a basic PHP framework for any application type. It offers only a PSR-4 class autoloader, a configuration management and an exception management. It's configuration differs from most other PHP framework since it only load specific configuration file or spesific class. This version of Selifa is a major rewrite of my previous Selifa Framework which contains a full framework.

  Sources   Download

MIT

by Avatar rbs1518

17/05 2017

dev-working

dev-working https://bitbucket.org/rbs1518/selifa-core

Selifa Core is a basic PHP framework for any application type. It offers only a PSR-4 class autoloader, a configuration management and an exception management. It's configuration differs from most other PHP framework since it only load specific configuration file or spesific class. This version of Selifa is a major rewrite of my previous Selifa Framework which contains a full framework.

  Sources   Download

MIT

by Avatar rbs1518