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
9ecbb7df
Commit
9ecbb7df
authored
Nov 30, 2015
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of github.com:solariumphp/solarium into thomascorthals-develop
parents
906c76b6
cf4843c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
19 deletions
+28
-19
.gitignore
.gitignore
+6
-5
phar/buildphar.php
phar/buildphar.php
+20
-11
phar/stub.php
phar/stub.php
+2
-3
No files found.
.gitignore
View file @
9ecbb7df
build
phpunit.xml
composer.phar
composer.lock
vendor
/build
/phpunit.xml
/composer.phar
/composer.lock
/vendor
/phar/solarium.phar
phar/buildphar.php
View file @
9ecbb7df
...
...
@@ -49,27 +49,36 @@ $strip = (isset($options['s']) && $options['s'] == '1');
$start
=
microtime
(
true
);
// Create a new Solarium
phar file
// Create a new Solarium
PHAR file.
@
unlink
(
'solarium.phar'
);
$phar
=
new
Phar
(
'solarium.phar'
,
0
,
'solarium.phar'
);
$phar
->
setStub
(
file_get_contents
(
"stub.php"
));
$phar
->
setStub
(
file_get_contents
(
__DIR__
.
DIRECTORY_SEPARATOR
.
'stub.php'
));
$phar
->
setSignatureAlgorithm
(
Phar
::
SHA1
);
// Add files to the phar
$basePath
=
realpath
(
__DIR__
.
"/../library/Solarium"
);
if
(
$strip
)
{
$directoryIterator
=
new
RecursiveIteratorIterator
(
new
RecursiveDirectoryIterator
(
$basePath
),
// Add files to the PHAR.
$basePath
=
dirname
(
__DIR__
);
$directoryIterator
=
new
AppendIterator
();
$directoryIterator
->
append
(
new
RecursiveIteratorIterator
(
new
RecursiveDirectoryIterator
(
$basePath
.
DIRECTORY_SEPARATOR
.
'library'
),
RecursiveIteratorIterator
::
SELF_FIRST
)
);
$directoryIterator
->
append
(
new
RecursiveIteratorIterator
(
new
RecursiveDirectoryIterator
(
$basePath
.
DIRECTORY_SEPARATOR
.
'vendor'
),
RecursiveIteratorIterator
::
SELF_FIRST
);
)
);
if
(
$strip
)
{
foreach
(
$directoryIterator
as
$file
)
{
if
(
preg_match
(
'/\\.php$/i'
,
$file
))
{
if
(
0
!==
preg_match
(
'/\\.php$/i'
,
$file
))
{
$phar
->
addFromString
(
substr
(
$file
,
strlen
(
$basePath
)
+
1
),
php_strip_whitespace
(
$file
));
}
}
}
else
{
$phar
->
buildFrom
Directory
(
$basePath
,
'/\.php$/'
);
$phar
->
buildFrom
Iterator
(
$directoryIterator
,
$basePath
);
}
// Create compressed versions
...
...
@@ -79,4 +88,4 @@ if ($compress) {
}
$time
=
round
(
microtime
(
true
)
-
$start
,
5
);
echo
"
\n
DONE (
$time
seconds)
\n\n
"
;
echo
"
\n
DONE (
$time
seconds)
\n
solarium.phar has been created.
\n
\n
"
;
phar/stub.php
View file @
9ecbb7df
...
...
@@ -34,7 +34,7 @@
*/
Phar
::
mapPhar
(
"solarium.phar"
);
require_once
'phar://solarium.phar/
Autoloader
.php'
;
require_once
'phar://solarium.phar/
vendor/autoload
.php'
;
\Solarium\Autoloader
::
register
();
if
(
'cli'
===
php_sapi_name
()
&&
basename
(
__FILE__
)
===
basename
(
$_SERVER
[
'argv'
][
0
])
&&
isset
(
$_SERVER
[
'argv'
][
1
]))
{
...
...
@@ -46,9 +46,8 @@ if ('cli' === php_sapi_name() && basename(__FILE__) === basename($_SERVER['argv'
break
;
default
:
echo
"Unknown command '"
.
$_SERVER
[
'argv'
][
1
]
.
"' (Supported commands: version)
\n
"
;
echo
'Unknown command \''
.
$_SERVER
[
'argv'
][
1
]
.
'\' (Supported commands: version)'
.
"
\n
"
;
}
}
__HALT_COMPILER
();
?>
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