Skip to content

Commit

Permalink
version 0.9.1 berly
Browse files Browse the repository at this point in the history
  • Loading branch information
subins2000 committed Aug 8, 2016
1 parent c63949f commit b7848ba
Show file tree
Hide file tree
Showing 444 changed files with 57,290 additions and 0 deletions.
8 changes: 8 additions & 0 deletions admin/ajax/set-timezone.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
$offset = Request::postParam("offset");
if($offset !== null){
$timeZone = \Lobby\Time::getTimezone($offset);
if(@date_default_timezone_set($timeZone))
\Lobby\DB::saveOption("lobby_timezone", $timeZone);
}
?>
1 change: 1 addition & 0 deletions admin/css/apps-grid.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions admin/css/apps.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions contents/extra/logs/app.site-compressor.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[2016-08-07 12:17:11] Command executed for compression : '/usr/bin/php' '/home/simsu/Other/projects/Web/Lobby/local/lobby.php' 'app' --a='site-compressor' --i='src/ajax/compress-bg.php' --data='siteID=lobby' > '/dev/null'
[2016-08-07 13:01:34] Command executed for compression : '/usr/bin/php' '/home/simsu/Other/projects/Web/Lobby/local/lobby.php' 'app' --a='site-compressor' --i='src/ajax/compress-bg.php' --data='siteID=lobby' > '/dev/null'
[2016-08-07 13:04:14] Command executed for compression : '/usr/bin/php' '/home/simsu/Other/projects/Web/Lobby/local/lobby.php' 'app' --a='site-compressor' --i='src/ajax/compress-bg.php' --data='siteID=lobby' > '/dev/null'
[2016-08-07 13:13:06] Command executed for compression : '/usr/bin/php' '/home/simsu/Other/projects/Web/Lobby/local/lobby.php' 'app' --a='site-compressor' --i='src/ajax/compress-bg.php' --data='siteID=lobby' > '/dev/null'
33 changes: 33 additions & 0 deletions contents/extra/logs/lobby.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[2016-08-07 07:36:34] Lobby Server Replied :
[2016-08-07 07:37:19] Lobby Server Replied :
[2016-08-07 07:37:36] Lobby Server Replied :
[2016-08-07 07:38:25] Lobby Server Replied :
[2016-08-07 07:42:45] Lobby Server Replied :
[2016-08-07 07:43:58] Lobby Server Replied :
[2016-08-07 07:45:11] Lobby Server Replied :
[2016-08-07 19:23:21] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 53 : syntax error, unexpected '}', expecting '('
[2016-08-07 19:38:00] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 69 : syntax error, unexpected '}'
[2016-08-07 19:38:10] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 69 : syntax error, unexpected '}', expecting '('
[2016-08-07 19:38:20] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 69 : syntax error, unexpected '}'
[2016-08-07 19:38:30] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 69 : syntax error, unexpected '}'
[2016-08-07 19:40:00] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:40:10] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:40:20] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:40:30] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:40:40] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:40:50] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:41:00] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:41:10] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:41:20] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:41:30] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:41:40] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:41:50] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:42:00] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:42:10] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:42:20] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:42:30] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:42:40] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:42:50] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:43:00] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:43:05] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
[2016-08-07 19:43:06] 4 caused by /home/simsu/Other/projects/Web/Lobby/local/contents/apps/site-compressor/App.php on line 51 : syntax error, unexpected '.1' (T_DNUMBER)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions contents/themes/hine/src/main/css/icons.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added contents/themes/hine/src/main/image/app-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions contents/themes/hine/src/main/image/icons/open-in-new.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions includes/lib/lobby/inc/view.error.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<html>
<head>
<?php
/**
* Load CSS Only
*/
echo Assets::getServeLinkTag();
?>
<title><?php echo $title;?> - Lobby</title>
</head>
<body>
<div id="workspace">
<div class="contents">
<h1><?php echo $title;?></h1>
<p><?php echo $description;?></p>
<p>
<a href="#" onclick="window.history.go(-1)">Return to previous page</a>
</p>
<p>
&copy; <a target='_blank' href='//lobby.subinsb.com'>Lobby</a> 2014 - <?php echo date("Y");?>
</p>
</div>
</div>
</body>
</html>
31 changes: 31 additions & 0 deletions includes/lib/lobby/inc/view.page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<html>
<head>
<?php
if(\Lobby::status("lobby.admin")){
\Hooks::doAction("admin.head.begin");
}else{
\Hooks::doAction("head.begin");
}
\Response::head();
if(\Lobby::status("lobby.admin")){
\Hooks::doAction("admin.head.end");
}else{
\Hooks::doAction("head.end");
}
?>
</head>
<body>
<?php
if(\Lobby::status("lobby.admin")){
\Hooks::doAction("admin.body.begin");
}else{
\Hooks::doAction("body.begin");
}
?>
<div id="workspace">
<?php
echo \Response::getPageContent();
?>
</div>
</body>
</html>
55 changes: 55 additions & 0 deletions includes/src/vendor/francium/process/tests/ProcessTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php
use Fr\Process;

class ProcessTest extends PHPUnit_Framework_TestCase {

public function testStartAProcess(){
$tmpFile = tempnam(sys_get_temp_dir(), "FranciumProcess");
$PR = new Process(Process::getPHPExecutable(), array(
"arguments" => array(
"-r" => "echo 'hello';echo 'world';"
),
"output" => $tmpFile
));
$PR->start();

$this->assertNotEquals("helloworld", file_get_contents($tmpFile));

/**
* Let the bg process complete
*/
sleep(1);
$this->assertEquals("helloworld", file_get_contents($tmpFile));

// Remove temporary file
unlink($tmpFile);
}

public function testStopAProcess(){
$tmpFile = tempnam(sys_get_temp_dir(), "FranciumProcess");
$PR = new Process(Process::getPHPExecutable(), array(
"arguments" => array(
"-r" => "file_put_contents('$tmpFile', 'hello');sleep('3');file_put_contents('$tmpFile', 'world');"
)
));
$PR->start();

/**
* Let the bg process start
*/
sleep(1);
$this->assertEquals("hello", file_get_contents($tmpFile));

var_dump($PR->stop());

/**
* It would take 5 seconds for bg process to complete
*/
sleep(3);
$this->assertNotEquals("world", file_get_contents($tmpFile));

// Remove temporary file
unlink($tmpFile);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<?php
/**
* Klein (klein.php) - A fast & flexible router for PHP
*
* @author Chris O'Hara <[email protected]>
* @author Trevor Suarez (Rican7) (contributor and v2 refactorer)
* @copyright (c) Chris O'Hara
* @link https://github.com/chriso/klein.php
* @license MIT
*/

namespace Klein\Tests;

use Klein\Klein;
use Klein\Request;
use Klein\Response;
use Klein\Tests\Mocks\HeadersNoOp;
use PHPUnit_Framework_TestCase;

/**
* AbstractKleinTest
*
* Base test class for PHP Unit testing
*/
abstract class AbstractKleinTest extends PHPUnit_Framework_TestCase
{

/**
* The automatically created test Klein instance
* (for easy testing and less boilerplate)
*
* @type Klein
*/
protected $klein_app;


/**
* Setup our test
* (runs before each test)
*
* @return void
*/
protected function setUp()
{
// Create a new klein app,
// since we need one pretty much everywhere
$this->klein_app = new Klein();
}

/**
* Quick method for dispatching and returning our output from our shared Klein instance
*
* This is mostly useful, since the tests would otherwise have to make a bunch of calls
* concerning the argument order and constants. DRY, bitch. ;)
*
* @param Request $request Custom Klein "Request" object
* @param Response $response Custom Klein "Response" object
* @return mixed The output of the dispatch call
*/
protected function dispatchAndReturnOutput($request = null, $response = null)
{
return $this->klein_app->dispatch(
$request,
$response,
false,
Klein::DISPATCH_CAPTURE_AND_RETURN
);
}

/**
* Runs a callable and asserts that the output from the executed callable
* matches the passed in expected output
*
* @param mixed $expected The expected output
* @param callable $callback The callable function
* @param string $message (optional) A message to display if the assertion fails
* @return void
*/
protected function assertOutputSame($expected, $callback, $message = '')
{
// Start our output buffer so we can capture our output
ob_start();

call_user_func($callback);

// Grab our output from our buffer
$out = ob_get_contents();

// Clean our buffer and destroy it, so its like no output ever happened. ;)
ob_end_clean();

// Use PHPUnit's built in assertion
$this->assertSame($expected, $out, $message);
}

/**
* Loads externally defined routes under the filename's namespace
*
* @param Klein $app_context The application context to attach the routes to
* @return array
*/
protected function loadExternalRoutes(Klein $app_context = null)
{
// Did we not pass an instance?
if (is_null($app_context)) {
$app_context = $this->klein_app ?: new Klein();
}

$route_directory = __DIR__ . '/routes/';
$route_files = scandir($route_directory);
$route_namespaces = array();

foreach ($route_files as $file) {
if (is_file($route_directory . $file)) {
$route_namespace = '/' . basename($file, '.php');
$route_namespaces[] = $route_namespace;

$app_context->with($route_namespace, $route_directory . $file);
}
}

return $route_namespaces;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?php
/**
* Klein (klein.php) - A fast & flexible router for PHP
*
* @author Chris O'Hara <[email protected]>
* @author Trevor Suarez (Rican7) (contributor and v2 refactorer)
* @copyright (c) Chris O'Hara
* @link https://github.com/chriso/klein.php
* @license MIT
*/

namespace Klein\Tests;

use Klein\AbstractRouteFactory;
use Klein\Route;

/**
* AbstractRouteFactoryTest
*/
class AbstractRouteFactoryTest extends AbstractKleinTest
{

/**
* Helpers
*/

protected function getDefaultMethodsToMock()
{
return array(
'build',
);
}

protected function getMockForFactory()
{
return $this->getMockForAbstractClass('\Klein\AbstractRouteFactory');
}

protected function getMockBuilderForFactory(array $methods_to_mock = null)
{
$methods_to_mock = $methods_to_mock ?: $this->getDefaultMethodsToMock();

return $this->getMockBuilder('\Klein\AbstractRouteFactory')
->setMethods($methods_to_mock);
}


/**
* Tests
*/

public function testNamespaceGetSet()
{
// Test data
$test_namespace = '/users';

// Empty constructor
$factory = $this->getMockForFactory();

$this->assertNull($factory->getNamespace());

// Set in constructor
$factory = $this->getMockBuilderForFactory()
->setConstructorArgs(
array(
$test_namespace,
)
)
->getMock();

$this->assertSame($test_namespace, $factory->getNamespace());

// Set in method
$factory = $this->getMockForFactory();
$factory->setNamespace($test_namespace);

$this->assertSame($test_namespace, $factory->getNamespace());
}

public function testAppendNamespace()
{
// Test data
$test_namespace = '/users';
$test_namespace_append = '/names';

$factory = $this->getMockForFactory();
$factory->setNamespace($test_namespace);
$factory->appendNamespace($test_namespace_append);

$this->assertSame(
$test_namespace . $test_namespace_append,
$factory->getNamespace()
);
}
}
Loading

0 comments on commit b7848ba

Please sign in to comment.