Merge branch 'storageareas' of github.com:/ConnorTechnology/ZoneMinder into storageareas
commit
01f159c20e
|
@ -25,29 +25,31 @@ if [ "$1" = "configure" ]; then
|
|||
if [ -e "/lib/systemd/system/mysql.service" ] || [ -e "/lib/systemd/system/mariadb.service" ]; then
|
||||
# Ensure zoneminder is stopped
|
||||
deb-systemd-invoke stop zoneminder.service || exit $?
|
||||
|
||||
|
||||
#
|
||||
# Get mysql started if it isn't running
|
||||
#
|
||||
$(systemctl status mysql.service >/dev/null 2>&1); MYSQL_STATUS=$?
|
||||
$(systemctl status mariadb.service >/dev/null 2>&1); MARIADB_STATUS=$?
|
||||
|
||||
# 3 = inactive, 4 = nonexistant
|
||||
if [ "$MARIADB_STATUS" != "4" ]; then
|
||||
if [ -e "/lib/systemd/system/mariadb.service" ]; then
|
||||
DBSERVICE="mariadb.service"
|
||||
else
|
||||
DBSERVICE="mysql.service"
|
||||
fi
|
||||
if systemctl is-failed --quiet $DBSERVICE; then
|
||||
echo "$DBSERVICE is in a failed state; it will not be started."
|
||||
echo "If you have already resolved the problem preventing $DBSERVICE from running,"
|
||||
echo "run sudo systemctl restart $DBSERVICE then run sudo dpkg-reconfigure zoneminder."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$MYSQL_STATUS" != "0" ] && [ "$MARIADB_STATUS" != "0" ]; then
|
||||
# 3 = inactive, 4 = nonexistant
|
||||
if ! systemctl is-active --quiet mysql.service mariadb.service; then
|
||||
# Due to /etc/init.d service autogeneration, mysql.service always returns the status of mariadb.service
|
||||
# However, mariadb.service will not return the status of mysql.service.
|
||||
deb-systemd-invoke start $DBSERVICE
|
||||
fi
|
||||
|
||||
|
||||
# Make sure systemctl status exit code is 0; i.e. the DB is running
|
||||
if systemctl status "$DBSERVICE" >/dev/null 2>&1; then
|
||||
|
||||
if systemctl is-active --quiet "$DBSERVICE"; then
|
||||
mysqladmin --defaults-file=/etc/mysql/debian.cnf -f reload
|
||||
# test if database if already present...
|
||||
if ! $(echo quit | mysql --defaults-file=/etc/mysql/debian.cnf zm > /dev/null 2> /dev/null) ; then
|
||||
|
|
|
@ -53,67 +53,70 @@ GetOptions(
|
|||
version => \$version
|
||||
);
|
||||
if ( $version ) {
|
||||
print( ZoneMinder::Base::ZM_VERSION . "\n");
|
||||
exit(0);
|
||||
print( ZoneMinder::Base::ZM_VERSION . "\n");
|
||||
exit(0);
|
||||
}
|
||||
if ( $help ) {
|
||||
pod2usage(-exitstatus => -1);
|
||||
pod2usage(-exitstatus => -1);
|
||||
}
|
||||
if ( ! defined $interval ) {
|
||||
$interval = eval($Config{ZM_TELEMETRY_INTERVAL});
|
||||
}
|
||||
|
||||
if ( $Config{ZM_TELEMETRY_DATA} or $force ) {
|
||||
print "Update agent starting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n";
|
||||
if ( !($Config{ZM_TELEMETRY_DATA} or $force) ) {
|
||||
print "ZoneMinder Telemetry Agent not enabled. Exiting.\n";
|
||||
exit(0);
|
||||
}
|
||||
|
||||
print 'ZoneMinder Telemetry Agent starting at '.strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n";
|
||||
|
||||
my $lastCheck = $Config{ZM_TELEMETRY_LAST_UPLOAD};
|
||||
my $lastCheck = $Config{ZM_TELEMETRY_LAST_UPLOAD};
|
||||
|
||||
while( 1 ) {
|
||||
my $now = time();
|
||||
my $since_last_check = $now-$lastCheck;
|
||||
Debug(" Last Check time (now($now) - lastCheck($lastCheck)) = $since_last_check > interval($interval) or force($force)");
|
||||
if ( $since_last_check < 0 ) {
|
||||
Warning( "Seconds since last check is negative! Which means that lastCheck is in the future!" );
|
||||
next;
|
||||
}
|
||||
if ( ( ($now-$lastCheck) > $interval ) or $force ) {
|
||||
print "Collecting data to send to ZoneMinder Telemetry server.\n";
|
||||
my $dbh = zmDbConnect();
|
||||
while( 1 ) {
|
||||
my $now = time();
|
||||
my $since_last_check = $now-$lastCheck;
|
||||
Debug(" Last Check time (now($now) - lastCheck($lastCheck)) = $since_last_check > interval($interval) or force($force)");
|
||||
if ( $since_last_check < 0 ) {
|
||||
Warning( 'Seconds since last check is negative! Which means that lastCheck is in the future!' );
|
||||
next;
|
||||
}
|
||||
if ( ( ($since_last_check) > $interval ) or $force ) {
|
||||
print "Collecting data to send to ZoneMinder Telemetry server.\n";
|
||||
my $dbh = zmDbConnect();
|
||||
# Build the telemetry hash
|
||||
# We should keep *BSD systems in mind when calling system commands
|
||||
my %telemetry;
|
||||
$telemetry{uuid} = getUUID($dbh);
|
||||
$telemetry{ip} = getIP();
|
||||
$telemetry{timestamp} = strftime( '%Y-%m-%dT%H:%M:%S%z', localtime() );
|
||||
$telemetry{monitor_count} = countQuery($dbh,'Monitors');
|
||||
$telemetry{event_count} = countQuery($dbh,'Events');
|
||||
$telemetry{architecture} = runSysCmd('uname -p');
|
||||
($telemetry{kernel}, $telemetry{distro}, $telemetry{version}) = getDistro();
|
||||
$telemetry{zm_version} = ZoneMinder::Base::ZM_VERSION;
|
||||
$telemetry{system_memory} = totalmem();
|
||||
$telemetry{processor_count} = cpu_count();
|
||||
$telemetry{monitors} = getMonitorRef($dbh);
|
||||
my %telemetry;
|
||||
$telemetry{uuid} = getUUID($dbh);
|
||||
$telemetry{ip} = getIP();
|
||||
$telemetry{timestamp} = strftime( '%Y-%m-%dT%H:%M:%S%z', localtime() );
|
||||
$telemetry{monitor_count} = countQuery($dbh,'Monitors');
|
||||
$telemetry{event_count} = countQuery($dbh,'Events');
|
||||
$telemetry{architecture} = runSysCmd('uname -p');
|
||||
($telemetry{kernel}, $telemetry{distro}, $telemetry{version}) = getDistro();
|
||||
$telemetry{zm_version} = ZoneMinder::Base::ZM_VERSION;
|
||||
$telemetry{system_memory} = totalmem();
|
||||
$telemetry{processor_count} = cpu_count();
|
||||
$telemetry{monitors} = getMonitorRef($dbh);
|
||||
|
||||
Info( 'Sending data to ZoneMinder Telemetry server.' );
|
||||
Info('Sending data to ZoneMinder Telemetry server.');
|
||||
|
||||
my $result = jsonEncode( \%telemetry );
|
||||
my $result = jsonEncode(\%telemetry);
|
||||
|
||||
if ( sendData($result) ) {
|
||||
|
||||
my $sql = q`UPDATE Config SET Value = ? WHERE Name = 'ZM_TELEMETRY_LAST_UPLOAD'`;
|
||||
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() );
|
||||
my $res = $sth->execute( $now ) or die( "Can't execute: ".$sth->errstr() );
|
||||
$sth->finish();
|
||||
$Config{ZM_TELEMETRY_LAST_UPLOAD} = $now;
|
||||
}
|
||||
zmDbDisconnect();
|
||||
} elsif ( -t STDIN ) {
|
||||
print "Update agent sleeping for 1 hour because ($now-$lastCheck=$since_last_check > $interval\n";
|
||||
}
|
||||
sleep( 3600 );
|
||||
}
|
||||
print 'Update agent exiting at '.strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n";
|
||||
}
|
||||
if ( sendData($result) ) {
|
||||
my $sql = q`UPDATE Config SET Value = ? WHERE Name = 'ZM_TELEMETRY_LAST_UPLOAD'`;
|
||||
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() );
|
||||
my $res = $sth->execute($now) or die( "Can't execute: ".$sth->errstr() );
|
||||
$sth->finish();
|
||||
$Config{ZM_TELEMETRY_LAST_UPLOAD} = $now;
|
||||
}
|
||||
zmDbDisconnect();
|
||||
} elsif ( -t STDIN ) {
|
||||
print "ZoneMinder Telemetry Agent sleeping for $interval seconds because ($now-$lastCheck=$since_last_check > $interval\n";
|
||||
}
|
||||
$lastCheck = $now;
|
||||
sleep($interval);
|
||||
} # end while
|
||||
print 'ZoneMinder Telemetry Agent exiting at '.strftime('%y/%m/%d %H:%M:%S', localtime())."\n";
|
||||
|
||||
###############
|
||||
# SUBROUTINES #
|
||||
|
@ -178,7 +181,7 @@ sub sendData {
|
|||
# Retrieves the UUID from the database. Creates a new UUID if one does not exist.
|
||||
sub getUUID {
|
||||
my $dbh = shift;
|
||||
my $uuid= "";
|
||||
my $uuid= '';
|
||||
|
||||
# Verify the current UUID is valid and not nil
|
||||
if (( $Config{ZM_TELEMETRY_UUID} =~ /([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i ) && ( $Config{ZM_TELEMETRY_UUID} ne '00000000-0000-0000-0000-000000000000' )) {
|
||||
|
|
|
@ -39,26 +39,26 @@ bool zmDbConnect() {
|
|||
return false;
|
||||
}
|
||||
my_bool reconnect = 1;
|
||||
if ( mysql_options( &dbconn, MYSQL_OPT_RECONNECT, &reconnect ) )
|
||||
Error( "Can't set database auto reconnect option: %s", mysql_error( &dbconn) );
|
||||
if ( mysql_options(&dbconn, MYSQL_OPT_RECONNECT, &reconnect) )
|
||||
Error("Can't set database auto reconnect option: %s", mysql_error(&dbconn));
|
||||
if ( !staticConfig.DB_SSL_CA_CERT.empty() )
|
||||
mysql_ssl_set( &dbconn,
|
||||
mysql_ssl_set(&dbconn,
|
||||
staticConfig.DB_SSL_CLIENT_KEY.c_str(),
|
||||
staticConfig.DB_SSL_CLIENT_CERT.c_str(),
|
||||
staticConfig.DB_SSL_CA_CERT.c_str(),
|
||||
NULL, NULL );
|
||||
std::string::size_type colonIndex = staticConfig.DB_HOST.find( ":" );
|
||||
NULL, NULL);
|
||||
std::string::size_type colonIndex = staticConfig.DB_HOST.find(":");
|
||||
if ( colonIndex == std::string::npos ) {
|
||||
if ( !mysql_real_connect( &dbconn, staticConfig.DB_HOST.c_str(), staticConfig.DB_USER.c_str(), staticConfig.DB_PASS.c_str(), NULL, 0, NULL, 0 ) ) {
|
||||
Error( "Can't connect to server: %s", mysql_error( &dbconn ) );
|
||||
if ( !mysql_real_connect(&dbconn, staticConfig.DB_HOST.c_str(), staticConfig.DB_USER.c_str(), staticConfig.DB_PASS.c_str(), NULL, 0, NULL, 0) ) {
|
||||
Error( "Can't connect to server: %s", mysql_error(&dbconn));
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
std::string dbHost = staticConfig.DB_HOST.substr( 0, colonIndex );
|
||||
std::string dbPortOrSocket = staticConfig.DB_HOST.substr( colonIndex+1 );
|
||||
if ( dbPortOrSocket[0] == '/' ) {
|
||||
if ( !mysql_real_connect( &dbconn, NULL, staticConfig.DB_USER.c_str(), staticConfig.DB_PASS.c_str(), NULL, 0, dbPortOrSocket.c_str(), 0 ) ) {
|
||||
Error( "Can't connect to server: %s", mysql_error( &dbconn ) );
|
||||
if ( !mysql_real_connect(&dbconn, NULL, staticConfig.DB_USER.c_str(), staticConfig.DB_PASS.c_str(), NULL, 0, dbPortOrSocket.c_str(), 0) ) {
|
||||
Error("Can't connect to server: %s", mysql_error(&dbconn));
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
@ -70,7 +70,7 @@ bool zmDbConnect() {
|
|||
}
|
||||
if ( mysql_select_db( &dbconn, staticConfig.DB_NAME.c_str() ) ) {
|
||||
Error( "Can't select database: %s", mysql_error( &dbconn ) );
|
||||
exit( mysql_errno( &dbconn ) );
|
||||
return false;
|
||||
}
|
||||
zmDbConnected = true;
|
||||
return zmDbConnected;
|
||||
|
@ -78,67 +78,71 @@ bool zmDbConnect() {
|
|||
|
||||
void zmDbClose() {
|
||||
if ( zmDbConnected ) {
|
||||
db_mutex.lock();
|
||||
mysql_close( &dbconn );
|
||||
// mysql_init() call implicitly mysql_library_init() but
|
||||
// mysql_close() does not call mysql_library_end()
|
||||
mysql_library_end();
|
||||
zmDbConnected = false;
|
||||
db_mutex.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
MYSQL_RES * zmDbFetch( const char * query ) {
|
||||
MYSQL_RES * zmDbFetch(const char * query) {
|
||||
if ( ! zmDbConnected ) {
|
||||
Error( "Not connected." );
|
||||
Error("Not connected.");
|
||||
return NULL;
|
||||
}
|
||||
db_mutex.lock();
|
||||
|
||||
if ( mysql_query( &dbconn, query ) ) {
|
||||
Error( "Can't run query: %s", mysql_error( &dbconn ) );
|
||||
if ( mysql_query(&dbconn, query) ) {
|
||||
Error("Can't run query: %s", mysql_error(&dbconn));
|
||||
db_mutex.unlock();
|
||||
return NULL;
|
||||
}
|
||||
Debug( 4, "Success running query: %s", query );
|
||||
MYSQL_RES *result = mysql_store_result( &dbconn );
|
||||
Debug(4, "Success running query: %s", query);
|
||||
MYSQL_RES *result = mysql_store_result(&dbconn);
|
||||
if ( !result ) {
|
||||
Error( "Can't use query result: %s for query %s", mysql_error( &dbconn ), query );
|
||||
return NULL;
|
||||
Error("Can't use query result: %s for query %s", mysql_error(&dbconn), query);
|
||||
}
|
||||
db_mutex.unlock();
|
||||
return result;
|
||||
} // end MYSQL_RES * zmDbFetch( const char * query );
|
||||
} // end MYSQL_RES * zmDbFetch(const char * query);
|
||||
|
||||
zmDbRow *zmDbFetchOne( const char *query ) {
|
||||
zmDbRow *zmDbFetchOne(const char *query) {
|
||||
zmDbRow *row = new zmDbRow();
|
||||
if ( row->fetch( query ) ) {
|
||||
if ( row->fetch(query) ) {
|
||||
return row;
|
||||
}
|
||||
delete row;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
MYSQL_RES *zmDbRow::fetch( const char *query ) {
|
||||
result_set = zmDbFetch( query );
|
||||
MYSQL_RES *zmDbRow::fetch(const char *query) {
|
||||
result_set = zmDbFetch(query);
|
||||
if ( ! result_set ) return result_set;
|
||||
|
||||
int n_rows = mysql_num_rows( result_set );
|
||||
if ( n_rows != 1 ) {
|
||||
Error( "Bogus number of lines return from query, %d returned for query %s.", n_rows, query );
|
||||
mysql_free_result( result_set );
|
||||
Error("Bogus number of lines return from query, %d returned for query %s.", n_rows, query);
|
||||
mysql_free_result(result_set);
|
||||
result_set = NULL;
|
||||
return result_set;
|
||||
}
|
||||
|
||||
row = mysql_fetch_row( result_set );
|
||||
row = mysql_fetch_row(result_set);
|
||||
if ( ! row ) {
|
||||
mysql_free_result( result_set );
|
||||
mysql_free_result(result_set);
|
||||
result_set = NULL;
|
||||
Error("Error getting row from query %s. Error is %s", query, mysql_error( &dbconn ) );
|
||||
Error("Error getting row from query %s. Error is %s", query, mysql_error(&dbconn));
|
||||
} else {
|
||||
Debug(5, "Success");
|
||||
}
|
||||
return result_set;
|
||||
}
|
||||
zmDbRow::~zmDbRow() {
|
||||
if ( result_set )
|
||||
mysql_free_result( result_set );
|
||||
if ( result_set ) {
|
||||
mysql_free_result(result_set);
|
||||
result_set = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -187,7 +187,7 @@ int FfmpegCamera::Capture( Image &image ) {
|
|||
|
||||
int frameComplete = false;
|
||||
while ( !frameComplete ) {
|
||||
int avResult = av_read_frame( mFormatContext, &packet );
|
||||
int avResult = av_read_frame(mFormatContext, &packet);
|
||||
char errbuf[AV_ERROR_MAX_STRING_SIZE];
|
||||
if ( avResult < 0 ) {
|
||||
av_strerror(avResult, errbuf, AV_ERROR_MAX_STRING_SIZE);
|
||||
|
@ -197,15 +197,10 @@ int FfmpegCamera::Capture( Image &image ) {
|
|||
// Check for Connection failure.
|
||||
(avResult == -110)
|
||||
) {
|
||||
Info( "av_read_frame returned \"%s\". Reopening stream.", errbuf );
|
||||
if ( ReopenFfmpeg() < 0 ) {
|
||||
// OpenFfmpeg will do enough logging.
|
||||
return -1;
|
||||
}
|
||||
continue;
|
||||
Info("Unable to read packet from stream %d: error %d \"%s\".", packet.stream_index, avResult, errbuf);
|
||||
} else {
|
||||
Error("Unable to read packet from stream %d: error %d \"%s\".", packet.stream_index, avResult, errbuf);
|
||||
}
|
||||
|
||||
Error( "Unable to read packet from stream %d: error %d \"%s\".", packet.stream_index, avResult, errbuf );
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -707,10 +702,19 @@ int FfmpegCamera::CaptureAndRecord( Image &image, timeval recording, char* event
|
|||
while ( ! frameComplete ) {
|
||||
av_init_packet( &packet );
|
||||
|
||||
ret = av_read_frame( mFormatContext, &packet );
|
||||
ret = av_read_frame(mFormatContext, &packet);
|
||||
if ( ret < 0 ) {
|
||||
av_strerror( ret, errbuf, AV_ERROR_MAX_STRING_SIZE );
|
||||
Error( "Unable to read packet from stream %d: error %d \"%s\".", packet.stream_index, ret, errbuf );
|
||||
av_strerror(ret, errbuf, AV_ERROR_MAX_STRING_SIZE);
|
||||
if (
|
||||
// Check if EOF.
|
||||
(ret == AVERROR_EOF || (mFormatContext->pb && mFormatContext->pb->eof_reached)) ||
|
||||
// Check for Connection failure.
|
||||
(ret == -110)
|
||||
) {
|
||||
Info("Unable to read packet from stream %d: error %d \"%s\".", packet.stream_index, ret, errbuf);
|
||||
} else {
|
||||
Error("Unable to read packet from stream %d: error %d \"%s\".", packet.stream_index, ret, errbuf);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,22 +61,22 @@ void Logger::usrHandler( int sig ) {
|
|||
logger->level( logger->level()+1 );
|
||||
else if ( sig == SIGUSR2 )
|
||||
logger->level( logger->level()-1 );
|
||||
Info( "Logger - Level changed to %d", logger->level() );
|
||||
Info("Logger - Level changed to %d", logger->level());
|
||||
}
|
||||
|
||||
Logger::Logger() :
|
||||
mLevel( INFO ),
|
||||
mTerminalLevel( NOLOG ),
|
||||
mDatabaseLevel( NOLOG ),
|
||||
mFileLevel( NOLOG ),
|
||||
mSyslogLevel( NOLOG ),
|
||||
mEffectiveLevel( NOLOG ),
|
||||
mLevel(INFO),
|
||||
mTerminalLevel(NOLOG),
|
||||
mDatabaseLevel(NOLOG),
|
||||
mFileLevel(NOLOG),
|
||||
mSyslogLevel(NOLOG),
|
||||
mEffectiveLevel(NOLOG),
|
||||
//mLogPath( staticConfig.PATH_LOGS.c_str() ),
|
||||
//mLogFile( mLogPath+"/"+mId+".log" ),
|
||||
mDbConnected( false ),
|
||||
mLogFileFP( NULL ),
|
||||
mHasTerminal( false ),
|
||||
mFlush( false ) {
|
||||
mDbConnected(false),
|
||||
mLogFileFP(NULL),
|
||||
mHasTerminal(false),
|
||||
mFlush(false) {
|
||||
|
||||
if ( smInstance ) {
|
||||
Panic( "Attempt to create second instance of Logger class" );
|
||||
|
@ -124,7 +124,7 @@ Logger::~Logger() {
|
|||
#endif
|
||||
}
|
||||
|
||||
void Logger::initialise( const std::string &id, const Options &options ) {
|
||||
void Logger::initialise(const std::string &id, const Options &options) {
|
||||
char *envPtr;
|
||||
|
||||
if ( !id.empty() )
|
||||
|
@ -132,7 +132,7 @@ void Logger::initialise( const std::string &id, const Options &options ) {
|
|||
|
||||
std::string tempLogFile;
|
||||
|
||||
if ( (envPtr = getTargettedEnv( "LOG_FILE" )) )
|
||||
if ( (envPtr = getTargettedEnv("LOG_FILE")) )
|
||||
tempLogFile = envPtr;
|
||||
else if ( options.mLogFile.size() )
|
||||
tempLogFile = options.mLogFile;
|
||||
|
@ -171,20 +171,20 @@ void Logger::initialise( const std::string &id, const Options &options ) {
|
|||
if ( (envPtr = getenv( "LOG_PRINT" )) )
|
||||
tempTerminalLevel = atoi(envPtr) ? DEBUG9 : NOLOG;
|
||||
|
||||
if ( (envPtr = getTargettedEnv( "LOG_LEVEL" )) )
|
||||
if ( (envPtr = getTargettedEnv("LOG_LEVEL")) )
|
||||
tempLevel = atoi(envPtr);
|
||||
|
||||
if ( (envPtr = getTargettedEnv( "LOG_LEVEL_TERM" )) )
|
||||
if ( (envPtr = getTargettedEnv("LOG_LEVEL_TERM")) )
|
||||
tempTerminalLevel = atoi(envPtr);
|
||||
if ( (envPtr = getTargettedEnv( "LOG_LEVEL_DATABASE" )) )
|
||||
if ( (envPtr = getTargettedEnv("LOG_LEVEL_DATABASE")) )
|
||||
tempDatabaseLevel = atoi(envPtr);
|
||||
if ( (envPtr = getTargettedEnv( "LOG_LEVEL_FILE" )) )
|
||||
if ( (envPtr = getTargettedEnv("LOG_LEVEL_FILE")) )
|
||||
tempFileLevel = atoi(envPtr);
|
||||
if ( (envPtr = getTargettedEnv( "LOG_LEVEL_SYSLOG" )) )
|
||||
if ( (envPtr = getTargettedEnv("LOG_LEVEL_SYSLOG")) )
|
||||
tempSyslogLevel = atoi(envPtr);
|
||||
|
||||
if ( config.log_debug ) {
|
||||
StringVector targets = split( config.log_debug_target, "|" );
|
||||
StringVector targets = split(config.log_debug_target, "|");
|
||||
for ( unsigned int i = 0; i < targets.size(); i++ ) {
|
||||
const std::string &target = targets[i];
|
||||
if ( target == mId || target == "_"+mId || target == "_"+mIdRoot || target == "" ) {
|
||||
|
@ -206,15 +206,14 @@ void Logger::initialise( const std::string &id, const Options &options ) {
|
|||
if ( tempLevel > INFO ) tempLevel = INFO;
|
||||
} // end if config.log_debug
|
||||
|
||||
logFile(tempLogFile);
|
||||
|
||||
logFile( tempLogFile );
|
||||
terminalLevel(tempTerminalLevel);
|
||||
databaseLevel(tempDatabaseLevel);
|
||||
fileLevel(tempFileLevel);
|
||||
syslogLevel(tempSyslogLevel);
|
||||
|
||||
terminalLevel( tempTerminalLevel );
|
||||
databaseLevel( tempDatabaseLevel );
|
||||
fileLevel( tempFileLevel );
|
||||
syslogLevel( tempSyslogLevel );
|
||||
|
||||
level( tempLevel );
|
||||
level(tempLevel);
|
||||
|
||||
mFlush = false;
|
||||
if ( (envPtr = getenv("LOG_FLUSH")) ) {
|
||||
|
@ -223,24 +222,24 @@ void Logger::initialise( const std::string &id, const Options &options ) {
|
|||
mFlush = true;
|
||||
}
|
||||
|
||||
//mRuntime = (envPtr = getenv( "LOG_RUNTIME")) ? atoi( envPtr ) : false;
|
||||
{
|
||||
struct sigaction action;
|
||||
memset( &action, 0, sizeof(action) );
|
||||
memset(&action, 0, sizeof(action));
|
||||
action.sa_handler = usrHandler;
|
||||
action.sa_flags = SA_RESTART;
|
||||
|
||||
if ( sigaction( SIGUSR1, &action, 0 ) < 0 ) {
|
||||
Fatal( "sigaction(), error = %s", strerror(errno) );
|
||||
// Does this REALLY need to be fatal?
|
||||
if ( sigaction(SIGUSR1, &action, 0) < 0 ) {
|
||||
Fatal("sigaction(), error = %s", strerror(errno));
|
||||
}
|
||||
if ( sigaction( SIGUSR2, &action, 0 ) < 0) {
|
||||
Fatal( "sigaction(), error = %s", strerror(errno) );
|
||||
if ( sigaction(SIGUSR2, &action, 0) < 0) {
|
||||
Fatal("sigaction(), error = %s", strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
mInitialised = true;
|
||||
|
||||
Debug( 1, "LogOpts: level=%s/%s, screen=%s, database=%s, logfile=%s->%s, syslog=%s",
|
||||
Debug(1, "LogOpts: level=%s/%s, screen=%s, database=%s, logfile=%s->%s, syslog=%s",
|
||||
smCodes[mLevel].c_str(),
|
||||
smCodes[mEffectiveLevel].c_str(),
|
||||
smCodes[mTerminalLevel].c_str(),
|
||||
|
@ -252,7 +251,7 @@ void Logger::initialise( const std::string &id, const Options &options ) {
|
|||
}
|
||||
|
||||
void Logger::terminate() {
|
||||
Debug(1, "Terminating Logger" );
|
||||
Debug(1, "Terminating Logger");
|
||||
|
||||
if ( mFileLevel > NOLOG )
|
||||
closeFile();
|
||||
|
@ -264,60 +263,61 @@ void Logger::terminate() {
|
|||
closeDatabase();
|
||||
}
|
||||
|
||||
bool Logger::boolEnv( const std::string &name, bool defaultValue ) {
|
||||
const char *envPtr = getenv( name.c_str() );
|
||||
return( envPtr ? atoi( envPtr ) : defaultValue );
|
||||
// These don't belong here, they have nothing to do with logging
|
||||
bool Logger::boolEnv(const std::string &name, bool defaultValue) {
|
||||
const char *envPtr = getenv(name.c_str());
|
||||
return envPtr ? atoi(envPtr) : defaultValue;
|
||||
}
|
||||
|
||||
int Logger::intEnv( const std::string &name, bool defaultValue ) {
|
||||
const char *envPtr = getenv( name.c_str() );
|
||||
return( envPtr ? atoi( envPtr ) : defaultValue );
|
||||
int Logger::intEnv(const std::string &name, bool defaultValue) {
|
||||
const char *envPtr = getenv(name.c_str());
|
||||
return envPtr ? atoi(envPtr) : defaultValue;
|
||||
}
|
||||
|
||||
std::string Logger::strEnv( const std::string &name, const std::string &defaultValue ) {
|
||||
const char *envPtr = getenv( name.c_str() );
|
||||
return( envPtr ? envPtr : defaultValue );
|
||||
std::string Logger::strEnv(const std::string &name, const std::string &defaultValue) {
|
||||
const char *envPtr = getenv(name.c_str());
|
||||
return envPtr ? envPtr : defaultValue;
|
||||
}
|
||||
|
||||
char *Logger::getTargettedEnv( const std::string &name ) {
|
||||
char *Logger::getTargettedEnv(const std::string &name) {
|
||||
std::string envName;
|
||||
|
||||
envName = name+"_"+mId;
|
||||
char *envPtr = getenv( envName.c_str() );
|
||||
char *envPtr = getenv(envName.c_str());
|
||||
if ( !envPtr && mId != mIdRoot ) {
|
||||
envName = name+"_"+mIdRoot;
|
||||
envPtr = getenv( envName.c_str() );
|
||||
envPtr = getenv(envName.c_str());
|
||||
}
|
||||
if ( !envPtr )
|
||||
envPtr = getenv( name.c_str() );
|
||||
return( envPtr );
|
||||
envPtr = getenv(name.c_str());
|
||||
return envPtr;
|
||||
}
|
||||
|
||||
const std::string &Logger::id( const std::string &id ) {
|
||||
const std::string &Logger::id(const std::string &id) {
|
||||
std::string tempId = id;
|
||||
|
||||
size_t pos;
|
||||
// Remove whitespace
|
||||
while ( (pos = tempId.find_first_of( " \t" )) != std::string::npos ) {
|
||||
tempId.replace( pos, 1, "" );
|
||||
tempId.replace(pos, 1, "");
|
||||
}
|
||||
// Replace non-alphanum with underscore
|
||||
while ( (pos = tempId.find_first_not_of( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_" )) != std::string::npos ) {
|
||||
tempId.replace( pos, 1, "_" );
|
||||
while ( (pos = tempId.find_first_not_of("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_")) != std::string::npos ) {
|
||||
tempId.replace(pos, 1, "_");
|
||||
}
|
||||
if ( mId != tempId ) {
|
||||
mId = tempId;
|
||||
pos = mId.find( '_' );
|
||||
pos = mId.find('_');
|
||||
if ( pos != std::string::npos ) {
|
||||
mIdRoot = mId.substr( 0, pos );
|
||||
mIdRoot = mId.substr(0, pos);
|
||||
if ( ++pos < mId.size() )
|
||||
mIdArgs = mId.substr( pos );
|
||||
mIdArgs = mId.substr(pos);
|
||||
}
|
||||
}
|
||||
return( mId );
|
||||
}
|
||||
|
||||
Logger::Level Logger::level( Logger::Level level ) {
|
||||
Logger::Level Logger::level(Logger::Level level) {
|
||||
if ( level > NOOPT ) {
|
||||
level = limit(level);
|
||||
if ( mLevel != level )
|
||||
|
|
|
@ -1571,12 +1571,12 @@ bool Monitor::Analyse() {
|
|||
// lets construct alarm cause. It will contain cause + names of zones alarmed
|
||||
std::string alarm_cause="";
|
||||
for ( int i=0; i < n_zones; i++) {
|
||||
if (zones[i]->Alarmed()) {
|
||||
alarm_cause += std::string(zones[i]->Label());
|
||||
if (i < n_zones-1) {
|
||||
alarm_cause +=",";
|
||||
}
|
||||
if (zones[i]->Alarmed()) {
|
||||
alarm_cause += std::string(zones[i]->Label());
|
||||
if (i < n_zones-1) {
|
||||
alarm_cause +=",";
|
||||
}
|
||||
}
|
||||
}
|
||||
alarm_cause = cause+" "+alarm_cause;
|
||||
strncpy( shared_data->alarm_cause,alarm_cause.c_str() , sizeof(shared_data->alarm_cause) );
|
||||
|
|
|
@ -173,7 +173,7 @@ int main( int argc, char *argv[] ) {
|
|||
zm_reload = false;
|
||||
}
|
||||
sigprocmask( SIG_UNBLOCK, &block_set, 0 );
|
||||
}
|
||||
} // end while ! zm_terminate
|
||||
delete monitor;
|
||||
} else {
|
||||
fprintf( stderr, "Can't find monitor with id of %d\n", id );
|
||||
|
|
|
@ -102,6 +102,9 @@ commonprep () {
|
|||
git clone https://github.com/packpack/packpack.git packpack
|
||||
fi
|
||||
|
||||
# Rpm builds are broken in latest packpack master. Temporarily roll back.
|
||||
git -C packpack checkout 7cf23ee
|
||||
|
||||
# Patch packpack
|
||||
patch --dry-run --silent -f -p1 < utils/packpack/packpack-rpm.patch
|
||||
if [ $? -eq 0 ]; then
|
||||
|
|
|
@ -4,32 +4,42 @@
|
|||
*
|
||||
* Use it to configure database for ACL
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package app.Config.Schema
|
||||
* @since CakePHP(tm) v 0.2.9
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
/**
|
||||
* Using the Schema command line utility
|
||||
* cake schema run create DbAcl
|
||||
*
|
||||
*/
|
||||
class DbAclSchema extends CakeSchema {
|
||||
|
||||
/**
|
||||
* Before event.
|
||||
*
|
||||
* @param array $event The event data.
|
||||
* @return bool Success
|
||||
*/
|
||||
public function before($event = array()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* After event.
|
||||
*
|
||||
* @param array $event The event data.
|
||||
* @return void
|
||||
*/
|
||||
public function after($event = array()) {
|
||||
}
|
||||
|
||||
|
@ -44,7 +54,11 @@ class DbAclSchema extends CakeSchema {
|
|||
'alias' => array('type' => 'string', 'null' => true),
|
||||
'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
|
||||
'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
|
||||
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
|
||||
'indexes' => array(
|
||||
'PRIMARY' => array('column' => 'id', 'unique' => 1),
|
||||
'idx_acos_lft_rght' => array('column' => array('lft', 'rght'), 'unique' => 0),
|
||||
'idx_acos_alias' => array('column' => 'alias', 'unique' => 0)
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -58,7 +72,11 @@ class DbAclSchema extends CakeSchema {
|
|||
'alias' => array('type' => 'string', 'null' => true),
|
||||
'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
|
||||
'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
|
||||
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
|
||||
'indexes' => array(
|
||||
'PRIMARY' => array('column' => 'id', 'unique' => 1),
|
||||
'idx_aros_lft_rght' => array('column' => array('lft', 'rght'), 'unique' => 0),
|
||||
'idx_aros_alias' => array('column' => 'alias', 'unique' => 0)
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -73,7 +91,11 @@ class DbAclSchema extends CakeSchema {
|
|||
'_read' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
|
||||
'_update' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
|
||||
'_delete' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
|
||||
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1))
|
||||
'indexes' => array(
|
||||
'PRIMARY' => array('column' => 'id', 'unique' => 1),
|
||||
'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1),
|
||||
'idx_aco_id' => array('column' => 'aco_id', 'unique' => 0)
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# $Id$
|
||||
#
|
||||
# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
#
|
||||
# Licensed under The MIT License
|
||||
# For full copyright and license information, please see the LICENSE.txt
|
||||
# Redistributions of files must retain the above copyright notice.
|
||||
# MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
# MIT License (https://opensource.org/licenses/mit-license.php)
|
||||
|
||||
CREATE TABLE acos (
|
||||
id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
|
@ -38,4 +38,15 @@ CREATE TABLE aros (
|
|||
lft INTEGER(10) DEFAULT NULL,
|
||||
rght INTEGER(10) DEFAULT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
);
|
||||
|
||||
/* this indexes will improve acl perfomance */
|
||||
CREATE INDEX idx_acos_lft_rght ON `acos` (`lft`, `rght`);
|
||||
|
||||
CREATE INDEX idx_acos_alias ON `acos` (`alias`);
|
||||
|
||||
CREATE INDEX idx_aros_lft_rght ON `aros` (`lft`, `rght`);
|
||||
|
||||
CREATE INDEX idx_aros_alias ON `aros` (`alias`);
|
||||
|
||||
CREATE INDEX idx_aco_id ON `aros_acos` (`aco_id`);
|
||||
|
|
|
@ -4,22 +4,21 @@
|
|||
*
|
||||
* Use it to configure database for i18n
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package app.Config.Schema
|
||||
* @since CakePHP(tm) v 0.2.9
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* Using the Schema command line utility
|
||||
*
|
||||
* Use it to configure database for i18n
|
||||
|
@ -28,15 +27,37 @@
|
|||
*/
|
||||
class I18nSchema extends CakeSchema {
|
||||
|
||||
/**
|
||||
* The name property
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $name = 'i18n';
|
||||
|
||||
/**
|
||||
* Before callback.
|
||||
*
|
||||
* @param array $event Schema object properties
|
||||
* @return bool Should process continue
|
||||
*/
|
||||
public function before($event = array()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* After callback.
|
||||
*
|
||||
* @param array $event Schema object properties
|
||||
* @return void
|
||||
*/
|
||||
public function after($event = array()) {
|
||||
}
|
||||
|
||||
/**
|
||||
* The i18n table definition
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $i18n = array(
|
||||
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
|
||||
'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'),
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# $Id$
|
||||
#
|
||||
# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
#
|
||||
# Licensed under The MIT License
|
||||
# For full copyright and license information, please see the LICENSE.txt
|
||||
# Redistributions of files must retain the above copyright notice.
|
||||
# MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
# MIT License (https://opensource.org/licenses/mit-license.php)
|
||||
|
||||
CREATE TABLE i18n (
|
||||
id int(10) NOT NULL auto_increment,
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
# $Id$
|
||||
#
|
||||
# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
# 1785 E. Sahara Avenue, Suite 490-204
|
||||
# Las Vegas, Nevada 89104
|
||||
#
|
||||
# Licensed under The MIT License
|
||||
# For full copyright and license information, please see the LICENSE.txt
|
||||
# Redistributions of files must retain the above copyright notice.
|
||||
# MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
# MIT License (https://opensource.org/licenses/mit-license.php)
|
||||
|
||||
CREATE TABLE cake_sessions (
|
||||
id varchar(255) NOT NULL default '',
|
||||
|
|
|
@ -2,20 +2,20 @@
|
|||
;/**
|
||||
; * ACL Configuration
|
||||
; *
|
||||
; * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
; * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
; * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
; * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
; *
|
||||
; * Licensed under The MIT License
|
||||
; * Redistributions of files must retain the above copyright notice.
|
||||
; *
|
||||
; * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
; * @link http://cakephp.org CakePHP(tm) Project
|
||||
; * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
; * @link https://cakephp.org CakePHP(tm) Project
|
||||
; * @package app.Config
|
||||
; * @since CakePHP(tm) v 0.10.0.1076
|
||||
; * @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
; * @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
; */
|
||||
|
||||
; acl.ini.php - Cake ACL Configuration
|
||||
; acl.ini.php - CakePHP ACL Configuration
|
||||
; ---------------------------------------------------------------------
|
||||
; Use this file to specify user permissions.
|
||||
; aco = access control object (something in your application)
|
||||
|
|
|
@ -4,18 +4,18 @@
|
|||
*
|
||||
* Use it to configure access control of your CakePHP application.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package app.Config
|
||||
* @since CakePHP(tm) v 2.1
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -34,60 +34,72 @@
|
|||
* will ask the configured ACL interface if access is granted. Under the assumptions 1. and 2. this will be
|
||||
* done via a call to Acl->check() with
|
||||
*
|
||||
* array('User' => array('username' => 'jeff', 'group_id' => 4, ...))
|
||||
* ```
|
||||
* array('User' => array('username' => 'jeff', 'group_id' => 4, ...))
|
||||
* ```
|
||||
*
|
||||
* as ARO and
|
||||
*
|
||||
* '/controllers/invoices/delete'
|
||||
* ```
|
||||
* '/controllers/invoices/delete'
|
||||
* ```
|
||||
*
|
||||
* as ACO.
|
||||
*
|
||||
* If the configured map looks like
|
||||
*
|
||||
* $config['map'] = array(
|
||||
* 'User' => 'User/username',
|
||||
* 'Role' => 'User/group_id',
|
||||
* );
|
||||
* ```
|
||||
* $config['map'] = array(
|
||||
* 'User' => 'User/username',
|
||||
* 'Role' => 'User/group_id',
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* then PhpAcl will lookup if we defined a role like User/jeff. If that role is not found, PhpAcl will try to
|
||||
* find a definition for Role/4. If the definition isn't found then a default role (Role/default) will be used to
|
||||
* check rules for the given ACO. The search can be expanded by defining aliases in the alias configuration.
|
||||
* E.g. if you want to use a more readable name than Role/4 in your definitions you can define an alias like
|
||||
*
|
||||
* $config['alias'] = array(
|
||||
* 'Role/4' => 'Role/editor',
|
||||
* );
|
||||
* ```
|
||||
* $config['alias'] = array(
|
||||
* 'Role/4' => 'Role/editor',
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* In the roles configuration you can define roles on the lhs and inherited roles on the rhs:
|
||||
*
|
||||
* $config['roles'] = array(
|
||||
* 'Role/admin' => null,
|
||||
* 'Role/accountant' => null,
|
||||
* 'Role/editor' => null,
|
||||
* 'Role/manager' => 'Role/editor, Role/accountant',
|
||||
* 'User/jeff' => 'Role/manager',
|
||||
* );
|
||||
* ```
|
||||
* $config['roles'] = array(
|
||||
* 'Role/admin' => null,
|
||||
* 'Role/accountant' => null,
|
||||
* 'Role/editor' => null,
|
||||
* 'Role/manager' => 'Role/editor, Role/accountant',
|
||||
* 'User/jeff' => 'Role/manager',
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* In this example manager inherits all rules from editor and accountant. Role/admin doesn't inherit from any role.
|
||||
* Lets define some rules:
|
||||
*
|
||||
* $config['rules'] = array(
|
||||
* 'allow' => array(
|
||||
* '*' => 'Role/admin',
|
||||
* 'controllers/users/(dashboard|profile)' => 'Role/default',
|
||||
* 'controllers/invoices/*' => 'Role/accountant',
|
||||
* 'controllers/articles/*' => 'Role/editor',
|
||||
* 'controllers/users/*' => 'Role/manager',
|
||||
* 'controllers/invoices/delete' => 'Role/manager',
|
||||
* ),
|
||||
* 'deny' => array(
|
||||
* 'controllers/invoices/delete' => 'Role/accountant, User/jeff',
|
||||
* 'controllers/articles/(delete|publish)' => 'Role/editor',
|
||||
* ),
|
||||
* );
|
||||
* ```
|
||||
* $config['rules'] = array(
|
||||
* 'allow' => array(
|
||||
* '*' => 'Role/admin',
|
||||
* 'controllers/users/(dashboard|profile)' => 'Role/default',
|
||||
* 'controllers/invoices/*' => 'Role/accountant',
|
||||
* 'controllers/articles/*' => 'Role/editor',
|
||||
* 'controllers/users/*' => 'Role/manager',
|
||||
* 'controllers/invoices/delete' => 'Role/manager',
|
||||
* ),
|
||||
* 'deny' => array(
|
||||
* 'controllers/invoices/delete' => 'Role/accountant, User/jeff',
|
||||
* 'controllers/articles/(delete|publish)' => 'Role/editor',
|
||||
* ),
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* Ok, so as jeff inherits from Role/manager he's matched every rule that references User/jeff, Role/manager,
|
||||
* Role/editor, Role/accountant and Role/default. However, for jeff, rules for User/jeff are more specific than
|
||||
* Role/editor, and Role/accountant. However, for jeff, rules for User/jeff are more specific than
|
||||
* rules for Role/manager, rules for Role/manager are more specific than rules for Role/editor and so on.
|
||||
* This is important when allow and deny rules match for a role. E.g. Role/accountant is allowed
|
||||
* controllers/invoices/* but at the same time controllers/invoices/delete is denied. But there is a more
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
* You should also use this file to include any files that provide global functions/constants
|
||||
* that your application uses.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package app.Config
|
||||
* @since CakePHP(tm) v 0.10.8.2117
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
// Setup a 'default' cache configuration for use in the application.
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
* In production mode, flash messages redirect after a time interval.
|
||||
* In development mode, you need to click the flash message to continue.
|
||||
*/
|
||||
Configure::write('debug', 0);
|
||||
Configure::write('debug', 2);
|
||||
|
||||
/**
|
||||
* Configure the Error handler used to handle errors for your application. By default
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
/**
|
||||
*
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package app.Config
|
||||
* @since CakePHP(tm) v 0.2.9
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
/**
|
||||
*
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @package app.Config
|
||||
* @since CakePHP(tm) v 2.0.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,18 +6,18 @@
|
|||
* Routes are very important mechanism that allows you to freely connect
|
||||
* different URLs to chosen controllers and their actions (functions).
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package app.Config
|
||||
* @since CakePHP(tm) v 0.2.9
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* AppShell file
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 2.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('Shell', 'Console');
|
||||
|
|
|
@ -3,18 +3,18 @@
|
|||
#
|
||||
# Bake is a shell script for running CakePHP bake script
|
||||
#
|
||||
# CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
# CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
# Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
#
|
||||
# Licensed under The MIT License
|
||||
# For full copyright and license information, please see the LICENSE.txt
|
||||
# Redistributions of files must retain the above copyright notice.
|
||||
#
|
||||
# @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
# @link http://cakephp.org CakePHP(tm) Project
|
||||
# @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
# @link https://cakephp.org CakePHP(tm) Project
|
||||
# @package app.Console
|
||||
# @since CakePHP(tm) v 1.2.0.5012
|
||||
# @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
# @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
#
|
||||
################################################################################
|
||||
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
::
|
||||
:: Bake is a shell script for running CakePHP bake script
|
||||
::
|
||||
:: CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
:: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
:: CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
:: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
::
|
||||
:: Licensed under The MIT License
|
||||
:: Redistributions of files must retain the above copyright notice.
|
||||
::
|
||||
:: @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
:: @link http://cakephp.org CakePHP(tm) Project
|
||||
:: @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
:: @link https://cakephp.org CakePHP(tm) Project
|
||||
:: @package app.Console
|
||||
:: @since CakePHP(tm) v 2.0
|
||||
:: @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
:: @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
|
|
|
@ -3,34 +3,45 @@
|
|||
/**
|
||||
* Command-line code generation utility to automate programmer chores.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package app.Console
|
||||
* @since CakePHP(tm) v 2.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
$ds = DIRECTORY_SEPARATOR;
|
||||
$dispatcher = 'Cake' . $ds . 'Console' . $ds . 'ShellDispatcher.php';
|
||||
if (!defined('DS')) {
|
||||
define('DS', DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
||||
$dispatcher = 'Cake' . DS . 'Console' . DS . 'ShellDispatcher.php';
|
||||
|
||||
if (function_exists('ini_set')) {
|
||||
$root = dirname(dirname(dirname(__FILE__)));
|
||||
$appDir = basename(dirname(dirname(__FILE__)));
|
||||
$install = $root . DS . 'lib';
|
||||
$composerInstall = $root . DS . $appDir . DS . 'Vendor' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib';
|
||||
|
||||
// the following line differs from its sibling
|
||||
// the following lines differ from its sibling
|
||||
// /lib/Cake/Console/Templates/skel/Console/cake.php
|
||||
ini_set('include_path', $root . $ds . 'lib' . PATH_SEPARATOR . ini_get('include_path'));
|
||||
if (file_exists($composerInstall . DS . $dispatcher)) {
|
||||
$install = $composerInstall;
|
||||
}
|
||||
|
||||
ini_set('include_path', $install . PATH_SEPARATOR . ini_get('include_path'));
|
||||
unset($root, $appDir, $install, $composerInstall);
|
||||
}
|
||||
|
||||
if (!include $dispatcher) {
|
||||
trigger_error('Could not locate CakePHP core files.', E_USER_ERROR);
|
||||
}
|
||||
unset($paths, $path, $dispatcher, $root, $ds);
|
||||
unset($dispatcher);
|
||||
|
||||
return ShellDispatcher::run($argv);
|
||||
|
|
|
@ -4,18 +4,18 @@
|
|||
*
|
||||
* This file will render views from views/pages/
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package app.Controller
|
||||
* @since CakePHP(tm) v 0.2.9
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppController', 'Controller');
|
||||
|
@ -26,7 +26,7 @@ App::uses('AppController', 'Controller');
|
|||
* Override this controller by placing a copy in controllers directory of an application
|
||||
*
|
||||
* @package app.Controller
|
||||
* @link http://book.cakephp.org/2.0/en/controllers/pages-controller.html
|
||||
* @link https://book.cakephp.org/2.0/en/controllers/pages-controller.html
|
||||
*/
|
||||
class PagesController extends AppController {
|
||||
|
||||
|
@ -40,10 +40,10 @@ class PagesController extends AppController {
|
|||
/**
|
||||
* Displays a view
|
||||
*
|
||||
* @param mixed What page to display
|
||||
* @return void
|
||||
* @return CakeResponse|null
|
||||
* @throws ForbiddenException When a directory traversal attempt.
|
||||
* @throws NotFoundException When the view file could not be found
|
||||
* or MissingViewException in debug mode.
|
||||
* or MissingViewException in debug mode.
|
||||
*/
|
||||
public function display() {
|
||||
$path = func_get_args();
|
||||
|
@ -52,6 +52,9 @@ class PagesController extends AppController {
|
|||
if (!$count) {
|
||||
return $this->redirect('/');
|
||||
}
|
||||
if (in_array('..', $path, true) || in_array('.', $path, true)) {
|
||||
throw new ForbiddenException();
|
||||
}
|
||||
$page = $subpage = $title_for_layout = null;
|
||||
|
||||
if (!empty($path[0])) {
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit c3976f1478c681b0bbc132ec3a3e82c3984eeed5
|
||||
Subproject commit 1351dde6b4c75b215099ae8bcf5a21d6c6e10298
|
|
@ -1,2 +1,2 @@
|
|||
<?php echo $scripts_for_layout; ?>
|
||||
<?php echo $this->fetch('script'); ?>
|
||||
<script type="text/javascript"><?php echo $this->fetch('content'); ?></script>
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Cache
|
||||
* @since CakePHP(tm) v 1.2.0.4933
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('Inflector', 'Utility');
|
||||
|
@ -616,4 +616,18 @@ class Cache {
|
|||
self::set(null, $config);
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the engine attached to a specific configuration name.
|
||||
*
|
||||
* @param string $config Optional string configuration name to get an engine for. Defaults to 'default'.
|
||||
* @return null|CacheEngine Null if the engine has not been initialized or the engine.
|
||||
*/
|
||||
public static function engine($config = 'default') {
|
||||
if (self::isInitialized($config)) {
|
||||
return self::$_engines[$config];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Cache
|
||||
* @since CakePHP(tm) v 1.2.0.4933
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -181,7 +181,7 @@ abstract class CacheEngine {
|
|||
|
||||
$prefix = '';
|
||||
if (!empty($this->_groupPrefix)) {
|
||||
$prefix = vsprintf($this->_groupPrefix, $this->groups());
|
||||
$prefix = md5(implode('_', $this->groups()));
|
||||
}
|
||||
|
||||
$key = preg_replace('/[\s]+/', '_', strtolower(trim(str_replace(array(DS, '/', '.'), '_', strval($key)))));
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
/**
|
||||
* APC storage engine for cache.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Cache.Engine
|
||||
* @since CakePHP(tm) v 1.2.0.4933
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -31,6 +31,13 @@ class ApcEngine extends CacheEngine {
|
|||
*/
|
||||
protected $_compiledGroupNames = array();
|
||||
|
||||
/**
|
||||
* APC or APCu extension
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_apcExtension = 'apc';
|
||||
|
||||
/**
|
||||
* Initialize the Cache Engine
|
||||
*
|
||||
|
@ -47,6 +54,10 @@ class ApcEngine extends CacheEngine {
|
|||
}
|
||||
$settings += array('engine' => 'Apc');
|
||||
parent::init($settings);
|
||||
if (function_exists('apcu_dec')) {
|
||||
$this->_apcExtension = 'apcu';
|
||||
return true;
|
||||
}
|
||||
return function_exists('apc_dec');
|
||||
}
|
||||
|
||||
|
@ -63,8 +74,9 @@ class ApcEngine extends CacheEngine {
|
|||
if ($duration) {
|
||||
$expires = time() + $duration;
|
||||
}
|
||||
apc_store($key . '_expires', $expires, $duration);
|
||||
return apc_store($key, $value, $duration);
|
||||
$func = $this->_apcExtension . '_store';
|
||||
$func($key . '_expires', $expires, $duration);
|
||||
return $func($key, $value, $duration);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -75,11 +87,12 @@ class ApcEngine extends CacheEngine {
|
|||
*/
|
||||
public function read($key) {
|
||||
$time = time();
|
||||
$cachetime = (int)apc_fetch($key . '_expires');
|
||||
$func = $this->_apcExtension . '_fetch';
|
||||
$cachetime = (int)$func($key . '_expires');
|
||||
if ($cachetime !== 0 && ($cachetime < $time || ($time + $this->settings['duration']) < $cachetime)) {
|
||||
return false;
|
||||
}
|
||||
return apc_fetch($key);
|
||||
return $func($key);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -90,7 +103,8 @@ class ApcEngine extends CacheEngine {
|
|||
* @return New incremented value, false otherwise
|
||||
*/
|
||||
public function increment($key, $offset = 1) {
|
||||
return apc_inc($key, $offset);
|
||||
$func = $this->_apcExtension . '_inc';
|
||||
return $func($key, $offset);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -101,7 +115,8 @@ class ApcEngine extends CacheEngine {
|
|||
* @return New decremented value, false otherwise
|
||||
*/
|
||||
public function decrement($key, $offset = 1) {
|
||||
return apc_dec($key, $offset);
|
||||
$func = $this->_apcExtension . '_dec';
|
||||
return $func($key, $offset);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -111,7 +126,8 @@ class ApcEngine extends CacheEngine {
|
|||
* @return bool True if the value was successfully deleted, false if it didn't exist or couldn't be removed
|
||||
*/
|
||||
public function delete($key) {
|
||||
return apc_delete($key);
|
||||
$func = $this->_apcExtension . '_delete';
|
||||
return $func($key);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -125,19 +141,20 @@ class ApcEngine extends CacheEngine {
|
|||
if ($check) {
|
||||
return true;
|
||||
}
|
||||
$func = $this->_apcExtension . '_delete';
|
||||
if (class_exists('APCIterator', false)) {
|
||||
$iterator = new APCIterator(
|
||||
'user',
|
||||
'/^' . preg_quote($this->settings['prefix'], '/') . '/',
|
||||
APC_ITER_NONE
|
||||
);
|
||||
apc_delete($iterator);
|
||||
$func($iterator);
|
||||
return true;
|
||||
}
|
||||
$cache = apc_cache_info('user');
|
||||
$cache = $this->_apcExtension === 'apc' ? apc_cache_info('user') : apcu_cache_info();
|
||||
foreach ($cache['cache_list'] as $key) {
|
||||
if (strpos($key['info'], $this->settings['prefix']) === 0) {
|
||||
apc_delete($key['info']);
|
||||
$func($key['info']);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -157,11 +174,13 @@ class ApcEngine extends CacheEngine {
|
|||
}
|
||||
}
|
||||
|
||||
$groups = apc_fetch($this->_compiledGroupNames);
|
||||
$fetchFunc = $this->_apcExtension . '_fetch';
|
||||
$storeFunc = $this->_apcExtension . '_store';
|
||||
$groups = $fetchFunc($this->_compiledGroupNames);
|
||||
if (count($groups) !== count($this->settings['groups'])) {
|
||||
foreach ($this->_compiledGroupNames as $group) {
|
||||
if (!isset($groups[$group])) {
|
||||
apc_store($group, 1);
|
||||
$storeFunc($group, 1);
|
||||
$groups[$group] = 1;
|
||||
}
|
||||
}
|
||||
|
@ -184,7 +203,8 @@ class ApcEngine extends CacheEngine {
|
|||
* @return bool success
|
||||
*/
|
||||
public function clearGroup($group) {
|
||||
apc_inc($this->settings['prefix'] . $group, 1, $success);
|
||||
$func = $this->_apcExtension . '_inc';
|
||||
$func($this->settings['prefix'] . $group, 1, $success);
|
||||
return $success;
|
||||
}
|
||||
|
||||
|
@ -203,7 +223,8 @@ class ApcEngine extends CacheEngine {
|
|||
if ($duration) {
|
||||
$expires = time() + $duration;
|
||||
}
|
||||
apc_add($key . '_expires', $expires, $duration);
|
||||
return apc_add($key, $value, $duration);
|
||||
$func = $this->_apcExtension . '_add';
|
||||
$func($key . '_expires', $expires, $duration);
|
||||
return $func($key, $value, $duration);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,17 +6,17 @@
|
|||
*
|
||||
* You can configure a FileEngine cache, using Cache::config()
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 1.2.0.4933
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -132,7 +132,7 @@ class FileEngine extends CacheEngine {
|
|||
}
|
||||
|
||||
$expires = time() + $duration;
|
||||
$contents = $expires . $lineBreak . $data . $lineBreak;
|
||||
$contents = implode(array($expires, $lineBreak, $data, $lineBreak));
|
||||
|
||||
if ($this->settings['lock']) {
|
||||
$this->_File->flock(LOCK_EX);
|
||||
|
@ -267,6 +267,10 @@ class FileEngine extends CacheEngine {
|
|||
}
|
||||
|
||||
$dir = dir($path);
|
||||
if ($dir === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
while (($entry = $dir->read()) !== false) {
|
||||
if (substr($entry, 0, $prefixLength) !== $this->settings['prefix']) {
|
||||
continue;
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
/**
|
||||
* Memcache storage engine for cache
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Cache.Engine
|
||||
* @since CakePHP(tm) v 1.2.0.4933
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 2.5.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -23,6 +23,8 @@
|
|||
* (if memcached extension compiled with --enable-igbinary)
|
||||
* Compressed keys can also be incremented/decremented
|
||||
*
|
||||
* This cache engine requires at least ext/memcached version 2.0
|
||||
*
|
||||
* @package Cake.Cache.Engine
|
||||
*/
|
||||
class MemcachedEngine extends CacheEngine {
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
/**
|
||||
* Redis storage engine for cache
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Cache.Engine
|
||||
* @since CakePHP(tm) v 2.2
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -133,11 +133,11 @@ class RedisEngine extends CacheEngine {
|
|||
*/
|
||||
public function read($key) {
|
||||
$value = $this->_Redis->get($key);
|
||||
if (ctype_digit($value)) {
|
||||
$value = (int)$value;
|
||||
if (preg_match('/^[-]?\d+$/', $value)) {
|
||||
return (int)$value;
|
||||
}
|
||||
if ($value !== false && is_string($value)) {
|
||||
$value = unserialize($value);
|
||||
return unserialize($value);
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
|
|
@ -4,18 +4,18 @@
|
|||
*
|
||||
* Supports wincache 1.1.0 and higher.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Cache.Engine
|
||||
* @since CakePHP(tm) v 1.2.0.4933
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
/**
|
||||
* Xcache storage engine for cache.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Cache.Engine
|
||||
* @since CakePHP(tm) v 1.2.0.4947
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2,18 +2,18 @@
|
|||
/**
|
||||
* Core Configurations.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Config
|
||||
* @since CakePHP(tm) v 1.1.11.4062
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
$versionFile = file(CAKE . 'VERSION.txt');
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Config
|
||||
* @since CakePHP(tm) v 2.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -38,7 +38,7 @@
|
|||
* - `/:controller'
|
||||
* - `/:controller/:action/*'
|
||||
*
|
||||
* You can disable the connection of default routes by deleting the require inside APP/Config/routes.php.
|
||||
* You can disable the connection of default routes by deleting the require inside CONFIG/routes.php.
|
||||
*/
|
||||
$prefixes = Router::prefixes();
|
||||
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
|
||||
* @see http://www.unicode.org/reports/tr21/tr21-5.html
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Config.unicode.casefolding
|
||||
* @since CakePHP(tm) v 1.2.0.5691
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
|
||||
* @see http://www.unicode.org/reports/tr21/tr21-5.html
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Config.unicode.casefolding
|
||||
* @since CakePHP(tm) v 1.2.0.5691
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
|
||||
* @see http://www.unicode.org/reports/tr21/tr21-5.html
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Config.unicode.casefolding
|
||||
* @since CakePHP(tm) v 1.2.0.5691
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
|
||||
* @see http://www.unicode.org/reports/tr21/tr21-5.html
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Config.unicode.casefolding
|
||||
* @since CakePHP(tm) v 1.2.0.6833
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
|
||||
* @see http://www.unicode.org/reports/tr21/tr21-5.html
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Config.unicode.casefolding
|
||||
* @since CakePHP(tm) v 1.2.0.5691
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
|
||||
* @see http://www.unicode.org/reports/tr21/tr21-5.html
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Config.unicode.casefolding
|
||||
* @since CakePHP(tm) v 1.2.0.5691
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
|
||||
* @see http://www.unicode.org/reports/tr21/tr21-5.html
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Config.unicode.casefolding
|
||||
* @since CakePHP(tm) v 1.2.0.5691
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
|
||||
* @see http://www.unicode.org/reports/tr21/tr21-5.html
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Config.unicode.casefolding
|
||||
* @since CakePHP(tm) v 1.2.0.5691
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
|
||||
* @see http://www.unicode.org/reports/tr21/tr21-5.html
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Config.unicode.casefolding
|
||||
* @since CakePHP(tm) v 1.2.0.5691
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
|
||||
* @see http://www.unicode.org/reports/tr21/tr21-5.html
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Config.unicode.casefolding
|
||||
* @since CakePHP(tm) v 1.2.0.5691
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
|
||||
* @see http://www.unicode.org/reports/tr21/tr21-5.html
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Config.unicode.casefolding
|
||||
* @since CakePHP(tm) v 1.2.0.5691
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
|
||||
* @see http://www.unicode.org/reports/tr21/tr21-5.html
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Config.unicode.casefolding
|
||||
* @since CakePHP(tm) v 1.2.0.5691
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
|
||||
* @see http://www.unicode.org/reports/tr21/tr21-5.html
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Config.unicode.casefolding
|
||||
* @since CakePHP(tm) v 1.2.0.5691
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
|
||||
* @see http://www.unicode.org/reports/tr21/tr21-5.html
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Config.unicode.casefolding
|
||||
* @since CakePHP(tm) v 1.2.0.5691
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
|
||||
* @see http://www.unicode.org/reports/tr21/tr21-5.html
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Config.unicode.casefolding
|
||||
* @since CakePHP(tm) v 1.2.0.5691
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
|
||||
* @see http://www.unicode.org/reports/tr21/tr21-5.html
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Config.unicode.casefolding
|
||||
* @since CakePHP(tm) v 1.2.0.5691
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
* @see http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
|
||||
* @see http://www.unicode.org/reports/tr21/tr21-5.html
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Config.unicode.casefolding
|
||||
* @since CakePHP(tm) v 1.2.0.5691
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Core
|
||||
* @since CakePHP(tm) v 1.0.0.2363
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
/**
|
||||
* IniReader
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Configure
|
||||
* @since CakePHP(tm) v 2.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('Hash', 'Utility');
|
||||
|
@ -73,13 +73,13 @@ class IniReader implements ConfigReaderInterface {
|
|||
* Build and construct a new ini file parser. The parser can be used to read
|
||||
* ini files that are on the filesystem.
|
||||
*
|
||||
* @param string $path Path to load ini config files from. Defaults to APP . 'Config' . DS
|
||||
* @param string $path Path to load ini config files from. Defaults to CONFIG
|
||||
* @param string $section Only get one section, leave null to parse and fetch
|
||||
* all sections in the ini file.
|
||||
*/
|
||||
public function __construct($path = null, $section = null) {
|
||||
if (!$path) {
|
||||
$path = APP . 'Config' . DS;
|
||||
$path = CONFIG;
|
||||
}
|
||||
$this->_path = $path;
|
||||
$this->_section = $section;
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* PhpReader file
|
||||
*
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://book.cakephp.org/2.0/en/development/configuration.html#loading-configuration-files CakePHP(tm) Configuration
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://book.cakephp.org/2.0/en/development/configuration.html#loading-configuration-files CakePHP(tm) Configuration
|
||||
* @package Cake.Configure
|
||||
* @since CakePHP(tm) v 2.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('CakePlugin', 'Core');
|
||||
|
@ -38,11 +38,11 @@ class PhpReader implements ConfigReaderInterface {
|
|||
/**
|
||||
* Constructor for PHP Config file reading.
|
||||
*
|
||||
* @param string $path The path to read config files from. Defaults to APP . 'Config' . DS
|
||||
* @param string $path The path to read config files from. Defaults to CONFIG
|
||||
*/
|
||||
public function __construct($path = null) {
|
||||
if (!$path) {
|
||||
$path = APP . 'Config' . DS;
|
||||
$path = CONFIG;
|
||||
}
|
||||
$this->_path = $path;
|
||||
}
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* Acl Shell provides Acl access in the CLI environment
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 1.2.0.5012
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
@ -89,7 +89,7 @@ class AclShell extends AppShell {
|
|||
$this->args = null;
|
||||
return $this->DbConfig->execute();
|
||||
}
|
||||
require_once APP . 'Config' . DS . 'database.php';
|
||||
require_once CONFIG . 'database.php';
|
||||
|
||||
if (!in_array($this->command, array('initdb'))) {
|
||||
$collection = new ComponentCollection();
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
*
|
||||
* Implementation of a Cake Shell to show CakePHP core method signatures.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 1.2.0.5012
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* AppShell file
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 2.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('Shell', 'Console');
|
||||
|
|
|
@ -6,17 +6,17 @@
|
|||
* application development by writing fully functional skeleton controllers,
|
||||
* models, and views. Going further, Bake can also write Unit Tests for you.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 1.2.0.5012
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
@ -30,7 +30,7 @@ App::uses('Model', 'Model');
|
|||
* models, and views. Going further, Bake can also write Unit Tests for you.
|
||||
*
|
||||
* @package Cake.Console.Command
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells/code-generation-with-bake.html
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells/code-generation-with-bake.html
|
||||
*/
|
||||
class BakeShell extends AppShell {
|
||||
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP Project
|
||||
* @package Cake.Console.Command
|
||||
* @since CakePHP v 2.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
@ -54,6 +54,7 @@ class CommandListShell extends AppShell {
|
|||
$this->out(" -working: " . rtrim(APP, DS));
|
||||
$this->out(" -root: " . rtrim(ROOT, DS));
|
||||
$this->out(" -core: " . rtrim(CORE_PATH, DS));
|
||||
$this->out(" -webroot: " . rtrim(WWW_ROOT, DS));
|
||||
$this->out("");
|
||||
$this->out(__d('cake_console', "<info>Changing Paths:</info>"), 2);
|
||||
$this->out(__d('cake_console', "Your working path should be the same as your application path. To change your path use the '-app' param."));
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP Project
|
||||
* @package Cake.Console.Command
|
||||
* @since CakePHP v 2.5
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 1.2.0.5012
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
@ -501,7 +501,7 @@ class ConsoleShell extends AppShell {
|
|||
extract(Router::getNamedExpressions());
|
||||
|
||||
//@codingStandardsIgnoreStart
|
||||
if (!@include APP . 'Config' . DS . 'routes.php') {
|
||||
if (!@include CONFIG . 'routes.php') {
|
||||
//@codingStandardsIgnoreEnd
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* Internationalization Management Shell
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 1.2.0.5669
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 1.2.0.5550
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
@ -25,7 +25,7 @@ App::uses('CakeSchema', 'Model');
|
|||
* of your database.
|
||||
*
|
||||
* @package Cake.Console.Command
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells/schema-management-and-migrations.html
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells/schema-management-and-migrations.html
|
||||
*/
|
||||
class SchemaShell extends AppShell {
|
||||
|
||||
|
@ -476,7 +476,7 @@ class SchemaShell extends AppShell {
|
|||
);
|
||||
$path = array(
|
||||
'help' => __d('cake_console', 'Path to read and write schema.php'),
|
||||
'default' => APP . 'Config' . DS . 'Schema'
|
||||
'default' => CONFIG . 'Schema'
|
||||
);
|
||||
$file = array(
|
||||
'help' => __d('cake_console', 'File name to read and write.'),
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* built-in Server Shell
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 2.3.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
@ -78,7 +78,7 @@ class ServerShell extends AppShell {
|
|||
* or otherwise modify the pre-command flow.
|
||||
*
|
||||
* @return void
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::startup
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::startup
|
||||
*/
|
||||
public function startup() {
|
||||
if (!empty($this->params['host'])) {
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* Base class for Bake Tasks.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 1.3
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 2.5
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* The ControllerTask handles creating and updating controller files.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 1.2
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
@ -182,11 +182,11 @@ class ControllerTask extends BakeTask {
|
|||
$components = $this->doComponents();
|
||||
|
||||
$wannaUseSession = $this->in(
|
||||
__d('cake_console', "Would you like to use Session flash messages?"), array('y', 'n'), 'y'
|
||||
__d('cake_console', "Would you like to use the FlashComponent to display flash messages?"), array('y', 'n'), 'y'
|
||||
);
|
||||
|
||||
if (strtolower($wannaUseSession) === 'y') {
|
||||
array_push($components, 'Session');
|
||||
array_push($components, 'Session', 'Flash');
|
||||
}
|
||||
array_unique($components);
|
||||
}
|
||||
|
@ -331,6 +331,12 @@ class ControllerTask extends BakeTask {
|
|||
public function bake($controllerName, $actions = '', $helpers = null, $components = null) {
|
||||
$this->out("\n" . __d('cake_console', 'Baking controller class for %s...', $controllerName), 1, Shell::QUIET);
|
||||
|
||||
if ($helpers === null) {
|
||||
$helpers = array();
|
||||
}
|
||||
if ($components === null) {
|
||||
$components = array();
|
||||
}
|
||||
$isScaffold = ($actions === 'scaffold') ? true : false;
|
||||
|
||||
$this->Template->set(array(
|
||||
|
@ -384,9 +390,9 @@ class ControllerTask extends BakeTask {
|
|||
* @return array Components the user wants to use.
|
||||
*/
|
||||
public function doComponents() {
|
||||
$components = array('Paginator', 'Flash');
|
||||
$components = array('Paginator');
|
||||
return array_merge($components, $this->_doPropertyChoices(
|
||||
__d('cake_console', "Would you like this controller to use other components\nbesides PaginatorComponent and FlashComponent?"),
|
||||
__d('cake_console', "Would you like this controller to use other components\nbesides PaginatorComponent?"),
|
||||
__d('cake_console', "Please provide a comma separated list of the component names you'd like to use.\nExample: 'Acl, Security, RequestHandler'")
|
||||
));
|
||||
}
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* The DbConfig Task handles creating and updating the database.php
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 1.2
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
@ -64,7 +64,7 @@ class DbConfigTask extends AppShell {
|
|||
* @return void
|
||||
*/
|
||||
public function initialize() {
|
||||
$this->path = APP . 'Config' . DS;
|
||||
$this->path = CONFIG;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* Language string extractor
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 1.2.0.5012
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* The FixtureTask handles creating and updating fixture files.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 1.3
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
@ -125,7 +125,8 @@ class FixtureTask extends BakeTask {
|
|||
return $this->all();
|
||||
}
|
||||
$model = $this->_modelName($this->args[0]);
|
||||
$this->bake($model);
|
||||
$importOptions = $this->importOptions($model);
|
||||
$this->bake($model, false, $importOptions);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -177,24 +178,29 @@ class FixtureTask extends BakeTask {
|
|||
*/
|
||||
public function importOptions($modelName) {
|
||||
$options = array();
|
||||
$plugin = '';
|
||||
if (isset($this->params['plugin'])) {
|
||||
$plugin = $this->params['plugin'] . '.';
|
||||
}
|
||||
|
||||
if (!empty($this->params['schema'])) {
|
||||
$options['schema'] = $modelName;
|
||||
} else {
|
||||
$options['schema'] = $plugin . $modelName;
|
||||
} elseif ($this->interactive) {
|
||||
$doSchema = $this->in(__d('cake_console', 'Would you like to import schema for this fixture?'), array('y', 'n'), 'n');
|
||||
if ($doSchema === 'y') {
|
||||
$options['schema'] = $modelName;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($this->params['records'])) {
|
||||
$doRecords = 'y';
|
||||
} else {
|
||||
$options['fromTable'] = true;
|
||||
} elseif ($this->interactive) {
|
||||
$doRecords = $this->in(__d('cake_console', 'Would you like to use record importing for this fixture?'), array('y', 'n'), 'n');
|
||||
if ($doRecords === 'y') {
|
||||
$options['records'] = true;
|
||||
}
|
||||
}
|
||||
if ($doRecords === 'y') {
|
||||
$options['records'] = true;
|
||||
}
|
||||
if ($doRecords === 'n') {
|
||||
if (!isset($options['records']) && $this->interactive) {
|
||||
$prompt = __d('cake_console', "Would you like to build this fixture with data from %s's table?", $modelName);
|
||||
$fromTable = $this->in($prompt, array('y', 'n'), 'n');
|
||||
if (strtolower($fromTable) === 'y') {
|
||||
|
@ -329,6 +335,9 @@ class FixtureTask extends BakeTask {
|
|||
}
|
||||
$insert = '';
|
||||
switch ($fieldInfo['type']) {
|
||||
case 'tinyinteger':
|
||||
case 'smallinteger':
|
||||
case 'biginteger':
|
||||
case 'integer':
|
||||
case 'float':
|
||||
$insert = $i + 1;
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* The ModelTask handles creating and updating models files.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 1.2
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
@ -450,6 +450,10 @@ class ModelTask extends BakeTask {
|
|||
$guess = $methods['notBlank'];
|
||||
} elseif ($metaData['type'] === 'integer') {
|
||||
$guess = $methods['numeric'];
|
||||
} elseif ($metaData['type'] === 'smallinteger') {
|
||||
$guess = $methods['numeric'];
|
||||
} elseif ($metaData['type'] === 'tinyinteger') {
|
||||
$guess = $methods['numeric'];
|
||||
} elseif ($metaData['type'] === 'float') {
|
||||
$guess = $methods['numeric'];
|
||||
} elseif ($metaData['type'] === 'boolean') {
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 1.2
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
@ -45,7 +45,7 @@ class PluginTask extends AppShell {
|
|||
*/
|
||||
public function initialize() {
|
||||
$this->path = current(App::path('plugins'));
|
||||
$this->bootstrap = APP . 'Config' . DS . 'bootstrap.php';
|
||||
$this->bootstrap = CONFIG . 'bootstrap.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* The Project Task handles creating the base application
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 1.2
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
@ -79,14 +79,14 @@ class ProjectTask extends AppShell {
|
|||
if ($this->securitySalt($path) === true) {
|
||||
$this->out(__d('cake_console', ' * Random hash key created for \'Security.salt\''));
|
||||
} else {
|
||||
$this->err(__d('cake_console', 'Unable to generate random hash for \'Security.salt\', you should change it in %s', APP . 'Config' . DS . 'core.php'));
|
||||
$this->err(__d('cake_console', 'Unable to generate random hash for \'Security.salt\', you should change it in %s', CONFIG . 'core.php'));
|
||||
$success = false;
|
||||
}
|
||||
|
||||
if ($this->securityCipherSeed($path) === true) {
|
||||
$this->out(__d('cake_console', ' * Random seed created for \'Security.cipherSeed\''));
|
||||
} else {
|
||||
$this->err(__d('cake_console', 'Unable to generate random seed for \'Security.cipherSeed\', you should change it in %s', APP . 'Config' . DS . 'core.php'));
|
||||
$this->err(__d('cake_console', 'Unable to generate random seed for \'Security.cipherSeed\', you should change it in %s', CONFIG . 'core.php'));
|
||||
$success = false;
|
||||
}
|
||||
|
||||
|
@ -362,7 +362,7 @@ class ProjectTask extends AppShell {
|
|||
* @return bool Success
|
||||
*/
|
||||
public function cakeAdmin($name) {
|
||||
$path = (empty($this->configPath)) ? APP . 'Config' . DS : $this->configPath;
|
||||
$path = (empty($this->configPath)) ? CONFIG : $this->configPath;
|
||||
$File = new File($path . 'core.php');
|
||||
$contents = $File->read();
|
||||
if (preg_match('%(\s*[/]*Configure::write\(\'Routing.prefixes\',[\s\'a-z,\)\(]*\);)%', $contents, $match)) {
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* Template Task can generate templated output Used in other Tasks
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 1.3
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* The TestTask handles creating and updating test files.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 1.3
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
@ -367,7 +367,7 @@ class TestTask extends BakeTask {
|
|||
* Generate the list of fixtures that will be required to run this test based on
|
||||
* loaded models.
|
||||
*
|
||||
* @param object $subject The object you want to generate fixtures for.
|
||||
* @param CakeObject $subject The object you want to generate fixtures for.
|
||||
* @return array Array of fixtures to be included in the test.
|
||||
*/
|
||||
public function generateFixtureList($subject) {
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* The View Tasks handles creating and updating view files.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 1.2
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
*
|
||||
* This Shell allows the running of test suites via the cake command line
|
||||
*
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) Tests <https://book.cakephp.org/2.0/en/development/testing.html>
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://book.cakephp.org/2.0/en/development/testing.html
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://book.cakephp.org/2.0/en/development/testing.html
|
||||
* @since CakePHP(tm) v 1.2.0.4433
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('Shell', 'Console');
|
||||
|
@ -71,6 +71,9 @@ class TestShell extends Shell {
|
|||
))->addOption('coverage-clover', array(
|
||||
'help' => __d('cake_console', '<file> Write code coverage data in Clover XML format.'),
|
||||
'default' => false
|
||||
))->addOption('coverage-text', array(
|
||||
'help' => __d('cake_console', 'Output code coverage report in Text format.'),
|
||||
'boolean' => true
|
||||
))->addOption('testdox-html', array(
|
||||
'help' => __d('cake_console', '<file> Write agile documentation in HTML format to file.'),
|
||||
'default' => false
|
||||
|
@ -152,6 +155,7 @@ class TestShell extends Shell {
|
|||
'default' => false
|
||||
))->addOption('directive', array(
|
||||
'help' => __d('cake_console', 'key[=value] Sets a php.ini value.'),
|
||||
'short' => 'd',
|
||||
'default' => false
|
||||
))->addOption('fixture', array(
|
||||
'help' => __d('cake_console', 'Choose a custom fixture manager.')
|
||||
|
@ -234,7 +238,11 @@ class TestShell extends Shell {
|
|||
if ($value === false) {
|
||||
continue;
|
||||
}
|
||||
$options[] = '--' . $param;
|
||||
if ($param === 'directive') {
|
||||
$options[] = '-d';
|
||||
} else {
|
||||
$options[] = '--' . $param;
|
||||
}
|
||||
if (is_string($value)) {
|
||||
$options[] = $value;
|
||||
}
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
*
|
||||
* This is a bc wrapper for the newer Test shell
|
||||
*
|
||||
* CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) Tests <https://book.cakephp.org/2.0/en/development/testing.html>
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://book.cakephp.org/2.0/en/development/testing.html
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://book.cakephp.org/2.0/en/development/testing.html
|
||||
* @since CakePHP(tm) v 1.2.0.4433
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('TestShell', 'Console/Command');
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
/**
|
||||
* Upgrade Shell
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Console.Command
|
||||
* @since CakePHP(tm) v 2.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('AppShell', 'Console/Command');
|
||||
|
@ -532,7 +532,7 @@ class UpgradeShell extends AppShell {
|
|||
/**
|
||||
* Update components.
|
||||
*
|
||||
* - Make components that extend Object to extend Component.
|
||||
* - Make components that extend CakeObject to extend Component.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
@ -547,6 +547,11 @@ class UpgradeShell extends AppShell {
|
|||
'/([a-zA-Z]*Component extends) Object/',
|
||||
'\1 Component'
|
||||
),
|
||||
array(
|
||||
'*Component extends CakeObject to *Component extends Component',
|
||||
'/([a-zA-Z]*Component extends) CakeObject/',
|
||||
'\1 Component'
|
||||
),
|
||||
);
|
||||
|
||||
$this->_filesRegexpUpdate($patterns);
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* ErrorHandler for Console Shells
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 2.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('ErrorHandler', 'Error');
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
/**
|
||||
* ConsoleInput file.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Console
|
||||
* @since CakePHP(tm) v 2.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* ConsoleArgumentOption file
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 2.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -159,7 +159,7 @@ class ConsoleInputArgument {
|
|||
$option = $parent->addChild('argument');
|
||||
$option->addAttribute('name', $this->_name);
|
||||
$option->addAttribute('help', $this->_help);
|
||||
$option->addAttribute('required', $this->isRequired());
|
||||
$option->addAttribute('required', (int)$this->isRequired());
|
||||
$choices = $option->addChild('choices');
|
||||
foreach ($this->_choices as $valid) {
|
||||
$choices->addChild('choice', $valid);
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* ConsoleInputOption file
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 2.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -205,10 +205,11 @@ class ConsoleInputOption {
|
|||
$option->addAttribute('name', '--' . $this->_name);
|
||||
$short = '';
|
||||
if (strlen($this->_short)) {
|
||||
$short = $this->_short;
|
||||
$short = '-' . $this->_short;
|
||||
}
|
||||
$option->addAttribute('short', '-' . $short);
|
||||
$option->addAttribute('boolean', $this->_boolean);
|
||||
$option->addAttribute('short', $short);
|
||||
$option->addAttribute('help', $this->_help);
|
||||
$option->addAttribute('boolean', (int)$this->_boolean);
|
||||
$option->addChild('default', $this->_default);
|
||||
$choices = $option->addChild('choices');
|
||||
foreach ($this->_choices as $valid) {
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* ConsoleInputSubcommand file
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 2.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* ConsoleOptionParser file
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 2.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('TaskCollection', 'Console');
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* ConsoleOutput file.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 2.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
/**
|
||||
* HelpFormatter
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('CakeText', 'Utility');
|
||||
|
@ -182,7 +182,6 @@ class HelpFormatter {
|
|||
$xml->addChild('command', $parser->command());
|
||||
$xml->addChild('description', $parser->description());
|
||||
|
||||
$xml->addChild('epilog', $parser->epilog());
|
||||
$subcommands = $xml->addChild('subcommands');
|
||||
foreach ($parser->subcommands() as $command) {
|
||||
$command->xml($subcommands);
|
||||
|
@ -195,6 +194,7 @@ class HelpFormatter {
|
|||
foreach ($parser->arguments() as $argument) {
|
||||
$argument->xml($arguments);
|
||||
}
|
||||
$xml->addChild('epilog', $parser->epilog());
|
||||
return $string ? $xml->asXml() : $xml;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 2.8
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
abstract class BaseShellHelper {
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 2.8
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
App::uses("BaseShellHelper", "Console/Helper");
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 2.8
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
App::uses("BaseShellHelper", "Console/Helper");
|
||||
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* Base class for Shells
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 1.2.0.5012
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('TaskCollection', 'Console');
|
||||
|
@ -28,7 +28,7 @@ App::uses('File', 'Utility');
|
|||
*
|
||||
* @package Cake.Console
|
||||
*/
|
||||
class Shell extends Object {
|
||||
class Shell extends CakeObject {
|
||||
|
||||
/**
|
||||
* Default error code
|
||||
|
@ -112,7 +112,7 @@ class Shell extends Object {
|
|||
* Contains tasks to load and instantiate
|
||||
*
|
||||
* @var array
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::$tasks
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::$tasks
|
||||
*/
|
||||
public $tasks = array();
|
||||
|
||||
|
@ -127,7 +127,7 @@ class Shell extends Object {
|
|||
* Contains models to load and instantiate
|
||||
*
|
||||
* @var array
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::$uses
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::$uses
|
||||
*/
|
||||
public $uses = array();
|
||||
|
||||
|
@ -194,7 +194,7 @@ class Shell extends Object {
|
|||
* @param ConsoleOutput $stdout A ConsoleOutput object for stdout.
|
||||
* @param ConsoleOutput $stderr A ConsoleOutput object for stderr.
|
||||
* @param ConsoleInput $stdin A ConsoleInput object for stdin.
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell
|
||||
*/
|
||||
public function __construct($stdout = null, $stderr = null, $stdin = null) {
|
||||
if (!$this->name) {
|
||||
|
@ -222,7 +222,7 @@ class Shell extends Object {
|
|||
* allows configuration of tasks prior to shell execution
|
||||
*
|
||||
* @return void
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::initialize
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::initialize
|
||||
*/
|
||||
public function initialize() {
|
||||
$this->_loadModels();
|
||||
|
@ -237,7 +237,7 @@ class Shell extends Object {
|
|||
* or otherwise modify the pre-command flow.
|
||||
*
|
||||
* @return void
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::startup
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::startup
|
||||
*/
|
||||
public function startup() {
|
||||
$this->_welcome();
|
||||
|
@ -340,7 +340,7 @@ class Shell extends Object {
|
|||
*
|
||||
* @param string $task The task name to check.
|
||||
* @return bool Success
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasTask
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasTask
|
||||
*/
|
||||
public function hasTask($task) {
|
||||
return isset($this->_taskMap[Inflector::camelize($task)]);
|
||||
|
@ -351,7 +351,7 @@ class Shell extends Object {
|
|||
*
|
||||
* @param string $name The method name to check.
|
||||
* @return bool
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasMethod
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hasMethod
|
||||
*/
|
||||
public function hasMethod($name) {
|
||||
try {
|
||||
|
@ -369,7 +369,7 @@ class Shell extends Object {
|
|||
}
|
||||
|
||||
/**
|
||||
* Dispatch a command to another Shell. Similar to Object::requestAction()
|
||||
* Dispatch a command to another Shell. Similar to CakeObject::requestAction()
|
||||
* but intended for running shells from other shells.
|
||||
*
|
||||
* ### Usage:
|
||||
|
@ -387,7 +387,7 @@ class Shell extends Object {
|
|||
* `return $this->dispatchShell('schema', 'create', 'i18n', '--dry');`
|
||||
*
|
||||
* @return mixed The return of the other shell.
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::dispatchShell
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::dispatchShell
|
||||
*/
|
||||
public function dispatchShell() {
|
||||
$args = func_get_args();
|
||||
|
@ -415,8 +415,8 @@ class Shell extends Object {
|
|||
* @param string $command The command name to run on this shell. If this argument is empty,
|
||||
* and the shell has a `main()` method, that will be called instead.
|
||||
* @param array $argv Array of arguments to run the shell with. This array should be missing the shell name.
|
||||
* @return void
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::runCommand
|
||||
* @return int|bool
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::runCommand
|
||||
*/
|
||||
public function runCommand($command, $argv) {
|
||||
$isTask = $this->hasTask($command);
|
||||
|
@ -431,6 +431,7 @@ class Shell extends Object {
|
|||
try {
|
||||
list($this->params, $this->args) = $this->OptionParser->parse($argv, $command);
|
||||
} catch (ConsoleException $e) {
|
||||
$this->err(__d('cake_console', '<error>Error:</error> %s', $e->getMessage()));
|
||||
$this->out($this->OptionParser->help($command));
|
||||
return false;
|
||||
}
|
||||
|
@ -468,7 +469,7 @@ class Shell extends Object {
|
|||
* Display the help in the correct format
|
||||
*
|
||||
* @param string $command The command to get help for.
|
||||
* @return void
|
||||
* @return int|bool
|
||||
*/
|
||||
protected function _displayHelp($command) {
|
||||
$format = 'text';
|
||||
|
@ -487,7 +488,7 @@ class Shell extends Object {
|
|||
* By overriding this method you can configure the ConsoleOptionParser before returning it.
|
||||
*
|
||||
* @return ConsoleOptionParser
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::getOptionParser
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::getOptionParser
|
||||
*/
|
||||
public function getOptionParser() {
|
||||
$name = ($this->plugin ? $this->plugin . '.' : '') . $this->name;
|
||||
|
@ -533,7 +534,7 @@ class Shell extends Object {
|
|||
* @param string|array $options Array or string of options.
|
||||
* @param string $default Default input value.
|
||||
* @return mixed Either the default value, or the user-provided input.
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::in
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::in
|
||||
*/
|
||||
public function in($prompt, $options = null, $default = null) {
|
||||
if (!$this->interactive) {
|
||||
|
@ -570,7 +571,7 @@ class Shell extends Object {
|
|||
* @param string $prompt Prompt text.
|
||||
* @param string|array $options Array or string of options.
|
||||
* @param string $default Default input value.
|
||||
* @return Either the default value, or the user-provided input.
|
||||
* @return string|int the default value, or the user-provided input.
|
||||
*/
|
||||
protected function _getInput($prompt, $options, $default) {
|
||||
if (!is_array($options)) {
|
||||
|
@ -612,7 +613,7 @@ class Shell extends Object {
|
|||
* @param string|int|array $options Array of options to use, or an integer to wrap the text to.
|
||||
* @return string Wrapped / indented text
|
||||
* @see CakeText::wrap()
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::wrapText
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::wrapText
|
||||
*/
|
||||
public function wrapText($text, $options = array()) {
|
||||
return CakeText::wrap($text, $options);
|
||||
|
@ -633,7 +634,7 @@ class Shell extends Object {
|
|||
* @param int $newlines Number of newlines to append
|
||||
* @param int $level The message's output level, see above.
|
||||
* @return int|bool Returns the number of bytes returned from writing to stdout.
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::out
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::out
|
||||
*/
|
||||
public function out($message = null, $newlines = 1, $level = Shell::NORMAL) {
|
||||
$currentLevel = Shell::NORMAL;
|
||||
|
@ -688,7 +689,7 @@ class Shell extends Object {
|
|||
* @param string|array $message A string or an array of strings to output
|
||||
* @param int $newlines Number of newlines to append
|
||||
* @return void
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::err
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::err
|
||||
*/
|
||||
public function err($message = null, $newlines = 1) {
|
||||
$this->stderr->write($message, $newlines);
|
||||
|
@ -699,7 +700,7 @@ class Shell extends Object {
|
|||
*
|
||||
* @param int $multiplier Number of times the linefeed sequence should be repeated
|
||||
* @return string
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::nl
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::nl
|
||||
*/
|
||||
public function nl($multiplier = 1) {
|
||||
return str_repeat(ConsoleOutput::LF, $multiplier);
|
||||
|
@ -711,7 +712,7 @@ class Shell extends Object {
|
|||
* @param int $newlines Number of newlines to pre- and append
|
||||
* @param int $width Width of the line, defaults to 63
|
||||
* @return void
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hr
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::hr
|
||||
*/
|
||||
public function hr($newlines = 0, $width = 63) {
|
||||
$this->out(null, $newlines);
|
||||
|
@ -725,8 +726,8 @@ class Shell extends Object {
|
|||
*
|
||||
* @param string $title Title of the error
|
||||
* @param string $message An optional error message
|
||||
* @return void
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::error
|
||||
* @return int
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::error
|
||||
*/
|
||||
public function error($title, $message = null) {
|
||||
$this->err(__d('cake_console', '<error>Error:</error> %s', $title));
|
||||
|
@ -742,7 +743,7 @@ class Shell extends Object {
|
|||
* Clear the console
|
||||
*
|
||||
* @return void
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::clear
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::clear
|
||||
*/
|
||||
public function clear() {
|
||||
if (empty($this->params['noclear'])) {
|
||||
|
@ -760,7 +761,7 @@ class Shell extends Object {
|
|||
* @param string $path Where to put the file.
|
||||
* @param string $contents Content to put in the file.
|
||||
* @return bool Success
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::createFile
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::createFile
|
||||
*/
|
||||
public function createFile($path, $contents) {
|
||||
$path = str_replace(DS . DS, DS, $path);
|
||||
|
@ -849,7 +850,7 @@ class Shell extends Object {
|
|||
*
|
||||
* @param string $file Absolute file path
|
||||
* @return string short path
|
||||
* @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::shortPath
|
||||
* @link https://book.cakephp.org/2.0/en/console-and-shells.html#Shell::shortPath
|
||||
*/
|
||||
public function shortPath($file) {
|
||||
$shortPath = str_replace(ROOT, null, $file);
|
||||
|
@ -974,15 +975,48 @@ class Shell extends Object {
|
|||
CakeLog::drop('stderr');
|
||||
return;
|
||||
}
|
||||
if (!$this->_loggerIsConfigured("stdout")) {
|
||||
$this->_configureStdOutLogger();
|
||||
}
|
||||
if (!$this->_loggerIsConfigured("stderr")) {
|
||||
$this->_configureStdErrLogger();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the stdout logger
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _configureStdOutLogger() {
|
||||
CakeLog::config('stdout', array(
|
||||
'engine' => 'Console',
|
||||
'types' => array('notice', 'info'),
|
||||
'stream' => $this->stdout,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the stderr logger
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _configureStdErrLogger() {
|
||||
CakeLog::config('stderr', array(
|
||||
'engine' => 'Console',
|
||||
'types' => array('emergency', 'alert', 'critical', 'error', 'warning', 'debug'),
|
||||
'stream' => $this->stderr,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given logger is configured
|
||||
*
|
||||
* @param string $logger The name of the logger to check
|
||||
* @return bool
|
||||
*/
|
||||
protected function _loggerIsConfigured($logger) {
|
||||
$configured = CakeLog::configured();
|
||||
return in_array($logger, $configured);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
/**
|
||||
* ShellDispatcher file
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 2.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -106,7 +106,7 @@ class ShellDispatcher {
|
|||
$message = "This file has been loaded incorrectly and cannot continue.\n" .
|
||||
"Please make sure that " . DS . 'lib' . DS . 'Cake' . DS . "Console is in your system path,\n" .
|
||||
"and check the cookbook for the correct usage of this command.\n" .
|
||||
"(http://book.cakephp.org/)";
|
||||
"(https://book.cakephp.org/)";
|
||||
throw new CakeException($message);
|
||||
}
|
||||
|
||||
|
@ -129,15 +129,22 @@ class ShellDispatcher {
|
|||
define('APP', $this->params['working'] . DS);
|
||||
}
|
||||
if (!defined('WWW_ROOT')) {
|
||||
define('WWW_ROOT', APP . $this->params['webroot'] . DS);
|
||||
if (!$this->_isAbsolutePath($this->params['webroot'])) {
|
||||
$webroot = realpath(APP . $this->params['webroot']);
|
||||
} else {
|
||||
$webroot = $this->params['webroot'];
|
||||
}
|
||||
define('WWW_ROOT', $webroot . DS);
|
||||
}
|
||||
if (!defined('TMP') && !is_dir(APP . 'tmp')) {
|
||||
define('TMP', CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'tmp' . DS);
|
||||
}
|
||||
|
||||
// $boot is used by Cake/bootstrap.php file
|
||||
$boot = file_exists(ROOT . DS . APP_DIR . DS . 'Config' . DS . 'bootstrap.php');
|
||||
require CORE_PATH . 'Cake' . DS . 'bootstrap.php';
|
||||
|
||||
if (!file_exists(APP . 'Config' . DS . 'core.php')) {
|
||||
if (!file_exists(CONFIG . 'core.php')) {
|
||||
include_once CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'Config' . DS . 'core.php';
|
||||
App::build();
|
||||
}
|
||||
|
@ -305,25 +312,45 @@ class ShellDispatcher {
|
|||
}
|
||||
}
|
||||
|
||||
if ($params['app'][0] === '/' || preg_match('/([a-z])(:)/i', $params['app'], $matches)) {
|
||||
if ($this->_isAbsolutePath($params['app'])) {
|
||||
$params['root'] = dirname($params['app']);
|
||||
} elseif (strpos($params['app'], '/')) {
|
||||
$params['root'] .= '/' . dirname($params['app']);
|
||||
}
|
||||
|
||||
$isWindowsAppPath = $this->_isWindowsPath($params['app']);
|
||||
$params['app'] = basename($params['app']);
|
||||
$params['working'] = rtrim($params['root'], '/');
|
||||
if (!$isWin || !preg_match('/^[A-Z]:$/i', $params['app'])) {
|
||||
$params['working'] .= '/' . $params['app'];
|
||||
}
|
||||
|
||||
if (!empty($matches[0]) || !empty($isWin)) {
|
||||
if ($isWindowsAppPath || !empty($isWin)) {
|
||||
$params = str_replace('/', '\\', $params);
|
||||
}
|
||||
|
||||
$this->params = $params + $this->params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given path is absolute or relative.
|
||||
*
|
||||
* @param string $path absolute or relative path.
|
||||
* @return bool
|
||||
*/
|
||||
protected function _isAbsolutePath($path) {
|
||||
return $path[0] === '/' || $this->_isWindowsPath($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given path is Window OS path.
|
||||
*
|
||||
* @param string $path absolute path.
|
||||
* @return bool
|
||||
*/
|
||||
protected function _isWindowsPath($path) {
|
||||
return preg_match('/([a-z])(:)/i', $path) == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses out the paths from from the argv
|
||||
*
|
||||
|
@ -332,7 +359,7 @@ class ShellDispatcher {
|
|||
*/
|
||||
protected function _parsePaths($args) {
|
||||
$parsed = array();
|
||||
$keys = array('-working', '--working', '-app', '--app', '-root', '--root');
|
||||
$keys = array('-working', '--working', '-app', '--app', '-root', '--root', '-webroot', '--webroot');
|
||||
$args = (array)$args;
|
||||
foreach ($keys as $key) {
|
||||
while (($index = array_search($key, $args)) !== false) {
|
||||
|
|
|
@ -3,17 +3,17 @@
|
|||
* Task collection is used as a registry for loaded tasks and handles loading
|
||||
* and constructing task class objects.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since CakePHP(tm) v 2.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
App::uses('ObjectCollection', 'Utility');
|
||||
|
@ -64,7 +64,7 @@ class TaskCollection extends ObjectCollection {
|
|||
*
|
||||
* @param string $task Task name to load
|
||||
* @param array $settings Settings for the task.
|
||||
* @return Task A task object, Either the existing loaded task or a new one.
|
||||
* @return AppShell A task object, Either the existing loaded task or a new one.
|
||||
* @throws MissingTaskException when the task could not be found
|
||||
*/
|
||||
public function load($task, $settings = array()) {
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
/**
|
||||
* Bake Template for Controller action generation.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Console.Templates.default.actions
|
||||
* @since CakePHP(tm) v 1.3
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
?>
|
||||
|
||||
|
|
|
@ -4,18 +4,18 @@
|
|||
*
|
||||
* Allows templating of Controllers generated from bake.
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.Console.Templates.default.classes
|
||||
* @since CakePHP(tm) v 1.3
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
echo "<?php\n";
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue