diff options
author | xue <> | 2006-01-28 17:09:31 +0000 |
---|---|---|
committer | xue <> | 2006-01-28 17:09:31 +0000 |
commit | 568a5cea4833a3316f3741dcd32699334f770d26 (patch) | |
tree | 97fc2e42696ce9606e2a426d421f28f188951f20 /buildscripts/phpbuilder | |
parent | 785fa814501d66e94d07a872d5ff69e26baf413d (diff) |
Rename "tools" to "buildscripts".
Diffstat (limited to 'buildscripts/phpbuilder')
-rw-r--r-- | buildscripts/phpbuilder/build.php | 99 | ||||
-rw-r--r-- | buildscripts/phpbuilder/files.txt | 89 |
2 files changed, 188 insertions, 0 deletions
diff --git a/buildscripts/phpbuilder/build.php b/buildscripts/phpbuilder/build.php new file mode 100644 index 00000000..6df74923 --- /dev/null +++ b/buildscripts/phpbuilder/build.php @@ -0,0 +1,99 @@ +#!/usr/bin/php
+<?php
+/**
+ * Prado build file.
+ *
+ * This script compresses a list of Prado PHP script files
+ * and merges them into one for performance redistribution.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright © 2005 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Revision: $ $Date: $
+ * @package Tools
+ */
+
+/**
+ * The merged file name
+ */
+define('OUTPUT_FILE','pradolite.php');
+/**
+ * The framework directory
+ */
+define('FRAMEWORK_DIR',realpath(dirname(__FILE__).'/../../framework'));
+/**
+ * The file containing script list to be built
+ */
+define('SCRIPT_FILES',dirname(__FILE__).'/files.txt');
+
+if(FRAMEWORK_DIR===false)
+ die('Unable to determine the installation directory of Prado Framework.');
+if(!is_file(SCRIPT_FILES))
+ die('Unable to read '.SCRIPT_FILES.'.');
+
+$output='';
+
+$lines=file(SCRIPT_FILES);
+foreach($lines as $line)
+{
+ $line=trim($line);
+ if($line==='' || $line[0]==='#')
+ continue;
+ echo 'adding '.FRAMEWORK_DIR.'/'.$line."\n";
+ $input=file_get_contents(FRAMEWORK_DIR.'/'.$line);
+ $input = strip_comments($input);
+ $input=strtr($input,"\r",' ');
+ $input=preg_replace("/\s*(\n+\s*){2,}\s*/m","\n",$input);
+ $input=preg_replace('/^Prado::using\([^\*]*?\);/mu','',$input);
+ $input=preg_replace('/^(require|require_once)\s*\(.*?;/mu','',$input);
+ $input=preg_replace('/^(include|include_once)\s*\(.*?;/mu','',$input);
+
+ //remove internal logging
+ $input=preg_replace('/^\s*Prado::trace.*\s*;\s*$/mu','',$input);
+
+ $output.=$input;
+}
+
+file_put_contents(FRAMEWORK_DIR.'/'.OUTPUT_FILE,$output);
+
+function strip_comments($source)
+{
+ $tokens = token_get_all($source);
+ /* T_ML_COMMENT does not exist in PHP 5.
+ * The following three lines define it in order to
+ * preserve backwards compatibility.
+ *
+ * The next two lines define the PHP 5-only T_DOC_COMMENT,
+ * which we will mask as T_ML_COMMENT for PHP 4.
+ */
+ if (!defined('T_ML_COMMENT')) {
+ @define('T_ML_COMMENT', T_COMMENT);
+ } else {
+ @define('T_DOC_COMMENT', T_ML_COMMENT);
+ }
+ $output = '';
+ foreach ($tokens as $token) {
+ if (is_string($token)) {
+ // simple 1-character token
+ $output .= $token;
+ } else {
+ // token array
+ list($id, $text) = $token;
+ switch ($id) {
+ case T_COMMENT:
+ case T_ML_COMMENT: // we've defined this
+ case T_DOC_COMMENT: // and this
+ // no action on comments
+ break;
+ default:
+ // anything else -> output "as is"
+ $output .= $text;
+ break;
+ }
+ }
+ }
+ return $output;
+}
+
+?>
\ No newline at end of file diff --git a/buildscripts/phpbuilder/files.txt b/buildscripts/phpbuilder/files.txt new file mode 100644 index 00000000..21779094 --- /dev/null +++ b/buildscripts/phpbuilder/files.txt @@ -0,0 +1,89 @@ +TComponent.php
+Exceptions/TException.php
+Collections/TList.php
+Collections/TMap.php
+Collections/TAttributeCollection.php
+Data/TXmlDocument.php
+Web/THttpUtility.php
+Data/TCache.php
+Log/TLogger.php
+core.php
+prado.php
+TApplication.php
+Exceptions/TErrorHandler.php
+Web/THttpRequest.php
+Web/THttpResponse.php
+Web/THttpSession.php
+Security/TAuthorizationRule.php
+Web/Services/TPageService.php
+Web/UI/THtmlWriter.php
+Web/UI/TTemplateManager.php
+Web/UI/TThemeManager.php
+Web/UI/TAssetManager.php
+Web/UI/TPageStatePersister.php
+Web/UI/TControl.php
+Web/UI/TTemplateControl.php
+Web/UI/TForm.php
+Web/UI/TClientScriptManager.php
+Web/UI/TPage.php
+Web/UI/WebControls/TFont.php
+Web/UI/WebControls/TStyle.php
+Web/UI/WebControls/TWebControl.php
+Web/UI/WebControls/TPlaceHolder.php
+Web/UI/WebControls/TLiteral.php
+Web/UI/WebControls/TLabel.php
+Web/UI/WebControls/TImage.php
+Web/UI/WebControls/TImageButton.php
+Web/UI/WebControls/TButton.php
+Web/UI/WebControls/TCheckBox.php
+Web/UI/WebControls/TRadioButton.php
+Web/UI/WebControls/TTextBox.php
+# Web/UI/WebControls/TTextHighlighter.php
+Web/UI/WebControls/TPanel.php
+Web/UI/WebControls/TContent.php
+Web/UI/WebControls/TContentPlaceHolder.php
+Web/UI/WebControls/TExpression.php
+Web/UI/WebControls/TStatements.php
+Web/UI/WebControls/TFileUpload.php
+Web/UI/WebControls/THead.php
+Web/UI/WebControls/THiddenField.php
+Web/UI/WebControls/THyperLink.php
+Web/UI/WebControls/TTable.php
+
+Web/UI/WebControls/TDataSourceControl.php
+Web/UI/WebControls/TDataSourceView.php
+
+Web/UI/WebControls/TDataBoundControl.php
+Web/UI/WebControls/TCheckBoxList.php
+Web/UI/WebControls/TRadioButtonList.php
+Web/UI/WebControls/TBulletedList.php
+
+Web/UI/WebControls/TListControl.php
+Web/UI/WebControls/TListBox.php
+Web/UI/WebControls/TDropDownList.php
+
+Web/UI/WebControls/TJavascriptLogger.php
+Web/UI/WebControls/TLinkButton.php
+
+Web/UI/WebControls/TBaseValidator.php
+Web/UI/WebControls/TRequiredFieldValidator.php
+Web/UI/WebControls/TCompareValidator.php
+Web/UI/WebControls/TRegularExpressionValidator.php
+Web/UI/WebControls/TEmailAddressValidator.php
+Web/UI/WebControls/TCustomValidator.php
+Web/UI/WebControls/TValidationSummary.php
+
+Web/UI/WebControls/TRepeatInfo.php
+Web/UI/WebControls/TRepeater.php
+
+Web/UI/WebControls/TBaseDataList.php
+Web/UI/WebControls/TDataList.php
+Collections/TPagedDataSource.php
+Collections/TDummyDataSource.php
+Web/UI/WebControls/TDataGrid.php
+Web/UI/WebControls/TDataGridColumn.php
+Web/UI/WebControls/TBoundColumn.php
+Web/UI/WebControls/TButtonColumn.php
+Web/UI/WebControls/TEditCommandColumn.php
+Web/UI/WebControls/THyperLinkColumn.php
+Web/UI/WebControls/TTemplateColumn.php
|