This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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/bash | |
# бэкап mysql базы при каждом коммите | |
FILENAME=/home/www/intinity/klumbariy/db/`date +%d-%m-%Y-%H-%I-%S`.mysql | |
mysqldump intinity_klumba -u klumba \ | |
-p2UDRyHqedqnSfFfW > ${FILENAME} | |
git add $FILENAME |
This file contains hidden or 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
/* | |
*last 6 featured articles | |
*/ | |
$db = JFactory::getDbo(); | |
$query = $db->getQuery(true); | |
$query->select('*') | |
->from($db->quoteName('#__content')) | |
->where($db->quoteName('featured') . ' = 1 ') | |
->order('created DESC'); |
This file contains hidden or 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
/* | |
* get subcategory ids | |
*/ | |
$catID = $this->category->id; | |
$categories = JCategories::getInstance('Content'); | |
$cat = $categories->get($catID); | |
$children = $cat->getChildren(); | |
$children = array_map(function($el) { | |
return (array)$el; |
This file contains hidden or 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
# Usage examples: | |
# | |
# dataService.getTree().then((response)-> | |
# if response | |
# $scope.list = response.data | |
# | |
# dataService.saveTree(nodeData) | |
.service "dataService", ($http) -> | |
delete $http.defaults.headers.common["X-Requested-With"] |