Пример #1
0
 public function test_path_join()
 {
     $this->assertEquals('path/to/some/file', \veneer\util::path_join('path', 'to', 'some', 'file'));
 }
Пример #2
0
 /**
  * Includes the socket listener class and instantiates it, creating an HTTP
  * server instance that can serve requests to the run() method.
  *
  * @param string $bind_addr  The inet address to bind to
  * @param integer $bind_port  The TCP port to bind on
  * @return bool
  */
 public static function listen($bind_addr = '0.0.0.0', $bind_port = '8080')
 {
     require_once \veneer\util::path_join('http', 'server.php');
     require_once \veneer\util::path_join('http', 'request.php');
     new \veneer\http\server($bind_addr, $bind_port);
 }
Пример #3
0
<?php

/**
 * veneer - An Experimental API Framework for PHP
 *
 * @author     Ryan Uber <*****@*****.**>
 * @copyright  Ryan Uber <*****@*****.**>
 * @link       https://github.com/ryanuber/veneer
 * @license    http://opensource.org/licenses/MIT
 * @package    veneer
 * @category   api
 */
namespace veneer;

/**
 * Require various framework components in the proper order. These calls
 * will only load in classes, and won't actually execute anything. This
 * is intended to make using the framework simple for a developer - simply
 * include this file, then begin using veneer.
 */
require_once 'util.php';
\veneer\util::include_dir('exception');
require_once 'output.php';
\veneer\util::include_dir('output');
\veneer\util::include_dir(\veneer\util::path_join('output', 'handler'));
require_once \veneer\util::path_join('http', 'response.php');
require_once 'call.php';
require_once 'app.php';
require_once 'router.php';