This repository has been archived by the owner on Aug 10, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from szytko/v1.1
v1.1
- Loading branch information
Showing
168 changed files
with
5,764 additions
and
1,853 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,4 +34,5 @@ com_crashlytics_export_strings.xml | |
/vendor/ | ||
composer.phar | ||
composer.lock | ||
travis.log | ||
travis.log | ||
tests/config.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
/** | ||
* @author Sławomir Żytko <slawek@amsterdam-standard.pl> | ||
* @copyright (c) 2014, Amsterdam Standard | ||
*/ | ||
|
||
namespace Vegas\Bootstrap; | ||
|
||
use Phalcon\Config; | ||
use Vegas\Constants; | ||
|
||
trait EnvironmentInitializerTrait | ||
{ | ||
|
||
/** | ||
* Initializes application environment | ||
*/ | ||
public function initEnvironment(Config $config) | ||
{ | ||
if (isset($config->application) && isset($config->application->environment)) { | ||
$env = $config->application->environment; | ||
} else { | ||
$env = Constants::DEFAULT_ENV; | ||
} | ||
|
||
if (!defined('APPLICATION_ENV')) { | ||
define('APPLICATION_ENV', $env); | ||
} | ||
|
||
$this->getDI()->set('environment', function() use ($env) { | ||
return $env; | ||
}, true); | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
abstract public function getDI(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* This file is part of Vegas package | ||
* | ||
* @author Slawomir Zytko <slawek@amsterdam-standard.pl> | ||
* @copyright Amsterdam Standard Sp. Z o.o. | ||
* @homepage http://vegas-cmf.github.io | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Vegas\Bootstrap; | ||
|
||
use Phalcon\Config; | ||
use Phalcon\Loader; | ||
|
||
trait LoaderInitializerTrait | ||
{ | ||
|
||
/** | ||
* Initializes loader | ||
* Registers library and plugin directory | ||
*/ | ||
public function initLoader(Config $config) | ||
{ | ||
$loader = new Loader(); | ||
$loader->registerDirs( | ||
array( | ||
$config->application->libraryDir, | ||
$config->application->pluginDir, | ||
$config->application->taskDir | ||
) | ||
)->register(); | ||
} | ||
} | ||
|
Oops, something went wrong.