Skip to content

Commit

Permalink
Checked syntaxis errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc committed Nov 25, 2011
1 parent 5dcd9be commit c723abc
Show file tree
Hide file tree
Showing 7 changed files with 292 additions and 19 deletions.
4 changes: 2 additions & 2 deletions Driver/Gearman/GearmanAnnotations.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ final class Work extends Annotation
* @var mixed
*/
public $servers = null;

/**
* Service typeof Class. If it's defined, object will be instanced throught service dependence injection.
* Otherwise, class will be instance with new() method
*
*
* @var string
*/
public $service = null;
Expand Down
4 changes: 2 additions & 2 deletions MmoreramerinoGearmanBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ public function boot()
$reader->setDefaultAnnotationNamespace('Mmoreramerino\GearmanBundle\Driver\\');
$workerCollection = new WorkerCollection;
$bundles = $this->container->get('kernel')->getBundles();

foreach ($bundles as $bundle) {

if (!\in_array($bundle->getNamespace(), $this->getParseableBundles())) {
continue;
}
Expand Down
1 change: 0 additions & 1 deletion README

This file was deleted.

273 changes: 273 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<style type="text/css">
.wp_syntax {
white-space:pre-wrap;
-moz-border-radius:8px;
-webkit-border-radius:8px;
-o-border-radius:8px;
-ms-border-radius:8px;
-khtml-border-radius:8px;
border-radius:8px;
background-color:#F9F9F9;
border:1px solid silver;
color:#100;
overflow:auto;
overflow-x:auto;
overflow-y:hidden;
width:100%;
margin:0 0 1.5em;
padding:1em 1em expression(this.scrollWidth > this.offsetWidth ? 15 : 0) 1em;
}

.wp_syntax table {
border-collapse:collapse;
}

.wp_syntax div,.wp_syntax td {
vertical-align:top;
padding:2px 4px;
}

.wp_syntax .line_numbers {
background-color:#DEF;
color:gray;
overflow:visible;
text-align:right;
}

.wp_syntax .code {
background-color:#232125 !important;
}

.wp_syntax pre {
color:#ccc;
font-family:Consolas, Lucida Console, Monaco, monospace;
background-color:#232125;
clear:none;
float:none;
font-size:12px;
line-height:1.333;
overflow:visible;
white-space:pre;
width:auto;
margin:0;
padding:0;
}

.de1 {
color:#ddd;
}

.de2 {
color:#bbb;
}

.kw1 {
color:#FF8400;
background-color:#222;
}

.kw2 {
color:#FF8400;
font-weight:400;
background-color:#222;
}

.kw3 {
color:#fd6;
background-color:#222;
}

.kw4 {
color:#F83;
font-weight:400;
}

.co0 {
color:#6d6;
font-style:italic;
}

.co2 {
color:#8d8;
font-style:italic;
}

.co3 {
color:#9d9;
font-style:italic;
}

.coMULTI {
color:#bdb;
font-style:italic;
}

.es0 {
color:#e3e;
}

.es_h {
color:#909;
}

.sy0 {
color:#E0882F;
}

.sy1 {
color:#aff;
background-color:#039;
}

.nu0 {
color:#e66;
}

.nu8 {
color:#cc6;
}

.nu12 {
color:#6cc;
}

.nu19 {
color:#c6c;
}

.me1 {
color:#FFF;
font-weight:400;
}

.me2 {
color:#ccb;
}

.re0 {
color:#fff;
font-weight:400;
}

.re1 {
color:#ccc;
font-weight:700;
}

a {
text-decoration:none;
}

.diff .kw1 {
color:#aaa;
font-style:italic;
}

.diff .re0 {
color:#408;
}

.diff .re1 {
color:#f33;
}

.diff .re2 {
color:#00b000;
}

.diff .re3 {
color:#f96;
}

.diff .re4 {
color:#9f9;
}

.diff .re5 {
color:#01d;
}

.diff .re6 {
color:#96f;
}

.diff .re7 {
color:#f66;
}

.diff .re8 {
color:#5f5;
}

.diff .re9 {
color:#882;
}

.one-column #page {
max-width:none;
}

.wp_syntax td {
border-width:0;
}

.entry-content .wp_syntax table,.wp_syntax .comment-content table {
border-bottom:none !important;
margin:0;
}

.co1,.co4 {
color:#B729D9;
font-style:italic;
}

.st0,.st_h {
color:#56DB3A;
}

.br0,.re2,.re3,.re4,.re5,.re6,.re7,.re8,.re9 {
color:#fff;
}

</style>
<head>
<body>
<h1>README</h1>
<h2>What is GearmanBundle?</h2>
<p>GearmanBundle is a bundle for symfony2 intended provide a easy way support developers who need use job queues.</p>
<p>It uses annotations to define Jobs and Workers' options.</p>

<h2>Requirements</h2>
<p>To work with GearmanBundle needed, PHP 5.3, Gearman and Symfony2</p>

<h2>Installation</h2>
<p>You have two options to install in its Framework Gearman2 by Vendor or by repository. The two options are based on the same basis but one requires a little configuration.</p>
<p>On the one hand we can set ourselves the repository as follows</p>
<div class="wp_syntax">
<div class="code">
<pre class="php">
<span class="br0">~/path/to/my/bundles<span class="kw2">[master]</span>: git clone git://github.com/mmoreramerino/GearmanBundle.git</span>
</pre>
</div>
</div>
<p>Moreover, you can include this repository in the list of vendors and reinstall again</p>
<div class="wp_syntax">
<div class="code">
<pre class="php">
<span class="br0">~/path/to/my/bundles<span class="kw2">[master]</span>: git clone git://github.com/mmoreramerino/GearmanBundle.git</span>
</pre>
</div>
</div>


<h2>Documentation</h2>


<h2>Contributing</h2>
*open source
* feel free
</body>
</html>
11 changes: 6 additions & 5 deletions Service/Gearman.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
*/
class Gearman extends GearmanService implements GearmanInterface
{

/**
* Server variable to define in what server must connect to
*
* @var array
*/
public $server = null;

/**
* If workers are not loaded, they're loaded and returned.
* Otherwise, they are simply returned
Expand Down Expand Up @@ -160,7 +160,7 @@ private function enqueue($jobName, $params, $method)
private function doEnqueue(Array $worker, $params='', $method='do')
{
$gmclient= new \GearmanClient();

if (null === $this->server || !is_array($this->server)) {
$gmclient->addServer();
} else {
Expand All @@ -169,12 +169,13 @@ private function doEnqueue(Array $worker, $params='', $method='do')

return $gmclient->$method($worker['job']['realCallableName'], serialize($params));
}

/**
* Set server of gearman
*
* @param type $servername Server name (must be ip)
* @param type $port Port of server. By default 4730
*
*
* @return Gearman Returns self object
*/
public function setServer($servername, $port = 4730)
Expand Down
6 changes: 3 additions & 3 deletions Service/GearmanExecute.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ private function callJob(Array $worker)
} else {
$gmworker->addServer();
}


if (null !== $worker['service']) {
$objInstance = $this->container->get($worker['service']);
} else {
$objInstance = new $worker['className'];
}

$gmworker->addFunction($job['realCallableName'], array($objInstance, $job['methodName']));

$iter = isset($job['iter']) ? (int) ($job['iter']) : 0;
Expand Down
12 changes: 6 additions & 6 deletions codesniffer.log
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Time: 0 seconds, Memory: 4.00Mb

Time: 0 seconds, Memory: 4.50Mb

Time: 0 seconds, Memory: 5.25Mb
Time: 1 second, Memory: 5.25Mb

Time: 0 seconds, Memory: 5.75Mb
Time: 0 seconds, Memory: 6.00Mb

Time: 1 second, Memory: 4.75Mb
Time: 0 seconds, Memory: 4.75Mb

Time: 0 seconds, Memory: 5.00Mb

Expand All @@ -18,15 +18,15 @@ Time: 0 seconds, Memory: 5.75Mb

Time: 0 seconds, Memory: 5.75Mb

Time: 0 seconds, Memory: 5.25Mb
Time: 0 seconds, Memory: 5.50Mb

Time: 0 seconds, Memory: 4.75Mb

Time: 0 seconds, Memory: 4.50Mb
Time: 1 second, Memory: 4.50Mb

Time: 0 seconds, Memory: 5.25Mb

Time: 1 second, Memory: 6.00Mb
Time: 0 seconds, Memory: 6.00Mb

Time: 0 seconds, Memory: 4.50Mb

Expand Down

0 comments on commit c723abc

Please sign in to comment.