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 | |
/** | |
* Usage: | |
* concrete/bin/concrete5 c5:exec bulk_change_page_template.php old_page_template_handle /parent-page-path new_page_template_handle | |
*/ | |
$filterPageTemplateHandle = $args[0]; | |
$filterPagePath = $args[1]; | |
$changePageTemplateHandle = $args[2]; |
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
# Set the bucket name and date limit that you want to scan for... | |
# | |
# For example, if you deleted everything at 9'ish, set the DATE_LIMIT for a | |
# few minutes before to ensure you find only the stuff you deleted by error | |
# | |
BUCKET_NAME="..." | |
DATE_LIMIT="0000-00-00T00:00:00.000Z" | |
aws s3api list-object-versions --bucket "${BUCKET_NAME}" > objects.json | |
cat objects.json | jq --arg DATE_LIMIT "${DATE_LIMIT}" '[ .DeleteMarkers[] | select(.LastModified > $DATE_LIMIT and .IsLatest) | { file: .Key, version: .VersionId } ]' > markers-to-delete.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
<?php | |
// application/src/Console/Command/StatusCodeCheck.php | |
namespace Application\Console\Command; | |
use Concrete\Core\Console\Command; | |
use Concrete\Core\Database\Connection\Connection; | |
use Concrete\Core\Http\Client\Client; | |
use Concrete\Core\Page\Page; | |
use Concrete\Core\Support\Facade\Application; | |
use Concrete\Core\Url\Url; |
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 | |
// application/src/Console/Command/StatusCodeCheck.php | |
namespace Application\Console\Command; | |
use Concrete\Core\Console\Command; | |
use Concrete\Core\Database\Connection\Connection; | |
use Concrete\Core\Http\Client\Client; | |
use Concrete\Core\Page\Page; | |
use Concrete\Core\Support\Facade\Application; | |
use Concrete\Core\Url\Url; |
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
## -- concrete5 urls start -- | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
# Change RewriteBase path if this concrete5 is installed on subdirectory / concrete5 がサブディレクトリにインストールされていたら、RewriteBase の変更が必要です。 | |
# IP address restriction starts here / IP アドレス制限、アクセス許可するのIPの設定 | |
RewriteCond %{REMOTE_ADDR} !123\.4\.56\.789 | |
RewriteCond %{REMOTE_ADDR} !123\.123\.123\.123 | |
# Add more lines is you have more IP / もっとIPがある場合は、行を追加してください |
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
// application/bootstrap/app.php | |
Route::register('/ccm/request', function() { | |
header("Pragma: no-cache"); | |
header("Pragma: no-cache"); | |
echo '<dl>'; | |
$app = \Concrete\Core\Support\Facade\Application::getFacadeApplication(); | |
?><dt>Application environment:</dt><dd><?php echo ($app->environment()) ? $app->environment() : 'default'; ?></dd><?php | |
$request = \Concrete\Core\Http\Request::getInstance(); | |
?><dt>Client IP:</dt><dd><?php echo $request->getClientIp(); ?></dd><?php | |
?><dt>Host:</dt><dd><?php echo $request->getHost(); ?></dd><?php |
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 | |
// 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; |
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 | |
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() |
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 | |
// 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).+$/'] | |
); |
NewerOlder