Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
<?php | |
class My_Zend_Application_Bootstrap_LazyBootstrap extends Zend_Application_Bootstrap_Bootstrap | |
{ | |
/** | |
* Bootstrap implementation | |
* | |
* This method may be overridden to provide custom bootstrapping logic. | |
* It is the sole method called by {@link bootstrap()}. | |
* |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
<?php | |
define('DS', DIRECTORY_SEPARATOR); | |
function _getExtractSchemaStatement($sqlFileName, $db) | |
{ | |
$dumpSchema = 'mysqldump' . ' '; | |
$dumpSchema .= '--no-data' . ' '; | |
$dumpSchema .= '-u ' . $db['user'] . ' '; | |
$dumpSchema .= '-p' . $db['pass'] . ' '; | |
$dumpSchema .= '-h ' . $db['host'] . ' '; |
<?php | |
// located in the /app/filters.php | |
/* some original code */ | |
Route::filter('statistics.auth.basic', function() { | |
$user = Request::getUser(); | |
$password = Request::getPassword(); | |
if (!App::environment('development') && |
#Как упороться по модульной структуре и областям ответственности в Laravel. А потом стать счастливым.
[UPD] после пары вопросов в личку, решил добавить дисклеймер: Я не считаю, что это единственно верный путь. Я просто говорю вам о том, что существует такой подход.
Когда меня спрашивают для чего нужны сервис-провайдеры в Laravel, я пожимаю плечами и говорю: если вы не знаете зачем они нужны, значит они вам не нужны. Если вы пишите и строите код так, как это описано во всех мануалах, скорее всего вам хватит одного провайдера на всё приложение, и он уже есть сразу. И не надо парить мозг себе и людям. Просто забейте на это все.
Дефолтная структура приложения на laravel выглядит вот так: У вас есть папка Http
в которой лежат посредники(раньше это были фильтры) и контроллеры. Так же есть команды, хэндлеры, исключения, модели (последние Тейлор бессовестно бросил просто так - прямо в корне app )... возможно вы сами создаете папки репозиториев, обсерверов... или что-то там еще... потом вы начинаете строить
This page provides a full overview of PHP's SessionHandler
life-cycle - this was generated by a set of test-scripts, in order to provide an exact overview of when and
what you can expect will be called in your custom SessionHandler
implementation.
Each example is a separate script being run by a client with cookies enabled.
To the left, you can see the function being called in your script, and to the right, you can see the resulting calls being made to a custom session-handler registed using session_set_save_handler().
import * as actions from 'action-creators'; | |
// Тип, который берет action-creators, выводит типы всех экшенов по отдельности и собирает их в union | |
type InferValueTypes<T> = T extends { [key: string]: infer U } | |
? U | |
: never; | |
type ActionTypes = ReturnType<InferValueTypes<typeof actions>>; |