Exemplo n.º 1
0
define('LIBRARY_PATH', realpath('.') . '/library');
error_reporting(E_ALL);
ini_set("display_errors", 1);
require APPLICATION_ROOT . '/system/boot/helper/console.php';
//Получаем имя
if (empty($argv[1])) {
    echo 'Write mailer name' . PHP_EOL;
    exit(127);
}
$mailer = ucfirst($argv[1]);
//Проверяем директории
$directories = ["/application/mailers", "/application/views/mailer", "/test/mailers"];
//Создаём необходимые директории
Boot_Console_Helper::mkdir($directories);
//Создаем класс
$class = <<<PHP
<?
class {$mailer}Mailer extends Boot_Mailer_Abstract {

}
PHP;
Boot_Console_Helper::create_file('/application/mailers/' . strtolower($mailer) . '.php', $class);
//Создаем класс
$class = <<<PHP
<?
class {$mailer}MailerPreview {

}
PHP;
Boot_Console_Helper::create_file('/test/mailers/' . strtolower($mailer) . '.php', $class);
Exemplo n.º 2
0
fastcgi_buffer_size 128k;
fastcgi_buffers    4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_index      index.php;

fastcgi_param  DOCUMENT_ROOT      \$document_root;
fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SCRIPT_FILENAME    \$document_root/index.php;

fastcgi_param  HTTP_HOST          \$host;
fastcgi_param  SERVER_NAME        \$host;
fastcgi_param  REQUEST_URI        \$uri;
fastcgi_param  QUERY_STRING       \$query_string;
fastcgi_param  REQUEST_METHOD     \$request_method;
fastcgi_param  CONTENT_TYPE       \$content_type;
fastcgi_param  CONTENT_LENGTH     \$content_length;
fastcgi_param  DOCUMENT_URI       \$document_uri;
fastcgi_param  SERVER_PROTOCOL    \$server_protocol;

fastcgi_param  SERVER_ADDR        \$server_addr;
fastcgi_param  SERVER_PORT        \$server_port;
fastcgi_param  SERVER_NAME        \$server_name;
fastcgi_param  REQUEST_SCHEME     \$scheme;

fastcgi_param  REMOTE_ADDR        \$proxy_add_x_forwarded_for;
fastcgi_param  REMOTE_PORT        \$remote_port;
CONF;
Boot_Console_Helper::create_file("/application/config/fastcgi.conf", $fastcgi);
$nginx = "server {\n\tlisten 80;\n\tserver_name localhost;\n\troot " . APPLICATION_ROOT . "/public;\n\n\t#Only for Development\n\tlocation ~ /assets/.*\$ {\n\t\tinclude " . APPLICATION_PATH . "/config/fastcgi.conf;\n\t}\n\n\tlocation ~* \\.(jpg|jpeg|gif|png|ico|bmp|swf|woff|ttf|eot|js|css|svg|zip|txt|xml)\$ {\n\t\troot " . APPLICATION_ROOT . "/public;\n\t\taccess_log off;\n\t}\n\n\tlocation / {\n\t\tinclude " . APPLICATION_PATH . "/config/fastcgi.conf;\n\t}\n}\n";
Boot_Console_Helper::create_file("/application/config/nginx.conf", $nginx);