예제 #1
0
 static function getInstance()
 {
     if (!isset(self::$instance)) {
         if (class_exists('RedCat\\Wire\\Di')) {
             self::$instance = \RedCat\Wire\Di::getInstance()->create(__CLASS__);
         } else {
             self::$instance = new self();
         }
     }
     return self::$instance;
 }
예제 #2
0
파일: B.php 프로젝트: kidaa30/redcat
 static function _init()
 {
     if (!isset(self::$bases)) {
         if (class_exists('RedCat\\Wire\\Di') && self::$useWireDi) {
             self::$bases = \RedCat\Wire\Di::getInstance()->create('RedCat\\DataMap\\Bases');
             if (isset(self::$bases[0])) {
                 self::selectDatabase(0);
             }
         } else {
             self::$bases = new Bases();
         }
     }
 }
예제 #3
0
 function load()
 {
     $this->remapAttr('domains');
     $this->attr('domains', eval('return ' . $this->domains . ';'));
     if ($this->attr('no-cache')) {
         $href = "<?php echo \\RedCat\\Wire\\Di::getInstance()->create('RedCat\\Route\\Url')->getCanonical(" . var_export($this->attr('domains'), true) . ',' . ($this->attr('http-substitution') ? 'true' : 'false') . ',' . ($this->attr('static') ? 'true' : 'false') . ');?>';
     } else {
         $url = Di::getInstance()->create('RedCat\\Route\\Url');
         $canonical = $url->getCanonical($this->attr('domains'), !!$this->attr('http-substitution'), $this->attr('static'));
         $canonical2 = $url->getCanonical($this->attr('domains'), '%s', $this->attr('static'));
         if ($this->attr('http-substitution')) {
             $href = '<?php echo http_response_code()===200?' . var_export($canonical, true) . ':sprintf(' . var_export($canonical2, true) . ',http_response_code());?>';
         } else {
             $href = $canonical;
         }
     }
     $this->write('<link rel="canonical" href="' . $href . '">');
 }
예제 #4
0
<?php

$workDir = $_GET['repo'];
if (!is_dir($workDir) || !is_file($workDir . '/.config.php')) {
    return;
}
require_once __DIR__ . '/php/common.inc.php';
use RedCat\Autoload\Autoload;
use RedCat\Wire\Di;
$di = new Di();
$di->loadPhpVar(include $workDir . '/.config.php');
$di->defineClass('Surikat\\GitCascade\\PHPloy', ['construct' => ['$map' => 'gitDeploy']]);
ignore_user_abort(false);
set_time_limit(0);
if (php_sapi_name() != 'cli') {
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Pragma: no-cache");
    header("Cache-Control: no-cache");
    header("Expires: -1");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Cache-Control: no-store, no-cache, must-revalidate");
    ob_implicit_flush(true);
    @ob_end_flush();
    echo str_repeat(" ", 1024);
}
try {
    $phploy = $di->create('Surikat\\GitCascade\\PHPloy', ['repo' => $workDir]);
    $phploy->output("<bgGreen>PHPloy v3.5.0.SurikatRevised");
    $phploy->output('<red>working on ' . $workDir);
    $phploy->setMaintenanceOn();