Installed FirePHP with composer

This commit is contained in:
Raphaël Doursenaud
2015-09-17 16:08:00 +02:00
parent 9cbd236c8c
commit 2cf0f240b9
27 changed files with 5006 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
The [PINF JavaScript Loader](https://github.com/pinf/loader-js) is used to provide a development environment and package releases for this project.
**NOTE:** It is assumed you have the _PINF JavaScript Loader_ mapped to the `commonjs` command and are using the `node` platform by default as explained [here](https://github.com/pinf/loader-js/blob/master/docs/Setup.md).
Publishing
==========
git tag v...
commonjs -v --script build .
commonjs -v --script publish .
TODO: Auto-upload to PEAR channel server at http://pear.firephp.org/
NOTE: For PEAR RC releases: Change release stability to "beta" and capitalize "RC" in release version in package.xml

View File

@@ -0,0 +1,5 @@
exports.main = function(options)
{
}

View File

@@ -0,0 +1,28 @@
{
"name": "firephp-core",
"engine": [
"node"
],
"main": "lib/project.js",
"scripts": {
"build": {
"location": "./",
"module": "/scripts/build.js"
},
"publish": {
"location": "./",
"module": "/scripts/publish.js"
}
},
"mappings": {
"nodejs": {
"id": "nodejs.org/"
},
"pinf": {
"id": "pinf.org/loader/"
},
"modules": {
"id": "github.com/pinf/modules-js/"
}
}
}

View File

@@ -0,0 +1,78 @@
{
"boot": "workspace",
"engine": [
"node"
],
"packages": {
"workspace": {
"locator": {
"location": "./"
}
},
"nodejs.org/": {
"provider": "nodejs.org/"
},
"pinf.org/loader/": {
"provider": "pinf.org/loader/"
},
"github.com/pinf/modules-js/": {
"locator": {
"archive": "https://github.com/pinf/modules-js/zipball/master"
}
},
"github.com/kriskowal/q/": {
"locator": {
"archive": "https://github.com/kriskowal/q/zipball/v0.3.0"
},
"descriptor": {
"uid": "https://github.com/kriskowal/q/",
"dependencies": [
{
"id": "github.com/pinf/modules-js/"
}
]
}
},
"private-registry.appspot.com/cadorn.com/github/com.cadorn.baby/projects/sourcemint/packages/client-js/": {
"locator": {
"archive": "https://github.com/cadorn/com.cadorn.baby/zipball/master",
"path": "projects/sourcemint/packages/client-js"
}
},
"github.com/cadorn/aws-lib/": {
"locator": {
"archive": "https://github.com/cadorn/aws-lib/zipball/master"
},
"descriptor": {
"uid": "https://github.com/cadorn/aws-lib/",
"native": true,
"dependencies": [
{
"id": "registry.npmjs.org/sax/"
},
{
"id": "registry.npmjs.org/xml2js/"
}
]
}
},
"registry.npmjs.org/sax/": {
"locator": {
"archive": "http://registry.npmjs.org/sax/-/sax-0.1.2.tgz"
},
"descriptor": {
"uid": "http://registry.npmjs.org/sax/",
"native": true
}
},
"registry.npmjs.org/xml2js/": {
"locator": {
"archive": "http://registry.npmjs.org/xml2js/-/xml2js-0.1.6.tgz"
},
"descriptor": {
"uid": "http://registry.npmjs.org/xml2js/",
"native": true
}
}
}
}

View File

@@ -0,0 +1,164 @@
var FILE = require("modules/file"),
Q = require("modules/q"),
SYSTEM = require("modules/system"),
UTIL = require("modules/util"),
JSON = require("modules/json");
var pkgPath = FILE.dirname(FILE.dirname(FILE.dirname(module.id))),
buildPath = pkgPath + "/build",
tplPath = pkgPath + "/workspace/tpl",
version = false;
exports.getBuildPath = function()
{
return buildPath;
}
exports.main = function()
{
SYSTEM.exec("rm -Rf " + buildPath, function()
{
FILE.mkdirs(buildPath, 0775);
SYSTEM.exec("git tag", function(stdout)
{
version = UTIL.trim(stdout).split("\n").pop().match(/^v(.*)$/)[1];
// TODO: Compare against version in `../../program.json ~ version` (ensure =)
module.print("\0cyan(Building version: " + version + "\0)\n");
buildZipArchive(function()
{
buildPEARArchive(function()
{
done();
});
});
});
});
function done()
{
module.print("\0green(Done\0)\n");
}
}
function buildZipArchive(callback)
{
var targetBasePath = buildPath + "/FirePHPCore-" + version;
FILE.mkdirs(targetBasePath, 0775);
SYSTEM.exec("rsync -r --copy-links --exclude \"- .DS_Store\" --exclude \"- .git/\" --exclude \"- .tmp_*\" " + pkgPath + "/lib " + targetBasePath, function()
{
replaceVariablesInFile(targetBasePath + "/lib/FirePHPCore/FirePHP.class.php");
replaceVariablesInFile(targetBasePath + "/lib/FirePHPCore/FirePHP.class.php4");
SYSTEM.exec("cp -Rf " + pkgPath + "/examples " + targetBasePath, function()
{
next1();
});
});
function next1()
{
var content = FILE.read(tplPath + "/readme.tpl.md");
content = content.replace(/%%VERSION%%/g, version);
FILE.write(targetBasePath + "/README.md", content);
var content = FILE.read(tplPath + "/license.tpl.md");
FILE.write(targetBasePath + "/LICENSE.md", content);
FILE.write(buildPath + "/info.json", JSON.encode({
version: version
}));
next2();
}
function next2()
{
SYSTEM.exec("cd " + buildPath + " ; zip -vr FirePHPCore-" + version + ".zip FirePHPCore-" + version, function(stdout)
{
console.log(stdout);
callback();
});
}
}
function buildPEARArchive(callback)
{
var targetBasePath = buildPath + "/pear";
FILE.mkdirs(targetBasePath, 0775);
SYSTEM.exec("rsync -r --copy-links --exclude \"- .DS_Store\" --exclude \"- .git/\" --exclude \"- .tmp_*\" " + pkgPath + "/lib/FirePHPCore/* " + targetBasePath, function()
{
replaceVariablesInFile(targetBasePath + "/FirePHP.class.php");
replaceVariablesInFile(targetBasePath + "/FirePHP.class.php4");
next1();
});
function next1()
{
var content = FILE.read(tplPath + "/pear.package.tpl.xml");
var date = new Date();
content = content.replace(/%%DATE%%/g, date.getFullYear() + "-" + UTIL.padBegin(date.getMonth()+1, 2, "0") + "-" + date.getDate());
content = content.replace(/%%VERSION%%/g, version);
content = content.replace(/%%STABILITY%%/g, "stable");
FILE.write(targetBasePath + "/package.xml", content);
next2();
}
function next2()
{
SYSTEM.exec("pear channel-discover pear.firephp.org", function(stdout)
{
console.log(stdout);
SYSTEM.exec("cd " + targetBasePath + "; pear package package.xml", function(stdout)
{
console.log(stdout);
callback();
});
});
}
}
function replaceVariablesInFile(path)
{
var content = FILE.read(path);
// @pinf replace '0.3' with '%%VERSION%%'
var re1 = /\n(.*)\/\/\s*@pinf\s(.*)\n/g;
var match1;
while (match1 = re1.exec(content)) {
var rule = match1[2].match(/^replace (.*?) with (.*)$/);
if(rule) {
// replace variables in rule
var re2 = /%%([^%]*)%%/g;
var match2;
while (match2 = re2.exec(rule[2])) {
var value;
if(match2[1]=="VERSION") {
value = version;
}
rule[2] = rule[2].replace(match2[0], value);
}
match1[1] = match1[1].replace(rule[1], rule[2]);
content = content.replace(match1[0], "\n"+match1[1]+"\n");
}
}
FILE.write(path, content);
}

View File

@@ -0,0 +1,65 @@
var PINF_LOADER = require("pinf/loader"),
SANDBOX = PINF_LOADER.getSandbox(),
FILE = require("modules/file"),
Q = require("modules/q"),
SYSTEM = require("modules/system"),
BUILD = require("./build"),
JSON = require("modules/json"),
SOURCEMINT_CLIENT = false;
exports.main = function()
{
module.load({
id: "private-registry.appspot.com/cadorn.com/github/com.cadorn.baby/projects/sourcemint/packages/client-js/",
descriptor: {
main: "lib/client.js"
}
}, function(id)
{
SOURCEMINT_CLIENT = require(id);
publish();
});
}
function publish()
{
var buildPath = BUILD.getBuildPath(),
info = JSON.decode(FILE.read(buildPath + "/info.json")),
descriptor = JSON.decode(FILE.read(FILE.dirname(FILE.dirname(FILE.dirname(module.id))) + "/package.json"));
var bundles = {};
bundles["firephp-core.zip"] = {
"type": "zip",
"options": {
"archivePath": buildPath + "/FirePHPCore-" + info.version + ".zip",
}
};
var packages = [
{
"uid": descriptor.uid,
"stream": "stable",
"version": info.version,
"bundles": bundles
}
];
try
{
Q.when(SOURCEMINT_CLIENT.publish(packages), function(info)
{
module.print("\0green(Published:\n");
console.log(info);
module.print("\0)");
}, function(e)
{
throw e;
});
}
catch(e)
{
console.error("Error: " + e);
}
}

View File

@@ -0,0 +1,21 @@
[MIT License](http://www.opensource.org/licenses/mit-license.php)
Copyright (c) 2007+ [Christoph Dorn](http://www.christophdorn.com/)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<package packagerversion="1.7.1"
version="2.0"
xmlns="http://pear.php.net/dtd/package-2.0"
xmlns:tasks="http://pear.php.net/dtd/tasks-1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<name>FirePHPCore</name>
<channel>pear.firephp.org</channel>
<summary>Log variables from PHP to the browser (Firebug Console)</summary>
<description>Handles all communication between the PHP code on the server and the client. Also implements all core FirePHP features.</description>
<lead>
<name>Christoph Dorn</name>
<user>cadorn</user>
<email>christoph@christophdorn.com</email>
<active>yes</active>
</lead>
<date>%%DATE%%</date>
<version>
<release>%%VERSION%%</release>
<api>0.3</api>
</version>
<stability>
<release>%%STABILITY%%</release>
<api>stable</api>
</stability>
<license>MIT</license>
<notes>No Notes</notes>
<contents>
<dir name="/" baseinstalldir="FirePHPCore">
<file name="fb.php" role="php"/>
<file name="fb.php4" role="php"/>
<file name="FirePHP.class.php" role="php"/>
<file name="FirePHP.class.php4" role="php"/>
</dir>
</contents>
<dependencies>
<required>
<php>
<min>4.0</min>
</php>
<pearinstaller>
<min>1.4.5</min>
</pearinstaller>
</required>
</dependencies>
<phprelease />
</package>

View File

@@ -0,0 +1,17 @@
FirePHPCore Server Library
==========================
Status: stable
Version: [%%VERSION%%](https://github.com/firephp/firephp-core/tree/v%%VERSION%%)
This archive contains the *FirePHPCore* PHP server library.
Links
-----
* Documentation: http://docs.sourcemint.org/firephp.org/firephp/1/-docs/
* Install: http://docs.sourcemint.org/firephp.org/firephp/1/-docs/Configuration/Traditional
* Support: http://docs.sourcemint.org/firephp.org/firephp/1/-docs/OpenSource#support
* Author: [Christoph Dorn](http://www.christophdorn.com/)
* License: [MIT License](http://www.opensource.org/licenses/mit-license.php)