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 | |
| // git://gist.github.com/868907.git | |
| // Простейший механизм миграции для БД Mysql. | |
| // В корне проекта добавляется папочка db, туда помещается этот скрипт и файлы миграций с шаблоном для имени: 20110314145307_действие_объект_контекст.sql, цифры в имени обеспечивают порядок применения. | |
| // Понимает 4 команды: show, backup, apply, restore | |
| // Базу модифицируют apply и restore, которые запускаются только после того как был сделан backup, не раньше чем час назад. | |
| // Реквизиты доступа к бд должны находится в configs/common.ini (Zend) | |
| // Запуск на выполнение производить из корня проекта: php db/migtation.php | |
| $params = parse_ini_file('configs/common.ini'); | |
| $migrations = new SimpleDbMigrations($params['params.host'], $params['params.username'], $params['params.password'], $params['params.dbname']); |
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
| require 'rubygems' | |
| require 'watir' | |
| def browser | |
| @browser ||= Watir::Browser.new() | |
| end | |
| After do | |
| browser.close |
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
| # language: ru | |
| Функционал: SJB-1061 дублирование PHPSESSID для форнтенда и админки. | |
| Предыстория: | |
| Допустим продукт установлен по адресу "http://vglebov-desktop.ss.kg/A-SJB-1061-PHPSESSID-kill-duplicates/" | |
| Если удаляю куки "PHPSESSID" для сайта | |
| То количество куки "PHPSESSID" для сайта должно быть 0 | |
| Сценарий: пользователь логнится в админку, затем во фронтенд, а сессия одна |
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
| package com.smartjobboard.jira.plugins; | |
| import org.mortbay.jetty.HttpConnection; | |
| import org.mortbay.jetty.Request; | |
| import org.mortbay.jetty.Server; | |
| import org.mortbay.jetty.handler.AbstractHandler; | |
| import javax.servlet.ServletException; | |
| import javax.servlet.http.HttpServletRequest; | |
| import javax.servlet.http.HttpServletResponse; |
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 | |
| /** | |
| * User: vglebov | |
| * Date: 4/22/11 | |
| * Time: 3:02 PM | |
| */ | |
| class Datasource | |
| { | |
| public $debug = false; |
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 | |
| class Exec{ | |
| var $commandLine; | |
| var $resultCode = 0; | |
| var $output = array(); | |
| public static function withCommandLine($commandLine){ | |
| return new Exec($commandLine); | |
| } |
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
| #!/bin/sh | |
| DatabaseHost="localhost" | |
| DatabaseName=$1 | |
| DatabasePort="" | |
| DatabaseSocket="" | |
| DatabaseUsername=$2 | |
| DatabasePassword=$3 | |
| isImportCompleted() { |
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
| Задача из учебника по ПХП: | |
| Создайте программу, которая трансформирует первое предложение во второе, и выводит результат. Оба предложения представлены ниже: | |
| A. Теперь пора всем хорошим людям прийти на помощь стране; | |
| Б. Пора теперь стране прийти на помощь всем хорошим людям. | |
| Интересно, как бы ее решили знакомые разработчики. Просьба код выкладывать на gist.github.com |
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 | |
| try { | |
| if (isFormDataSubmitted()) { | |
| $clientId = getSignedInUserId(); | |
| if (!$clientId) { | |
| $clientId = apiAddClientAndGetId(); | |
| } | |
| addProductToUser($trial_version_product_id, $clientId); | |
| displaySuccessfullMessage(); | |
| } else { |
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
| [debug] | |
| ; Remote settings | |
| xdebug.remote_autostart=on | |
| xdebug.remote_enable=on | |
| xdebug.remote_handler=dbgp | |
| xdebug.remote_mode=req | |
| xdebug.remote_host=localhost | |
| xdebug.remote_port=9000 | |
| ; General |
OlderNewer