@@ -35,7 +35,7 @@ |
||
| 35 | 35 | if (!$element->isRendered()) { |
| 36 | 36 | $return .= '<li class="row">'; |
| 37 | 37 | |
| 38 | - $return = $this->renderLabel($element); |
|
| 38 | + $return = $this->renderLabel($element); |
|
| 39 | 39 | |
| 40 | 40 | $class = "value " . ($element->getType() == 'input' ? 'input' : ''); |
| 41 | 41 | $return .= '<span class="'.$class.'">'; |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | public function renderElements() { |
| 17 | 17 | $return = '<ul'; |
| 18 | 18 | foreach ($this->_list as $attrib => $value) { |
| 19 | - $return .= ' '. $attrib .'="'. $value .'"'; |
|
| 19 | + $return .= ' ' . $attrib . '="' . $value . '"'; |
|
| 20 | 20 | } |
| 21 | 21 | $return .= '>'; |
| 22 | 22 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $return = $this->renderLabel($element); |
| 39 | 39 | |
| 40 | 40 | $class = "value " . ($element->getType() == 'input' ? 'input' : ''); |
| 41 | - $return .= '<span class="'.$class.'">'; |
|
| 41 | + $return .= '<span class="' . $class . '">'; |
|
| 42 | 42 | $return .= $element->renderElement(); |
| 43 | 43 | $return .= '</span>'; |
| 44 | 44 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $this->_data[$idRow][$idCol]['element'] = $element; |
| 39 | 39 | $this->_data[$idRow][$idCol]['type'] = $type; |
| 40 | 40 | if (!in_array($idCol, $this->_cols)) { |
| 41 | - $this->_cols[]= $idCol; |
|
| 41 | + $this->_cols[] = $idCol; |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
@@ -50,13 +50,13 @@ discard block |
||
| 50 | 50 | public function renderElements() { |
| 51 | 51 | $return = '<table'; |
| 52 | 52 | foreach ($this->_table as $attrib => $value) { |
| 53 | - $return .= ' '. $attrib .'="'. $value .'"'; |
|
| 53 | + $return .= ' ' . $attrib . '="' . $value . '"'; |
|
| 54 | 54 | } |
| 55 | 55 | $return .= '>'; |
| 56 | 56 | $renderRows = $this->renderRows(); |
| 57 | 57 | $return .= '<tbody'; |
| 58 | 58 | foreach ($this->_tbody as $attrib => $value) { |
| 59 | - $return .= ' '. $attrib .'="'. $value .'"'; |
|
| 59 | + $return .= ' ' . $attrib . '="' . $value . '"'; |
|
| 60 | 60 | } |
| 61 | 61 | $return .= '>'; |
| 62 | 62 | if ($renderRows) { |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $return .= '<tr'; |
| 78 | 78 | if ($this->_rows[$idRow]) { |
| 79 | 79 | foreach ($this->_rows[$idRow] as $attrib => $value) { |
| 80 | - $return .= ' '. $attrib .'="'. $value .'"'; |
|
| 80 | + $return .= ' ' . $attrib . '="' . $value . '"'; |
|
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | foreach ($elements as $element) { |
| 8 | 8 | if (!$element->isRendered()) { |
| 9 | 9 | $idRow = $element->getUniqueId(); |
| 10 | - $this->setRowAttrib($idRow, 'class', "row ". $idRow); |
|
| 10 | + $this->setRowAttrib($idRow, 'class', "row " . $idRow); |
|
| 11 | 11 | $this->addCell($idRow, 1, $element, 'label'); |
| 12 | 12 | $this->addCell($idRow, 2, $element, 'value'); |
| 13 | 13 | } |
@@ -5,44 +5,44 @@ |
||
| 5 | 5 | class Process |
| 6 | 6 | { |
| 7 | 7 | |
| 8 | - protected $_pid; |
|
| 9 | - protected $_command; |
|
| 10 | - |
|
| 11 | - public function __construct($command = false) |
|
| 12 | - { |
|
| 13 | - if ($command) { |
|
| 14 | - $this->_command = $command; |
|
| 15 | - } |
|
| 16 | - } |
|
| 17 | - |
|
| 18 | - public function run() |
|
| 19 | - { |
|
| 20 | - $command = "nohup $this->_command > /dev/null 2>&1 & echo $!"; |
|
| 21 | - $this->_pid = shell_exec($command); |
|
| 22 | - |
|
| 23 | - return $this; |
|
| 24 | - } |
|
| 25 | - |
|
| 26 | - public function running() |
|
| 27 | - { |
|
| 28 | - exec("ps -p $this->_pid", $output); |
|
| 29 | - return isset($output[1]); |
|
| 30 | - } |
|
| 31 | - |
|
| 32 | - public function stop() |
|
| 33 | - { |
|
| 34 | - exec("kill $this->_pid"); |
|
| 35 | - return !$this->running(); |
|
| 36 | - } |
|
| 37 | - |
|
| 38 | - public function setPID($pid) |
|
| 39 | - { |
|
| 40 | - $this->_pid = $pid; |
|
| 41 | - } |
|
| 42 | - |
|
| 43 | - public function getPID() |
|
| 44 | - { |
|
| 45 | - return $this->_pid; |
|
| 46 | - } |
|
| 8 | + protected $_pid; |
|
| 9 | + protected $_command; |
|
| 10 | + |
|
| 11 | + public function __construct($command = false) |
|
| 12 | + { |
|
| 13 | + if ($command) { |
|
| 14 | + $this->_command = $command; |
|
| 15 | + } |
|
| 16 | + } |
|
| 17 | + |
|
| 18 | + public function run() |
|
| 19 | + { |
|
| 20 | + $command = "nohup $this->_command > /dev/null 2>&1 & echo $!"; |
|
| 21 | + $this->_pid = shell_exec($command); |
|
| 22 | + |
|
| 23 | + return $this; |
|
| 24 | + } |
|
| 25 | + |
|
| 26 | + public function running() |
|
| 27 | + { |
|
| 28 | + exec("ps -p $this->_pid", $output); |
|
| 29 | + return isset($output[1]); |
|
| 30 | + } |
|
| 31 | + |
|
| 32 | + public function stop() |
|
| 33 | + { |
|
| 34 | + exec("kill $this->_pid"); |
|
| 35 | + return !$this->running(); |
|
| 36 | + } |
|
| 37 | + |
|
| 38 | + public function setPID($pid) |
|
| 39 | + { |
|
| 40 | + $this->_pid = $pid; |
|
| 41 | + } |
|
| 42 | + |
|
| 43 | + public function getPID() |
|
| 44 | + { |
|
| 45 | + return $this->_pid; |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | 48 | } |
| 49 | 49 | \ No newline at end of file |
@@ -3,24 +3,24 @@ |
||
| 3 | 3 | class Nip_Hash |
| 4 | 4 | { |
| 5 | 5 | |
| 6 | - protected static $golden_primes = array( |
|
| 7 | - 36 => array(1, 23, 809, 28837, 1038073, 37370257, 1345328833) |
|
| 8 | - ); |
|
| 6 | + protected static $golden_primes = array( |
|
| 7 | + 36 => array(1, 23, 809, 28837, 1038073, 37370257, 1345328833) |
|
| 8 | + ); |
|
| 9 | 9 | |
| 10 | - public static function uhash($num, $len = 5, $base = 36) |
|
| 11 | - { |
|
| 12 | - $gp = self::$golden_primes[$base]; |
|
| 13 | - $maxlen = count($gp); |
|
| 14 | - $len = $len > ($maxlen - 1) ? ($maxlen - 1) : $len; |
|
| 15 | - while ($len < $maxlen && pow($base, $len) < $num) |
|
| 16 | - $len++; |
|
| 17 | - if ($len >= $maxlen) |
|
| 18 | - throw new Exception($num . " out of range (max " . pow($base, $maxlen - 1) . ")"); |
|
| 19 | - $ceil = pow($base, $len); |
|
| 20 | - $prime = $gp[$len]; |
|
| 21 | - $dechash = ($num * $prime) % $ceil; |
|
| 22 | - $hash = base_convert($dechash, 10, $base); |
|
| 23 | - return str_pad($hash, $len, "0", STR_PAD_LEFT); |
|
| 24 | - } |
|
| 10 | + public static function uhash($num, $len = 5, $base = 36) |
|
| 11 | + { |
|
| 12 | + $gp = self::$golden_primes[$base]; |
|
| 13 | + $maxlen = count($gp); |
|
| 14 | + $len = $len > ($maxlen - 1) ? ($maxlen - 1) : $len; |
|
| 15 | + while ($len < $maxlen && pow($base, $len) < $num) |
|
| 16 | + $len++; |
|
| 17 | + if ($len >= $maxlen) |
|
| 18 | + throw new Exception($num . " out of range (max " . pow($base, $maxlen - 1) . ")"); |
|
| 19 | + $ceil = pow($base, $len); |
|
| 20 | + $prime = $gp[$len]; |
|
| 21 | + $dechash = ($num * $prime) % $ceil; |
|
| 22 | + $hash = base_convert($dechash, 10, $base); |
|
| 23 | + return str_pad($hash, $len, "0", STR_PAD_LEFT); |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | 26 | } |
@@ -12,10 +12,12 @@ |
||
| 12 | 12 | $gp = self::$golden_primes[$base]; |
| 13 | 13 | $maxlen = count($gp); |
| 14 | 14 | $len = $len > ($maxlen - 1) ? ($maxlen - 1) : $len; |
| 15 | - while ($len < $maxlen && pow($base, $len) < $num) |
|
| 16 | - $len++; |
|
| 17 | - if ($len >= $maxlen) |
|
| 18 | - throw new Exception($num . " out of range (max " . pow($base, $maxlen - 1) . ")"); |
|
| 15 | + while ($len < $maxlen && pow($base, $len) < $num) { |
|
| 16 | + $len++; |
|
| 17 | + } |
|
| 18 | + if ($len >= $maxlen) { |
|
| 19 | + throw new Exception($num . " out of range (max " . pow($base, $maxlen - 1) . ")"); |
|
| 20 | + } |
|
| 19 | 21 | $ceil = pow($base, $len); |
| 20 | 22 | $prime = $gp[$len]; |
| 21 | 23 | $dechash = ($num * $prime) % $ceil; |
@@ -37,9 +37,9 @@ |
||
| 37 | 37 | $this->userAgent = $_SERVER['HTTP_USER_AGENT']; |
| 38 | 38 | $this->accept = $_SERVER['HTTP_ACCEPT']; |
| 39 | 39 | |
| 40 | - if (isset($_SERVER['HTTP_X_WAP_PROFILE'])|| isset($_SERVER['HTTP_PROFILE'])) { |
|
| 40 | + if (isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE'])) { |
|
| 41 | 41 | $this->isMobile = true; |
| 42 | - } elseif (strpos($this->accept,'text/vnd.wap.wml') > 0 || strpos($accept,'application/vnd.wap.xhtml+xml') > 0) { |
|
| 42 | + } elseif (strpos($this->accept, 'text/vnd.wap.wml') > 0 || strpos($accept, 'application/vnd.wap.xhtml+xml') > 0) { |
|
| 43 | 43 | $this->isMobile = true; |
| 44 | 44 | } else { |
| 45 | 45 | foreach ($this->devices as $device => $regexp) { |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | - * @param bool|AutoLoader $autoLoader |
|
| 29 | + * @param AutoLoader $autoLoader |
|
| 30 | 30 | * @return $this |
| 31 | 31 | */ |
| 32 | 32 | public function setAutoLoader($autoLoader = false) |
@@ -122,7 +122,7 @@ |
||
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
| 125 | - * @param $filePath |
|
| 125 | + * @param string $filePath |
|
| 126 | 126 | * @return bool |
| 127 | 127 | */ |
| 128 | 128 | protected function readCacheFile($filePath) |
@@ -11,7 +11,6 @@ |
||
| 11 | 11 | /** |
| 12 | 12 | * Parses a file from `$path` and gets its contents as an array |
| 13 | 13 | * |
| 14 | - * @param string $path |
|
| 15 | 14 | * |
| 16 | 15 | * @return array |
| 17 | 16 | */ |