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
var a = document.createElement('a'); | |
a.download = filename; // Set the file name. | |
a.style.display = 'none'; | |
document.body.appendChild(a); | |
a.click(); | |
delete a; |
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
$db = Zend_Registry::get('db'); | |
$db->getProfiler()->setEnabled(true); | |
Zend_Debug::dump($db->getProfiler()->getLastQueryProfile()); |
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
(function($) { | |
$.fn.myPlugin = function() { | |
return this.each(function() { | |
//Do stuff | |
}); | |
}; | |
}(jQuery)); |
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
$upload = new Zend_File_Transfer_Adapter_Http(); | |
$uploaded_dir = APPLICATION_PATH.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'staff'.DIRECTORY_SEPARATOR.'photo'.DIRECTORY_SEPARATOR.$id; | |
if (!is_dir($uploaded_dir)) | |
@mkdir($uploaded_dir, 0777, true); | |
$upload->setDestination($uploaded_dir); | |
// $upload->addFilter('Rename', APPLICATION_PATH.'/../public/images/avatars/'.$id.'.jpg'); | |
try { | |
// This takes care of the moving and making sure the file is there |
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
protected function _initRoutes() | |
{ | |
$this->bootstrap('frontcontroller'); | |
/** | |
* @var Zend_Controller_Front $front | |
*/ | |
$front = $this->getResource('frontcontroller'); | |
/** | |
* @var Zend_Controller_Router_Rewrite $router | |
*/ |
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
RewriteEngine On | |
RewriteBase /bbs | |
RewriteCond %{REQUEST_URI} !/maintenance.html$ | |
RewriteCond %{REQUEST_URI} !/website_maintenance.png$ | |
RewriteRule $ /bbs/maintenance.html [R=302,L] |
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 | |
$url = "http://new.sell.dev/distributor"; | |
$post_data = array ( | |
"key" => "jAun729*hA6T6sE2nP3!m3@a4hw", | |
); | |
$ch = curl_init(); |
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 | |
trim(preg_replace(array('/\s{2,}/', '/[\t\n]+/'), ' ', $title)); |
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 CosDb { | |
private $DB_HOST; | |
private $DB_PORT; | |
private $DB_NAME; | |
private $DB_USER; | |
private $DB_PASS; | |
private $link; | |
public function __construct($user, $pass, $db_name, $host = 'localhost', $port = null) { |
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 CosDb { | |
public $DB_HOST; | |
public $DB_PORT; | |
public $DB_NAME; | |
public $DB_USER; | |
public $DB_PASS; | |
private $link; | |
public function __construct($user, $pass, $db_name, $host = 'localhost', $port = null) { |