PHPackages                             brokerexchange/gloadals - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. brokerexchange/gloadals

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

brokerexchange/gloadals
=======================

Load simple GLOBAL variables

v1.0.4(7y ago)0161MITPHP

Since Oct 16Pushed 7y ago6 watchersCompare

[ Source](https://github.com/BrokerExchange/Gloadals)[ Packagist](https://packagist.org/packages/brokerexchange/gloadals)[ RSS](/packages/brokerexchange-gloadals/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

Gloadals
========

[](#gloadals)

Load simple variables into the PHP global scope using an "ini" file.

This is meant to be quick for installation and usage.

Currently, the only variable types available for loading are: single-depth arrays (associative and numeric) and scalar.

Obviously, care should be taken when loading any variables into the global scope, if and when possible -- don't use globals! Please take care to not overwrite other global variables. You have been forewarned, and you will assume use of this code at your own risk.

License
=======

[](#license)

This project is licensed under the terms of the MIT license. See the included "License.txt" for more information.

Usage
=====

[](#usage)

For the purpose of this demonstration, the ini file shall be called: '.gload.ini', but you can use a different file name, if you would like.

1 - install package via composer and require autoload
-----------------------------------------------------

[](#1---install-package-via-composer-and-require-autoload)

```
composer require brokerexchange/gloadals

```

2 - require composer autoload
-----------------------------

[](#2---require-composer-autoload)

```
require_once( . '/vendor/autoload.php' );

```

3 - option (a) - Setup ini file ('.gload.ini')
----------------------------------------------

[](#3---option-a---setup-ini-file-gloadini)

```
;simple (one level deep maximum)
associative_array1[associative_index1] = "test_value1"
associative_array1[associative_index2] = test_value2
numeric_array1[] = "test_value3"
scalar = test_value4

;multidimensional (when using ini - up to two levels deep *maximum* and must be placed after all simple variables)
[multidimensional]
levelone[leveltwo] = "testing"
levelone[another_leveltwo] = "testing testing"
levelone[yet_another_leveltwo] = "testing"

```

3 - option (b) - Setup php file ('.gload.php')
----------------------------------------------

[](#3---option-b---setup-php-file-gloadphp)

```
