 Sponsor | ntltrmllgnc | Jun 26, 2007 5:24pm | It's a php class that streamlines connecting instances into networks.
I'm thinking of GPLing my version but I want to put it out in the wild with the express statement that all I expect is behavior conformance. I'd like to see it go viral. It's so small that anyone could make a clone. |
|
|
 Sponsor | trevho | Jun 26, 2007 10:21pm | | yes licence it any way you see fit or the wrong person will claim it and make it proprietary |
|
|
 Sponsor | ntltrmllgnc | Jun 27, 2007 11:22am | | My copy will GPLed but I want proprietary and free copies (I have my reasons). |
|
|
 Sponsor | Thlayli | Jun 27, 2007 12:14pm | The biggest reason you need to GPL or CC your work is that, with no declared license, a fully restrictive copyright is in effect. If you want others to be able to use your code, you need to tell them they can.
I wish I had included GPL licensing in more of my smallish projects. It's annoying to have to go back and fix it now, and people undoubtedly have copies on their drives which don't have the info. |
|
|
 Sponsor | Morosoph | Jun 27, 2007 11:54pm | 1. The GPL is a licence, meaning that you give the user more freedoms than they'd have by default. Commercial dual licencing is very common, which means that someone has to pay you for the right to close-source your work.
The GPL is one of the few free software licences that preserves a sizable incentive to buy your work. |
|
|
 Sponsor | ntltrmllgnc | Jul 4, 2007 8:28pm | [?php
class Node {
private $init = FALSE;
private $sources = array();
private $filters = array();
private $targets = array();
protected function init() {}
protected function request($input) {}
protected function deliver() {}
final public function __destruct() { $this->contact(); }
final public function getNodes($nodes) { return $this->$nodes; }
final public function setNodes() {
$list = func_get_args();
$nodes = array_shift($list);
if (empty($list)) $this->$nodes = array();
$this->$nodes = array_merge($this->$nodes, $list);
}
final private function flatten($arr) {
$flat = array();
foreach($arr as $value) {
if (is_array($value)) $flat = array_merge($flat, $this->flatten($value));
else $flat[] = $value;
}
return $flat;
}
final private function process($request) {
$done = array();
foreach($request as $value) {
if (!is_null($value)) {
$reqd = $this->request($value);
if (!is_null($reqd)) $done[] = $reqd;
else $done[] = $value;
}
}
return $done;
}
final private function forward($content) {
if (!empty($this->targets)) {
foreach($this->targets as $target) {
foreach($content as $value) {
$target->contact($value);
}
}
$content = array();
} else return $content;
}
final public function contact() {
$args = func_get_args();
if (empty($args)) $args = array(NULL);
foreach($args as $input) {
$output = array();
if (is_bool($input)) return $input;
if ($this->init === is_null($input)) {
if ($this->init === FALSE) $result = $this->init($input);
$this->init = !is_null($input);
if (is_null($input)) {
$result = $this->deliver();
if (!empty($this->sources)) {
foreach($this->sources as $source) {
$content[] = $source->contact();
}
}
}
if (!is_null($result)) $content[] = $result;
$content = $this->forward($content);
}
if (!is_array($input)) $result = array($input);
else $result = $input;
if (is_null($input)) $result = NULL;
if (!is_null($result)) {
if (!empty($this->filters)) {
foreach($this->filters as $filter) {
$result = $filter->contact($result);
$done = $this->process($result);
}
} else $done = $this->process($result);
$result = $this->forward($done);
if (!empty($result)) $content[] = $result;
}
if (!empty($content)) $output[] = $content;
}
if (!empty($output)) return $this->flatten($output);
}
}
?] |
|
|

| rmartish | Jul 6, 2007 6:25am | | Yes, I think the best thing to do is to dual license it. That way you can make a profit if you so choose to like MySQL. |
|
|

| dehvknull | Aug 1, 2007 10:30pm | | @rmartish: I completely disagree with you. That is wrong and entirely against the spirit of Free Software. You are saying that you can't make a profit with the GPL, right? Think again. To the original poster; please ignore his advice, ideas like that hold back progress. |
|
|
 Sponsor | ntltrmllgnc | Aug 1, 2007 10:39pm | | Well it's 20 lines now. Licensing 20 lines seems Odd. |
|
|

| Tabmow | Aug 2, 2007 12:29am | | Maybe dual license it with a CC attribution license and GPL? |
|
|
|