This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__ . '/app/code/local/Nivea/Mobile/Model/Device/Detect.php'; | |
$mobile = new Nivea_Mobile_Model_Device_Detect(); | |
$isMobile = $mobile->isMobile(); | |
$currentUrl = $env = ($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']; | |
$scheme = isset($_SERVER['HTTPS']) ? 'https://' : 'http://'; | |
if ($isMobile && $currentUrl == 'shop.nivea.co.uk') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "Please enter SSH host as first parameter. Eg [email protected]" | |
exit 1 | |
fi | |
sshHost=$1 | |
if [ -z "$2" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PHPUnit 3.7.32 by Sebastian Bergmann. | |
Configuration read from /var/www/jh-flexitime/module/JhTime/test/phpunit.xml | |
EF | |
Time: 67 ms, Memory: 6.00Mb | |
There was 1 error: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Marco Pivetta <[email protected]> | |
*/ | |
use Zend\ServiceManager\ServiceManager; | |
use Zend\Mvc\Service\ServiceManagerConfig; | |
use DoctrineORMModuleTest\Framework\TestCase; | |
use JhTimeTest\Util\ServiceManagerFactory; | |
use Zend\Loader\StandardAutoloader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
composer install --dev --prefer-source | |
mkdir -p build/coverage | |
cp tests/TestConfiguration.php.travis tests/TestConfiguration.php | |
ls -d tests/ZendTest/* | parallel --gnu --keep-order 'echo "Running {} tests"; ./vendor/bin/phpunit -c tests/phpunit.xml.dist --coverage-php build/coverage/coverage-{/.}.cov {};' || exit 1 | |
#Generates error | |
php vendor/bin/phpcov.php --merge --clover build/logs/clover.xml --whitelist library build/coverage | |
aydin@ubuntu ~/zf2:master$ php vendor/bin/phpcov.php --merge --clover build/logs/clover.xml --whitelist library build/coverage | |
PHP Warning: require(ezc/Base/base.php): failed to open stream: No such file or directory in /home/aydin/Documents/zf2/vendor/sebastianbergmann/phpcov/src/autoload.php on line 45 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for d in module/*/test | |
do | |
echo "Running $d tests" | |
fileName=$(echo $d | tr '/' '-') | |
vendor/bin/phpunit -c $d/phpunit.xml --coverage-php build/coverage/coverage-$fileName.cov $d | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
├── config | |
│ └── autoload | |
├── module | |
│ ├── JhHub | |
│ │ ├── public | |
│ │ └── bower.json | |
│ ├── JhOvertime | |
│ │ ├── public | |
│ │ └── bower.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Module.php | |
namespace JhHub; | |
class Module implements | |
ConsoleBannerProviderInterface, | |
ConfigProviderInterface, | |
AutoloaderProviderInterface | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I want the ability to be able to "install" modules which require installing. | |
If they have not been installed, then they should not be loaded. | |
Imagine there is one module in a ZF2 Skeleton App. Named "Hub". | |
It has an "install" cli route, which loops through all loaded modules. | |
If they implement "InstallableInterface" they will provide some install service. | |
The "install" command will run each of these | |
services "install" method. | |
One example (my use case) is that I need to loop thorugh each user and create a 'user_flex_settings' row for them. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Not sure if this is an issue or expected: | |
I have the following console route: | |
return [ | |
'console' => [ | |
'router' => [ | |
'routes' => [ | |
'set-user-starting-balance' => [ | |
'options' => [ |
OlderNewer