Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
solarium
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
solarium
Commits
4e90abaa
Commit
4e90abaa
authored
Sep 12, 2013
by
Dorian Villet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PSR-2 compliant phar folder.
parent
daa22fce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
phar/buildphar.php
phar/buildphar.php
+8
-4
phar/stub.php
phar/stub.php
+2
-2
No files found.
phar/buildphar.php
View file @
4e90abaa
...
@@ -58,10 +58,14 @@ $phar->setSignatureAlgorithm(Phar::SHA1);
...
@@ -58,10 +58,14 @@ $phar->setSignatureAlgorithm(Phar::SHA1);
// Add files to the phar
// Add files to the phar
$basePath
=
realpath
(
__DIR__
.
"/../library/Solarium"
);
$basePath
=
realpath
(
__DIR__
.
"/../library/Solarium"
);
if
(
$strip
)
{
if
(
$strip
)
{
$directoryIterator
=
new
RecursiveIteratorIterator
(
new
RecursiveDirectoryIterator
(
$basePath
),
RecursiveIteratorIterator
::
SELF_FIRST
);
$directoryIterator
=
new
RecursiveIteratorIterator
(
new
RecursiveDirectoryIterator
(
$basePath
),
RecursiveIteratorIterator
::
SELF_FIRST
);
foreach
(
$directoryIterator
as
$file
)
{
foreach
(
$directoryIterator
as
$file
)
{
if
(
preg_match
(
'/\\.php$/i'
,
$file
)
)
{
if
(
preg_match
(
'/\\.php$/i'
,
$file
)
)
{
$phar
->
addFromString
(
substr
(
$file
,
strlen
(
$basePath
)
+
1
),
php_strip_whitespace
(
$file
));
$phar
->
addFromString
(
substr
(
$file
,
strlen
(
$basePath
)
+
1
),
php_strip_whitespace
(
$file
));
}
}
}
}
}
else
{
}
else
{
...
@@ -74,5 +78,5 @@ if ($compress) {
...
@@ -74,5 +78,5 @@ if ($compress) {
$phar
->
compress
(
Phar
::
GZ
);
$phar
->
compress
(
Phar
::
GZ
);
}
}
$time
=
round
(
microtime
(
true
)
-
$start
,
5
);
$time
=
round
(
microtime
(
true
)
-
$start
,
5
);
echo
"
\n
DONE (
$time
seconds)
\n\n
"
;
echo
"
\n
DONE (
$time
seconds)
\n\n
"
;
phar/stub.php
View file @
4e90abaa
...
@@ -52,5 +52,5 @@ if ('cli' === php_sapi_name() && basename(__FILE__) === basename($_SERVER['argv'
...
@@ -52,5 +52,5 @@ if ('cli' === php_sapi_name() && basename(__FILE__) === basename($_SERVER['argv'
exit
(
0
);
exit
(
0
);
}
}
__HALT_COMPILER
();
__halt_compiler
();
?>
?>
\ No newline at end of file
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