Yaf_Application::__construct

(Yaf >=1.0.0)

Yaf_Application::__constructYaf_Application constructor

Beschreibung

public Yaf_Application::__construct(mixed $config, string $envrion = ?)

Instance a Yaf_Application.

Parameter-Liste

config

A ini config file path, or a config array

If is a ini config file, there should be a section named as the one defined by yaf.environ, which is "product" by default.

Hinweis:

If you use a ini configuration file as your applicatioin's config container. you would open the yaf.cache_config to improve performance.

And the config entry(and there default value) list blow:

Beispiel #1 A ini config file example

[product]
;this one should alway be defined, and have no default value
application.directory=APPLICATION_PATH

;following configs have default value, you may no need to define them
application.library = APPLICATION_PATH . "/library"
application.dispatcher.throwException=1
application.dispatcher.catchException=1

application.baseUri=""

;the php script ext name
ap.ext=php

;the view template ext name
ap.view.ext=phtml

ap.dispatcher.defaultModuel=Index
ap.dispatcher.defaultController=Index
ap.dispatcher.defaultAction=index

;defined modules
ap.modules=Index

envrion

Which section will be loaded as the final config

Rückgabewerte

Beispiele

Beispiel #2 Yaf_Application::__construct()example

<?php
defined
('APPLICATION_PATH')                  // APPLICATION_PATH will be used in the ini config file
    
|| define('APPLICATION_PATH'__DIR__));

$application = new Yaf_Application(APPLICATION_PATH.'/conf/application.ini');
$application->bootstrap()->run();
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

Beispiel #3 Yaf_Application::__construct()example

<?php
$config 
= array(
    
"application" => array(
        
"directory" => realpath(dirname(__FILE__)) . "/application",
    ),
);

/** Yaf_Application */
$application = new Yaf_Application($config);
$application->bootstrap()->run();
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

Siehe auch

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Was genau bedeutet "Vibe Coding"? Ein tiefgehender Blick für Entwickler

In der Welt der Softwareentwicklung gibt es unzählige Wege, wie man an ein Projekt herangeht. Manche schwören auf strikte Planung, andere auf bewährte Algorithmen und wieder andere lassen sich von etwas ganz anderem leiten: ihrem Gefühl. ...

admin

Autor : admin
Kategorie: Software & Web-Development

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Review of smartphone apps from the best bookmakers in India

I am glad to welcome, as I have probably already guessed Ravindran and today I will tell you about some nuances that you need to know if you are p ...

Geschrieben von ravindrankhx am 26.05.2026 12:14:32
Forum: Apps und PHP Script Gesuche
SELLING BEST FRESH CC CCC CVV CVV2 DUMPS12 2026 FULLSsn CS Dob DL ALL

contact me via>> Gmail : dumpss500@gmail.com telegram:@king_dumps12 My store=>> https://dumps201.net/login.php ------------------ Hello All Cus ...

Geschrieben von sellergood11 am 26.05.2026 05:23:09
Forum: Archiv / Trash
Sell full cc cvv us uk aus ca eu asia inter,pass vbv/bin/dob1

telegram:@king_dumps12 BUY / SELL CCV. CV2 , CVV , Acc paypal, transfer , bank logins , Western union , verizon , ATT , Dumps track with pin T1 / ...

Geschrieben von sellergood11 am 26.05.2026 05:22:20
Forum: User stellen sich vor
SELL FULLSsn Dob DL CS CC CVV US UK AUS CA EU ASIA INTER,PASS VBV/BIN/DOB1

HOT Seller CVV Good 2026- NON VBV Credit Card/Debit Card U.P.D.A.T.E CVV 2026 Sell CVV Good info And High Balance (Cvv CC Fullz Credit Cards Dum ...

Geschrieben von sellergood11 am 26.05.2026 05:21:29
Forum: Out of Order