Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
744af92b
Commit
744af92b
authored
Mar 22, 2011
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added missing files in the PHAR
parent
be090ea7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
src/Silex/Compiler.php
src/Silex/Compiler.php
+15
-4
No files found.
src/Silex/Compiler.php
View file @
744af92b
...
@@ -48,12 +48,12 @@ class Compiler
...
@@ -48,12 +48,12 @@ class Compiler
;
;
foreach
(
$finder
as
$file
)
{
foreach
(
$finder
as
$file
)
{
$path
=
str_replace
(
realpath
(
__DIR__
.
'/../..'
)
.
'/'
,
''
,
$file
->
getRealPath
());
$this
->
addFile
(
$phar
,
$file
);
$content
=
Kernel
::
stripComments
(
file_get_contents
(
$file
));
$phar
->
addFromString
(
$path
,
$content
);
}
}
$this
->
addFile
(
$phar
,
new
\SplFileInfo
(
__DIR__
.
'/../../LICENSE'
),
false
);
$this
->
addFile
(
$phar
,
new
\SplFileInfo
(
__DIR__
.
'/../../autoload.php'
));
// Stubs
// Stubs
$phar
[
'_cli_stub.php'
]
=
$this
->
getStub
();
$phar
[
'_cli_stub.php'
]
=
$this
->
getStub
();
$phar
[
'_web_stub.php'
]
=
$this
->
getStub
();
$phar
[
'_web_stub.php'
]
=
$this
->
getStub
();
...
@@ -66,6 +66,17 @@ class Compiler
...
@@ -66,6 +66,17 @@ class Compiler
unset
(
$phar
);
unset
(
$phar
);
}
}
protected
function
addFile
(
$phar
,
$file
,
$strip
=
true
)
{
$path
=
str_replace
(
realpath
(
__DIR__
.
'/../..'
)
.
'/'
,
''
,
$file
->
getRealPath
());
$content
=
file_get_contents
(
$file
);
if
(
$strip
)
{
$content
=
Kernel
::
stripComments
(
file_get_contents
(
$file
));
}
$phar
->
addFromString
(
$path
,
$content
);
}
protected
function
getStub
()
protected
function
getStub
()
{
{
return
<<<EOF
return
<<<EOF
...
...
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