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
class_name: AcceptanceTester | |
modules: | |
enabled: | |
- WebDriver | |
- tests\codeception\_support\WebHelper | |
- tests\codeception\_support\DynamicFixtureHelper | |
# capabilities: | |
# chromeOptions: | |
# args: ["--headless", "--disable-gpu"] | |
config: |
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
run user test for module comment | |
cd /var/www/humhub/protected/humhub/modules/comment/tests | |
../../../../vendor/bin/codecept run unit CommentFollowersNotificationTest | |
ru queue | |
отправка почты: | |
cd /var/www/humhub/protected/ | |
php yii queue/run |
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 | |
/** | |
* This file provides to overwrite the default HumHub / Yii configuration by your local Web environments | |
* @see http://www.yiiframework.com/doc-2.0/guide-concept-configurations.html | |
* @see http://docs.humhub.org/admin-installation-configuration.html | |
* @see http://docs.humhub.org/dev-environment.html | |
*/ | |
return [ | |
'modules' => [ | |
'gii' => [ |
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
1. cd /var/www/humhub/protected/ | |
1.1 create | |
php yii migrate/create spacesofusersgroup --migrationPath=@humhub/modules/user/migrations | |
2. migrate | |
php yii migrate --migrationPath=@humhub/modules/user/migrations |
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
if (!$this->save()) { | |
throw new Exception("Could not archive content!" . print_r($this->getErrors(), 1)); | |
}; | |
To DB | |
try { | |
// your DB query |
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
$test = ['a' => 1, 'b' => 2]; | |
\yii\helpers\VarDumper::dump($test, 10, true); | |
return 0; | |
Работает из контроллеров | |
Yii::error(); | |
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
$letter = []; | |
$sQuery = ''; | |
$sQuery .= 'SELECT DISTINCT '; | |
$sQuery .= 'UPPER(LEFT(LTRIM(NAME), 1)) AS LETTER '; | |
//$sQuery .= 'UPPER(NAME) AS LETTER '; | |
$sQuery .= 'FROM b_iblock_element BE '; | |
$sQuery .= 'WHERE BE.IBLOCK_ID = '.CONTENT_BREND_IB_ID.' AND BE.ACTIVE = "Y" AND BE.WF_STATUS_ID = 1 AND BE.WF_PARENT_ELEMENT_ID IS NULL'; | |
$sQuery .= ' ORDER BY LETTER ASC '; | |
$rsItems = $GLOBALS['DB']->Query($sQuery, false, __LINE__); |
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
Имеется ID элемента. В инфоблоке несколько уровней вложенности. Как получить ID корневой папки этого элемента? | |
select | |
s.* | |
from b_iblock_section_element l | |
join b_iblock_section s | |
on s.ID = l.IBLOCK_SECTION_ID | |
where | |
l.IBLOCK_ELEMENT_ID = $id |
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
А фильтровать элементы так: | |
$arFilter = array( | |
'NAME' => $sRequestLetter.'%' | |
); | |
где $sRequestLetter - это выбранная буква(ы) алфавитного индекса. |
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 | |
$script = <<<JS | |
$(function () { | |
$('#showModalMessage').click(function () { | |
$('#modalMessage').modal('show') | |
.find('.modalContent') | |
.load($(this).data('value')); | |
}); |