Beispiel #1
0
 /**
  * @param null $name
  *
  * @return string
  */
 public function method($name = null)
 {
     /*
     if (!$ip = Ip::sessionReload("IP")) {
         $ip = Ip::getById(12);
         $ip->sessionSave("IP");
     }
     */
     $list = Ip::getAll();
     $find = $list->find('getCountry', 'JP');
     $cache = Cache::create(["type" => "Apc", "prefix" => "bla", "config" => "redis://*****:*****@doe.com' => 'John Doe'))->setTo(array('*****@*****.**'))->setHtmlBody("sdfsdf");
     // $message->send();
     $http = new Client();
     $http->get("http://www.google.com");
     // $this->app->response->redirect("/");
     $container = new HtmlContainer('<div>');
     $html = new HtmlElement('<a>');
     $html->setContent('Click me')->addClass(array('btn', 'btn-primary'));
     $container->add($html);
     $html = new HtmlElement('<a>');
     $html->setContent('Click now')->addClass(array('btn', 'btn-default'));
     $container->add($html);
     $this->data['main'] = $container->render();
     $this->data['plural'] = DateTime::now()->diffForHumans(DateTime::parse('-1 day')) . '<br />' . DateTime::now()->formatLocalized('%A %d %B %Y') . '<br />' . App::translator()->transChoice('transChoice', 10, [10]) . '<br />' . App::translator()->transChoice('transChoice', 1, [1]);
     $page = new MasterPage();
     $page->setMain($this->render())->setAside('ASIDE FROM ' . get_class() . ' with name ' . $name)->addCss('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css');
     return $page->render();
 }
Beispiel #2
0
use Cawa\Log\Output\SyslogUdp;
use Psr\Log\LogLevel;
$udp = new SyslogUdp(SyslogUdp::FACILITY_LOG_LOCAL0, "Сáша");
$udp->setMinimumLevel(LogLevel::EMERGENCY);
$config = ["ip" => ["admin" => ["127.0.0.1"], "remoteAddressHeaders" => ["REMOTE_ADDR"]], "email" => ["default" => "smtp://*****:*****@prod:3306/database", "SLAVE" => "mysql://*****:*****@prod:3307/database"], "httpclient" => ["GOOGLE" => "http://www.google.com", "GOOGLE_FN" => function () {
        $client = new Client();
        $client->setBaseUri("http://www.google.com");
        $client->getClient()->setOption(Client\AbstractClient::OPTIONS_DEBUG, true)->setOption(Client\AbstractClient::OPTIONS_SSL_VERIFY, false);
        return $client;
    }]]);
} else {
    /*
    |--------------------------------------------------------------------------
    | Development
    |--------------------------------------------------------------------------
    */
    $config = array_merge($config, ["db" => ["MAIN" => "mysql://root:@127.0.0.1:3306/test", "SLAVE" => "mysql://root:@127.0.0.1:3307/test"], "httpclient" => ["GOOGLE" => "http://www.google.fr", "GOOGLE_FN" => function () {
        $client = new Client();
        $client->setBaseUri("http://www.google.fr");
        $client->getClient()->setOption(Client\AbstractClient::OPTIONS_DEBUG, true)->setOption(Client\AbstractClient::OPTIONS_SSL_VERIFY, false);
        return $client;
    }]]);
}
return $config;