PHP Classes

File: entry.php

Recommend this page to a friend!
  Classes of Ahmad Mustapha   Minimal Singleton   entry.php   Download  
File: entry.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Minimal Singleton
Show how to create only one object of class
Author: By
Last change:
Date: 11 days ago
Size: 358 bytes
 

Contents

Class file image Download
<?php

use Ahmard\Singleton\Environment;

require_once
__DIR__ . '/vendor/autoload.php';

$app = Environment::getInstance()
    ->
setName('Test')
    ->
setEnv('dev')
    ->
setHost('http://localhost');


var_dump(Environment::getInstance()->getAppName());
var_dump(Environment::getInstance()->getAppEnv());
var_dump(Environment::getInstance()->getAppHost());