Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
3cccec2e
Commit
3cccec2e
authored
Jun 25, 2007
by
nicobn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added header + script automatically detects /lib
parent
4e241886
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
12 deletions
+45
-12
bundle.php
tools/cli/bundle.php
+45
-12
No files found.
tools/cli/bundle.php
View file @
3cccec2e
<?php
/**
* Small command line script to bundle Doctrine classes.
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*
* Small command line script to bundle Doctrine classes in a single file.
*
* @author Nicolas Bérard-Nault <nicobn@php.net>
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @package Doctrine
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @version $Revision$
* @category Object Relational Mapping
* @link www.phpdoctrine.com
* @since 1.0
*/
if
(
count
(
$argv
)
<
2
)
{
echo
"Usage: bundle.php [Target
directory
] <Library directory>
\n\n
"
.
"Note: If the library directory is ommited, the path will be deducted
\n
"
;
echo
"Usage: bundle.php [Target
file
] <Library directory>
\n\n
"
.
"Note: If the library directory is ommited, the path will be deducted
if possible
\n
"
;
exit
(
1
);
}
else
if
(
count
(
$argv
)
==
3
)
{
$doctrineBaseDir
=
$argv
[
2
];
}
else
{
$doctrineBaseDir
=
str_replace
(
'tools/cli'
,
'lib'
,
$_SERVER
[
'PWD'
],
$Cnt
);
$pathInfos
=
pathinfo
(
$_SERVER
[
'PHP_SELF'
]);
$doctrineBaseDir
=
str_replace
(
'tools/cli/'
.
$pathInfos
[
'basename'
],
'lib'
,
getcwd
()
.
'/'
.
$_SERVER
[
'SCRIPT_NAME'
],
$Cnt
);
if
(
$Cnt
!=
1
)
{
echo
"Can't find library directory, please specify it as an argument
\n
"
;
exit
(
1
);
}
}
$target
Dir
=
$argv
[
1
];
$target
File
=
$argv
[
1
];
echo
"Target directory:
$targetDir
\n
"
;
echo
"Base directory:
$doctrineBaseDir
\n\n
"
;
echo
"Target file:
$targetFile
"
.
PHP_EOL
;
echo
"Base directory:
$doctrineBaseDir
"
.
PHP_EOL
;
echo
PHP_EOL
;
set_include_path
(
get_include_path
()
.
PATH_SEPARATOR
.
$doctrineBaseDir
);
...
...
@@ -29,11 +61,12 @@ require_once 'Doctrine/Compiler.php';
spl_autoload_register
(
array
(
'Doctrine'
,
'autoload'
));
echo
"Bundling classes ..."
.
PHP_EOL
;
echo
"Bundling classes
and interfaces
..."
.
PHP_EOL
;
Doctrine_Compiler
::
compile
(
$target
Dir
);
Doctrine_Compiler
::
compile
(
$target
File
);
echo
"Bundle complete."
.
PHP_EOL
;
echo
PHP_EOL
.
"Bundle complete."
.
PHP_EOL
;
echo
"File:
$targetFile
(size: "
.
number_format
(
filesize
(
$targetFile
)
/
1024
,
2
,
'.'
,
''
)
.
" kb)."
.
PHP_EOL
;
exit
(
0
);
?>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment