Skip to content
This repository has been archived by the owner on Aug 10, 2022. It is now read-only.

Commit

Permalink
Merge pull request #33 from szytko/v1.1
Browse files Browse the repository at this point in the history
v1.1
  • Loading branch information
arius86 committed Dec 18, 2014
2 parents b195311 + fa8872d commit 3ebf366
Show file tree
Hide file tree
Showing 168 changed files with 5,764 additions and 1,853 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -34,4 +34,5 @@ com_crashlytics_export_strings.xml
/vendor/
composer.phar
composer.lock
travis.log
travis.log
tests/config.php
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -18,7 +18,9 @@ before_script:
- php composer.phar install --dev

script:
- cp tests/config.sample.php tests/config.php
- mkdir -p tests/fixtures/cache
- mkdir -p tests/fixtures/tmp
- mkdir -p build/logs
- php vendor/bin/phpunit -c travis/phpunit.xml.dist

Expand Down
236 changes: 0 additions & 236 deletions src/Application/Bootstrap.php

This file was deleted.

40 changes: 40 additions & 0 deletions src/Bootstrap/EnvironmentInitializerTrait.php
@@ -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();
}

37 changes: 37 additions & 0 deletions src/Bootstrap/LoaderInitializerTrait.php
@@ -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();
}
}

0 comments on commit 3ebf366

Please sign in to comment.