Skip to content

Commit e269166

Browse files
committed
Initial commit, build 6030
0 parents  commit e269166

File tree

392 files changed

+31477
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

392 files changed

+31477
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kraken-data/log/*
2+
kraken-data/tmp/*
3+
.idea
4+
vendor/
5+
composer.lock
6+
composer.phar

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CHANGELOG for 0.2.x
2+
===================
3+
4+
This changelog references the relevant changes (bug and security fixes) done
5+
in 0.2 minor versions.
6+
7+
* 0.2.0 (2016-01-30)
8+
9+
* Initial release

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2015-2016 Kamil Jamróz
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
## KrakenPHP Framework
2+
3+
KrakenPHP is the first and only multi-processed, multi-threaded, fault-tolerant framework for PHP. It has been written
4+
to provide easy and reliable API for creating distributed applications using PHP. KrakenPHP aims to solve typical
5+
problems of writing such applications and to provide developers with powerful yet elegant tools for dealing with them.
6+
7+
The main focus of KrakenPHP is put on:
8+
* Concurrency and distribution
9+
Create systems that are asynchronous and distributed by design. Run them on multiple threads, processors or hosts
10+
and manage from single place.
11+
* Error-tolerant design
12+
Write systems that self-heal using remote and local supervision hierarchies.
13+
* Elasticity
14+
Keep business logic of your applications inside universal containers and connections between them separately. Modify
15+
existing architecture and number of running containers in realtime without need to change in code.
16+
* High performance
17+
Handle up to thousands of simultaneous connections per second on single container. Use multiple containers on several
18+
processors and/or hosts to push it even further.
19+
* Extensibility
20+
Use available options to easily extend and adapt framework features for your needs.
21+
22+
Then again, start writing applications that were previously marked as impossible or hard to implement in PHP right know.
23+
Servers, service-oriented architecture, agent-based models, games, complex daemons, socket programs, schedulers
24+
and much, much more - nothing is impossible with KrakenPHP!
25+
26+
## Features
27+
28+
Full list of features can be found on [official webpage][1].
29+
30+
## Official Documentation
31+
32+
Documentation for the framework can be found in the [official documentation][2].
33+
34+
## Installation
35+
36+
Installation instructions can be found in [installation guide][3].
37+
38+
## Frequently Asked Questions
39+
40+
If there are any questions that you have about framework, you can check whether the answers
41+
for them have been already posted in [KrakenPHP faq][4].
42+
43+
## Contributing
44+
45+
Thank you for considering contributing to KrakenPHP framework! The contribution guide can be found in the [contribution tips][5].
46+
47+
### License
48+
49+
KrakenPHP framework is open-sourced software licensed under the [MIT license][6].
50+
51+
[1]: http://kraken-php.com
52+
[2]: http://kraken-php.com/docs
53+
[3]: http://kraken-php.com/getting_started
54+
[4]: http://kraken-php.com/faq
55+
[5]: http://kraken-php.com/docs/contributions
56+
[6]: http://opensource.org/licenses/MIT

composer.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "kraken-php/kraken-framework",
3+
"description": "The first and only multi-processed, multi-threaded, fault-tolerant framework for PHP.",
4+
"keywords": [
5+
"kraken", "framework", "websocket", "socket", "server", "asynchronous", "soa", "thread", "process", "fault-tolerant", "fault-tolerance"
6+
],
7+
"license": "MIT",
8+
"homepage": "http://kraken-php.com",
9+
"authors": [
10+
{
11+
"name": "Kamil Jamroz"
12+
}
13+
],
14+
"require": {
15+
"php": ">=5.5.0",
16+
"symfony/console": "2.6.*",
17+
"league/flysystem": "1.0.*",
18+
"league/container": "1.3.*",
19+
"monolog/monolog": "1.13.*"
20+
},
21+
"require-dev": {
22+
23+
},
24+
"suggest": {
25+
"ext-libevent": ">=0.1.0",
26+
"ext-event": "~1.0",
27+
"ext-libev": "*"
28+
},
29+
"autoload": {
30+
"psr-4": {
31+
"Kraken\\": "src",
32+
"App\\": "app/"
33+
}
34+
},
35+
"scripts": {
36+
"post-install-cmd": [
37+
"Kraken\\Composer\\ScriptHandler::buildBootstrap"
38+
],
39+
"post-update-cmd": [
40+
"Kraken\\Composer\\ScriptHandler::buildBootstrap"
41+
]
42+
},
43+
"minimum-stability": "dev",
44+
"extra": {
45+
"branch-alias": {
46+
"dev-master": "0.2-dev"
47+
}
48+
}
49+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
global $argv;
4+
global $argc;
5+
6+
if (!defined('STDIN') || $argc < 3)
7+
{
8+
echo("Tried to execute program outside of CLI mode or not enough parameters have been passed.\n");
9+
exit(1);
10+
}
11+
12+
$parent = (string) $argv[1];
13+
$alias = (string) $argv[2];
14+
$name = (string) $argv[3];

kraken-data/autorun/kraken.process

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
/**
4+
* Declare paths
5+
*/
6+
$dataPath = realpath(__DIR__ . '/..');
7+
$basePath = realpath($dataPath . '/..');
8+
9+
/**
10+
* Include autoloader & dependencies.
11+
*/
12+
require $basePath . '/vendor/autoload.php';
13+
require_once $dataPath . '/autorun/autoload.params';
14+
15+
/**
16+
* Create process instance.
17+
*/
18+
try
19+
{
20+
$process = (new \Kraken\Boot\ProcessBoot)
21+
->params([
22+
'prefix' => 'App',
23+
'name' => $name
24+
])
25+
->constructor([
26+
$parent,
27+
$alias,
28+
$name
29+
])
30+
->boot(
31+
$dataPath
32+
);
33+
34+
$process
35+
->create();
36+
}
37+
catch (\Exception $ex)
38+
{
39+
echo \Kraken\Exception\Exception::toString($ex) . PHP_EOL;
40+
}

kraken-data/autorun/kraken.thread

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
/**
4+
* Declare paths
5+
*/
6+
$dataPath = realpath(__DIR__ . '/..');
7+
$basePath = realpath($dataPath . '/..');
8+
9+
/**
10+
* Include autoloader & dependencies.
11+
*/
12+
require $basePath . '/vendor/autoload.php';
13+
require_once $dataPath . '/autorun/autoload.params';
14+
15+
/**
16+
* Create thread instance.
17+
*/
18+
try
19+
{
20+
$process = (new \Kraken\Boot\ThreadBoot)
21+
->params([
22+
'prefix' => 'App',
23+
'name' => $name
24+
])
25+
->constructor([
26+
$parent,
27+
$alias,
28+
$name
29+
])
30+
->boot(
31+
$dataPath
32+
);
33+
34+
$process
35+
->create();
36+
}
37+
catch (\Exception $ex)
38+
{
39+
echo \Kraken\Exception\Exception::toString($ex) . PHP_EOL;
40+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
/**
3+
* Bootstrap file for ProcessContainers.
4+
* Any modifications in this file should be done with exceptional care.
5+
*/
6+
7+
$core = new \Kraken\Runtime\Process\ProcessCore(
8+
__DIR__ . '/../../'
9+
);
10+
11+
$providers = [
12+
/**
13+
* List of service providers that needs to be registered for your application to work correctly.
14+
*/
15+
];
16+
17+
$aliases = [
18+
/**
19+
* List of aliases that needs to be registered in IoC container for specified interfaces.
20+
*/
21+
];
22+
23+
$core->registerProviders($providers);
24+
$core->registerAliases($aliases);
25+
26+
return $core;

0 commit comments

Comments
 (0)