How Yii framework creates timed tasks from console commands

yii

Assuming that the Yii project path is/HOME/APPS/1, create the file/home/apps/protected/commands/crons.php $yii = '/home/apps/framework/yii.php '; Require_once ($YII); $configFile = DirName (__file__).

Phpsocket A simple PHP socket instance

Server 1 Php2Set_time_limit(0);34$ip= ' 127.0.0.1 ';5$port= 8888;67//1. Create8if( ($sock= Socket_create (Af_inet, sock_stream, sol_tcp) = =FALSE ){9Echo' Create fail: '.Socket_strerror (Socket_last_error ());Ten} One A//2. Binding

PHP to upload files and add text and image watermark code

/************************************* Parameter description: $max _file_size: Upload file size limit, unit byte $destination _folder: Upload file path $watermark: Whether additional watermark (1 is watermark, the other is not

PHP run appears notice:use of undefined constant workaround

When modifying a program, it is suggested that notice:use of undefined constant is resolved by the following method, preferably error_reporting (0), without changing the configuration. When modifying a program, it is suggested that notice:use of

Examples of sending messages using the PEAR:NET_SMTP class

Require ' net/smtp.php '; $host = ' 126.com '; IP or domain name of the//SMTP server $username = ' arcow ';//user name of the login SMTP server $password = ' secret ';//Login to SMTP server password $from = ' jbxue@126.com '; Who

PHP 72-hour weather forecast for each city [China weather NET]

PHP 72-hour weather forecast for each cityGet the city weather forecast content data.txt Download: http://3.ibtf.sinaapp.com/data.txt[Note page encoding]Demo Address: http://3.ibtf.sinaapp.com/?city=%E7%9F%B3%E5%AE%B6%E5%BA%84 function

Introduction to PHP's method of obtaining the client's real IP

function GetIP () { if (getenv ("Http_client_ip") && strcasecmp (getenv ("Http_client_ip"), "Unknown") $ip = getenv ("Http_client_ip"); else if (getenv ("Http_x_forwarded_for") && strcasecmp (getenv ("Http_x_forwarded_for"),

The difference between empty () and isset () functions

This article introduces the difference between empty and isset functions in PHP, and interested friends can refer to the learning. When using PHP to write a page program, I often use the variable handler function to determine the PHP page trailing

How to store the user ID and password to the MySQL database

CREATE TABLE Tbl_auth_user ( USER_ID VARCHAR (Ten) is not NULL, User_password CHAR (+) not NULL, PRIMARY KEY (user_id) ); INSERT into Tbl_auth_user (user_id, User_password) VALUES (' Theadmin ', password ('

PHP set index.php file as read-only method

function set_writeable ($file _name) { if (@chmod ($file _name,0555)) { echo "Modified index.php file read-only attribute succeeded"; } Else { echo "modified the index.php file read-only

10 good habits of PHP programming

function Baz ($y $z) { $x = new Array (); $x [Sales] = 60; $x [Profit] = 20: foreach ($x as $key = $value) { echo $key + "+ $value +""; } } Copy CodeSmart, how many places can you

Database connection Operation class

Database connection Operation class Class MySQL { Private $_link; Public function __construct ($dbhost, $dbuser, $dbpassword, $dbname, $charset = ' UTF8 ') { $this->_link =

Summary of PHP output non-HTML format files

$file = ' a.pdf '; if (file_exists ($file)) { Header (' Content-description:file Transfer '); Header (' Content-type:application/octet-stream '); Header (' content-disposition:attachment; Filename= '. basename

PHP imitation GD generated BMP image

PHP imitation GD generated BMP image Function Imagebmp (& $im, $filename = ", $bit = 8, $compression = 0) { if (!in_array ($bit, Array (1, 4, 8, 16, 24, 32))) { $bit = 8; } else if ($bit = = +)//todo:32 bit

Two ways to generate static files in PHP

Ob_start (); #开启服务器缓存 Include_once ' index.php '; $ctx =ob_get_contents (); #获取缓存 Ob_end_clean (); #清空缓存 $FH =fopen ("index.html", "w+"); Fwrite ($FH, $ctx); #写入html, generating HTML Fclose ($FH); ?>

PHP Strtotime Function Detailed description

This article describes the use of the timestamp function strtotime () in PHP and the need for a friend to refer to below.Strtotime function is a very good function, flexible use of it, will give you a lot of convenience in the work. But the PHP

Deep analysis and understanding of PHP file Upload principle

For everyone in-depth introduction of PHP file upload related principles, have the need for friends, you can refer to the next.Many PHP tutorials, will introduce file upload, it is well known that PHP file upload is simple and efficient, today for

PHP Shopping Cart feature Implementation code (introductory example)

Product Category page Session_Start ();//Open Session Environment Determine if the user has clicked the "Add to Cart" button if (isset ($_post[' cart ')) { Cyclic mode Assignment foreach ($_post[' cart ') as $value) {

Code for a two-dimensional PHP array sorted by the specified key value

Ordering of key values for two-dimensional arrays function Array_sort ($array, $keys, $type = ' desc ') { if (!isset ($array) | |!is_array ($array) | | empty ($array)) { Return '; } if (!isset ($keys) | | trim ($keys) = = ')

PHP Multi-image Upload simple example (graphic)

PHP Multi-image Upload simple example, only for beginners friends reference, the programmer's home produced. No reprint is permitted without permission.PHP Multi-image Upload simple example for beginners to refer to friends. Script Academy produced,

Total Pages: 5208 1 .... 1958 1959 1960 1961 1962 .... 5208 Go to: GO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.