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
#!/usr/bin/env bash | |
TEST_PATH='/home/ulv/PhpstormProjects/kinetic/oncologytest/tests/' | |
while read oldrev newrev refname | |
do | |
branch=$(git rev-parse --symbolic --abbrev-ref $refname) | |
if [ "master" == "$branch" ]; then | |
phpunit $TEST_PATH |
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
#!/usr/bin/env bash | |
TEST_GLOB='../../tests/test_*.php' | |
for f in $TEST_GLOB; do | |
printf "\n+ Running 'phpunit `basename ${f}`'\n\n" | |
phpunit $f | |
rc=$? | |
if [[ $rc != 0 ]] ; 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
/** | |
* вывод меню | |
* | |
* Пример: | |
* | |
* <code> | |
* if ($menu = mso_get_option('top_menu', 'templates', '')) { | |
* echo limo_menu_out($menu); | |
* } | |
* </code> |
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
/** | |
* архивирует файлы модуля в tar.gz и возвращает имя архива | |
* Реализована блокировка архива на время архивации (чтобы избежать race) | |
* | |
* @return string | |
*/ | |
public function export() | |
{ | |
if (is_readable($this->archive_name . '.gz')) { | |
return $this->archive_name . '.gz'; |
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
public function get_class_constants() | |
{ | |
$reflect = new ReflectionClass(get_class($this)); | |
return $reflect->getConstants()); | |
} |
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 // "Add to cart" Button | |
$this->assignRef('product', $product); | |
echo $this->loadTemplate('addtocart'); | |
?> |
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
$queries = array( | |
'delete from `s_robots_log` where YEAR(dtlabel) <> YEAR(CURDATE())', | |
'delete from `s_visits_log` where YEAR(dtlabel) <> YEAR(CURDATE())', | |
'truncate table `s_robots_stat`', | |
// 'truncate table `s_visits_stat`', | |
'truncate table a_ua_ranges', | |
'truncate table a_log', | |
'truncate table a_http_error', | |
// restore stats |
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
window.echo = (function (window, document) { | |
'use strict'; | |
var Echo = function (elem) { | |
this.elem = elem; | |
this.render(); | |
this.listen(); | |
}; | |
var echoStore = []; |
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
function asyncInject(array, fn, delay) { | |
var i = 0; | |
window.setTimeout(function iter() { | |
if (i === array.length) { | |
return; | |
} | |
fn.call(array, array[i], i++); | |
window.setTimeout(iter, delay); | |
}, 0); | |
} |
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
document.onmousedown = function(event) { | |
if (event.button == 2) { | |
return false; | |
} | |
} |