Example #1
0
 /**
  * Provides a stored instance of the arch class. The instance itself
  * doesn't store a useful state. This is more for utility.
  * @return Asar
  */
 static function getInstance()
 {
     if (!self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Example #2
0
 function init()
 {
     $this->config['log_file'] = \Asar::getInstance()->getFrameworkTestsDataTempPath() . DIRECTORY_SEPARATOR . 'example.log';
 }
Example #3
0
<?php

/*
set_include_path(
  realpath(dirname(__FILE__) . '/../../../lib/core') . PATH_SEPARATOR .
  realpath(dirname(__FILE__) . '/../apps') . PATH_SEPARATOR .
  realpath(dirname(__FILE__) . '/../lib/vendor') . PATH_SEPARATOR .
  get_include_path()
);*/
require_once realpath(dirname(__FILE__) . '/../../../lib/core/Asar.php');
//Asar::start('Sample');
$__asar = Asar::getInstance();
$__asar->getToolSet()->getIncludePathManager()->add($__asar->getFrameworkCorePath(), realpath(dirname(__FILE__) . '/../apps'));
require_once 'Asar/EnvironmentScope.php';
require_once 'Asar/Injector.php';
if (!isset($_SESSION)) {
    $_SESSION = array();
}
if (!isset($argv)) {
    $argv = array();
}
$scope = new Asar_EnvironmentScope('Sample', $_SERVER, $_GET, $_POST, $_FILES, $_SESSION, $_COOKIE, $_ENV, getcwd(), $argv);
Asar_Injector::injectEnvironmentHelperBootstrap($scope)->run();
Asar_Injector::injectEnvironmentHelper($scope)->runAppInProductionEnvironment();
Example #4
0
 protected function getTempDir()
 {
     return \Asar::getInstance()->getFrameworkTestsDataTempPath();
 }
 function setUp()
 {
     $this->peek = new ClassFilePeek();
     $this->file = \Asar::getInstance()->getFrameworkTestsDataPath() . DIRECTORY_SEPARATOR . 'classfilepeektestfile.php';
 }