Skip to content

Instantly share code, notes, and snippets.

View katzueno's full-sized avatar

Katz Ueno katzueno

View GitHub Profile
require 'logger'
require "kconv"
# Site URL
#SITE_URL = "https://imperavi.com/kube/"
SITE_URL = "http://example.com/"
# log File
LOG_FILE = "log.txt"
@katzueno
katzueno / GenerateTestContents.php
Created May 24, 2017 06:15 — forked from hissy/GenerateTestContents.php
ダミーコンテンツ大量生成
<?php
// application/src/Concrete/Console/Command/GenerateTestContents.php
namespace Application\Concrete\Console\Command;
use Concrete\Core\Block\BlockType\BlockType;
use Concrete\Core\Cache\CacheClearer;
use Concrete\Core\Console\Command;
use Concrete\Core\File\Importer;
use Concrete\Core\Page\Page;
@katzueno
katzueno / bootstrap.php
Last active May 2, 2017 03:30
concrete5 Detect Environment
<?php
// /application/config/bootstrap/start.php
use Concrete\Core\Application\Application;
/**
* ----------------------------------------------------------------------------
* Instantiate concrete5
* ----------------------------------------------------------------------------
*/
$app = new Application();
/**
@katzueno
katzueno / controller.php
Created April 19, 2017 02:17 — forked from kanetei/controller.php
【concrete5】特定のエクスプレスオブジェクトで、属性(チェックボックス)にチェックがない時に項目を表示するカスタマイズ
<?php
namespace Application\Block\ExpressEntryList;
use Concrete\Core\Express\Entry\Search\Result\Result;
use Concrete\Core\Express\EntryList;
class Controller extends \Concrete\Block\ExpressEntryList\Controller
{
public function view()
@katzueno
katzueno / app.php
Created April 17, 2017 13:26 — forked from hissy/app.php
[concrete5] [V8] Add password validation rule
<?php
// application/bootstrap/app.php
/** @var \Concrete\Core\Validator\ValidatorManagerInterface $passwordValidator */
$passwordValidator = Core::make('validator/password');
/** @var \Concrete\Core\Validator\String\RegexValidator $regexValidator */
$regexValidator = Core::make(
\Concrete\Core\Validator\String\RegexValidator::class,
['/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).+$/']
);
@katzueno
katzueno / import_files.php
Created April 14, 2017 06:37 — forked from hissy/import_files.php
[concrete5][V8] Search all files from legacy databas, then import files to modern concrete5
<?php
namespace Application\Job;
use Concrete\Core\File\Importer;
use Concrete\Core\Job\QueueableJob;
use ZendQueue\Message as ZendQueueMessage;
use ZendQueue\Queue as ZendQueue;
class ImportFiles extends QueueableJob
{
@katzueno
katzueno / scan_duplicate_file_name.php
Created April 11, 2017 06:02 — forked from hissy/scan_duplicate_file_name.php
[concrete5][Legacy] Find duplicate file name and change it
<?php
class ScanDuplicateFileName extends QueueableJob
{
public $jNotUninstallable=0;
public $jSupportsQueue = true;
public function getJobName()
{
return t('Scan Duplicate File Name');
@katzueno
katzueno / block_form_submission.php
Last active February 21, 2017 05:46
Adding Date and Time
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$submittedData = '';
foreach ($questionAnswerPairs as $questionAnswerPair) {
$submittedData .= $questionAnswerPair['question']."\r\n".$questionAnswerPair['answerDisplay']."\r\n"."\r\n";
}
$formDisplayUrl = URL::to('/dashboard/reports/forms') . '?qsid='.$questionSetId;
@katzueno
katzueno / concrete.php
Last active February 21, 2017 04:15
concrete5 の差出人メールアドレスを一斉管理
<?php
return array(
/**
* ------------------------------------------------------------------------
* 通知メール設定
* ------------------------------------------------------------------------
*/
'email' => array(
/**
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order: